When you have an Chinese document with a few non-Latin characters (say, Devanagari, Tamil, Mathematical symbols, Old Italic), the list of fonts returned by fontconfig is not likely to include fonts for Devanagari or Tamil even though you have fonts covering them. Fixing bug 204586 and bug 229394 can make this better in some situations, but that doesn't work always. Fixing bug 204586 doesn't solve this particular problem because Devanagari and Tamil have to be explicitly tagged with 'lang'/xml:lang. Moreover, if characters in question are some 'language-neutral' symbols (say, Mathematical symbols), we can't tell authors to tag them with lang/xml:lang. Bug 229394 could work in all cases, but the only platform where we have that implemented doesn't have UI for that and it's undocumented so that we can't expect end-users to do that (see bug 232657 comment #2). In addition, on Windows, what I want to implement in bug 208479 is implemented so that the situation is better. However, it's all but impossible to do the equivalent on Gfx:Xft because the pattern for fontconfig is not constructed per character. There are a couple of things we can do here. 1. When we construct a font pattern, we can map the first character to a langGroup and add the font for that langGroup to the pattern. This is not perfect but could have a similar effect to what we have on Gfx:Win (see http://lxr.mozilla.org/seamonkey/source/gfx/src/windows/nsFontMetricsWin.cpp#3450). Perhaps, I have to do that in bug 208479. 2. Even #1 could fail because 1) we only have a handful of langGroups and there are a huge number of scripts not covered by our current set of langGroups (actually scriptGroups) 2) the first character may happen to be covered by one of our existing langGroups while most of characters in a chunk are not. In the first case, we can solve the problem in bug 208479 by using x-unicode font as 'fit-them-all' fallback. For the second case, we explicitly have to add fonts for 'x-unicode' to the pattern, which is this bug. Gfx:Win effectively does this already and Gfx:Xft should do that, too.
bug 232657 comment #16 explains why we need to add the feature. see also http://www.google.com.sg The page has Latin, Chinese and Tamil without 'lang' specified.
Created attachment 151799 [details] [diff] [review] patch This patch will make Gfx:Xft a bit closer to Gfx:Win.
The code modified by the patch no longer exists, but I don't know whether the change request is still relevant. Relabeling Core:Graphics for triage.
I suspect this is now fixed.