mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Implement get_table_for_tag on FreeType
Also fixes use-after-free of FontTable buffers.
This commit is contained in:
parent
3f9b6f8586
commit
afafb0b71c
10 changed files with 41 additions and 33 deletions
|
@ -42,7 +42,7 @@ pub trait FontHandleMethods: Sized {
|
|||
fn glyph_h_advance(&self, GlyphId) -> Option<FractionalPixel>;
|
||||
fn glyph_h_kerning(&self, GlyphId, GlyphId) -> FractionalPixel;
|
||||
fn metrics(&self) -> FontMetrics;
|
||||
fn get_table_for_tag(&self, FontTableTag) -> Option<FontTable>;
|
||||
fn get_table_for_tag(&self, FontTableTag) -> Option<Box<FontTable>>;
|
||||
}
|
||||
|
||||
// Used to abstract over the shaper's choice of fixed int representation.
|
||||
|
@ -170,7 +170,7 @@ impl Font {
|
|||
self.shaper.as_ref().unwrap()
|
||||
}
|
||||
|
||||
pub fn get_table_for_tag(&self, tag: FontTableTag) -> Option<FontTable> {
|
||||
pub fn get_table_for_tag(&self, tag: FontTableTag) -> Option<Box<FontTable>> {
|
||||
let result = self.handle.get_table_for_tag(tag);
|
||||
let status = if result.is_some() { "Found" } else { "Didn't find" };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue