freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Accessing `ft_mem_*' from OT-SVG hooks


From: Alexei Podtelezhnikov
Subject: Re: [ft-devel] Accessing `ft_mem_*' from OT-SVG hooks
Date: Sat, 6 Jul 2019 10:35:06 -0400

> 
> To solve this issue, memory allocation needs to be performed from the 
> FreeType side. Thus I added a new hook `get_state_size' which will be called 
> to query the size of the `state' structure of a particular port.

FreeType stores the size of its module structures as their second field 
explicitly for this very reason. This way you won’t need any special hooks. 

> Then FreeType can allocate this memory and later free it too. I did the same 
> thing for the image buffer. I created a new hook `get_buffer_size' which can 
> be called to query the size needed to place the final rendered image. The 
> rendering port uses this memory and it sets the `FT_GLYPH_OWN_BITMAP' flag, 
> thus, FreeType can free it later.

Yeap. That is what this flag is for.


reply via email to

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