mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Further changes required by Servo
This commit is contained in:
parent
dcafbde256
commit
105050d46d
9 changed files with 72 additions and 88 deletions
|
@ -207,11 +207,10 @@ impl FontHandleMethods for FontHandle {
|
|||
}
|
||||
|
||||
fn style(&self) -> FontStyle {
|
||||
use style::values::generics::font::FontStyle::*;
|
||||
if self.ctfont.symbolic_traits().is_italic() {
|
||||
Italic
|
||||
FontStyle::ITALIC
|
||||
} else {
|
||||
Normal
|
||||
FontStyle::NORMAL
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -225,15 +224,12 @@ impl FontHandleMethods for FontHandle {
|
|||
} else {
|
||||
4.0 + normalized * 5.0 // [4.0, 9.0]
|
||||
}; // [1.0, 9.0], centered on 4.0
|
||||
FontWeight(normalized as f32 * 100.)
|
||||
FontWeight::from_float(normalized as f32 * 100.)
|
||||
}
|
||||
|
||||
fn stretchiness(&self) -> FontStretch {
|
||||
use style::values::computed::Percentage;
|
||||
use style::values::generics::NonNegative;
|
||||
|
||||
let normalized = self.ctfont.all_traits().normalized_width(); // [-1.0, 1.0]
|
||||
FontStretch(NonNegative(Percentage(normalized as f32 + 1.0)))
|
||||
FontStretch::from_percentage(normalized as f32 + 1.0)
|
||||
}
|
||||
|
||||
fn glyph_index(&self, codepoint: char) -> Option<GlyphId> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue