forked from koreader/crengine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CJK: improved typography by tweaking punctuations
Add support in textlang for flagging CJK punctuations, and ensuring width adjustment (forced or allowed reduction) depending on a punctuation context (neighbout, start or end of line), and differently depending if the language is Japanese, Simplified Chinese or Traditional Chinese. This allows, for example, to make consecutive opening or closing punctuations halfwidth in SC, and some punctuations at end of line halfwidth, respecting the recommended typography rules for each language (clreq, jlreq). In lvtextfm, detect and flag punctuation chars as "flexible" CJK chars, and use the typography rules when breaking lines and making words. When line-breaking, when a CJK char would not fit, and a break would not be allowed (which would cause a hole the size of a glyph at end of line, that text justification would solve by spreading out the glyphs), try to steal some width from any previous "flexible" punctuation that stayed full width. Disable all this when kerning mode is "off", to allow getting the old behaviour. In lvfntman, when a CJK glyph got its width reduced, try to shift the drawing so this CJK glyph appears in this reduced width as it would naturally (left, right or centered).
- Loading branch information
Showing
7 changed files
with
841 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.