diff options
author | Matt Brubeck <mbrubeck@limpet.net> | 2016-05-18 10:50:31 -0700 |
---|---|---|
committer | Matt Brubeck <mbrubeck@limpet.net> | 2016-05-19 09:44:56 -0700 |
commit | 0010b448b897afd8805b2f0976133b12a1b5411e (patch) | |
tree | 5d19cf106007a3bd3d162782d04aad61cc055ad1 | |
parent | 1eab6fbb2e71e8daeece6e29308f3be2b3c7c5a1 (diff) | |
download | servo-0010b448b897afd8805b2f0976133b12a1b5411e.tar.gz servo-0010b448b897afd8805b2f0976133b12a1b5411e.zip |
Move hb_tag! macro and KERN into font module
-rw-r--r-- | components/gfx/font.rs | 8 | ||||
-rw-r--r-- | components/gfx/lib.rs | 2 | ||||
-rw-r--r-- | components/gfx/text/shaping/harfbuzz.rs | 12 |
3 files changed, 11 insertions, 11 deletions
diff --git a/components/gfx/font.rs b/components/gfx/font.rs index f97c5373190..9c1afea6e57 100644 --- a/components/gfx/font.rs +++ b/components/gfx/font.rs @@ -24,6 +24,14 @@ use unicode_script::Script; use util::cache::HashCache; use webrender_traits; +macro_rules! ot_tag { + ($t1:expr, $t2:expr, $t3:expr, $t4:expr) => ( + (($t1 as u32) << 24) | (($t2 as u32) << 16) | (($t3 as u32) << 8) | ($t4 as u32) + ); +} + +pub const KERN: u32 = ot_tag!('k', 'e', 'r', 'n'); + static TEXT_SHAPING_PERFORMANCE_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT; // FontHandle encapsulates access to the platform's font API, diff --git a/components/gfx/lib.rs b/components/gfx/lib.rs index c48b536a567..736b77a8cb0 100644 --- a/components/gfx/lib.rs +++ b/components/gfx/lib.rs @@ -95,7 +95,7 @@ mod paint_context; pub mod display_list; // Fonts -pub mod font; +#[macro_use] pub mod font; pub mod font_cache_thread; pub mod font_context; pub mod font_template; diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/gfx/text/shaping/harfbuzz.rs index ff765818069..9f5615e491b 100644 --- a/components/gfx/text/shaping/harfbuzz.rs +++ b/components/gfx/text/shaping/harfbuzz.rs @@ -5,7 +5,7 @@ use app_units::Au; use euclid::Point2D; use font::{DISABLE_KERNING_SHAPING_FLAG, Font, FontTableMethods, FontTableTag}; -use font::{IGNORE_LIGATURES_SHAPING_FLAG, RTL_FLAG, ShapingOptions}; +use font::{IGNORE_LIGATURES_SHAPING_FLAG, KERN, RTL_FLAG, ShapingOptions}; use harfbuzz::{HB_DIRECTION_LTR, HB_DIRECTION_RTL, HB_MEMORY_MODE_READONLY}; use harfbuzz::{hb_blob_create, hb_face_create_for_tables}; use harfbuzz::{hb_blob_t}; @@ -39,16 +39,8 @@ use text::glyph::{ByteIndex, GlyphData, GlyphId, GlyphStore}; use text::shaping::ShaperMethods; use text::util::{fixed_to_float, float_to_fixed, is_bidi_control}; -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) - ); -} - const NO_GLYPH: i32 = -1; - -static KERN: u32 = hb_tag!('k', 'e', 'r', 'n'); -static LIGA: u32 = hb_tag!('l', 'i', 'g', 'a'); +const LIGA: u32 = ot_tag!('l', 'i', 'g', 'a'); pub struct ShapedGlyphData { count: usize, |