mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
Shaper abstraction setup (#38755)
# Objective - Reorganise Servo's shaper code in preparation for multiple shaping backends - Make it possible to keep https://github.com/servo/servo/pull/38707 up-to-date with `main` with minimal conflicts ## Changes made - Split `components/fonts/shaper.rs` into `components/fonts/shapers/mod.rs` and `components/fonts/shapers/harfbuzz.rs` - Add traits for generic shapers - `ShapedGlyphData` now takes ownership of the HarfBuzz buffer (`hb_buffer_t`). This allows it to be returned from the`THarfShaper::shape_text` function. The buffer is now deallocated in the `ShapedGlyphData`s `Drop` impl. - Add traits for HarfBuzz-like shapers and move code from `save_glyph_results` function to be generic over those traits so that it can be shared by a future `HarfRust` backend. --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
This commit is contained in:
parent
d4757c9e9f
commit
b18a65ed70
4 changed files with 264 additions and 223 deletions
|
@ -52,6 +52,7 @@ pub const SBIX: OpenTypeTableTag = ot_tag!('s', 'b', 'i', 'x');
|
|||
pub const CBDT: OpenTypeTableTag = ot_tag!('C', 'B', 'D', 'T');
|
||||
pub const COLR: OpenTypeTableTag = ot_tag!('C', 'O', 'L', 'R');
|
||||
pub const BASE: OpenTypeTableTag = ot_tag!('B', 'A', 'S', 'E');
|
||||
pub const LIGA: OpenTypeTableTag = ot_tag!('l', 'i', 'g', 'a');
|
||||
|
||||
pub const LAST_RESORT_GLYPH_ADVANCE: FractionalPixel = 10.0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue