@@ -30,6 +30,7 @@ pub(crate) struct GlifParser<'names> {
3030 glyph : Glyph ,
3131 version : Version ,
3232 seen_identifiers : HashSet < Identifier > ,
33+ has_warned_for_smooth_point : bool ,
3334 /// Optional set of glyph names to be reused between glyphs.
3435 names : Option < & ' names NameList > ,
3536}
@@ -47,7 +48,13 @@ impl<'names> GlifParser<'names> {
4748
4849 let ( name, version) = start ( & mut reader, & mut buf, names) ?;
4950 let glyph = Glyph :: new_impl ( name) ;
50- let parser = GlifParser { glyph, seen_identifiers : Default :: default ( ) , names, version } ;
51+ let parser = GlifParser {
52+ glyph,
53+ seen_identifiers : Default :: default ( ) ,
54+ names,
55+ version,
56+ has_warned_for_smooth_point : false ,
57+ } ;
5158 parser. parse_body ( & mut reader, xml, & mut buf)
5259 }
5360
@@ -325,7 +332,7 @@ impl<'names> GlifParser<'names> {
325332 // Instead of failing to parse these files, we prefer to just skip the dicts.
326333 self . glyph . lib = dict;
327334 }
328- Err ( e) => log:: info!( "glyph {} contains invalid lib: ' {e}' " , self . glyph. name) ,
335+ Err ( e) => log:: info!( "glyph '{}' {e}" , self . glyph. name) ,
329336 }
330337
331338 Ok ( ( ) )
@@ -386,6 +393,16 @@ impl<'names> GlifParser<'names> {
386393
387394 match ( x, y) {
388395 ( Some ( x) , Some ( y) ) => {
396+ if typ == PointType :: OffCurve && smooth {
397+ if !self . has_warned_for_smooth_point {
398+ log:: info!(
399+ "glyph '{}' has off-curve point with 'smooth' attribute set" ,
400+ self . glyph. name
401+ ) ;
402+ }
403+ self . has_warned_for_smooth_point = true ;
404+ smooth = false ;
405+ }
389406 outline_builder. add_point ( ( x, y) , typ, smooth, name, identifier) ?;
390407 Ok ( ( ) )
391408 }
0 commit comments