freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] PCF: Issues with lazy copy in `ft_bitmap_glyph_init'


From: armin
Subject: Re: [ft-devel] PCF: Issues with lazy copy in `ft_bitmap_glyph_init'
Date: Thu, 23 Aug 2018 16:43:49 +0200

>> FT_Get_Glyph(  face->glyph, &glyph );     // lazy copy in
>> `ft_bitmap_glyph_init'
>
> I think the else (proper copy) condition is bogus. If bitmap is not owned,
it
> is not valid and you cannot copy it, which leaves us with lazy case only.
> Elsewhere, we do not even free the bitmap buffer in the FT_GlyphSlot if it
is
> not owned.

Personally, I think the "else" is the only "proper" way to proceed in that
situation (even though it is way more expensive):  the glyph that is being
allocated in `FT_Get_Glyph' is basically a deep copy of whatever resides in
the face's glyph slot (at least that's the way it is advertised).  Apart
from my expectations (1), I also have to free the glyph that `FT_Get_Glyph'
crafts (according to docs) and that flushes the bitmap buffer of said glyph
(which causes the issues in first place).

(1) I expect to be able to use the returned glyph however I like.  Knowing
it won't affect the glyphslot in the face ... that way I can do fancy things
to it without the need to reload the glyph in the face -- which renders
`FT_Get_Glyph' pretty much useless.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]