Skip to content

Use JetBrains Mono as the PDF code font - #21

Merged
schacon merged 1 commit into
mainfrom
cursor/pdf-jetbrains-mono-6d3c
Aug 3, 2026
Merged

Use JetBrains Mono as the PDF code font#21
schacon merged 1 commit into
mainfrom
cursor/pdf-jetbrains-mono-6d3c

Conversation

@schacon

@schacon schacon commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

Switches the monospace font in the PDF from the default M+ 1mn to JetBrains Mono for inline code (codespan), code blocks (code), and kbd macros.

  • theme/pdf/progit-theme.yml — new PDF theme extending the asciidoctor-pdf default; only the mono font changes. Callout numbers (conum) intentionally keep M+ 1mn, which provides the circled-number glyphs (①②③).
  • theme/pdf/fonts/ — JetBrains Mono v2.304 TTFs (Regular/Bold/Italic/BoldItalic), vendored with its OFL license file.
  • Rakefile and builder/src/tasks.rs — both PDF invocations pass pdf-theme and a pdf-fontsdir that includes the bundled fonts plus GEM_FONTS_DIR (so the default theme's other fonts keep resolving).

Verification

  • Direct asciidoctor-pdf run with the theme completes with zero warnings (no missing glyphs), and rake book:build_pdf works with the new arguments.
  • The generated PDF embeds JetBrainsMono-Regular/Bold/Italic (checked via font names in the file); Noto Serif body and M+ 1mn conums are unchanged, and all 16 circled callout numbers still render.
  • The Rust builder compiles and uses the same theme.
  • Rendered page from the built PDF:

PDF page 22 showing code blocks in JetBrains Mono

Open in Web Open in Cursor 

Add a PDF theme (theme/pdf/progit-theme.yml) extending the default
Asciidoctor PDF theme with JetBrains Mono (v2.304, OFL, bundled in
theme/pdf/fonts) for codespan, code blocks, and kbd. Callout numbers
keep the default M+ 1mn font for its circled-number glyphs. Wire the
theme into both the Rake task and the Rust builder.

Co-authored-by: Scott Chacon <schacon@gmail.com>
@schacon
schacon marked this pull request as ready for review August 3, 2026 19:53
@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@schacon
schacon merged commit ebb476b into main Aug 3, 2026
1 check passed
@schacon
schacon deleted the cursor/pdf-jetbrains-mono-6d3c branch August 3, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants