johnfactotum / foliate

Read e-books in style
https://johnfactotum.github.io/foliate/
GNU General Public License v3.0
5.93k stars 273 forks source link

Crash when pick custom fonts. #1167

Closed sommio closed 8 months ago

sommio commented 8 months ago

Describe the bug Crash when pick custom fonts (my system has tens of thousands of fonts installed).

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Font & Layout Settings'
  2. Click on 'Sans'
  3. Scroll down to 'Pick a Font'
  4. See error:
    Gtk:ERROR:../gtk/gtk/gtkfontchooserwidget.c:2732:gtk_font_chooser_widget_merge_font_desc: assertion failed: (font_desc != NULL)
    Bail out! Gtk:ERROR:../gtk/gtk/gtkfontchooserwidget.c:2732:gtk_font_chooser_widget_merge_font_desc: assertion failed: (font_desc != NULL)
    zsh: IOT instruction (core dumped)  foliate

Expected behavior 'Pick a fonts' work properly. It works fine with the GTK3 version.

Screenshots GTK3 Version

xjgA00nqP88U1PTE

Version:

Additional context I have tens of thousands of fonts installed on my system, but in GTK3 version 'pick a font' works fine. If you can't fix it, is it possible to provide options that don't pass 'pick a font'? For example using json configuration.

johnfactotum commented 8 months ago

The font chooser is a widget provided by GTK. So you should file a GTK bug.

If you can't fix it, is it possible to provide options that don't pass 'pick a font'? For example using json configuration.

Settings are stored with GSettings at, e.g., com.github.johnfactotum.Foliate.viewer.font.serif for the serif font, which you can change with the gsettings command or dconf editor (or edit the config file when using the text file backend).