Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Actually an assert. This is caused by a paragraph separator in the
text. The Unicode Bidirectional Algorithm says we should operate
paragraph by paragraph, and includes code to split paragraphs
at paragraph markers, changing their type to boundary neutrals
as it goes.
The use of this code was left "as an exercise for the reader" in
the example code, so we simply hook it up here.
|
|
|
|
|
|
This silences the many warnings we get when building for x64
in windows.
This does not address any of the warnings we get in thirdparty
libraries - in particular harfbuzz. These look (at a quick
glance) harmless though.
|
|
|
|
And use the same enum for both the internal bidi code and the layout code.
|
|
We move to using bidirectional "levels" throughout. This should
give us better behaviour vis-a-vis nested l2r/l2r text. This
also allows us to carry xps levels throughout with no loss of
information.
This also avoids the need to special case numbers.
We accordingly carry more information into fz_text.
As well as wmode, also hold additional details about the text spans.
We now include the directionality of the bidi level text (either as
derived from bidi code, or from the original document (e.g. xps)),
the directionality of text (as specified in the original document
(e.g. html)), and the language of the text (if specified in the
original document).
|
|
fz_fonts gain a 'shaper' field that will be filled in as
required. Use a void * rather than an hb_font_t to avoid
polluting top level include space.
Harfbuff handles mirroring for us, so lose the 'mirror'
fields. This simplifies our wrappers around the 'standard'
bidi code in that we don't need to split fragments upon
mirroring.
We do need to split our fragments at script changes though
as harfbuzz only operates on a single font at a time.
Update the html flow structure so that each flow node contains
details of the the direction specified for it in the markup,
the language specified for it in the markup and the script
detected by the bidi code.
Get the bidi code to pass out the script for each fragment
as part of the callback and populate that field in the node.
Ensure that we pass in the markup direction to the bidi
splitting code as the 'base' direction.
When feeding the bidi code, rather than feeding it paragraphs
at a time, break those paragraphs if different parts of them
have different marked up directions.
|
|
Make the import follow mupdf style (better, if not perfect).
Use ucdn where possible to avoid duplicating tables.
Shrink the types, make them explicit (e.g. use fz_bidi_level rather
than int) and make tables const.
Use 32-bit integers for text.
|
|
After we parse html text from an ebook run it through the
unicode bidirectional algorithm to determine the directionality
of each fragment. This may require splitting of fragments.
Currently we don't do anything with this information.
|
|
|