diff options
author | Christopher Zimmermann <madroach@gmerlin.de> | 2020-07-18 08:39:01 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2020-09-22 22:00:38 +0000 |
commit | 19412d9ac3fb7f00346273cfe914601c844f5872 (patch) | |
tree | d862bb2684bb68e5f8e83fb7bbe93b2ed57438e7 | |
parent | 1fa97fdc6dc900728be8523be89096b4cb117d4d (diff) |
Add warnings when wrapping multiple fonts and on PCF fonts
-rw-r--r-- | fonttosfnt.c | 6 | ||||
-rw-r--r-- | read.c | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/fonttosfnt.c b/fonttosfnt.c index 062ef3e..7828b79 100644 --- a/fonttosfnt.c +++ b/fonttosfnt.c @@ -106,6 +106,12 @@ main(int argc, char **argv) font = makeFont(); + if(argc - i > 1) + fprintf(stderr, + "You are requesting to put more than one font into a single OpenType font.\n" + "This is not recommended. The global font metrics will not match every font face.\n" + "The creation of an OpenType font collection is recommended.\n"); + if(i == argc) { rc = readFile(NULL, font); if(rc != 0) @@ -29,6 +29,7 @@ THE SOFTWARE. #include FT_FREETYPE_H #include FT_MODULE_H #include FT_BDF_H +#include FT_FONT_FORMATS_H #include "X11/Xos.h" #include "fonttosfnt.h" #include "X11/fonts/fontenc.h" @@ -102,7 +103,7 @@ readFile(char *filename, FontPtr font) BitmapPtr bitmap; int symbol = 0; int force_unicode = 1; - char *encoding_name = NULL; + const char *encoding_name, *file_format; FontMapPtr mapping = NULL; FontMapReversePtr reverse = NULL; @@ -133,6 +134,15 @@ readFile(char *filename, FontPtr font) return -1; } + file_format = FT_Get_Font_Format(face); + if(strcmp(file_format, "BDF") != 0) + fprintf(stderr, + "font file %s is of format %s.\n" + "It's recommended to convert directly from a BDF font.\n" + "Some font properties may get lost when converting via a PCF font.\n", + filename ? filename : "<stdin>", + file_format); + /* FreeType will insist on encodings which are simple subsets of unicode * to be read as unicode regardless of what we call them. */ for(j = 0; j < face->num_charmaps; ++j) { |