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
You can find details on:
and his mail:
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
OK, I would explain more intensively to show what the individual patch would
1. Try to use emebed bitmap font within Chinese font instead of rendering from
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
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.
Patch 1: http://firefly.idv.tw/setfont-xft/patches/fontconfig/fontconfig-2.2.1-
Support Chinese font name, which you are planning to.
Patch 2: http://firefly.idv.tw/setfont-xft/patches/fontconfig/fontconfig-2.2.1-
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-
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.
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
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:
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.
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 ***