mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Rustfmt has changed its default style :/
This commit is contained in:
parent
82fc6d9f49
commit
be69f9c3e6
207 changed files with 1200 additions and 1339 deletions
|
@ -806,11 +806,12 @@ impl<'a> Iterator for GlyphIterator<'a> {
|
|||
}
|
||||
|
||||
// No glyph range. Look at next byte.
|
||||
self.byte_index = self.byte_index + if self.store.is_rtl {
|
||||
ByteIndex(-1)
|
||||
} else {
|
||||
ByteIndex(1)
|
||||
};
|
||||
self.byte_index = self.byte_index +
|
||||
if self.store.is_rtl {
|
||||
ByteIndex(-1)
|
||||
} else {
|
||||
ByteIndex(1)
|
||||
};
|
||||
let i = self.byte_index;
|
||||
if !self.byte_range.contains(i) {
|
||||
return None;
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
|
||||
#![allow(unsafe_code)]
|
||||
|
||||
use app_units::Au;
|
||||
use crate::font::{Font, FontTableMethods, FontTableTag, ShapingFlags, ShapingOptions, KERN};
|
||||
use crate::platform::font::FontTable;
|
||||
use crate::text::glyph::{ByteIndex, GlyphData, GlyphId, GlyphStore};
|
||||
use crate::text::shaping::ShaperMethods;
|
||||
use crate::text::util::{fixed_to_float, float_to_fixed, is_bidi_control};
|
||||
use app_units::Au;
|
||||
use euclid::Point2D;
|
||||
// Eventually we would like the shaper to be pluggable, as many operating systems have their own
|
||||
// shapers. For now, however, HarfBuzz is a hard dependency.
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use app_units::Au;
|
||||
use crate::font::{Font, FontHandleMethods, FontMetrics, ShapingFlags};
|
||||
use crate::font::{RunMetrics, ShapingOptions};
|
||||
use crate::platform::font_template::FontTemplateData;
|
||||
use crate::text::glyph::{ByteIndex, GlyphStore};
|
||||
use app_units::Au;
|
||||
use range::Range;
|
||||
use std::cell::Cell;
|
||||
use std::cmp::{max, Ordering};
|
||||
|
@ -293,9 +293,10 @@ impl<'a> TextRun {
|
|||
// TODO(Issue #98): using inter-char and inter-word spacing settings when measuring text
|
||||
self.natural_word_slices_in_range(range)
|
||||
.fold(Au(0), |advance, slice| {
|
||||
advance + slice
|
||||
.glyphs
|
||||
.advance_for_byte_range(&slice.range, self.extra_word_spacing)
|
||||
advance +
|
||||
slice
|
||||
.glyphs
|
||||
.advance_for_byte_range(&slice.range, self.extra_word_spacing)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue