Custom font files with Pango



Hello,

I've seen on the mailing list a similar question related to loading a new font file.  Here is how he explained his solution:
If i delete fonts.conf and adding below code, i am able to laod the file. But i am unable to render italic or bold characters. I am setting style information using pango and trying to render it. But it is rendering only normal text.  For style information what i have to do? 
char *fontFile = "Amelia.pfr";
FcConfig *config = FcInitLoadConfigAndFonts();
FcBool ret = FcConfigAppFontAddFile(config, reinterpret_cast<const FcChar8*>(fontFile));
ret = FcConfigSetCurrent(config);

Thanks,
Pradeep.

I was wondering if anybody knew if loading .ttf files shipped with an application is possible.  Basically, I want Pango to only know about fonts that I tell it about, and I don't want to mess with anything on the system, like deleting fonts.conf files.  Since the documentation for FontConfig is lacking, I was hoping this list might know.  I'm assuming FcConfigSetCurrent only affects font config for the current app?

Also in that same mailing list thread: http://mail.gnome.org/archives/gtk-i18n-list/2009-June/msg00006.html it was stated that the user has to run fc-cache -f via command line - is there a way to do that within the application using the font config API and only affecting configuration of the current app?

Thanks,

sb


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