Font settings widget saves nonexistent font families without validation - apps silently fall back to arbitrary fonts

オープン
#222 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
desktop

調査の方向性

Start with xapp/SettingsWidgets.py and inspect how FontButton binds Gtk.FontButton.font-name to GSettings; the issue reports that the chooser accepts arbitrary typed family names. Check what family validation is available through GTK, fontconfig, or Pango, and how the widget is reused by settings modules. Done means nonexistent families are refused or clearly flagged instead of being silently saved; the issue gives no test file to run.

索引モデルが issue の本文から書いたものです。

説明

Environment

  • Cinnamon 6.6.7 on Gentoo (upstream settings UI: cinnamon-settings -> Font Selection module)
  • python3-xapp 3.0.2 / xapp 3.2.2 (Python widget xapp/SettingsWidgets.py)
  • GTK 3.24.52

Steps to reproduce

  1. Open System Settings -> Font Selection.
  2. On any row (e.g. "Default font"), open the font chooser, type into the Family field a family that is not installed - for example DejaVu Sans Semi-Condensed (DejaVu Sans only ships a "Condensed" variant, not "Semi-Condensed") - and confirm.
  3. The typed string is persisted verbatim into the gsettings key:
    • gsettings get org.cinnamon.desktop.interface font-name -> 'DejaVu Sans Semi-Condensed 11'
    • the same happens for document-font-name, org.nemo.desktop font and titlebar-font.

Observed

  • The stored family cannot be resolved by fontconfig: fc-match "DejaVu Sans Semi-Condensed" returns LiberationSans-Regular.ttf.
  • GTK applications then silently render with a different, unrelated font. Because every app/toolkit resolves the fallback differently, the UI becomes inconsistent - some parts use the intended font, others a fallback, with no error or warning shown anywhere.

Expected

  • The font widget should validate the selected family against fontconfig (e.g. against the GtkFontChooser family list, or fc-list / Pango) and refuse or flag families that cannot be resolved instead of saving them.

Root cause

  • xapp/SettingsWidgets.py -> FontButton binds Gtk.FontButton.font-name directly to the gsettings key (Gio.SettingsBindFlags.DEFAULT) with no validation.
  • GtkFontChooser's family entry also accepts arbitrary typed family names, so any typo or non-existent variant (e.g. a width such as Semi-Condensed that the family does not ship) reaches the settings keys.

Notes

  • The invalid value is spread to all GTK apps at once: csd-xsettings reads org.gnome.desktop.interface font-name and publishes it as the XSettings Gtk/FontName key.
  • The widget is reused by many Mint settings modules, so this silent path is not specific to one app.
  • A repair/warning on startup when a stored font family cannot be resolved would help users who already have such values in dconf.
主要言語
C
スター
173
フォーク
52
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

linuxmint/xapp のほかの issue

linuxmint/xapp の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。