mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Remove unnecessary cycle between FontEntry and FontFamily.
This commit is contained in:
parent
c8b10ec6b8
commit
818d29d13a
3 changed files with 3 additions and 5 deletions
|
@ -132,7 +132,6 @@ impl FontFamily {
|
||||||
/// In the common case, each FontFamily will have a singleton FontEntry, or it will have the
|
/// In the common case, each FontFamily will have a singleton FontEntry, or it will have the
|
||||||
/// standard four faces: Normal, Bold, Italic, BoldItalic.
|
/// standard four faces: Normal, Bold, Italic, BoldItalic.
|
||||||
pub struct FontEntry {
|
pub struct FontEntry {
|
||||||
family: @mut FontFamily,
|
|
||||||
face_name: ~str,
|
face_name: ~str,
|
||||||
priv weight: CSSFontWeight,
|
priv weight: CSSFontWeight,
|
||||||
priv italic: bool,
|
priv italic: bool,
|
||||||
|
@ -141,9 +140,8 @@ pub struct FontEntry {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FontEntry {
|
impl FontEntry {
|
||||||
pub fn new(family: @mut FontFamily, handle: FontHandle) -> FontEntry {
|
pub fn new(handle: FontHandle) -> FontEntry {
|
||||||
FontEntry {
|
FontEntry {
|
||||||
family: family,
|
|
||||||
face_name: handle.face_name(),
|
face_name: handle.face_name(),
|
||||||
weight: handle.boldness(),
|
weight: handle.boldness(),
|
||||||
italic: handle.is_italic(),
|
italic: handle.is_italic(),
|
||||||
|
|
|
@ -116,7 +116,7 @@ pub impl FontListHandle {
|
||||||
let font_handle = font_handle.unwrap();
|
let font_handle = font_handle.unwrap();
|
||||||
|
|
||||||
debug!("Creating new FontEntry for face: %s", font_handle.face_name());
|
debug!("Creating new FontEntry for face: %s", font_handle.face_name());
|
||||||
let entry = @FontEntry::new(family, font_handle);
|
let entry = @FontEntry::new(font_handle);
|
||||||
family.entries.push(entry);
|
family.entries.push(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ pub impl FontListHandle {
|
||||||
let handle = result::unwrap(FontHandle::new_from_CTFont(&self.fctx, font));
|
let handle = result::unwrap(FontHandle::new_from_CTFont(&self.fctx, font));
|
||||||
|
|
||||||
debug!("Creating new FontEntry for face: %s", handle.face_name());
|
debug!("Creating new FontEntry for face: %s", handle.face_name());
|
||||||
let entry = @FontEntry::new(family, handle);
|
let entry = @FontEntry::new(handle);
|
||||||
family.entries.push(entry)
|
family.entries.push(entry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue