Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Editor uses a proportional font with the default Linux font configuration

未关闭
#710 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
linux, shell, vscode
领域
desktop, tooling

调研方向

通过在 Flatpak 应用中打开 /app/share/vscode/flatpak-warning.txt,并在 sandbox 内运行提供的 fc-match 命令,复现全新安装时的行为。检查 fix-flatpak-vscode-fonts.sh 和打包的默认字体配置,然后验证编辑器在没有用户设置的情况下使用等宽字体,同时保留所报告的环境。

由索引模型根据 Issue 内容生成。

描述

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:

'Droid Sans Mono', monospace

Running these commands inside the Flatpak sandbox produced:

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:

{
    "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

主要语言
Shell
星标
216
派生
82
平均合并
1 天 7 小时
30 天内合并 PR
1

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

flathub/com.visualstudio.code 的其他 Issue

查看 flathub/com.visualstudio.code 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。