add simple test case for subsetting issue #98

adds a single test which proves that the invalid truetype subsetting with roboto is related to our font subsetting code, since we can subset the same text correctly with windows calibri we must be reading roboto incorrectly.
This commit is contained in:
Eliot Jones
2020-01-03 14:35:47 +00:00
parent fe315be2ef
commit 90f8f97bfd

View File

@@ -145,6 +145,35 @@
}
}
[Fact]
public void CanWriteRobotoAccentedCharacters()
{
var builder = new PdfDocumentBuilder();
builder.DocumentInformation.Title = "Hello Roboto!";
var page = builder.AddPage(PageSize.A4);
var font = builder.AddTrueTypeFont(TrueTypeTestHelper.GetFileBytes("Roboto-Regular.ttf"));
page.AddText("eé", 12, new PdfPoint(30, 520), font);
Assert.NotEmpty(page.Operations);
var b = builder.Build();
WriteFile(nameof(CanWriteRobotoAccentedCharacters), b);
Assert.NotEmpty(b);
using (var document = PdfDocument.Open(b))
{
var page1 = document.GetPage(1);
Assert.Equal("eé", page1.Text);
}
}
[Fact]
public void WindowsOnlyCanWriteSinglePageAccentedCharactersSystemFont()
{