Skip to content

Redex PDF output contains a wrong font, while Racket REPL renders the correct font #263

Description

@o6po5fcs

When I try to use Source Code Pro as the font for nonterminals, the font is correctly rendered in the output of the racket REPL, but when outputting as pdf then a different font is used in the pdf, namely Source Code Variable with weight ExtraLight.

My OS is macOS Ventura 13.4.1, running Racket 8.9 [cs].

A nearly minimal example to reproduce the issue. Some of the style modifications are undoubtedly redundant since they do not affect nonterminals, but this is the actual configuration that I am using in a project (which may be relevant). If needed, the used fonts can be acquired here: Source Code Pro and CMU Serif.

#lang racket

(require redex
         redex/pict)

(define-language CommonLang
  (atom ::= number boolean string ())
  (r/w ::= READ WRITE))

(define sans-serif-style "Source Code Pro")
(define roman-style "CMU Serif")
(label-style sans-serif-style)
(literal-style sans-serif-style)
(metafunction-style sans-serif-style)
(paren-style roman-style)
(default-style roman-style)
(grammar-style roman-style)
(non-terminal-subscript-style `(subscript large-script italic . ,roman-style))
(non-terminal-superscript-style `(superscript large-script italic . ,roman-style))
(non-terminal-style `(italic . ,roman-style))

(render-language CommonLang)
(render-language CommonLang "./commonlang.pdf")

Pictures of the issue:

Correct font for the READ and WRITE terminals:
correct

Incorrect font for the READ and WRITE terminals:
incorrect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions