diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2015-02-21 15:05:24 +0000 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2015-02-21 15:05:24 +0000 |
commit | fbacf8fd2a4e22df4f740fa28cc1da0d556e957f (patch) | |
tree | de953728222b20635fba5a77176081afe4db80b2 /Build/source/texk/dvipdfm-x/fontmap.c | |
parent | 76f588e8f00d736a9c635576b5b83ae0fa208616 (diff) |
Load glyph advances without FreeType
git-svn-id: svn://tug.org/texlive/trunk@36333 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/fontmap.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/fontmap.c | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/Build/source/texk/dvipdfm-x/fontmap.c b/Build/source/texk/dvipdfm-x/fontmap.c index 32b93823ab8..14e37955f7a 100644 --- a/Build/source/texk/dvipdfm-x/fontmap.c +++ b/Build/source/texk/dvipdfm-x/fontmap.c @@ -35,11 +35,6 @@ #include "fontmap.h" -#ifdef XETEX -#include "ft2build.h" -#include FT_FREETYPE_H -#endif - /* CIDFont */ static char *strip_options (const char *map_name, fontmap_opt *opt); @@ -82,10 +77,6 @@ pdf_init_fontmap_record (fontmap_rec *mrec) mrec->opt.style = FONTMAP_STYLE_NONE; mrec->opt.stemv = -1; /* not given explicitly by an option */ -#ifdef XETEX - mrec->opt.ft_face = NULL; -#endif - mrec->opt.cff_charsets = NULL; } @@ -153,10 +144,6 @@ pdf_copy_fontmap_record (fontmap_rec *dst, const fontmap_rec *src) dst->opt.style = src->opt.style; dst->opt.stemv = src->opt.stemv; -#ifdef XETEX - dst->opt.ft_face = src->opt.ft_face; -#endif - dst->opt.cff_charsets = src->opt.cff_charsets; } @@ -1049,13 +1036,13 @@ pdf_load_fontmap_file (const char *filename, int mode) #ifdef XETEX static int -pdf_insert_native_fontmap_record (const char *path, int index, FT_Face face, +pdf_insert_native_fontmap_record (const char *path, int index, int layout_dir, int extend, int slant, int embolden) { char *fontmap_key; fontmap_rec *mrec; - ASSERT(path || face); + ASSERT(path); fontmap_key = malloc(strlen(path) + 40); // CHECK sprintf(fontmap_key, "%s/%d/%c/%d/%d/%d", path, index, layout_dir == 0 ? 'H' : 'V', extend, slant, embolden); @@ -1070,7 +1057,6 @@ pdf_insert_native_fontmap_record (const char *path, int index, FT_Face face, mrec->enc_name = mstrdup(layout_dir == 0 ? "Identity-H" : "Identity-V"); mrec->font_name = (path != NULL) ? mstrdup(path) : NULL; mrec->opt.index = index; - mrec->opt.ft_face = face; if (layout_dir != 0) mrec->opt.flags |= FONTMAP_OPT_VERT; @@ -1090,38 +1076,12 @@ pdf_insert_native_fontmap_record (const char *path, int index, FT_Face face, return 0; } -static FT_Library ftLib; - int pdf_load_native_font (const char *filename, unsigned long index, int layout_dir, int extend, int slant, int embolden) { - char *q; - FT_Face face = NULL; - int error = -1; - - if (FT_Init_FreeType(&ftLib) != 0) { - ERROR("FreeType initialization failed."); - return error; - } - - /* try loading the filename directly */ - error = FT_New_Face(ftLib, filename, index, &face); - - /* if failed, try locating the file in the TEXMF tree */ - if ( error && - ( (q = dpx_find_opentype_file(filename)) != NULL - || (q = dpx_find_truetype_file(filename)) != NULL - || (q = dpx_find_type1_file(filename)) != NULL - || (q = dpx_find_dfont_file(filename)) != NULL) ) { - error = FT_New_Face(ftLib, q, index, &face); - RELEASE(q); - } - - if (error == 0) - error = pdf_insert_native_fontmap_record(filename, index, face, + return pdf_insert_native_fontmap_record(filename, index, layout_dir, extend, slant, embolden); - return error; } #endif /* XETEX */ |