Commit graph

60 commits

Author SHA1 Message Date
Simon Hausmann
87431eea95 Make it possible to build without unicode-script 2022-03-10 10:51:32 +01:00
Simon Hausmann
38e26f25ef Basic elision support
TODO:
 * alignment for rtl/ltr
 * elide only last line for multi-line
2022-03-10 10:51:32 +01:00
Simon Hausmann
8d4c645346 Change the paragraph text layout callback to take glyphs
This is needed in the future to avoid duplication shaping and
implementation of features like elision or letter spacing in  a shared code.
2022-03-10 10:51:32 +01:00
Simon Hausmann
ff2b38eefb Minor clean up in paragraph layout
Encapsulate the entire loop body in the process_line helper
2022-03-10 10:51:32 +01:00
Simon Hausmann
a947ec1441 Simplify glyph interface
The textlayout module does not need to impose the exact glyph struct layout.

This paves the way for glyph based rendering.
2022-03-10 10:51:32 +01:00
Simon Hausmann
42a0f605ad Add an paragraph layout helper function to the corelib textlayout
The objective is to use this in the MCU backend and replace layout_text_lines() in the GL backend in the future.
2022-03-10 10:51:32 +01:00
Simon Hausmann
6748563dc6 Fix non-wrapped text with multiple break opportunities 2022-03-10 10:51:32 +01:00
Simon Hausmann
62d633a572 Add convenience function for measuring paragraph sizes 2022-03-10 10:51:32 +01:00
Simon Hausmann
72186cd891 Make the available width an option 2022-03-10 10:51:32 +01:00
Simon Hausmann
1a73460a6a Add basic text layout module for use with the MCU
This is based on the unicode line breaking algorithm (uses crate for
that), which also supports forced line breaks. The shaping is generic,
so on the MCU side we can do without at first.
2022-03-10 10:51:32 +01:00