Skip to content

Passing FT_LOAD_RENDER on FT_Load_Glyph() doesn't work #47

Description

@heyx3

Rendering it manually, the bitmap data exists:

julia> using FreeType, CSyntax; ft_lib::FT_Library = C_NULL; ft_err = @c FT_Init_FreeType(&ft_lib); @assert(ft_err == 0); ft_face::FT_Face = C_NULL; ft_err = @c FT_New_Face(ft_lib, "assets/JetBrainsMono-Bold.ttf", 0, &ft_face); ft_result = @c FT_Get_Char_Index(ft_face, '®'); ft_err = @c FT_Load_Glyph(ft_face, ft_result, 0); @assert(ft_err == 0); ft_glyph = unsafe_load(ft_face).glyph; ft_err = @c FT_Render_Glyph(ft_glyph, FT_RENDER_MODE_NORMAL); unsafe_load(ft_glyph).bitmap

FT_Bitmap_(0x0000000b, 0x00000009, 9, Ptr{UInt8} @0x000001cbfdd9ef60, 0x0100, 0x02, 0x00, Ptr{Nothing} @0x0000000000000000)

But rendering it using the flag FT_LOAD_RENDER, which is supposed to call FT_Render_Glyph() automatically, the bitmap data does not exist:

julia> using FreeType, CSyntax; ft_lib::FT_Library = C_NULL; ft_err = @c FT_Init_FreeType(&ft_lib); @assert(ft_err == 0); ft_face::FT_Face = C_NULL; ft_err = @c FT_New_Face(ft_lib, "assets/JetBrainsMono-Bold.ttf", 0, &ft_face); ft_result = @c FT_Get_Char_Index(ft_face, '®'); ft_err = @c FT_Load_Glyph(ft_face, ft_result, FT_LOAD_RENDER); @assert(ft_err == 0); ft_glyph = unsafe_load(ft_face).glyph; unsafe_load(ft_glyph).bitmap

FT_Bitmap_(0x00000000, 0x00000000, 0, Ptr{UInt8} @0x0000000000000000, 0x0000, 0x00, 0x00, Ptr{Nothing} @0x0000000000000000)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions