summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/xetexdir/xetex.web
diff options
context:
space:
mode:
authorJonathan Kew <jfkthame@googlemail.com>2016-03-20 15:25:33 +0000
committerJonathan Kew <jfkthame@googlemail.com>2016-03-20 15:25:33 +0000
commitbafd11420aed2f53489e204712292894250a89bb (patch)
tree1ba0cf4bb6febe4ff441e140b6c5759377296b90 /Build/source/texk/web2c/xetexdir/xetex.web
parent2f2944050a8fd44dc75fcb754cf989c4ef437e8a (diff)
Update xetex to 0.99996 (adding the \XeTeXhyphenatablelength primitive)
git-svn-id: svn://tug.org/texlive/trunk@40084 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/xetexdir/xetex.web')
-rw-r--r--Build/source/texk/web2c/xetexdir/xetex.web63
1 files changed, 40 insertions, 23 deletions
diff --git a/Build/source/texk/web2c/xetexdir/xetex.web b/Build/source/texk/web2c/xetexdir/xetex.web
index 6d20a3fcc31..e003f7f54e2 100644
--- a/Build/source/texk/web2c/xetexdir/xetex.web
+++ b/Build/source/texk/web2c/xetexdir/xetex.web
@@ -315,8 +315,8 @@ known as `\eTeX'.
@d eTeX_version_string=='-2.6' {current \eTeX\ version}
@#
@d XeTeX_version=0 { \.{\\XeTeXversion} }
-@d XeTeX_revision==".99995" { \.{\\XeTeXrevision} }
-@d XeTeX_version_string=='-0.99995' {current \XeTeX\ version}
+@d XeTeX_revision==".99996" { \.{\\XeTeXrevision} }
+@d XeTeX_version_string=='-0.99996' {current \XeTeX\ version}
@#
@d XeTeX_banner=='This is XeTeX, Version 3.14159265',eTeX_version_string,XeTeX_version_string
{printed when \XeTeX\ starts}
@@ -350,7 +350,8 @@ known as `\eTeX'.
set to 1 for contextual adjustment of space width only,
and 2 for full cross-space shaping (e.g. multi-word ligatures) }
@d XeTeX_generate_actual_text_code=10 { controls output of /ActualText for native-word nodes }
-@d eTeX_states=11 {number of \eTeX\ state variables in |eqtb|}
+@d XeTeX_hyphenatable_length_code=11 { sets maximum hyphenatable word length }
+@d eTeX_states=12 {number of \eTeX\ state variables in |eqtb|}
@ Different \PASCAL s have slightly different conventions, and the present
@!@:PASCAL H}{\ph@>
@@ -632,6 +633,7 @@ emphasize this distinction.
@d script_script_size=number_math_families+number_math_families {size code for the smallest size in a family}
@d biggest_lang=255 {the largest hyphenation language}
@d too_big_lang=256 {|biggest_lang+1|}
+@d hyphenatable_length_limit=4095 {hard limit for hyphenatable length; runtime value is |max_hyphenatable_length|}
@^system dependencies@>
@ In case somebody has inadvertently made bad settings of the ``constants,''
@@ -2397,7 +2399,7 @@ positions from the right end of a binary computer word.
@<Types...@>=
@!scaled = integer; {this type is used for scaled integers}
@!nonnegative_integer=0..@'17777777777; {$0\L x<2^{31}$}
-@!small_number=0..63; {this type is self-explanatory}
+@!small_number=0..hyphenatable_length_limit; {this type is self-explanatory}
@ The following function is used to create a scaled integer from a given decimal
fraction $(.d_0d_1\ldots d_{k-1})$, where |0<=k<=17|. The digit $d_i$ is
@@ -20603,8 +20605,8 @@ terminating node $p_m$. All characters that do not have the same font as
$c_1$ will be treated as nonletters. The |hyphen_char| for that font
must be between 0 and 255, otherwise hyphenation will not be attempted.
\TeX\ looks ahead for as many consecutive letters $c_1\ldots c_n$ as
-possible; however, |n| must be less than 64, so a character that would
-otherwise be $c_{64}$ is effectively not a letter. Furthermore $c_n$ must
+possible; however, |n| must be less than max_hyphenatable_length+1, so a character that would
+otherwise be $c_{max_hyphenatable_length+1}$ is effectively not a letter. Furthermore $c_n$ must
not be in the middle of a ligature. In this way we obtain a string of
letters $c_1\ldots c_n$ that are generated by nodes $p_a\ldots p_b$, where
|1<=a<=b+1<=m|. If |n>=l_hyf+r_hyf|, this string qualifies for hyphenation;
@@ -20636,13 +20638,13 @@ nodes $p_{a-1}$ and~$p_b$ in the description above are placed into variables
|ha| and |hb|; and the font number is placed into |hf|.
@<Glob...@>=
-@!hc:array[0..66] of 0..number_usvs; {word to be hyphenated}
+@!hc:array[0..hyphenatable_length_limit+3] of 0..number_usvs; {word to be hyphenated}
{ note that element 0 needs to be a full UnicodeScalar, even though we
basically work in UTF16 }
@!hn:small_number; {the number of positions occupied in |hc|}
@!ha,@!hb:pointer; {nodes |ha..hb| should be replaced by the hyphenated result}
@!hf:internal_font_number; {font number of the letters in |hc|}
-@!hu:array[0..64] of 0..too_big_char;
+@!hu:array[0..hyphenatable_length_limit+1] of 0..too_big_char;
{like |hc|, before conversion to lowercase}
@!hyf_char:integer; {hyphen character of the relevant font}
@!cur_lang,@!init_cur_lang:0..biggest_lang;
@@ -20668,7 +20670,7 @@ begin prev_s:=cur_p; s:=link(prev_s);
if s<>null then
begin @<Skip to node |ha|, or |goto done1| if no hyphenation
should be attempted@>;
- if l_hyf+r_hyf>63 then goto done1;
+ if l_hyf+r_hyf>max_hyphenatable_length then goto done1;
if is_native_word_node(ha) then begin
@<Check that nodes after |native_word| permit hyphenation; if not, |goto done1|@>;
@<Prepare a |native_word_node| for hyphenation@>;
@@ -20692,6 +20694,14 @@ begin @<Find hyphen locations for the word in |hc|, or |return|@>;
the discretionary hyphens@>;
exit:end;
+function max_hyphenatable_length: integer;
+begin
+ if XeTeX_hyphenatable_length>hyphenatable_length_limit then
+ max_hyphenatable_length:=hyphenatable_length_limit
+ else
+ max_hyphenatable_length:=XeTeX_hyphenatable_length;
+end;
+
@ @<Check that nodes after |native_word| permit hyphenation; if not, |goto done1|@>=
s:=link(ha);
loop@+ begin if not(is_char_node(s)) then
@@ -20725,7 +20735,7 @@ for l:=0 to native_length(ha)-1 do begin
@<Split the |native_word_node| at |l| and link the second part after |ha|@>;
ha:=link(ha);
goto restart;
- end else if (hn = 63) then
+ end else if (hn = max_hyphenatable_length) then
{ reached max hyphenatable length }
goto done3
else begin
@@ -20814,7 +20824,7 @@ loop@+ begin if is_char_node(s) then
set_lc_code(c);
if hc[0]=0 then goto done3;
if hc[0]>max_hyph_char then goto done3;
- if hn=63 then goto done3;
+ if hn=max_hyphenatable_length then goto done3;
hb:=s; incr(hn); hu[hn]:=c; hc[hn]:=hc[0]; hyf_bchar:=non_char;
end
else if type(s)=ligature_node then
@@ -20842,7 +20852,7 @@ while q>null do
set_lc_code(c);
if hc[0]=0 then goto done3;
if hc[0]>max_hyph_char then goto done3;
- if j=63 then goto done3;
+ if j=max_hyphenatable_length then goto done3;
incr(j); hu[j]:=c; hc[j]:=hc[0];@/
q:=link(q);
end;
@@ -20874,13 +20884,13 @@ it finds, since it is better to work on this part of the program before
forgetting what |ha| and |hb|, etc., are all about.
@<Glob...@>=
-@!hyf:array [0..64] of 0..9; {odd values indicate discretionary hyphens}
+@!hyf:array [0..hyphenatable_length_limit+1] of 0..9; {odd values indicate discretionary hyphens}
@!init_list:pointer; {list of punctuation characters preceding the word}
@!init_lig:boolean; {does |init_list| represent a ligature?}
@!init_lft:boolean; {if so, did the ligature involve a left boundary?}
@ @<Local variables for hyphenation@>=
-@!i,@!j,@!l:0..65; {indices into |hc| or |hu|}
+@!i,@!j,@!l:0..hyphenatable_length_limit+2; {indices into |hc| or |hu|}
@!q,@!r,@!s:pointer; {temporary registers for list manipulation}
@!bchar:halfword; {right boundary character of hyphenated word, or |non_char|}
@@ -21232,7 +21242,7 @@ we need a few new local variables:
@!major_tail,@!minor_tail:pointer; {the end of lists in the main and
discretionary branches being reconstructed}
@!c:UnicodeScalar; {character temporarily replaced by a hyphen}
-@!c_loc:0..63; {where that character came from}
+@!c_loc:0..hyphenatable_length_limit; {where that character came from}
@!r_count:integer; {replacement count for discretionary}
@!hyf_node:pointer; {the hyphen, if it exists}
@@ -21331,7 +21341,7 @@ end
@ Ligature insertion can cause a word to grow exponentially in size. Therefore
we must test the size of |r_count| here, even though the hyphenated text
-was at most 63 characters long.
+was at most |max_hyphenatable_length| characters long.
@<Move pointer |s| to the end of the current list...@>=
if r_count>127 then {we have to forget the discretionary hyphen}
@@ -21536,8 +21546,8 @@ When \TeX\ has scanned `\.{\\hyphenation}', it calls on a procedure named
@p procedure new_hyph_exceptions; {enters new exceptions}
label reswitch, exit, found, not_found, not_found1;
-var n:0..64; {length of current word; not always a |small_number|}
-@!j:0..64; {an index into |hc|}
+var n:0..hyphenatable_length_limit+1; {length of current word; not always a |small_number|}
+@!j:0..hyphenatable_length_limit+1; {an index into |hc|}
@!h:hyph_pointer; {an index into |hyph_word| and |hyph_list|}
@!k:str_number; {an index into |str_start|}
@!p:pointer; {head of a list of hyphen positions}
@@ -21591,7 +21601,7 @@ else begin set_lc_code(cur_chr);
("Proceed; I'll ignore the character I just read.");
error;
end
- else if n<63 then
+ else if n<max_hyphenatable_length then
begin incr(n);
if hc[0]<@"10000 then hc[n]:=hc[0]
else begin
@@ -21603,7 +21613,7 @@ else begin set_lc_code(cur_chr);
end
@ @<Append the value |n| to list |p|@>=
-begin if n<63 then
+begin if n<max_hyphenatable_length then
begin q:=get_avail; link(q):=p; info(q):=n; p:=q;
end;
end
@@ -22014,7 +22024,7 @@ sequence, it calls on |new_patterns| to do the right thing.
@<Declare procedures for preprocessing hyph...@>=
procedure new_patterns; {initializes the hyphenation pattern data}
label done, done1;
-var k,@!l:0..64; {indices into |hc| and |hyf|;
+var k,@!l:0..hyphenatable_length_limit+1; {indices into |hc| and |hyf|;
not always in |small_number| range}
@!digit_sensed:boolean; {should the next digit be treated as a letter?}
@!v:quarterword; {trie op code}
@@ -22067,11 +22077,11 @@ if digit_sensed or(cur_chr<"0")or(cur_chr>"9") then
end;
end;
if cur_chr>max_hyph_char then max_hyph_char:=cur_chr;
- if k<63 then
+ if k<max_hyphenatable_length then
begin incr(k); hc[k]:=cur_chr; hyf[k]:=0; digit_sensed:=false;
end;
end
-else if k<63 then
+else if k<max_hyphenatable_length then
begin hyf[k]:=cur_chr-"0"; digit_sensed:=true;
end
@@ -31065,6 +31075,8 @@ and is never inhibited for words originating from horizontal mode.
@d XeTeX_default_input_mode == eTeX_state(XeTeX_default_input_mode_code)
@d XeTeX_default_input_encoding == eTeX_state(XeTeX_default_input_encoding_code)
+@d XeTeX_hyphenatable_length == eTeX_state(XeTeX_hyphenatable_length_code)
+
@<Cases for |print_param|@>=
suppress_fontnotfound_error_code:print_esc("suppressfontnotfounderror");
eTeX_state_code+TeXXeT_code:print_esc("TeXXeTstate");
@@ -31076,6 +31088,7 @@ eTeX_state_code+XeTeX_input_normalization_code:print_esc("XeTeXinputnormalizatio
eTeX_state_code+XeTeX_tracing_fonts_code:print_esc("XeTeXtracingfonts");
eTeX_state_code+XeTeX_interword_space_shaping_code:print_esc("XeTeXinterwordspaceshaping");
eTeX_state_code+XeTeX_generate_actual_text_code:print_esc("XeTeXgenerateactualtext");
+eTeX_state_code+XeTeX_hyphenatable_length_code:print_esc("XeTeXhyphenatablelength");
@ @<Generate all \eTeX...@>=
primitive("suppressfontnotfounderror",assign_int,int_base+suppress_fontnotfound_error_code);@/
@@ -31102,6 +31115,9 @@ primitive("XeTeXinterwordspaceshaping",assign_int,eTeX_state_base+XeTeX_interwor
primitive("XeTeXgenerateactualtext",assign_int,eTeX_state_base+XeTeX_generate_actual_text_code);
@!@:XeTeX_generate_actual_text_}{\.{\\XeTeXgenerateactualtext} primitive@>
+primitive("XeTeXhyphenatablelength",assign_int,eTeX_state_base+XeTeX_hyphenatable_length_code);
+@!@:XeTeX_hyphenatable_length_}{\.{\\XeTeXhyphenatablelength} primitive@>
+
primitive("XeTeXinputencoding",extension,XeTeX_input_encoding_extension_code);
primitive("XeTeXdefaultencoding",extension,XeTeX_default_encoding_extension_code);
primitive("beginL",valign,begin_L_code);
@@ -33424,6 +33440,7 @@ existing code.
@d hyph_root==trie_r[0] {root of the linked trie for |hyph_codes|}
@<Initialize table entries...@>=
+XeTeX_hyphenatable_length:=63; {for backward compatibility with standard TeX by default}
@ @<Store hyphenation codes for current language@>=
begin c:=cur_lang; first_child:=false; p:=0;