10-scale-bitmap-fonts.conf 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?xml version="1.0"?>
  2. <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
  3. <fontconfig>
  4. <!--
  5. If font is bitmap, calculate scale factor.
  6. Note that color bitmap fonts have scalable=true, while
  7. non-color ones have scalable=false. Both groups have outline=false.
  8. -->
  9. <match target="font">
  10. <test name="outline" compare="eq">
  11. <bool>false</bool>
  12. </test>
  13. <edit name="pixelsizefixupfactor" mode="assign">
  14. <divide>
  15. <name target="pattern">pixelsize</name>
  16. <name target="font" >pixelsize</name>
  17. </divide>
  18. </edit>
  19. </match>
  20. <!--
  21. For non-scalable bitmap fonts (ie. non-color), skip
  22. minor scaling if hinting is enabled.
  23. -->
  24. <match target="font">
  25. <test name="outline" compare="eq">
  26. <bool>false</bool>
  27. </test>
  28. <test name="scalable" compare="eq">
  29. <bool>false</bool>
  30. </test>
  31. <test name="hinting" compare="eq">
  32. <bool>true</bool>
  33. </test>
  34. <edit name="scalingnotneeded" mode="assign">
  35. <and>
  36. <less>
  37. <name>pixelsizefixupfactor</name>
  38. <double>1.2</double>
  39. </less>
  40. <more>
  41. <name>pixelsizefixupfactor</name>
  42. <double>0.8</double>
  43. </more>
  44. </and>
  45. </edit>
  46. </match>
  47. <match target="font">
  48. <test name="scalingnotneeded" compare="eq">
  49. <bool>true</bool>
  50. </test>
  51. <edit name="pixelsizefixupfactor" mode="assign">
  52. <double>1.0</double>
  53. </edit>
  54. </match>
  55. <!--
  56. If we *are* going to scale, go ahead and do it.
  57. -->
  58. <match target="font">
  59. <test name="outline" compare="eq">
  60. <bool>false</bool>
  61. </test>
  62. <test name="pixelsizefixupfactor" compare="not_eq">
  63. <double>1.0</double>
  64. </test>
  65. <edit name="matrix" mode="assign">
  66. <times>
  67. <name>matrix</name>
  68. <matrix>
  69. <name>pixelsizefixupfactor</name> <double>0</double>
  70. <double>0</double> <name>pixelsizefixupfactor</name>
  71. </matrix>
  72. </times>
  73. </edit>
  74. <edit name="size" mode="assign">
  75. <divide>
  76. <name>size</name>
  77. <name>pixelsizefixupfactor</name>
  78. </divide>
  79. </edit>
  80. </match>
  81. </fontconfig>