Any help is appreciated in code below to convert the glyph to 0 and 1 based 
bitmap as shown at the end.

>
> Since I'm new to C, I don't quite know how to connect function Char_Index 
> output to FT_Bitmap. I'm new to reading such C documentation.
>
> //===================================================================
> #include <ft2build.h>
> #include FT_FREETYPE_H
>
> void main()
> {
> FT_Library library;
> FT_Face face;
> FT_Error error;
> FT_UInt glyph_index;
> FT_Bitmap bmp;
>
> int width=200;
> int height=200;
>
> error = FT_Init_FreeType(&library);
> error = FT_New_Face(library, "/path/to/ttf", 0, &face);
> error = FT_Set_Char_Size(face, 0, 16*64, 200, 200);
>
> glyph_index = FT_Get_Char_Index(face, 0x41);
>
> error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_MONO);
> printf("%d\n", error);
> }
> //===========================
>
> Thanking you
> Sagar Acharya
>
>
>
> Jan 13, 2023, 19:06 by beh...@behdad.org:
>
>> Hi Sagar,
>>
>> HarfBuzz does not have a rasterizer so you can't get that from HarfBuzz. You 
>> have two options:
>>
>>   1. Use FreeType library,
>>
>>   2. If you have a graphics library with a rasterizer capable of handling 
>> the moveTo/lineTo/curveTo model, you can use the hb-draw API to draw to it.
>>
>> Hope that helps,
>>
>> behdad
>> http://behdad.org/
>>
>>
>> On Fri, Jan 13, 2023 at 10:06 AM Sagar Acharya <>> 
>> sagaracha...@tutanota.com>> > wrote:
>>
>>> I have ttf file of the font that I want the bitmap of. In black and white 
>>> mapped to 0 and 1, I want a set of 16x16 set of all characters.
>>>
>>> How do I do it?
>>>
>>> 1110001111
>>> 1111101111
>>> 1110001111
>>> 1110101111
>>> 1110001111
>>>
>>> Something like above. How do I get it from ttf?
>>> Thanking you
>>> Sagar Acharya
>>>
>
>

Reply via email to