mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Rename Au methods with f32/f64 instead of frac32/frac/subpx
This commit is contained in:
parent
32d5e24922
commit
8b522f2e7d
23 changed files with 99 additions and 99 deletions
|
@ -62,7 +62,7 @@ impl FontHandleMethods for FontHandle {
|
|||
pt_size: Option<Au>)
|
||||
-> Result<FontHandle, ()> {
|
||||
let size = match pt_size {
|
||||
Some(s) => s.to_subpx(),
|
||||
Some(s) => s.to_f64_px(),
|
||||
None => 0.0
|
||||
};
|
||||
match template.ctfont {
|
||||
|
@ -162,7 +162,7 @@ impl FontHandleMethods for FontHandle {
|
|||
let bounding_rect: CGRect = self.ctfont.bounding_box();
|
||||
let ascent = self.ctfont.ascent() as f64;
|
||||
let descent = self.ctfont.descent() as f64;
|
||||
let em_size = Au::from_frac_px(self.ctfont.pt_size() as f64);
|
||||
let em_size = Au::from_f64_px(self.ctfont.pt_size() as f64);
|
||||
let leading = self.ctfont.leading() as f64;
|
||||
|
||||
let scale = px_to_pt(self.ctfont.pt_size() as f64) / (ascent + descent);
|
||||
|
@ -171,7 +171,7 @@ impl FontHandleMethods for FontHandle {
|
|||
let max_advance_width = Au::from_pt(bounding_rect.size.width as f64);
|
||||
let average_advance = self.glyph_index('0')
|
||||
.and_then(|idx| self.glyph_h_advance(idx))
|
||||
.map(|advance| Au::from_frac_px(advance))
|
||||
.map(|advance| Au::from_f64_px(advance))
|
||||
.unwrap_or(max_advance_width);
|
||||
|
||||
let metrics = FontMetrics {
|
||||
|
@ -191,7 +191,7 @@ impl FontHandleMethods for FontHandle {
|
|||
descent: Au::from_pt(descent * scale),
|
||||
max_advance: max_advance_width,
|
||||
average_advance: average_advance,
|
||||
line_gap: Au::from_frac_px(line_gap),
|
||||
line_gap: Au::from_f64_px(line_gap),
|
||||
};
|
||||
debug!("Font metrics (@{} pt): {:?}", self.ctfont.pt_size() as f64, metrics);
|
||||
return metrics;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue