Summary: | FcMatch() returns style in wrong language | ||
---|---|---|---|
Product: | fontconfig | Reporter: | Behdad Esfahbod <freedesktop> |
Component: | library | Assignee: | Akira TAGOH <akira> |
Status: | RESOLVED FIXED | QA Contact: | Behdad Esfahbod <freedesktop> |
Severity: | normal | ||
Priority: | medium | CC: | akira, fontconfig-bugs, freedesktop, mark.russell, uzadow |
Version: | 2.7 | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Behdad Esfahbod
2010-04-20 20:47:58 UTC
Behdad, what's the progress here? Can I help somehow? Or is it fixed yet -- can I download the patch somewhere? Not yet. Working on it this week. (In reply to comment #2) > Not yet. Working on it this week. Ok, thanks a lot! Hi Behdad. Anything new on this? Not yet, got stuck with harfbuzz hacking. I'll give fontconfig another push soon. From a mail I sent today: This is how I think this should be fixed: Add a new element FC_NAME_LANG="namelang". In FcFreeTypeQuery, perhaps set FC_NAME_LANG to the intersection of FC_FAMILY_LANG and FC_STYLE_LANG. Or maybe don't. Not going to use this directly. In FcConfigDefault, if FC_NAME_LANG is empty, fill it in from default locale language. Then if FC_FAMILY_LANG is empty, copy it from FC_NAME_LANG. Same for FC_STYLE_LANG and FC_FULLNAME_LANG. This way, FC_NAME_LANG is how the user will request names in a particular language. In FcFontRenderPrepare, when deciding what FC_FAMILY and FC_STYLE to choose, choose the first one that has a _LANG equivalent present in the query pattern's respective _LANG element. That should do it. the proposed patch: http://cgit.freedesktop.org/~tagoh/fontconfig/commit/?h=bz27765 updated a bit to add *lang object to the pattern like the original behavior. I guess we should change the code for FcFontList() too. updated fclist.c too: http://cgit.freedesktop.org/~tagoh/fontconfig/commit/?h=bz27765 The patch will change the behavior compared to current one. particularly with: http://cgit.freedesktop.org/~tagoh/fontconfig/tree/src/fcdefault.c?h=bz27765#n196 http://cgit.freedesktop.org/~tagoh/fontconfig/tree/src/fclist.c?h=bz27765#n382 the result on LANG=ja_JP say will looks like: (On fontconfig-2.9.0) /usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc: 文泉驛點陣正黑,WenQuanYi Zen Hei Sharp,文泉驿点阵正黑:style=Regular (with patch) /usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc: WenQuanYi Zen Hei Sharp,文泉驛點陣正黑,文泉驿点阵正黑:style=Regular Anyway, that should be trivial. committed with 7587d1c9. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.