Re: loading an external font using pango



Hi Shiplu.

Pango uses Fontconfig to resolve which font to load. You will have to make Fontconfig aware of your font, and give it an alias which you can then use in Pango.

Good luck.

/Jesper

On Aug 1, 2010, at 1:57 AM, shiplu wrote:

> Hello list,
> 
> The subject already says what I need.
> 
> Somewhere in the example pages of Pango i found the following code.
> 
> PangoFontDescription * pango_font_desc =
> pango_font_description_from_string("Sans Bold 12");
> 
> This works for me.
> 
> 
> But I dont want to use Sans font. I have my own ttf font. I have the
> path of the font.  I know the size.
> 
> Now what should I right so that pango_font_desc will be filled with
> font path and size?
> 
> I used this,
> pango_font_description_set_family(pango_font_desc, this->font_family.c_str());
> 
> But it doesn't work.
> 
> how do I replace the pango_font_description_from_string("Sans Bold
> 12") call with font path and font size call?
> 
> 
> Thanks
> 
> 
> 
> Shiplu Mokadd.im
> My talks, http://talk.cmyweb.net
> Follow me, http://twitter.com/shiplu
> SUST Programmers, http://groups.google.com/group/p2psust
> Innovation distinguishes bet ... ... (ask Steve Jobs the rest)
> _______________________________________________
> gtk-i18n-list mailing list
> gtk-i18n-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-i18n-list

--
Jesper L Nielsen
jln locatel dk






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