Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.

### Fixed
- DateTimeAxis converting local time rather than UTC to TimeZone
- PDF font name matching broken under Turkish culture (upper-case names such as "TIMES")

### Changed
- Target .NET 10, remove target .NET 6 (out of support and incompatible with nuget updates)
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Matt Williams
Matthew Leibowitz <mattleibow@live.com>
Memphisch <memphis@machzwo.de>
Mendel Monteiro-Beckerman
menes97 <38889017+menes97@users.noreply.github.com>
Menno Deij - van Rijswijk <m.deij@marin.nl>
Menno van der Woude <mennowo@gmail.com>
methdotnet
Expand Down
24 changes: 24 additions & 0 deletions Source/OxyPlot.Tests/Pdf/PortableDocumentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,30 @@ public void DrawText_HelloWorld()
doc.Save(Folder + "DrawText.pdf");
}

[Test]
public void SetFont_UpperCaseName_TurkishCulture()
{
var culture = CultureInfo.CurrentCulture;
try
{
CultureInfo.CurrentCulture = new CultureInfo("tr-TR");
var doc = new PortableDocument();
doc.AddPage(PageSize.A4);
doc.SetFont("TIMES", 12);
doc.DrawText(50, 400, "Hello world!");
using (var ms = new MemoryStream())
{
doc.Save(ms);
var pdf = Encoding.ASCII.GetString(ms.ToArray());
Assert.That(pdf, Does.Contain("TimesNewRoman"));
}
}
finally
{
CultureInfo.CurrentCulture = culture;
}
}

[Test, Ignore("Not supported")]
public void DrawText_SpecialCharacters()
{
Expand Down
2 changes: 1 addition & 1 deletion Source/OxyPlot/Pdf/PortableDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ private static PortableDocumentFont GetFont(string fontName, bool bold, bool ita
{
if (fontName != null)
{
fontName = fontName.ToLower();
fontName = fontName.ToLowerInvariant();
}

switch (fontName)
Expand Down