Remove unnecessary cycle between FontEntry and FontFamily.

This commit is contained in:
Josh Matthews 2013-05-22 14:02:32 -04:00
parent c8b10ec6b8
commit 818d29d13a
3 changed files with 3 additions and 5 deletions

View file

@ -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(),

View file

@ -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);
}

View file

@ -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)
}
}