On 2/8/2025 9:32 AM, luigi scarso wrote:
On Sat, 8 Feb 2025 at 09:09, Hironori KITAGAWA via luatex
<[email protected] <mailto:[email protected]>> wrote:
Hello all,
I found that TFM-based fonts do not scale in the development
version of LuaTeX:
----
\input luaotfload.sty
\font\la=file:lmroman10-regular.otf scaled 2000
\font\lb=file:lmroman10-regular.otf at 100pt
\font\ca=cmr10 scaled 2000
\font\cb=cmr10 at 100pt
\la abc\lb xyz % ==> OK
\ca abc\cb xyz % ==> typeset in 10pt
\bye
----
I suspect the cause is the following code of font/tfmofm.c,
which is introduced by a recent commit.
----
if ((arith_error) || (z>= 01000000000)) {
char err[256];
const char *errhelp[] = {
"I will ignore the scaling factor.",
NULL
};
snprintf(err, 255, "Font scaled to 2048pt or higher");
tex_error(err, errhelp);
}
z = sw ;
arith_error = saved_arith_error;
}
----
Ok, I am checking it.
- we can change z >= 01000000000 to z > 01000000000 so that the 2048 is
still okay but larger fonts aren't valid (for whatever reason, mostly in
order to be compatible with other engines)
- we can in addition just clip to that max and stick to a warning, no
need to error
but as a starter
if ((arith_error) || (z > 01000000000)) {
could work ok for those choosing 2048 or some scale that results in that
value
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------