@@ -102,9 +102,7 @@ fn main() {
102102#[ derive( Debug , Clone ) ]
103103struct ChainedFeature {
104104 pub tag : String ,
105- pub name : String ,
106105 pub glyphs : Vec < String > ,
107- pub source_table : String ,
108106}
109107
110108fn build_glyph_map ( face : & ttf_parser:: Face ) -> std:: collections:: HashMap < u16 , char > {
@@ -150,7 +148,7 @@ fn extract_features_via_chained_sequences(
150148}
151149
152150fn extract_gsub_features_simplified (
153- face : & ttf_parser:: Face ,
151+ _face : & ttf_parser:: Face ,
154152 gsub_table : ttf_parser:: opentype_layout:: LayoutTable ,
155153 glyph_map : & std:: collections:: HashMap < u16 , char > ,
156154) -> Vec < ChainedFeature > {
@@ -160,7 +158,6 @@ fn extract_gsub_features_simplified(
160158 for i in 0 ..gsub_table. features . len ( ) {
161159 if let Some ( feature) = gsub_table. features . get ( i as u16 ) {
162160 let tag = feature. tag . to_string ( ) ;
163- let name = get_feature_name_from_font ( face, & tag) ;
164161
165162 // Extract glyphs from all lookups in this feature
166163 let mut all_glyphs = std:: collections:: HashSet :: new ( ) ;
@@ -224,9 +221,7 @@ fn extract_gsub_features_simplified(
224221
225222 features. push ( ChainedFeature {
226223 tag,
227- name,
228224 glyphs : glyph_chars,
229- source_table : "GSUB" . to_string ( ) ,
230225 } ) ;
231226 }
232227 }
@@ -235,7 +230,7 @@ fn extract_gsub_features_simplified(
235230}
236231
237232fn extract_gpos_features_simplified (
238- face : & ttf_parser:: Face ,
233+ _face : & ttf_parser:: Face ,
239234 gpos_table : ttf_parser:: opentype_layout:: LayoutTable ,
240235 glyph_map : & std:: collections:: HashMap < u16 , char > ,
241236) -> Vec < ChainedFeature > {
@@ -245,7 +240,6 @@ fn extract_gpos_features_simplified(
245240 for i in 0 ..gpos_table. features . len ( ) {
246241 if let Some ( feature) = gpos_table. features . get ( i as u16 ) {
247242 let tag = feature. tag . to_string ( ) ;
248- let name = get_feature_name_from_font ( face, & tag) ;
249243
250244 // Extract glyphs from all lookups in this feature
251245 let mut all_glyphs = std:: collections:: HashSet :: new ( ) ;
@@ -301,9 +295,7 @@ fn extract_gpos_features_simplified(
301295
302296 features. push ( ChainedFeature {
303297 tag,
304- name,
305298 glyphs : glyph_chars,
306- source_table : "GPOS" . to_string ( ) ,
307299 } ) ;
308300 }
309301 }
@@ -337,31 +329,3 @@ fn extract_coverage_glyphs(coverage: &ttf_parser::opentype_layout::Coverage) ->
337329
338330 glyphs
339331}
340-
341- fn get_feature_name_from_font ( _face : & ttf_parser:: Face , tag : & str ) -> String {
342- // Simplified feature name mapping
343- match tag {
344- "kern" => "Kerning" . to_string ( ) ,
345- "liga" => "Ligatures" . to_string ( ) ,
346- "ss01" => "Stylistic Set 1" . to_string ( ) ,
347- "cv01" => "Character Variant 1" . to_string ( ) ,
348- "locl" => "Localized Forms" . to_string ( ) ,
349- "zero" => "Slashed Zero" . to_string ( ) ,
350- "sinf" => "Scientific Inferiors" . to_string ( ) ,
351- "aalt" => "Access All Alternates" . to_string ( ) ,
352- "numr" => "Numerators" . to_string ( ) ,
353- "ordn" => "Ordinals" . to_string ( ) ,
354- "case" => "Case-Sensitive Forms" . to_string ( ) ,
355- "pnum" => "Proportional Numbers" . to_string ( ) ,
356- "ccmp" => "Glyph Composition/Decomposition" . to_string ( ) ,
357- "dlig" => "Discretionary Ligatures" . to_string ( ) ,
358- "sups" => "Superscript" . to_string ( ) ,
359- "tnum" => "Tabular Numbers" . to_string ( ) ,
360- "subs" => "Subscript" . to_string ( ) ,
361- "salt" => "Stylistic Alternates" . to_string ( ) ,
362- "dnom" => "Denominators" . to_string ( ) ,
363- "frac" => "Fractions" . to_string ( ) ,
364- "calt" => "Contextual Alternates" . to_string ( ) ,
365- _ => format ! ( "Feature {}" , tag) ,
366- }
367- }
0 commit comments