auto merge of #4568 : gilles-leblanc/servo/issue-4556, r=Manishearth

Fixes #4556
This commit is contained in:
bors-servo 2015-01-15 18:06:48 -07:00
commit 9fd675c266
2 changed files with 8 additions and 18 deletions

View file

@ -47,13 +47,17 @@ use std::mem;
use std::cmp; use std::cmp;
use std::ptr; use std::ptr;
macro_rules! hb_tag {
($t1:expr, $t2:expr, $t3:expr, $t4:expr) => (
(($t1 as u32) << 24) | (($t2 as u32) << 16) | (($t3 as u32) << 8) | ($t4 as u32)
);
}
static NO_GLYPH: i32 = -1; static NO_GLYPH: i32 = -1;
static CONTINUATION_BYTE: i32 = -2; static CONTINUATION_BYTE: i32 = -2;
static KERN: u32 = ((b'k' as u32) << 24) | ((b'e' as u32) << 16) | ((b'r' as u32) << 8) | static KERN: u32 = hb_tag!('k', 'e', 'r', 'n');
(b'n' as u32); static LIGA: u32 = hb_tag!('l', 'i', 'g', 'a');
static LIGA: u32 = ((b'l' as u32) << 24) | ((b'i' as u32) << 16) | ((b'g' as u32) << 8) |
(b'a' as u32);
pub struct ShapedGlyphData { pub struct ShapedGlyphData {
count: int, count: int,

View file

@ -128,20 +128,6 @@ pub fn fixed_to_rounded_int(before: int, f: i32) -> int {
} }
} }
/* Generate a 32-bit TrueType tag from its 4 characters */
pub fn true_type_tag(a: char, b: char, c: char, d: char) -> u32 {
let a = a as u32;
let b = b as u32;
let c = c as u32;
let d = d as u32;
(a << 24 | b << 16 | c << 8 | d) as u32
}
#[test]
fn test_true_type_tag() {
assert_eq!(true_type_tag('c', 'm', 'a', 'p'), 0x_63_6D_61_70_u32);
}
#[test] #[test]
fn test_transform_compress_none() { fn test_transform_compress_none() {
let test_strs = [ let test_strs = [