summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/font
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/font')
-rw-r--r--Build/source/texk/web2c/luatexdir/font/luafont.w43
-rw-r--r--Build/source/texk/web2c/luatexdir/font/luatexfont.h15
-rw-r--r--Build/source/texk/web2c/luatexdir/font/mapfile.h10
-rw-r--r--Build/source/texk/web2c/luatexdir/font/mapfile.w27
-rw-r--r--Build/source/texk/web2c/luatexdir/font/texfont.h1
-rw-r--r--Build/source/texk/web2c/luatexdir/font/vfpacket.w14
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writecff.h8
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writecff.w203
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writettf.w56
9 files changed, 51 insertions, 326 deletions
diff --git a/Build/source/texk/web2c/luatexdir/font/luafont.w b/Build/source/texk/web2c/luatexdir/font/luafont.w
index 7065f96d904..f63b71a1c15 100644
--- a/Build/source/texk/web2c/luatexdir/font/luafont.w
+++ b/Build/source/texk/web2c/luatexdir/font/luafont.w
@@ -834,16 +834,31 @@ static void read_char_packets(lua_State * L, int *l_fonts, charinfo * co, intern
lua_pop(L, 2);
break;
case packet_pdf_code:
- append_packet(cmd);
ts = (int) lua_rawlen(L, -2);
lua_rawgeti(L, -2, 2);
if (ts == 3) {
+ /* mode on stack */
+ s = lua_tostring(L, -1);
+ if (lua_type(L, -1) == LUA_TSTRING) {
+ /* <pdf> <mode> <direct|page|text|raw|origin> */
+ if (lua_key_eq(s, mode)) {
+ cmd = packet_pdf_mode;
+ lua_rawgeti(L, -3, 3);
+ /* mode on stack */
+ s = lua_tostring(L, -1);
+ }
+ } else {
+ /* <pdf> <direct|page|text|raw|origin> <string> */
+ }
if (lua_type(L, -1) == LUA_TSTRING) {
- s = lua_tostring(L, -1);
if (lua_key_eq(s, direct)) {
n = direct_always;
} else if (lua_key_eq(s, page)) {
n = direct_page;
+ } else if (lua_key_eq(s, text)) {
+ n = direct_text;
+ } else if (lua_key_eq(s, font)) {
+ n = direct_font;
} else if (lua_key_eq(s, raw)) {
n = direct_raw;
} else if (lua_key_eq(s, origin)) {
@@ -854,23 +869,29 @@ static void read_char_packets(lua_State * L, int *l_fonts, charinfo * co, intern
}
} else {
n = (int) lua_roundnumber(L, -1);
- if (n < set_origin || n > direct_raw) {
+ if (n < set_origin || n >= scan_special) {
n = set_origin ;
}
}
- lua_rawgeti(L, -3, 3);
+ if (cmd == packet_pdf_code) {
+ lua_rawgeti(L, -3, 3);
+ /* string on stack */
+ }
} else {
n = set_origin;
}
+ append_packet(cmd);
do_store_four(n);
- s = luaL_checklstring(L, -1, &l);
- if (l > 0) {
+ if (cmd == packet_pdf_code) {
+ s = luaL_checklstring(L, -1, &l);
do_store_four(l);
- m = (int) l;
- while (m > 0) {
- n = *s++;
- m--;
- append_packet(n);
+ if (l > 0) {
+ m = (int) l;
+ while (m > 0) {
+ n = *s++;
+ m--;
+ append_packet(n);
+ }
}
}
lua_pop(L,ts == 3 ? 2 : 1);
diff --git a/Build/source/texk/web2c/luatexdir/font/luatexfont.h b/Build/source/texk/web2c/luatexdir/font/luatexfont.h
index 9ef5110db24..459d2092b54 100644
--- a/Build/source/texk/web2c/luatexdir/font/luatexfont.h
+++ b/Build/source/texk/web2c/luatexdir/font/luatexfont.h
@@ -63,20 +63,9 @@ typedef struct {
extern const key_entry font_key[FONT_KEYS_NUM];
-typedef struct _subfont_entry {
- char *infix; /* infix for this subfont, eg "01" */
- long charcodes[256]; /* the mapping for this subfont as read from sfd */
- struct _subfont_entry *next;
-} subfont_entry;
-
# include "mapfile.h"
typedef struct {
- char *name; /* sfd name, eg "Unicode" */
- subfont_entry *subfont; /* linked list of subfonts */
-} sfd_entry;
-
-typedef struct {
int val; /* value */
boolean set; /* true if parameter has been set */
} intparm;
@@ -182,10 +171,6 @@ void pdf_add_stream(pdf_obj * stream, unsigned char *buf, long len);
void pdf_release_obj(pdf_obj * stream);
unsigned long ttc_read_offset(sfnt * sfont, int ttc_idx, fd_entry *fd);
-/* subfont.c */
-void sfd_free(void);
-boolean handle_subfont_fm(fm_entry *, int);
-
/* writeenc.c */
fe_entry *get_fe_entry(char *);
void enc_free(void);
diff --git a/Build/source/texk/web2c/luatexdir/font/mapfile.h b/Build/source/texk/web2c/luatexdir/font/mapfile.h
index 8ad05c77bb1..928a0e91904 100644
--- a/Build/source/texk/web2c/luatexdir/font/mapfile.h
+++ b/Build/source/texk/web2c/luatexdir/font/mapfile.h
@@ -24,7 +24,7 @@
# define F_INCLUDED (1 << 0)
# define F_SUBSETTED (1 << 1)
# define F_STDT1FONT (1 << 2)
-# define F_SUBFONT (1 << 3)
+/* we don't support sub fonts */
# define F_TYPE1 (1 << 4)
# define F_TRUETYPE (1 << 5)
# define F_OTF (1 << 6)
@@ -38,7 +38,6 @@ typedef enum { MAPFILE, MAPLINE } maptype;
# define set_included(fm) ((fm)->type = (unsigned short)((fm)->type | F_INCLUDED))
# define set_subsetted(fm) ((fm)->type = (unsigned short)((fm)->type | F_SUBSETTED))
# define set_std_t1font(fm) ((fm)->type = (unsigned short)((fm)->type | F_STDT1FONT))
-# define set_subfont(fm) ((fm)->type = (unsigned short)((fm)->type | F_SUBFONT))
# define set_type1(fm) ((fm)->type = (unsigned short)((fm)->type | F_TYPE1))
# define set_truetype(fm) ((fm)->type = (unsigned short)((fm)->type | F_TRUETYPE))
# define set_opentype(fm) ((fm)->type = (unsigned short)((fm)->type | F_OTF))
@@ -50,7 +49,6 @@ typedef enum { MAPFILE, MAPLINE } maptype;
# define unset_included(fm) ((fm)->type = (unsigned short)((fm)->type & ~F_INCLUDED))
# define unset_subsetted(fm) ((fm)->type = (unsigned short)((fm)->type & ~F_SUBSETTED))
# define unset_std_t1font(fm)((fm)->type = (unsigned short)((fm)->type & ~F_STDT1FONT))
-# define unset_subfont(fm) ((fm)->type = (unsigned short)((fm)->type & ~F_SUBFONT))
# define unset_type1(fm) ((fm)->type = (unsigned short)((fm)->type & ~F_TYPE1))
# define unset_truetype(fm) ((fm)->type = (unsigned short)((fm)->type & ~F_TRUETYPE))
# define unset_opentype(fm) ((fm)->type = (unsigned short)((fm)->type & ~F_OTF))
@@ -62,7 +60,6 @@ typedef enum { MAPFILE, MAPLINE } maptype;
# define is_included(fm) (((fm)->type & F_INCLUDED) != 0)
# define is_subsetted(fm) (((fm)->type & F_SUBSETTED) != 0)
# define is_std_t1font(fm) (((fm)->type & F_STDT1FONT) != 0)
-# define is_subfont(fm) (((fm)->type & F_SUBFONT) != 0)
# define is_type1(fm) (((fm)->type & F_TYPE1) != 0)
# define is_truetype(fm) (((fm)->type & F_TRUETYPE) != 0)
# define is_opentype(fm) (((fm)->type & F_OTF) != 0)
@@ -85,7 +82,6 @@ typedef enum { MAPFILE, MAPLINE } maptype;
typedef struct {
/* parameters scanned from the map file: */
char *tfm_name; /* TFM file name (1st field in map line) */
- char *sfd_name; /* subfont directory name, like @sfd_name@ */
char *ps_name; /* PostScript name (optional 2nd field in map line) */
int fd_flags; /* font descriptor /Flags (PDF Ref. section 5.7.1) */
int slant; /* SlantFont */
@@ -93,10 +89,6 @@ typedef struct {
char *encname; /* encoding file name */
char *ff_name; /* font file name */
unsigned short type; /* various flags */
- short pid; /* Pid for truetype fonts */
- short eid; /* Eid for truetype fonts */
- /* parameters NOT scanned from the map file: */
- subfont_entry *subfont; /* subfont mapping */
} fm_entry;
typedef struct {
diff --git a/Build/source/texk/web2c/luatexdir/font/mapfile.w b/Build/source/texk/web2c/luatexdir/font/mapfile.w
index f4f31e5a833..9460dac5a9f 100644
--- a/Build/source/texk/web2c/luatexdir/font/mapfile.w
+++ b/Build/source/texk/web2c/luatexdir/font/mapfile.w
@@ -73,7 +73,6 @@ fm_entry *new_fm_entry(void)
fm_entry *fm;
fm = xtalloc(1, fm_entry);
fm->tfm_name = NULL;
- fm->sfd_name = NULL;
fm->ps_name = NULL;
fm->fd_flags = FD_FLAGS_NOT_SET_IN_MAPLINE;
fm->ff_name = NULL;
@@ -81,9 +80,6 @@ fm_entry *new_fm_entry(void)
fm->type = 0;
fm->slant = 0;
fm->extend = 1000;
- fm->pid = -1;
- fm->eid = -1;
- fm->subfont = NULL;
unset_slantset(fm);
unset_extendset(fm);
unset_inuse(fm);
@@ -93,7 +89,6 @@ fm_entry *new_fm_entry(void)
void delete_fm_entry(fm_entry * fm)
{
xfree(fm->tfm_name);
- xfree(fm->sfd_name);
xfree(fm->ps_name);
xfree(fm->ff_name);
xfree(fm);
@@ -251,15 +246,6 @@ static int check_fm_entry(fm_entry * fm, boolean warn)
a += 16;
}
- /* subfonts must be used with subsetted non-reencoded TrueType fonts */
- if (fm->pid != -1 &&
- !(is_truetype(fm) && is_subsetted(fm) && !is_reencoded(fm))) {
- if (warn)
- formatted_warning("map file", "invalid entry for '%s': PidEid can be used only with subsetted non-reencoded TrueType fonts",
- fm->tfm_name);
- a += 32;
- }
-
return a;
}
@@ -408,13 +394,10 @@ static void fm_scan_line(void)
goto bad_line;
}
break;
- case 'P': /* handle cases for subfonts like 'PidEid=3,1' */
- if (sscanf(r, "PidEid=%i, %i %n", &a, &b, &c) >= 2) {
- fm->pid = (short) a;
- fm->eid = (short) b;
- r += c;
- break;
- }
+ case 'P': /* handle cases for sub fonts like 'PidEid=3,1' */
+ formatted_warning("map file", "invalid entry for '%s': subfonts are not supported", fm->tfm_name);
+ goto bad_line;
+ break;
default: /* encoding or font file specification */
a = b = 0;
if (*r == '<') {
@@ -468,8 +451,6 @@ static void fm_scan_line(void)
fm points to a valid, freshly filled-out fm_entry structure.
Now follows the actual work of registering/deleting.
*/
- if (handle_subfont_fm(fm, mitem->mode)) /* is this a subfont? */
- return;
if (avl_do_entry(fm, mitem->mode) == 0)
return;
bad_line:
diff --git a/Build/source/texk/web2c/luatexdir/font/texfont.h b/Build/source/texk/web2c/luatexdir/font/texfont.h
index d415460b1e1..75beafe66f1 100644
--- a/Build/source/texk/web2c/luatexdir/font/texfont.h
+++ b/Build/source/texk/web2c/luatexdir/font/texfont.h
@@ -625,6 +625,7 @@ typedef enum { packet_char_code,
packet_scale_code,
packet_lua_code,
packet_pdf_code,
+ packet_pdf_mode,
} packet_command_codes;
extern scaled store_scaled_f(scaled sq, int fw);
diff --git a/Build/source/texk/web2c/luatexdir/font/vfpacket.w b/Build/source/texk/web2c/luatexdir/font/vfpacket.w
index 14a6ca61169..d2329916a31 100644
--- a/Build/source/texk/web2c/luatexdir/font/vfpacket.w
+++ b/Build/source/texk/web2c/luatexdir/font/vfpacket.w
@@ -83,11 +83,12 @@ int vf_packet_bytes(charinfo * co)
case packet_image_code:
case packet_node_code:
case packet_right_code:
- vfp += 4;
- break;
case packet_rule_code:
vfp += 8;
break;
+ case packet_pdf_mode:
+ vfp += 4;
+ break;
case packet_pdf_code:
vfp += 4;
/* plus a string so we fall through */
@@ -243,6 +244,10 @@ void do_vf_packet(PDF pdf, internal_font_number vf_f, int c, int ex_glyph)
pdf_literal(pdf, s, mode, false);
flush_str(s);
break;
+ case packet_pdf_mode:
+ packet_number(mode);
+ pdf_literal_set_mode(pdf, mode);
+ break;
case packet_special_code:
packet_number(k);
str_room(k);
@@ -397,11 +402,12 @@ replace_packet_fonts(internal_font_number f, int *old_fontid,
case packet_image_code:
case packet_node_code:
case packet_right_code:
- vfp += 4;
- break;
case packet_rule_code:
vfp += 8;
break;
+ case packet_pdf_mode:
+ vfp += 4;
+ break;
case packet_pdf_code:
vfp += 4;
/* plus a string so we fall through */
diff --git a/Build/source/texk/web2c/luatexdir/font/writecff.h b/Build/source/texk/web2c/luatexdir/font/writecff.h
index 1a24df483b4..f05822a893b 100644
--- a/Build/source/texk/web2c/luatexdir/font/writecff.h
+++ b/Build/source/texk/web2c/luatexdir/font/writecff.h
@@ -247,22 +247,14 @@ extern long cff_set_name(cff_font * cff, char *name);
extern long cff_read_subrs(cff_font * cff);
/* Encoding */
-extern long cff_read_encoding(cff_font * cff);
-extern long cff_pack_encoding(cff_font * cff, card8 * dest, long destlen);
-extern card16 cff_encoding_lookup(cff_font * cff, card8 code);
extern void cff_release_encoding(cff_encoding * encoding);
/* Charsets */
extern long cff_read_charsets(cff_font * cff);
extern long cff_pack_charsets(cff_font * cff, card8 * dest, long destlen);
-/* Returns GID of PS name "glyph" */
-extern card16 cff_glyph_lookup(cff_font * cff, const char *glyph);
-/* Returns GID of glyph with SID/CID "cid" */
-extern card16 cff_charsets_lookup(cff_font * cff, card16 cid);
extern void cff_release_charsets(cff_charsets * charset);
/* Returns SID or CID */
-extern card16 cff_charsets_lookup_inverse(cff_font * cff, card16 gid);
/* FDSelect */
extern long cff_read_fdselect(cff_font * cff);
diff --git a/Build/source/texk/web2c/luatexdir/font/writecff.w b/Build/source/texk/web2c/luatexdir/font/writecff.w
index 9707c751e25..a71e16f6f5c 100644
--- a/Build/source/texk/web2c/luatexdir/font/writecff.w
+++ b/Build/source/texk/web2c/luatexdir/font/writecff.w
@@ -2589,142 +2589,6 @@ static long cs_copy_charstring(card8 * dst, long dstlen, card8 * src, long srcle
return (long) (dst - save);
}
-@* encodings.
-
-@ Encoding and Charset arrays always begin with GID = 1.
-
-@c
-long cff_read_encoding(cff_font * cff)
-{
- cff_encoding *encoding;
- long offset, length;
- card8 i;
-
- if (cff->topdict == NULL) {
- normal_error("cff","top DICT data not found");
- }
-
- if (!cff_dict_known(cff->topdict, "Encoding")) {
- cff->flag |= ENCODING_STANDARD;
- cff->encoding = NULL;
- return 0;
- }
-
- offset = (long) cff_dict_get(cff->topdict, "Encoding", 0);
- if (offset == 0) { /* predefined */
- cff->flag |= ENCODING_STANDARD;
- cff->encoding = NULL;
- return 0;
- } else if (offset == 1) {
- cff->flag |= ENCODING_EXPERT;
- cff->encoding = NULL;
- return 0;
- }
-
- cff->offset = (l_offset) offset;
- cff->encoding = encoding = xcalloc(1, sizeof(cff_encoding));
- encoding->format = get_card8(cff);
- length = 1;
-
- switch (encoding->format & (~0x80)) {
- case 0:
- encoding->num_entries = get_card8(cff);
- (encoding->data).codes = xmalloc(encoding->num_entries * sizeof(card8));
- for (i = 0; i < (encoding->num_entries); i++) {
- (encoding->data).codes[i] = get_card8(cff);
- }
- length += encoding->num_entries + 1;
- break;
- case 1:
- {
- cff_range1 *ranges;
- encoding->num_entries = get_card8(cff);
- encoding->data.range1 = ranges
- = xcalloc(encoding->num_entries, sizeof(cff_range1));
- for (i = 0; i < (encoding->num_entries); i++) {
- ranges[i].first = get_card8(cff);
- ranges[i].n_left = get_card8(cff);
- }
- length += (encoding->num_entries) * 2 + 1;
- }
- break;
- default:
- xfree(encoding);
- normal_error("cff","unknown encoding format");
- break;
- }
- /* Supplementary data */
- if ((encoding->format) & 0x80) {
- cff_map *map;
- encoding->num_supps = get_card8(cff);
- encoding->supp = map = xcalloc(encoding->num_supps, sizeof(cff_map));
- for (i = 0; i < (encoding->num_supps); i++) {
- map[i].code = get_card8(cff);
- map[i].glyph = get_card16(cff); /* SID */
- }
- length += (encoding->num_supps) * 3 + 1;
- } else {
- encoding->num_supps = 0;
- encoding->supp = NULL;
- }
-
- return length;
-}
-
-@ @c
-long cff_pack_encoding(cff_font * cff, card8 * dest, long destlen)
-{
- long len = 0;
- cff_encoding *encoding;
- card16 i;
-
- if (cff->flag & HAVE_STANDARD_ENCODING || cff->encoding == NULL)
- return 0;
-
- if (destlen < 2)
- normal_error("cff","buffer overflow (19)");
-
- encoding = cff->encoding;
-
- dest[len++] = encoding->format;
- dest[len++] = encoding->num_entries;
- switch (encoding->format & (~0x80)) {
- case 0:
- if (destlen < len + encoding->num_entries)
- normal_error("cff","buffer overflow (20)");
- for (i = 0; i < (encoding->num_entries); i++) {
- dest[len++] = (encoding->data).codes[i];
- }
- break;
- case 1:
- {
- if (destlen < len + (encoding->num_entries) * 2)
- normal_error("cff","buffer overflow (21)");
- for (i = 0; i < (encoding->num_entries); i++) {
- dest[len++] = (card8) ((encoding->data).range1[i].first & 0xff);
- dest[len++] = (card8) ((encoding->data).range1[i].n_left);
- }
- }
- break;
- default:
- normal_error("cff","unknown encoding format");
- break;
- }
-
- if ((encoding->format) & 0x80) {
- if (destlen < len + (encoding->num_supps) * 3 + 1)
- normal_error("cff","buffer overflow (22)");
- dest[len++] = encoding->num_supps;
- for (i = 0; i < (encoding->num_supps); i++) {
- dest[len++] = (card8) ((encoding->supp)[i].code);
- dest[len++] = (card8) (((encoding->supp)[i].glyph >> 8) & 0xff);
- dest[len++] = (card8) ((encoding->supp)[i].glyph & 0xff);
- }
- }
-
- return len;
-}
-
@ CID-Keyed font specific
@c
long cff_read_fdselect(cff_font * cff)
@@ -3230,68 +3094,6 @@ cffont->_string = NULL;
}
@ @c
-#undef ERROR /* for mingw */
-#define ERROR(a) { perror(a); return 0; }
-
-@ Input : SID or CID (16-bit unsigned int) Output: glyph index
-
-@c
-card16 cff_charsets_lookup(cff_font * cff, card16 cid)
-{
- card16 gid = 0;
- cff_charsets *charset;
- card16 i;
-
- if (cff->flag & (CHARSETS_ISOADOBE | CHARSETS_EXPERT | CHARSETS_EXPSUB)) {
- ERROR("Predefined CFF charsets not supported yet");
- } else if (cff->charsets == NULL) {
- normal_error("cff","charsets data not available");
- }
-
- if (cid == 0) {
- return 0; /* GID 0 (.notdef) */
- }
-
- charset = cff->charsets;
-
- gid = 0;
- switch (charset->format) {
- case 0:
- for (i = 0; i < charset->num_entries; i++) {
- if (cid == charset->data.glyphs[i]) {
- gid = (card16) (i + 1);
- return gid;
- }
- }
- break;
- case 1:
- for (i = 0; i < charset->num_entries; i++) {
- if (cid >= charset->data.range1[i].first &&
- cid <= charset->data.range1[i].first + charset->data.range1[i].n_left) {
- gid = (card16) (gid + cid - charset->data.range1[i].first + 1);
- return gid;
- }
- gid = (card16) (gid + charset->data.range1[i].n_left + 1);
- }
- break;
- case 2:
- for (i = 0; i < charset->num_entries; i++) {
- if (cid >= charset->data.range2[i].first &&
- cid <= charset->data.range2[i].first + charset->data.range2[i].n_left) {
- gid = (card16) (gid + cid - charset->data.range2[i].first + 1);
- return gid;
- }
- gid = (card16) (gid + charset->data.range2[i].n_left + 1);
- }
- break;
- default:
- normal_error("cff","unknown charset format");
- }
-
- return 0; /* not found */
-}
-
-@ @c
#define is_cidfont(a) ((a)->flag & FONTTYPE_CIDFONT)
#define CID_MAX 65535
@@ -3319,7 +3121,7 @@ void write_cid_cff(PDF pdf, cff_font * cffont, fd_entry * fd)
cff_charsets *charset = NULL;
if (!is_cidfont(cffont)) {
- perror("Not a CIDfont.");
+ normal_error("cff","invalid CIDfont");
return;
}
@@ -3359,9 +3161,6 @@ void write_cid_cff(PDF pdf, cff_font * cffont, fd_entry * fd)
for (cid = 0; cid <= CID_MAX; cid++) {
glyph->id = (unsigned) cid;
if (avl_find(fd->gl_tree, glyph) != NULL) {
- /*
- gid = (card16) cff_charsets_lookup(cffont, (card16) cid);
- */
gid = (card16) cid;
CIDToGIDMap[2 * cid] = (unsigned char) ((gid >> 8) & 0xff);
CIDToGIDMap[2 * cid + 1] = (unsigned char) (gid & 0xff);
diff --git a/Build/source/texk/web2c/luatexdir/font/writettf.w b/Build/source/texk/web2c/luatexdir/font/writettf.w
index ff968eef9e2..2a13b889979 100644
--- a/Build/source/texk/web2c/luatexdir/font/writettf.w
+++ b/Build/source/texk/web2c/luatexdir/font/writettf.w
@@ -38,7 +38,6 @@ int ttf_curbyte = 0;
typedef struct {
char *name; /* name of glyph */
- long code; /* charcode in case of subfonts */
long newindex; /* new index of glyph in output file */
} ttfenc_entry;
@@ -571,30 +570,6 @@ static void ttf_copy_encoding(void)
ttfenc_tab[*q].name = glyph_names[*q];
}
make_subset_tag(fd_cur);
- } else if (is_subfont(fd_cur->fm)) {
- charcodes = fd_cur->fm->subfont->charcodes;
- assert(charcodes != NULL);
-
- for (i = 0; i < 256; i++)
- ttfenc_tab[i].code = -1;
-
- /* take over collected characters from \TeX */
- avl_t_init(&t, fd_cur->tx_tree);
- for (q = (int *) avl_t_first(&t, fd_cur->tx_tree); q != NULL;
- q = (int *) avl_t_next(&t)) {
- assert(*q >= 0 && *q < 256);
- e = ttfenc_tab + *q;
- e->code = charcodes[*q];
- if (e->code == -1)
- formatted_warning("ttf font", "character %i in subfont %s is not mapped to any charcode", *q, fd_cur->fm->tfm_name);
- else {
- assert(e->code < 0x10000);
- sprintf(buf, "/c%4.4X", (int) e->code);
- aa = avl_probe(fd_cur->gl_tree, xstrdup(buf));
- assert(aa != NULL);
- }
- }
- make_subset_tag(fd_cur);
} else
assert(0);
}
@@ -1366,33 +1341,6 @@ static void ttf_reindex_glyphs(void)
for (e = ttfenc_tab; e - ttfenc_tab < 256; e++) {
e->newindex = 0; /* index of ".notdef" glyph */
- /* handle case of subfonts first */
- if (is_subfont(fd_cur->fm)) {
- if (e->code == -1)
- continue;
- assert(fd_cur->fm->pid != -1 && fd_cur->fm->eid != -1);
- if (cmap == NULL && !cmap_not_found) {
- cmap =
- ttf_read_cmap(fd_cur->fm->ff_name, fd_cur->fm->pid,
- fd_cur->fm->eid, true);
- if (cmap == NULL)
- cmap_not_found = true;
- }
- if (cmap == NULL)
- continue;
- t = cmap->table;
- assert(t != NULL && e->code < 0x10000);
- if (t[e->code] < 0) {
- formatted_warning("ttf font",
- "subfont %s has a wrong mapping, character %li -> 0x%4.4lX -> .notdef",
- fd_cur->fm->tfm_name, (long) (e - ttfenc_tab), e->code);
- continue;
- }
- assert(t[e->code] >= 0 && t[e->code] < glyphs_count); /* t has been read from ttf */
- glyph = glyph_tab + t[e->code];
- goto append_new_glyph;
- }
-
/* handle case of reencoded fonts */
if (e->name == notdef)
continue;
@@ -1706,8 +1654,8 @@ void writettf(PDF pdf, fd_entry * fd)
assert(is_truetype(fd_cur->fm));
assert(is_included(fd_cur->fm));
- if (is_subsetted(fd_cur->fm) && (fd_cur->fe == NULL) && !is_subfont(fd_cur->fm)) {
- normal_error("ttf font","subset must be a reencoded or a subfont");
+ if (is_subsetted(fd_cur->fm) && (fd_cur->fe == NULL)) {
+ normal_error("ttf font","subset must be a reencoded font");
}
ttf_curbyte = 0;
ttf_size = 0;