diff options
| author | Qwerasd <qwerasd205@users.noreply.github.com> | 2024-05-08 14:23:20 -0400 |
|---|---|---|
| committer | Qwerasd <qwerasd205@users.noreply.github.com> | 2024-05-09 00:03:40 -0400 |
| commit | d4a75492225e571f91fcd6ef79662563fad9be94 (patch) | |
| tree | 600b0ed721ff97c1152bdc213c888dfbbaee38c5 /src/cli/args.zig | |
| parent | 08940940d57f7ede766588db9541aa1cb6db75d9 (diff) | |
feat(font): Non-integer point sizes
Allows for high dpi displays to get odd numbered pixel sizes, for
example, 13.5pt @ 2px/pt for 27px font. This implementation performs
all the sizing calculations with f32, rounding to the nearest pixel
size when it comes to rendering. In the future this can be enhanced
by adding fractional scaling to support fractional pixel sizes.
Diffstat (limited to 'src/cli/args.zig')
| -rw-r--r-- | src/cli/args.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cli/args.zig b/src/cli/args.zig index 49c5152ac..707416e38 100644 --- a/src/cli/args.zig +++ b/src/cli/args.zig @@ -250,8 +250,10 @@ fn parseIntoField( 0, ) catch return error.InvalidValue, - f64 => std.fmt.parseFloat( - f64, + f32, + f64, + => |Float| std.fmt.parseFloat( + Float, value orelse return error.ValueRequired, ) catch return error.InvalidValue, |
