Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Termux: unable to determine default font. Failed to locate font for family DejaVu Sans #7145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Quackdoc opened this issue Dec 18, 2024 · 4 comments
Labels
bug Something isn't working need triaging Issue that the owner of the area still need to triage

Comments

@Quackdoc
Copy link

Quackdoc commented Dec 18, 2024

Bug Description

Cannot launch slint program (krokiet) on termux.

I am trying to run a program called krokiet on termux but it seems to fail due to font issues (Worth noting wayland is needed because when cross compiling for some reason it can't find the display server)

➜  ~ XDG_RUNTIME_DIR=$PREFIX/tmp WAYLAND_DISPLAY=wayland-2 XDG_DATA_DIRS=$PREFIX/glibc/share RUST_BACKTRACE=1 grun ./krokiet
03:26:35.195 [INFO] czkawka_core::common: App version: 8.0.0, release mode, rust 1.83.0 (2024-11-26), os Linux Unknown [aarch64 64-bit], 6 cpu/threads, features(0): []
thread 'main' panicked at /home/quack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/i-slint-common-1.8.0/sharedfontdb.rs:165:13:
Unable to determine default font. Failed to locate font for family DejaVu Sans
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: i_slint_common::sharedfontdb::init_fontdb
   3: std::sys::thread_local::native::lazy::Storage<T,D>::initialize
   4: i_slint_core::graphics::image::svg::load_from_data
   5: i_slint_core::graphics::image::cache::ImageCache::load_image_from_embedded_data
   6: i_slint_core::graphics::image::load_image_from_embedded_data
   7: krokiet::slint_generatedMainWindow::InnerMainWindow::init
   8: krokiet::slint_generatedMainWindow::MainWindow::new
   9: krokiet::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Reproducible Code (if applicable)

No response

Environment Details

  • Slint Version: 1.8
  • Platform/OS: Android Termux
  • Programming Language: Rust
  • Backend/Renderer: winit software

Product Impact

How to test:

  1. Build krokiet with cargo build --release --target aarch64-unknown-linux-gnu --no-default-features --features "winit_software"

  2. copy to termux (setup with termux-x11)

  3. launch sway termux-x11 :1 -xstartup "XDG_RUNTIME_DIR=$PREFIX/tmp sway"

  4. try to launch the program XDG_RUNTIME_DIR=$PREFIX/tmp WAYLAND_DISPLAY=wayland-2 XDG_DATA_DIRS=$PREFIX/glibc/share RUST_BACKTRACE=1 grun ./krokiet

this bug prevents use of slint on termux.

@Quackdoc Quackdoc added bug Something isn't working need triaging Issue that the owner of the area still need to triage labels Dec 18, 2024
@tronical
Copy link
Member

This error message indicates that while fontconfig says the font for "Sans Serif" is "DejaVu Sans", that font can't be found in any directories that are scanned for fonts.

Where in your target environment for the krokiet process (sysroot?) are your fonts located?

@ogoffart
Copy link
Member

Ideally we shouldn't panic in that case, but somehow return an error from run() or something like that.

@tronical
Copy link
Member

Yes, that's #2556.

@tronical
Copy link
Member

I'll convert this into a discussion, as this is most likely a setup issue. Happy to continue triaging there.

@slint-ui slint-ui locked and limited conversation to collaborators Dec 18, 2024
@tronical tronical converted this issue into discussion #7149 Dec 18, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Something isn't working need triaging Issue that the owner of the area still need to triage
Projects
None yet
Development

No branches or pull requests

3 participants