BBC-Esq and GitHub
0970cebfea
Update _hocr.py
2025-03-08 07:37:37 -05:00
Odin Dahlström and James R. Barlow
c29f58a8b7
Process hOCR textangle attribute
2025-02-26 15:09:59 -08:00
Odin Dahlström
b7d63f3dc1
Process ocr_caption lines
2025-01-30 17:49:06 +01:00
James R. Barlow
d87db6cad0
Merge branch 'pr/pajowu/1446'
2025-01-01 17:50:33 -08:00
James R. Barlow
f71a5ffd61
hocr: comment typo
2024-12-23 01:46:00 -08:00
Kara Engelhardt
74253e5fc8
hocr: only add space if boxwidth is positive
2024-12-11 16:23:45 +01:00
James R. Barlow
0f82d7223e
Fix some typing issues
2024-10-27 12:31:16 -07:00
James R. Barlow
653c4ffb45
hocr: accept multiple spaces in bounding boxes
...
Fixes #1322
2024-05-31 16:22:27 -07:00
James R. Barlow
28be50136c
hocr: If a line box's coords are invalid, log and error and don't render
...
Addresses [Bug]: Crash on multiple .pdf files #1312
Not actually a fix, but at least it will get us better diagnostics. Appears old Tesseract 4.x generates bad line boxes at times.
2024-05-18 23:32:18 -07:00
James R. Barlow
6a746a1cbb
ruff linting/Python 3.10 cleanup
2024-02-14 12:41:51 -08:00
James R. Barlow
602f5632cb
hocr: fix unbound local
2024-01-07 01:33:36 -08:00
James R. Barlow
9498f01f59
hocr: Pass text direction for standalone words
2024-01-06 16:21:21 -08:00
James R. Barlow
b71d16dd96
Draw RTL text with reversed matrix instead of reversing characters
2023-12-24 01:34:03 -08:00
James R. Barlow
fd593eb5e9
Reversing character order for RTL helps output
2023-12-24 01:24:44 -08:00
James R. Barlow
18353e1e94
Also fix space rendering
2023-12-24 00:09:47 -08:00
James R. Barlow
9adcad84da
Overhaul debug rendering to support possible use of Helvetica for testing
2023-12-23 23:47:35 -08:00
James R. Barlow
f2714586d8
Fix upside down glyphless font
2023-12-23 23:44:37 -08:00
James R. Barlow
e6095a9949
Fix text rendering issue with new hOCR text renderer
2023-12-20 12:26:06 -08:00
James R. Barlow
43618e6b3f
Move canvas API to pikepdf and import it
2023-12-02 19:42:35 -08:00
James R. Barlow
e97f89de3b
Refactor font so glyphless isn't as hard coded
2023-12-02 08:55:01 -08:00
James R. Barlow
d217856166
Make hocrdebug work, and try to handle CJK spacing better
2023-11-21 00:33:02 -08:00
James R. Barlow
e2be457e9b
Avoid divzero
2023-11-20 23:08:00 -08:00
James R. Barlow
4850f486d2
Make text API more like an accessor
2023-11-20 22:59:50 -08:00
James R. Barlow
729c7febd9
Fix placement of spaces in debug mode
2023-11-20 22:44:12 -08:00
James R. Barlow
6c6aca2f1e
Refactor save_state
2023-11-20 22:29:21 -08:00
James R. Barlow
c69823f496
Refactor; accumulate content stream as bytes rather than discrete pikepdf objects
2023-11-20 22:11:59 -08:00
James R. Barlow
73f8f6aac8
Add RTL output - seems to work, but debug does not
2023-11-20 20:28:07 -08:00
James R. Barlow
d944254e45
hocr: typing cont'd
2023-11-20 17:07:52 -08:00
James R. Barlow
03669183d7
Rationalize canvas interface
2023-11-20 15:54:13 -08:00
James R. Barlow
74e101a2fa
Improve canvas interface with chaining
2023-11-20 14:42:48 -08:00
James R. Barlow
532cf18ad3
Restructure hocrtransform submodule to avoid having everything in __init__
2023-11-20 00:57:58 -08:00