Re: [Fonts]Wrong CJK bitmap font size selected by fontconfig/Xft 2.1?

2003-01-02 Thread Anthony Fok
On Wed, Jan 01, 2003 at 07:32:48PM -0800, Keith Packard wrote:
 Around 11 o'clock on Jan 2, Anthony Fok wrote:
 
  I couldn't figure out why disproportionally large 24px zh-CN font was
  selected in place of the closest 16px when lang=en.  I have tried
  switching to all other languages, and it appears that only lang=en
  exhibits the problem.
 
 lang=en may force the 24px font because of coverage issues; it's possible 
 the 16px font is missing some glyphs needed for English but not needed 
 for German.
 
 You can check the language encoding supported by each font using fc-list, 
 I don't have a 24 pixel font with support for zh-CN, but you should be 
 able to see it with:
 
 $ fc-list :lang=zh-cn:pixelsize=24 family lang pixelsize

Hello Keith,

Thanks again for your quick and helpful response!  Yes, you have hit right
on the nail!  It turns out that fangsongti16.pcf is missing U+00EB (small
latin e with diaeresis), while fangsongti24.pcf does have it.  Manually
adding the glyph in fangsongti16.bdf solves the problem, at least fc-list
now shows fangsong ti 16 with lang=en support.  :-)

I was a little surprised to find that en.orth's coverage is greater than
that of say de.orth or fr.orth.  But then again, I guess English does use
more foreign words in daily use.  :-)

By the way, these fangsongti{16,24}.bdf fonts are created by Yu Shao and
Owen Taylor from existing XFree86 fonts (gb16fs.bdf, gb24st.bdf, 8x16,
12x24), re-encoded in Unicode.  If you are interested, you may get the font
here:

  BDF files:

http://mirror.mcs.anl.gov/redhat/linux/beta/phoebe/en/os/i386/SRPMS/bitmap-fonts-0.2-4.src.rpm

  PCF files:

http://mirror.mcs.anl.gov/redhat/linux/beta/phoebe/en/os/i386/RedHat/RPMS/bitmap-fonts-0.2-4.noarch.rpm

http://mirror.mcs.anl.gov/redhat/linux/beta/phoebe/en/os/i386/RedHat/RPMS/bitmap-fonts-cjk-0.2-4.noarch.rpm

Patch for fangsongti16.bdf attached.  (This is the least I can do.  :-)
I haven't tried it with an anaconda rebuild, but I guess the patch should
do the trick.  :-)

 You can watch the match process by enabling a couple of debugging levels 
 within fontconfig:
 
 $ export FC_DEBUG=3 
 $ some random pango app

 This will generate quite a bit of output, but should provide sufficient 
 information to see why one font is preferred to another, although you're 
 likely to need to look a the fontconfig source to make much sense of the 
 output.

Thanks for the helpful tips!  They'll come in handy.  :-)

Cheers,

Anthony

-- 
Anthony Fok Tung-Ling
ThizLinux Laboratory   [EMAIL PROTECTED] http://www.thizlinux.com/
Debian Chinese Project [EMAIL PROTECTED]   http://www.debian.org/intl/zh/
Come visit Our Lady of Victory Camp!   http://www.olvc.ab.ca/

--- bitmap-fonts-0.2~/fangsongti16.bdf  2002-08-29 01:55:55.0 +0800
+++ bitmap-fonts-0.2/fangsongti16.bdf   2003-01-02 17:22:16.0 +0800
@@ -81,7 +81,7 @@
 DEFAULT_CHAR 8481
 COPYRIGHT Copyright (c) 1988  The Institute of Software, Academia Sinica.
 ENDPROPERTIES
-CHARS 7814
+CHARS 7815
 STARTCHAR 0x3000
 ENCODING 12288
 SWIDTH 1000 0
@@ -179528,6 +179528,29 @@
 10
 20
 ENDCHAR
+STARTCHAR C353
+ENCODING 235
+SWIDTH 480 0
+DWIDTH 8 0
+BBX 8 16 0 -2
+BITMAP
+00
+44
+44
+00
+00
+38
+44
+82
+fe
+80
+80
+80
+44
+38
+00
+00
+ENDCHAR
 STARTCHAR C355
 ENCODING 238
 SWIDTH 480 0



[Fonts]Wrong CJK bitmap font size selected by fontconfig/Xft 2.1?

2003-01-01 Thread Anthony Fok
Hello,

First of all, Happy New Year!  :-)

While testing the latest Red Hat 8.1 beta (Phoebe), during installation,
fontconfig/Xft 2.1 appears to be selecting the wrong CJK bitmap font size
when lang=en, as shown in the following screen capture:

   http://foka.homelinux.net/~foka/xft/phoebe-anaconda-en-chinese-24px.jpg

switching to other languages, e.g. lang=de, seem to fix the problem:

   http://foka.homelinux.net/~foka/xft/phoebe-anaconda-de-chinese-16px.jpg

Hanzi fonts available in the system:
  zh-CN: 16px and 24px PCF fonts
  zh-TW: AR PL Mingti2L Big5 (TrueType)
  ja: Kochi Gothic (TrueType)
  ko: (I forgot which one, probably Baekmuk Batang or Dotum; also TrueType)

I couldn't figure out why disproportionally large 24px zh-CN font was
selected in place of the closest 16px when lang=en.  I have tried switching
to all other languages, and it appears that only lang=en exhibits the
problem.

In the previous version (Red Hat 8.0, fontconfig 2.0, Xft 2.0), a more
correct bitmap font size (16px instead of 24px) was selected even when
lang=en.  (I.e., it looks like phoebe-anaconda-de-chinese-16px.jpg)

Is this issue the domain of fontconfig or Xft?  Or Pango?  Or something else
altogether?  I apologize for my ignorance, as I am not yet sure of the exact
division of work among the three libraries.  :-)

Many thanks,

Anthony

-- 
Anthony Fok Tung-Ling
ThizLinux Laboratory   [EMAIL PROTECTED] http://www.thizlinux.com/
Debian Chinese Project [EMAIL PROTECTED]   http://www.debian.org/intl/zh/
Come visit Our Lady of Victory Camp!   http://www.olvc.ab.ca/
___
Fonts mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/fonts



Re: [Fonts]Wrong CJK bitmap font size selected by fontconfig/Xft 2.1?

2003-01-01 Thread Keith Packard

Around 11 o'clock on Jan 2, Anthony Fok wrote:

 I couldn't figure out why disproportionally large 24px zh-CN font was
 selected in place of the closest 16px when lang=en.  I have tried switching
 to all other languages, and it appears that only lang=en exhibits the
 problem.

lang=en may force the 24px font because of coverage issues; it's possible 
the 16px font is missing some glyphs needed for English but not needed 
for German.

You can check the language encoding supported by each font using fc-list, 
I don't have a 24 pixel font with support for zh-CN, but you should be 
able to see it with:

$ fc-list :lang=zh-cn:pixelsize=24 family lang pixelsize

 Is this issue the domain of fontconfig or Xft?  Or Pango?  Or something else
 altogether?  I apologize for my ignorance, as I am not yet sure of the exact
 division of work among the three libraries.  :-)

Font matching and selection is entirely within the province of fontconfig, 
although the generation of matching patterns is done by applications and 
libraries like Pango.

You can watch the match process by enabling a couple of debugging levels 
within fontconfig:

$ export FC_DEBUG=3 
$ some random pango app

This will generate quite a bit of output, but should provide sufficient 
information to see why one font is preferred to another, although you're 
likely to need to look a the fontconfig source to make much sense of the 
output.

Keith PackardXFree86 Core TeamHP Cambridge Research Lab


___
Fonts mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/fonts