mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +08:00
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:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user