Skip to content

Padding between Lines #7

@max333

Description

@max333

For the time being, making an image with multiple text lines is done with FontGlyph.makeMultiLineImage(List lines, Font font, int pixelsBetweenLines). It is not clear what value to use for pixelsBetweenLines.

What do applications usually do? Two values are of interest: LineMetrics.getHeight() and FontMetrics.getHeight(). The first one is just the ascent + descent, and the second ones seems to be ascent + 2 * descent, which would imply that an extra pixel row of height descent is used for padding between lines. Also note that when calling graphics2D.drawText(someText), there are some extra empty pixels rows on top, which seem to be of height descent too.

SearchTreeOCR.detectCharactersOnMultipleLines() is used for interpreting an image with multiple lines, where the public static value SearchTreeOCR.defaultPixelsBetweenLines is used to specify the padding between lines. It is currently set to 0. It can easily be changed since it is a public member.

So the handling of the inter-line padding for both writing and reading a multi-line images need to be fixed.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions