[MPlayer-users] Use -ass without fontconfig?

Raimund Steger rs at mytum.de
Sun Apr 28 21:12:22 CEST 2013


Reimar Döffinger wrote:
> On 14.04.2013, at 13:59, Nicolas George
> <nicolas.george at normalesup.org> wrote:
>> Le quartidi 24 germinal, an CCXXI, wm4 a écrit :
>>> Yeah, fontconfig does the same as you do: assume Windows is a
>>> Linux distro.
>>
>> fontconfig assumes that the system administrator is capable of
>> following a simple directive after installing fonts, no more no
>> less. Your sentence only makes sense if you assume that windows
>> admins are not capable of that.
>
> Desktop systems do not have administrators. Not to mention that fonts
> are very rarely installed manually, why should Windows installers for
> fonts rebuild a fontconfig cache? Now you could say that Windows

At the moment, the best option on a "sysadmin-less" Windows box is 
probably if application installers initialized the cache at installation 
time and put the result in their program directory or in the Common 
Files Folder. If a couple of fonts are added later, these can be picked 
up by the user cache without a huge performance impact.


> the biggest question to me is: wtf is fontconfig doing that it takes
> more than a few seconds to scan a few 100 fonts? We are talking about

fc-cache spends most of its time loading glyphs and computing hash 
values. This should take about the same amount of time on Windows and 
Unix. I've run a typical 'fc-cache -fv' command through the profiler:

sun2:fontconfig)collect env 
FONTCONFIG_FILE=$HOME/testing/etc-fonts/fonts.conf FC_DEBUG=128 
$HOME/testing/fontconfig-git/bin/fc-cache -fv
[...]
caching, new cache contents: 262 fonts, 0 dirs
/home/rs/tmp/fc-test/cache: cleaning cache directory
/home/rs/testing/fontconfig-git/bin/fc-cache: succeeded

sun2:fontconfig)er_print -calltree test.2.er
Functions Call Tree. Metric: Attributed User CPU Time

Attr.      Name
User CPU
   sec.
12.829     +-<Total>
12.829       +-_start
12.829         +-main
12.829           +-scanDirs
12.829           |  +-FcDirCacheRead
12.829           |    +-FcDirCacheScan
12.819           |      +-FcDirScanConfig
12.819           |      |  +-FcFileScanConfig
12.819           |      |    +-FcFileScanFontConfig
12.819           |      |      +-FcFreeTypeQuery
12.719           |      |        +-FcFreeTypeQueryFace
  6.745           |      |        |  +-FcFreeTypeCharSetAndSpacing
  6.745           |      |        |  |  +-FcFreeTypeCharSetAndSpacingForSize
  6.705           |      |        |  |    +-FcFreeTypeCheckGlyph
  6.695           |      |        |  |    |  +-FT_Load_Glyph
  6.565           |      |        |  |    |    +-Load_Glyph
[...]
  5.694           |      |        |  +-FcHashGetSHA256DigestFromMemory
  5.674           |      |        |  |  +-FcHashComputeSHA256Digest
[...]
  0.              +-sleep
  0.                +-___nanosleep


Basically, everything underneath FT_Load_Glyph is FreeType's time.
The SHA256 thing is a rather new addition, see 
https://bugs.freedesktop.org/show_bug.cgi?id=50733.


Raimund



More information about the MPlayer-users mailing list