Fix line breaking and add convenience ops #17

Merged
dhdaines merged 3 commits from fix_line_breaking into main 2026-01-08 23:44:44 -05:00
dhdaines commented 2026-01-08 18:46:34 -05:00 (Migrated from github.com)

Line breaking was actually... not really working right.

This adds also a bunch of convenience functions to paves.text to allow you to concisely do fun things like:

# mark up words based on the font (sure, this works for glyphs too)
pi.mark(px.words(page), labelfunc=px.font)

# group text into lines
for line, words in itertools.groupby(px.words(page), px.line):
    for word in words:
        ...
Line breaking was actually... not really working right. This adds also a bunch of convenience functions to `paves.text` to allow you to concisely do fun things like: ```python # mark up words based on the font (sure, this works for glyphs too) pi.mark(px.words(page), labelfunc=px.font) # group text into lines for line, words in itertools.groupby(px.words(page), px.line): for word in words: ... ```
Sign in to join this conversation.
No description provided.