You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building my application normally (the "dev" profile) everything works as intended; I set the face, set character sizes, then get glyphs and render them, putting the resulting bitmap buffer in a shader: no issues whatsoever.
If I run the exact same code in release mode (both my dev and release profiles are set to optimization level 3 and LTO "thin"), everything still works but the bitmaps are way lower resolution than they should be but glyphs still output the same (correct) metrics.
I've tried taking ownership of the bitmap buffer right after rendering (using to_vec or to_owned) but the problem is the exact same.
Freetype calls in order:
let face = ft.new_face(file_path, 0) face.set_pixel_sizes(...) face.height()face.ascender() and face.descender()
Getting the char:
face.get_char_index(...) face.load_glyph(id, LoadFlag::DEFAULT) let glyph = face.glyph() glyph.render_glyph(RenderMode::Normal) let bitmap = glyph.bitmap()
Then I send the bitmap to the GPU (OpenGL) using bitmap.buffer().as_ptr() as *cont c_void
Lastly I get the metric for the glyph using let metrics = glyph.metrics()
After this the next character is processed (starting from "Getting the char:")
The text was updated successfully, but these errors were encountered:
When building my application normally (the "dev" profile) everything works as intended; I set the face, set character sizes, then get glyphs and render them, putting the resulting bitmap buffer in a shader: no issues whatsoever.
If I run the exact same code in release mode (both my dev and release profiles are set to optimization level 3 and LTO "thin"), everything still works but the bitmaps are way lower resolution than they should be but glyphs still output the same (correct) metrics.
I've tried taking ownership of the bitmap buffer right after rendering (using
to_vec
orto_owned
) but the problem is the exact same.Freetype calls in order:
let face = ft.new_face(file_path, 0)
face.set_pixel_sizes(...)
face.height()
face.ascender()
andface.descender()
Getting the char:
face.get_char_index(...)
face.load_glyph(id, LoadFlag::DEFAULT)
let glyph = face.glyph()
glyph.render_glyph(RenderMode::Normal)
let bitmap = glyph.bitmap()
Then I send the bitmap to the GPU (OpenGL) using
bitmap.buffer().as_ptr() as *cont c_void
Lastly I get the metric for the glyph using
let metrics = glyph.metrics()
After this the next character is processed (starting from "Getting the char:")
The text was updated successfully, but these errors were encountered: