letter-spacing gets reset on invoking key-bindings.font-reset #680

Closed
opened 2 months ago by subnut · 20 comments
subnut commented 2 months ago

I've set letter-spacing = -1.4 in foot.ini.

When I start a new instance of foot, it works fine. But if you press Ctrl + 0 to font-reset, the letter-spacing gets reset to 0 (i.e. glyphs get wider)

I've set `letter-spacing = -1.4` in `foot.ini`. When I start a new instance of foot, it works fine. But if you press `Ctrl + 0` to font-reset, the letter-spacing gets reset to 0 (i.e. glyphs get wider)
Owner

I can't reproduce this on latest master. Which version of foot are you running?

I can't reproduce this on latest master. Which version of foot are you running?
Poster

Latest master -

foot -v
foot version: 1.8.2-92-ga37109e5 (Aug 13 2021, branch 'master') +pgo +ime +graphemes

The commit is a37109e5. Build from foot-git package in Arch AUR


Please see the attached recording for demonstration.

Latest master - ``` foot -v foot version: 1.8.2-92-ga37109e5 (Aug 13 2021, branch 'master') +pgo +ime +graphemes ``` The commit is `a37109e5`. Build from `foot-git` package in Arch AUR --- Please see the attached recording for demonstration.
Owner

Can you paste the full log output from foot, up to the point where you press ctrl+0?

Can you paste the full log output from foot, up to the point where you press ctrl+0?
Owner

And can you post your entire foot.ini conf here as well?

And can you post your entire foot.ini conf here as well?
Poster

output log

info: main.c:398: version: 1.8.2-92-ga37109e5 (Aug 13 2021, branch 'master') +pgo +ime +graphemes
info: main.c:405: arch: Linux x86_64/64-bit
info: main.c:412: locale: en_US.UTF8
info: config.c:3053: loading configuration from /home/subnut/.config/foot/foot.ini
info: wayland.c:1270: eDP-1: 1920x1080+1476x0@60Hz 0x14D4 13.92" scale=2 PPI=160x180 (physical) PPI=100x112 (logical), DPI=197.83
info: wayland.c:1270: HDMI-A-1: 1920x1080+0x0@60Hz BenQ GW2480 23.98" scale=2 PPI=96x98 (physical) PPI=73x75 (logical), DPI=141.25
info: wayland.c:1423: requesting SSD decorations
info: fcft.c:267: fcft: 2.4.4 +graphemes +runs
info: fcft.c:277: fontconfig: 2.13.94
info: fcft.c:283: freetype: 2.10.4
info: fcft.c:758: /home/subnut/.fonts/Recursive_Code/RecMonoSemicasual/RecMonoSemicasual-Regular-1.078.ttf: size=32.00pt/43px, dpi=96.00
info: fcft.c:758: /home/subnut/.fonts/Recursive_Code/RecMonoSemicasual/RecMonoSemicasual-BoldItalic-1.078.ttf: size=32.00pt/43px, dpi=96.00
info: fcft.c:758: /home/subnut/.fonts/Recursive_Code/RecMonoSemicasual/RecMonoSemicasual-Italic-1.078.ttf: size=32.00pt/43px, dpi=96.00
info: fcft.c:758: /home/subnut/.fonts/Recursive_Code/RecMonoSemicasual/RecMonoSemicasual-Bold-1.078.ttf: size=32.00pt/43px, dpi=96.00
info: terminal.c:683: cell width=22, height=52
info: terminal.c:585: using 8 rendering threads
xkbcommon: ERROR: couldn't find a Compose file for locale "en_US.UTF8"
warn: input.c:659: failed to instantiate compose table; dead keys will not work
info: wayland.c:800: using SSD decorations
info: wayland.c:1581: cursor theme: (null), size: 24, scale: 2
info: terminal.c:683: cell width=23, height=52
^Cinfo: main.c:579: goodbye

foot.ini

font = Rec Mono Semicasual:size=16
# letter-spacing = -1.4
letter-spacing = -2
pad = 8x8 center

[scrollback]
indicator-format = line

[mouse]
hide-when-typing = yes

[colors]
# alpha = 1
alpha = 0.7
background = ffffff
foreground = 000000
0  = 000000
1  = A80000
2  = 00A800
3  = A8A800
4  = 0000A8
5  = A800A8
6  = 00A8A8
7  = CFCFCF

8  = 000054
9  = FF0054
10 = 00FF54
11 = FFFF54
12 = 0000FF
13 = FF00FF
14 = 00FFFF

# vim: set cms=#%s:
# output log ```log info: main.c:398: version: 1.8.2-92-ga37109e5 (Aug 13 2021, branch 'master') +pgo +ime +graphemes info: main.c:405: arch: Linux x86_64/64-bit info: main.c:412: locale: en_US.UTF8 info: config.c:3053: loading configuration from /home/subnut/.config/foot/foot.ini info: wayland.c:1270: eDP-1: 1920x1080+1476x0@60Hz 0x14D4 13.92" scale=2 PPI=160x180 (physical) PPI=100x112 (logical), DPI=197.83 info: wayland.c:1270: HDMI-A-1: 1920x1080+0x0@60Hz BenQ GW2480 23.98" scale=2 PPI=96x98 (physical) PPI=73x75 (logical), DPI=141.25 info: wayland.c:1423: requesting SSD decorations info: fcft.c:267: fcft: 2.4.4 +graphemes +runs info: fcft.c:277: fontconfig: 2.13.94 info: fcft.c:283: freetype: 2.10.4 info: fcft.c:758: /home/subnut/.fonts/Recursive_Code/RecMonoSemicasual/RecMonoSemicasual-Regular-1.078.ttf: size=32.00pt/43px, dpi=96.00 info: fcft.c:758: /home/subnut/.fonts/Recursive_Code/RecMonoSemicasual/RecMonoSemicasual-BoldItalic-1.078.ttf: size=32.00pt/43px, dpi=96.00 info: fcft.c:758: /home/subnut/.fonts/Recursive_Code/RecMonoSemicasual/RecMonoSemicasual-Italic-1.078.ttf: size=32.00pt/43px, dpi=96.00 info: fcft.c:758: /home/subnut/.fonts/Recursive_Code/RecMonoSemicasual/RecMonoSemicasual-Bold-1.078.ttf: size=32.00pt/43px, dpi=96.00 info: terminal.c:683: cell width=22, height=52 info: terminal.c:585: using 8 rendering threads xkbcommon: ERROR: couldn't find a Compose file for locale "en_US.UTF8" warn: input.c:659: failed to instantiate compose table; dead keys will not work info: wayland.c:800: using SSD decorations info: wayland.c:1581: cursor theme: (null), size: 24, scale: 2 info: terminal.c:683: cell width=23, height=52 ^Cinfo: main.c:579: goodbye ``` # `foot.ini` ```ini font = Rec Mono Semicasual:size=16 # letter-spacing = -1.4 letter-spacing = -2 pad = 8x8 center [scrollback] indicator-format = line [mouse] hide-when-typing = yes [colors] # alpha = 1 alpha = 0.7 background = ffffff foreground = 000000 0 = 000000 1 = A80000 2 = 00A800 3 = A8A800 4 = 0000A8 5 = A800A8 6 = 00A8A8 7 = CFCFCF 8 = 000054 9 = FF0054 10 = 00FF54 11 = FFFF54 12 = 0000FF 13 = FF00FF 14 = 00FFFF # vim: set cms=#%s: ```
Poster

Curiously, it doesn't happen on my laptop display 😕

My setup is like this

  • eDP-1: 1920x1080 scale=1.6 (14-inch laptop display)
  • HDMI-A-1: 1920x1080 scale=1.3 (24-inch external display)

The recording is done on the external display, where the issue happens.
It doesn't happen in the laptop display (i.e. font stays compressed)

@dnkl Any idea why that might happen? I am using sway.

Curiously, it doesn't happen on my laptop display 😕 My setup is like this - `eDP-1: 1920x1080 scale=1.6 (14-inch laptop display)` - `HDMI-A-1: 1920x1080 scale=1.3 (24-inch external display)` The recording is done on the external display, where the issue happens. It doesn't happen in the laptop display (i.e. font stays compressed) @dnkl Any idea why that might happen? I am using `sway`.
Poster

@dnkl I forgot to mention, the recording was made with letter-spacing = 2 so that the effect is more visible.

@dnkl I forgot to mention, the recording was made with `letter-spacing = 2` so that the effect is more visible.
Owner

I think this is related to DPI scaling.

You have scaling enabled, which means the fonts (by default) are scaled using the scaling factor, not the monitors' actual DPI.

The letter spacing on the other hand is always scaled using the monitor DPI. This is one bug - if the fonts are scaled by the scaling factor instead of the DPI, so should the letter spacing.

What I'm thinking is there's some bad interaction between having multiple monitors, with scaling factors > 1.

Something like the letter spacing initially being scaled using one DPI, and then when you reset the fonts, it's scaled using another DPI value.

This is probably happening because we're not supposed to use the DPI at all in your case, making the DPI value we end up using being unsynchronized, and thus different at startup and then after the font reset.

Just for kicks, try setting dpi-aware=yes in foot.ini. Your fonts will be scaled differently from before, and you may have to adjust the size in foot.ini. But see if it helps with the letter spacing issue. This will help narrow down the exact cause.

I think this is related to DPI scaling. You have scaling enabled, which means the fonts (by default) are scaled using the scaling factor, not the monitors' actual DPI. The letter spacing on the other hand is always scaled using the monitor DPI. This is one bug - if the fonts are scaled by the scaling factor instead of the DPI, so should the letter spacing. What I'm thinking is there's some bad interaction between having multiple monitors, with scaling factors > 1. Something like the letter spacing initially being scaled using one DPI, and then when you reset the fonts, it's scaled using another DPI value. This is probably happening because we're not supposed to use the DPI at all in your case, making the DPI value we end up using being unsynchronized, and thus different at startup and then after the font reset. Just for kicks, try setting `dpi-aware=yes` in `foot.ini`. Your fonts will be scaled differently from before, and you may have to adjust the size in foot.ini. But see if it helps with the letter spacing issue. This will help narrow down the exact cause.
Owner

If you're up for it, try adding logging to term_pt_or_px_as_pixels() in terminal.c, and log the DPI value.

You'd have to do a manual build.

No need to bother if you don't immediately know what I'm talking about ;)

If you're up for it, try adding logging to `term_pt_or_px_as_pixels()` in `terminal.c`, and log the DPI value. You'd have to do a manual build. No need to bother if you don't immediately know what I'm talking about ;)
Poster

If you're up for it, try adding logging to term_pt_or_px_as_pixels() in terminal.c, and log the DPI value.

With dpi-aware enabled in foot.ini ?

> If you're up for it, try adding logging to term_pt_or_px_as_pixels() in terminal.c, and log the DPI value. With `dpi-aware` enabled in `foot.ini` ?
Owner

Without :)

Without :)
Owner
Background: https://codeberg.org/dnkl/foot/src/commit/a37109e5f6e139ec01951b917c56a9696c55d86c/README.md#user-content-dpi-and-font-size
Poster
FAILED: libvtlib.a.p/csi.c.o 
cc -Ilibvtlib.a.p -I. -I.. -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -flto=auto -fdiagnostics-color=always -fprofile-generate -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=c11 -O3 -DMEMFD_CREATE -D_GNU_SOURCE=200809L -fno-asynchronous-unwind-tables -DFOOT_IME_ENABLED=1 -pedantic -fstrict-aliasing -Wstrict-aliasing -fmacro-prefix-map=../= -DFOOT_GRAPHEME_CLUSTERING=1 -DHAVE_TERMINFO -DHAVE_XDG_ACTIVATION -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -O3 -fPIC -DUTF8PROC_EXPORTS -MD -MQ libvtlib.a.p/csi.c.o -MF libvtlib.a.p/csi.c.o.d -o libvtlib.a.p/csi.c.o -c ../csi.c
In file included from ../csi.c:23:
../csi.c: In function ‘csi_dispatch’:
./version.h:2:20: error: implicit declaration of function ‘a37109e’ [-Werror=implicit-function-declaration]
    2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master')
      |                    ^~~~~~~
../csi.c:1504:31: note: in expansion of macro ‘FOOT_MAJOR’
 1504 |                 static_assert(FOOT_MAJOR < 100, "Major version must not exceed 99");
      |                               ^~~~~~~~~~
./version.h:2:29: error: ‘Aug’ undeclared (first use in this function); did you mean ‘bug’?
    2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master')
      |                             ^~~
../csi.c:1504:31: note: in expansion of macro ‘FOOT_MAJOR’
 1504 |                 static_assert(FOOT_MAJOR < 100, "Major version must not exceed 99");
      |                               ^~~~~~~~~~
./version.h:2:29: note: each undeclared identifier is reported only once for each function it appears in
    2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master')
      |                             ^~~
../csi.c:1504:31: note: in expansion of macro ‘FOOT_MAJOR’
 1504 |                 static_assert(FOOT_MAJOR < 100, "Major version must not exceed 99");
      |                               ^~~~~~~~~~
./version.h:2:33: error: expected ‘)’ before numeric constant
    2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master')
      |                            ~    ^~
../csi.c:1504:31: note: in expansion of macro ‘FOOT_MAJOR’
 1504 |                 static_assert(FOOT_MAJOR < 100, "Major version must not exceed 99");
      |                               ^~~~~~~~~~
../csi.c:1504:31: error: character constant too long for its type [-Werror]
In file included from ../csi.c:23:
./version.h:2:20: error: expression in static assertion is not an integer
    2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master')
      |                    ^~~~~~~
../csi.c:1504:31: note: in expansion of macro ‘FOOT_MAJOR’
 1504 |                 static_assert(FOOT_MAJOR < 100, "Major version must not exceed 99");
      |                               ^~~~~~~~~~
./version.h:3:33: error: expected ‘)’ before numeric constant
    3 | #define FOOT_MINOR a37109e (Aug 13 2021, branch 'master')
      |                            ~    ^~
../csi.c:1505:31: note: in expansion of macro ‘FOOT_MINOR’
 1505 |                 static_assert(FOOT_MINOR < 100, "Minor version must not exceed 99");
      |                               ^~~~~~~~~~
../csi.c:1505:31: error: character constant too long for its type [-Werror]
In file included from ../csi.c:23:
./version.h:3:20: error: expression in static assertion is not an integer
    3 | #define FOOT_MINOR a37109e (Aug 13 2021, branch 'master')
      |                    ^~~~~~~
../csi.c:1505:31: note: in expansion of macro ‘FOOT_MINOR’
 1505 |                 static_assert(FOOT_MINOR < 100, "Minor version must not exceed 99");
      |                               ^~~~~~~~~~
./version.h:4:33: error: expected ‘)’ before numeric constant
    4 | #define FOOT_PATCH a37109e (Aug 13 2021, branch 'master')
      |                            ~    ^~
../csi.c:1506:31: note: in expansion of macro ‘FOOT_PATCH’
 1506 |                 static_assert(FOOT_PATCH < 100, "Patch version must not exceed 99");
      |                               ^~~~~~~~~~
../csi.c:1506:31: error: character constant too long for its type [-Werror]
In file included from ../csi.c:23:
./version.h:4:20: error: expression in static assertion is not an integer
    4 | #define FOOT_PATCH a37109e (Aug 13 2021, branch 'master')
      |                    ^~~~~~~
../csi.c:1506:31: note: in expansion of macro ‘FOOT_PATCH’
 1506 |                 static_assert(FOOT_PATCH < 100, "Patch version must not exceed 99");
      |                               ^~~~~~~~~~
./version.h:2:33: error: expected ‘)’ before numeric constant
    2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master')
      |                            ~    ^~
../csi.c:1510:26: note: in expansion of macro ‘FOOT_MAJOR’
 1510 |                          FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH);
      |                          ^~~~~~~~~~
../csi.c:1510:26: error: character constant too long for its type [-Werror]
In file included from ../csi.c:23:
./version.h:3:33: error: expected ‘)’ before numeric constant
    3 | #define FOOT_MINOR a37109e (Aug 13 2021, branch 'master')
      |                            ~    ^~
../csi.c:1510:38: note: in expansion of macro ‘FOOT_MINOR’
 1510 |                          FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH);
      |                                      ^~~~~~~~~~
../csi.c:1510:38: error: character constant too long for its type [-Werror]
In file included from ../csi.c:23:
./version.h:4:33: error: expected ‘)’ before numeric constant
    4 | #define FOOT_PATCH a37109e (Aug 13 2021, branch 'master')
      |                            ~    ^~
../csi.c:1510:50: note: in expansion of macro ‘FOOT_PATCH’
 1510 |                          FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH);
      |                                                  ^~~~~~~~~~
../csi.c:1510:50: error: character constant too long for its type [-Werror]
In file included from ../csi.c:23:
./version.h:2:33: error: expected ‘)’ before numeric constant
    2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master')
      |                            ~    ^~
../csi.c:1559:17: note: in expansion of macro ‘FOOT_MAJOR’
 1559 |                 FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH,
      |                 ^~~~~~~~~~
../csi.c:1559:17: error: character constant too long for its type [-Werror]
In file included from ../csi.c:23:
./version.h:3:33: error: expected ‘)’ before numeric constant
    3 | #define FOOT_MINOR a37109e (Aug 13 2021, branch 'master')
      |                            ~    ^~
../csi.c:1559:29: note: in expansion of macro ‘FOOT_MINOR’
 1559 |                 FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH,
      |                             ^~~~~~~~~~
../csi.c:1559:29: error: character constant too long for its type [-Werror]
In file included from ../csi.c:23:
./version.h:4:33: error: expected ‘)’ before numeric constant
    4 | #define FOOT_PATCH a37109e (Aug 13 2021, branch 'master')
      |                            ~    ^~
../csi.c:1559:41: note: in expansion of macro ‘FOOT_PATCH’
 1559 |                 FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH,
      |                                         ^~~~~~~~~~
../csi.c:1559:41: error: character constant too long for its type [-Werror]
cc1: all warnings being treated as errors
[11/27] Compiling C object foot.p/config.c.o
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
    Aborting...
4
~/foot
$ 
``` FAILED: libvtlib.a.p/csi.c.o cc -Ilibvtlib.a.p -I. -I.. -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -flto=auto -fdiagnostics-color=always -fprofile-generate -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=c11 -O3 -DMEMFD_CREATE -D_GNU_SOURCE=200809L -fno-asynchronous-unwind-tables -DFOOT_IME_ENABLED=1 -pedantic -fstrict-aliasing -Wstrict-aliasing -fmacro-prefix-map=../= -DFOOT_GRAPHEME_CLUSTERING=1 -DHAVE_TERMINFO -DHAVE_XDG_ACTIVATION -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -O3 -fPIC -DUTF8PROC_EXPORTS -MD -MQ libvtlib.a.p/csi.c.o -MF libvtlib.a.p/csi.c.o.d -o libvtlib.a.p/csi.c.o -c ../csi.c In file included from ../csi.c:23: ../csi.c: In function ‘csi_dispatch’: ./version.h:2:20: error: implicit declaration of function ‘a37109e’ [-Werror=implicit-function-declaration] 2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master') | ^~~~~~~ ../csi.c:1504:31: note: in expansion of macro ‘FOOT_MAJOR’ 1504 | static_assert(FOOT_MAJOR < 100, "Major version must not exceed 99"); | ^~~~~~~~~~ ./version.h:2:29: error: ‘Aug’ undeclared (first use in this function); did you mean ‘bug’? 2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master') | ^~~ ../csi.c:1504:31: note: in expansion of macro ‘FOOT_MAJOR’ 1504 | static_assert(FOOT_MAJOR < 100, "Major version must not exceed 99"); | ^~~~~~~~~~ ./version.h:2:29: note: each undeclared identifier is reported only once for each function it appears in 2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master') | ^~~ ../csi.c:1504:31: note: in expansion of macro ‘FOOT_MAJOR’ 1504 | static_assert(FOOT_MAJOR < 100, "Major version must not exceed 99"); | ^~~~~~~~~~ ./version.h:2:33: error: expected ‘)’ before numeric constant 2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master') | ~ ^~ ../csi.c:1504:31: note: in expansion of macro ‘FOOT_MAJOR’ 1504 | static_assert(FOOT_MAJOR < 100, "Major version must not exceed 99"); | ^~~~~~~~~~ ../csi.c:1504:31: error: character constant too long for its type [-Werror] In file included from ../csi.c:23: ./version.h:2:20: error: expression in static assertion is not an integer 2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master') | ^~~~~~~ ../csi.c:1504:31: note: in expansion of macro ‘FOOT_MAJOR’ 1504 | static_assert(FOOT_MAJOR < 100, "Major version must not exceed 99"); | ^~~~~~~~~~ ./version.h:3:33: error: expected ‘)’ before numeric constant 3 | #define FOOT_MINOR a37109e (Aug 13 2021, branch 'master') | ~ ^~ ../csi.c:1505:31: note: in expansion of macro ‘FOOT_MINOR’ 1505 | static_assert(FOOT_MINOR < 100, "Minor version must not exceed 99"); | ^~~~~~~~~~ ../csi.c:1505:31: error: character constant too long for its type [-Werror] In file included from ../csi.c:23: ./version.h:3:20: error: expression in static assertion is not an integer 3 | #define FOOT_MINOR a37109e (Aug 13 2021, branch 'master') | ^~~~~~~ ../csi.c:1505:31: note: in expansion of macro ‘FOOT_MINOR’ 1505 | static_assert(FOOT_MINOR < 100, "Minor version must not exceed 99"); | ^~~~~~~~~~ ./version.h:4:33: error: expected ‘)’ before numeric constant 4 | #define FOOT_PATCH a37109e (Aug 13 2021, branch 'master') | ~ ^~ ../csi.c:1506:31: note: in expansion of macro ‘FOOT_PATCH’ 1506 | static_assert(FOOT_PATCH < 100, "Patch version must not exceed 99"); | ^~~~~~~~~~ ../csi.c:1506:31: error: character constant too long for its type [-Werror] In file included from ../csi.c:23: ./version.h:4:20: error: expression in static assertion is not an integer 4 | #define FOOT_PATCH a37109e (Aug 13 2021, branch 'master') | ^~~~~~~ ../csi.c:1506:31: note: in expansion of macro ‘FOOT_PATCH’ 1506 | static_assert(FOOT_PATCH < 100, "Patch version must not exceed 99"); | ^~~~~~~~~~ ./version.h:2:33: error: expected ‘)’ before numeric constant 2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master') | ~ ^~ ../csi.c:1510:26: note: in expansion of macro ‘FOOT_MAJOR’ 1510 | FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH); | ^~~~~~~~~~ ../csi.c:1510:26: error: character constant too long for its type [-Werror] In file included from ../csi.c:23: ./version.h:3:33: error: expected ‘)’ before numeric constant 3 | #define FOOT_MINOR a37109e (Aug 13 2021, branch 'master') | ~ ^~ ../csi.c:1510:38: note: in expansion of macro ‘FOOT_MINOR’ 1510 | FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH); | ^~~~~~~~~~ ../csi.c:1510:38: error: character constant too long for its type [-Werror] In file included from ../csi.c:23: ./version.h:4:33: error: expected ‘)’ before numeric constant 4 | #define FOOT_PATCH a37109e (Aug 13 2021, branch 'master') | ~ ^~ ../csi.c:1510:50: note: in expansion of macro ‘FOOT_PATCH’ 1510 | FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH); | ^~~~~~~~~~ ../csi.c:1510:50: error: character constant too long for its type [-Werror] In file included from ../csi.c:23: ./version.h:2:33: error: expected ‘)’ before numeric constant 2 | #define FOOT_MAJOR a37109e (Aug 13 2021, branch 'master') | ~ ^~ ../csi.c:1559:17: note: in expansion of macro ‘FOOT_MAJOR’ 1559 | FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH, | ^~~~~~~~~~ ../csi.c:1559:17: error: character constant too long for its type [-Werror] In file included from ../csi.c:23: ./version.h:3:33: error: expected ‘)’ before numeric constant 3 | #define FOOT_MINOR a37109e (Aug 13 2021, branch 'master') | ~ ^~ ../csi.c:1559:29: note: in expansion of macro ‘FOOT_MINOR’ 1559 | FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH, | ^~~~~~~~~~ ../csi.c:1559:29: error: character constant too long for its type [-Werror] In file included from ../csi.c:23: ./version.h:4:33: error: expected ‘)’ before numeric constant 4 | #define FOOT_PATCH a37109e (Aug 13 2021, branch 'master') | ~ ^~ ../csi.c:1559:41: note: in expansion of macro ‘FOOT_PATCH’ 1559 | FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH, | ^~~~~~~~~~ ../csi.c:1559:41: error: character constant too long for its type [-Werror] cc1: all warnings being treated as errors [11/27] Compiling C object foot.p/config.c.o ninja: build stopped: subcommand failed. ==> ERROR: A failure occurred in build(). Aborting... 4 ~/foot $ ```
Poster

Can't build using makepkg

See error above

Can't build using `makepkg` See error above
Owner

What does ls -l /bin/sh say?

What does `ls -l /bin/sh` say?
Owner

And git describe --always --tags (inside the foot source directory)?

And `git describe --always --tags` (inside the foot source directory)?
Poster

Leave it, I just removed all references to version.h and FOOT_* 😂

I've got the numbers -

For the laptop display

$ foot 2>/dev/null
########### term->font_dpi = 197.82671 ###########
########### term->font_dpi = 197.82671 ###########
########### term->font_dpi = 197.82671 ###########
########### term->font_dpi = 197.82671 ###########
########### term->font_dpi = 197.82671 ###########
########### term->font_dpi = 197.82671 ###########

For the external display -

$ foot 2>/dev/null
########### term->font_dpi = 197.82671 ###########
########### term->font_dpi = 197.82671 ###########
########### term->font_dpi = 197.82671 ###########
########### term->font_dpi = 141.24893 ###########
########### term->font_dpi = 141.24893 ###########
########### term->font_dpi = 141.24893 ###########

First three lines are printed when the terminal is first invoked. The next three lines are printed when I press Ctrl+0

Leave it, I just removed all references to `version.h` and `FOOT_*` 😂 I've got the numbers - For the laptop display ``` $ foot 2>/dev/null ########### term->font_dpi = 197.82671 ########### ########### term->font_dpi = 197.82671 ########### ########### term->font_dpi = 197.82671 ########### ########### term->font_dpi = 197.82671 ########### ########### term->font_dpi = 197.82671 ########### ########### term->font_dpi = 197.82671 ########### ``` For the external display - ``` $ foot 2>/dev/null ########### term->font_dpi = 197.82671 ########### ########### term->font_dpi = 197.82671 ########### ########### term->font_dpi = 197.82671 ########### ########### term->font_dpi = 141.24893 ########### ########### term->font_dpi = 141.24893 ########### ########### term->font_dpi = 141.24893 ########### ``` First three lines are printed when the terminal is first invoked. The next three lines are printed when I press `Ctrl+0`
Owner

Thanks! Then I think this is what's happening:

When foot is faced with multiple monitors, it needs to guess the initial DPI. As soon as the window has been mapped (displayed), and thus when foot knows which monitor it is on (and thus which DPI to use), it will correct itself if necessary.

In your case, foot is guessing wrong. But, since you have scaling enabled, and foot isn't scaling the fonts using DPI, nothing is reloaded. At this point, the letter spacing distance has been scaled using the "wrong" DPI.

Then, when you press ctrl+0 to reset the fonts, the letter spacing gets re-calculated, this time using the "correct" DPI.

The real bug is if course, as already mentioned, that the letter spacing is scaled using the DPI.

I have a patch that I think will fix this. I can't post it right know, but will try to do so later tonight.

As for the version issue, I'm guessing it's a sed gone wrong in the generate-version.sh script...

Thanks! Then I think this is what's happening: When foot is faced with multiple monitors, it needs to guess the initial DPI. As soon as the window has been mapped (displayed), and thus when foot knows which monitor it is on (and thus which DPI to use), it will correct itself if necessary. In your case, foot is guessing wrong. But, since you have scaling enabled, and foot isn't scaling the fonts using DPI, nothing is reloaded. At this point, the letter spacing distance has been scaled using the "wrong" DPI. Then, when you press ctrl+0 to reset the fonts, the letter spacing gets re-calculated, this time using the "correct" DPI. The real bug is if course, as already mentioned, that the letter spacing is scaled using the DPI. I have a patch that I think will fix this. I can't post it right know, but will try to do so later tonight. As for the version issue, I'm guessing it's a `sed` gone wrong in the `generate-version.sh` script...
Poster

When foot is faced with multiple monitors, it needs to guess the initial DPI. As soon as the window has been mapped (displayed), and thus when foot knows which monitor it is on (and thus which DPI to use), it will correct itself if necessary.
...
Then, when you press ctrl+0 to reset the fonts, the letter spacing gets re-calculated, this time using the "correct" DPI

After you mentioned, I tried to increase/decrease the font size instead of resetting it, and sure enough! It gets expanded

> When foot is faced with multiple monitors, it needs to guess the initial DPI. As soon as the window has been mapped (displayed), and thus when foot knows which monitor it is on (and thus which DPI to use), it will correct itself if necessary. ... Then, when you press ctrl+0 to reset the fonts, the letter spacing gets re-calculated, this time using the "correct" DPI After you mentioned, I tried to increase/decrease the font size instead of resetting it, and sure enough! It gets expanded
Poster

I have a patch that I think will fix this. I can't post it right know, but will try to do so later tonight.

It's OK, take your time :)

> I have a patch that I think will fix this. I can't post it right know, but will try to do so later tonight. It's OK, take your time :)
dnkl referenced this issue from a commit 2 months ago
dnkl added the
bug
label 2 months ago
dnkl closed this issue 2 months ago
dnkl referenced this issue from a commit 2 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.