mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
fonts: Enable fast text shaping on Windows (#33123)
* Use patched dwrote Signed-off-by: crbrz <cristianb@gmail.com> * Enable fast text shaping Signed-off-by: crbrz <cristianb@gmail.com> * Add fast text shape test Signed-off-by: crbrz <cristianb@gmail.com> * Update dwrote to 0.11.1 Signed-off-by: crbrz <cristianb@gmail.com> --------- Signed-off-by: crbrz <cristianb@gmail.com>
This commit is contained in:
parent
6f333a8e29
commit
4ae2610c24
4 changed files with 103 additions and 15 deletions
|
@ -213,15 +213,15 @@ impl PlatformFontMethods for PlatformFont {
|
|||
|
||||
/// Can this font do basic horizontal LTR shaping without Harfbuzz?
|
||||
fn can_do_fast_shaping(&self) -> bool {
|
||||
// TODO copy CachedKernTable from the MacOS X implementation to
|
||||
// somehwere global and use it here. We could also implement the
|
||||
// IDirectWriteFontFace1 interface and use the glyph kerning pair
|
||||
// methods there.
|
||||
false
|
||||
self.face.has_kerning_pairs()
|
||||
}
|
||||
|
||||
fn glyph_h_kerning(&self, _: GlyphId, _: GlyphId) -> FractionalPixel {
|
||||
0.0
|
||||
fn glyph_h_kerning(&self, first_glyph: GlyphId, second_glyph: GlyphId) -> FractionalPixel {
|
||||
let adjustment = self
|
||||
.face
|
||||
.get_glyph_pair_kerning_adjustment(first_glyph as u16, second_glyph as u16);
|
||||
|
||||
(adjustment as f32 * self.scaled_du_to_px) as FractionalPixel
|
||||
}
|
||||
|
||||
fn metrics(&self) -> FontMetrics {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue