mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
parent
00e3a2144d
commit
79789a18de
2 changed files with 20 additions and 2 deletions
|
@ -231,6 +231,15 @@ impl FontHandleMethods for FontHandle {
|
|||
let descent = self.font_units_to_au(face.descender as float);
|
||||
let max_advance = self.font_units_to_au(face.max_advance_width as float);
|
||||
|
||||
// 'leading' is supposed to be the vertical distance between two baselines,
|
||||
// reflected by the height attibute in freetype. On OS X (w/ CTFont),
|
||||
// leading represents the distance between the bottom of a line descent to
|
||||
// the top of the next line's ascent or: (line_height - ascent - descent),
|
||||
// see http://stackoverflow.com/a/5635981 for CTFont implementation.
|
||||
// Convert using a formular similar to what CTFont returns for consistency.
|
||||
let height = self.font_units_to_au(face.height as float);
|
||||
let leading = height - (ascent + descent);
|
||||
|
||||
let mut strikeout_size = geometry::from_pt(0.0);
|
||||
let mut strikeout_offset = geometry::from_pt(0.0);
|
||||
let mut x_height = geometry::from_pt(0.0);
|
||||
|
@ -249,7 +258,7 @@ impl FontHandleMethods for FontHandle {
|
|||
underline_offset: underline_offset,
|
||||
strikeout_size: strikeout_size,
|
||||
strikeout_offset: strikeout_offset,
|
||||
leading: geometry::from_pt(0.0), //FIXME
|
||||
leading: leading,
|
||||
x_height: x_height,
|
||||
em_size: em_size,
|
||||
ascent: ascent,
|
||||
|
|
|
@ -230,6 +230,15 @@ impl FontHandleMethods for FontHandle {
|
|||
let descent = self.font_units_to_au(face.descender as f64);
|
||||
let max_advance = self.font_units_to_au(face.max_advance_width as f64);
|
||||
|
||||
// 'leading' is supposed to be the vertical distance between two baselines,
|
||||
// reflected by the height attibute in freetype. On OS X (w/ CTFont),
|
||||
// leading represents the distance between the bottom of a line descent to
|
||||
// the top of the next line's ascent or: (line_height - ascent - descent),
|
||||
// see http://stackoverflow.com/a/5635981 for CTFont implementation.
|
||||
// Convert using a formular similar to what CTFont returns for consistency.
|
||||
let height = self.font_units_to_au(face.height as f64);
|
||||
let leading = height - (ascent + descent);
|
||||
|
||||
let mut strikeout_size = geometry::from_pt(0.0);
|
||||
let mut strikeout_offset = geometry::from_pt(0.0);
|
||||
let mut x_height = geometry::from_pt(0.0);
|
||||
|
@ -248,7 +257,7 @@ impl FontHandleMethods for FontHandle {
|
|||
underline_offset: underline_offset,
|
||||
strikeout_size: strikeout_size,
|
||||
strikeout_offset: strikeout_offset,
|
||||
leading: geometry::from_pt(0.0), //FIXME
|
||||
leading: leading,
|
||||
x_height: x_height,
|
||||
em_size: em_size,
|
||||
ascent: ascent,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue