mirror of
https://github.com/servo/servo.git
synced 2025-08-17 03:15:34 +01:00
fonts: Start using fontations
to read font tables (#37287)
Use `read-fonts` to read font tables for FreeType fonts. This is the first step to using fontations throughout Servo. The main benefit here is that we no longer need to provide our own table data structures and we can read tables from these fonts without making copies of the table contents. Testing: This should not change observable behavior and is covered by existing WPT tests. I have run some manual microbenchmarks and have not noticed any changes in performance that are larger than the general noise. This adds a new memory map of the font file for local fonts, but this should be very cheap as FreeType is already doing this internally and subsequent maps should just reuuse the existing memory-mapped file. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
1044f8fbf5
commit
29e618dcf7
5 changed files with 107 additions and 109 deletions
|
@ -143,7 +143,7 @@ pub trait FontTableMethods {
|
|||
fn buffer(&self) -> &[u8];
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, MallocSizeOf, PartialEq, Serialize)]
|
||||
pub struct FontMetrics {
|
||||
pub underline_size: Au,
|
||||
pub underline_offset: Au,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue