Repository navigation
Fix: Render Chinese and Japanese characters on invoice PDFs - #1383
Merged
Merged
Conversation
Invoices were rendered with DejaVu Sans only, which has no CJK glyphs, so Chinese names, addresses, event titles and translated labels showed as empty boxes. - Bundle Noto Sans SC (Regular/Bold, OFL) and add it after DejaVu Sans in the invoice font stack; dompdf falls back per character - Enable font subsetting (invoices drop from ~880 KB to ~25-50 KB) - Use bold instead of weight 500 for info values, which fell back to Times and could not render CJK - Route both invoice PDF paths through InvoicePdfRenderer, which skips the CJK font and logs a warning when the dompdf font cache is not writable, so invoices never fail to render
|
🚅 Deployed to the Hi.Events-pr-1383 environment in Hi.Events
1 service not affected by this PR
|
railway-app
Bot
temporarily deployed
to
Hi.Events / Hi.Events-pr-1383
October 11, 2026 08:23
Destroyed
railway-app
Bot
temporarily deployed
to
Hi.Events / Hi.Events-pr-1383
October 11, 2026 08:26
Destroyed
Contributor
|
| ✅ Passed | ❌ Failed | ⏭️ Skipped | ⏱️ Duration | |
|---|---|---|---|---|
| 95 | 0 | 1 | 0 | 2m 44s |
Flaky (passed on retry)
⚠️ organizer/organizer-management.spec.ts— organizer management › an organizer creates a second organizer from the global menu
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A customer reported that invoices for Chinese buyers are in the "wrong format everywhere". Invoices are rendered by DomPDF with DejaVu Sans only, which has no CJK glyphs, so every Chinese character (buyer name, address, event title, organiser details, notes and the
zh-cnlabels) shows as an empty box.Fix
backend/resources/fonts/and add it after DejaVu Sans in the invoice font stack. DomPDF 3 picks the font per character, so Latin text stays in DejaVu and only CJK characters use Noto.font-weight: 500, which neither font has, so DomPDF fell back to Times. That rendered them in serif and would have shown a Chinese invoice prefix as boxes. They now use bold.InvoicePdfRenderer. It creates the DomPDF font cache folder when it's missing, which is always the case on Vapor (/tmp/storage/fonts). If the folder isn't writable, it skips the CJK font and logs a warning, so the invoice renders exactly as before instead of failing.Coverage
Testing
InvoicePdfRendererTest(feature) covers three cases:zh-cninvoice renders correctly in regular and bold.www-data, invoices render.Deploy notes
/tmp.🤖 Generated with Claude Code