DVUI

name

Parameters

#
self:*const Font
*const Font
allocator:std.mem.Allocator
std.mem.Allocator

Source

Implementation

#
pub fn name(self: *const Font, allocator: std.mem.Allocator) []const u8 {
    const weight = switch (self.weight) {
        .normal => "",
        .bold => " Bold",
    };
    const style = switch (self.style) {
        .normal => "",
        .italic => " Italic",
    };
    return std.fmt.allocPrint(allocator, "{s}{s}{s}", .{ self.familyName(), weight, style }) catch "";
}