Re: Synthesizing fonts using Cairo/Pango
- From: Carl Hetherington <lists carlh net>
- To: "gtk-i18n-list gnome org" <gtk-i18n-list gnome org>
- Subject: Re: Synthesizing fonts using Cairo/Pango
- Date: Wed, 19 Jul 2017 10:13:17 +0100 (BST)
Hi Behdad,
[snip]
Try calling FcInitLoadConfigAndFonts first for example...
Many, many thanks: using FcInitLoadConfig() instead of FcConfigCreate()
appears to have fixed it!
All the best,
Carl
Â
Thank you,
Carl
On Tue, 18 Jul 2017, Behdad Esfahbod wrote:
> pangocairo is supposed to do that automatically. Is this on Windows / Mac by any chance?
>
> On Mon, Jul 17, 2017 at 3:46 PM, Carl Hetherington <lists carlh net> wrote:
>Â Â Â Â Hi all,
>
>Â Â Â Â I am writing text to a Cairo RGB24 ImageSurface using code along the lines
>Â Â Â Â of
>
>Â Â Â Â FcConfigAppFontAddFile (..., "Arial.ttf");
>
>Â Â Â Â auto surface = Cairo::ImageSurface::create (...);
>Â Â Â Â auto context = Cairo::Context::create (surface);
>Â Â Â Â auto layout = Pango::Layout::create (context);
>Â Â Â Â Pango::FontDescription font ("Arial");
>Â Â Â Â layout->set_font_description (font);
>Â Â Â Â layout->set_markup ("<span style=\"italic\">Hello world</span>");
>Â Â Â Â layout->add_to_cairo_context (context);
>
>Â Â Â Â Is there any way I can get Pango/Cairo/whoever to synthesize italic/bold
>Â Â Â Â fonts for me if I only supply a "regular" font file?
>
>Â Â Â Â As a complete punt I tried:
>
>Â Â Â Â auto ff = context->get_font_face();
>Â Â Â Â cairo_ft_font_face_set_synthesize (ff->cobj(), CAIRO_FT_SYNTHESIZE_OBLIQUE |
CAIRO_FT_SYNTHESIZE_BOLD);
>
>    but no joy. Any tips?
>
>Â Â Â Â Thanks very much,
>Â Â Â Â Carl
>Â Â Â Â _______________________________________________
>Â Â Â Â gtk-i18n-list mailing list
>Â Â Â Â gtk-i18n-list gnome org
>Â Â Â Â https://mail.gnome.org/mailman/listinfo/gtk-i18n-list
>
>
>
>
> --
> behdad
> http://behdad.org/
>
>
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list
--
behdad
http://behdad.org/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]