Skip to content
Snippets Groups Projects
  1. Oct 02, 2020
    • Chun-wei Fan's avatar
      meson: Look for FreeType using CMake too · e50fbc1b
      Chun-wei Fan authored
      Some systems build FreeType using CMake rather than autotools (such as Visual
      Studio), which will give us CMake config files rather than pkg-config files, so
      if we can't find FreeType using pkg-config, try again using CMake.
      
      Please note that according to FreeType's docs/VERSIONS.TXT, the version we want
      when checking with CMake is 2.8.1 or later.
      e50fbc1b
  2. Sep 29, 2020
  3. Sep 21, 2020
  4. Sep 16, 2020
  5. Sep 15, 2020
  6. Sep 03, 2020
  7. Aug 30, 2020
    • Matthias Clasen's avatar
      Fix a problem in FcConfigSubstitute · e735abcf
      Matthias Clasen authored
      We were using the family names from the pattern without
      copying, and this was leading to a valgrind warning:
      ==53167== Invalid read of size 1
      ==53167==    at 0x58B0238: FcStrCaseWalkerNextNonBlank (fcstr.c:198)
      ==53167==    by 0x58B0238: FcStrCaseWalkerNextNonBlank (fcstr.c:186)
      ==53167==    by 0x58B02C7: FcStrCmpIgnoreBlanksAndCase (fcstr.c:281)
      ==53167==    by 0x58A4D44: FcHashTableFind (fchash.c:109)
      ==53167==    by 0x5895E76: FamilyTableAdd (fccfg.c:1634)
      ==53167==    by 0x589646A: FcConfigAdd.isra.0 (fccfg.c:1823)
      ==53167==    by 0x58988CF: IA__FcConfigSubstituteWithPat.part.0 (fccfg.c:2228)
      ==53167==    by 0x55F4F1A: pango_cairo_fc_font_map_fontset_key_substitute (pangocairo-fcfontmap.c:106)
      ==53167==    by 0x5B88AF6: pango_fc_default_substitute (pangofc-fontmap.c:1795)
      ==53167==    by 0x5B88D15: pango_fc_font_map_get_patterns (pangofc-fontmap.c:1850)
      ==53167==    by 0x5B88FC7: pango_fc_font_map_load_fontset (pangofc-fontmap.c:1952)
      ==53167==    by 0x5623627: pango_font_map_load_fontset (pango-fontmap.c:161)
      ==53167==    by 0x5621743: pango_context_get_metrics (pango-context.c:1782)
      ==53167==  Address 0x150d3450 is 0 bytes inside a block of size 10 free'd
      ==53167==    at 0x483B9F5: free (vg_replace_malloc.c:538)
      ==53167==    by 0x58ABE70: FcValueListDestroy (fcpat.c:147)
      ==53167==    by 0x5898A08: IA__FcConfigSubstituteWithPat.part.0 (fccfg.c:2203)
      ==53167==    by 0x55F4F1A: pango_cairo_fc_font_map_fontset_key_substitute (pangocairo-fcfontmap.c:106)
      ==53167==    by 0x5B88AF6: pango_fc_default_substitute (pangofc-fontmap.c:1795)
      ==53167==    by 0x5B88D15: pango_fc_font_map_get_patterns (pangofc-fontmap.c:1850)
      ==53167==    by 0x5B88FC7: pango_fc_font_map_load_fontset (pangofc-fontmap.c:1952)
      ==53167==    by 0x5623627: pango_font_map_load_fontset (pango-fontmap.c:161)
      ==53167==    by 0x5621743: pango_context_get_metrics (pango-context.c:1782)
      
      Use copies of the strings as keys in the hash table to avoid this.
      e735abcf
  8. Aug 27, 2020
  9. Aug 26, 2020
    • Akira TAGOH's avatar
      Integrate python scripts to autotools build · ef28c783
      Akira TAGOH authored
      Recently some python scripts has been added to the build toolchain for meson build support. but we don't want to maintain multiple files for one purpose. since autotools build support will be guradually discontinued, integrating those scripts into autotools would be better.
      ef28c783
  10. Aug 25, 2020
    • Matthias Clasen's avatar
      Fix up FC_LIKELY macros · ff7d314a
      Matthias Clasen authored
      __builtin_expect returns the same type as the expression,
      so enforce that we pass in a boolean expression.
      
      Pointed out by Emmanuele Bassi.
      ff7d314a
    • Matthias Clasen's avatar
      Fixup: Handle patterns without family · e117d676
      Matthias Clasen authored
      Pointed out by Akira Tagoh.
      e117d676
    • Matthias Clasen's avatar
      Use FC_UNLIKELY · 51d40491
      Matthias Clasen authored
      51d40491
    • Matthias Clasen's avatar
      Add FC_LIKELY and FC_UNLIKELY macros · 76699a48
      Matthias Clasen authored
      These wrap __builtin_expect where it exists.
      76699a48
    • Matthias Clasen's avatar
      Fixup: Promote ints to ranges when appropriate · 835f9bbd
      Matthias Clasen authored
      Pointed out by Akira Tagoh.
      835f9bbd
    • Matthias Clasen's avatar
      Use __builtin_expect in a few places · 148ebf98
      Matthias Clasen authored
      utf8 is extremely rare in the strings we see in
      font configuration, so this seems to be a good
      case for __builtin_expect.
      148ebf98
    • Matthias Clasen's avatar
      Use a hash table for families in FcConfigSubstitute · 13015a0a
      Matthias Clasen authored
      Use the same approach we used for FcFontMatch, and
      keep a hash table of family names. We only speed
      up the no-match case, for now.
      13015a0a
    • Matthias Clasen's avatar
      Speed up FcCompareLang and FcCompareBool · 7deb07e3
      Matthias Clasen authored
      Avoid FcCanonicalize here too.
      7deb07e3
    • Matthias Clasen's avatar
      Speed up FcConfigCompareValue · 09729c90
      Matthias Clasen authored
      Avoid FcValueCanonicalize when we can, to avoid
      unnecessary copying of FcValue structs.
      09729c90
    • Matthias Clasen's avatar
      Speed up FcConfigCompareValue · 9d4e5d0f
      Matthias Clasen authored
      Make FcConfigPromote use a switch instead of
      an if-else cascade, and avoid calling it when
      we can.
      
      Note that we need to add a case for integers
      in FcConfigCompareValue, since we are no longer
      promoting integers to doubles unconditionally.
      9d4e5d0f
    • Matthias Clasen's avatar
      Speed up fonthashint matching · 922168af
      Matthias Clasen authored
      When we don't need to differentiate between weak and strong,
      we can exit the loop in FcCompareValueList once we found a
      best match.
      
      This change helps reducing the amount of list walking we do
      for fonthashint, where careless config files end up creating
      lists with ~100 booleans :( We don't want to walk all those
      to the end, over and over again.
      
      We are already special-casing family, and the only other case
      where weak != strong, PostScript names, doesn't have long lists
      of values, so the limitation to weak == strong doesn't matter
      much in practice.
      922168af
    • Matthias Clasen's avatar
      Add a shortcut for FcQualAny matching · 1b0cb23a
      Matthias Clasen authored
      When checking whether a test matches a pattern,
      we cut the loop short for FcQualAll when we see
      the first non-matching value, but for FcQualAny
      we were always walking the full list. This patch
      cuts the loop short for FcQualAny when we see the
      first matching value.
      1b0cb23a
    • Matthias Clasen's avatar
      Use a hash table for family matching · 8022ab4a
      Matthias Clasen authored
      With the way typical font configurations look, matching the lists
      of families is the bottleneck for both FcFontMatch and FcFontSort.
      After installing the Noto fonts on my system, an innocent match
      pattern like "Cantarell 14" turns into a monster with a list of
      300 family names after calling FcConfigSubstitute().
      
      With this setup, every FcFontSort call takes 80-100 ms, which is
      entirely incompatible with using FcFontSort for anything interactive.
      And many font choosers render every font in itself, causing on average
      one FcFontSort call per font.
      
      On my system, it takes more than 20 seconds to open the GTK font
      chooser dialog, with frequent stalls when scrolling.
      
      This patch special-cases font families and replaces the list
      walking for comparison with a hash table lookup. With this
      patch, the FcFontSort time goes to ~10ms per call. Which is
      still not good enough for calling it dozens of times when
      scrolling, but a significant improvement.
      8022ab4a
    • Matthias Clasen's avatar
      Add a hash function for families · 05584363
      Matthias Clasen authored
      Add a hash function that behaves like family
      comparison: ignoring case and blanks. This
      will be used to replace the list walking for
      finding family matches with a hash table.
      05584363
    • Matthias Clasen's avatar
      Special-case some of the string walking code · 46d818df
      Matthias Clasen authored
      Make variants of FcStrCaseWalkerNext for the two
      common cases, delim == NULL and delim == " ", to
      speed things up.
      
      These are inner loops, and having the conditions
      as simple as possible helps.
      46d818df
    • Akira TAGOH's avatar
      abbd87ac
  11. Aug 23, 2020
  12. Aug 18, 2020
    • Jan Tojnar's avatar
      Turn unknown attributes into warning · 9133e799
      Jan Tojnar authored and Akira TAGOH's avatar Akira TAGOH committed
      As far as I can tell, fontconfig can recover from encountering an unknown attribute.
      And unknown elements already print a warning instead of an error, so let's make this a warning too.
      9133e799
  13. Aug 06, 2020
  14. Jul 31, 2020
  15. Jul 27, 2020
  16. Jul 22, 2020
  17. Jul 14, 2020
  18. Jul 07, 2020
Loading