DVUI

glyphInfoGetOrReplacement

If a codepoint is missing in the font it gets the glyph for std.unicode.replacement_character

Parameters

#
self:*Entry
*Entry
gpa:std.mem.Allocator
std.mem.Allocator
codepoint:u32
u32

Source

Implementation

#
pub fn glyphInfoGetOrReplacement(self: *Entry, gpa: std.mem.Allocator, codepoint: u32) std.mem.Allocator.Error!GlyphInfo {
            return self.glyphInfoGet(gpa, codepoint) catch |err| switch (err) {
                Error.FontError => self.glyphInfoGet(gpa, std.unicode.replacement_character) catch unreachable,
                else => |e| e,
            };
        }