mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
auto merge of #4568 : gilles-leblanc/servo/issue-4556, r=Manishearth
Fixes #4556
This commit is contained in:
commit
9fd675c266
2 changed files with 8 additions and 18 deletions
|
@ -47,13 +47,17 @@ use std::mem;
|
|||
use std::cmp;
|
||||
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 CONTINUATION_BYTE: i32 = -2;
|
||||
|
||||
static KERN: u32 = ((b'k' as u32) << 24) | ((b'e' as u32) << 16) | ((b'r' as u32) << 8) |
|
||||
(b'n' as u32);
|
||||
static LIGA: u32 = ((b'l' as u32) << 24) | ((b'i' as u32) << 16) | ((b'g' as u32) << 8) |
|
||||
(b'a' as u32);
|
||||
static KERN: u32 = hb_tag!('k', 'e', 'r', 'n');
|
||||
static LIGA: u32 = hb_tag!('l', 'i', 'g', 'a');
|
||||
|
||||
pub struct ShapedGlyphData {
|
||||
count: int,
|
||||
|
|
|
@ -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]
|
||||
fn test_transform_compress_none() {
|
||||
let test_strs = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue