summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/fontmap.c
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2014-08-16 10:06:36 +0000
committerKhaled Hosny <khaledhosny@eglug.org>2014-08-16 10:06:36 +0000
commit9fc908a02f223f2262b33b1cc87ab19b6fe15fef (patch)
tree51b0ca3f9c7fb01fd9ed0bd17687df162957f692 /Build/source/texk/dvipdfm-x/fontmap.c
parentcf417274d82f73f673cc9295d58e5f5190973edb (diff)
Switch to XDV version 6
git-svn-id: svn://tug.org/texlive/trunk@34947 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/fontmap.c')
-rw-r--r--Build/source/texk/dvipdfm-x/fontmap.c44
1 files changed, 6 insertions, 38 deletions
diff --git a/Build/source/texk/dvipdfm-x/fontmap.c b/Build/source/texk/dvipdfm-x/fontmap.c
index 5096ea14ef3..32b93823ab8 100644
--- a/Build/source/texk/dvipdfm-x/fontmap.c
+++ b/Build/source/texk/dvipdfm-x/fontmap.c
@@ -1049,17 +1049,16 @@ pdf_load_fontmap_file (const char *filename, int mode)
#ifdef XETEX
static int
-pdf_insert_native_fontmap_record (const char *name, const char *path, int index, FT_Face face,
+pdf_insert_native_fontmap_record (const char *path, int index, FT_Face face,
int layout_dir, int extend, int slant, int embolden)
{
char *fontmap_key;
fontmap_rec *mrec;
- ASSERT(name);
ASSERT(path || face);
- fontmap_key = malloc(strlen(name) + 40); // CHECK
- sprintf(fontmap_key, "%s/%c/%d/%d/%d", name, layout_dir == 0 ? 'H' : 'V', extend, slant, embolden);
+ 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);
if (verbose)
MESG("<NATIVE-FONTMAP:%s", fontmap_key);
@@ -1094,48 +1093,18 @@ pdf_insert_native_fontmap_record (const char *name, const char *path, int index,
static FT_Library ftLib;
int
-pdf_load_native_font (const char *ps_name,
+pdf_load_native_font (const char *filename, unsigned long index,
int layout_dir, int extend, int slant, int embolden)
{
- const char *p;
- char *filename = NEW(strlen(ps_name), char);
- char *q = filename;
- int index = 0;
+ char *q;
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 == ':') {
- if (p == ps_name+2 && isalpha(*(p-1)) && (*(p+1) == '/' || *(p+1) == '\\'))
- *q++ = *p;
- else
- break;
- }
- else
- *q++ = *p;
- }
-#else
- for (p = ps_name + 1; *p && *p != ':' && *p != ']'; ++p)
- *q++ = *p;
-#endif
- *q = 0;
- if (*p == ':') {
- ++p;
- while (*p && *p != ']')
- index = index * 10 + *p++ - '0';
- }
-
/* try loading the filename directly */
error = FT_New_Face(ftLib, filename, index, &face);
@@ -1150,9 +1119,8 @@ pdf_load_native_font (const char *ps_name,
}
if (error == 0)
- error = pdf_insert_native_fontmap_record(ps_name, filename, index, face,
+ error = pdf_insert_native_fontmap_record(filename, index, face,
layout_dir, extend, slant, embolden);
- RELEASE(filename);
return error;
}
#endif /* XETEX */