Bold fonts not bold on MAC?
- From: Ulrich von Zadow <coder c-base org>
- To: gtk-i18n-list gnome org
- Subject: Bold fonts not bold on MAC?
- Date: Sun, 30 Jul 2006 23:40:13 +0200
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]