diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2013-03-14 14:12:02 +0000 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2013-03-14 14:12:02 +0000 |
commit | c8157f242392ce9ae8d294c509e0c5431004189a (patch) | |
tree | 11fbc51f434b0577510dce758c846882205878ae /Build | |
parent | b60c4c14b5067eacb6c9c39b7d2279d9cae03d54 (diff) |
Merge pdf_load_native_font_from_path() into pdf_load_native_font()
git-svn-id: svn://tug.org/texlive/trunk@29382 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/xdvipdfmx/ChangeLog | 2 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/fontmap.c | 43 |
2 files changed, 17 insertions, 28 deletions
diff --git a/Build/source/texk/xdvipdfmx/ChangeLog b/Build/source/texk/xdvipdfmx/ChangeLog index b011bc4f191..68557375769 100644 --- a/Build/source/texk/xdvipdfmx/ChangeLog +++ b/Build/source/texk/xdvipdfmx/ChangeLog @@ -3,6 +3,8 @@ * src/dvi.c, src/dvicodes.h, vf.c: Revert "Support DVI-IVD inspired text reflection for XeTeX". * src/fontmap.c: Remove commented out old Mac code. + * src/fontmap.c (pdf_load_native_font_from_path, pdf_load_native_font): + Merge. 2013-02-25 Peter Breitenlohner <peb@mppmu.mpg.de> diff --git a/Build/source/texk/xdvipdfmx/src/fontmap.c b/Build/source/texk/xdvipdfmx/src/fontmap.c index d2d0d7e7d3a..13c232e3edb 100644 --- a/Build/source/texk/xdvipdfmx/src/fontmap.c +++ b/Build/source/texk/xdvipdfmx/src/fontmap.c @@ -1099,8 +1099,10 @@ pdf_insert_native_fontmap_record (const char *name, const char *path, int index, static FT_Library ftLib; -static int -pdf_load_native_font_from_path(const char *ps_name, int layout_dir, int extend, int slant, int embolden) +int +pdf_load_native_font (const char *ps_name, + const char *fam_name, const char *sty_name, + int layout_dir, int extend, int slant, int embolden) { const char *p; char *filename = NEW(strlen(ps_name), char); @@ -1108,7 +1110,17 @@ pdf_load_native_font_from_path(const char *ps_name, int layout_dir, int extend, int index = 0; FT_Face face = NULL; int error = -1; - + + if (ps_name[0] != '[') { + ERROR("Loading fonts by font name is not supported: %s", ps_name); + return error; + } + + if (FT_Init_FreeType(&ftLib) != 0) { + ERROR("FreeType initialization failed."); + return error; + } + #ifdef WIN32 for (p = ps_name + 1; *p && *p != ']'; ++p) { if (*p == ':') { @@ -1150,31 +1162,6 @@ pdf_load_native_font_from_path(const char *ps_name, int layout_dir, int extend, RELEASE(filename); return error; } - -int -pdf_load_native_font (const char *ps_name, - const char *fam_name, const char *sty_name, - int layout_dir, int extend, int slant, int embolden) -{ - static int sInitialized = 0; - int error = -1; - - if (!sInitialized) { - if (FT_Init_FreeType(&ftLib) != 0) { - WARN("FreeType initialization failed."); - return error; - } - sInitialized = 1; - } - - if (ps_name[0] == '[') { - error = pdf_load_native_font_from_path(ps_name, layout_dir, extend, slant, embolden); - } else { - ERROR("Loading fonts by font name is not supported: %s", ps_name); - } - - return error; -} #endif /* XETEX */ #if 0 |