[HarfBuzz] is it possible to render the harfbuzz buffer on to something other than SDL, like terminal

Alexander Sabourenkov llxxnntt at gmail.com
Tue Aug 20 09:52:40 PDT 2013


On Tue, Aug 20, 2013 at 4:09 PM, mahavishnu
<mahavishnu.r at gramtechnet.co.in> wrote:
> hi,
>         I am trying to use freetype and harfbuzz to get the bitmap information from
> the harfbuzz buffer where the layout is been done(if i am correct).

Not quite, the harfbuzz buffer holds only information which glyphs to
draw where.

Actual drawing is done by explicit calls to freetype with certain
callbacks (spanners) set up.

> please let
> me know the possibility of getting it done?.The ultimate result i am hoping to
> get is something like this for A
>                          00011000
>                          00100100
>                          01100110
>                          01100110
>                          01111110
>                          01100110
>                          01100110.

Taking the  ex-sdl-freetype-harfbuzz code as a start, you can remove
all SDL-specific code and use a plain memory buffer instead of
SDL_Surface. You can either use the spanner functions as-is and then
convert the resulting 32bit-per-pixel buffer to your preferred
representation, or you can modify the spanners to write it out
directly.

You can also leave the SDL-specific code as is and instead convert the
resulting SDL_Surface to whatever you need after the text has been
rendered to it, just before the SDL_UnlockSurface() call at line 485.

-- 

./lxnt



More information about the HarfBuzz mailing list