• Behdad Esfahbod's avatar
    [fc-lang] Make LangSet representation in the cache files stable · ffd6668b
    Behdad Esfahbod authored
    Fontconfig assigns an index number to each language it knows about.
    The index is used to index a bit in FcLangSet language map.  The bit
    map is stored in the cache.
    Previously fc-lang simply sorted the list of languages and assigned
    them an index starting from zero.  Net effect is that whenever new
    orth files were added, all the FcLangSet info in the cache files would
    become invalid.  This was causing weird bugs like this one:
    With this commit we fix the index assigned to each language.  The index
    will be based on the order the orth files are passed to fc-lang.  As a
    result all orth files are explicitly listed in Makefile.am now, and
    new additions should be made to the end of the list.  The list is made
    to reflect the sorted list of orthographies from 2.6.0 released followed
    by new additions since.
    This fixes the stability problem.  Needless to say, recreating caches
    is necessary before any new orthography is recognized in existing fonts,
    but at least the existing caches are still valid and don't cause bugs
    like the above.
fclang.c 16.2 KB