|
List Info
Thread: Bold fonts not bold on MAC?
|
|
| Bold fonts not bold on MAC? |

|
2006-07-30 21:40:13 |
Hi,
I'm in the process of porting libavg (www.libavg.de) from
Linux to Mac
OS X and I've run into a strange issue with Pango (or
fontconfig - I'm
not sure). The issue is that I'm not getting any bold
fonts. Italics
work fine. Creating a font from a bold font description and
querying the
font's description again gives me a bold description.
Paraphrasing the code:
pango_font_description_set_family(m_pFontDescription,
g_strdup("Arial");
pango_font_description_set_weight(m_pFontDescription,
PANGO_WEIGHT_BOLD);
PangoFontMap* pFontMap =
pango_context_get_font_map(m_pContext);
PangoFont* pUsedFont = pango_font_map_load_font(pFontMap,
m_pContext,
m_pFontDescription);
PangoFontDescription * pUsedDescription =
pango_font_describe(pUsedFont);
assert(PANGO_WEIGHT_BOLD ==
pango_font_description_get_weight(m_pFontDescription));
pango_context_set_font_description(m_pContext,
m_pFontDescription);
PangoLayout *layout = pango_layout_new (m_pContext);
pango_layout_set_markup(layout, m_Text.c_str(),
m_Text.length());
[Create bitmap etc.]
pango_ft2_render_layout(&bitmap, layout, 0, 0);
The assert doesn't fire, but the font isn't rendered in
bold.
This happens at least with Arial and Times New Roman, I
haven't yet
tried other fonts. I'm using Pango 1.13.3, freetype 2.1.10
and
fontconfig 2.3.1, all compiled from source.
Regards,
Uli
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list
|
|
| Bold fonts not bold on MAC? |

|
2006-07-31 00:17:17 |
Hi,
On Sun, 30 Jul 2006 23:40:13 +0200
Ulrich von Zadow <coder c-base.org> wrote:
>This happens at least with Arial and Times New Roman, I
haven't yet
>tried other fonts.
Could you test against the fonts copied from Linux?
Against the fonts bundled to MacOS, there might be some
Mac-specific issues in font file vs FreeType.
> I'm using Pango 1.13.3, freetype
2.1.10 and
>fontconfig 2.3.1, all compiled from source.
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.
Regards,
mpsuzuki
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list
|
|
| Bold fonts not bold on MAC? |

|
2006-07-31 17:09:17 |
mpsuzuki hiroshima-u.ac.jp wrote:
> Hi,
>
> On Sun, 30 Jul 2006 23:40:13 +0200
> Ulrich von Zadow <coder c-base.org> wrote:
>> This happens at least with Arial and Times New
Roman, I haven't yet
>> tried other fonts.
>
> Could you test against the fonts copied from Linux?
> Against the fonts bundled to MacOS, there might be some
> Mac-specific issues in font file vs FreeType.
Bingo! If I copy the fonts from Linux, everything is ok.
>> I'm using Pango 1.13.3, freetype
2.1.10 and
>> fontconfig 2.3.1, all compiled from source.
>
> 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().
Regards,
Uli
#!/usr/bin/python
import avg
Player = avg.Player()
Player.loadFile("boldtest.avg")
Player.play()
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list
|
|
| Bold fonts not bold on MAC? |

|
2006-08-17 05:52:54 |
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
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list
|
|
| Bold fonts not bold on MAC? |

|
2006-09-23 17:01:42 |
mpsuzuki hiroshima-u.ac.jp wrote:
> Sorry for long lated response.
Um - my turn to be sorry now :-(.
Thanks to your tests, I now have a working version of libavg
with
old-mac-font support. Sadly, it only works on PPC macs,
because if
freetype is built --with-old-mac-fonts on Intel mac,
fc-cache segfaults.
This is the case with freetype 2.1.10 and 2.2.1 as well as
fontconfig
2.3.1, 2.3.2 and 2.4.0. If you need more information to
track this down,
please ask.
Also, --with-old-mac-fonts introduces dependencies on some
apple
frameworks that pkg-config doesn't report. I had to add
-framework ApplicationServices -framework CoreFoundation
by hand to libraries using freetype.
> 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
If I understood your mail correctly, installing libavg in
this way (with
--with-mac-old-fonts) will cause errors with other
pango-based
applications on the same machine, and that clearly isn't
what we want.
Also, if I understand your mail correctly, not supporting
.dfont at all
(2-a and 1-c) will make some fonts (including the installed
arial) on
Apples unavailable, and that probably isn't such a good
idea either.
Regards,
Uli
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list
|
|
| Bold fonts not bold on MAC? |

|
2006-09-25 00:42:25 |
Hi,
On Sat, 23 Sep 2006 19:01:42 +0200
Ulrich von Zadow <coder c-base.org> wrote:
>Um - my turn to be sorry now :-(.
>
>Thanks to your tests, I now have a working version of
libavg with
>old-mac-font support. Sadly, it only works on PPC macs,
because if
>freetype is built --with-old-mac-fonts on Intel mac,
fc-cache segfaults.
Ah, sorry for lacking the important notice. QuickDraw
support code for freetype-2.2.1 and older versions is
only tested on m68k and ppc platforms (because I had
no access to i386 Mac at that time). The latest freetype2
on CVS is fixed for i386 platform.
>Also, --with-old-mac-fonts introduces dependencies on
some apple
>frameworks that pkg-config doesn't report. I had to add
>
> -framework ApplicationServices -framework
CoreFoundation
>
>by hand to libraries using freetype.
Yes, this is another problem. And, I remember that
some old version of pkg-config cannot pass these options
to linker even when these options are included in .pc files
(latest pkg-config is ok, but Apple ships older one?).
I asked if such options should be inserted into .pc files
and freetype-config --libs, in ft-devel list, but nobody
replied. If you know any other softwares that inserts such
very platform specific options into .pc files, please let
me know, I want to refer that.
>> 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
>
>If I understood your mail correctly, installing libavg
in this way (with
>--with-mac-old-fonts) will cause errors with other
pango-based
>applications on the same machine, and that clearly
isn't what we want.
Yes, if libavg installs its own private copy of libfreetype
with-old-mac-fonts, its behaviour differs from other
applications
using Apple's "official"
/usr/X11R6/lib/libfreetype.so.
In addition to, when a user execute fc-cache normally,
it updates fontconfig database to exclude .dfont files.
He must keep it in mind to execute fc-cache with appropriate
DYLD_LIBRARY_PATH. I think it's not pragmatic.
>Also, if I understand your mail correctly, not
supporting .dfont at all
>(2-a and 1-c) will make some fonts (including the
installed arial) on
>Apples unavailable, and that probably isn't such a good
idea either.
I see. Therefore, the expected solution might be 1-b.
I will take a look, but possibly I cannot proceed until
the end of November.
Regards,
mpsuzuki
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list
|
|
[1-6]
|
|