Skip to content

Match PDF font names with invariant casing - #2175

Open
menes97 wants to merge 1 commit into
oxyplot:developfrom
menes97:fix/pdf-font-name-culture
Open

menes97 wants to merge 1 commit into
oxyplot:developfrom
menes97:fix/pdf-font-name-culture

Conversation

@menes97

@menes97 menes97 commented Nov 18, 2026

Copy link
Copy Markdown

No issue for this one; I found it running the tests on a Turkish-culture machine.

Checklist

  • I have included examples or tests
  • I have updated the change log
  • I am listed in the CONTRIBUTORS file
  • I have cleaned up the commit history (use rebase and squash)

Changes proposed in this pull request:

  • PortableDocument.GetFont lower-cased the font name with ToLower() before matching it against times, courier, etc. Under a Turkish culture "I".ToLower() is the dotless "ı", so SetFont("TIMES", 12) looked up "tımes", didn't match and silently fell back to Helvetica (COURIER too). It now uses ToLowerInvariant().
  • Test: PortableDocumentTests.SetFont_UpperCaseName_TurkishCulture sets the current culture to tr-TR, sets "TIMES", draws text, saves the PDF and checks it uses TimesNewRoman. It fails on develop (the PDF uses Helvetica) and passes with this change; it restores the culture afterwards.
  • CHANGELOG entry under Unreleased / Fixed, and a CONTRIBUTORS entry.

What I ran (Windows, tr-TR): the full OxyPlot.Tests project on develop passed on net10.0, net8.0 and net462 (3261 passed, 5 skipped); after the change, the Pdf tests on net10.0 passed (752). I didn't rerun the full suite on all three frameworks after the change.

Written with Claude Code (AI); I reviewed the change and ran the tests above.

🤖 Generated with Claude Code

PortableDocument.GetFont lower-cased the font name with the current
culture, so "TIMES" became "tımes" under tr-TR and fell back to Helvetica.
Use ToLowerInvariant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant