summaryrefslogtreecommitdiff
path: root/source/fitz/bidi.c
AgeCommit message (Collapse)Author
2017-04-27Include required system headers.Tor Andersson
2017-04-27Include "mupdf/ucdn.h" explicitly.Tor Andersson
2017-04-27Use namespace prefix for bidi defines.Tor Andersson
2016-11-16Bug 697301: Fix "crash" in epub.Robin Watts
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.
2016-10-19Rename internal headers to follow pattern *-imp.h.Sebastian Rasmussen
2016-06-17Fix off-by-one error in split_at_script.Tor Andersson
2016-06-17Use 'size_t' instead of int as appropriate.Robin Watts
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.
2016-06-14Fix typos in various parts of the code.Sebastian Rasmussen
2016-04-05Clean up bidi enum names.Tor Andersson
And use the same enum for both the internal bidi code and the layout code.
2016-03-11Rejig Bidirectional and Text code.Robin Watts
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).
2016-02-04Make HTML layout use harfbuzz for shaping.Robin Watts
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.
2016-01-20Tidy bidirectional source.Robin Watts
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.
2016-01-18Process HTML text for directionality.Robin Watts
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.
2016-01-18First import of bidi code.Robin Watts