src/font: working on initiaizing deferred fonts from fc

This commit is contained in:
Mitchell Hashimoto
2022-09-23 12:09:40 -07:00
parent bc9a0a36a8
commit 88a4cb65f3
3 changed files with 54 additions and 0 deletions

View File

@@ -32,6 +32,18 @@ pub fn version(self: Library) Version {
return v;
}
/// Call FT_New_Face to open a font from a file.
pub fn initFace(self: Library, path: [:0]const u8, index: i32) Error!Face {
var face: Face = undefined;
try intToError(c.FT_New_Face(
self.handle,
path.ptr,
index,
&face.handle,
));
return face;
}
/// Call FT_Open_Face to open a font that has been loaded into memory.
pub fn initMemoryFace(self: Library, data: []const u8, index: i32) Error!Face {
var face: Face = undefined;