diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-02-03 21:33:11 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-02-03 21:33:11 +0000 |
commit | 85a5ab00705446693e236ee78a0be10f53e86377 (patch) | |
tree | dcc942a92ffb98bbb2731f58fa069a46a18f9dcb /Build/source/texk/web2c/luatexdir/font | |
parent | b14c66510e21d60854c376a6d8cdfb3c48f5e2b8 (diff) |
luatexdir: sync with the upstream (1.0.3)
git-svn-id: svn://tug.org/texlive/trunk@43128 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/font')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/luafont.w | 14 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/texfont.h | 25 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/texfont.w | 12 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writefont.w | 9 |
4 files changed, 54 insertions, 6 deletions
diff --git a/Build/source/texk/web2c/luatexdir/font/luafont.w b/Build/source/texk/web2c/luatexdir/font/luafont.w index baaaac4e9a6..a998c308ef0 100644 --- a/Build/source/texk/web2c/luatexdir/font/luafont.w +++ b/Build/source/texk/web2c/luatexdir/font/luafont.w @@ -29,6 +29,14 @@ const char *font_type_strings[] = { "unknown", "virtual", "real", NULL }; +const char *font_writingmode_strings[] = { + "unknown", "horizontal", "vertical", NULL +}; + +const char *font_identity_strings[] = { + "unknown", "horizontal", "vertical", NULL +}; + const char *font_format_strings[] = { "unknown", "type1", "type3", "truetype", "opentype", NULL }; @@ -427,6 +435,8 @@ int font_to_lua(lua_State * L, int f) dump_booleanfield(L,used,(font_used(f) ? true : false)); dump_stringfield(L,type,font_type_strings[font_type(f)]); dump_stringfield(L,format,font_format_strings[font_format(f)]); + dump_stringfield(L,writingmode,font_writingmode_strings[font_writingmode(f)]); + dump_stringfield(L,identity,font_identity_strings[font_identity(f)]); dump_stringfield(L,embedding,font_embedding_strings[font_embedding(f)]); dump_intfield(L,units_per_em,font_units_per_em(f)); @@ -1409,6 +1419,10 @@ int font_from_lua(lua_State * L, int f) set_font_type(f, i); i = n_enum_field(L, lua_key_index(format), unknown_format, font_format_strings); set_font_format(f, i); + i = n_enum_field(L, lua_key_index(writingmode), unknown_writingmode, font_writingmode_strings); + set_font_writingmode(f, i); + i = n_enum_field(L, lua_key_index(identity), unknown_identity, font_identity_strings); + set_font_identity(f, i); i = n_enum_field(L, lua_key_index(embedding), unknown_embedding, font_embedding_strings); set_font_embedding(f, i); if (font_encodingbytes(f) == 0 && (font_format(f) == opentype_format || font_format(f) == truetype_format)) { diff --git a/Build/source/texk/web2c/luatexdir/font/texfont.h b/Build/source/texk/web2c/luatexdir/font/texfont.h index f89512ecec7..ff15cc791b4 100644 --- a/Build/source/texk/web2c/luatexdir/font/texfont.h +++ b/Build/source/texk/web2c/luatexdir/font/texfont.h @@ -150,6 +150,8 @@ typedef struct texfont { fm_entry *_font_map; int _font_type; int _font_format; + int _font_writingmode; + int _font_identity; int _font_embedding; int _font_bc; int _hyphen_char; @@ -191,6 +193,18 @@ typedef enum { } font_formats; typedef enum { + unknown_writingmode = 0, + horizontal_writingmode, + vertical_writingmode, +} writingmode_types; + +typedef enum { + unknown_identity = 0, + horizontal_identity, + vertical_identity, +} identity_types; + +typedef enum { unknown_embedding = 0, no_embedding, subset_embedding, @@ -199,6 +213,8 @@ typedef enum { extern const char *font_type_strings[]; extern const char *font_format_strings[]; +extern const char *font_writingmodes_strings[]; +extern const char *font_identity_strings[]; extern const char *font_embedding_strings[]; # define font_checksum(a) font_tables[a]->_font_checksum @@ -249,7 +265,6 @@ boolean cmp_font_area(int, str_number); strcmp(font_fullname(a),font_fullname(b)))) # define cmp_font_encodingname(a,b) (!(font_encoding(a)!=NULL || font_encodingname(b)!=NULL || \ strcmp(font_encodingname(a),font_encodingname(b)))) - # define font_bc(a) font_tables[a]->_font_bc # define set_font_bc(f,b) font_bc(f) = b @@ -269,6 +284,14 @@ boolean cmp_font_area(int, str_number); # define font_format_name(a) font_format_strings[font_tables[a]->_font_format] # define set_font_format(a,b) font_format(a) = b +# define font_writingmode(a) font_tables[a]->_font_writingmode +# define font_writingmode_name(a) font_writingmode_strings[font_tables[a]->_font_writingmode] +# define set_font_writingmode(a,b) font_writingmode(a) = b + +# define font_identity(a) font_tables[a]->_font_identity +# define font_identity_name(a) font_identity_strings[font_tables[a]->_font_identity] +# define set_font_identity(a,b) font_identity(a) = b + # define font_embedding(a) font_tables[a]->_font_embedding # define set_font_embedding(a,b) font_embedding(a) = b diff --git a/Build/source/texk/web2c/luatexdir/font/texfont.w b/Build/source/texk/web2c/luatexdir/font/texfont.w index 9b6c0cd6bfe..ab72a52f592 100644 --- a/Build/source/texk/web2c/luatexdir/font/texfont.w +++ b/Build/source/texk/web2c/luatexdir/font/texfont.w @@ -113,11 +113,13 @@ int new_font(void) font_tables[id]->_param_base = NULL; font_tables[id]->_math_param_base = NULL; - set_font_bc(id, 1); /* ec = 0 */ + set_font_bc(id, 1); /* ec = 0 */ + set_font_writingmode(id, 0); + set_font_identity(id, 0); set_hyphen_char(id, '-'); set_skew_char(id, -1); - font_slant(id) = 0; /* vertical */ - font_extend(id) = 1000; /* normal width */ + font_slant(id) = 0; /* vertical */ + font_extend(id) = 1000; /* normal width */ /* allocate eight values including 0 */ set_font_params(id, 7); @@ -1537,6 +1539,8 @@ static void dump_font_entry(texfont * f) dump_int(f->_font_tounicode); dump_int(f->_font_type); dump_int(f->_font_format); + dump_int(f->_font_writingmode); + dump_int(f->_font_identity); dump_int(f->_font_embedding); dump_int(f->_font_bc); dump_int(f->_hyphen_char); @@ -1714,6 +1718,8 @@ static void undump_font_entry(texfont * f) undump_int(x); f->_font_tounicode = (char)x; undump_int(x); f->_font_type = x; undump_int(x); f->_font_format = x; + undump_int(x); f->_font_writingmode = x; + undump_int(x); f->_font_identity = x; undump_int(x); f->_font_embedding = x; undump_int(x); f->_font_bc = x; undump_int(x); f->_hyphen_char = x; diff --git a/Build/source/texk/web2c/luatexdir/font/writefont.w b/Build/source/texk/web2c/luatexdir/font/writefont.w index ab47d9626e7..66c26fa7c16 100644 --- a/Build/source/texk/web2c/luatexdir/font/writefont.w +++ b/Build/source/texk/web2c/luatexdir/font/writefont.w @@ -569,8 +569,9 @@ static void write_fontdescriptor(PDF pdf, fd_entry * fd) assert(0); } } - if (cidset != 0) + if ((! pdf->omit_cidset) && (cidset != 0)) { pdf_dict_add_ref(pdf, "CIDSet", cidset); + } /* TODO: Other optional keys for CID fonts. The most interesting one is \.{/Style << /Panose <12-byte string>>>} @@ -1006,7 +1007,11 @@ void write_cid_fontdictionary(PDF pdf, fo_entry * fo, internal_font_number f) pdf_begin_dict(pdf); pdf_dict_add_name(pdf, "Type", "Font"); pdf_dict_add_name(pdf, "Subtype", "Type0"); - pdf_dict_add_name(pdf, "Encoding", "Identity-H"); + if (font_identity(f) == vertical_identity) { + pdf_dict_add_name(pdf, "Encoding", "Identity-V"); + } else { + pdf_dict_add_name(pdf, "Encoding", "Identity-H"); + } pdf_dict_add_fontname(pdf, "BaseFont", fo->fd); i = pdf_create_obj(pdf, obj_type_others, 0); pdf_add_name(pdf, "DescendantFonts"); |