summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorChristopher Zimmermann <madroach@gmerlin.de>2020-10-24 11:41:32 +0200
committerChristopher Zimmermann <madroach@gmerlin.de>2020-10-26 08:45:20 +0100
commit899eadee6750ea39ddb6b874529c29c011599bb2 (patch)
treea3bdd230dc1107b397fe519536116b2883b12a9d /util.c
parent5f2307d883de6ddf55f499f1690840747b1a3ad9 (diff)
Fall back to using FONT property as family name
Diffstat (limited to 'util.c')
-rw-r--r--util.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/util.c b/util.c
index ba9d096..655b5cf 100644
--- a/util.c
+++ b/util.c
@@ -405,6 +405,24 @@ faceIntProp(FT_Face face, const char *name)
}
char *
+faceStringProp(FT_Face face, const char *name)
+{
+ int rc;
+ BDF_PropertyRec prop;
+ char *buf = NULL;
+
+ rc = FT_Get_BDF_Property(face, name, &prop);
+ if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) {
+ buf = sprintf_alloc("%s", prop.u.atom ? prop.u.atom : "");
+ if(buf == NULL) {
+ perror("sprintf_alloc failed");
+ exit(1);
+ }
+ }
+ return buf;
+}
+
+char *
faceEncoding(FT_Face face)
{
BDF_PropertyRec p1, p2;