No description
Find a file
2022-10-24 11:47:49 -06:00
examples Fix UDHR test 2022-10-24 08:53:56 -06:00
sample Appearance for iced text box 2022-10-18 14:35:16 -06:00
src Store font ID with CacheKey 2022-10-24 11:47:49 -06:00
.gitignore Appearance for iced text box 2022-10-18 14:35:16 -06:00
Cargo.toml Switch unicode-linebreak to xi-unicode for ~25% faster builds 2022-10-23 12:57:35 -06:00
editor-libcosmic.sh Text library moved from libcosmic 2022-10-18 12:07:22 -06:00
editor-orbclient.sh Text library moved from libcosmic 2022-10-18 12:07:22 -06:00
editor-test.sh Improvements for tests 2022-10-19 15:31:09 -06:00
LICENSE Text library moved from libcosmic 2022-10-18 12:07:22 -06:00
README.md Update README.md 2022-10-21 19:33:40 -06:00

COSMIC Text

Pure Rust multi-line text shaping and rendering for COSMIC.

COSMIC Text provides advanced text shaping, layout, and rendering wrapped up into a simple abstraction. Shaping is provided by rustybuzz, and supports a wide variety of advanced shaping operations. Rendering is provided by swash, which supports ligatures and color emoji. Layout is implemented custom, in safe Rust, and supports bidirectional text. Font fallback is also a custom implementation, reusing some of the static fallback lists in browsers such as Chromium and Firefox. Linux, macOS, and Windows are supported with the full feature set. Other platforms may need to implement font fallback capabilities.

The following features must be supported before this is "ready":

  • Font loading
    • Preset fonts
    • System fonts
  • Text styles (bold, italic, etc.)
  • Font shaping (using rustybuzz)
    • Cache results
    • RTL
    • Bidirectional rendering
  • Font fallback
    • Choose font based on locale to work around "unification"
    • Per-line granularity
    • Per-character granularity
  • Font layout
    • Click detection
    • Simple wrapping
    • Wrapping with indentation
    • No wrapping
    • Ellipsize
  • Font rendering (using swash)
    • Cache results
    • Font hinting
    • Ligatures
    • Color emoji
  • Text editing
    • Performance improvements
    • Text selection
    • Can automatically recreate https://unicode.org/udhr/ without errors (see below)
    • Bidirectional selection
    • Copy/paste

The UDHR (UN Declaration of Human Rights) test involves taking the entire set of UDHR translations (almost 500 languages), concatenating them as one file (which ends up being 8 megabytes!), then via the editor-test example, automatically simulating the entry of that file into cosmic-text per-character, with the use of backspace and delete tested per character and per line. Then, the final contents of the buffer is compared to the original file. All of the 106746 lines are correct.