summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorChristopher Zimmermann <madroach@gmerlin.de>2020-06-15 14:08:49 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2020-09-22 22:00:38 +0000
commit1df352c9e862686692ac053b838d76a36d721805 (patch)
treef80387d297a2d21443b0c8df880f5621b7b7ba4d /util.c
parent8532812f1eddfadc0bcfad220b283bf5990bba10 (diff)
truncate foundry if there is no known abbreviation.
Honestly I have no idea why the foundry needs to fit in four bytes. But anyway truncation might indeed be better then "UNKN" ? Anyone more knowledgeable than me out there?
Diffstat (limited to 'util.c')
-rw-r--r--util.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/util.c b/util.c
index 12d92ea..fc6eb38 100644
--- a/util.c
+++ b/util.c
@@ -280,8 +280,11 @@ faceFoundry(FT_Face face)
return makeName("URW ");
else if(strcasecmp(prop.u.atom, "y&y") == 0)
return makeName("Y&Y ");
- else
- return makeName("UNKN");
+ else {
+ char buf[5];
+ snprintf(buf, sizeof(buf), "%-4s", prop.u.atom);
+ return makeName(buf);
+ }
}
/* For now */
return makeName("UNKN");