Package-level declarations
Types
Text search over PDF pages, as a thin delegate to the shared core walker on io.github.yuroyami.kitepdf.core.KiteStructuredText (the same engine EPUB search uses). A hit is a KiteSearchHit: display-space quads (one per line touched) plus the matched text and page index.
Structured text: pageGlyphs → spans → lines → blocks (ISO 32000-1 §14.8 is the spec basis; MuPDF's fz_stext_page is the architectural reference).
One paragraph-ish chunk: a vertical run of lines with no big gap. Block boundaries fall where vertical spacing exceeds GAP_TO_NEW_BLOCK × the median line height. It is a heuristic, not authoritative, but matches what readers consider "paragraph breaks" in the absence of structure tagging.
One line of text: spans sharing a baseline, within a small Y slack (StructuredTextTuning.Y_CLUSTER_TOL × font size, floored at StructuredTextTuning.Y_CLUSTER_TOL_MIN_PT). Spans are stored left-to-right. A column of vertical text (ISO 32000-1, 9.7.4.3) is a line too: its spans run down the page and are stored top to bottom.
One renderer-drawText worth of glyphs that share font, size, and baseline. Position is the device-space origin (where the baseline starts).
Linear text extraction (ISO 32000-1 §9.4).
Functions
Find needle across the whole document, page by page. The result is a lazy Sequence, so a UI can surface incremental hits while later pages are still being extracted. See PdfPage.search for matching rules.
Find needle on this page. Matches may cross line boundaries inside a block (a break reads as one space, or joins directly after a hyphenated line with the hyphen dropped); they never cross block boundaries.