Font Rendering Issue - linux

I have a problem with my font rendering under Linux Mint 17.1 Rebecca with Kernel 3.17.1.
The spacing for monospace fonts is really wrong, some letters are bold and misplaced. At some places the font appears italic and I don't know why. It just looks terrible.
Gnome Terminal:
Sublime Text:
The font settings are set to default:
Default Font: Noto Sans 9
Desktop Font: Noto Sans 10
Document Font: Noto Sans 10
Monospace Font: Monospace 10
Window Title Font: Noto Sans Bold 10,
Text Scaling Factor: 1.0
Antialiasing: Rgba
Hinting: Slight
Antialiasing and Hinting are not the problem! Also, I did not touch the fonts themselves (I also ran diff).
The problem does appear when I log in with different users, and in cinnamon as well as in i3.
I am not using a custom ~/.config/fontconfig file and did not change /etc/fonts/fonts.conf.
Even if I change the font in Sublime to "Times", only numbers seem to be affected.
The problem affects the following applications:
Gnome Terminal (using the system's font)
Terminator
Sublime Text
while it does not affect:
Firefox (and other browsers)
Android Studio
GTK Applications (like Gnome Settings, Abiword...)

Related

JetBrains IDE font rendering incorrect on Windows and Linux

I recently switched from Windows 11 to Nobara 37 GNOME (Fedora) and found the following problem:
PyCharm and WebStorm display the font differently in Windows and Linux with completely identical IDE settings.
Font: JetBrains Mono (default)
Size: 13
Line height: 1.2
Antialiasing: Subpixel
Windows
Linux
https://i.stack.imgur.com/sTSph.png
https://i.stack.imgur.com/7KA8I.png
Overlay
https://i.stack.imgur.com/V63r0.gif
As you can see, on Linux, the font is smaller in height and looks "compressed and stretched".
It is extremely inconvenient to work, it hurts the eyes.
IDE Settings
https://i.stack.imgur.com/UXwQP.png
https://i.stack.imgur.com/aYEKo.png
What I've already tried:
Reinstall the IDE
Check the JetBrains Mono font files on Windows and Linux, they turned out to be the same
I noticed that on Linux, when font smoothing is turned off, the character height returns to normal, but on Windows, the character height does not change in any way and always remains the same.
It seems that I was able to achieve about the same result as in Windows. To do this, I had to increase the font by one size (14) and set the line height to 1.1. It seems that this is really an IDE or font problem, since there is no such problem with other fonts.

Guake terminal displays incorrect colors (insufficient contrast)

I use two dropdown terminals in parallel: Yakuake and Guake.
When using Guake, the colors are way too dark, which makes much of the colored text unreadable because of insufficient contrast. The problem is most severe when displaying color #4 (dark blue) on black background (which is the default color ls displays directories with) or in Midnight Commander (default theme, dark blue background).
Yakuake displays all 16 colors correctly and the text is readable very well, the colored output of ls and Midnight Commander.
My OS is Linux 5.15.11-gentoo with plasma-5.88.0, gtk+-2.24.33 and gtk+-3.24.29. Here is my TERM setting in the environment:
TERM=xterm-256color
COLORTERM=yes
I tried all available Guake themes and all of them have horrible contrast. Either all colors are too dark, or the other way around - all of them are too bright. It seems Guake somehow compresses the color contrast.
I also tried defining custom colors, copying the color settings from Yakuake, but even though I set specific colors explicitly, the actually displayed colors were darker. I validated this with a color picker.
Changing the GTK Theme setting in Guake's preference tab General did not yield any success either.
The question is: Why does Guake alter the colors? Is there a way to turn this off and let it display the actual colors I specified? The problem must be with Guake or GTK because everything else is identical when using Yakuake (environment, Midnight Commander colors, ls colors, ...)
The following screenshots demonstrate my Guake Appearance settings:
And here is some Guake support information:
<details><summary>$ guake --support</summary>
Guake Version: 3.8.0
Vte Version: 0.64.2
Vte Runtime Version: 0.64.2
--------------------------------------------------
GTK+ Version: 3.24.29
GDK Backend: <GdkX11.X11Display
--------------------------------------------------
Desktop Session: /usr/share/xsessions/plasma
--------------------------------------------------
Display: :0
RGBA visual: True
Composited: True
Thanks a lot in advance.
It turns out ls renders directories as bold font with the expectation that the text will appear in bright color. As explained by Guake developers this is non-standard behavior used with old terminals that did not supported fonts. Guake follows the ANSI standard and renders the text correctly.
The solution is to tweak the ls colors accordingly.

Font used in Qt5 application looks different in Ubuntu Linux desktop and embedded Linux built using buildroot

In Qt Application I have loaded the QtFont as below
QFont arialFont("Arial Unicode MS", 15);
QGuiApplication::setFont(arialFont);
In Qml I have a text component
Text
{
id: txt
font.pointSize:10
color: "#1E1E1E"
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
text: "Start Apt"
}
The text is elided(looks different) in embedded Linux platform when compared with Ubuntu Linux desktop(18.04).
I am using Qt 5.6.3.
Free type is used in Linux for font rendering and Qt is configured for system freetype.
I used different freetype versions(2.9.1, 2.6.1, 2.5.3 and 2.3.12) and didn't see much variation.
I also gathered font information by logging the values:
Values of font properties that are logged and are same in both the platforms:
Text Width: 52
Font Point size: 10
Font Family: Arial Unicode MS
Font Pixel size: 13
Font letter spacing: 0
Font Weight: QFont:: Normal-50
Font Ratio: 1
Hinting Preference: PreferDefaultHinting
Capitalization: Capitalize
SpacingType: PercentageSpacing
Stretch: Unstretched
Style: Normal
StyleHint: AnyStyle
StyleStrategy: PreferDefault
Weight: Normal
Different values logged:
Text Painted Width: 48.35 in Linux Ubuntu and 47.39 in embedded Linux
Note: Also built the qt application in Windows with using system freetype, font rendering was same as Ubuntu Linux Desktop.
Below picture shows the difference
Left side is Ubuntu Linux Desktop(18.04) and right is Embedded Linux
Click here for image
Expecting Font should be similar in both the Linux platforms

fvwm gvim menu size smaller than text size

I am new to fvwm machine which is used by my new employers.
I am struggling in customizing gvim menu (File, Edit,etc) font size.
As you can see in the attached image, the font size are decent, but menu size is pretty small as compared to text font size.
How to solve this??
Reference Image:
gvim uses gnome gtk in the gnome version of gvim and in this case you can configure your environment using a .gtkrc file see https://unix.stackexchange.com/questions/25043/what-is-this-gtkrc-file. As another answer pointed out for Gtk 2.x programs ~/.gtkrc-2.0 is the configuration file.
To modify your font see e.g.
https://ubuntuforums.org/showthread.php?t=846348
https://bbs.archlinux.org/viewtopic.php?id=164044
https://unix.stackexchange.com/a/478303/38701
examples:
gtk-font-name = "Sans 12"
which gives you a Sans-Serif font with size 12
gtk-font-name = "DejaVu Sans 11"
which is more specific regarding the font and uses size 11
Create .gtkrc-2.0 in your home directory if it isn't present already
and add:
gtk-font-name = "bitstream bold 16"
That should solve your problem.

Font style and size differences in some Linux browsers

Default fonts on my site are defined in an external stylesheet as:
body { font-family: Arial; font-size:62.5%;}
This works fine in Windows and Mac.
To test my site I installed Linux Mint 13 (Mate) and loaded a selection of browsers from the Repository. I made two installations on separate PC’s. I left all browser settings as their defaults.
Firefox, Opera, Konqueror and Reconq displayed my pages as expected.
Web (Epiphany) overrides the default font style (i.e. it is not Arial) and also displays too large a font size.
Midori displays too large a font size. (installed in windows, midori displays the correct font size).
I believe Web (Epiphany) is designed principally for the GNOME desktop environment and maybe this is a factor or do I need to design differently for these two browsers to make them display the fonts correctly in Linux?
It seems that some distributions of Linux don't include the Arial font. I added Liberation Sans as an alternative font and this seems to be okay.
I don't understand however why some of the browsers didn't need this. Unless they include the font with the browser or accurately map some alternative?

Resources