Skip to content

Commit c8eaa64

Browse files
committed
Add SourceHanSerifKR test
DEVSIX-444
1 parent 9f66449 commit c8eaa64

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

kernel/src/test/java/com/itextpdf/kernel/pdf/PdfFontTest.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,31 @@ public void SourceHanSansHWTest() throws IOException, InterruptedException {
14581458
Assert.assertNull(new CompareTool().compareByContent(filename, cmpFilename, destinationFolder, "diff_"));
14591459
}
14601460

1461+
@Test
1462+
@Ignore("DEVSIX-444")
1463+
public void SourceHanSerifKRRegularTest() throws IOException, InterruptedException {
1464+
String filename = destinationFolder + "SourceHanSerifKRRegularTest.pdf";
1465+
String cmpFilename = sourceFolder + "cmp_SourceHanSerifKRRegularTest.pdf";
1466+
1467+
PdfDocument doc = new PdfDocument(new PdfWriter(filename));
1468+
PdfPage page = doc.addNewPage();
1469+
// Identity-H must be embedded
1470+
PdfFont font = PdfFontFactory.createFont(fontsFolder + "SourceHanSerifKR-Regular.otf", "Identity-H");
1471+
//font.setSubset(false);
1472+
PdfCanvas canvas = new PdfCanvas(page);
1473+
canvas.saveState()
1474+
.setFillColor(DeviceRgb.RED)
1475+
.beginText()
1476+
.moveText(36, 680)
1477+
.setFontAndSize(font, 12)
1478+
.showText("\ube48\uc9d1")
1479+
.endText()
1480+
.restoreState();
1481+
1482+
doc.close();
1483+
Assert.assertNull(new CompareTool().compareByContent(filename, cmpFilename, destinationFolder, "diff_"));
1484+
}
1485+
14611486
@Test
14621487
public void testCheckTTCSize() throws IOException {
14631488
TrueTypeCollection collection = new TrueTypeCollection(fontsFolder + "uming.ttc");

0 commit comments

Comments
 (0)