Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use baseline information for improved text rendering #4

Open
jbaiter opened this issue Jul 13, 2020 · 3 comments
Open

Use baseline information for improved text rendering #4

jbaiter opened this issue Jul 13, 2020 · 3 comments
Labels
enhancement New feature or request rendering

Comments

@jbaiter
Copy link
Member

jbaiter commented Jul 13, 2020

ALTO supports a @BASELINE attribute that can define a polyline on which the text rests. hOCR also includes support for this information. These values could be used for a more accurate estimation of the font size and position used for rendering the SVG.

Unfortunately I don't have access to any samples of OCR data with this information at the moment.

The test fixtures now include an hOCR file (generated by Tesseract 4) that has baseline information. Since both hOCR and ALTO define baselines as polynomials, an hOCR-based implementation should work with ALTO with (hopefully) minimal modifications.

@jbaiter jbaiter changed the title Use ALTO @BASELINE attribute for improved text rendering Use baseline information for improved text rendering Jul 13, 2020
@dstoekl
Copy link

dstoekl commented Feb 11, 2021

Here is a 1p example for a BSB
1p_export_m117_mekhilta_new_alto_202102111507.zip
Hebrew manuscript in Alto 4.1 with Polylines und Polygon-Regions
IIIF: https://api.digitale-sammlungen.de/iiif/presentation/v2/bsb00084914/manifest

@dbmdz dbmdz deleted a comment from dstoekl Feb 11, 2021
@jbaiter
Copy link
Member Author

jbaiter commented Feb 11, 2021

I created a bare-bones manifest with the ALTO here (CORS-enabled):
https://rawgit.com/jbaiter/d5fcd5f72349a6ad19ccb8f6e9e7d9db/raw/9ec3c5655d3749a4461103b49f06b674f6a7c440/bsb00084914.json

Looks like right-to-left reading order works out of the box, so one thing less to worry about!
image

One problem is that there's an issue with the rendering of ambivalent unicode bidi codepoints (the glyphs in brackets).

@dstoekl
Copy link

dstoekl commented Feb 11, 2021

fantastic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rendering
Projects
None yet
Development

No branches or pull requests

2 participants