2008年8月8日 星期五

KDE4 and libqt4 font patches (English version)

(繁體中文版在此)
First, Forgive my poor English.
I'll try to show you
Why libqt4 need patches ?
This is kde4.04: I used an openSUSE 11.0 KDE4 Live CD to install this KDE4 system.
Looks nice, is't it?

After fully updated, I install gcin and ttf-arphic-uming, so I can input Chinese words, and uming is an Chinese font that can be used for Chinese both traditional and simplified.



Here you can see something strange. Compared to the same page browsed with firefox3, we notice that all Chinese characters have no bold face.


Here's another problem, uming has embeddedbitmap font in it, which is more readable for small fonts.But you can see that Chinese-named folder use antialias-style, that's not so good for a low resolution screen, fonts is not black enough.


Now, I will change locale to zh_TW and install kde4-l10n package, That's the real desktop we will use.

You can see all fonts are not the same. When use zh_TW locale, all fonts will match to Chinese font include English character.-->But this is another topic...





Even Konsole use Chinese font, but most Chinese fonts are not monospace.
So some words cannot show correctly. Like "Deskto"p"", "p" is cut into half like an "l".
So after installing KDE, The first thing you have to do is to change font setting like this:

Then




OK, Now let's get into topic.
We still need qt4 to show embeddedbitmap font and fake bold face.
Belly had make some patches for qt4 font rendering, see the thread below:
http://moto.debian.org.tw/viewtopic.php?t=13003 (In Chinese)
You can follow the links above to get these patches.
basic.diff : improve hint-style matching
embeddedbitmap.diff : embeddedbitmap support
add-missing-style.diff : add bold-style to fonts that do not have a real bold-style
synthetic-bold.diff : use freetype to bolder font stroke
ftlcdfil.diff : Lcd Subpixel Filtering (from David Turner)
ignore-global-advance.diff (from Siyuan.nz)
I have test these patches to patch libqt4-4.4.1 in openSUSE Build Service.
http://download.opensuse.org/repositories/home:/swyear/openSUSE_11.0/
If you use openSUSE and want to test these patches,
add my repository and update libqt4-related packages.
Seem work fine, KDE looks beautiful again.






Compare to the screenshots before patching,
You will know what I said.
Chinese fonts can use embeddedbitmap fonts and can have bold-style,
this is not only an eye-candy effect, but a really need for Chinese users.

These patches may need more test and refine,
and we need someone's (that's you!) help to merge into upstream.
If you want to help ( testing, discussing or submiting to upstream or anything)
goto moto's forum to contact with us.
http://moto.debian.org.tw/viewtopic.php?t=13003

A known issue:(for openSUSE 11.0)
If you enable subpixel-hinting in freetype2,
for example, You upgrade your freetype2 from M17N repository,
Chinese characters will disappear on desktop and system tray like below:


Make sure you use freetype2 shiped with openSUSE 11.0.
Disable M17N repo, and run
# zypper in -f freetype2

You'd better run
# ldconfig

again.
I'm Not sure what's the problem.
Plasma? libqt4-4.4.1? or caused by some of these patches?
I'll try to re-diff these patches for libqt4-4.4.0 <--the version openSUSE 11.0 shiped with. And see if these patches work for KDE 4.1. maybe next week...


Let's enjoy KDE4 together!


I'll submit these to openSUSE bugzilla
https://bugzilla.novell.com/show_bug.cgi?id=374066

沒有留言: