mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
font: fontconfig adaptations to new api
This commit is contained in:
@ -360,13 +360,13 @@ test "fontconfig" {
|
|||||||
defer def.deinit();
|
defer def.deinit();
|
||||||
|
|
||||||
// Verify we can get the name
|
// Verify we can get the name
|
||||||
const n = try def.name();
|
var buf: [1024]u8 = undefined;
|
||||||
|
const n = try def.name(&buf);
|
||||||
try testing.expect(n.len > 0);
|
try testing.expect(n.len > 0);
|
||||||
|
|
||||||
// Load it and verify it works
|
// Load it and verify it works
|
||||||
try def.load(lib, .{ .points = 12 });
|
const face = try def.load(lib, .{ .points = 12 });
|
||||||
try testing.expect(def.hasCodepoint(' ', null));
|
try testing.expect(face.glyphIndex(' ') != null);
|
||||||
try testing.expect(def.face.?.glyphIndex(' ') != null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test "coretext" {
|
test "coretext" {
|
||||||
|
@ -638,7 +638,7 @@ test "discover monospace with fontconfig and freetype" {
|
|||||||
defer lib.deinit();
|
defer lib.deinit();
|
||||||
var group = try init(alloc, lib, .{ .points = 12 });
|
var group = try init(alloc, lib, .{ .points = 12 });
|
||||||
defer group.deinit();
|
defer group.deinit();
|
||||||
try group.addFace(.regular, (try it.next()).?);
|
try group.addFace(.regular, .{ .deferred = (try it.next()).? });
|
||||||
|
|
||||||
// Should find all visible ASCII
|
// Should find all visible ASCII
|
||||||
var atlas_greyscale = try font.Atlas.init(alloc, 512, .greyscale);
|
var atlas_greyscale = try font.Atlas.init(alloc, 512, .greyscale);
|
||||||
|
@ -217,7 +217,6 @@ pub const Fontconfig = struct {
|
|||||||
defer self.i += 1;
|
defer self.i += 1;
|
||||||
|
|
||||||
return DeferredFace{
|
return DeferredFace{
|
||||||
.face = null,
|
|
||||||
.fc = .{
|
.fc = .{
|
||||||
.pattern = font_pattern,
|
.pattern = font_pattern,
|
||||||
.charset = (try font_pattern.get(.charset, 0)).char_set,
|
.charset = (try font_pattern.get(.charset, 0)).char_set,
|
||||||
|
Reference in New Issue
Block a user