flathub / flathub/com.visualstudio.code

Editor uses a proportional font with the default Linux font configuration

オープン
#710 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Shell
スター
217
フォーク
82
平均マージ
1日 7時間
マージ済み PR(30日)
1

説明

### Description

On a fresh installation of the Flatpak version of Visual Studio Code, plain text in the editor appears to use a proportional font instead of a monospace font.

There was no `settings.json` in the default user profile when the problem occurred.

### Environment

- Application ID: `com.visualstudio.code`
- VS Code version reported by Flatpak: `1.130.0`
- Flatpak branch: `stable`
- Installation: system-wide

### Steps to reproduce

1. Launch the Flatpak application with the default user settings.
2. Open the bundled `/app/share/vscode/flatpak-warning.txt`.
3. Observe the font used in the editor.

### Expected behavior

The editor should use a monospace font with the default settings.

### Actual behavior

The editor text appears proportional, including the bundled warning file.

### Font diagnostics

The installed VS Code build specifies the following default Linux editor font family:

```text
'Droid Sans Mono', monospace
```

Running these commands inside the Flatpak sandbox produced:

```bash
flatpak run --command=fc-match com.visualstudio.code "Droid Sans Mono"
# DejaVuSans.ttf: "DejaVu Sans" "Book"

flatpak run --command=fc-match com.visualstudio.code monospace
# DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

flatpak run --command=fc-match com.visualstudio.code "Source Code Pro" \
-f '%{family} spacing=%{spacing}\n'
# Source Code Pro spacing=100
```

Monospace fonts are therefore available inside the sandbox. However, the unavailable `Droid Sans Mono` family resolves to proportional `DejaVu Sans` when queried directly.

This suggests a font fallback or substitution issue, although the `fc-match` results alone do not establish exactly how Electron resolves the complete font-family list.

### Workaround

Explicitly selecting an available monospace font resolves the editor display issue:

```json
{
"editor.fontFamily": "'Source Code Pro', 'DejaVu Sans Mono', monospace",
"terminal.integrated.fontFamily": "'Source Code Pro', 'DejaVu Sans Mono', monospace"
}
```

The terminal setting was added as a precaution; the original issue was observed in the editor.

### Possible investigation

Could you check whether the packaged default font configuration reliably falls back to a monospace font when `Droid Sans Mono` is absent?

Using an available monospace default or providing an appropriate font substitution may help avoid this on fresh installations.

[fix-flatpak-vscode-fonts.sh](https://github.com/user-attachments/files/31865953/fix-flatpak-vscode-fonts.sh)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Reproduce the fresh-install behavior by opening /app/share/vscode/flatpak-warning.txt in the Flatpak application and run the supplied fc-match commands inside the sandbox. Review fix-flatpak-vscode-fonts.sh and the packaged default font configuration, then verify that the editor uses a monospace font without user settings while preserving the reported environment.

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

評価

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

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

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