mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
auto merge of #904 : aydinkim/servo/PR, r=metajack
servo-android has been broken after newer rust included. fixed.
This commit is contained in:
commit
b4ffe3c3c2
6 changed files with 18 additions and 3 deletions
|
@ -62,6 +62,7 @@ pub struct FontHandle {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for FontHandle {
|
||||
#[fixed_stack_segment]
|
||||
fn drop(&self) {
|
||||
assert!(self.face.is_not_null());
|
||||
unsafe {
|
||||
|
@ -99,6 +100,7 @@ impl FontHandleMethods for FontHandle {
|
|||
Err(()) => Err(())
|
||||
};
|
||||
|
||||
#[fixed_stack_segment]
|
||||
fn create_face_from_buffer(lib: FT_Library,
|
||||
cbuf: *u8, cbuflen: uint, pt_size: float)
|
||||
-> Result<FT_Face, ()> {
|
||||
|
@ -130,12 +132,14 @@ impl FontHandleMethods for FontHandle {
|
|||
fn family_name(&self) -> ~str {
|
||||
unsafe { str::raw::from_c_str((*self.face).family_name) }
|
||||
}
|
||||
#[fixed_stack_segment]
|
||||
fn face_name(&self) -> ~str {
|
||||
unsafe { str::raw::from_c_str(FT_Get_Postscript_Name(self.face)) }
|
||||
}
|
||||
fn is_italic(&self) -> bool {
|
||||
unsafe { (*self.face).style_flags & FT_STYLE_FLAG_ITALIC != 0 }
|
||||
}
|
||||
#[fixed_stack_segment]
|
||||
fn boldness(&self) -> CSSFontWeight {
|
||||
let default_weight = FontWeight400;
|
||||
if unsafe { (*self.face).style_flags & FT_STYLE_FLAG_BOLD == 0 } {
|
||||
|
@ -178,6 +182,7 @@ impl FontHandleMethods for FontHandle {
|
|||
}
|
||||
}
|
||||
|
||||
#[fixed_stack_segment]
|
||||
fn glyph_index(&self,
|
||||
codepoint: char) -> Option<GlyphIndex> {
|
||||
assert!(self.face.is_not_null());
|
||||
|
@ -192,6 +197,7 @@ impl FontHandleMethods for FontHandle {
|
|||
}
|
||||
}
|
||||
|
||||
#[fixed_stack_segment]
|
||||
fn glyph_h_advance(&self,
|
||||
glyph: GlyphIndex) -> Option<FractionalPixel> {
|
||||
assert!(self.face.is_not_null());
|
||||
|
@ -242,6 +248,7 @@ impl FontHandleMethods for FontHandle {
|
|||
}
|
||||
|
||||
impl<'self> FontHandle {
|
||||
#[fixed_stack_segment]
|
||||
fn set_char_size(face: FT_Face, pt_size: float) -> Result<(), ()>{
|
||||
let char_width = float_to_fixed_ft(pt_size) as FT_F26Dot6;
|
||||
let char_height = float_to_fixed_ft(pt_size) as FT_F26Dot6;
|
||||
|
@ -254,6 +261,7 @@ impl<'self> FontHandle {
|
|||
}
|
||||
}
|
||||
|
||||
#[fixed_stack_segment]
|
||||
pub fn new_from_file(fctx: &FontContextHandle, file: ~str,
|
||||
style: &SpecifiedFontStyle) -> Result<FontHandle, ()> {
|
||||
unsafe {
|
||||
|
@ -281,6 +289,7 @@ impl<'self> FontHandle {
|
|||
}
|
||||
}
|
||||
|
||||
#[fixed_stack_segment]
|
||||
pub fn new_from_file_unstyled(fctx: &FontContextHandle, file: ~str)
|
||||
-> Result<FontHandle, ()> {
|
||||
unsafe {
|
||||
|
|
|
@ -17,6 +17,7 @@ struct FreeTypeLibraryHandle {
|
|||
}
|
||||
|
||||
impl Drop for FreeTypeLibraryHandle {
|
||||
#[fixed_stack_segment]
|
||||
fn drop(&self) {
|
||||
assert!(self.ctx.is_not_null());
|
||||
unsafe {
|
||||
|
@ -30,6 +31,7 @@ pub struct FontContextHandle {
|
|||
}
|
||||
|
||||
impl FontContextHandle {
|
||||
#[fixed_stack_segment]
|
||||
pub fn new() -> FontContextHandle {
|
||||
unsafe {
|
||||
let ctx: FT_Library = ptr::null();
|
||||
|
|
|
@ -39,6 +39,7 @@ impl FontListHandle {
|
|||
FontListHandle { fctx: fctx.clone() }
|
||||
}
|
||||
|
||||
#[fixed_stack_segment]
|
||||
pub fn get_available_families(&self) -> FontFamilyMap {
|
||||
let mut family_map : FontFamilyMap = HashMap::new();
|
||||
unsafe {
|
||||
|
@ -62,6 +63,7 @@ impl FontListHandle {
|
|||
return family_map;
|
||||
}
|
||||
|
||||
#[fixed_stack_segment]
|
||||
pub fn load_variations_for_family(&self, family: @mut FontFamily) {
|
||||
debug!("getting variations for %?", family);
|
||||
unsafe {
|
||||
|
@ -138,6 +140,7 @@ struct AutoPattern {
|
|||
}
|
||||
|
||||
impl Drop for AutoPattern {
|
||||
#[fixed_stack_segment]
|
||||
fn drop(&self) {
|
||||
unsafe {
|
||||
FcPatternDestroy(self.pattern);
|
||||
|
@ -145,6 +148,7 @@ impl Drop for AutoPattern {
|
|||
}
|
||||
}
|
||||
|
||||
#[fixed_stack_segment]
|
||||
pub fn path_from_identifier(name: ~str, style: &UsedFontStyle) -> Result<~str, ()> {
|
||||
unsafe {
|
||||
let config = FcConfigGetCurrent();
|
||||
|
|
|
@ -59,7 +59,7 @@ impl WindowMethods<Application> for Window {
|
|||
/// Creates a new window.
|
||||
fn new(_: &Application) -> @mut Window {
|
||||
// Create the GLUT window.
|
||||
unsafe { glut::glutInitWindowSize(800, 600); }
|
||||
glut::init_window_size(800, 600);
|
||||
let glut_window = glut::create_window(~"Servo");
|
||||
|
||||
// Create our window object.
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 24939d67ce465e3a44bb4adac56534c833478daf
|
||||
Subproject commit 91b81ab550ce175a868b91ca3290bd9ef64954cd
|
|
@ -1 +1 @@
|
|||
Subproject commit 3359d73650614921718b84d6c680cd7898b35df7
|
||||
Subproject commit 852c2c439b2198989181d52e39e0e8cb28d64179
|
Loading…
Add table
Add a link
Reference in a new issue