diff options
author | Bastien Orivel <eijebong@bananium.fr> | 2017-10-09 17:03:40 +0200 |
---|---|---|
committer | Bastien Orivel <eijebong@bananium.fr> | 2017-10-19 15:01:17 +0200 |
commit | e8e2d0a4b24475b018dbc7e59ea46fdceaf20815 (patch) | |
tree | bd56b4a2fc203150ee5c3b5e163937fb3b4e1989 /components/gfx/text | |
parent | 4cf2ce66fc4f970a47ab1fb4b9aa1a55282640f7 (diff) | |
download | servo-e8e2d0a4b24475b018dbc7e59ea46fdceaf20815.tar.gz servo-e8e2d0a4b24475b018dbc7e59ea46fdceaf20815.zip |
Update bitflags to 1.0 in every servo crate
It still needs dependencies update to remove all the other bitflags
versions.
Diffstat (limited to 'components/gfx/text')
-rw-r--r-- | components/gfx/text/shaping/harfbuzz.rs | 9 | ||||
-rw-r--r-- | components/gfx/text/text_run.rs | 6 |
2 files changed, 7 insertions, 8 deletions
diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/gfx/text/shaping/harfbuzz.rs index 27e614af158..36e35150ad1 100644 --- a/components/gfx/text/shaping/harfbuzz.rs +++ b/components/gfx/text/shaping/harfbuzz.rs @@ -6,8 +6,7 @@ use app_units::Au; use euclid::Point2D; -use font::{DISABLE_KERNING_SHAPING_FLAG, Font, FontTableMethods, FontTableTag}; -use font::{IGNORE_LIGATURES_SHAPING_FLAG, KERN, RTL_FLAG, ShapingOptions}; +use font::{ShapingFlags, Font, FontTableMethods, FontTableTag, ShapingOptions, KERN}; 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_buffer_create, hb_font_destroy}; @@ -189,7 +188,7 @@ impl ShaperMethods for Shaper { fn shape_text(&self, text: &str, options: &ShapingOptions, glyphs: &mut GlyphStore) { unsafe { let hb_buffer: *mut hb_buffer_t = hb_buffer_create(); - hb_buffer_set_direction(hb_buffer, if options.flags.contains(RTL_FLAG) { + hb_buffer_set_direction(hb_buffer, if options.flags.contains(ShapingFlags::RTL_FLAG) { HB_DIRECTION_RTL } else { HB_DIRECTION_LTR @@ -204,7 +203,7 @@ impl ShaperMethods for Shaper { text.len() as c_int); let mut features = Vec::new(); - if options.flags.contains(IGNORE_LIGATURES_SHAPING_FLAG) { + if options.flags.contains(ShapingFlags::IGNORE_LIGATURES_SHAPING_FLAG) { features.push(hb_feature_t { tag: LIGA, value: 0, @@ -212,7 +211,7 @@ impl ShaperMethods for Shaper { end: hb_buffer_get_length(hb_buffer), }) } - if options.flags.contains(DISABLE_KERNING_SHAPING_FLAG) { + if options.flags.contains(ShapingFlags::DISABLE_KERNING_SHAPING_FLAG) { features.push(hb_feature_t { tag: KERN, value: 0, diff --git a/components/gfx/text/text_run.rs b/components/gfx/text/text_run.rs index d34e4788cac..e66b6550dc3 100644 --- a/components/gfx/text/text_run.rs +++ b/components/gfx/text/text_run.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use app_units::Au; -use font::{Font, FontHandleMethods, FontMetrics, IS_WHITESPACE_SHAPING_FLAG, KEEP_ALL_FLAG}; +use font::{Font, FontHandleMethods, FontMetrics, ShapingFlags}; use font::{RunMetrics, ShapingOptions}; use platform::font_template::FontTemplateData; use range::Range; @@ -210,7 +210,7 @@ impl<'a> TextRun { .take_while(|&(_, c)| char_is_whitespace(c)).last() { whitespace.start = slice.start + i; slice.end = whitespace.start; - } else if idx != text.len() && options.flags.contains(KEEP_ALL_FLAG) { + } else if idx != text.len() && options.flags.contains(ShapingFlags::KEEP_ALL_FLAG) { // If there's no whitespace and word-break is set to // keep-all, try increasing the slice. continue; @@ -224,7 +224,7 @@ impl<'a> TextRun { } if whitespace.len() > 0 { let mut options = options.clone(); - options.flags.insert(IS_WHITESPACE_SHAPING_FLAG); + options.flags.insert(ShapingFlags::IS_WHITESPACE_SHAPING_FLAG); glyphs.push(GlyphRun { glyph_store: font.shape_text(&text[whitespace.clone()], &options), range: Range::new(ByteIndex(whitespace.start as isize), |