Repository: alacritty/alacritty (language: rust)

Issue:
Font size with two screens and 0.13.x

### System

OS: Linux Arch 
Version: Install this one https://aur.archlinux.org/packages/alacritty-git
Linux/BSD: X11/Wayland & I3

I try the beta version of alacritty according to the AUR package. I end up with a “strange” bug, I got two screen, on the “main” screen the font are huge (around 36 times pressing ctrl+- to get the same size as the other) but on the second screen the font size are smaller (than alacritty 0.12.3) but still almost normal (one or two time with ctrl+ + and it's OK). 

Here the ouput on main screen big font : 
 ```
alacritty -vv
Created log file at "/tmp/Alacritty-257882.log"
[0.000000930s] [INFO ] [alacritty] Welcome to Alacritty
[0.000052826s] [INFO ] [alacritty] Version 0.14.0-dev (3d7d81c8)
[0.000060252s] [INFO ] [alacritty] Running on X11
[0.000248361s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/home/jas/.config/alacritty/alacritty.toml"
                                     "/home/jas/.config/alacritty/themes/themes/zenburn.toml"
[0.002130955s] [INFO ] [alacritty] Using GLX 1.4
[0.022473869s] [DEBUG] [alacritty] Picked GL Config:
                                     buffer_type: Some(Rgb { r_size: 8, g_size: 8, b_size: 8 })
                                     alpha_size: 8
                                     num_samples: 0
                                     hardware_accelerated: true
                                     supports_transparency: Some(true)
                                     config_api: Api(OPENGL | GLES1 | GLES2)
                                     srgb_capable: false
[0.023350944s] [INFO ] [alacritty] Window scale factor: 3.3333333333333335
[0.024181876s] [DEBUG] [alacritty] Loading "MonaspiceAr Nerd Font" font
[0.042892337s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.052037464s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.060848755s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Italic, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.069681937s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold Italic, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.096586687s] [INFO ] [alacritty] Running on Mesa Intel(R) Xe Graphics (TGL GT2)
[0.096611209s] [INFO ] [alacritty] OpenGL version 4.6 (Core Profile) Mesa 23.3.1-arch1.1, shader_version 4.60
[0.096617232s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[0.103495446s] [DEBUG] [alacritty] Enabled debug logging for OpenGL
[0.103644299s] [DEBUG] [alacritty] Filling glyph cache with common glyphs
[0.116963095s] [INFO ] [alacritty] Cell size: 44 x 86
[0.116983874s] [INFO ] [alacritty] Padding: 0 x 0
[0.116986990s] [INFO ] [alacritty] Width: 800, Height: 600
[0.133824468s] [INFO ] [alacritty] PTY dimensions: 6 x 18
[0.138169696s] [INFO ] [alacritty] Initialisation complete
[0.264222546s] [DEBUG] [alacritty_terminal] New num_cols is 87 and num_lines is 24
[0.264627996s] [INFO ] [alacritty] Padding: 0 x 0
[0.264644598s] [INFO ] [alacritty] Width: 3832, Height: 2080
[0.281043634s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Solid, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
```

and in the second screen : 
 
```
Created log file at "/tmp/Alacritty-257692.log"
[0.000001169s] [INFO ] [alacritty] Welcome to Alacritty
[0.000043673s] [INFO ] [alacritty] Version 0.14.0-dev (3d7d81c8)
[0.000049677s] [INFO ] [alacritty] Running on X11
[0.000221867s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/home/jas/.config/alacritty/alacritty.toml"
                                     "/home/jas/.config/alacritty/themes/themes/zenburn.toml"
[0.002172703s] [INFO ] [alacritty] Using GLX 1.4
[0.022660213s] [DEBUG] [alacritty] Picked GL Config:
                                     buffer_type: Some(Rgb { r_size: 8, g_size: 8, b_size: 8 })
                                     alpha_size: 8
                                     num_samples: 0
                                     hardware_accelerated: true
                                     supports_transparency: Some(true)
                                     config_api: Api(OPENGL | GLES1 | GLES2)
                                     srgb_capable: false
[0.023697779s] [INFO ] [alacritty] Window scale factor: 3.3333333333333335
[0.024991955s] [DEBUG] [alacritty] Loading "MonaspiceAr Nerd Font" font
[0.043398696s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.052950878s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.061649865s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Italic, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.071409705s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold Italic, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.118369302s] [INFO ] [alacritty] Running on Mesa Intel(R) Xe Graphics (TGL GT2)
[0.118406795s] [INFO ] [alacritty] OpenGL version 4.6 (Core Profile) Mesa 23.3.1-arch1.1, shader_version 4.60
[0.118418023s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[0.130535785s] [DEBUG] [alacritty] Enabled debug logging for OpenGL
[0.130809549s] [DEBUG] [alacritty] Filling glyph cache with common glyphs
[0.201837891s] [INFO ] [alacritty] Cell size: 44 x 86
[0.201929142s] [INFO ] [alacritty] Padding: 0 x 0
[0.201948208s] [INFO ] [alacritty] Width: 800, Height: 600
[0.205163255s] [INFO ] [alacritty] PTY dimensions: 6 x 18
[0.209942576s] [INFO ] [alacritty] Initialisation complete
[0.323256204s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.333711099s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.343313746s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Italic, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.352785738s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold Italic, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.354485010s] [INFO ] [alacritty] Font size changed to 32.0 px
[0.354497357s] [INFO ] [alacritty] Cell size: 20 x 40
[0.354507730s] [DEBUG] [alacritty_terminal] New num_cols is 191 and num_lines is 52
[0.361546633s] [INFO ] [alacritty] Padding: 0 x 0
[0.361569751s] [INFO ] [alacritty] Width: 3832, Height: 2080
[0.417722246s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Solid, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
```

I can do any test to help *if* it's in the AUR packages (I'm not really good to build packages).




Discussion / hints:
How does this compare to Alacritty 0.12.3? Could you share screenshots comparing the two?
So here a screenshot of both screen 

On the right is the second screen, on the left is the main screen. On each screen on the left is alacritty 0.12.3 and on the right alacritty-git-0.13.x

![2023-12-21-1703141438_screenshot_7680x2160](https://github.com/alacritty/alacritty/assets/11524096/7a78053e-23be-4c58-af3e-8a50fa58797c)

The configuration of alacritty-git are created only with a alacritty migrate.
Just curious, do you set `Xft.dpi`?
> Just curious, do you set `Xft.dpi`?

Indeed I did 

```
xrdb -query|grep Xft.dpi
Xft.dpi:	192
```
I think this should fix it.

```diff
diff --git a/Cargo.lock b/Cargo.lock
index c09840e3..01c54bd9 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -563,9 +563,9 @@ dependencies = [
 
 [[package]]
 name = "crossfont"
-version = "0.5.2"
+version = "0.6.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3eb5a3822b594afc99b503cc1859b94686d3c3efdd60507a28587dab80ee1071"
+checksum = "80c5cf9f7d8f5478dbebc0e7a9ddcd350401e4cd9275d003481d8ec9613b7de1"
 dependencies = [
  "cocoa",
  "core-foundation",
@@ -649,7 +649,7 @@ version = "0.5.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412"
 dependencies = [
- "libloading 0.8.1",
+ "libloading",
 ]
 
 [[package]]
@@ -822,6 +822,16 @@ dependencies = [
  "winapi",
 ]
 
+[[package]]
+name = "gethostname"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818"
+dependencies = [
+ "libc",
+ "windows-targets 0.48.5",
+]
+
 [[package]]
 name = "getrandom"
 version = "0.2.11"
@@ -859,7 +869,7 @@ dependencies = [
  "glutin_glx_sys",
  "glutin_wgl_sys",
  "icrate",
- "libloading 0.8.1",
+ "libloading",
  "objc2",
  "once_cell",
  "raw-window-handle 0.5.2",
@@ -1049,16 +1059,6 @@ version = "0.2.150"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
 
-[[package]]
-name = "libloading"
-version = "0.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
-dependencies = [
- "cfg-if",
- "winapi",
-]
-
 [[package]]
 name = "libloading"
 version = "0.8.1"
@@ -1587,11 +1587,11 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
 
 [[package]]
 name = "sctk-adwaita"
-version = "0.7.0"
+version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1729a30a469de249c6effc17ec8d039b0aa29b3af79b819b7f51cb6ab8046a90"
+checksum = "c6d3124356ea1b31eb808b07d45c31c2a8341c75789846781e4e965977e92b7b"
 dependencies = [
- "crossfont 0.5.2",
+ "crossfont 0.6.0",
  "log",
  "smithay-client-toolkit",
  "tiny-skia",
@@ -2357,8 +2357,7 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
 [[package]]
 name = "winit"
 version = "0.29.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d25d662bb83b511acd839534bb2d88521b0bbc81440969cb077d23c4db9e62c7"
+source = "git+https://github.com/rust-windowing/winit#a676d0018bee83ce9f86766229e390c39276e2d7"
 dependencies = [
  "ahash",
  "android-activity",
@@ -2399,7 +2398,7 @@ dependencies = [
  "web-time",
  "windows-sys 0.48.0",
  "x11-dl",
- "x11rb",
+ "x11rb 0.13.0",
  "xkbcommon-dl",
 ]
 
@@ -2437,7 +2436,7 @@ version = "0.8.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b41aca1115b1f195f21c541c5efb423470848d48143127d0f07f8b90c27440df"
 dependencies = [
- "x11rb",
+ "x11rb 0.12.0",
 ]
 
 [[package]]
@@ -2457,15 +2456,26 @@ version = "0.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a"
 dependencies = [
- "as-raw-xcb-connection",
- "gethostname",
- "libc",
- "libloading 0.7.4",
+ "gethostname 0.3.0",
  "nix",
- "once_cell",
  "winapi",
  "winapi-wsapoll",
- "x11rb-protocol",
+ "x11rb-protocol 0.12.0",
+]
+
+[[package]]
+name = "x11rb"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a"
+dependencies = [
+ "as-raw-xcb-connection",
+ "gethostname 0.4.3",
+ "libc",
+ "libloading",
+ "once_cell",
+ "rustix",
+ "x11rb-protocol 0.13.0",
 ]
 
 [[package]]
@@ -2477,6 +2487,12 @@ dependencies = [
  "nix",
 ]
 
+[[package]]
+name = "x11rb-protocol"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34"
+
 [[package]]
 name = "xcursor"
 version = "0.3.4"
diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml
index 26be76ff..0c208bf2 100644
--- a/alacritty/Cargo.toml
+++ b/alacritty/Cargo.toml
@@ -40,7 +40,7 @@ serde_json = "1"
 serde_yaml = "0.9.25"
 toml = "0.8.2"
 unicode-width = "0.1"
-winit = { version = "0.29.4", default-features = false, features = ["rwh_05", "serde"] }
+winit = { git = "https://github.com/rust-windowing/winit", default-features = false, features = ["rwh_05", "serde"] }
 
 [build-dependencies]
 gl_generator = "0.14.0"

```
Well....I will trust you on that (I've no clue what you just write ;-) ) but soon the AUR package are updated I test and tell you the result.

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index c09840e321c..1c53199ebe9 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -563,9 +563,9 @@ dependencies = [
 
 [[package]]
 name = "crossfont"
-version = "0.5.2"
+version = "0.6.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3eb5a3822b594afc99b503cc1859b94686d3c3efdd60507a28587dab80ee1071"
+checksum = "80c5cf9f7d8f5478dbebc0e7a9ddcd350401e4cd9275d003481d8ec9613b7de1"
 dependencies = [
  "cocoa",
  "core-foundation",
@@ -649,7 +649,7 @@ version = "0.5.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412"
 dependencies = [
- "libloading 0.8.1",
+ "libloading",
 ]
 
 [[package]]
@@ -822,6 +822,16 @@ dependencies = [
  "winapi",
 ]
 
+[[package]]
+name = "gethostname"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818"
+dependencies = [
+ "libc",
+ "windows-targets 0.48.5",
+]
+
 [[package]]
 name = "getrandom"
 version = "0.2.11"
@@ -859,7 +869,7 @@ dependencies = [
  "glutin_glx_sys",
  "glutin_wgl_sys",
  "icrate",
- "libloading 0.8.1",
+ "libloading",
  "objc2",
  "once_cell",
  "raw-window-handle 0.5.2",
@@ -1049,16 +1059,6 @@ version = "0.2.150"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
 
-[[package]]
-name = "libloading"
-version = "0.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
-dependencies = [
- "cfg-if",
- "winapi",
-]
-
 [[package]]
 name = "libloading"
 version = "0.8.1"
@@ -1587,11 +1587,11 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
 
 [[package]]
 name = "sctk-adwaita"
-version = "0.7.0"
+version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1729a30a469de249c6effc17ec8d039b0aa29b3af79b819b7f51cb6ab8046a90"
+checksum = "c6d3124356ea1b31eb808b07d45c31c2a8341c75789846781e4e965977e92b7b"
 dependencies = [
- "crossfont 0.5.2",
+ "crossfont 0.6.0",
  "log",
  "smithay-client-toolkit",
  "tiny-skia",
@@ -2356,9 +2356,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
 
 [[package]]
 name = "winit"
-version = "0.29.4"
+version = "0.29.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d25d662bb83b511acd839534bb2d88521b0bbc81440969cb077d23c4db9e62c7"
+checksum = "2cc935117ef48caed8822a893efef723e07ad868f668dfc4d244aea8873b07f9"
 dependencies = [
  "ahash",
  "android-activity",
@@ -2399,7 +2399,7 @@ dependencies = [
  "web-time",
  "windows-sys 0.48.0",
  "x11-dl",
- "x11rb",
+ "x11rb 0.13.0",
  "xkbcommon-dl",
 ]
 
@@ -2437,7 +2437,7 @@ version = "0.8.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b41aca1115b1f195f21c541c5efb423470848d48143127d0f07f8b90c27440df"
 dependencies = [
- "x11rb",
+ "x11rb 0.12.0",
 ]
 
 [[package]]
@@ -2457,15 +2457,26 @@ version = "0.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a"
 dependencies = [
- "as-raw-xcb-connection",
- "gethostname",
- "libc",
- "libloading 0.7.4",
+ "gethostname 0.3.0",
  "nix",
- "once_cell",
  "winapi",
  "winapi-wsapoll",
- "x11rb-protocol",
+ "x11rb-protocol 0.12.0",
+]
+
+[[package]]
+name = "x11rb"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a"
+dependencies = [
+ "as-raw-xcb-connection",
+ "gethostname 0.4.3",
+ "libc",
+ "libloading",
+ "once_cell",
+ "rustix",
+ "x11rb-protocol 0.13.0",
 ]
 
 [[package]]
@@ -2477,6 +2488,12 @@ dependencies = [
  "nix",
 ]
 
+[[package]]
+name = "x11rb-protocol"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34"
+
 [[package]]
 name = "xcursor"
 version = "0.3.4"
diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml
index 26be76ff102..e4b439f5aa2 100644
--- a/alacritty/Cargo.toml
+++ b/alacritty/Cargo.toml
@@ -40,7 +40,7 @@ serde_json = "1"
 serde_yaml = "0.9.25"
 toml = "0.8.2"
 unicode-width = "0.1"
-winit = { version = "0.29.4", default-features = false, features = ["rwh_05", "serde"] }
+winit = { version = "0.29.5", default-features = false, features = ["rwh_05", "serde"] }
 
 [build-dependencies]
 gl_generator = "0.14.0"


Test patch: