When using New Computer Modern font, raw text block renders single quote after a Greek letter differently

It relates to the script.

#show raw: set text(font: "New Computer Modern Mono")
= script: auto // Guess the script from the surrounding characters
`greek: τ'` vs. `latin: t'`
= script: `grek`
#show raw: set text(script: "grek")
`greek: τ'` vs. `latin: t'`
= script: `latn`
#show raw: set text(script: "latn")
`greek: τ'` vs. `latin: t'`

You can disable the locl Localized Forms feature if you don’t want any script-specific differences:

#show raw: set text(font: "New Computer Modern Mono", features: (locl: 0))
`greek: τ'` vs. `latin: t'`

图片

The workaround above relies on this bug: The inferred writing script is not passed to HarfBuzz, making `locl` ineffective · Issue #7396 · typst/typst · GitHub


Besides, I recommend that you replace the show-function rule (show raw: text.with(…) with a show-set rule (show raw: set text(…)).
Show-set rules can be overridden later when needed, but once you apply a function, you can never undo it.
See Which show rule takes precedence? - #15 by Y.D.X for explanation.

3 Likes