On 5/12/2021 11:46 PM, Marcel Fabian Krüger wrote:
Hi,

recently we got an interesting bug report in luaotfload (the original report
is at https://github.com/latex3/luaotfload/issues/184) which relates to the
ConTeXt fontloader. Take the following ConTeXt example:

     \starttext
     \definefontfeature [default:bold] [default] [axis={weight=500}]
     \definedfont[file:NotoSansCJKsc-VF.otf*default:bold @ 10pt]
U+5E2E 帮 \stoptext

The font is available at
https://github.com/googlefonts/noto-cjk/raw/main/Sans/Variable/OTF/NotoSansCJKsc-VF.otf.

This compiles correctly, but the CJK glyph do not appear since
it's Type2 CharString is invalid. The CFF2 CharStrings of this
glyph invokes the rrcurveto operator with 63 arguments, which is

66 etc .. multiples of 6

allowed in CFF2 where the argument limit is 513, but not allowed in
Type2 where the limit is at 48.

a rather low limit right from the start (we can assume only rrcurveto is affected)

It would be great if ConTeXt could check for this and insert additional
rrcuveto operators when necessary to avoid this issue.
after some experiments ... attached

(no upload yet as i'm renaming some low level helpers which needs testing)

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
-----------------------------------------------------------------

Attachment: largestack.pdf
Description: Adobe PDF document

\definefontfeature
  [default:bold]
  [default]
  [axis={weight=500}]

\definefontfeature
  [default:heavy]
  [default]
  [axis={weight=800}]

\definefontfeature
  [default:light]
  [default]
  [axis={weight=250}]

\definefont
  [DemoFontBold]
  [file:NotoSansCJKsc-VF.otf*default:bold @ 10pt]

\definefont
  [DemoFontHeavy]
  [file:NotoSansCJKsc-VF.otf*default:heavy @ 10pt]

\definefont
  [DemoFontLight]
  [file:NotoSansCJKsc-VF.otf*default:light @ 10pt]

\startTEXpage
    \DemoFontBold  \char"5E2D\kern10pt\char"5E2E\kern10pt\char"5E2F\par
    \DemoFontHeavy \char"5E2D\kern10pt\char"5E2E\kern10pt\char"5E2F\par
    \DemoFontLight \char"5E2D\kern10pt\char"5E2E\kern10pt\char"5E2F
\stopTEXpage
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to