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
|
@ -11,7 +11,7 @@ mod font_template;
|
|||
mod glyph;
|
||||
#[allow(unsafe_code)]
|
||||
pub mod platform;
|
||||
mod shaper;
|
||||
mod shapers;
|
||||
mod system_font_service;
|
||||
|
||||
pub use font::*;
|
||||
|
@ -21,7 +21,7 @@ pub use font_template::*;
|
|||
pub use fonts_traits::*;
|
||||
pub use glyph::*;
|
||||
pub use platform::LocalFontIdentifier;
|
||||
pub use shaper::*;
|
||||
pub use shapers::*;
|
||||
pub use system_font_service::*;
|
||||
use unicode_properties::{EmojiStatus, UnicodeEmoji, emoji};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue