Load multi language fonts at the same time
Hi guys,
i want to show multi languages(English, HEBREW, Thai, ARABIC, Chinese) as a selection list,
i find something about insert substitution
Quote:
void QFont::insertSubstitution ( const QString & familyName, const QString & substituteName )
and
void QFont::insertSubstitutions ( const QString & familyName, const QStringList & substituteNames )
but failed , below is my code of loading fonts
first , i'm using the debug message to show the support family, i don't know if this is a proper way to find the support font,
please correct me if it's a wrong solution
Code:
/* output the support font */
after get the debug message , i'm using tool "makeqpf" to create qpf2 files such as
wenquanyi_micro_hei(for chinese), sans_serif(for HEBREW, ARABIC), waree(for Thai)
and i need to load all of them to show the correct words, but failed
In this way, i can show the chinese, english, hebrew, arabic but not thai,
Code:
QFont font1
("WenQuanYi Micro Hei [prerendered]",
14,
50,
FALSE);
subs << "DejaVu Sans [prerendered]" << "Waree" ;
font1.insertSubstitutions("WenQuanYi Micro Hei [prerendered]", subs);
qApp->setFont(font1);
qDebug() << font1.family() ;
qDebug() << sl.isEmpty() ;
qDebug() << sl ;
qDebug() << font1.substitutes("WenQuanYi Micro Hei [prerendered]") ;
and i just make another test to change the font family
Code:
QFont font1
("DejaVu Sans [prerendered]",
14,
50,
FALSE);
subs << "WenQuanYi Micro Hei [prerendered]" << "Waree" ;
font1.insertSubstitutions("DejaVu Sans [prerendered]", subs);
qApp->setFont(font1);
if i insert "DejaVu Sans" first, when i open the multi language page,
the program crashed, i guess it's because the program can't show chinese and crashed,
i just can't figure it out why this happened ,
in my eyes , that two ways above was almost the same, can anyone explain for me?
and the final goal is to show all the language at the same time
so i need load waree and show it correctly, please help
thanks
Re: Load multi language fonts at the same time
hello~ guys ,
is there someone who know this issue ?
i've also tried to read the "Thai" font "Waree" like below
Code:
QFont font1
("Waree",
14,
50,
FALSE);
in this way, i can see the "Thai" font in my program,
but the others disappear, (Hebrew, Arabic, Traditional Chinese) all remain in blank
please help !
any reply will be appreciated!!