PDA

View Full Version : After changing QT_QWS_FONTDIR , QT program not working?



lllturtle
8th November 2011, 07:20
Hi guys,

I found something about QT_QWS_FONTDIR
after checked ARM environment setting i got

export QT_QWS_FONTDIR=/usr/share/fonts/X11/Type1

no matter i add new font file into this path or change the QT_QWS_FONTDIR font path
i can't run all of my program , there's only a mouse icon in the center of screen
and mouse not working too ,

Is anyone meet this problem before? or something like this ?
Any comment is appreciated .


below is why i need to add font to qt

i'm using the QT linguist tool to change english to non-Latin(like chinese, japanese) language by qm file ,
and it works well under VM-ware Ubuntu 10.04(Qt version : 4.7.0) , all word print out when i replace the qm file ,
but when change the program to ARM (Qt version : 4.7.1),
the program only keep the text part blank(not â–¡ , all blank) .

after google around , i found "QFontDatabase::families"
which says "Returns a sorted list of the available font families which support the writingSystem."

i don't know if it's exactly what i want , but i tried it

QFontDatabase *fdb = new QFontDatabase ;
QStringList fam = fdb->families(QFontDatabase::TraditionalChinese);

qDebug() << "QFontDatabase::TraditionalChinese: available font families" ;
for(int i=0 ; i< fam.count(); i++){
qDebug() << fam[i] ;
}
output the following under ubuntu:

QFontDatabase::TraditionalChinese: available font families
"Monospace"
"Sans Serif"
"Serif"
"WenQuanYi Micro Hei"
"WenQuanYi Micro Hei Mono"
and under ARM (linux embedded system):

QFontDatabase::TraditionalChinese: available font families
"Bitstream Charter"
"Courier 10 Pitch"

Thanks~

lllturtle
9th November 2011, 07:03
i'm using the QT linguist tool to change english to non-Latin(like chinese, japanese) language by qm file ,
and it works well under VM-ware Ubuntu 10.04(Qt version : 4.7.0) , all word print out when i replace the qm file ,
but when change the program to ARM (Qt version : 4.7.1),
the program only keep the text part blank(not â–¡ , all blank) .

the problem solved this morning, just add following argument

./yourProgram -qws -font unifont

but don't know why the program can't working when font dir changed to other path,
anyway, it's not important !:)