name
Parameters
- self:*const Source
- *const Source
- allocator:std.mem.Allocator
- std.mem.Allocator
Source
Implementation
pub fn name(self: *const Source, 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 "";
}