How to to extract fonts in FineReader Engine 12

Question

How to check the font of the extracted text in FineReader Engine 12?

Answer

Here is a C++ code snippet which can be used to extract fonts:

for(int k = 0; k < paragraphs.getCount(); k++) {
IParagraph paragraph = paragraphs.getElement(k);
IFontStyle baseFont = paragraph.getParagraphStyle().getBaseFont();
System.out.println("Font Name: " + baseFont.getFontName());
System.out.println("Font Type: " + baseFont.getFontType().name());
System.out.println("Font Size: " + baseFont.getFontSize());
System.out.println("Text: " + paragraph.getText());
}

In order to detect fonts properly, make sure that the related fonts are installed in your system.
If the fonts are already installed/registered in your system, but the fonts are still can't be detected correctly, then you will need to specify the path to the fonts folder using the CustomFontSet::setFolder("path to your fonts folder") property.

Have more questions? Submit a request

Comments

2 comments

  • Avatar

    Tim Mora

    Is the provided code snippet for FlexiCapture or FineReader?

    0
  • Avatar

    Sergey Pilipchuk

    Hi Tim,

    It is for FineReader Engine 12, I have updated the article to better illustrate that.

    0

Please sign in to leave a comment.