Bug 102 - Patch for fontconfig and Xft2 when redering CJK characters
Summary: Patch for fontconfig and Xft2 when redering CJK characters
Status: CLOSED DUPLICATE of bug 2420
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xft (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: high normal
Assignee: Keith Packard
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-16 11:12 UTC by Wang
Modified: 2011-10-15 17:14 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Wang 2003-07-16 11:12:45 UTC
Currently, Xf2 and fontconfig does not support Chinese as well as it should be. 
So, somebody has made his own patch for fontconfig and Xft2 when rendering 
Chinese.

You can find details on:
http://firefly.idv.tw/setfont-xft/patches/

and his mail:
firefly@firefly.idv.tw
Comment 1 Keith Packard 2003-08-11 19:03:33 UTC
If you could submit individual bugs with a description of the problem and
solution, I'd have a chance of understanding what issues need fixing in each
library.  I already have plans for extracting local family and style names so
that applications can present them to users, I'm not sure what other things need
fixing.
Comment 2 Wang 2003-08-11 22:15:49 UTC
OK, I would explain more intensively to show what the individual patch would 
do.

Xft2 Patch===============
http://firefly.idv.tw/setfont-xft/patches/Xft2/xft-2.1.2-CJK-fixwidth-
embededbitmaps-artificial_bold-20030606.patch
1. Try to use emebed bitmap font within Chinese font instead of rendering from 
vectors.
2. Many Chinese font does not supply bold or italic style within itself. When 
bold style is requested during rendering, Xft2 will likely render it as normal 
style. The patch will try to generate dynamiclly bold style from normal style
(bold emulation).
3. Xf2 uses font->public.max_advance_width to detect the width which will be 
used in rendering. But it is not applicatable in Chinese, as Chinese font have 
half-width and full-width characters within single font. The patch will change 
to glyphslot->metrics.vertAdvance and glyphslot->metrics.horiAdvance.

fontconfig===============
Patch 1: http://firefly.idv.tw/setfont-xft/patches/fontconfig/fontconfig-2.2.1-
multifamily-20030618.patch
Support Chinese font name, which you are planning to.
Patch 2: http://firefly.idv.tw/setfont-xft/patches/fontconfig/fontconfig-2.2.1-
include_CJK_charmaps-20030626.patch.gz
fontconfig can use font with unicode cmap or native cmap. With the latter one, 
it will convert native cmap into unicode. But it does not include the cmap of 
CJK, so supporting Chinese fonts which only have native cmap but not unicode 
cmap would be impossible. The patch gives you such a cmap.
Patch 3: http://firefly.idv.tw/setfont-xft/patches/fontconfig/fontconfig-2.2.1-
fclang-miss_1_percent-20030617.patch
Some very old font does not fill the cmap completely. That means, maybe very 
few characters supplied with the font is missing in the font. This patch allow 
1% characters missing in the font. Of course, this patch may not need to be 
merged, as the case rarely occurs.
Comment 3 Won-Kyu Park 2003-09-04 11:26:44 UTC
recently I reported a bug related with this report on the bugzilla of the xfree86

Summary: crashed rendering result with embeded bitmap(sbit) and anti-aliased text
http://bugs.xfree86.org/show_bug.cgi?id=649

and I found that the crashed rendering bug is fixed on the Xft2 2.1.2

but some unexpected results are also found on the mozilla related with embeded
bitmaps (sbit). I'll take screenshots and post it on.

and Akito also makes some CJK related patches several month ago:
http://www.kde.gr.jp/~akito/patch/fcpackage/
Comment 4 Wang 2003-09-04 16:38:50 UTC
In fact, firefly's patch is based on Akito's, only that there are some 
mistakes on Chinese in the one Akito has made. Firefly has corrected this 
mistakes, and applied some more tweaks on visual effects.
Comment 5 Keith Packard 2005-03-01 20:40:36 UTC
The only Xft related patch here is the artificial bold bitmap code which is
covered by bug 2420.  The other issues are in fontconfig and have mostly been
fixed in version 2.3.

*** This bug has been marked as a duplicate of 2420 ***


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.