Trolltech Home | Qt-solutions Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-solutions Archive, November 2006
Expecting help for the function : qt_set_fallback_font_family


Message 1 in thread

Hi,

 I am working on qt-x11-free-3.3.6 to check out some
chinese based font picking issue. Of course it is part
of my interest, and havent found any working solution
for that error.
If you have japanese font and chinese font, then it
will be issue in rendering some chinese word, say for
e.g. type 'chan' or 'wei' using smart pinyin in kedit.

I went through the source code of qt and checked it in
qfont_x11.cpp. I tried the following solution coz of
which my code is working fine with k based app.

if ( script == QFont::Han )		
qt_set_fallback_font_family(QFont::Han,"AR PL
ShanHeiSun Uni");
		.
                .
                .

QStringList::ConstIterator it = family_list.begin(),
end = family_list.end();
    for ( ; ! engine && it != end; ++it ) {
	req.family = *it;
engine = QFontDatabase::findFont( script, this, req );
	if ( engine ) {
 	if ((script==QFont::Han) && (req.family=="Serif")) {
 		engine = 0;
 		continue;
 		}
        .
        .
        .
        .
        .
the remaining code as it is.


Here the 'Serif' condition checking is only for test
purpose. If I check it with only QFont::Han, then it
continues the loop with engine=0 and returns
SEG-FAULT.

Its not specific to only 'Serif' family, and it checks
any 'Corier' or any, if i start my demo application by
putting any font family.

Can some one give me solution to make it more
comfirtable instead of putting hard coded value in
qt_set_fallback_font_family?

Is this the proper way I am going through?

Please correct me if I am wrong.

regards,
Sachin Tawniya



 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

--
 [ signature omitted ]