You are not logged in.

#1 2021-07-10 13:52:02

no_time
Member
Registered: 2021-07-10
Posts: 9

Text not horizontally centered

Greetings!

I have a problem with text not being horizontally centered in some but not all applications.
It's most noticeable in Wireshark but also present in Firefox. See attached image
Screenshot of wireshark

I did mess around with font rendering a while ago to improve subpixel hinting. Unfortunately I forgot the steps I took and the tutorial I followed.
The font rendering did improve but the changes had this nasty side effect.

Any help from freetype wizards is greatly appreciated  :^)

Offline

#2 2021-07-10 17:14:27

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,331

Re: Text not horizontally centered

Well post your font config changes.

Offline

#3 2021-07-11 13:50:28

no_time
Member
Registered: 2021-07-10
Posts: 9

Re: Text not horizontally centered

V1del wrote:

Well post your font config changes.

Looking back at my bash history I followed this guide.

https://wiki.manjaro.org/index.php/Impr … _Rendering

But even after undoing all the changes (unlinking the symlinks,deleting .Xresources,flushing cache) it's still broken. I'm not 100% it wasn't broken to begin with.

EDIT: pacman -Qkk fontconfig -> fontconfig: 339 total files, 0 altered files
I have no idea what remains modified, if anything.

Last edited by no_time (2021-07-11 14:04:15)

Offline

#4 2021-07-11 14:19:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,438

Re: Text not horizontally centered

What font is that? Also

fc-match monospace

I don't think that you can fontconfig override the ascender or descender of a font. The only thing capable of throwing things off in that wiki is the

nano ~/.config/fontconfig/fonts.conf

part - but the screenshot kinda looks like some Courier version.

Offline

#5 2021-07-11 15:40:05

no_time
Member
Registered: 2021-07-10
Posts: 9

Re: Text not horizontally centered

seth wrote:

What font is that? Also

fc-match monospace

I don't think that you can fontconfig override the ascender or descender of a font. The only thing capable of throwing things off in that wiki is the

nano ~/.config/fontconfig/fonts.conf

part - but the screenshot kinda looks like some Courier version.

All fonts exhibit this behaviour in Wireshark. The output of fc-match monospace is: NimbusMonoPS-Regular.otf: "Nimbus Mono PS" "Regular"
I have since deleted the contents of ~/.config/fontconfig/fonts.conf and ran sudo fc-cache -fv + a reboot
The situation is unchanged.

Offline

#6 2021-07-11 15:54:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,438

Re: Text not horizontally centered

Qt style issue?
But that wouldn't affect firefox.

Offline

#7 2021-07-11 16:00:19

no_time
Member
Registered: 2021-07-10
Posts: 9

Re: Text not horizontally centered

seth wrote:

Qt style issue?
But that wouldn't affect firefox.

I haven't touched anything Qt related other than the color scheme. Also plasma-settings seems to be fine too judging from the little test I came up with (finding a textbox and selecting the text, if it touches the selection box it's incorrect)
At this point I'm just wondering which packages should I nuke.

EDIT: Also, GUI programs launched with sudo render text incorrectly too, so this problem is not user level.

Last edited by no_time (2021-07-11 16:03:06)

Offline

#8 2021-07-11 16:16:54

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,438

Re: Text not horizontally centered

Can you provide a FF screenshot?

Offline

#9 2021-07-11 16:40:25

no_time
Member
Registered: 2021-07-10
Posts: 9

Re: Text not horizontally centered

seth wrote:

Can you provide a FF screenshot?

Sure, It's the most noticable in messenger. You can also see the selection rectangle being off too.

icliq.png

Offline

#10 2021-07-12 14:08:35

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,438

Re: Text not horizontally centered

There might be a disagreement on the DPI causing a miscalculation between toolkit and font renderer…

echo $XDG_SESSION_TYPE
printenv | grep -i scale
xrdb -q | grep -i dpi
xdpyinfo | grep resolution
xrandr -q
pacman -Qs 'freetype|harfbuzz'

Offline

#11 2021-07-12 18:52:46

no_time
Member
Registered: 2021-07-10
Posts: 9

Re: Text not horizontally centered

seth wrote:

There might be a disagreement on the DPI causing a miscalculation between toolkit and font renderer…

echo $XDG_SESSION_TYPE
printenv | grep -i scale
xrdb -q | grep -i dpi
xdpyinfo | grep resolution
xrandr -q
pacman -Qs 'freetype|harfbuzz'

Here we go

[redacted@redacted ~]$ echo $XDG_SESSION_TYPE
x11
[redacted@redacted ~]$ printenv | grep -i scale
QT_AUTO_SCREEN_SCALE_FACTOR=0
[redacted@redacted ~]$ xrdb -q | grep -i dpi
[redacted@redacted ~]$ echo "hmmm. it returned nothing"
hmmm. it returned nothing
[redacted@redacted ~]$ xdpyinfo | grep resolution
  resolution:    96x96 dots per inch
[redacted@redacted ~]$ xrandr -q
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
DisplayPort-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  74.97    50.00    59.94  
   1680x1050     59.95  
   1280x1024     75.02    60.02  
   1440x900      59.89  
   1280x960      60.00  
   1280x800      60.00  
   1280x720      60.00    50.00    59.94  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    72.81    66.67    60.00    59.94  
   720x400       70.08  
DisplayPort-1 disconnected (normal left inverted right x axis y axis)
HDMI-A-0 disconnected (normal left inverted right x axis y axis)
HDMI-A-1 disconnected (normal left inverted right x axis y axis)
DVI-D-0 disconnected (normal left inverted right x axis y axis)
[redacted@redacted ~]$ pacman -Qs 'freetype|harfbuzz'
local/freetype2 2.10.4-1
    Font rasterization library
local/freetype2-demos 2.10.4-1
    Freetype tools and demos
local/harfbuzz 2.8.2-1
    OpenType text shaping engine
local/harfbuzz-icu 2.8.2-1
    OpenType text shaping engine (ICU integration)
local/libxft 2.3.3-2
    FreeType-based font drawing library for X
[redacted@redacted ~]$ 

Offline

#12 2021-07-12 19:05:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,438

Re: Text not horizontally centered

hmmm. it returned nothing

That's fine, only means that you'r enot explcitly setting xft.dpi

The server runs at 96dpi, the physical resolution is ~82dpi - I don't think that this should™ have negative impact, but try

xrandr --dpi 82

Notice that this will only apply to processes started afterwards, so restart firefox/wireshark/whatever after doing so.

Offline

#13 2021-07-13 20:02:01

no_time
Member
Registered: 2021-07-10
Posts: 9

Re: Text not horizontally centered

seth wrote:

hmmm. it returned nothing

That's fine, only means that you'r enot explcitly setting xft.dpi

The server runs at 96dpi, the physical resolution is ~82dpi - I don't think that this should™ have negative impact, but try

xrandr --dpi 82

Notice that this will only apply to processes started afterwards, so restart firefox/wireshark/whatever after doing so.


And indeed it doesn't affect anything. I tried running from the same terminal that executed the xrandr command too. *sigh*  Something tells me I should just try to salvage my KDE install and do a full format.

Offline

#14 2021-07-13 20:12:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,438

Re: Text not horizontally centered

Does it happen w/ a fresh user account?

Offline

#15 2021-07-14 20:04:21

no_time
Member
Registered: 2021-07-10
Posts: 9

Re: Text not horizontally centered

seth wrote:

Does it happen w/ a fresh user account?

Yep, I tried creating a new account and it still happens.

Offline

#16 2021-07-14 21:21:30

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,438

Re: Text not horizontally centered

Then it's not a local config - did you fumble w/ the global config files in you subpixel hinting explorations?

pacman -Qikk fontconfig
fc-conflist

Offline

#17 2021-07-19 12:28:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,438

Offline

Board footer

Powered by FluxBB