Skip to content

Confounding math font issues #3379

@Enivex

Description

@Enivex

Description

I'm not exactly sure how to describe this issue (there may be more than one)

This does not work:

#let scr(it) = {
  show math.equation: set text(font: "New Computer Modern Math Book", stylistic-set: 1)
  $cal(it)$
}

$ cal(A) cal(B) $
$ scr(A) scr(B) $

image

This does work, but the spacing is incorrect:

#let scr(it) = {
  set text(font: "New Computer Modern Math Book", stylistic-set: 1)
  $cal(it)$
}

$ cal(A) cal(B) $
$ scr(A) scr(B) $

image

The following workaround works on 0.10, but does not work on main:

#let scr(it) = {
  math.class(
    "normal",
    text(font: "New Computer Modern Math Book", stylistic-set: 1, $cal(it)$),
  )
}

$ cal(A) cal(B) $
$ scr(A) scr(B) $

Output in 0.10:

image

Output on main: Same as the picture above with wrong spacing

Lastly, and perhaps most weirdly (and really a different issue)
None of the above work with "New Computer Modern Math" instead of "New Computer Modern Math Book" (they all display as the top picture). This might lead one to believe that it's the font that is at fault (missing stylistic set for instance). However, this is not the case, because

#show math.equation: set text(font: "New Computer Modern Math", stylistic-set: 1)

$ cal(A) cal(B) $

works as intended

image

Reproduction URL

No response

Operating system

Windows

Typst version

  • I am using the latest version of Typst

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmathRelated to math syntax, layout, etc.stylingAbout set and show rules or style properties

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions