From 5df0935f82069f4d2f48603539680ddde0b42f59 Mon Sep 17 00:00:00 2001 From: Qwerasd Date: Wed, 8 May 2024 16:40:29 -0400 Subject: [PATCH] update font_size to f32 in libghostty --- include/ghostty.h | 2 +- macos/Sources/Ghostty/SurfaceView.swift | 2 +- src/apprt/embedded.zig | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/ghostty.h b/include/ghostty.h index 22d42449c..890e5f50e 100644 --- a/include/ghostty.h +++ b/include/ghostty.h @@ -379,7 +379,7 @@ typedef struct { ghostty_platform_u platform; void* userdata; double scale_factor; - uint8_t font_size; + float font_size; const char* working_directory; const char* command; } ghostty_surface_config_s; diff --git a/macos/Sources/Ghostty/SurfaceView.swift b/macos/Sources/Ghostty/SurfaceView.swift index d007a898c..4d755e70e 100644 --- a/macos/Sources/Ghostty/SurfaceView.swift +++ b/macos/Sources/Ghostty/SurfaceView.swift @@ -252,7 +252,7 @@ extension Ghostty { /// libghostty, usually from the Ghostty configuration. struct SurfaceConfiguration { /// Explicit font size to use in points - var fontSize: UInt8? = nil + var fontSize: Float32? = nil /// Explicit working directory to set var workingDirectory: String? = nil diff --git a/src/apprt/embedded.zig b/src/apprt/embedded.zig index 341de5eb7..4c9db1988 100644 --- a/src/apprt/embedded.zig +++ b/src/apprt/embedded.zig @@ -314,7 +314,7 @@ pub const Surface = struct { scale_factor: f64 = 1, /// The font size to inherit. If 0, default font size will be used. - font_size: u8 = 0, + font_size: f32 = 0, /// The working directory to load into. working_directory: [*:0]const u8 = "", @@ -1049,7 +1049,7 @@ pub const Surface = struct { } fn newSurfaceOptions(self: *const Surface) apprt.Surface.Options { - const font_size: u8 = font_size: { + const font_size: f32 = font_size: { if (!self.app.config.@"window-inherit-font-size") break :font_size 0; break :font_size self.core_surface.font_size.points; };