PdfTrueTypeFont extends PdfSimpleFont<TrueTypeFont> { @Override protected boolean isBuiltInFont() { return fontProgram instanceof Type1Font && ((Type1Font) fontProgram).isBuiltInFont(); } PdfTrueTypeFont(TrueTypeFont ttf, String encoding, boolean embedded);   PdfTrueTypeFont(PdfDictionary fontDictionary); @Override Glyph getGlyph(int unicode); @Override boolean containsGlyph(int unicode); @Override void flush();  }
@Test public void isBuiltInTest() { PdfFont font = PdfFontFactory.createFont(createTrueTypeFontDictionaryWithStandardHelveticaFont()); Assert.assertTrue(font instanceof PdfTrueTypeFont); Assert.assertTrue(((PdfTrueTypeFont) font).isBuiltInFont()); }
@Test public void isNotBuiltInTest() throws IOException { PdfFont font = PdfFontFactory.createFont(SOURCE_FOLDER + "NotoSans-Regular_v.1.8.2.ttf"); Assert.assertTrue(font instanceof PdfTrueTypeFont); Assert.assertFalse(((PdfTrueTypeFont) font).isBuiltInFont()); }