Closed Bug 232716 Opened 21 years ago Closed 13 years ago

[xft] need to add 'Uncode' font(s) to a fontconfig search pattern

Categories

(Core :: Graphics, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jshin1987, Unassigned)

References

Details

(Keywords: intl)

Attachments

(1 obsolete file)

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.
Blocks: 232647
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.
Attached patch patch (obsolete) — Splinter Review
This patch will make Gfx:Xft a bit closer to Gfx:Win.
Product: Core → Core Graveyard
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.
Assignee: jshin1987 → nobody
Status: NEW → UNCONFIRMED
Component: GFX: Gtk → Graphics
Ever confirmed: false
Product: Core Graveyard → Core
QA Contact: ian → thebes
Attachment #151799 - Attachment is obsolete: true
I suspect this is now fixed.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: