diff --git a/src/components/gfx/font_context.rs b/src/components/gfx/font_context.rs index 72b37de0d25..256e31329cc 100644 --- a/src/components/gfx/font_context.rs +++ b/src/components/gfx/font_context.rs @@ -31,7 +31,6 @@ pub fn dummy_style() -> FontStyle { } pub trait FontContextHandleMethods { - fn clone(&self) -> FontContextHandle; fn create_font_from_identifier(&self, ~str, UsedFontStyle) -> Result; } diff --git a/src/components/gfx/platform/linux/font.rs b/src/components/gfx/platform/linux/font.rs index 05f792ca1a4..0f4e2b3b331 100644 --- a/src/components/gfx/platform/linux/font.rs +++ b/src/components/gfx/platform/linux/font.rs @@ -8,7 +8,6 @@ use font::{CSSFontWeight, FontHandleMethods, FontMetrics, FontTableMethods}; use font::{FontTableTag, FractionalPixel, SpecifiedFontStyle, UsedFontStyle, FontWeight100}; use font::{FontWeight200, FontWeight300, FontWeight400, FontWeight500, FontWeight600}; use font::{FontWeight700, FontWeight800, FontWeight900}; -use font_context::FontContextHandleMethods; use servo_util::geometry::Au; use servo_util::geometry; use platform::font_context::FontContextHandle; diff --git a/src/components/gfx/platform/linux/font_context.rs b/src/components/gfx/platform/linux/font_context.rs index b975005bc9b..8fd427ec411 100644 --- a/src/components/gfx/platform/linux/font_context.rs +++ b/src/components/gfx/platform/linux/font_context.rs @@ -18,6 +18,7 @@ struct FreeTypeLibraryHandle { ctx: FT_Library, } +#[deriving(Clone)] pub struct FontContextHandle { ctx: Arc, } @@ -35,7 +36,7 @@ impl FontContextHandle { pub fn new() -> FontContextHandle { unsafe { let ctx: FT_Library = ptr::null(); - let result = FT_Init_FreeType(ptr::to_unsafe_ptr(&ctx)); + let result = FT_Init_FreeType(&ctx); if !result.succeeded() { fail!("Unable to initialize FreeType library"); } FontContextHandle { ctx: Arc::new(FreeTypeLibraryHandle { ctx: ctx }), @@ -45,12 +46,6 @@ impl FontContextHandle { } impl FontContextHandleMethods for FontContextHandle { - fn clone(&self) -> FontContextHandle { - FontContextHandle { - ctx: self.ctx.clone() - } - } - fn create_font_from_identifier(&self, name: ~str, style: UsedFontStyle) -> Result { debug!("Creating font handle for {:s}", name); diff --git a/src/components/gfx/platform/linux/font_list.rs b/src/components/gfx/platform/linux/font_list.rs index 74fe4449445..deadb966245 100644 --- a/src/components/gfx/platform/linux/font_list.rs +++ b/src/components/gfx/platform/linux/font_list.rs @@ -19,7 +19,6 @@ use fontconfig::fontconfig::{ use font::{FontHandleMethods, UsedFontStyle}; -use font_context::FontContextHandleMethods; use font_list::{FontEntry, FontFamily, FontFamilyMap}; use platform::font::FontHandle; use platform::font_context::FontContextHandle; diff --git a/src/components/gfx/platform/macos/font_context.rs b/src/components/gfx/platform/macos/font_context.rs index 0c824073573..4a4afe6cefb 100644 --- a/src/components/gfx/platform/macos/font_context.rs +++ b/src/components/gfx/platform/macos/font_context.rs @@ -8,10 +8,12 @@ use platform::macos::font::FontHandle; use core_text; +#[deriving(Clone)] pub struct FontContextHandle { ctx: () } +#[deriving(Clone)] impl FontContextHandle { // this is a placeholder until NSFontManager or whatever is bound in here. pub fn new() -> FontContextHandle { @@ -20,12 +22,6 @@ impl FontContextHandle { } impl FontContextHandleMethods for FontContextHandle { - fn clone(&self) -> FontContextHandle { - FontContextHandle { - ctx: self.ctx - } - } - fn create_font_from_identifier(&self, name: ~str, style: UsedFontStyle)