@@ -7,8 +7,8 @@ use ttf_parser::gdef::GlyphClass;
7
7
use ttf_parser:: { GlyphId , RgbaColor } ;
8
8
9
9
use super :: buffer:: GlyphPropsFlags ;
10
- use super :: fonta;
11
10
use super :: common:: TagExt ;
11
+ use super :: fonta;
12
12
use super :: ot_layout:: TableIndex ;
13
13
use crate :: Variation ;
14
14
@@ -22,15 +22,6 @@ pub struct hb_font_t<'a> {
22
22
pub ( crate ) points_per_em : Option < f32 > ,
23
23
}
24
24
25
- impl < ' a > core:: ops:: Deref for hb_font_t < ' a > {
26
- type Target = ttf_parser:: Face < ' a > ;
27
-
28
- #[ inline]
29
- fn deref ( & self ) -> & Self :: Target {
30
- & self . ttfp_face
31
- }
32
- }
33
-
34
25
impl < ' a > hb_font_t < ' a > {
35
26
/// Creates a new `Face` from data.
36
27
///
@@ -79,10 +70,15 @@ impl<'a> hb_font_t<'a> {
79
70
self . points_per_em = ptem;
80
71
}
81
72
73
+ pub ( crate ) fn tables ( & self ) -> & ttf_parser:: FaceTables < ' a > {
74
+ self . ttfp_face . tables ( )
75
+ }
76
+
82
77
/// Sets font variations.
83
78
pub fn set_variations ( & mut self , variations : & [ Variation ] ) {
84
79
for variation in variations {
85
- self . ttfp_face . set_variation ( ttf_parser:: Tag ( variation. tag . as_u32 ( ) ) , variation. value ) ;
80
+ self . ttfp_face
81
+ . set_variation ( ttf_parser:: Tag ( variation. tag . as_u32 ( ) ) , variation. value ) ;
86
82
}
87
83
self . font . set_coords ( self . ttfp_face . variation_coordinates ( ) ) ;
88
84
}
@@ -215,7 +211,7 @@ impl<'a> hb_font_t<'a> {
215
211
return false ;
216
212
}
217
213
218
- if let Some ( clip_box) = colr. clip_box ( glyph, self . variation_coordinates ( ) ) {
214
+ if let Some ( clip_box) = colr. clip_box ( glyph, self . ttfp_face . variation_coordinates ( ) ) {
219
215
// Floor
220
216
glyph_extents. x_bearing = ( clip_box. x_min ) . round ( ) as i32 ;
221
217
glyph_extents. y_bearing = ( clip_box. y_max ) . round ( ) as i32 ;
@@ -230,7 +226,7 @@ impl<'a> hb_font_t<'a> {
230
226
glyph,
231
227
0 ,
232
228
& mut extents_data,
233
- self . variation_coordinates ( ) ,
229
+ self . ttfp_face . variation_coordinates ( ) ,
234
230
RgbaColor :: new ( 0 , 0 , 0 , 0 ) ,
235
231
)
236
232
. is_some ( ) ;
0 commit comments