diff --git a/src/rust-azure b/src/rust-azure index 5fc77111bbb..7d2543dceeb 160000 --- a/src/rust-azure +++ b/src/rust-azure @@ -1 +1 @@ -Subproject commit 5fc77111bbb003fbcd9ba15e4813b31eccf6943c +Subproject commit 7d2543dceeb05741637e6070d700ae3a85495010 diff --git a/src/rust-fontconfig b/src/rust-fontconfig index 2cdbb170c35..a508df34eae 160000 --- a/src/rust-fontconfig +++ b/src/rust-fontconfig @@ -1 +1 @@ -Subproject commit 2cdbb170c3591c08a872e30584fcaf490680a100 +Subproject commit a508df34eae1d5c2917200d94980989e309081cc diff --git a/src/rust-freetype b/src/rust-freetype index 6852c4a04e4..e7e82c62aae 160000 --- a/src/rust-freetype +++ b/src/rust-freetype @@ -1 +1 @@ -Subproject commit 6852c4a04e44d29dc410666ef551654a7e181d6c +Subproject commit e7e82c62aae80d5502b89c8cbbb6f7d4b341b9e2 diff --git a/src/rust-xlib b/src/rust-xlib index 754ac8e774d..c38348c219c 160000 --- a/src/rust-xlib +++ b/src/rust-xlib @@ -1 +1 @@ -Subproject commit 754ac8e774d9ac7b8577b6a0b775a54e1f00a262 +Subproject commit c38348c219caf2be3cc50baa4ffa7a06f041e29b diff --git a/src/servo-gfx/fontconfig/font_list.rs b/src/servo-gfx/fontconfig/font_list.rs index 9f6b3466b93..6ab2668b1f6 100644 --- a/src/servo-gfx/fontconfig/font_list.rs +++ b/src/servo-gfx/fontconfig/font_list.rs @@ -1,25 +1,22 @@ extern mod freetype; extern mod fontconfig; -use gfx_font::{FontHandle, FontHandleMethods}; +use gfx_font::FontHandleMethods; use gfx_font_list::{FontEntry, FontFamily, FontFamilyMap}; use gfx_font_context::FontContextHandleMethods; use freetype_impl::font_context::FreeTypeFontContextHandle; use freetype_impl::font::FreeTypeFontHandle; -use self::fontconfig::fontconfig::{FcConfig, FcFontSet, FcChar8, - FcResultMatch, FcSetSystem, FcPattern, +use self::fontconfig::fontconfig::{FcChar8, FcResultMatch, FcSetSystem, FcResultNoMatch, FcMatchPattern}; use self::fontconfig::fontconfig::bindgen::{ FcConfigGetCurrent, FcConfigGetFonts, FcPatternGetString, - FcInitReinitialize, FcPatternDestroy, FcPatternReference, - FcFontSetDestroy, FcCharSetDestroy, FcConfigSubstitute, + FcPatternDestroy, FcFontSetDestroy, FcConfigSubstitute, FcDefaultSubstitute, FcPatternCreate, FcPatternAddString, - FcFontMatch, FcFontSetCreate, FcFontSetList, FcPatternPrint, - FcObjectSetCreate, FcObjectSetDestroy, FcObjectSetAdd, - FcPatternGetInteger + FcFontMatch, FcFontSetList, FcObjectSetCreate, FcObjectSetDestroy, + FcObjectSetAdd, FcPatternGetInteger }; -use core::hashmap::linear; +use core::hashmap::HashMap; use core::libc::c_int; use core::ptr::Ptr; use native; @@ -34,7 +31,7 @@ pub impl FontconfigFontListHandle { } fn get_available_families(&self) -> FontFamilyMap { - let mut family_map : FontFamilyMap = linear::LinearMap::new(); + let mut family_map : FontFamilyMap = HashMap::new(); unsafe { let config = FcConfigGetCurrent(); let fontSet = FcConfigGetFonts(config, FcSetSystem); @@ -65,13 +62,13 @@ pub impl FontconfigFontListHandle { do str::as_c_str("family") |FC_FAMILY| { do str::as_c_str(family.family_name) |family_name| { let pattern = FcPatternCreate(); - fail_unless!(pattern.is_not_null()); + assert!(pattern.is_not_null()); let family_name = family_name as *FcChar8; let ok = FcPatternAddString(pattern, FC_FAMILY, family_name); - fail_unless!(ok != 0); + assert!(ok != 0); let object_set = FcObjectSetCreate(); - fail_unless!(object_set.is_not_null()); + assert!(object_set.is_not_null()); str::as_c_str("file", |FC_FILE| FcObjectSetAdd(object_set, FC_FILE) ); str::as_c_str("index", |FC_INDEX| FcObjectSetAdd(object_set, FC_INDEX) ); diff --git a/src/servo-gfx/freetype_impl/font.rs b/src/servo-gfx/freetype_impl/font.rs index 2ab0fa6f882..234ffaeb00e 100644 --- a/src/servo-gfx/freetype_impl/font.rs +++ b/src/servo-gfx/freetype_impl/font.rs @@ -4,7 +4,6 @@ use native; use freetype_impl::font_context::FreeTypeFontContextHandle; use gfx_font::{ CSSFontWeight, - FontHandle, FontHandleMethods, FontMetrics, FontTable, @@ -30,7 +29,6 @@ use text::util::{float_to_fixed, fixed_to_float}; use self::freetype::freetype::{ FTErrorMethods, - FT_Error, FT_F26Dot6, FT_Face, FT_FaceRec, @@ -38,7 +36,6 @@ use self::freetype::freetype::{ FT_Library, FT_Long, FT_ULong, - FT_Size, FT_SizeRec, FT_UInt, FT_Size_Metrics, @@ -47,8 +44,6 @@ use self::freetype::freetype::{ ft_sfnt_os2 }; use self::freetype::freetype::bindgen::{ - FT_Init_FreeType, - FT_Done_FreeType, FT_New_Memory_Face, FT_Done_Face, FT_Get_Char_Index, @@ -90,9 +85,10 @@ pub struct FreeTypeFontHandle { face: FT_Face, } +#[unsafe_destructor] impl Drop for FreeTypeFontHandle { fn finalize(&self) { - fail_unless!(self.face.is_not_null()); + assert!(self.face.is_not_null()); if !FT_Done_Face(self.face).succeeded() { fail!(~"FT_Done_Face failed"); } @@ -245,7 +241,7 @@ impl FontHandleMethods for FreeTypeFontHandle { pub fn glyph_index(&self, codepoint: char) -> Option { - fail_unless!(self.face.is_not_null()); + assert!(self.face.is_not_null()); let idx = FT_Get_Char_Index(self.face, codepoint as FT_ULong); return if idx != 0 as FT_UInt { Some(idx as GlyphIndex) @@ -257,13 +253,13 @@ impl FontHandleMethods for FreeTypeFontHandle { pub fn glyph_h_advance(&self, glyph: GlyphIndex) -> Option { - fail_unless!(self.face.is_not_null()); + assert!(self.face.is_not_null()); let res = FT_Load_Glyph(self.face, glyph as FT_UInt, 0); if res.succeeded() { unsafe { let void_glyph = (*self.face).glyph; let slot: FT_GlyphSlot = cast::transmute(void_glyph); - fail_unless!(slot.is_not_null()); + assert!(slot.is_not_null()); debug!("metrics: %?", (*slot).metrics); let advance = (*slot).metrics.horiAdvance; debug!("h_advance for %? is %?", glyph, advance); @@ -324,7 +320,7 @@ pub impl FreeTypeFontHandle { let x_scale = (metrics.x_ppem as float) / em_size as float; // If this isn't true then we're scaling one of the axes wrong - fail_unless!(metrics.x_ppem == metrics.y_ppem); + assert!(metrics.x_ppem == metrics.y_ppem); return geometry::from_frac_px(value * x_scale); } diff --git a/src/servo-gfx/freetype_impl/font_context.rs b/src/servo-gfx/freetype_impl/font_context.rs index 4671b6d49ff..98b5615bbaf 100644 --- a/src/servo-gfx/freetype_impl/font_context.rs +++ b/src/servo-gfx/freetype_impl/font_context.rs @@ -3,7 +3,6 @@ extern mod fontconfig; use self::freetype::freetype::{ FTErrorMethods, - FT_Error, FT_Library, }; use self::freetype::freetype::bindgen::{ @@ -25,7 +24,7 @@ struct FreeTypeLibraryHandle { impl Drop for FreeTypeLibraryHandle { fn finalize(&self) { - fail_unless!(self.ctx.is_not_null()); + assert!(self.ctx.is_not_null()); FT_Done_FreeType(self.ctx); } }