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

Native unicode U+00A0 (nbsp) support #1918

Merged
merged 5 commits into from
Dec 16, 2023

Conversation

Omikhleia
Copy link
Member

@Omikhleia Omikhleia commented Dec 2, 2023

This was mentioned in discussion #1716 (reply in thread), and in PR #1860 (comment)

It tangentially relates to #1889 -- Via the SILE's unicode node maker, it adds native support to U+00A0 (non-breaking space) in input files being handled as a stretchable and shrinkable space for justification purpose, as per Unicode UAX 14.

Besides the above-mentioned topics, while experimenting with the French SBL bible in USX in Freely-Given-org/BibleTypesetter#3 (comment), I found it was using non-breaking spaces, defeating the special French punctuation rules from SILE. I also had the issue before, with text copied from LibreOffice (which inserts non-breaking spaces), though of course I just had to remove them from my input file (... that is, when noticing them!). -- So the French case is handled too in this PR.

One test was failing (sura-2) as it contains non-breaking spaces, so I added a setting to disable the feature (languages.fixedNbsp) as I don't know the expectations here and cannot read the script -- French still gets correct punctuation spaces in that case, because it's dumb otherwise anyway. N.B. I haven't documented it in the manual (not sure it should even).

Before:
image

After:
image

@Omikhleia Omikhleia requested review from a team, alerque and simoncozens as code owners December 2, 2023 15:14
@Omikhleia Omikhleia added the enhancement Software improvement or feature request label Dec 5, 2023
languages/unicode.lua Outdated Show resolved Hide resolved
@alerque alerque linked an issue Dec 16, 2023 that may be closed by this pull request
@alerque
Copy link
Member

alerque commented Dec 16, 2023

I checked the Sura test and believe the flexible spaces are a better display and more expected output. The point of the non-breaking spaces is to make sure the marker numbers don't end up at the end of a line disconnected from the start of the related text. Maxing the spaces flexible balances those spaces with the rest of the line.

@alerque alerque merged commit 8686730 into sile-typesetter:master Dec 16, 2023
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Software improvement or feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce non-breaking but stretchable interword space
2 participants