Re: [gtk-i18n-list] Bold fonts not bold on MAC?



Hi,

On Mon, 31 Jul 2006 19:09:17 +0200
Ulrich von Zadow <coder c-base org> wrote:
>> Please send me some sample source (to test bolden Arial), I will
>> check it. Either I wish that you can provide compiled binary,
>> if possible.
>
>Hm - extracting a small bit of working source is some work, but if you
>download the mac installer at www.libavg.de/download.html and do a
>doubleclick, you should have an installed PowerPC Mac binary of the
>engine. After that, the attached two files can be copied into a
>directory and the python script started to reproduce the effect. Have a
>bit of patience, since the first invocation causes an fc-cache run.
>
>Source code is also on the download page, but because the libavg engine
>has lots of dependencies, building from scratch on the mac is some work.
>The relevant code is under src/player/Words.cpp, mostly in drawString().

Sorry for long lated response. During my silence, libavg
was updated to 0.5.9. Yet I've not checked source, I suppose
there is some changes in font handling. Following is based
on test by 0.5.8.

--

libfreetype.6.dylib included in libavg-0.5.8 pkg is built
without old mac font support. I think, fontconfig collects
.dfont as available TTF, but ignore resource fork based
fonts (e.g.: /Library/Fonts/Arial). FreeType2 can open
.dfont without old mac font support, but the handling of
.dfont contents is slightly questionable (because of shortage
of testers). I did cross check by FreeType2 with old mac font
support, by following steps.

1. Build FreeType2 with old mac font support.

	$ cd /tmp
	$ tar xvfz freetype-2.2.1.tar.gz
	$ cd freetype-2.2.1
	$ ./configure --with-old-mac-fonts
	$ make

2. Recreate fontconfig cache files by FreeType2 with old mac font support.

	$ sudo bash
	# env DYLD_LIBRARY_PATH=/tmp/freetype-2.2.1/objs/.libs fc-cache -v -f

3. Replace libavg's FreeType2 by that with old mac font support.

	$ cd /Library/Python/2.3/site-packages/avg/
	$ sudo bash
	# mv libfreetype.6.dylib libfreetype-normal.6.dylib
	# cp /tmp/freetype-2.2.1/objs/.libs/libfreetype.6.dylib .

4. View test scripts.

5. Recover libavg's original FreeType2.

	$ cd /Library/Python/2.3/site-packages/avg/
	$ sudo bash
	# mv libfreetype.6.dylib libfreetype-oldmac.6.dylib
	# ln -s libfreetype-normal.6.dylib libfreetype.6.dylib

6. View test scripts (again).

My test script is following.
-------------------------------------------------------------------
<?xml version="1.0"?>
<avg id="imageavg" width="640" height="480">
    <words id="courier-normal" x="10" y="10" size="18" font="Courier" text="weight-undefined"/>
    <words id="courier-wbold" x="10" y="35" size="18" font="Courier" weight="bold" text="weight-bold"/>
    <words id="courier-sbold" x="10" y="60" size="18" font="Courier Bold" text="suffix-bold"/>
    <words id="courier-wsbold" x="10" y="85" size="18" font="Courier Bold" weight="bold" text="weight and suffix-bold"/>
    <words id="arial-normal" x="300" y="10" size="18" font="Arial" text="weight-undefined"/>
    <words id="arial-wbold" x="300" y="35" size="18" font="Arial" weight="bold" text="weight-bold"/>
    <words id="arial-sbold" x="300" y="60" size="18" font="Arial Bold" text="suffix-bold"/>
    <words id="arial-wsbold" x="300" y="85" size="18" font="Arial Bold" weight="bold" text="weight and suffix-bold"/>
</avg>
-------------------------------------------------------------------

The comparison of results is shown in attached GIF. I think,
FT2 with old mac font support works as expected. FT2 without
old mac font support cannot extract bold face from font file.
Yet I'm not sure if it's specific to .dfont, rather, Suitcase
font collection issue /or more generic issue (e.g.: TTC can
cause similar trouble?).

Anyway, after I recreate fontconfig cache with old mac font
support, normal-libfreetype2-based pango complains as:

-------------------------------------------------------------------
(process:13631): Pango-WARNING **: Unable to open font file
		/System/Library/Fonts/Courier.dfont
		for font Courier Semi-Condensed 18,
		falling back to /Library/Fonts/#Gungseouche.dfont

(process:13631): Pango-WARNING **: Unable to open font file
		/System/Library/Fonts/Courier.dfont
		for font Courier Bold Semi-Condensed 18,
		falling back to /Library/Fonts/#Gungseouche.dfont


(process:13631): Pango-WARNING **: Unable to open font file
		/Library/Fonts/Verdana
		for font Verdana Bold Semi-Condensed 18,
		falling back to /Library/Fonts/#Gungseouche.dfont

(process:13631): Pango-WARNING **: Unable to open font file
		/Library/Fonts/Arial
		for font Arial Bold Semi-Condensed 18,
		falling back to /Library/Fonts/#Gungseouche.dfont

(process:13631): Pango-WARNING **: Unable to open font file
		/Library/Fonts/Verdana
		for font Verdana Bold Semi-Condensed 18,
		falling back to /Library/Fonts/#Gungseouche.dfont
-------------------------------------------------------------------

There might be several solutions:

1. Use old mac font support for Mac OS X.
   1-a: Use Carbon-based old mac font (--with-old-mac-fonts).
   1-b: Polish Carbon-free old mac font support
   1-c: FreeType2 should ignore .dfont by default

2. Fix the inconsistency between fontconfig and Pango backend.
   2-a: fontconfig should ignore .dfont
   2-b: Pango should accept .dfont

Yet I'm not sure which is best solution. Ulrich, how do you think of?

Regards,
mpsuzuki



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]