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