From: Eon S. Jeon Date: Fri, 19 Jul 2013 05:07:02 +0000 (-0400) Subject: Improved font caching X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=33ad83d49213749f4fcec850327f57a33ca8b921;hp=33ad83d49213749f4fcec850327f57a33ca8b921;p=st.git Improved font caching I made a patch that improves the performance of font caching mechanism. This is based on a funny behaviour of FontConfig: it was handling FcCharSet in a somewhat unexpected way. So, we are currently adding "a character" to a new FcCharSet, and then add it to a FcPattern. However, if we toss the FcPattern to FontConfig, it loads the entire language(charset) that contains the character we gave. That is, we don't always have to load a new font for each unknown character. Instead, we can reused cached fonts, and this significantly reduces the number of calls to extremely slow FontConfig matching functions. One more thing. I found that, in libXft, there's a function called XftCharExists. XftCharIndex internally calls this function, and does more stuffs if the character does exist. Since the returned index is never used in st, we should call XftCharExists instead of XftCharIndex. Please note that I already made this change in the patch. ---