On 10/6/2025 10:50 AM, Max Chernoff via ntg-context wrote:
Hi Hans,

On Wed, 2025-03-19 at 03:51 -0600, Max Chernoff wrote:
Using the latest ConTeXt (2025.02.19), negative slants are broken with
compact fonts. Example document:

     \definefontfeature[default][default][Slant=-1]

     \startTEXpage
         Hello, world!
     \stopTEXpage

When compiled with "context", I get the error message

     tex error       > tex error on line 1 in file 
./context-negative-slant.tex: Scale factor (-1000) should be in the range 0..100000
     [...]
     I'm going to use 0 instead of that illegal code value.

but when compiled with "context --nocompactfonts", I get the correct
result.

Negative slants still seem to be broken with the latest (2025.09.25
18:46). Applying the patch at the end of the email seems to fix things,
but it's more of a hack than a real solution since a negative "scale"
doesn't really make much sense.

Thanks,
-- Max

diff --git a/texmf-context/source/luametatex/source/tex/textypes.h 
b/texmf-context/source/luametatex/source/tex/textypes.h
index 0fe86eb..c0d3488 100644
--- a/texmf-context/source/luametatex/source/tex/textypes.h
+++ b/texmf-context/source/luametatex/source/tex/textypes.h
@@ -219,7 +219,7 @@ extern halfword tex_badness(

  # define min_space_factor                           0 /*tex watch out: 
|\spacefactor| cannot be zero but the sf code can!*/
  # define max_space_factor                      0x7FFF /*tex |077777| */
-# define min_scale_factor                           0
+# define min_scale_factor                     -100000
  # define max_scale_factor                      100000 /*tex for now */
  # define default_space_factor                    1000
  # define space_factor_threshold                  2000
@@ -1116,4 +1116,3 @@ typedef enum tex_character_control_codes {
  # define has_character_control(a,b) ((a & b) != 0)

  # endif

That is indeed somewhat hackish. Actually

    \glyphxscale -200 x
    \glyphslant -100 x

are catched as they are internal integers that get clipped later on ...
we can either bark or just silently clip to 0 and 100K whichis more consistent .. as you say, negative values make no sense

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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to