Re: render 3 glyphes into the one buffer

Vitaliy Fadeev <[email protected]>
Newsgroups gmane.comp.fonts.freetype.user
Message-ID <[email protected]>
On Вт, 2021-08-03 at 08:47 -0400, Alexei Podtelezhnikov wrote:
> > Question 1: Possible to render glyphs directly into te one big
> > bitmap ?
> 
> If you are ready to manage the buffer yourselves and carefully track
> the pen coordinates for proper layout, you might be able to use
> FT_Outline_Render with  FT_RASTER_FLAG_DIRECT and some callback
> function.
> 
> https://www.freetype.org/freetype2/docs/reference/ft2-outline_processing.html#ft_outline_render
> 
> This is what a lot of games use when they do not want to rely on a
> heavy layout engine like Cairo.

Alexei Podtelezhnikov, thank you!

I see FT_Outline_Render. I see the flag FT_RASTER_FLAG_DIRECT.

I will to pass the bitmap ( FT_Bitmap ) via `params.target` (
FT_Raster_Params ). It good.
How to set render offset ( left, top ) ?

I think,
I can use `FT_Bitmap.buffer` for set start position in buffer, and 
I can set `FT_Bitmap.pitch` to ny_buffer.width.

It is correct way for render into the preallocated bitmap ?
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.