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

Added support for RTL languages, correct list indentation #202

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

werksjan
Copy link

RTL Languages

I added

@property(nonatomic) NSTextAlignment textAlignment;

to the BPDisplaySettings, so the system's default (Natural) may be overridden in case the content is known to contain a right-to-left language on a left-to-right device.

The setting get's interpreted when styling the paragraphs in the BPAttributedStringConverter and defaults to NSTextAlignmentNatural, the system default.

Correct list indentation

When list items run over more than one line, the broken lines should be indented so they start where the first line starts; after the bullet and the space.

For that to work, instead of inserting tab characters before the list item to match the level, I insert the zero-width character for all levels and apply the correct indentations for the level to the paragraph style.

As the bullet uses a monospace font and (afais) cannot be configured, this should work for any settings.

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