[bt-devel] again: Font problems

Martin Gruner bt-devel@crosswire.org
Thu, 3 May 2001 19:43:29 +0200


> > What means "wrong charset"?
> > Qt does not know which charset encoding we want.
>
> Qt uses Unicode.
> It maps greek fonts normally into another area of the fontmap than latin1.
> But because we do want to have latin1 and the greek chars are not mapped
> internally to latin1 but to iso8859-7 we do get normal latin1 characters
> (probably Helvetica).
> Greek fonts are mapped into another rea than latin1 fonts, so we get the
> wron characters.

This may be correct but still I don't understand it.
The characters we use from sword are 1 Byte values from 0 to 255.
They are put into QString via fromLocal8Bit(). That means they are mapped to 
unicode encoding via iso8859-1 (at least for me). No Problem.
The characters themselves are not greek, they are just chars. So they should 
be fine for output with iso8859-1 fonts. ?

The problem already occurs in the font chooser dialog. QT detects some 
encoding conflict and therefore will not let us use the desired fonts! That's 
why the output in the presenters is displayed in helvetica.

>From the QT documentation:

"void QFont::setCharSet ( CharSet charset )
Sets the character set encoding (e.g. Latin1). 
If the character set encoding is not available another will be used for 
drawing. For most non-trivial applications you will probably not want this to 
happen since it can totally obscure the text shown to the user. This is why 
the font matching algorithm gives high priority to finding the correct 
character set."

Could you maybe try to ask some qt developers about this matter? Would that 
be possible? It also affects other applications using different encodings...

Martin

BTW: shouldn't the text from sword rather be mapped to unicode using 
fromLatin1(), since that is how the modules were encoded? [Just a question, 
should not affect this bug]