[cairo-bugs] [Bug 75219] New: [C++] Embolden doesn't work in a text

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Feb 19 09:52:47 PST 2014


https://bugs.freedesktop.org/show_bug.cgi?id=75219

          Priority: medium
            Bug ID: 75219
          Assignee: david at freetype.org
           Summary: [C++] Embolden doesn't work in a text
        QA Contact: cairo-bugs at cairographics.org
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: guillaume.mercat at cofelyineo-gdfsuez.com
          Hardware: x86 (IA32)
            Status: NEW
           Version: 1.12.14
         Component: freetype font backend
           Product: cairo

I use Cairo with freetype to write texts in my software.
I have a font without "bold" and i want to use "Synthesize Bold".
But my word isn't Embolden.

When i debug in cairo, i see, in 'cairo_scaled_font_create' (in file
cairo_scaled-font.c), the scaled_font is found in font_map (scaled_font =
font_map->mru_scaled_font) and _cairo_scaled_font_matches return true. So when
i draw text, cairo find scaled_glyph in the 'hash_table->cache' (in function
'_cairo_scaled_glyph_lookup') but this scaled_glyph isn't init with flag
"Synthesize Bold" and so it isn't embolden.

I think the issue is around the 'mru_scaled_font' usage where it matches with
font_face in cairo_scaled_font_create. 


I do :
[...]
FT_Face FTFace = GetFreetypeFace ();
cairo_t* pContext = NULL;
cairo_font_face_t* pCairoFontFace = NULL;
cairo_user_data_key_t Key;
cairo_surface_t* pSurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 1,
1);
if(pSurface)
{
   pContext = cairo_create(pSurface);
   pCairoFontFace = cairo_ft_font_face_create_for_ft_face (FTFace,0);
   cairo_font_face_set_user_data (pCairoFontFace, &Key, FTFace, NULL);
   cairo_ft_font_face_set_synthesize(pCairoFontFace, CAIRO_FT_SYNTHESIZE_BOLD);
   cairo_set_font_face(pContext, pCairoFontFace);
   cairo_text_path (pContext, TextBuffer.GetData());
   cairo_fill(pContext);
   if(cairo_status(apContext) == CAIRO_STATUS_SUCCESS)
   {
      cairo_font_face_set_user_data (pCairoFontFace, &Key, NULL, NULL);
      cairo_font_face_destroy(pCairoFontFace);
   }
   if(NULL != pContext)
   {
      cairo_destroy(pContext);
   }
   cairo_surface_destroy(pSurface);
}

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo-bugs/attachments/20140219/f7551f9e/attachment.html>


More information about the cairo-bugs mailing list