1. 25 Aug, 2020 12 commits
    • 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
  2. 23 Aug, 2020 1 commit
  3. 18 Aug, 2020 1 commit
    • Jan Tojnar's avatar
      Turn unknown attributes into warning · 9133e799
      Jan Tojnar authored
      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
  4. 06 Aug, 2020 1 commit
  5. 31 Jul, 2020 2 commits
  6. 27 Jul, 2020 1 commit
  7. 22 Jul, 2020 1 commit
  8. 14 Jul, 2020 1 commit
  9. 07 Jul, 2020 2 commits
  10. 02 Jul, 2020 1 commit
  11. 01 Jul, 2020 4 commits
  12. 24 Jun, 2020 1 commit
  13. 02 Jun, 2020 1 commit
  14. 25 May, 2020 2 commits
  15. 19 May, 2020 1 commit
  16. 12 May, 2020 1 commit
    • Akira TAGOH's avatar
      Fix cache conflicts on OSTree based system · fdbd9d13
      Akira TAGOH authored
      mtime isn't reliable to detect updates of fonts on OSTree based system
      since they reset mtime to 0 for system files.
      Due to this, there are the situation likely to happen where mtime is
      newer but content is older.
      
      Fortunately, OSTree based system requires reboot to deploy changes. so
      we can assume we won't see any changes on system fonts. so system caches
      are always up-to-date. we can ignore meta data for system fonts in
      user caches.
      fdbd9d13
  17. 28 Apr, 2020 1 commit
  18. 10 Apr, 2020 1 commit
  19. 28 Mar, 2020 1 commit
    • Nicolas Mailhot's avatar
      Use an URN for DTD ID · 9c46ef4a
      Nicolas Mailhot authored
      XML tools interpret “fonts.dtd” as a relative path.
      
      Unfortunately, that can not work now that the configuration is spread over
      multiple system-dependant directories, without a common relative path to this
      file. And, an absolute path can not be defined in a system-independant way.
      System independance is a requirement to share config files between systems.
      
      Therefore, replace the broken relative path by a formal URN, that will work the
      same way on all systems, without network access.
      
      This makes the DTD registerable with commands like:
      $ xmlcatalog --noout --add system \
                                 "urn:fontconfig:fonts.dtd" \
                                 "file:///usr/share/xml/fontconfig/fonts.dtd" \
                                 /etc/xml/catalog
      
      That enables easy config file checking:
      $ xmllint --loaddtd ${config_file} >/dev/null
      9c46ef4a
  20. 23 Mar, 2020 1 commit
    • Akira TAGOH's avatar
      Fix assertion in FcCacheFini() again · 6f6b3978
      Akira TAGOH authored
      The previous fix in fbc05949 was wrong. reverting.
      
      When reading older caches, FcDirCacheMapHelper() returns FcFalse and
      it became the return value from FcDirCacheProcess() too, which is wrong.
      Actually one of calls for FcDirCacheMapHelper() should be successfully
      finished and closure should have a valid pointer for cache.
      
      Due to this, the proper finalization process wasn't running against
      cache in closure.
      
      Fixes fontconfig/fontconfig#227
      6f6b3978
  21. 19 Mar, 2020 1 commit
  22. 27 Feb, 2020 1 commit
  23. 26 Feb, 2020 1 commit