File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,6 +136,9 @@ impl FontCatalog {
136136 . filter_map ( |( index, raw_name) | {
137137 let ( display_name, style) =
138138 parse_raw_font_name ( & raw_name, & regular_prefixed_names) ?;
139+ if display_name. starts_with ( '@' ) {
140+ return None ;
141+ }
139142 Some ( FontCatalogEntry {
140143 display_name,
141144 raw_name,
@@ -426,6 +429,24 @@ mod tests {
426429 ) ;
427430 }
428431
432+ #[ test]
433+ fn catalog_excludes_vertical_font_names ( ) {
434+ let catalog = FontCatalog :: from_raw_names ( vec ! [
435+ "slot-zero" . to_string( ) ,
436+ " @Malgun Gothic" . to_string( ) ,
437+ "B@Malgun Gothic" . to_string( ) ,
438+ " @맑은 고딕" . to_string( ) ,
439+ "@Vertical Face" . to_string( ) ,
440+ " Consolas" . to_string( ) ,
441+ ] ) ;
442+
443+ assert ! ( catalog
444+ . entries
445+ . iter( )
446+ . all( |entry| !entry. display_name. starts_with( '@' ) ) ) ;
447+ assert ! ( catalog. entry_by_name( "Consolas" ) . is_some( ) ) ;
448+ }
449+
429450 #[ test]
430451 fn face_variant_candidates_replace_regular_suffixes ( ) {
431452 assert ! ( variant_name_candidates( "PTMono-Regular" , FontStyle :: Bold )
You can’t perform that action at this time.
0 commit comments