@@ -26,10 +26,10 @@ use crate::metrics::{
26
26
use crate :: parse_utils:: {
27
27
fixed_word_to_i32, BigEndianValue , FromFontBufInPlace , TransmuteFontBufInPlace ,
28
28
} ;
29
- #[ cfg( target_os = "axle" ) ]
29
+ #[ cfg( any ( target_os = "axle" , feature = "no_std" ) ) ]
30
30
use axle_rt:: println;
31
31
use core:: ptr:: slice_from_raw_parts;
32
- #[ cfg( not( target_os = "axle" ) ) ]
32
+ #[ cfg( not( any ( target_os = "axle" , feature = "no_std" ) ) ) ]
33
33
use std:: println;
34
34
35
35
#[ repr( C , packed) ]
@@ -334,23 +334,26 @@ impl<'a> FontParser<'a> {
334
334
pub fn parse ( & mut self ) -> Font {
335
335
let mut cursor = 0 ;
336
336
let offset_subtable = OffsetSubtable :: from_in_place_buf ( self . read_with_cursor ( & mut cursor) ) ;
337
- println ! ( "Got offset subtable {offset_subtable:?}" , ) ;
337
+ // println!("Got offset subtable {offset_subtable:?}",);
338
338
339
339
for i in 0 ..offset_subtable. num_tables {
340
340
let table = TableHeader :: new ( self . read_with_cursor ( & mut cursor) ) ;
341
- println ! ( "Table #{i}: {table}" ) ;
341
+ // println!("Table #{i}: {table}");
342
342
self . table_headers . insert ( table. tag , table) ;
343
343
}
344
344
let head = self . parse_table ( "head" ) ;
345
345
self . head = Some ( head) ;
346
- println ! ( "Found head: {:?}" , head) ;
346
+ // println!("Found head: {:?}", head);
347
347
let glyph_bounding_box = head. glyph_bounding_box ;
348
348
349
349
let max_profile: MaxProfile = self . parse_table ( "maxp" ) ;
350
- println ! ( "Got max profile {max_profile:?}" ) ;
350
+ // println!("Got max profile {max_profile:?}");
351
351
352
352
let glyph_indexes_to_codepoints = parse_character_map ( self ) ;
353
353
354
+ let horizontal_glyph_metrics = parse_horizontal_metrics ( self ) ;
355
+ let vertical_glyph_metrics = parse_vertical_metrics ( self , max_profile. num_glyphs ) ;
356
+
354
357
let mut all_glyphs = vec ! [ ] ;
355
358
let mut codepoints_to_glyph_indexes = BTreeMap :: new ( ) ;
356
359
for i in 0 ..max_profile. num_glyphs {
@@ -365,8 +368,12 @@ impl<'a> FontParser<'a> {
365
368
}
366
369
}
367
370
368
- let horizontal_glyph_metrics = parse_horizontal_metrics ( self ) ;
369
- let vertical_glyph_metrics = parse_vertical_metrics ( self , max_profile. num_glyphs ) ;
371
+ /*
372
+ println!(
373
+ "num glyphs {} vert {:?}",
374
+ max_profile.num_glyphs, vertical_glyph_metrics
375
+ );
376
+ */
370
377
for ( i, glyph) in all_glyphs. iter ( ) . enumerate ( ) {
371
378
// Compound glyphs may inherit their metrics from one of their children
372
379
if let GlyphRenderInstructions :: CompoundGlyph ( compound_glyph_instructions) =
@@ -381,7 +388,7 @@ impl<'a> FontParser<'a> {
381
388
}
382
389
}
383
390
384
- if let Some ( horizontal_metrics) = horizontal_glyph_metrics. get ( i) {
391
+ if let Some ( horizontal_metrics) = horizontal_glyph_metrics. long_hor_metrics . get ( i) {
385
392
glyph
386
393
. render_metrics
387
394
. set_horizontal_metrics ( horizontal_metrics. clone ( ) ) ;
@@ -465,6 +472,7 @@ impl<'a> FontParser<'a> {
465
472
"abc" ,
466
473
& self . head . unwrap ( ) . glyph_bounding_box ,
467
474
self . head . unwrap ( ) . units_per_em as _ ,
475
+ horizontal_glyph_metrics,
468
476
all_glyphs,
469
477
codepoints_to_glyph_indexes,
470
478
function_boundaries_lookup_map,
0 commit comments