summaryrefslogtreecommitdiff
path: root/Build/source/texk
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-02-15 22:47:54 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-02-15 22:47:54 +0000
commite1d7bddac7d75ef6bb337f709e67cbd35a6b1e09 (patch)
tree780e86b897efa5ee377c06c45981b4cec49bfeda /Build/source/texk
parentb7a9077e3786c754c908fcb1acb14f856aac4e8f (diff)
luatexdir, mplibdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@43237 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r--Build/source/texk/web2c/luatexdir/NEWS45
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lnodelib.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lstatslib.c13
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luatex-api.h1
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.c2
-rw-r--r--Build/source/texk/web2c/mplibdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/mplibdir/mpmath.w14
-rw-r--r--Build/source/texk/web2c/mplibdir/mpmathbinary.w48
-rw-r--r--Build/source/texk/web2c/mplibdir/mpmathdecimal.w205
-rw-r--r--Build/source/texk/web2c/mplibdir/mpmathdouble.w13
-rw-r--r--Build/source/texk/web2c/mplibdir/mpost.w6
-rw-r--r--Build/source/texk/web2c/mplibdir/mpstrings.w18
-rw-r--r--Build/source/texk/web2c/mplibdir/mpxout.w12
-rw-r--r--Build/source/texk/web2c/mplibdir/pngout.w17
-rw-r--r--Build/source/texk/web2c/mplibdir/psout.w66
-rw-r--r--Build/source/texk/web2c/mplibdir/svgout.w4
16 files changed, 279 insertions, 191 deletions
diff --git a/Build/source/texk/web2c/luatexdir/NEWS b/Build/source/texk/web2c/luatexdir/NEWS
index d01f0744a97..3bd279cfccf 100644
--- a/Build/source/texk/web2c/luatexdir/NEWS
+++ b/Build/source/texk/web2c/luatexdir/NEWS
@@ -2,6 +2,51 @@
This file is in the public domain.
==============================================================
+LuaTeX Release 1.0.3 was released 2017021514
+==============================================================
+
+This is a minor upgrade and probably this version will go on texlive. There are a couple
+of fixes and additions.
+- We added a few a few more helpers in the pdf namespace (like set|get]gentounicode,
+ [set|get]omitcidset and set|get]decimaldigits. Some helpers were moved from the tex
+ to the pdf namespace.
+
+- We added a build_page_insert callback for inserts so that one can for instance adapt
+ spacing on demand.
+
+- On the agenda has been some more control over word start and end in hyphenation and
+ this is now possible via hyphenationbounds. We also updated the manual with some more
+ details.
+
+- An old tracker item with respect to control over spacing around math was revived and
+ has resulted in mathsurroundmode (one can wonder how useful this is).
+
+- We improved the resolution detection in included jpeg images.
+
+
+- An ffi library has been added to luatex so that it is more in sync with luajittex. This
+ permits easy and flexible loading of libraries. Our policy is to make luatex as lean
+ as possible with no dependencies and this is a step towards that. Eventually we hope
+ to support all relevant platforms.
+
+- The glue and skip register accessors have been improved as a step in freeing the user
+ from glue spec management.
+
+- We added a few more getters and setters for nodes in order to get a more consistent
+ set.
+
+- Irrelevant fields have been removed from the status table and an engine identifier
+ has been added.
+
+- Of course there are numerous fixes and improvements but none of these have consequences
+ for the interfaces.
+
+- The manual has been updated but will be improved over time.
+
+
+
+
+==============================================================
LuaTeX Release 0.95 for TeX Live 2016 was released 2016042515
==============================================================
diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
index a6fc98aba17..dbe195ff2c0 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
@@ -538,7 +538,7 @@ static int lua_nodelib_direct_getcomponents(lua_State * L)
{
halfword n = lua_tointeger(L, 1);
if ((n) && (type(n) == glyph_node)) {
- lua_pushinteger(L, lig_ptr(n));
+ nodelib_pushdirect_or_nil(lig_ptr(n));
} else {
lua_pushnil(L);
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
index 7c6e1bda2b8..7473ca214a4 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
@@ -116,6 +116,13 @@ static const char *luatexrevision(void)
return (const char *) (strrchr(luatex_version_string, '.') + 1);
}
+static const char *getenginename(void)
+{
+ return engine_name;
+}
+
+
+
static lua_Number get_luatexhashchars(void)
{
return (lua_Number) LUAI_HASHLIMIT;
@@ -217,8 +224,6 @@ static lua_Number shell_escape_state(void)
}
}
-static int luastate_max = 1; /* fixed value */
-
/* temp, for backward compat */
static int init_pool_ptr = 0;
@@ -250,9 +255,10 @@ static struct statistic stats[] = {
{"log_name", 'S', (void *) &getlogname},
{"banner", 'S', (void *) &getbanner},
{"luatex_version", 'G', &get_luatexversion},
- {"luatex_revision", 'S', (void *) &luatexrevision},
+ {"luatex_revision", 'S', (void *) &luatexrevision},
{"luatex_hashtype", 'S', (void *) &get_luatexhashtype},
{"luatex_hashchars", 'N', &get_luatexhashchars},
+ {"luatex_engine", 'S', (void *) &getenginename},
{"ini_version", 'b', &ini_version},
@@ -302,7 +308,6 @@ static struct statistic stats[] = {
{"largest_used_mark", 'g', &biggest_used_mark},
{"luabytecodes", 'g', &luabytecode_max},
{"luabytecode_bytes", 'g', &luabytecode_bytes},
- {"luastates", 'g', &luastate_max},
{"luastate_bytes", 'g', &luastate_bytes},
{"callbacks", 'g', &callback_count},
{"indirect_callbacks", 'g', &saved_callback_count},
diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
index 4ef40be8b71..f7c612ce204 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
+++ b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
@@ -189,6 +189,7 @@ extern int callback_count;
extern int saved_callback_count;
extern const char *luatex_banner;
+extern const char *engine_name;
/* luastuff.h */
diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c
index 7933d17d6df..2b924cac350 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.c
+++ b/Build/source/texk/web2c/luatexdir/luatex.c
@@ -30,7 +30,7 @@
int luatex_version = 100; /* \.{\\luatexversion} */
int luatex_revision = '3'; /* \.{\\luatexrevision} */
-int luatex_date_info = 2017011800; /* the compile date is now hardwired :YEAR MONTH DAY HOUR*/
+int luatex_date_info = 2017021514; /* the compile date is now hardwired :YEAR MONTH DAY HOUR*/
const char *luatex_version_string = "1.0.3";
const char *engine_name = my_name; /* the name of this engine */
diff --git a/Build/source/texk/web2c/mplibdir/ChangeLog b/Build/source/texk/web2c/mplibdir/ChangeLog
index 14b50e16ef9..476aff894ed 100644
--- a/Build/source/texk/web2c/mplibdir/ChangeLog
+++ b/Build/source/texk/web2c/mplibdir/ChangeLog
@@ -1,3 +1,7 @@
+2017-02-13 Luigi Scarso <luigi.scarso@gmail.com>
+ new primitive boundingpath
+
+
2016-03-06 Luigi Scarso <luigi.scarso@gmail.com>
Bump to version 1.9991.
diff --git a/Build/source/texk/web2c/mplibdir/mpmath.w b/Build/source/texk/web2c/mplibdir/mpmath.w
index b713dc14151..6c0ee6d00a6 100644
--- a/Build/source/texk/web2c/mplibdir/mpmath.w
+++ b/Build/source/texk/web2c/mplibdir/mpmath.w
@@ -1,4 +1,4 @@
-% $Id: mpmath.w 2070 2015-10-06 10:35:23Z luigi $
+% $Id: mpmath.w 2118 2017-02-15 17:49:54Z luigi $
%
% This file is part of MetaPost;
% the MetaPost program is in the public domain.
@@ -10,6 +10,8 @@
\font\logos=logosl10
\def\MF{{\tenlogo META}\-{\tenlogo FONT}}
\def\MP{{\tenlogo META}\-{\tenlogo POST}}
+\def\pct!{{\char`\%}} % percent sign in ordinary text
+\def\psqrt#1{\sqrt{\mathstrut#1}}
\def\title{Math support functions for 32-bit integer math}
\pdfoutput=1
@@ -830,9 +832,9 @@ static int mp_round_decimals (MP mp, unsigned char *b, quarterword k) { /* retur
return (int) halfp (a + 1);
}
-@* Scanning numbers in the input
+@* Scanning numbers in the input.
-The definitions below are temporarily here
+The definitions below are temporarily here.
@d set_cur_cmd(A) mp->cur_mod_->type=(A)
@d set_cur_mod(A) mp->cur_mod_->data.n.data.val=(A)
@@ -959,7 +961,7 @@ void mp_velocity (MP mp, mp_number *ret, mp_number st, mp_number ct, mp_number s
} else {
ret->data.val = mp_make_fraction (mp, num, denom);
}
-/* printf ("num,denom=%f,%f -=> %f\n", num/65536.0, denom/65536.0, ret.data.val/65536.0);*/
+/* |printf ("num,denom=%f,%f -=> %f\n", num/65536.0, denom/65536.0, ret.data.val/65536.0);|*/
}
@@ -1858,11 +1860,11 @@ static void mp_m_unif_rand (MP mp, mp_number *ret, mp_number x_orig) {
mp_number_clone (&abs_x, x);
mp_number_abs (&abs_x);
mp_next_random(mp, &u);
- /*take_fraction (y, abs_x, u);*/
+ /*|take_fraction (y, abs_x, u);|*/
mp_number_take_fraction (mp,&y, abs_x,u);
free_number (u);
if (mp_number_equal(y, abs_x)) {
- /*set_number_to_zero(*ret);*/
+ /*|set_number_to_zero(*ret);|*/
mp_number_clone (ret, ((math_data *)mp->math)->zero_t);
} else if (mp_number_greater(x, ((math_data *)mp->math)->zero_t)) {
mp_number_clone (ret, y);
diff --git a/Build/source/texk/web2c/mplibdir/mpmathbinary.w b/Build/source/texk/web2c/mplibdir/mpmathbinary.w
index 28537699196..b15b7983685 100644
--- a/Build/source/texk/web2c/mplibdir/mpmathbinary.w
+++ b/Build/source/texk/web2c/mplibdir/mpmathbinary.w
@@ -4,6 +4,16 @@
% the MetaPost program is in the public domain.
% See the <Show version...> code in mpost.w for more info.
+% Here is TeX material that gets inserted after \input webmac
+
+\font\tenlogo=logo10 % font used for the METAFONT logo
+\font\logos=logosl10
+\def\MF{{\tenlogo META}\-{\tenlogo FONT}}
+\def\MP{{\tenlogo META}\-{\tenlogo POST}}
+\def\pct!{{\char`\%}} % percent sign in ordinary text
+\def\psqrt#1{\sqrt{\mathstrut#1}}
+
+
\def\title{Math support functions for MPFR based math}
\pdfoutput=1
@@ -581,7 +591,7 @@ void mp_number_scaled_to_angle (mp_number *A) {
}
-@* Query functions
+@* Query functions.
@ Convert a number to a scaled value. |decNumberToInt32| is not
able to make this conversion properly, so instead we are using
@@ -671,7 +681,7 @@ char * mp_binnumber_tostring (mpfr_t n) {
*(str+strlen(str)-1) = '\0'; /* get rid of trailing zeroes */
}
buffer = malloc(strlen(str)+13+numprecdigits+1);
- /* the buffer should also fit at least strlen("E+%d", exp) or (numprecdigits-2) worth of zeroes,
+ /* the buffer should also fit at least strlen("E+\%d", exp) or (numprecdigits-2) worth of zeroes,
* because with numprecdigits == 33, the str for "1E32" will be "1", and needing 32 extra zeroes,
* and the decimal dot. To avoid miscalculations by myself, it is safer to add these
* three together.
@@ -863,9 +873,9 @@ void mp_binary_number_make_scaled (MP mp, mp_number *ret, mp_number p_orig, mp_n
@
@d halfp(A) (integer)((unsigned)(A) >> 1)
-@* Scanning numbers in the input
+@* Scanning numbers in the input.
-The definitions below are temporarily here
+The definitions below are temporarily here.
@d set_cur_cmd(A) mp->cur_mod_->type=(A)
@d set_cur_mod(A) mpfr_set((mpfr_ptr)(mp->cur_mod_->data.n.data.num),A, ROUNDING)
@@ -876,10 +886,10 @@ static void mp_wrapup_numeric_token(MP mp, unsigned char *start, unsigned char *
@ The check of the precision is based on the article "27 Bits are not enough for 8-Digit accuracy"
@ by Bennet Goldberg which roughly says that
@ given $p$ digits in base 10 and $q$ digits in base 2,
-@ conversion from base 10 round-trip through base 2 if and only if $10^p < $2^{q-1}$.
+@ conversion from base 10 round-trip through base 2 if and only if $10^p < 2^{q-1}$.
@ In our case $p/\log_{10}2 + 1 < q$, or $q\geq a$
@ where $q$ is the current precision in bits and $a=\left\lceil p/\log_{10}2 + 1\right\rceil$.
-@ Therefore if $a>q$ the number could be too precise and we emit a warning.
+@ Therefore if $a>q$ the required precision could be too high and we emit a warning.
@d too_precise(a) (a>precision_bits)
@c
void mp_wrapup_numeric_token(MP mp, unsigned char *start, unsigned char *stop) {
@@ -887,14 +897,13 @@ void mp_wrapup_numeric_token(MP mp, unsigned char *start, unsigned char *stop) {
mpfr_t result;
size_t l = stop-start+1;
unsigned long lp, lpbit;
- /*size_t lp = l; */
char *buf = mp_xmalloc(mp, l+1, 1);
char *bufp = buf;
buf[l] = '\0';
mpfr_init2(result, precision_bits);
(void)strncpy(buf,(const char *)start, l);
invalid = mpfr_set_str(result,buf, 10, ROUNDING);
- //fprintf(stdout,"scan of [%s] produced %s, ", buf, mp_binnumber_tostring(result));
+ /*|fprintf(stdout,"scan of [%s] produced %s, ", buf, mp_binnumber_tostring(result));|*/
lp = (unsigned long) l;
/* strip leading - or + or 0 or .*/
if ( (*bufp=='-') || (*bufp=='+') || (*bufp=='0') || (*bufp=='.') ) { lp--; bufp++;}
@@ -911,7 +920,7 @@ void mp_wrapup_numeric_token(MP mp, unsigned char *start, unsigned char *stop) {
bufp = NULL;
if (invalid == 0) {
set_cur_mod(result);
- // fprintf(stdout,"mod=%s\n", mp_binary_number_tostring(mp,mp->cur_mod_->data.n));
+ /* |fprintf(stdout,"mod=%s\n", mp_binary_number_tostring(mp,mp->cur_mod_->data.n));|*/
if (too_precise(lpbit)) {
if (mpfr_positive_p((mpfr_ptr)(internal_value (mp_warning_check).data.num)) &&
(mp->scanner_status != tex_flushing)) {
@@ -920,7 +929,7 @@ void mp_wrapup_numeric_token(MP mp, unsigned char *start, unsigned char *stop) {
"with that value; but it might be dangerous.",
"(Set warningcheck:=0 to suppress this message.)",
NULL };
- mp_snprintf (msg, 256, "Number is too precise (%d vs. numberprecision = %f, required precision=%d bits vs internal precision=%f bits)", (unsigned int)lp,mpfr_get_d(internal_value (mp_number_precision).data.num, ROUNDING),(int)lpbit,precision_bits);
+ mp_snprintf (msg, 256, "Required precision is too high (%d vs. numberprecision = %f, required precision=%d bits vs internal precision=%f bits)", (unsigned int)lp,mpfr_get_d(internal_value (mp_number_precision).data.num, ROUNDING),(int)lpbit,precision_bits);
@.Number is too large@>;
mp_error (mp, msg, hlp, true);
}
@@ -1566,7 +1575,7 @@ static void ran_array(long aa[],int n) /* put n new random numbers in aa */
}
/* */
/* the following routines are from exercise 3.6--15 */
-/* after calling ran_start, get new randoms by, e.g., "x=ran_arr_next()" */
+/* after calling |ran_start|, get new randoms by, e.g., |x=ran_arr_next()| */
/* */
#define QUALITY 1009 /* recommended quality level for high-res use */
static long ran_arr_buf[QUALITY];
@@ -1576,7 +1585,7 @@ static long *ran_arr_ptr=&ran_arr_dummy; /* the next random number, or -1 */
#define TT 70 /* guaranteed separation between streams */
#define is_odd(x) ((x)&1) /* units bit of x */
/* */
-static void ran_start(long seed) /* do this before using ran_array */
+static void ran_start(long seed) /* do this before using |ran_array| */
/* long seed selector for different streams */
{
register int t,j;
@@ -1711,12 +1720,12 @@ static void mp_binary_m_unif_rand (MP mp, mp_number *ret, mp_number x_orig) {
mp_number_clone (ret, y);
mp_number_negate (ret);
}
- r = mpfr_get_str(NULL, // char *str,
- &e, // mpfr_exp_t *expptr,
- 10, // int b,
- 0, // size_t n,
- ret->data.num, // mpfr_t op,
- ROUNDING // mpfr_rnd_t rnd
+ r = mpfr_get_str(NULL, /* |char *str|, */
+ &e, /* |mpfr_exp_t *expptr|,*/
+ 10, /* |int b|, */
+ 0, /* |size_t n|, */
+ ret->data.num, /* |mpfr_t op|, */
+ ROUNDING /* |mpfr_rnd_t rnd|*/
);
mpfr_free_str(r);
free_number (abs_x);
@@ -1761,7 +1770,6 @@ static void mp_binary_m_norm_rand (MP mp, mp_number *ret) {
mp_binary_m_log (mp,&la, u);
mp_set_binary_from_substraction(&la, ((math_data *)mp->math)->twelve_ln_2_k, la);
mp_binary_ab_vs_cd (mp,&ab_vs_cd, ((math_data *)mp->math)->one_k, la, xa, xa);
- /*mp_ab_vs_cd (mp,&ab_vs_cd, ((math_data *)mp->math)->one_k, la, xa, xa);*/
} while (mp_number_less(ab_vs_cd,((math_data *)mp->math)->zero_t));
mp_number_clone (ret, xa);
free_number (ab_vs_cd);
@@ -1774,7 +1782,7 @@ static void mp_binary_m_norm_rand (MP mp, mp_number *ret) {
-@ The following subroutine is used only in norm_rand and tests if $ab$ is
+@ The following subroutine is used only in |norm_rand| and tests if $ab$ is
greater than, equal to, or less than~$cd$.
The result is $+1$, 0, or~$-1$ in the three respective cases.
diff --git a/Build/source/texk/web2c/mplibdir/mpmathdecimal.w b/Build/source/texk/web2c/mplibdir/mpmathdecimal.w
index 6394372c5c7..aa86e2b650f 100644
--- a/Build/source/texk/web2c/mplibdir/mpmathdecimal.w
+++ b/Build/source/texk/web2c/mplibdir/mpmathdecimal.w
@@ -10,6 +10,9 @@
\font\logos=logosl10
\def\MF{{\tenlogo META}\-{\tenlogo FONT}}
\def\MP{{\tenlogo META}\-{\tenlogo POST}}
+\def\pct!{{\char`\%}} % percent sign in ordinary text
+\def\psqrt#1{\sqrt{\mathstrut#1}}
+
\def\title{Math support functions for decNumber based math}
\pdfoutput=1
@@ -55,7 +58,7 @@ First, here are some very important constants.
static void mp_decimal_scan_fractional_token (MP mp, int n);
static void mp_decimal_scan_numeric_token (MP mp, int n);
static void mp_ab_vs_cd (MP mp, mp_number *ret, mp_number a, mp_number b, mp_number c, mp_number d);
-/*static void mp_decimal_ab_vs_cd (MP mp, mp_number *ret, mp_number a, mp_number b, mp_number c, mp_number d);*/
+/*|static void mp_decimal_ab_vs_cd (MP mp, mp_number *ret, mp_number a, mp_number b, mp_number c, mp_number d);|*/
static void mp_decimal_crossing_point (MP mp, mp_number *ret, mp_number a, mp_number b, mp_number c);
static void mp_decimal_number_modulo (mp_number *a, mp_number b);
static void mp_decimal_print_number (MP mp, mp_number n);
@@ -139,7 +142,7 @@ int decNumber_check (decNumber *dec, decContext *context)
context->status &= ~DEC_Underflow;
}
if (context->status & DEC_Errors) {
-// fprintf(stdout, "DEC_ERROR %x (%s)\n", context->status, decContextStatusToString(context));
+/*|fprintf(stdout, "DEC_ERROR %x (%s)\n", context->status, decContextStatusToString(context));|*/
test = true;
decNumberZero(dec);
}
@@ -152,7 +155,7 @@ int decNumber_check (decNumber *dec, decContext *context)
} else {
decNumberCopy(dec, &EL_GORDO_decNumber);
}
- } else { // Nan
+ } else { /* Nan */
decNumberZero(dec);
}
}
@@ -214,28 +217,32 @@ static double decNumberToDouble(decNumber *A) {
return res;
} else {
free(buffer);
- //mp->arith_error = 1;
- return 0.0; // whatever
+ /*|mp->arith_error = 1;|*/
+ return 0.0; /* whatever*/
}
}
-
@ Borrowed code from libdfp:
- x^3 x^5 x^7
-arctan(x) = x - --- + --- - --- + ...
- 3 5 7
+% x^3 x^5 x^7
+%arctan(x) = x - --- + --- - --- + ...
+% 3 5 7
+$$ \arctan(x) = x - {x^3\over3} + {x^5\over5} - {x^7\over7} + \ldots$$
+
-This power series works well, if x is close to zero (|x|<0.5).
+This power series works well, if $x$ is close to zero ($|x|<0.5$).
If x is larger, the series converges too slowly,
so in order to get a smaller x, we apply the identity
- sqrt(1+x^2) - 1
-arctan(x) = 2*arctan ---------------
- x
+% sqrt(1+x^2) - 1
+%arctan(x) = 2*arctan ---------------
+% x
+$$ \arctan(x) = 2\,\arctan{{\sqrt{1+x^2}-1}\over x}$$
+
+twice. The first application gives us a new $x$ with $x < 1$.
+The second application gives us a new x with $x < 0.4142136$.
+For that $x$, we use the power series and multiply the result by four.
+
-twice. The first application gives us a new x with x < 1.
-The second application gives us a new x with x < 0.4142136.
-For that x, we use the power series and multiply the result by four.
@c
static void decNumberAtan (decNumber *result, decNumber *x_orig, decContext *set)
@@ -249,22 +256,22 @@ static void decNumberAtan (decNumber *result, decNumber *x_orig, decContext *set
}
for (i=0; i<2; i++) {
decNumber y;
- decNumberMultiply (&y, &x, &x, set); // y = x^2
- decNumberAdd (&y, &y, &one, set); // y = y+1
- decNumberSquareRoot (&y, &y, set); // y = sqrt(y)
- decNumberSubtract (&y, &y, &one, set); // y = y-1
- decNumberDivide (&x, &y, &x, set); // x = y/x
+ decNumberMultiply (&y, &x, &x, set); /* $y = x^2$ */
+ decNumberAdd (&y, &y, &one, set); /* $y = y+1$*/
+ decNumberSquareRoot (&y, &y, set); /* $y = sqrt(y)$ */
+ decNumberSubtract (&y, &y, &one, set); /* $y = y-1$ */
+ decNumberDivide (&x, &y, &x, set); /* $x = y/x$ */
if (decNumberIsZero (&x)) {
decNumberCopy (result, &x);
return;
}
}
- decNumberCopy (&f, &x); // f(0) = x
- decNumberCopy (&g, &one); // g(0) = 1
- decNumberCopy (&term, &x); // term = x
- decNumberCopy (result, &x); // sum = x
- decNumberMultiply (&mx2, &x, &x, set); // mx2 = x^2
- decNumberMinus (&mx2, &mx2, set); // mx2 = -x^2
+ decNumberCopy (&f, &x); /* $f(0) = x$ */
+ decNumberCopy (&g, &one); /*$ g(0) = 1$*/
+ decNumberCopy (&term, &x); /*$ term = x$*/
+ decNumberCopy (result, &x); /*$ sum = x $*/
+ decNumberMultiply (&mx2, &x, &x, set); /*$ mx2 = x^2$*/
+ decNumberMinus (&mx2, &mx2, set); /*$ mx2 = -x^2 $*/
for (i=0; i<2*set->digits; i++) {
decNumberMultiply (&f, &f, &mx2, set);
decNumberAdd (&g, &g, &two_decNumber, set);
@@ -365,11 +372,11 @@ static boolean initialized = false ;
@ @c
void * mp_initialize_decimal_math (MP mp) {
math_data *math = (math_data *)mp_xmalloc(mp,1,sizeof(math_data));
- // various decNumber initializations
- decContextDefault(&set, DEC_INIT_BASE); // initialize
- set.traps=0; // no traps, thank you
- decContextDefault(&limitedset, DEC_INIT_BASE); // initialize
- limitedset.traps=0; // no traps, thank you
+ /* various decNumber initializations */
+ decContextDefault(&set, DEC_INIT_BASE); /* initialize */
+ set.traps=0; /* no traps, thank you */
+ decContextDefault(&limitedset, DEC_INIT_BASE); /* initialize */
+ limitedset.traps=0; /* no traps, thank you */
limitedset.emax = 999999;
limitedset.emin = -999999;
set.digits = DECPRECISION_DEFAULT;
@@ -748,7 +755,7 @@ void mp_number_scaled_to_angle (mp_number *A) {
}
-@* Query functions
+@* Query functions.
@ Convert a number to a scaled value. |decNumberToInt32| is not
able to make this conversion properly, so instead we are using
@@ -776,8 +783,8 @@ int mp_number_to_int(mp_number A) {
result = decNumberToInt32(A.data.num, &set);
if (set.status == DEC_Invalid_operation) {
set.status = 0;
- // mp->arith_error = 1;
- return 0; // whatever
+ /* |mp->arith_error = 1;| */
+ return 0; /* whatever */
} else {
return result;
}
@@ -788,8 +795,8 @@ int mp_number_to_boolean(mp_number A) {
result = decNumberToUInt32(A.data.num, &set);
if (set.status == DEC_Invalid_operation) {
set.status = 0;
- // mp->arith_error = 1;
- return mp_false_code; // whatever
+ /* |mp->arith_error = 1;| */
+ return mp_false_code; /* whatever */
} else {
return result ;
}
@@ -804,8 +811,8 @@ double mp_number_to_double(mp_number A) {
return res;
} else {
free(buffer);
- //mp->arith_error = 1;
- return 0.0; // whatever
+ /* |mp->arith_error = 1;| */
+ return 0.0; /* whatever */
}
}
int mp_number_odd(mp_number A) {
@@ -994,7 +1001,7 @@ void mp_decimal_number_make_scaled (MP mp, mp_number *ret, mp_number p_orig, mp_
@
@d halfp(A) (integer)((unsigned)(A) >> 1)
-@* Scanning numbers in the input
+@* Scanning numbers in the input.
The definitions below are temporarily here
@@ -1038,7 +1045,7 @@ void mp_wrapup_numeric_token(MP mp, unsigned char *start, unsigned char *stop) {
mp_snprintf (msg, 256, "Number is too precise (numberprecision = %d)", set.digits);
mp_error (mp, msg, hlp, true);
}
- } else { // this also captures underflow
+ } else { /* this also captures underflow */
const char *hlp[] = {"I could not handle this number specification",
"Error:",
"",
@@ -1150,46 +1157,46 @@ void mp_decimal_velocity (MP mp, mp_number *ret, mp_number st, mp_number ct, mp_
decNumberFromInt32(&fone, fraction_one);
decNumberFromInt32(&fhalf, fraction_half);
decNumberFromInt32(&ftwo, fraction_two);
- decNumberFromInt32(&sqrtfive, 5); // sqrt(5)
+ decNumberFromInt32(&sqrtfive, 5); /*$\sqrt{5}$*/
decNumberSquareRoot(&sqrtfive, &sqrtfive, &set);
- decNumberDivide(&arg1,sf.data.num, &i16, &set); // arg1 = sf / 16
- decNumberSubtract(&arg1,st.data.num,&arg1, &set); // arg1 = st - arg1
- decNumberDivide(&arg2,st.data.num, &i16, &set); // arg2 = st / 16
- decNumberSubtract(&arg2,sf.data.num,&arg2, &set); // arg2 = sf - arg2
- mp_decimal_take_fraction (mp, &acc, &arg1, &arg2); // acc = (arg1 * arg2) / fmul
+ decNumberDivide(&arg1,sf.data.num, &i16, &set); /* arg1 = sf / 16*/
+ decNumberSubtract(&arg1,st.data.num,&arg1, &set); /* arg1 = st - arg1*/
+ decNumberDivide(&arg2,st.data.num, &i16, &set); /* arg2 = st / 16*/
+ decNumberSubtract(&arg2,sf.data.num,&arg2, &set); /* arg2 = sf - arg2*/
+ mp_decimal_take_fraction (mp, &acc, &arg1, &arg2); /* acc = (arg1 * arg2) / fmul*/
decNumberCopy(&arg1, &acc);
- decNumberSubtract(&arg2, ct.data.num, cf.data.num, &set); // arg2 = ct - cf
- mp_decimal_take_fraction (mp, &acc, &arg1, &arg2); // acc = (arg1 * arg2 ) / fmul
+ decNumberSubtract(&arg2, ct.data.num, cf.data.num, &set); /* arg2 = ct - cf*/
+ mp_decimal_take_fraction (mp, &acc, &arg1, &arg2); /* acc = (arg1 * arg2 ) / fmul*/
- decNumberSquareRoot(&arg1, &two_decNumber, &set); // arg1 = sqrt(2)
- decNumberMultiply(&arg1, &arg1, &fone, &set); // arg1 = arg1 * fmul
- mp_decimal_take_fraction (mp, &r1, &acc, &arg1); // r1 = (acc * arg1) / fmul
- decNumberAdd(&num, &ftwo, &r1, &set); // num = ftwo + r1
+ decNumberSquareRoot(&arg1, &two_decNumber, &set); /* arg1 = $\sqrt{2}$*/
+ decNumberMultiply(&arg1, &arg1, &fone, &set); /* arg1 = arg1 * fmul*/
+ mp_decimal_take_fraction (mp, &r1, &acc, &arg1); /* r1 = (acc * arg1) / fmul*/
+ decNumberAdd(&num, &ftwo, &r1, &set); /* num = ftwo + r1*/
- decNumberSubtract(&arg1,&sqrtfive, &one, &set); // arg1 = sqrt(5) - 1
- decNumberMultiply(&arg1,&arg1,&fhalf, &set); // arg1 = arg1 * fmul/2
- decNumberMultiply(&arg1,&arg1,&three_decNumber, &set); // arg1 = arg1 * 3
+ decNumberSubtract(&arg1,&sqrtfive, &one, &set); /* arg1 = $\sqrt{5}$ - 1*/
+ decNumberMultiply(&arg1,&arg1,&fhalf, &set); /* arg1 = arg1 * fmul/2*/
+ decNumberMultiply(&arg1,&arg1,&three_decNumber, &set); /* arg1 = arg1 * 3*/
- decNumberSubtract(&arg2,&three_decNumber, &sqrtfive, &set); // arg2 = 3 - sqrt(5)
- decNumberMultiply(&arg2,&arg2,&fhalf, &set); // arg2 = arg2 * fmul/2
- decNumberMultiply(&arg2,&arg2,&three_decNumber, &set); // arg2 = arg2 * 3
- mp_decimal_take_fraction (mp, &r1, ct.data.num, &arg1) ; // r1 = (ct * arg1) / fmul
- mp_decimal_take_fraction (mp, &r2, cf.data.num, &arg2); // r2 = (cf * arg2) / fmul
+ decNumberSubtract(&arg2,&three_decNumber, &sqrtfive, &set); /* arg2 = 3 - $\sqrt{5}$*/
+ decNumberMultiply(&arg2,&arg2,&fhalf, &set); /* arg2 = arg2 * fmul/2*/
+ decNumberMultiply(&arg2,&arg2,&three_decNumber, &set); /* arg2 = arg2 * 3*/
+ mp_decimal_take_fraction (mp, &r1, ct.data.num, &arg1) ; /* r1 = (ct * arg1) / fmul*/
+ mp_decimal_take_fraction (mp, &r2, cf.data.num, &arg2); /* r2 = (cf * arg2) / fmul*/
- decNumberFromInt32(&denom, fraction_three); // denom = 3fmul
- decNumberAdd(&denom, &denom, &r1, &set); // denom = denom + r1
- decNumberAdd(&denom, &denom, &r2, &set); // denom = denom + r1
+ decNumberFromInt32(&denom, fraction_three); /* denom = 3fmul*/
+ decNumberAdd(&denom, &denom, &r1, &set); /* denom = denom + r1*/
+ decNumberAdd(&denom, &denom, &r2, &set); /* denom = denom + r1*/
decNumberCompare(&arg1, t.data.num, &one, &set);
- if (!decNumberIsZero(&arg1)) { // t != r1
- decNumberDivide(&num, &num, t.data.num, &set); // num = num / t
+ if (!decNumberIsZero(&arg1)) { /* t != r1*/
+ decNumberDivide(&num, &num, t.data.num, &set); /* num = num / t*/
}
- decNumberCopy(&r2, &num); // r2 = num / 4
+ decNumberCopy(&r2, &num); /* r2 = num / 4*/
decNumberDivide(&r2, &r2, &four_decNumber, &set);
- if (decNumberLess(&denom,&r2)) { // num/4 >= denom => denom < num/4
+ if (decNumberLess(&denom,&r2)) { /* num/4 >= denom => denom < num/4*/
decNumberFromInt32(ret->data.num,fraction_four);
} else {
mp_decimal_make_fraction (mp, ret->data.num, &num, &denom);
@@ -1501,10 +1508,10 @@ void mp_decimal_pyth_add (MP mp, mp_number *ret, mp_number a_orig, mp_number b_o
decNumberMultiply(&bsq, &b, &b, &set);
decNumberAdd(&a, &asq, &bsq, &set);
decNumberSquareRoot(ret->data.num, &a, &set);
- //if (set.status != 0) {
- // mp->arith_error = true;
- // decNumberCopy(ret->data.num, &EL_GORDO_decNumber);
- //}
+ /*|if (set.status != 0) {|*/
+ /*| mp->arith_error = true;|*/
+ /*| decNumberCopy(ret->data.num, &EL_GORDO_decNumber);|*/
+ /*|}|*/
mp_check_decNumber(mp, ret->data.num, &set);
}
@@ -1696,12 +1703,12 @@ static void sinecosine(decNumber *theangle, decNumber *c, decNumber *s)
decNumberAdd (s, s, &pxa, &set);
decNumberFromInt32(&n2, 2*n+1);
- decNumberMultiply (&fac, &fac, &n2, &set); // fac = fac * (2*n+1)
+ decNumberMultiply (&fac, &fac, &n2, &set); /* fac = fac * (2*n+1)*/
decNumberPower(&pxa, theangle, &n2, &limitedset);
decNumberDivide (&pxa, &pxa, &fac, &set);
decNumberMultiply (&pxa, &pxa, &p, &set);
decNumberAdd (c, c, &pxa, &set);
- // printf("\niteration %2d: %-42s %-42s",n,tostring(c), tostring(s));
+ /* |printf("\niteration %2d: %-42s %-42s",n,tostring(c), tostring(s));|*/
}
}
@@ -1750,7 +1757,7 @@ mp_number_to_double(*n_cos), mp_number_to_double(*n_sin));
mp_check_decNumber(mp, n_sin->data.num, &set);
}
-@ This is the http://www-cs-faculty.stanford.edu/~uno/programs/rng.c
+@ This is the {\tt http://www-cs-faculty.stanford.edu/~uno/programs/rng.c}
with small cosmetic modifications.
@c
@@ -1773,7 +1780,7 @@ static void ran_array(long aa[],int n) /* put n new random numbers in aa */
}
/* */
/* the following routines are from exercise 3.6--15 */
-/* after calling ran_start, get new randoms by, e.g., "x=ran_arr_next()" */
+/* after calling |ran_start|, get new randoms by, e.g., "|x=ran_arr_next()|" */
/* */
#define QUALITY 1009 /* recommended quality level for high-res use */
static long ran_arr_buf[QUALITY];
@@ -1783,8 +1790,8 @@ static long *ran_arr_ptr=&ran_arr_dummy; /* the next random number, or -1 */
#define TT 70 /* guaranteed separation between streams */
#define is_odd(x) ((x)&1) /* units bit of x */
/* */
-static void ran_start(long seed) /* do this before using ran_array */
- /* long seed selector for different streams */
+static void ran_start(long seed) /* do this before using |ran_array| */
+ /* |long seed| selector for different streams */
{
register int t,j;
long x[KK+KK-1]; /* the preparation buffer */
@@ -1972,32 +1979,32 @@ static void mp_decimal_m_norm_rand (MP mp, mp_number *ret) {
-@ The following subroutine could be used in norm_rand and tests if $ab$ is
+@ The following subroutine could be used in |norm_rand| and tests if $ab$ is
greater than, equal to, or less than~$cd$.
The result is $+1$, 0, or~$-1$ in the three respective cases.
-This is not necessary, even if it's shorter than the current ab_vs_cd
-and looks as a native implememtation.
+This is not necessary, even if it's shorter than the current |ab_vs_cd|
+and looks as a native implementation.
@c
/*
-void mp_decimal_ab_vs_cd (MP mp, mp_number *ret, mp_number a_orig, mp_number b_orig, mp_number c_orig, mp_number d_orig) {
- decNumber a, b, c, d;
- decNumber ab, cd;
- (void)mp;
-
- decNumberCopy(&a, (decNumber *)a_orig.data.num);
- decNumberCopy(&b, (decNumber *)b_orig.data.num);
- decNumberCopy(&c, (decNumber *)c_orig.data.num);
- decNumberCopy(&d, (decNumber *)d_orig.data.num);
-
-
- decNumberMultiply (&ab, (decNumber *)a_orig.data.num, (decNumber *)b_orig.data.num, &set);
- decNumberMultiply (&cd, (decNumber *)c_orig.data.num, (decNumber *)d_orig.data.num, &set);
- decNumberCompare(ret->data.num, &ab, &cd, &set);
- mp_check_decNumber(mp, ret->data.num, &set);
- return;
-
-}
+|void mp_decimal_ab_vs_cd (MP mp, mp_number *ret, mp_number a_orig, mp_number b_orig, mp_number c_orig, mp_number d_orig) {|
+| decNumber a, b, c, d;|
+| decNumber ab, cd;|
+| (void)mp;|
+||
+| decNumberCopy(&a, (decNumber *)a_orig.data.num);|
+| decNumberCopy(&b, (decNumber *)b_orig.data.num);|
+| decNumberCopy(&c, (decNumber *)c_orig.data.num);|
+| decNumberCopy(&d, (decNumber *)d_orig.data.num);|
+||
+||
+| decNumberMultiply (&ab, (decNumber *)a_orig.data.num, (decNumber *)b_orig.data.num, &set);|
+| decNumberMultiply (&cd, (decNumber *)c_orig.data.num, (decNumber *)d_orig.data.num, &set);|
+| decNumberCompare(ret->data.num, &ab, &cd, &set);|
+| mp_check_decNumber(mp, ret->data.num, &set);|
+| return;|
+||
+|}|
*/
diff --git a/Build/source/texk/web2c/mplibdir/mpmathdouble.w b/Build/source/texk/web2c/mplibdir/mpmathdouble.w
index 9caf70653b6..cb14969365f 100644
--- a/Build/source/texk/web2c/mplibdir/mpmathdouble.w
+++ b/Build/source/texk/web2c/mplibdir/mpmathdouble.w
@@ -1,4 +1,4 @@
-% $Id: mpmathdouble.w 2091 2016-09-16 23:07:58Z luigi $
+% $Id: mpmathdouble.w 2118 2017-02-15 17:49:54Z luigi $
%
% This file is part of MetaPost;
% the MetaPost program is in the public domain.
@@ -10,6 +10,9 @@
\font\logos=logosl10
\def\MF{{\tenlogo META}\-{\tenlogo FONT}}
\def\MP{{\tenlogo META}\-{\tenlogo POST}}
+\def\pct!{{\char`\%}} % percent sign in ordinary text
+\def\psqrt#1{\sqrt{\mathstrut#1}}
+
\def\title{Math support functions for IEEE double based math}
\pdfoutput=1
@@ -645,7 +648,7 @@ double mp_double_make_scaled (MP mp, double p, double q);
@
@d halfp(A) (integer)((unsigned)(A) >> 1)
-@* Scanning numbers in the input
+@* Scanning numbers in the input.
The definitions below are temporarily here
@@ -1257,7 +1260,7 @@ static void ran_array(long aa[],int n) /* put n new random numbers in aa */
}
/* */
/* the following routines are from exercise 3.6--15 */
-/* after calling ran_start, get new randoms by, e.g., "x=ran_arr_next()" */
+/* after calling |ran_start|, get new randoms by, e.g., |x=ran_arr_next()| */
/* */
#define QUALITY 1009 /* recommended quality level for high-res use */
static long ran_arr_buf[QUALITY];
@@ -1267,7 +1270,7 @@ static long *ran_arr_ptr=&ran_arr_dummy; /* the next random number, or -1 */
#define TT 70 /* guaranteed separation between streams */
#define is_odd(x) ((x)&1) /* units bit of x */
/* */
-static void ran_start(long seed) /* do this before using ran_array */
+static void ran_start(long seed) /* do this before using |ran_array| */
/* long seed selector for different streams */
{
register int t,j;
@@ -1464,7 +1467,7 @@ static void mp_double_m_norm_rand (MP mp, mp_number *ret) {
-@ The following subroutine is used only in norm_rand and tests if $ab$ is
+@ The following subroutine is used only in |norm_rand| and tests if $ab$ is
greater than, equal to, or less than~$cd$.
The result is $+1$, 0, or~$-1$ in the three respective cases.
diff --git a/Build/source/texk/web2c/mplibdir/mpost.w b/Build/source/texk/web2c/mplibdir/mpost.w
index 4c4d671df21..43da635c3fc 100644
--- a/Build/source/texk/web2c/mplibdir/mpost.w
+++ b/Build/source/texk/web2c/mplibdir/mpost.w
@@ -4,6 +4,11 @@
\font\tenlogo=logo10 % font used for the METAFONT logo
\def\MP{{\tenlogo META}\-{\tenlogo POST}}
+\def\MF{{\tenlogo META}\-{\tenlogo FONT}}
+\def\MP{{\tenlogo META}\-{\tenlogo POST}}
+\def\pct!{{\char`\%}} % percent sign in ordinary text
+\def\psqrt#1{\sqrt{\mathstrut#1}}
+
\def\title{MetaPost executable}
\def\[#1]{#1.}
@@ -608,7 +613,6 @@ static char *mpost_find_file(MP mp, const char *fname, const char *fmode, int ft
struct stat source_stat, target_stat;
char *mpname = mpost_xstrdup(f);
*(mpname + strlen(mpname) -1 ) = '\0';
- /* printf("statting %s and %s\n", mpname, f); */
if ((stat(f, &target_stat) >= 0) &&
(stat(mpname, &source_stat) >= 0)) {
#if HAVE_ST_MTIM
diff --git a/Build/source/texk/web2c/mplibdir/mpstrings.w b/Build/source/texk/web2c/mplibdir/mpstrings.w
index ff4e5b6b44e..25dcf91b182 100644
--- a/Build/source/texk/web2c/mplibdir/mpstrings.w
+++ b/Build/source/texk/web2c/mplibdir/mpstrings.w
@@ -2,10 +2,18 @@
% the MetaPost program is in the public domain.
% See the <Show version...> code in mpost.w for more info.
+\font\tenlogo=logo10 % font used for the METAFONT logo
+\font\logos=logosl10
+\def\MF{{\tenlogo META}\-{\tenlogo FONT}}
+\def\MP{{\tenlogo META}\-{\tenlogo POST}}
+\def\pct!{{\char`\%}} % percent sign in ordinary text
+\def\psqrt#1{\sqrt{\mathstrut#1}}
+
+
@* String handling.
-@ First, we will need some stuff from other files
+@ First, we will need some stuff from other files.
@c
#include <w2c/config.h>
#include <stdio.h>
@@ -19,7 +27,7 @@
#include <time.h> /* for struct tm \& co */
#include "mpstrings.h" /* internal header */
-@ Then there is some stuff we need to prepare ourselves
+@ Then there is some stuff we need to prepare ourselves.
@(mpstrings.h@>=
#ifndef MPSTRINGS_H
@@ -173,7 +181,7 @@ void mp_dealloc_strings (MP mp) {
mp->cur_string_size = 0;
}
-@ Here are the definitions
+@ Here are the definitions:
@<Definitions@>=
extern void mp_initialize_strings (MP mp);
extern void mp_dealloc_strings (MP mp);
@@ -250,7 +258,7 @@ in the |cur_string|.
|make_string| has stored a new string in the avl tree, the
|cur_string| variable has to be prepared so that it will be ready to
start creating a new string. The initial size is fairly arbitrary, but
-setting it a little higher than expected helps prevent |reallocs|
+setting it a little higher than expected helps prevent |reallocs|.
@<Definitions@>=
void mp_reset_cur_string (MP mp);
@@ -380,7 +388,7 @@ mp_string mp_cat (MP mp, mp_string a, mp_string b) {
size_t saved_cur_string_size = mp->cur_string_size;
needed = a->len + b->len;
mp->cur_length = 0;
- /* mp->cur_string = NULL; */ /* needs malloc, spotted by clang */
+ /*| mp->cur_string = NULL;| */ /* needs malloc, spotted by clang */
mp->cur_string = (unsigned char *) mp_xmalloc (mp, needed+1, sizeof (unsigned char));
mp->cur_string_size = 0;
str_room (needed+1);
diff --git a/Build/source/texk/web2c/mplibdir/mpxout.w b/Build/source/texk/web2c/mplibdir/mpxout.w
index 8d1dee5ed49..22b8f242b35 100644
--- a/Build/source/texk/web2c/mplibdir/mpxout.w
+++ b/Build/source/texk/web2c/mplibdir/mpxout.w
@@ -1814,7 +1814,7 @@ commands. It is also capable of executing the typesetting commands for
a character in a virtual font.
@ The definition of \.{DVI} files refers to six registers,
-$(h,v,w,x,y,z)$, which hold web_integer values in \.{DVI} units.
+$(h,v,w,x,y,z)$, which hold |web_integer| values in \.{DVI} units.
These units come directly from the input file except they need to be
rescaled when typesetting characters from a virtual font.
The stack of $(h,v,w,x,y,z)$ values is represented by six arrays
@@ -2682,7 +2682,7 @@ static int mpx_get_int(MPX mpx, char *s) {
}
@ GROFF font description files use octal character codes
-|groff_font(5)|: The code can be any web_integer. If it starts with
+|groff_font(5)|: The code can be any |web_integer|. If it starts with
a 0 it will be interpreted as octal; if it starts with 0x
or 0X it will be intepreted as hexadecimal.
@@ -2700,10 +2700,10 @@ BAD:
return 0;
}
-@ Troff output files contain few if any non-web_integers, but this program is
+@ Troff output files contain few if any non-|web_integers|, but this program is
prepared to read floats whenever they seem reasonable; i.e., when the
number is not being used for character positioning. (For non-PostScript
-applications h and v are usually in pixels and should be web_integers.)
+applications h and v are usually in pixels and should be |web_integers|.)
@c
static float mpx_get_float(MPX mpx, char *s) {
@@ -2742,7 +2742,7 @@ static float mpx_get_float(MPX mpx, char *s) {
}
@ GROFF font description files have metrics field
-of comma-separated web_integers. Traditional troff
+of comma-separated |web_integers|. Traditional troff
have a float in this position. The value is not
used anyway - thus just skip the value,
eat all non-space chars.
@@ -2949,7 +2949,7 @@ in |groff_font(5)|. In order to allow parsing of groff's font files,
this function needs to be rewritten as follows:
\item{1.}The `metrics' field parsed by |mpx_get_float(lin);| may include
- a comma-separated list of up to six decimal web_integers rather
+ a comma-separated list of up to six decimal |web_integers| rather
than just a single floating-point number.
\item{2.}The `charcode' field parsed by |lastcode = mpx_get_int(arg_tail);|
diff --git a/Build/source/texk/web2c/mplibdir/pngout.w b/Build/source/texk/web2c/mplibdir/pngout.w
index 1b725d0575f..b42bf7b3219 100644
--- a/Build/source/texk/web2c/mplibdir/pngout.w
+++ b/Build/source/texk/web2c/mplibdir/pngout.w
@@ -468,13 +468,14 @@ void mp_png_text_out (MP mp, mp_text_object *p) {
cairo_fill(mp->png->cr);
}
wd = mp_get_char_dimension (mp, mp->font_name[fn], k, 'w');
- /* wd/100 is the size in PS point , ie wd =100*real_wd */
- /* but _without_ considering scaling. */
- /* We have a scale factor of */
- /* (ds/1000.0)*scf */
- /* so to match the scale wd should be */
- /* 1000*real_wd *scf /(ds *scf) */
- /* i.e. 10*wd/ds */
+/* $wd/100$ is the size in PS point , i.e, $wd =100\cdot real\_wd$
+ but without considering scaling.
+ We have a scale factor of
+ $(ds/1000.0)\cdot scf$
+ so to match the scale wd should be
+ $1000\cdot real_wd\cdot scf /(ds\cdot scf)$
+ i.e. $wd = 10\cdot wd/ds$.
+*/
wd *= 10.0/ds;
cairo_translate(mp->png->cr,wd,0);
}
@@ -483,7 +484,7 @@ void mp_png_text_out (MP mp, mp_text_object *p) {
@ When stroking a path with an elliptical pen, it is necessary to transform
the coordinate system so that a unit circular pen will have the desired shape.
-To keep this transformation local, we enclose it in a $$\&{<g>}\ldots\&{</g>}$$
+To keep this transformation local, we enclose it in a $$\&{\<g>}\ldots\&{\</g>}$$
block. Any translation component must be applied to the path being stroked
while the rest of the transformation must apply only to the pen.
If |fill_also=true|, the path is to be filled as well as stroked so we must
diff --git a/Build/source/texk/web2c/mplibdir/psout.w b/Build/source/texk/web2c/mplibdir/psout.w
index 265c42acc0a..6616d80b100 100644
--- a/Build/source/texk/web2c/mplibdir/psout.w
+++ b/Build/source/texk/web2c/mplibdir/psout.w
@@ -234,7 +234,7 @@ by all \PASCAL\ compilers.
@c
static void mp_ps_print_int (MP mp,integer n) { /* prints an integer in decimal form */
integer m; /* used to negate |n| in possibly dangerous cases */
- char outbuf [24]; /* dig[23], plus terminating \0 */
+ char outbuf [24]; /* dig[23], plus terminating |\0| */
unsigned char dig[23]; /* digits in a number, for rounding */
int k = 0; /* index to current digit; we assume that $|n|<10^{23}$ */
int l = 0;
@@ -1385,7 +1385,7 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
mp->selector = save_selector;
mp->ps->fm_file = NULL;
}
- /* mp_xfree(n); */
+ /* |mp_xfree(n);| */
break;
case MAPLINE:
fm_scan_line (mp);
@@ -3499,7 +3499,7 @@ mp_ps_font *mp_ps_font_parse (MP mp, int tex_font) {
t1_scan_param (mp, (font_number)tex_font, fm_cur);
} while (mp->ps->t1_in_eexec == 0);
- /* t1_start_eexec (mp,fm_cur); */
+ /* |t1_start_eexec (mp,fm_cur);| */
cc_init ();
cs_init (mp);
/* the boolean is needed to make sure that |t1_read_subrs|
@@ -3554,7 +3554,7 @@ void mp_ps_font_free (MP mp, mp_ps_font *f);
@<Variables for the charstring parser@>=
double flex_hint_data[14]; /* store temp. coordinates of flex hints */
-unsigned int flex_hint_index ; /* index for flex_hint_data */
+unsigned int flex_hint_index ; /* index for |flex_hint_data| */
boolean ignore_flex_hint; /* skip hint for flex */
double cur_x, cur_y; /* current point */
double orig_x, orig_y; /* origin (for seac) */
@@ -3803,7 +3803,7 @@ boolean cs_parse (MP mp, mp_ps_font *f, const char *cs_name, int subr)
(int) (stack_ptr - cc_stack), (int) cc->nargs);
}
switch (cc - cc_tab) {
- case CS_CLOSEPATH: /* - CLOSEPATH |- */
+ case CS_CLOSEPATH: /* |- CLOSEPATH |- */
cs_debug(CS_CLOSEPATH);
finish_subpath(mp, f);
cc_clear ();
@@ -3873,7 +3873,7 @@ boolean cs_parse (MP mp, mp_ps_font *f, const char *cs_name, int subr)
cc_clear ();
break;
/* hinting commands */
- case CS_DOTSECTION: /* - DOTSECTION |- */
+ case CS_DOTSECTION: /* |- DOTSECTION |- */
cs_debug(CS_DOTSECTION);
cc_clear ();
break;
@@ -3909,7 +3909,7 @@ boolean cs_parse (MP mp, mp_ps_font *f, const char *cs_name, int subr)
(void)cs_parse(mp,f,standard_glyph_names[a2],0);
}
break;
- case CS_ENDCHAR: /* - ENDCHAR |- */
+ case CS_ENDCHAR: /* |- ENDCHAR |- */
cs_debug(CS_ENDCHAR);
cc_clear ();
return true;
@@ -3962,32 +3962,32 @@ boolean cs_parse (MP mp, mp_ps_font *f, const char *cs_name, int subr)
if (a1==1)
f->ignore_flex_hint = 1;
if (a1==0) {
- /* double first_x,first_y,first_r_x,first_r_y; */
- /* double join_x,join_y,join_l_x,join_l_y,join_r_x,join_r_y; */
- /* double last_x,last_y,last_l_x,last_l_y; */
- /* /\* a := glyph "q" of "cmti12"; *\/ */
- /* first_x = 206.0; first_y = -194.0; */
- /* double ref_x,ref_y ; */
- /* ref_x = first_x+f->flex_hint_data[0]; */
- /* ref_y = first_y+f->flex_hint_data[1]; */
- /* printf("1:(%f, %f) 2:(%f,%f) 3:(%f,%f) 4:(%f,%f) 5:(%f,%f) 6:(%f,%f) 7:(%f,%f)\n", */
- /* f->flex_hint_data[0],f->flex_hint_data[1], */
- /* f->flex_hint_data[2],f->flex_hint_data[3], */
- /* f->flex_hint_data[4],f->flex_hint_data[5], */
- /* f->flex_hint_data[6],f->flex_hint_data[7], */
- /* f->flex_hint_data[8],f->flex_hint_data[9], */
- /* f->flex_hint_data[10],f->flex_hint_data[11], */
- /* f->flex_hint_data[12],f->flex_hint_data[13]); */
- /* printf("Reference=(%f,%f)\n",ref_x,ref_y); */
- /* first_r_x = ref_x + f->flex_hint_data[2]; first_r_y = ref_y + f->flex_hint_data[3]; */
- /* join_l_x = first_r_x + f->flex_hint_data[4]; join_l_y = first_r_y + f->flex_hint_data[5]; */
- /* join_x = join_l_x + f->flex_hint_data[6]; join_y = join_l_y + f->flex_hint_data[7]; */
- /* join_r_x = join_x + f->flex_hint_data[8]; join_r_y = join_y + f->flex_hint_data[9]; */
- /* last_l_x = join_r_x + f->flex_hint_data[10]; last_l_y = join_r_y + f->flex_hint_data[11]; */
- /* last_x = last_l_x + f->flex_hint_data[12]; last_y = last_l_y + f->flex_hint_data[13]; */
- /* printf("(%f,%f) .. (%f,%f) and (%f,%f) .. (%f,%f) .. (%f,%f) and (%f,%f) .. (%f,%f)\n", */
- /* first_x,first_y,first_r_x,first_r_y, join_l_x,join_l_y, join_x,join_y, join_r_x,join_r_y, */
- /* last_l_x,last_l_y,last_x,last_y); */
+ /*| double first_x,first_y,first_r_x,first_r_y; |*/
+ /*| double join_x,join_y,join_l_x,join_l_y,join_r_x,join_r_y; |*/
+ /*| double last_x,last_y,last_l_x,last_l_y; |*/
+ /*| |// a := glyph "q" of "cmti12";| |*/
+ /*| first_x = 206.0; first_y = -194.0; |*/
+ /*| double ref_x,ref_y ; |*/
+ /*| ref_x = first_x+f->flex_hint_data[0]; |*/
+ /*| ref_y = first_y+f->flex_hint_data[1]; |*/
+ /*| printf("1:(%f, %f) 2:(%f,%f) 3:(%f,%f) 4:(%f,%f) 5:(%f,%f) 6:(%f,%f) 7:(%f,%f)\n", |*/
+ /*| f->flex_hint_data[0],f->flex_hint_data[1], |*/
+ /*| f->flex_hint_data[2],f->flex_hint_data[3], |*/
+ /*| f->flex_hint_data[4],f->flex_hint_data[5], |*/
+ /*| f->flex_hint_data[6],f->flex_hint_data[7], |*/
+ /*| f->flex_hint_data[8],f->flex_hint_data[9], |*/
+ /*| f->flex_hint_data[10],f->flex_hint_data[11], |*/
+ /*| f->flex_hint_data[12],f->flex_hint_data[13]); |*/
+ /*| printf("Reference=(%f,%f)\n",ref_x,ref_y); |*/
+ /*| first_r_x = ref_x + f->flex_hint_data[2]; first_r_y = ref_y + f->flex_hint_data[3]; |*/
+ /*| join_l_x = first_r_x + f->flex_hint_data[4]; join_l_y = first_r_y + f->flex_hint_data[5]; |*/
+ /*| join_x = join_l_x + f->flex_hint_data[6]; join_y = join_l_y + f->flex_hint_data[7]; |*/
+ /*| join_r_x = join_x + f->flex_hint_data[8]; join_r_y = join_y + f->flex_hint_data[9]; |*/
+ /*| last_l_x = join_r_x + f->flex_hint_data[10]; last_l_y = join_r_y + f->flex_hint_data[11]; |*/
+ /*| last_x = last_l_x + f->flex_hint_data[12]; last_y = last_l_y + f->flex_hint_data[13]; |*/
+ /*| printf("(%f,%f) .. (%f,%f) and (%f,%f) .. (%f,%f) .. (%f,%f) and (%f,%f) .. (%f,%f)\n", |*/
+ /*| first_x,first_y,first_r_x,first_r_y, join_l_x,join_l_y, join_x,join_y, join_r_x,join_r_y, |*/
+ /*| last_l_x,last_l_y,last_x,last_y); |*/
f->ignore_flex_hint = 0;
f->flex_hint_index = 0;
diff --git a/Build/source/texk/web2c/mplibdir/svgout.w b/Build/source/texk/web2c/mplibdir/svgout.w
index 6ee2c711739..b7316f3f98b 100644
--- a/Build/source/texk/web2c/mplibdir/svgout.w
+++ b/Build/source/texk/web2c/mplibdir/svgout.w
@@ -881,7 +881,7 @@ void mp_svg_print_glyph_defs (MP mp, mp_edge_object *h) {
mp_svg_open_starttag(mp,"path");
mp_svg_attribute(mp, "style", "fill-rule: evenodd;");
while (p!=NULL) {
- if (mp->svg->loc>0) mp->svg->loc--; /* drop a '\0' */
+ if (mp->svg->loc>0) mp->svg->loc--; /* drop a '\\0' */
mp_svg_font_path_out(mp, gr_path_p((mp_fill_object *)p));
p=p->next;
}
@@ -922,7 +922,7 @@ void mp_svg_text_out (MP mp, mp_text_object *p, int prologues) {
size_t l; /* string length */
boolean transformed ;
double ds; /* design size and scale factor for a text node */
- /* clang: never read: fname = mp->font_ps_name[gr_font_n(p)]; */
+ /* clang: never read: |fname = mp->font_ps_name[gr_font_n(p)];| */
s = (unsigned char *)gr_text_p(p);
l = gr_text_l(p);
transformed=(gr_txx_val(p)!=unity)||(gr_tyy_val(p)!=unity)||