mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
remove FontContxtHandle.clone
This commit is contained in:
parent
301df201c3
commit
e1e59ac3b6
5 changed files with 4 additions and 16 deletions
|
@ -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<FontHandle, ()>;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -18,6 +18,7 @@ struct FreeTypeLibraryHandle {
|
|||
ctx: FT_Library,
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
pub struct FontContextHandle {
|
||||
ctx: Arc<FreeTypeLibraryHandle>,
|
||||
}
|
||||
|
@ -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<FontHandle, ()> {
|
||||
debug!("Creating font handle for {:s}", name);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue