mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Address review comments.
This commit is contained in:
parent
12978eeb50
commit
0c3cb39da3
4 changed files with 46 additions and 52 deletions
|
@ -109,8 +109,6 @@ pub struct Font {
|
|||
|
||||
impl Font {
|
||||
pub fn shape_text(&mut self, text: String, is_whitespace: bool) -> Arc<GlyphStore> {
|
||||
|
||||
//FIXME (ksh8281)
|
||||
self.make_shaper();
|
||||
let shaper = &self.shaper;
|
||||
self.shape_cache.find_or_create(&text, |txt| {
|
||||
|
|
|
@ -37,8 +37,8 @@ impl PartialEq for FontTemplateDescriptor {
|
|||
}
|
||||
|
||||
/// This describes all the information needed to create
|
||||
/// font instance handles. It contains a unique that is
|
||||
/// platform specific.
|
||||
/// font instance handles. It contains a unique
|
||||
/// FontTemplateData structure that is platform specific.
|
||||
pub struct FontTemplate {
|
||||
identifier: String,
|
||||
descriptor: Option<FontTemplateDescriptor>,
|
||||
|
|
|
@ -39,9 +39,7 @@ fn fixed_to_float_ft(f: i32) -> f64 {
|
|||
fixed_to_float(6, f)
|
||||
}
|
||||
|
||||
pub struct FontTable {
|
||||
_bogus: ()
|
||||
}
|
||||
pub struct FontTable;
|
||||
|
||||
impl FontTableMethods for FontTable {
|
||||
fn with_buffer(&self, _blk: |*u8, uint|) {
|
||||
|
@ -106,14 +104,14 @@ impl FontHandleMethods for FontHandle {
|
|||
if !result.succeeded() || face.is_null() {
|
||||
return Err(());
|
||||
}
|
||||
let is_ok = match pt_size {
|
||||
Some(s) => FontHandle::set_char_size(face, s).is_ok(),
|
||||
None => true,
|
||||
};
|
||||
if is_ok {
|
||||
Ok(face)
|
||||
} else {
|
||||
Err(())
|
||||
match pt_size {
|
||||
Some(s) => {
|
||||
match FontHandle::set_char_size(face, s) {
|
||||
Ok(_) => Ok(face),
|
||||
Err(_) => Err(()),
|
||||
}
|
||||
}
|
||||
None => Ok(face),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,9 +39,7 @@ fn fixed_to_float_ft(f: i32) -> f64 {
|
|||
fixed_to_float(6, f)
|
||||
}
|
||||
|
||||
pub struct FontTable {
|
||||
_bogus: ()
|
||||
}
|
||||
pub struct FontTable;
|
||||
|
||||
impl FontTableMethods for FontTable {
|
||||
fn with_buffer(&self, _blk: |*u8, uint|) {
|
||||
|
@ -106,14 +104,14 @@ impl FontHandleMethods for FontHandle {
|
|||
if !result.succeeded() || face.is_null() {
|
||||
return Err(());
|
||||
}
|
||||
let is_ok = match pt_size {
|
||||
Some(s) => FontHandle::set_char_size(face, s).is_ok(),
|
||||
None => true,
|
||||
};
|
||||
if is_ok {
|
||||
Ok(face)
|
||||
} else {
|
||||
Err(())
|
||||
match pt_size {
|
||||
Some(s) => {
|
||||
match FontHandle::set_char_size(face, s) {
|
||||
Ok(_) => Ok(face),
|
||||
Err(_) => Err(()),
|
||||
}
|
||||
}
|
||||
None => Ok(face),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue