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

未关闭
#263 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
32/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
领域
tooling

调研方向

从提供的最小 Racket 示例和 redex/pict 渲染入口开始,尤其是 render-language;将 REPL 和 PDF 的输出与指定的样式进行比较。完成的标准是,PDF 对相关终端使用 Source Code Pro,而不是 Source Code Variable ExtraLight,同时不导致 REPL 渲染回归。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
Racket
星标
114
派生
42
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

racket/redex 的其他 Issue

查看 racket/redex 的全部 Issue

相似的 Issue

更多 DevTools Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。