mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
||||
/// standard four faces: Normal, Bold, Italic, BoldItalic.
|
||||
pub struct FontEntry {
|
||||
family: @mut FontFamily,
|
||||
face_name: ~str,
|
||||
priv weight: CSSFontWeight,
|
||||
priv italic: bool,
|
||||
|
@ -141,9 +140,8 @@ pub struct FontEntry {
|
|||
}
|
||||
|
||||
impl FontEntry {
|
||||
pub fn new(family: @mut FontFamily, handle: FontHandle) -> FontEntry {
|
||||
pub fn new(handle: FontHandle) -> FontEntry {
|
||||
FontEntry {
|
||||
family: family,
|
||||
face_name: handle.face_name(),
|
||||
weight: handle.boldness(),
|
||||
italic: handle.is_italic(),
|
||||
|
|
|
@ -116,7 +116,7 @@ pub impl FontListHandle {
|
|||
let font_handle = font_handle.unwrap();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ pub impl FontListHandle {
|
|||
let handle = result::unwrap(FontHandle::new_from_CTFont(&self.fctx, font));
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue