Re: Synthesizing fonts using Cairo/Pango



On Tue, Jul 18, 2017 at 1:32 AM, Carl Hetherington <lists carlh net> wrote:
Hi Behdad,

This is on Ubuntu 16.04.  It works fine if I remove the
FcConfigAppFontAddFile.

Humm . I wouldn't have expected that.

 
  I'm happy to build Pango/Cairo from source and
do any debugging that would help.

Try calling FcInitLoadConfigAndFonts first for example...
 
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




--


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