diff --git a/src/Surface.zig b/src/Surface.zig index 1cbf256b0..fea791be1 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -321,8 +321,8 @@ pub fn init( // The font size we desire along with the DPI determined for the surface const font_size: font.face.DesiredSize = .{ .points = config.@"font-size", - .xdpi = x_dpi, - .ydpi = y_dpi, + .xdpi = @intFromFloat(x_dpi), + .ydpi = @intFromFloat(y_dpi), }; // Setup our font group. This will reuse an existing font group if @@ -1703,8 +1703,8 @@ pub fn contentScaleCallback(self: *Surface, content_scale: apprt.ContentScale) ! // Update our font size which is dependent on the DPI const size = size: { var size = self.font_size; - size.xdpi = x_dpi; - size.ydpi = y_dpi; + size.xdpi = @intFromFloat(x_dpi); + size.ydpi = @intFromFloat(y_dpi); break :size size; };