[Interest] Multi language/font display in qt4

Simone cjb.sw.nospam at gmail.com
Sun Jan 26 14:04:32 CET 2014


Thank you Oliver,
One thing, i saw that exactly the same application i can run on windows and see also chinese fonts (with dejavu sans as application font). On my embedded target with the same font chinese chars are not displayed (i can see an empty white square).

Why?
Isn't working with the same logic on windows?

Bye
Simone





> Il giorno 26/gen/2014, alle ore 13:43, Till Oliver Knoll <till.oliver.knoll at gmail.com> ha scritto:
> 
>> Am 26.01.2014 um 12:57 schrieb Simone <cjb.sw.nospam at gmail.com>:
>> 
>> ...
>> Are you sure of that?
>> I read some article about fontconfig and seems that there is a solution, but i have not understood how it work.
> 
> Basically your problem is the following:
> 
> * If the character to be displayed is in the "Latin 1" Unicode range, then use font A
> 
> * Else (character is in "Asian language" Unicode range): use font B
> 
> I am pretty sure that there is no Qt API which would let you define such a "Unicode range"-dependent font.
> 
> So either you could try to get hold of some underlying (fontconfig) API which might (?) provide such a feature, or you would pre-process each text before you pass it to Qt to render it as (HTML) text.
> 
> That is, you would iterate over each character and whenever the Unicode range changes, you would set the font accordingly. Something like the following could work:
> 
> <span font="A">Latin 1 text followed by </span><span font="B">asian characters.</span>
> 
> Depending on the Qt API used to display text (e.g. QLabel::setText) that  HTML formatting is then evaluated/considered.
> 
> Cheers,
>  Oliver
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list