Re: Possible bug/misuse in set_scaled_font/set_font_face & FreeType

Behdad Esfahbod <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On 13-12-16 02:06 PM, Jeremy Moles wrote:
> (This is a resubmission; my intial post was rejected because I attached a huge
> font file, sorry.)
> 
> Hello all! I am developing a (pretty cool) 2D text scenegraph library that
> uses Cairo, Harfbuzz, and glyphy. While working on some of the core
> components, I think I have discovered a bug (or perhaps more likely, a misuse)
> in/of Cairo. Attached is a very simple demo application.
> 
> You'll notice that I only use FreeType to load the initial font file, and then
> quickly create a cairo_font_fact_t* from that directly. I never call
> FT_Set_Char_Size, nor do I want to manage the font size with FreeType directly.
> 
> The issue I've found is that unless I call:
> 
> cairo_get_scaled_font()
> 
> ...after a call to cairo_set_font_size(), then the font glyphs seem to have
> wrong/null origins. I know that that the implementation is probably calling
> FT_Set_Char_Size underneath the hood, but it doesn't seem to actually "apply"
> until after the get_scaled_font() call. I don't know how else to best describe
> it, so I just attached a really simple example demonstrating it.

Correct.  You are misusing these.  You should use
cairo_ft_scaled_font_lock_face() to retrieve the face with correct size set.



> Hopefully I can get some advice/comments on my usage.
> 
> Thanks!
> 
> 
> 

-- 
behdad
http://behdad.org/
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.