You only get the error on closing because that's the time that the font is
subset and the missing tables are used. There's no ready made way to detect
it up front but it's straight forward to copy the code that lists the TT
tables and check if loca or glyf is there.

Paulo

On Sun, Sep 14, 2014 at 10:02 AM, Michael Totschnig <mich...@totschnig.org>
wrote:

> Hello Paulo,
>
> many thanks for the answer. My problem is that I am iterating over the
> fonts that are available on the device, and I do not know which of them
> might have the same problems. The TTF file is accepted by the createFont
> command, and the error is only triggered when the document is closed. Do
> you think there might be a simple way of checking the font at the moment
> I am creating the font?
>
> Best regards,
>
> Michael
>
> Am 14.09.2014 um 01:12 schrieb Paulo Soares:
> > That's a problem with the font, it contains color bitmaps and won't even
> > open in windows.
> >
> > Paulo
> >
> > On Sat, Sep 13, 2014 at 10:17 PM, Michael Totschnig
> > <mich...@totschnig.org <mailto:mich...@totschnig.org>> wrote:
> >
> >     Hello,
> >
> >     For generating PDFs from text input by user on Android I am using the
> >     systems TTF files found in /system/fonts . This works fine for
> >     generating Chinese or Arab documents, but is raising an error, if the
> >     user uses emojs available in a font called NotoColorEmoji.ttf .
> >
> >     The stacktrace is:
> >
> >     09-13 23:15:35.244: E/DEBUG(25717): ExceptionConverter:
> >     com.itextpdf.text.DocumentException: Table 'loca' does not exist in
> >     /system/fonts/NotoColorEmoji.ttf
> >     09-13 23:15:35.244: E/DEBUG(25717):     at
> >
>  
> com.itextpdf.text.pdf.TrueTypeFontSubSet.readLoca(TrueTypeFontSubSet.java:260)
> >     09-13 23:15:35.244: E/DEBUG(25717):     at
> >
>  com.itextpdf.text.pdf.TrueTypeFontSubSet.process(TrueTypeFontSubSet.java:135)
> >     09-13 23:15:35.244: E/DEBUG(25717):     at
> >     com.itextpdf.text.pdf.TrueTypeFont.getSubSet(TrueTypeFont.java:1160)
> >     09-13 23:15:35.244: E/DEBUG(25717):     at
> >
>  com.itextpdf.text.pdf.TtfUnicodeWriter.writeFont(TtfUnicodeWriter.java:83)
> >     09-13 23:15:35.244: E/DEBUG(25717):     at
> >
>  
> com.itextpdf.text.pdf.TrueTypeFontUnicode.writeFont(TrueTypeFontUnicode.java:348)
> >     09-13 23:15:35.244: E/DEBUG(25717):     at
> >     com.itextpdf.text.pdf.FontDetails.writeFont(FontDetails.java:383)
> >     09-13 23:15:35.244: E/DEBUG(25717):     at
> >
>  com.itextpdf.text.pdf.PdfWriter.addSharedObjectsToBody(PdfWriter.java:1373)
> >     09-13 23:15:35.244: E/DEBUG(25717):     at
> >     com.itextpdf.text.pdf.PdfWriter.close(PdfWriter.java:1264)
> >     09-13 23:15:35.244: E/DEBUG(25717):     at
> >     com.itextpdf.text.pdf.PdfDocument.close(PdfDocument.java:882)
> >     09-13 23:15:35.244: E/DEBUG(25717):     at
> >     com.itextpdf.text.Document.close(Document.java:416)
> >
> >     Is this a bug in itext or a problem with the font ?
> >
> >     Best regards,
> >
> >     Michael
> >
> >
>  
> ------------------------------------------------------------------------------
> >     Want excitement?
> >     Manually upgrade your production database.
> >     When you want reliability, choose Perforce
> >     Perforce version control. Predictably reliable.
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
> >     _______________________________________________
> >     iText-questions mailing list
> >     iText-questions@lists.sourceforge.net
> >     <mailto:iText-questions@lists.sourceforge.net>
> >     https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
> >     iText(R) is a registered trademark of 1T3XT BVBA.
> >     Many questions posted to this list can (and will) be answered with a
> >     reference to the iText book: http://www.itextpdf.com/book/
> >     Please check the keywords list before you ask for examples:
> >     http://itextpdf.com/themes/keywords.php
> >
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Want excitement?
> > Manually upgrade your production database.
> > When you want reliability, choose Perforce
> > Perforce version control. Predictably reliable.
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
> >
> >
> >
> > _______________________________________________
> > iText-questions mailing list
> > iText-questions@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
> > iText(R) is a registered trademark of 1T3XT BVBA.
> > Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> > Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
> >
>
>
>
> ------------------------------------------------------------------------------
> Want excitement?
> Manually upgrade your production database.
> When you want reliability, choose Perforce
> Perforce version control. Predictably reliable.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
>
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to