diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-03-21 16:07:28 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-03-21 16:09:22 +0100 |
commit | 4022d1bb49a7ece2ffa1d88bbe9ae4839e27132b (patch) | |
tree | 7e2d6e7287aacd06d9519135db9f54f3561e5084 /source | |
parent | 62f6df06680cf62b9ac88837f9db3eed9499fcbc (diff) | |
download | mupdf-4022d1bb49a7ece2ffa1d88bbe9ae4839e27132b.tar.xz |
Allow building with old versions of freetype.
Debian stable still ships with freetype 2.5.2. We normally wouldn't care,
but desktop java builds need to use the system freetype library as that's
what AWT links against.
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/font.c | 4 | ||||
-rw-r--r-- | source/pdf/pdf-font.c | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c index 8f598be1..56cfecbf 100644 --- a/source/fitz/font.c +++ b/source/fitz/font.c @@ -12,6 +12,10 @@ #define MAX_BBOX_TABLE_SIZE 4096 #define MAX_ADVANCE_CACHE 4096 +#ifndef FT_SFNT_OS2 +#define FT_SFNT_OS2 ft_sfnt_os2 +#endif + /* 20 degrees */ #define SHEAR 0.36397f diff --git a/source/pdf/pdf-font.c b/source/pdf/pdf-font.c index 7759cfaa..9cc928a1 100644 --- a/source/pdf/pdf-font.c +++ b/source/pdf/pdf-font.c @@ -3,9 +3,17 @@ #include <ft2build.h> #include FT_FREETYPE_H #include FT_ADVANCES_H +#ifdef FT_FONT_FORMATS_H #include FT_FONT_FORMATS_H +#else +#include FT_XFREE86_H +#endif #include FT_TRUETYPE_TABLES_H +#ifndef FT_SFNT_HEAD +#define FT_SFNT_HEAD ft_sfnt_head +#endif + static void pdf_load_font_descriptor(fz_context *ctx, pdf_document *doc, pdf_font_desc *fontdesc, pdf_obj *dict, char *collection, char *basefont, int iscidfont); static const char *base_font_names[][10] = @@ -127,7 +135,11 @@ enum { UNKNOWN, TYPE1, TRUETYPE }; static int ft_kind(FT_Face face) { +#ifdef FT_FONT_FORMATS_H const char *kind = FT_Get_Font_Format(face); +#else + const char *kind = FT_Get_X11_Font_Format(face); +#endif if (!strcmp(kind, "TrueType")) return TRUETYPE; if (!strcmp(kind, "Type 1")) return TYPE1; if (!strcmp(kind, "CFF")) return TYPE1; @@ -137,7 +149,11 @@ static int ft_kind(FT_Face face) static int ft_font_file_kind(FT_Face face) { +#ifdef FT_FONT_FORMATS_H const char *kind = FT_Get_Font_Format(face); +#else + const char *kind = FT_Get_X11_Font_Format(face); +#endif if (!strcmp(kind, "TrueType")) return 2; if (!strcmp(kind, "Type 1")) return 1; if (!strcmp(kind, "CFF")) return 3; |