Skip to content

Font height specification in pixels #2010

Closed
@ewhac

Description

@ewhac

Describe the bug
The docs and code suggest that specifying a font's size using the h parameter (e.g. :se gfn=ProFont:h9) describes the font's height in pixels. This does not appear to be the case. Depending on the display's DPI, a given font size will yield significantly different results. This happens regardless of the system display resolution as reported by xdpyinfo.

My guess is the problem lies in the Skia library, since Neovide doesn't appear to determine display DPI, nor make adjustments to the user's requested font sizes.

To Reproduce
Steps to reproduce the behavior:

  1. Find two Linux machines with significantly different DPI displays.
  2. Launch Neovide on each.
  3. Set gfn on each machine/display to the same font face and size.
  4. The rendered glyphs will be of different pixel dimensions, depending on actual display DPI.

Expected behavior
The rendered fonts should be of the same pixel dimensions, regardless of display DPI; or at least respect the user-specificed DPI in the system preferences. (If you want font size described in a resolution-independent manner, then you should have a different specifier (p?) to describe the font's size in points.)

Screenshots

All windows used the font Iosevka Extended.

h9 on a 109 DPI display:

neovide-iosevka-9-109dpi

h6 on a 145 DPI display:

neovide-iosevka-6-145dpi

h5 on a 210 DPI display:

neovide-iosevka-5-210dpi

For reference, here's the Kitty terminal emulator, with font_size 5 on a 210 DPI display. It looks exactly as tiny on the other DPI displays as well:

kitty-iosevka-05

Desktop (please complete the following information):

  • OS: Debian Sid (unstable)
  • Neovide 11.0 and 11.1
  • Neovim 0.9.1

Please run neovide --log and paste the contents of the .log file created in the current directory here:
neovide_rCURRENT.log

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions