diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-04-21 22:14:53 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-04-21 22:14:53 +0000 |
commit | 843fa0fa83ff9f0581fe0e0d7b2e23b5b8cafd43 (patch) | |
tree | e24123124a0207ae0283fe8be9453c124889e5a3 | |
parent | 5c1fcce7823084439adb6c135bfd9c8fb55e6367 (diff) |
web2c/luatexdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@40664 c570f23f-e606-0410-a88d-b1316a301751
8 files changed, 103 insertions, 81 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h index f671842d688..9a51ee4d869 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h +++ b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h @@ -348,72 +348,72 @@ extern int l_dir_text_index [DIR_TEXT_SIZE]; #define lua_push_string_by_name(L,index) lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(index)) #define set_l_pack_type_index \ -l_pack_type_index[0] = lua_key_index(exactly); \ -l_pack_type_index[1] = lua_key_index(additional); \ -l_pack_type_index[2] = lua_key_index(cal_expand_ratio);\ -l_pack_type_index[3] = lua_key_index(subst_ex_font); +l_pack_type_index[exactly] = lua_key_index(exactly); \ +l_pack_type_index[additional] = lua_key_index(additional); \ +l_pack_type_index[cal_expand_ratio] = lua_key_index(cal_expand_ratio);\ +l_pack_type_index[subst_ex_font] = lua_key_index(subst_ex_font); #define set_l_group_code_index \ -l_group_code_index[0] = lua_key_index(empty_string);\ -l_group_code_index[1] = lua_key_index(simple);\ -l_group_code_index[2] = lua_key_index(hbox);\ -l_group_code_index[3] = lua_key_index(adjusted_hbox);\ -l_group_code_index[4] = lua_key_index(vbox);\ -l_group_code_index[5] = lua_key_index(vtop);\ -l_group_code_index[6] = lua_key_index(align);\ -l_group_code_index[7] = lua_key_index(no_align);\ -l_group_code_index[8] = lua_key_index(output);\ -l_group_code_index[9] = lua_key_index(math);\ -l_group_code_index[10] = lua_key_index(disc);\ -l_group_code_index[11] = lua_key_index(insert);\ -l_group_code_index[12] = lua_key_index(vcenter);\ -l_group_code_index[13] = lua_key_index(math_choice);\ -l_group_code_index[14] = lua_key_index(semi_simple);\ -l_group_code_index[15] = lua_key_index(math_shift);\ -l_group_code_index[16] = lua_key_index(math_left);\ -l_group_code_index[17] = lua_key_index(local_box);\ -l_group_code_index[18] = lua_key_index(split_off);\ -l_group_code_index[19] = lua_key_index(split_keep);\ -l_group_code_index[20] = lua_key_index(preamble);\ -l_group_code_index[21] = lua_key_index(align_set);\ -l_group_code_index[22] = lua_key_index(fin_row) +l_group_code_index[bottom_level] = lua_key_index(empty_string);\ +l_group_code_index[simple_group] = lua_key_index(simple);\ +l_group_code_index[hbox_group] = lua_key_index(hbox);\ +l_group_code_index[adjusted_hbox_group] = lua_key_index(adjusted_hbox);\ +l_group_code_index[vbox_group] = lua_key_index(vbox);\ +l_group_code_index[vtop_group] = lua_key_index(vtop);\ +l_group_code_index[align_group] = lua_key_index(align);\ +l_group_code_index[no_align_group] = lua_key_index(no_align);\ +l_group_code_index[output_group] = lua_key_index(output);\ +l_group_code_index[math_group] = lua_key_index(math);\ +l_group_code_index[disc_group] = lua_key_index(disc);\ +l_group_code_index[insert_group] = lua_key_index(insert);\ +l_group_code_index[vcenter_group] = lua_key_index(vcenter);\ +l_group_code_index[math_choice_group] = lua_key_index(math_choice);\ +l_group_code_index[semi_simple_group] = lua_key_index(semi_simple);\ +l_group_code_index[math_shift_group] = lua_key_index(math_shift);\ +l_group_code_index[math_left_group] = lua_key_index(math_left);\ +l_group_code_index[local_box_group] = lua_key_index(local_box);\ +l_group_code_index[split_off_group] = lua_key_index(split_off);\ +l_group_code_index[split_keep_group] = lua_key_index(split_keep);\ +l_group_code_index[preamble_group] = lua_key_index(preamble);\ +l_group_code_index[align_set_group] = lua_key_index(align_set);\ +l_group_code_index[fin_row_group] = lua_key_index(fin_row) #define set_l_local_par_index \ -l_local_par_index[0] = lua_key_index(new_graf);\ -l_local_par_index[1] = lua_key_index(local_box);\ -l_local_par_index[2] = lua_key_index(hmode_par);\ -l_local_par_index[3] = lua_key_index(penalty);\ -l_local_par_index[4] = lua_key_index(math); +l_local_par_index[new_graf_par_code] = lua_key_index(new_graf);\ +l_local_par_index[local_box_par_code] = lua_key_index(local_box);\ +l_local_par_index[hmode_par_par_code] = lua_key_index(hmode_par);\ +l_local_par_index[penalty_par_code] = lua_key_index(penalty);\ +l_local_par_index[math_par_code] = lua_key_index(math); #define set_l_math_style_name_index \ -l_math_style_name_index[0] = lua_key_index(display);\ -l_math_style_name_index[1] = lua_key_index(crampeddisplay);\ -l_math_style_name_index[2] = lua_key_index(text);\ -l_math_style_name_index[3] = lua_key_index(crampedtext);\ -l_math_style_name_index[4] = lua_key_index(script);\ -l_math_style_name_index[5] = lua_key_index(crampedscript);\ -l_math_style_name_index[6] = lua_key_index(scriptscript);\ -l_math_style_name_index[7] = lua_key_index(crampedscriptscript) +l_math_style_name_index[display_style] = lua_key_index(display);\ +l_math_style_name_index[cramped_display_style] = lua_key_index(crampeddisplay);\ +l_math_style_name_index[text_style] = lua_key_index(text);\ +l_math_style_name_index[cramped_text_style] = lua_key_index(crampedtext);\ +l_math_style_name_index[script_style] = lua_key_index(script);\ +l_math_style_name_index[cramped_script_style] = lua_key_index(crampedscript);\ +l_math_style_name_index[script_script_style] = lua_key_index(scriptscript);\ +l_math_style_name_index[cramped_script_script_style] = lua_key_index(crampedscriptscript) #define set_l_dir_par_index \ -l_dir_par_index[0] = lua_key_index(TLT);\ -l_dir_par_index[1] = lua_key_index(TRT);\ -l_dir_par_index[2] = lua_key_index(LTL);\ -l_dir_par_index[3] = lua_key_index(RTT);\ -l_dir_par_index[4] = lua_key_index(TLT);\ -l_dir_par_index[5] = lua_key_index(TRT);\ -l_dir_par_index[6] = lua_key_index(LTL);\ -l_dir_par_index[7] = lua_key_index(RTT);\ +l_dir_par_index[dir_TLT] = lua_key_index(TLT);\ +l_dir_par_index[dir_TRT] = lua_key_index(TRT);\ +l_dir_par_index[dir_LTL] = lua_key_index(LTL);\ +l_dir_par_index[dir_RTT] = lua_key_index(RTT);\ +l_dir_par_index[dir_TLT+3] = lua_key_index(TLT);\ +l_dir_par_index[dir_TRT+3] = lua_key_index(TRT);\ +l_dir_par_index[dir_LTL+3] = lua_key_index(LTL);\ +l_dir_par_index[dir_RTT+3] = lua_key_index(RTT);\ #define set_l_dir_text_index \ -l_dir_text_index[0] = lua_key_index(mTLT);\ -l_dir_text_index[1] = lua_key_index(mTRT);\ -l_dir_text_index[2] = lua_key_index(mLTL);\ -l_dir_text_index[3] = lua_key_index(mRTT);\ -l_dir_text_index[4] = lua_key_index(pTLT);\ -l_dir_text_index[5] = lua_key_index(pTRT);\ -l_dir_text_index[6] = lua_key_index(pLTL);\ -l_dir_text_index[7] = lua_key_index(pRTT);\ +l_dir_text_index[dir_TLT] = lua_key_index(mTLT);\ +l_dir_text_index[dir_TRT] = lua_key_index(mTRT);\ +l_dir_text_index[dir_LTL] = lua_key_index(mLTL);\ +l_dir_text_index[dir_RTT] = lua_key_index(mRTT);\ +l_dir_text_index[dir_TLT+3] = lua_key_index(pTLT);\ +l_dir_text_index[dir_TRT+3] = lua_key_index(pTRT);\ +l_dir_text_index[dir_LTL+3] = lua_key_index(pLTL);\ +l_dir_text_index[dir_RTT+3] = lua_key_index(pRTT);\ #define img_parms_max 25 #define img_pageboxes_max 6 diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c index 1e8c09fceca..12b054ab46f 100644 --- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c +++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c @@ -5871,6 +5871,10 @@ static SplineFont *SFFillFromTTF(struct ttfinfo *info) { SymbolFixup(info); if ( info->map==NULL && info->subfonts==NULL ) /* Can happen when reading a ttf from a pdf */ info->map = EncMapFromEncoding(sf,FindOrMakeEncoding("original")); + if (info->map==NULL) { + LogError("Dummy map vector added"); + info->map = EncMapNew(info->glyph_cnt,info->glyph_cnt,&custom); + } if ( info->subfontcnt==0 ) PsuedoEncodeUnencoded(info->map,info); MapDoBack(info->map,info); diff --git a/Build/source/texk/web2c/luatexdir/tex/directions.h b/Build/source/texk/web2c/luatexdir/tex/directions.h index 8fe126bdb19..7ab524a1e79 100644 --- a/Build/source/texk/web2c/luatexdir/tex/directions.h +++ b/Build/source/texk/web2c/luatexdir/tex/directions.h @@ -30,11 +30,6 @@ extern const char *dir_strings[128]; */ -# define dir_TLT 0 /* maybe use this one as unset value */ -# define dir_TRT 1 /* or should we avoid that one because it's a signal too */ -# define dir_LTL 2 -# define dir_RTT 3 - extern const char *dir_strings[8]; extern int dir_swap; diff --git a/Build/source/texk/web2c/luatexdir/tex/equivalents.h b/Build/source/texk/web2c/luatexdir/tex/equivalents.h index ba4b4042859..1289ab70cba 100644 --- a/Build/source/texk/web2c/luatexdir/tex/equivalents.h +++ b/Build/source/texk/web2c/luatexdir/tex/equivalents.h @@ -478,6 +478,32 @@ typedef enum { fin_row_group /* box code for a provisory line in an alignment */ } tex_group_codes; +typedef enum { + new_graf_par_code = 0, + local_box_par_code, + hmode_par_par_code, + penalty_par_code, + math_par_code, +} tex_par_codes ; + +typedef enum { + display_style = 0, /* |subtype| for \.{\\displaystyle} */ + cramped_display_style, /* |subtype| for \.{\\crampeddisplaystyle} */ + text_style, /* |subtype| for \.{\\textstyle} */ + cramped_text_style, /* |subtype| for \.{\\crampedtextstyle} */ + script_style, /* |subtype| for \.{\\scriptstyle} */ + cramped_script_style, /* |subtype| for \.{\\crampedscriptstyle} */ + script_script_style, /* |subtype| for \.{\\scriptscriptstyle} */ + cramped_script_script_style, /* |subtype| for \.{\\crampedscriptscriptstyle} */ +} math_style_subtypes; + +typedef enum { + dir_TLT = 0, + dir_TRT, + dir_LTL, + dir_RTT, +} dir_codes; + # define max_group_code local_box_group /* which is wrong, but is what the web says */ extern int cur_cmd; /* current command set by |get_next| */ diff --git a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w index 8f423c63a0e..690952b2bf2 100644 --- a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w +++ b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w @@ -1499,7 +1499,7 @@ void new_graf(boolean indented) mode = hmode; space_factor = 1000; /* LOCAL: Add local paragraph node */ - tail_append(make_local_par_node(0)); + tail_append(make_local_par_node(new_graf_par_code)); if (indented) { p = new_null_box(); box_dir(p) = par_direction; @@ -1869,7 +1869,7 @@ void build_local_box(void) eq_define(local_right_box_base, box_ref_cmd, p); if (abs(mode) == hmode) { /* LOCAL: Add local paragraph node */ - tail_append(make_local_par_node(1)); + tail_append(make_local_par_node(local_box_par_code)); } eq_word_define(int_base + no_local_whatsits_code, no_local_whatsits + 1); } @@ -2830,7 +2830,7 @@ void fixup_directions(void) } if (temp_no_whatsits != 0) { /* LOCAL: Add local paragraph node */ - tail_append(make_local_par_node(2)); + tail_append(make_local_par_node(hmode_par_par_code)); } } } @@ -2940,7 +2940,7 @@ void assign_internal_value(int a, halfword p, int val) ((p == (int_base + local_inter_line_penalty_code)) || (p == (int_base + local_broken_penalty_code)))) { /* LOCAL: Add local paragraph node */ - tail_append(make_local_par_node(3)); + tail_append(make_local_par_node(penalty_par_code)); eq_word_define(int_base + no_local_whatsits_code, no_local_whatsits + 1); diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.w b/Build/source/texk/web2c/luatexdir/tex/mlist.w index 1695fb7ac8e..bceb4e88ad1 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mlist.w +++ b/Build/source/texk/web2c/luatexdir/tex/mlist.w @@ -1610,9 +1610,6 @@ void run_mlist_to_hlist(halfword p, boolean penalties, int mstyle) } alink(p) = null ; nodelist_to_lua(L, p); - /* - lua_pushstring(L, math_style_names[mstyle]); - */ lua_push_math_style_name(L,mstyle); lua_pushboolean(L, penalties); if (lua_pcall(L, 3, 1, 0) != 0) { /* 3 args, 1 result */ @@ -2186,6 +2183,7 @@ static void do_make_math_accent(pointer q, internal_font_number f, int c, int fl scaled w; /* width of the accentee, not including sub/superscripts */ boolean s_is_absolute; /* will be true if a top-accent is placed in |s| */ scaled fraction ; + scaled ic = 0; scaled target ; extinfo *ext; pointer attr_p; @@ -2277,6 +2275,12 @@ static void do_make_math_accent(pointer q, internal_font_number f, int c, int fl delta = delta + height(x) - h; h = height(x); } + } else if ((vlink(q) != null) && (type(nucleus(q)) == math_char_node)) { + /* only pure math char nodes */ + internal_font_number f = fam_fnt(math_fam(nucleus(q)),cur_size); + if (is_new_mathfont(f)) { + ic = char_italic(f,math_character(nucleus(q))); + } } /* the top accents of both characters are aligned */ if (s_is_absolute) { @@ -2340,6 +2344,10 @@ static void do_make_math_accent(pointer q, internal_font_number f, int c, int fl } else { shift_amount(y) = -(h - height(y)); } + if (ic != 0) { + /* old font codepath has ic built in, new font code doesn't */ + width(r) += ic ; + } math_list(nucleus(q)) = y; type(nucleus(q)) = sub_box_node; } diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.h b/Build/source/texk/web2c/luatexdir/tex/texmath.h index 90ae5f20a1d..f36644e997d 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texmath.h +++ b/Build/source/texk/web2c/luatexdir/tex/texmath.h @@ -91,17 +91,6 @@ void unsave_math_data(int lvl); or |denom_style|). */ -typedef enum { - display_style = 0, /* |subtype| for \.{\\displaystyle} */ - cramped_display_style, /* |subtype| for \.{\\crampeddisplaystyle} */ - text_style, /* |subtype| for \.{\\textstyle} */ - cramped_text_style, /* |subtype| for \.{\\crampedtextstyle} */ - script_style, /* |subtype| for \.{\\scriptstyle} */ - cramped_script_style, /* |subtype| for \.{\\crampedscriptstyle} */ - script_script_style, /* |subtype| for \.{\\scriptscriptstyle} */ - cramped_script_script_style, /* |subtype| for \.{\\crampedscriptscriptstyle} */ -} math_style_subtypes; - extern const char *math_style_names[]; # define cramped 1 /* add this to an uncramped style if you want to cramp it */ diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.w b/Build/source/texk/web2c/luatexdir/tex/texmath.w index abfd08db520..32bc134a488 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texmath.w +++ b/Build/source/texk/web2c/luatexdir/tex/texmath.w @@ -2137,8 +2137,8 @@ static void resume_after_display(void) push_nest(); mode = hmode; space_factor = 1000; - tail_append(make_local_par_node(4)); /* this needs to be intercepted in - the display math start ! */ + /* this needs to be intercepted in the display math start ! */ + tail_append(make_local_par_node(penalty_par_code)); get_x_token(); if (cur_cmd != spacer_cmd) back_input(); |