glyphInfoGet
Parameters
- self:*Entry
- *Entry
- gpa:std.mem.Allocator
- std.mem.Allocator
- codepoint:u32
- u32
Source
Implementation
pub fn glyphInfoGet(self: *Entry, gpa: std.mem.Allocator, codepoint: u32) (std.mem.Allocator.Error || Error)!GlyphInfo {
if (ascii_start <= codepoint and codepoint < ascii_size)
return self.glyph_info_ascii[codepoint - ascii_start];
if (self.glyph_info.get(codepoint)) |gi| return gi;
const gi = try self.glyphInfoGenerate(codepoint);
// new glyph, need to regen texture atlas on next render
//std.debug.print("new glyph {}\n", .{codepoint});
self.invalidateTextureAtlas();
try self.glyph_info.put(gpa, codepoint, gi);
return gi;
}