diff --git a/src/components/gfx/font.rs b/src/components/gfx/font.rs index f6dbd5063a1..36503e33960 100644 --- a/src/components/gfx/font.rs +++ b/src/components/gfx/font.rs @@ -43,8 +43,6 @@ pub trait FontHandleMethods { fn is_italic(&self) -> bool; fn boldness(&self) -> font_weight::T; - fn clone_with_style(&self, fctx: &FontContextHandle, style: &UsedFontStyle) - -> Result; fn glyph_index(&self, codepoint: char) -> Option; fn glyph_h_advance(&self, GlyphId) -> Option; fn get_metrics(&self) -> FontMetrics; @@ -253,19 +251,6 @@ impl<'a> Font { } } - pub fn new_from_existing_handle(fctx: &FontContext, handle: &FontHandle, - style: &SpecifiedFontStyle, backend: BackendType) - -> Result>,()> { - - // TODO(Issue #179): convert between specified and used font style here? - let styled_handle = match handle.clone_with_style(&fctx.handle, style) { - Ok(result) => result, - Err(()) => return Err(()) - }; - - return Ok(Rc::new(RefCell::new(Font::new_from_adopted_handle(fctx, styled_handle, style, backend)))); - } - fn make_shaper(&'a mut self) -> &'a Shaper { // fast path: already created a shaper match self.shaper { diff --git a/src/components/gfx/platform/android/font.rs b/src/components/gfx/platform/android/font.rs index e0dd18d8b55..3ba5b3e629a 100644 --- a/src/components/gfx/platform/android/font.rs +++ b/src/components/gfx/platform/android/font.rs @@ -160,19 +160,6 @@ impl FontHandleMethods for FontHandle { } } - fn clone_with_style(&self, - fctx: &FontContextHandle, - style: &UsedFontStyle) -> Result { - match self.source { - FontSourceMem(ref buf) => { - FontHandleMethods::new_from_buffer(fctx, buf.clone(), style) - } - FontSourceFile(ref file) => { - FontHandle::new_from_file(fctx, file.as_slice(), style) - } - } - } - fn glyph_index(&self, codepoint: char) -> Option { assert!(self.face.is_not_null()); diff --git a/src/components/gfx/platform/linux/font.rs b/src/components/gfx/platform/linux/font.rs index 72d5c5b8693..4df1b775aa9 100644 --- a/src/components/gfx/platform/linux/font.rs +++ b/src/components/gfx/platform/linux/font.rs @@ -5,7 +5,7 @@ extern crate freetype; use font::{FontHandleMethods, FontMetrics, FontTableMethods}; -use font::{FontTableTag, FractionalPixel, SpecifiedFontStyle, UsedFontStyle}; +use font::{FontTableTag, FractionalPixel, SpecifiedFontStyle}; use servo_util::geometry::Au; use servo_util::geometry; use platform::font_context::FontContextHandle; @@ -160,19 +160,6 @@ impl FontHandleMethods for FontHandle { } } - fn clone_with_style(&self, - fctx: &FontContextHandle, - style: &UsedFontStyle) -> Result { - match self.source { - FontSourceMem(ref buf) => { - FontHandleMethods::new_from_buffer(fctx, buf.clone(), style) - } - FontSourceFile(ref file) => { - FontHandle::new_from_file(fctx, file.as_slice(), style) - } - } - } - fn glyph_index(&self, codepoint: char) -> Option { assert!(self.face.is_not_null()); diff --git a/src/components/gfx/platform/macos/font.rs b/src/components/gfx/platform/macos/font.rs index ac0d1fff414..2edb233a527 100644 --- a/src/components/gfx/platform/macos/font.rs +++ b/src/components/gfx/platform/macos/font.rs @@ -119,12 +119,6 @@ impl FontHandleMethods for FontHandle { return font_weight::Weight900; } - fn clone_with_style(&self, fctx: &FontContextHandle, style: &SpecifiedFontStyle) - -> Result { - let new_font = self.ctfont.clone_with_font_size(style.pt_size); - return FontHandle::new_from_CTFont(fctx, new_font); - } - fn glyph_index(&self, codepoint: char) -> Option { let characters: [UniChar, ..1] = [codepoint as UniChar]; let glyphs: [CGGlyph, ..1] = [0 as CGGlyph];