Use f32 instead of i32 for lengths

This allows users to use logical coordinates instead of physical ones.
This commit is contained in:
Héctor Ramón Jiménez 2023-02-04 11:13:53 +01:00
parent f08bea22ed
commit 4320ae6329
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
15 changed files with 203 additions and 155 deletions

View file

@ -31,7 +31,7 @@ fn swash_image(
// Build the scaler
let mut scaler = context
.builder(font.as_swash())
.size(cache_key.font_size as f32)
.size(f32::from_bits(cache_key.font_size_bits))
.hint(true)
.build();
@ -74,7 +74,7 @@ fn swash_outline_commands(
// Build the scaler
let mut scaler = context
.builder(font.as_swash())
.size(cache_key.font_size as f32)
.size(f32::from_bits(cache_key.font_size_bits))
.build();
// Scale the outline