diff options
author | Christopher Zimmermann <madroach@gmerlin.de> | 2020-10-24 11:41:32 +0200 |
---|---|---|
committer | Christopher Zimmermann <madroach@gmerlin.de> | 2020-10-26 08:45:20 +0100 |
commit | 899eadee6750ea39ddb6b874529c29c011599bb2 (patch) | |
tree | a3bdd230dc1107b397fe519536116b2883b12a9d /util.c | |
parent | 5f2307d883de6ddf55f499f1690840747b1a3ad9 (diff) |
Fall back to using FONT property as family name
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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; |