onagre-launcher / onagre

A general purpose application launcher for X and wayland inspired by rofi/wofi and alfred
MIT License
511 stars 27 forks source link

Onagre fails to display if --font-family is set in theme.scss #55

Closed lilacpixel closed 4 months ago

lilacpixel commented 1 year ago

Describe the bug When attempting to trigger Onagre with any theme that contains a --font-family value, the Onagre window will fail to display. Running onagre in the terminal outputs a number of fontconfig warnings:

Fontconfig warning: line 5: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/10-sub-pixel-rgb-for-kde.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/10-yes-antialias.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/25-unhint-nonlatin.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/45-generic.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/48-spacing.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/49-sansserif.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/51-local.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/60-generic.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/60-latin.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/65-nonlatin.conf", line 4: unknown element "description"

Removing the line that contains --font-family from theme.scss resolves the issue.

To Reproduce

  1. Add any valid --font-family value to the theme SCSS file.
  2. Run onagre in the terminal.

Expected behavior Onagre should display normally when a valid --font-family value is present.

OS/WM:

oknozor commented 1 year ago

Hey @lunalicca which font are you using ? Can you copy you theme.scss here and the output of fc-list | grep | ${your font} ? So I can reproduce.

lilacpixel commented 1 year ago

I tested both of the following themes from the repo's theme examples, with no changes other than trying multiple fonts:

https://github.com/oknozor/onagre/blob/main/docs/theme_examples/simmple.scss https://github.com/oknozor/onagre/blob/main/docs/theme_examples/not-adwaita.scss

All fonts exhibit the same behavior, including fallback families like sans-serif. Here's the output for fc-list for one of the fonts that I tested, Cabin:

/home/cari/.local/share/fonts/Cabin-Italic.otf: Cabin:style=Italic
/home/cari/.local/share/fonts/Cabin-SemiBoldItalic.otf: Cabin:style=SemiBold Italic
/home/cari/.local/share/fonts/Cabin-MediumItalic.otf: Cabin:style=Medium Italic
/home/cari/.local/share/fonts/Cabin-Bold.otf: Cabin:style=Bold
/home/cari/.local/share/fonts/Cabin-Regular.otf: Cabin:style=Regular
/home/cari/.local/share/fonts/Cabin-Medium.otf: Cabin:style=Medium
/home/cari/.local/share/fonts/Cabin-BoldItalic.otf: Cabin:style=Bold Italic
/home/cari/.local/share/fonts/Cabin-SemiBold.otf: Cabin:style=SemiBold

I entered the --font-family declaration for this as --font-family: "Cabin";.

Thanks for taking a look! :smile_cat:

oknozor commented 1 year ago

Strange I am able to use "Cabin" or any other font without trouble. What version of fontconfig are you using ?

lilacpixel commented 1 year ago

How weird… is there anything else that might be worth checking? Here's my fontconfig info:

> fc-list -V
fontconfig version 2.14.1
oknozor commented 1 year ago

Honestly I don't know, maybe bumping the fontconfig crate would solve the issue

oknozor commented 4 months ago

This is now fixed Onagre does not depend on fontconfig anymore since iced now provide an API to set application fonts. If the user defined font does not exist, it will just fallback to the default.