-
-
Save malramsay64/01ae2bdd3209aee55c7e75383d9cfa81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/font/src/darwin/mod.rs b/font/src/darwin/mod.rs | |
index 19c05d5..92787af 100644 | |
--- a/font/src/darwin/mod.rs | |
+++ b/font/src/darwin/mod.rs | |
@@ -425,11 +425,22 @@ impl Font { | |
// Strikeout and underline metrics | |
// CoreText doesn't provide strikeout so we provide our own | |
- let underline_position = self.ct_font.underline_position() as f32; | |
+ let underline_position = self.ct_font.underline_position() as f32 - descent as f32; | |
let underline_thickness = self.ct_font.underline_thickness() as f32; | |
- let strikeout_position = line_height as f32 / 2. + descent as f32; | |
+ let strikeout_position = (line_height / 2. - descent) as f32; | |
let strikeout_thickness = underline_thickness; | |
+ println!("-----------"); | |
+ println!("CELL_HEIGHT: {}", line_height); | |
+ println!("DESCENT: {}", descent); | |
+ println!("UNDERLINE POS: {}", underline_position); | |
+ println!("UNDERLINE THI: {}", underline_thickness); | |
+ println!("STRIKETHROUGH POS: {}", strikeout_position); | |
+ println!("STRIKETHROUGH THI: {}", strikeout_thickness); | |
+ println!("CALC POS: {}", underline_position); | |
+ println!("CALC THI: {}", underline_thickness); | |
+ println!("-----------"); | |
+ | |
Metrics { | |
average_advance: average_advance, | |
line_height: line_height, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment