Bug 379644

Summary: qt3 doesn’t find fonts supporting IPA automatically
Product: [openSUSE] openSUSE 10.3 Reporter: Lars Müller <lmuelle>
Component: KDEAssignee: E-mail List <kde-maintainers>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: wstephenson
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 10.3   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Example file including UTF-8 chars
qt3-font-problem.png

Description Lars Müller 2008-04-14 11:43:33 UTC
I'm using UTF-8 characters as part of my signature.  I've tried to add the signature with the help of the kmail configuration dialog.

a) The characters are damaged already after paste into the application.
b) Also the signature of the resulting mails is broken.
Comment 1 Lars Müller 2008-04-14 11:44:46 UTC
Created attachment 207725 [details]
Example file including UTF-8 chars
Comment 2 Will Stephenson 2008-04-15 11:41:37 UTC
Seems to be any qt3 text entry widget.  It works in Qt4 apps.
Comment 3 Will Stephenson 2008-04-15 11:44:32 UTC
Reassigning to team while I try to figure out if this should work.

testcase:

#include <qapplication.h>
#include <qtextedit.h>

int main(int argc, char** argv)
{
    QApplication app(argc,argv);
    QTextEdit edt;
    edt.show();
    return app.exec();
}
Comment 4 Will Stephenson 2008-04-16 12:33:06 UTC
NB also an issue in Factory.  I tried just loading the example file in kwrite, and the chars from the utf8 range are displayed as spaces.  I don't know if it's a font problem or what.  Problem persists whether the paste came from firefox or KDE 4 apps (which don't have a problem with it). 

When KDE4 and KDE3 use the same font, the utf8 chars are rendered correctly in KDE 4, and boxes or blanks in KDE 3 (tested with Cumberland AMT and Monospace)
Comment 5 Mike Fabian 2008-04-22 13:55:18 UTC
Created attachment 209607 [details]
qt3-font-problem.png
Comment 6 Mike Fabian 2008-04-22 14:15:04 UTC
In the screenshot attached to comment #5 you see that it works in Qt3
and KDE3 applications if a font is choosen which has *all* needed
characters. Qt3 is very bad in searching for fallback fonts,
especially for “exotic” stuff like IPA or symbols. Qt3 assumes that a
font which has a certain test character (or in some cases a few test
characters) for a certain region of Unicode has this region complete.

This assumption usually works for Japanese, if one Japanese Kanji is
there, one can be reasonably sure that the others will be there as
well. Same for Russian, Thai, etc.…  There are not many fonts
which have only a few Cyrillic characters but not all of them
(But even this is a problem sometimes with Qt3!).

But for symbols and IPA this assumption is idiotic.  There is no
reason to assume that a font which has ☺ must also have ☹.

For IPA, which is what Lars uses in his signature, (“Lars Müller
[ˈlaː(r)z ˈmʏlɐ]”) Qt3 doesn’t even try to check whether a font has
any IPA characters.  Either the user selected font or the fontconfig
selected default font already has IPA or it won’t work.

Qt4 is much better in this respect, it has a single glyph fallback
(something which GTK2 had for many years already). I.e.  it check for
each glyph whether it is already available in the fonts used so far or
searching yet another fallback font for that glyph is necessary.



Comment 7 Mike Fabian 2008-04-22 14:21:19 UTC
In the screenshot you see

    /usr/lib/qt3/bin/qtconfig → set to use “DejaVu Serif”
    KWrite                    → set to use “DejaVu Sans Mono”
    qtextedit-will            → uses “DejaVu Sans” because I started
                                 it in de_DE.UTF-8 locale
                                 and this is my default font
                                 for this locale.

To workaround this Qt3 problem, I recommend to use fonts like
the DejaVu series which have IPA and tons of symbols which makes
the problem “mostly” go away.

“mostly” because some very exotic symbols are still missing
in some variants of the DejaVu fonts. “DejaVu Sans”
has more than the others, “DejaVu Serif” and “DejaVu Sans Mono”
lack some glyphs.

And you should probably avoid the Condensed and Light variants
of DejaVu, these lack more glyphs and don’t render well
anyway (they still lack good hinting instructions).

               
Comment 8 Mike Fabian 2008-04-23 16:44:21 UTC
I think this is not really fixable for qt3 → WONTFIX.

As a workaround one can used fonts which are known to support IPA
like the DejaVu fonts.