<div dir="ltr">Hi Sagar,<div><br></div><div>I suggest you follow an example piece of code, like:</div><div><br></div><div>  <a href="https://github.com/lxnt/ex-sdl-freetype-harfbuzz">https://github.com/lxnt/ex-sdl-freetype-harfbuzz</a></div><div><br></div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">behdad<br><a href="http://behdad.org/" target="_blank">http://behdad.org/</a></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 15, 2023 at 11:47 AM Sagar Acharya <<a href="mailto:sagaracharya@tutanota.com">sagaracharya@tutanota.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks a lot for the quick help.<br>
<br>
I decided to go ahead with Freetype for C.<br>
<br>
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.<br>
<br>
//===================================================================#include <ft2build.h><br>
#include FT_FREETYPE_H<br>
<br>
void main()<br>
{<br>
FT_Library library;<br>
FT_Face face;<br>
FT_Error error;<br>
FT_UInt glyph_index;<br>
FT_Bitmap bmp;<br>
<br>
int width=200;<br>
int height=200;<br>
<br>
error = FT_Init_FreeType(&library);<br>
error = FT_New_Face(library, "/path/to/ttf", 0, &face);<br>
error = FT_Set_Char_Size(face, 0, 16*64, 200, 200);<br>
<br>
glyph_index = FT_Get_Char_Index(face, 0x41);<br>
<br>
error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_MONO);<br>
printf("%d\n", error);<br>
}<br>
//===========================<br>
Thanking you<br>
Sagar Acharya<br>
<br>
<br>
<br>
Jan 13, 2023, 19:06 by <a href="mailto:behdad@behdad.org" target="_blank">behdad@behdad.org</a>:<br>
<br>
> Hi Sagar,<br>
><br>
> HarfBuzz does not have a rasterizer so you can't get that from HarfBuzz. You have two options:<br>
><br>
>   1. Use FreeType library,<br>
><br>
>   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.<br>
><br>
> Hope that helps,<br>
><br>
> behdad<br>
> <a href="http://behdad.org/" rel="noreferrer" target="_blank">http://behdad.org/</a><br>
><br>
><br>
> On Fri, Jan 13, 2023 at 10:06 AM Sagar Acharya <> <a href="mailto:sagaracharya@tutanota.com" target="_blank">sagaracharya@tutanota.com</a>> > wrote:<br>
><br>
>> 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.<br>
>>  <br>
>>  How do I do it?<br>
>>  <br>
>>  1110001111<br>
>>  1111101111<br>
>>  1110001111<br>
>>  1110101111<br>
>>  1110001111<br>
>>  <br>
>>  Something like above. How do I get it from ttf?<br>
>>  Thanking you<br>
>>  Sagar Acharya<br>
>><br>
<br>
</blockquote></div>