update font_size to f32 in libghostty

This commit is contained in:
Qwerasd
2024-05-08 16:40:29 -04:00
parent 575a477be5
commit 5df0935f82
3 changed files with 4 additions and 4 deletions

View File

@ -379,7 +379,7 @@ typedef struct {
ghostty_platform_u platform; ghostty_platform_u platform;
void* userdata; void* userdata;
double scale_factor; double scale_factor;
uint8_t font_size; float font_size;
const char* working_directory; const char* working_directory;
const char* command; const char* command;
} ghostty_surface_config_s; } ghostty_surface_config_s;

View File

@ -252,7 +252,7 @@ extension Ghostty {
/// libghostty, usually from the Ghostty configuration. /// libghostty, usually from the Ghostty configuration.
struct SurfaceConfiguration { struct SurfaceConfiguration {
/// Explicit font size to use in points /// Explicit font size to use in points
var fontSize: UInt8? = nil var fontSize: Float32? = nil
/// Explicit working directory to set /// Explicit working directory to set
var workingDirectory: String? = nil var workingDirectory: String? = nil

View File

@ -314,7 +314,7 @@ pub const Surface = struct {
scale_factor: f64 = 1, scale_factor: f64 = 1,
/// The font size to inherit. If 0, default font size will be used. /// 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. /// The working directory to load into.
working_directory: [*:0]const u8 = "", working_directory: [*:0]const u8 = "",
@ -1049,7 +1049,7 @@ pub const Surface = struct {
} }
fn newSurfaceOptions(self: *const Surface) apprt.Surface.Options { 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; if (!self.app.config.@"window-inherit-font-size") break :font_size 0;
break :font_size self.core_surface.font_size.points; break :font_size self.core_surface.font_size.points;
}; };