Selectively enabling hinting



Hi,

we'd like to enable hinting only for some text on the screen using pango and the freetype2 backend. So far, the solution seems to be to have an appropriate text substitution function that sometimes enables hinting and call pango_ft2_font_map_substitute_changed when the hinting status changes. I have two questions:

a) Am I right in assuming this will flush the font cache every time the hinting changes? What can I do to avoid this? Two completely separate cango contexts and font maps? b) My current code is crashing in pango_font_family_get_name if I call pango_ft2_font_map_substitute_changed:

(gdb) bt
#0  0x900a3e42 in __kill ()
#1  0x900a3e34 in kill$UNIX2003 ()
#2  0x9011623a in raise ()
#3  0x90122679 in abort ()
#4  0x901173db in __assert_rtn ()
#5 0x062e2696 in avg::GLibLogFunc (log_domain=0x6d84738 "Pango", log_level=G_LOG_LEVEL_CRITICAL, message=0x2176ee50 "pango_font_family_get_name: assertion `PANGO_IS_FONT_FAMILY (family)' failed", unused_data=0x0) at TextEngine.cpp:205 #6 0x06c24df6 in g_logv (log_domain=0x6d84738 "Pango", log_level=G_LOG_LEVEL_CRITICAL, format=0x6d9517a "%s: assertion `%s' failed", args1=0xbfffc67c "95?\006T5?\006") at gmessages.c:483 #7 0x06c251b9 in g_log (log_domain=0x6d84738 "Pango", log_level=G_LOG_LEVEL_CRITICAL, format=0x6d9517a "%s: assertion `%s' failed") at gmessages.c:526 #8 0x06c253b7 in g_return_if_fail_warning (log_domain=0x6d84738 "Pango", pretty_function=0x6d83539 "pango_font_family_get_name", expression=0x6d83554 "PANGO_IS_FONT_FAMILY (family)") at gmessages.c:541 #9 0x06afb999 in pango_font_family_get_name (family=0x2e8280) at fonts.c:1933 #10 0x062e41ec in avg::TextEngine::getFontFamily (this=0x6f8d1a0, sFamily= 0x2176a330) at TextEngine.cpp:259

Does anyone have an idea what might cause that?

Regards and thanks for any help,

 Uli


--
Any technology distinguishable from magic is insufficiently advanced.

Ulrich von Zadow | +49-172-7872715
Jabber: coder c-base org
Skype: uzadow


--
Any technology distinguishable from magic is insufficiently advanced.

Ulrich von Zadow | +49-172-7872715
Jabber: coder c-base org
Skype: uzadow





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