Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
file displaying incorrectly in qt but not in gnome
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese)
View previous topic :: View next topic  
Author Message
mathfeel
l33t
l33t


Joined: 03 Aug 2004
Posts: 697

PostPosted: Mon Feb 14, 2005 9:45 pm    Post subject: file displaying incorrectly in qt but not in gnome Reply with quote

I am sure it's font issue. Please take a look at this picture..

Notice how the same file is cat correctly under terminal (GTK+) but not in Konsole (QT)? I have played with font setting in KDE all night and can't get it right. I think all QT program (not just with fixed-width fonts) in my computer has problem displaying certian character (about 10%?)--some simplified, some traditional. Anybody? Thanks

For the very same reason, I can't use skim in KDE because the select table would be fill with some boxes. scim-qtimm works just fine. See here.

Using the FontInstaller (admin mode), I have track down some more details. I use the test string "你好吗,你好嗎" and scroll over each fonts. So far, the only fonts that I can find that can read the string correctly is SimHei, Arial UNICODE MS, and Bitstream Cyberbit. I suppose gnome has some method of falling back to certain fonts when the current font does not support a character. I wonder if QT can do the same?
Back to top
View user's profile Send private message
liuspider
Apprentice
Apprentice


Joined: 03 Feb 2003
Posts: 237

PostPosted: Tue Feb 15, 2005 1:09 pm    Post subject: Reply with quote

why not try to specify simhei as the default kde font?

you can set font substitute in qtconfig
Back to top
View user's profile Send private message
EricHsu
Moderator
Moderator


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Tue Feb 15, 2005 1:42 pm    Post subject: Reply with quote

hi, mathfeel,

AFAIK, selecting and rendering fonts are the x server's job. I guess GTK/Qt are just another layer above it.
To configure your system wide font settings, you could edit the /etc/fonts/local.conf (create it if there's no such file), and configure it like this:
Code:

eric@gentux ~ $ cat /etc/fonts/local.conf
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Bitstream Vera Serif</family>
      <family>SimSun</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Bitstream Vera Sans</family>
      <family>SimSun</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>Bitstream Vera Sans Mono</family>
      <family>SimSun</family>
    </prefer>
  </alias>
</fontconfig>

This configuration is quite straight forward, it just tells the system that the fonts I prefered are "Bitstream *" and Simsun (Chinese font), whenever you (- the system) encounter any charaters, please use the "Bitstream *" fonts to render them first, if the "Bitstream *" fonts are not enough (when there're chinese charaters), use "Simsun" to display them.

You can add as many font families as you want, each one of them is chosen in the order you place them.

This is a x server level font configuration, I guess Qt should listen to it as GTK+ does in my system ;)
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum