Commit graph

6 commits

Author SHA1 Message Date
Simon Hausmann
3edc34a866 fontique: Fix text rendering with wasm32-unknown-unknown and QNX
When targeting wasm32-unknown-unknown, there's on system font fallback
on fontique, because there isn't a way to discover and fetch fonts from.
With QNX there are ways of discovering fonts on the file system, but
neither we nor fontique do that yet.

So do what we did with fontdb: Include a trimmed version of DejaVu Sans
and install it as fallback for everything.
2025-09-29 11:07:55 +02:00
Ashley
13623bc152
feature/fontique: switch femtovg to parley (#9466)
Some checks are pending
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
* Parlay init

* Start on femtovg

* Cargo fmt

* Decimate fonts.rs

* Use fill_glyphs

* [autofix.ci] apply automated fixes

* Use positioned_glyphs instead

* Clean up a little

* Format

* [autofix.ci] apply automated fixes

* Few fixes

* [autofix.ci] apply automated fixes

* More small changes

* Clean up

* [autofix.ci] apply automated fixes

* Display text cursor

* Handle text_input_cursor_rect_for_byte_offset

* stoke glyphs

* Handle text selections

* Stroke selection as well

* Fix wierd cargo.toml padding

* Move selection and stroking to brush settings

* Removed commented out code

* [autofix.ci] apply automated fixes

* Cursor sizing

* [autofix.ci] apply automated fixes

* Mark unused variables

* _scale -> scale

* Handle a lot more layout options

* Use the parley cursor

* Removed unused PhysicalPoint

* Start combining stuff WIP

* Move things into i_slint_core::textlayout::sharedparley

* [autofix.ci] apply automated fixes

* Go back to splitting paragraphs correctly

* Handle font_metrics via ttf_parser

* Move (lack of) overflow handling to sharedparley

* [autofix.ci] apply automated fixes

* impl Deref for Layout

* Be more explit about the width passed to layout being physical

* Cargo fmt, rename fonts to font_cache

* Use a thread local for layout context

* Use parley selection

* fix femtovg wgpu

* Switch femtovg branch

* max_physical_width -> max_width

* Box contexts

* [autofix.ci] apply automated fixes

* Fallback to GenericFamily::SansSerif if no font is set

* Add paint.set_font_size

* Use max_physical_height

* Fix text_size to return correct logical sizes

* Use femtovg from crates.io

* Fix C++ build

The `sharedparley` module declares a public `Layout` struct, which
clashes with the `Layout` struct we use in the C++ API. The former
however is entirely internal to Rust, so we can instruct cbindgen to
ignore the module.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2025-09-26 02:48:48 +12:00
Ashley
a4278e6c3a feature/fontique: Remove fontdb, adapt glyph embedding code (#9434) 2025-09-24 16:54:09 +02:00
Ashley
a3a3844cef feature/fontique - switch femtovg over and use a default fontdb for usvg (#9426)
* Use default fontdb for usvg

* Start adapting femtovg

* Use DesignFontMetrics from sharedfontique

* Restore fallback fonts

* [autofix.ci] apply automated fixes

* Add allow(dead_code) tag

* [autofix.ci] apply automated fixes

* Tiny comment change

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-24 16:54:09 +02:00
Ashley
69258db126 feature/fontique - softwarerenderer - Replace usage of fontdb with fontique (#9405)
* feature/fontique - softwarerenderer - Replace usage of fontdb with
fontique

* Get rid of oncecell
2025-09-24 16:54:09 +02:00
Ashley
8e2df006cd Add fontique as a font database alongside fontdb (#9379)
* Add fontique as a font database alongside fontdb

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-24 16:54:09 +02:00