Space character (0x0020) has no extents
Created by: fschutt
When trying to get the extents of the space character of any font (Unicode 0x0020, a literal "space"), the glyphs extents
are None
, which is wrong (freetype-rs
shows a height of 2000 units, FontForge confirms this). This makes it difficult to calculate the width of a space.
Seems to be a problem with stb_truetype
. To reproduce:
let glyph = font.glyph(rusttype::CodepointOrGlyphId::Codepoint(rusttype::Codepoint(0x0020)));
let glyph_metrics = glyph.standalone().get_data().unwrap();
println!("{:?}", glyph_metrics.extents); // None - correct answer would be a Rect with a height of 2000