[Fontconfig] Bitmap font resizing

Behdad Esfahbod behdad at behdad.org
Sun Dec 30 17:26:00 PST 2012

On 12-12-29 06:24 PM, Behdad Esfahbod wrote:
>> > I'm not sure about using the 'dpi' and 'size'
>> > properties to calculate the scaling factor because these properties will not
>> > always be there.
> Agreed.  The target="font" approach is the right way to do it.

This is now in master too, and I really like it.  I can now do a config like
this and it all works:

<match target="font">
  <test name="scalable" compare="eq">
  <edit name="pixelsizefixupfactor" mode="assign">
      <name target="pattern">pixelsize</name>
      <name target="font"   >pixelsize</name>
  <edit name="matrix" mode="assign">
        <name>pixelsizefixupfactor</name> <double>0</double>
        <double>0</double> <name>pixelsizefixupfactor</name>
  <edit name="size" mode="assign">

The nice thing about this config is that it doesn't touch the pixelsize so
clients that directly pass that to FreeType will continue working.  Clients
that support matrix on bitmaps will pickup the resizing.

All that is left is to come up with a sane default config.  I'll give it a try
and report back.


More information about the Fontconfig mailing list