The Birdfont Source Code


All Repositories / birdfont.git / blobdiff – RSS feed

Remove hyphen in the full name field (Name table)

Changes made to libbirdfont/OpenFontFormat/NameTable.vala

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
--- libbirdfont/OpenFontFormat/NameTable.vala +++ libbirdfont/OpenFontFormat/NameTable.vala @@ -152,7 +152,11 @@ public string validate_full_name (string s) { string n = name_validation (s, true); string regular_suffix = " Regular"; - + + n = n.replace ("-Regular", " Regular"); + n = n.replace ("-Bold", " Bold"); + n = n.replace ("-Italic", " Italic"); + if (n.has_suffix (regular_suffix)) { n = n.substring (0, n.length - regular_suffix.length); }