Re: Sharing a FcConfig object between processes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 26, 2023 at 6:40 PM Idriss Fekir <mcsm224@xxxxxxxxx> wrote:
>
> Hi,
>
> In Gimp, a Custom config xml string is used to rename some fonts in the
> FcConfig object which are problematic with Pango.
>
> Gimp supports plugins (and has several fundamental plugins, such as
> saving to a PDF file), each plugin runs in its **own process**.
>
> This means that any plugin (such as the Pdf export plugin) will get some
> fonts wrong, due to not having the custom xml renaming string in its
> FcConfig.
>
> Apart from sharing the xml string and doing the renaming on the FcConfig
> object every time  plugin which needs it is run, Is it possible to share
> an FcConfig Object between several processes?

processes? not threads? No, fontconfig doesn't support sharing
FcConfig among processes.
But if renaming family names is the main purpose, you can put
something like this and updating fontconfig caches once may help.

<fontconfig>
  <match target="scan">
    <test name="family">
      <string>Bad Family Name</string>
    </test>
    <edit name="family" mode="assign">
      <string>Good Family Name</string>
    </edit>
  </match>
</fontconfig>

This is supposed to be "renaming" family name to something in edit. If
you prefer to keep the original one, you may want to use "append" or
"prepend" instead of "assign". Please see the document for more
details.
Please note that this only updates the family name in the fontconfig
cache. If applications tries to open a font directly and go through
meta data from freetype say, you'll still see the original name.

Hope that helps,
-- 
Akira TAGOH




[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux