summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2022-11-18 14:22:11 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2022-11-18 14:22:11 +0100
commit2593c827482f6c5a315d504cd5316879d6172656 (patch)
treeb696bd4e414c49230068ef8b8e4efed48f75d37f /source
parent08473f11287cb263079c0435068312cbc6d736e8 (diff)
downloadcontext-2593c827482f6c5a315d504cd5316879d6172656.tar.gz
2022-11-18 13:17:00
Diffstat (limited to 'source')
-rw-r--r--source/luametatex/CMakeLists.txt2
-rw-r--r--source/luametatex/source/lua/lmtfontlib.c29
-rw-r--r--source/luametatex/source/lua/lmtnodelib.c1
-rw-r--r--source/luametatex/source/tex/texconditional.c9
-rw-r--r--source/luametatex/source/tex/texfont.c2
-rw-r--r--source/luametatex/source/tex/texfont.h2
-rw-r--r--source/luametatex/source/tex/texmaincontrol.c1
-rw-r--r--source/luametatex/source/tex/texmath.h6
8 files changed, 23 insertions, 29 deletions
diff --git a/source/luametatex/CMakeLists.txt b/source/luametatex/CMakeLists.txt
index 13a7770c5..29553c701 100644
--- a/source/luametatex/CMakeLists.txt
+++ b/source/luametatex/CMakeLists.txt
@@ -194,7 +194,7 @@ if ((DEFINED LMT_HB_TOO))
add_definitions(-DLMT_HB_TOO=1)
endif()
-# This needs cmake >= 3.9 and produces a 60K smaller mingw binary but it take quite a bit or
+# This needs cmake >= 3.9 and produces a 60K smaller mingw binary but it take quite a bit of
# runtime to get there so it should become an option (apart from testing on all builders).
if (DEFINED LMT_OPTIMIZE)
diff --git a/source/luametatex/source/lua/lmtfontlib.c b/source/luametatex/source/lua/lmtfontlib.c
index 953d3bcd1..b2982cc49 100644
--- a/source/luametatex/source/lua/lmtfontlib.c
+++ b/source/luametatex/source/lua/lmtfontlib.c
@@ -96,7 +96,7 @@ static int fontlib_aux_count_hash_items(lua_State *L)
/*tex
Font parameters can be set by number or by name. There are seven basic \TEX\ parameters in text
- mode but in math mode there can be numerous.
+ mode but in math mode there can be numerous.
*/
@@ -673,8 +673,8 @@ static int lmt_characters_from_lua(lua_State *L, int f)
/*tex Find the array size values; |num| has the amount. */
int num = 0;
int todo = 0;
- int bc = font_first_character(f);
- int ec = font_last_character(f);
+ int first = font_first_character(f);
+ int last = font_last_character(f);
/*tex First key: */
lua_pushnil(L);
while (lua_next(L, -2)) {
@@ -682,16 +682,17 @@ static int lmt_characters_from_lua(lua_State *L, int f)
int i = lmt_tointeger(L, -2);
if (i >= 0 && lua_istable(L, -1)) {
todo++;
- if (! tex_char_exists(f, i)) {
+ /* if (! tex_char_exists(f, i)) { */ /* else we add each time even when in range */
+ if (! proper_char_index(f, i)) {
num++;
- if (i > ec) {
- ec = i;
+ if (i > last) {
+ last = i;
}
- if (bc < 0) {
- bc = i;
+ if (first < 0) {
+ first = i;
}
- if (bc >= 0 && i < bc) {
- bc = i;
+ if (first >= 0 && i < first) {
+ first = i;
}
}
}
@@ -699,9 +700,11 @@ static int lmt_characters_from_lua(lua_State *L, int f)
lua_pop(L, 1);
}
if (todo > 0) {
- tex_font_malloc_charinfo(f, num);
- set_font_first_character(f, bc);
- set_font_last_character(f, ec);
+ if (num > 0) {
+ tex_font_malloc_charinfo(f, num);
+ set_font_first_character(f, first);
+ set_font_last_character(f, last);
+ }
/*tex First key: */
lua_pushnil(L);
while (lua_next(L, -2)) {
diff --git a/source/luametatex/source/lua/lmtnodelib.c b/source/luametatex/source/lua/lmtnodelib.c
index caa9da065..4f0c7d73a 100644
--- a/source/luametatex/source/lua/lmtnodelib.c
+++ b/source/luametatex/source/lua/lmtnodelib.c
@@ -1405,7 +1405,6 @@ static int nodelib_direct_setanchors(lua_State *L)
if (lua_toboolean(L, 2)) {
break;
}
- break;
default:
box_anchor(n) = 0;
break;
diff --git a/source/luametatex/source/tex/texconditional.c b/source/luametatex/source/tex/texconditional.c
index be68a8d6d..f89a57ba1 100644
--- a/source/luametatex/source/tex/texconditional.c
+++ b/source/luametatex/source/tex/texconditional.c
@@ -484,10 +484,6 @@ void tex_conditional_if(halfword code, int unless)
goto RESULT;
case if_abs_int_code:
case if_int_code:
- /*tex
- Test the relation between integers or dimensions. Here we use the fact that |<|,
- |=|, and |>| are consecutive ASCII codes.
- */
{
halfword n1 = tex_scan_int(0, NULL);
halfword cp = tex_aux_scan_comparison(code);
@@ -516,10 +512,6 @@ void tex_conditional_if(halfword code, int unless)
goto RESULT;
case if_abs_dim_code:
case if_dim_code:
- /*tex
- Test the relation between integers or dimensions. Here we use the fact that |<|,
- |=|, and |>| are consecutive ASCII codes.
- */
{
scaled n1 = tex_scan_dimen(0, 0, 0, 0, NULL);
halfword cp = tex_aux_scan_comparison(code);
@@ -547,7 +539,6 @@ void tex_conditional_if(halfword code, int unless)
}
goto RESULT;
case if_odd_code:
- /*tex Test if an integer is odd. */
{
halfword v = tex_scan_int(0, NULL);
result = odd(v);
diff --git a/source/luametatex/source/tex/texfont.c b/source/luametatex/source/tex/texfont.c
index 4aad8f495..f3b26d99a 100644
--- a/source/luametatex/source/tex/texfont.c
+++ b/source/luametatex/source/tex/texfont.c
@@ -26,8 +26,6 @@
# include "luametatex.h"
-# define proper_char_index(f, c) (c >= font_first_character(f) && c <= font_last_character(f))
-
inline static scaled tex_aux_font_x_scaled(scaled v)
{
return v ? scaledround(0.000001 * (glyph_scale_par ? glyph_scale_par : 1000) * (glyph_x_scale_par ? glyph_x_scale_par : 1000) * v) : 0;
diff --git a/source/luametatex/source/tex/texfont.h b/source/luametatex/source/tex/texfont.h
index d3722f9ad..994cdd894 100644
--- a/source/luametatex/source/tex/texfont.h
+++ b/source/luametatex/source/tex/texfont.h
@@ -536,6 +536,8 @@ typedef enum char_tag_codes {
# define set_charinfo_top_overshoot(ci,val) if (ci->math) { ci->math->top_overshoot = val; }
# define set_charinfo_bottom_overshoot(ci,val) if (ci->math) { ci->math->bottom_overshoot = val; }
+# define proper_char_index(f, c) (c >= font_first_character(f) && c <= font_last_character(f))
+
/*tex Setters: */
void tex_set_lpcode_in_font (halfword f, halfword c, halfword i);
diff --git a/source/luametatex/source/tex/texmaincontrol.c b/source/luametatex/source/tex/texmaincontrol.c
index f3d91ffe0..b0a9d2a4b 100644
--- a/source/luametatex/source/tex/texmaincontrol.c
+++ b/source/luametatex/source/tex/texmaincontrol.c
@@ -6411,6 +6411,7 @@ void tex_initialize_variables(void)
math_end_class_par = math_end_class;
math_left_class_par = unset_noad_class;
math_right_class_par = unset_noad_class;
+ variable_family_par = -1,
aux_get_date_and_time(&time_par, &day_par, &month_par, &year_par, &lmt_engine_state.utc_time);
}
}
diff --git a/source/luametatex/source/tex/texmath.h b/source/luametatex/source/tex/texmath.h
index b97b1e8f2..a522008f3 100644
--- a/source/luametatex/source/tex/texmath.h
+++ b/source/luametatex/source/tex/texmath.h
@@ -330,7 +330,7 @@ typedef enum math_style_variants {
/*
-These are the mandate font parameters per \url {https://docs.microsoft.com/en-us/typography/opentype/spec/math}:
+These are the mandate font parameters: % https://docs.microsoft.com/en-us/typography/opentype/spec/math
\starttabulate[|T|p|]
\NC ScriptPercentScaleDown \NC Percentage of scaling down for level 1 superscripts and subscripts. Suggested value: 80 pct. \NC \NR
@@ -352,10 +352,10 @@ These are the mandate font parameters per \url {https://docs.microsoft.com/en-us
\NC SuperscriptBottomMaxWithSubscript \NC The maximum level to which the (ink) bottom of superscript can be pushed to increase the gap between superscript and subscript, before subscript starts being moved down. Suggested: 4/5 x-height. \NC \NR
\NC SpaceAfterScript \NC Extra white space to be added after each subscript and superscript. Suggested: 0.5 pt for a 12 pt font. (Note that, in some math layout implementations, a constant value, such as 0.5 pt, may be used for all text sizes. Some implementations may use a constant ratio of text size, such as 1/24 of em.) \NC \NR
\NC UpperLimitGapMin \NC Minimum gap between the (ink) bottom of the upper limit, and the (ink) top of the base operator. \NC \NR
-\NC UpperLimitBaselineRiseMin \NC Minimum distance between baseline of upper limit and (ink) top of the base operator.
+\NC UpperLimitBaselineRiseMin \NC Minimum distance between baseline of upper limit and (ink) top of the base operator. \NC \NR
\NC LowerLimitGapMin \NC Minimum gap between (ink) top of the lower limit, and (ink) bottom of the base operator. \NC \NR
\NC LowerLimitBaselineDropMin \NC Minimum distance between baseline of the lower limit and (ink) bottom of the base operator. \NC \NR
-\NC StackTopShiftUp \NC Standard shift up applied to the top element of a stack.
+\NC StackTopShiftUp \NC Standard shift up applied to the top element of a stack. \NC \NR
\NC StackTopDisplayStyleShiftUp \NC Standard shift up applied to the top element of a stack in display style. \NC \NR
\NC StackBottomShiftDown \NC Standard shift down applied to the bottom element of a stack. Positive for moving in the downward direction. \NC \NR
\NC StackBottomDisplayStyleShiftDown \NC Standard shift down applied to the bottom element of a stack in display style. Positive for moving in the downward direction. \NC \NR