Skip to content

fix(generator): skip zero-width chars in countVisibleChars - #105

Merged
kdroidFilter merged 1 commit into
masterfrom
fix/char-count-zero-width
Oct 8, 2026
Merged

kdroidFilter merged 1 commit into
masterfrom
fix/char-count-zero-width

Conversation

@kdroidFilter

Copy link
Copy Markdown
Owner

Nikud, teamim, other combining marks (NON_SPACING_MARK, ENCLOSING_MARK) and bidi controls (FORMAT) take no horizontal space but were counted by countVisibleChars, nearly doubling charCount on vocalized text.

Zayit's content-aware scrollbar models each line's height as ceil(charCount / capacity), with a capacity measured on unvocalized Hebrew, so vocalized books were overestimated (wrong thumb size, and the thumb stopped short of the end on short books).

Visible Hebrew punctuation (maqaf, sof pasuq, paseq) is still counted. Takes effect on the next DB generation; no schema change, ID hash inputs untouched.

Tests added for nikud/teamim, visible punctuation and bidi controls.

Nikud, teamim, other combining marks and bidi controls take no horizontal
space but were counted, nearly doubling charCount on vocalized text. The
app's content-aware scrollbar models line heights from charCount, so it
overestimated vocalized books.

Signed-off-by: Elie Gambache <elyahou.hadass@gmail.com>
@kdroidFilter
kdroidFilter merged commit 2c3f1c5 into master Oct 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant