some font sizes seem to break underlining #503

Closed
opened 6 months ago by mvdan · 4 comments
mvdan commented 6 months ago

I use neomutt with its sidebar. When navigating the sidebar, the current position is underlined. Here's how it looks with foot 1.7.2-119-gf930de6, with a minimal config and the current position being on the "protocol" mailbox:

foot --config=/dev/null --font=Inconsolata:size=12 neomutt

image

The underlining here works perfectly. However, if I use a larger font size (large enough so I can actually read comfortably), the underlining is invisible or missing. Doing the exact same thing as above, but with a larger size:

foot --config=/dev/null --font=Inconsolata:size=19 neomutt

image

Funnily enough, the underlining is visible again if I use size=20. So maybe it has something to do with rounding or some sort of DPI math.

If you struggle to reproduce, here's the entire log from the size=19 run:

$ foot --config=/dev/null --font=Inconsolata:size=19 neomutt
info: main.c:386: version: 1.7.2-119-gf930de6 (May 10 2021, branch 'master') +ime +pgo
info: main.c:393: arch: Linux x86_64/64-bit
info: main.c:400: locale: en_US.UTF-8
info: config.c:2468: loading configuration from /dev/null
info: wayland.c:1186: eDP-1: 2560x1440+0x480@60Hz 0x2336 13.92" scale=2 PPI=213x240 (physical) PPI=142x160 (logical), DPI=281.27
info: wayland.c:1186: DP-1: 2560x1440+1707x0@60Hz DELL U2520D 24.86" scale=1 PPI=121x120 (physical) PPI=121x120 (logical), DPI=118.17
info: wayland.c:1335: requesting SSD decorations
info: fcft.c:266: fcft: 2.4.0 +graphemes +runs
info: fcft.c:276: fontconfig: 2.13.93
info: fcft.c:282: freetype: 2.10.4
info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Regular.ttf: size=38.00pt/51px, dpi=96.00
info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Bold.ttf: size=38.00pt/51px, dpi=96.00
info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Bold.ttf: size=38.00pt/51px, dpi=96.00
info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Regular.ttf: size=38.00pt/51px, dpi=96.00
info: terminal.c:649: cell width=26, height=54
info: terminal.c:558: using 8 rendering threads
info: wayland.c:737: using SSD decorations
info: render.c:3119: resize: 1400x1000 pixels, 53x18 chars
info: render.c:3119: resize: 5120x2756 pixels, 196x50 chars
info: render.c:3119: resize: 2560x1378 pixels, 98x25 chars
info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Bold.ttf: size=19.00pt/31px, dpi=118.17
info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Bold.ttf: size=19.00pt/31px, dpi=118.17
info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Regular.ttf: size=19.00pt/31px, dpi=118.17
info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Regular.ttf: size=19.00pt/31px, dpi=118.17
info: terminal.c:649: cell width=16, height=33
info: render.c:3119: resize: 2560x1378 pixels, 159x41 chars
info: wayland.c:1475: cursor theme: (null), size: 24, scale: 1
info: main.c:560: goodbye
I use neomutt with its sidebar. When navigating the sidebar, the current position is underlined. Here's how it looks with foot 1.7.2-119-gf930de6, with a minimal config and the current position being on the "protocol" mailbox: foot --config=/dev/null --font=Inconsolata:size=12 neomutt ![image](/attachments/a562d834-57b2-4811-a472-6347fb09b56a) The underlining here works perfectly. However, if I use a larger font size (large enough so I can actually read comfortably), the underlining is invisible or missing. Doing the exact same thing as above, but with a larger size: foot --config=/dev/null --font=Inconsolata:size=19 neomutt ![image](/attachments/5a9ce16b-1bbd-457a-a2a6-6e470868e196) Funnily enough, the underlining is visible again if I use size=20. So maybe it has something to do with rounding or some sort of DPI math. If you struggle to reproduce, here's the entire log from the size=19 run: ``` $ foot --config=/dev/null --font=Inconsolata:size=19 neomutt info: main.c:386: version: 1.7.2-119-gf930de6 (May 10 2021, branch 'master') +ime +pgo info: main.c:393: arch: Linux x86_64/64-bit info: main.c:400: locale: en_US.UTF-8 info: config.c:2468: loading configuration from /dev/null info: wayland.c:1186: eDP-1: 2560x1440+0x480@60Hz 0x2336 13.92" scale=2 PPI=213x240 (physical) PPI=142x160 (logical), DPI=281.27 info: wayland.c:1186: DP-1: 2560x1440+1707x0@60Hz DELL U2520D 24.86" scale=1 PPI=121x120 (physical) PPI=121x120 (logical), DPI=118.17 info: wayland.c:1335: requesting SSD decorations info: fcft.c:266: fcft: 2.4.0 +graphemes +runs info: fcft.c:276: fontconfig: 2.13.93 info: fcft.c:282: freetype: 2.10.4 info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Regular.ttf: size=38.00pt/51px, dpi=96.00 info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Bold.ttf: size=38.00pt/51px, dpi=96.00 info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Bold.ttf: size=38.00pt/51px, dpi=96.00 info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Regular.ttf: size=38.00pt/51px, dpi=96.00 info: terminal.c:649: cell width=26, height=54 info: terminal.c:558: using 8 rendering threads info: wayland.c:737: using SSD decorations info: render.c:3119: resize: 1400x1000 pixels, 53x18 chars info: render.c:3119: resize: 5120x2756 pixels, 196x50 chars info: render.c:3119: resize: 2560x1378 pixels, 98x25 chars info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Bold.ttf: size=19.00pt/31px, dpi=118.17 info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Bold.ttf: size=19.00pt/31px, dpi=118.17 info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Regular.ttf: size=19.00pt/31px, dpi=118.17 info: fcft.c:757: /usr/share/fonts/TTF/Inconsolata-Regular.ttf: size=19.00pt/31px, dpi=118.17 info: terminal.c:649: cell width=16, height=33 info: render.c:3119: resize: 2560x1378 pixels, 159x41 chars info: wayland.c:1475: cursor theme: (null), size: 24, scale: 1 info: main.c:560: goodbye ```
Poster

Also, thanks for your work on foot - really liking it so far :)

Also, thanks for your work on foot - really liking it so far :)
Owner

I'll have to check the metrics provided by this font. Some fonts provide underline positioning data for us, while others lack it, in which case foot has to estimate the position.

Further actions depends on that :)

Maybe related, but definitely not a duplicate: #490

Also, thanks for your work on foot - really liking it so far :)

Thanks :)

I'll have to check the metrics provided by this font. Some fonts provide underline positioning data for us, while others lack it, in which case foot has to estimate the position. Further actions depends on that :) Maybe related, but definitely not a duplicate: https://codeberg.org/dnkl/foot/issues/490 > Also, thanks for your work on foot - really liking it so far :) Thanks :)
Owner

At the very least, I think we should make sure the underline is never positioned outside the cell boundaries. Regardless of where we got the position from.

At the very least, I think we should make sure the underline is never positioned outside the cell boundaries. Regardless of where we got the position from.
Owner

At the very least, I think we should make sure the underline is never positioned outside the cell boundaries

yup, that was the problem here; at 51px, the underline's top is positioned just below the cell.

Now I just need to decide if this should be fixed in fcft or in foot...

> At the very least, I think we should make sure the underline is never positioned outside the cell boundaries yup, that was the problem here; at 51px, the underline's top is positioned just below the cell. Now I just need to decide if this should be fixed in fcft or in foot...
dnkl added the
bug
label 6 months ago
dnkl referenced this issue from a commit 6 months ago
dnkl referenced this issue from a commit 5 months ago
dnkl closed this issue 5 months ago
dnkl referenced this issue from a commit 5 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.