I'm playing with retroshare and some parts of the UI seem to be using a very small font (picture attached) while some other parts of the UI look exactly like the should. Problem is, I can't find any setting to make the small fonts bigger. I'm guessing that RS is trying to use a font that's missing in SliTaz, so some kind of replacement font is being used. But the replacement font is waay too small. Any hints as how to fix this?
Fonts too small.
(15 posts) (3 voices)-
Posted 9 years ago #
-
Hi new_u,
Maybe you use incorrect DPI value for your monitor/display. Open your ~/.Xdefaults and play with Xft.dpi value.
Now details.
Open PCManFM. Press Ctrl+H to show hidden files. Find .Xdefaults file in your home folder. Open it using Leafpad. Found line started with "Xft.dpi". If not found, add this line to the end of file:
Xft.dpi: 96
and make empty line after it.
Change "96" to desired value. Save file (not close Leafpad). Close and re-open Retroshare. Repeat if needed.
After that log out from Xorg session and log in again. Now whole system use your new dpi settings. Fine tune system font size using LXAppearance (GTK Appearance).
FYI (For Your Information):
How to calculate real dpi value? Dpi is stands for "dots per inch".
My netbook's sizes:
- horizontal: 1024 dots / 7.7 inches = 133 dpi
- vertical: 600 dots / 4.5 inches = 133 dpiFonts sizes measured in pt (points). 1pt = 1" / 72.
So, six lines with font size 12pt with line-height 1 will occupy exact 1 inch.Value 96 dpi is an "old standard", if I can to say so. Some older programs using this value hardcoded.
You are free to use your real dpi or any value you want.
PS.
Seems like Retroshare is Qt-based application. You need to use qtconfig to change system font for Qt-based apps.Posted 9 years ago # -
@Aleksej
Hi, are the first time to view this patch on .Xdefaults (Xft.dpi: xx)
greats work well, but anyone make by default this setting over Xorg?
The preference of aspect (lxappearance) tune only dimensions of characters, Xft.dpi: make directly the enlargement video as same of video resolution, and this is good.
Thank you.Posted 9 years ago # -
Really, Xorg is clever one. It asks monitor for its resolution and dimensions using DDC. And then calculated dpi using these values.
But there exists old (ancient) monitors that not supported DDC. Or returns wrong values. We need to tweak dpi only in these rare cases. In the normal cases dpi value is various, and it's better not to force it.
https://en.wikipedia.org/wiki/Extended_display_identification_data
Posted 9 years ago # -
Thanks Aleksej!
Yes, I think it is a QT problem. I just realized that even the QT control panel looks 'broken'.
In the attached picture, the text I underlined in red is using a very small font, and changing the QT default font size makes no difference. The small text always stays the same small size.
Now, my .Xdefaults didn't have a dpi entry so I added Xft.dpi: 104 and that made all fonts bigger including the very small ones. So, it more or less fixed the problem! Except, I then had to set the QT
defaul font to size 8, the gtk font to size 8, had to choose smaller fonts for openbox, sakura, etc. etc. But it mostly worked.So, looks like if there's no dpi setting in X some of the QT fonts get messed up?
Posted 9 years ago # -
Sorry, I can't reproduce your issue (now I'm home, and SliTaz is running).
Here, changing Xft.dpi I see big fonts, or small fonts. Not big and small at one time:
Posted 9 years ago # -
If you want to reproduce it, I think you need to remove the Xft.dpi line (assuming you have one).
Also, Im using SliTaz 4 and qtconfig 4.7 - Maybe you're using different versions?
Anyway, I'm going to boot off a CD (4.0) and see if the problem is still there.
--------------
OK - Running SliTaz Live off the CD and installing QT gives the same results in my machine.
Posted 9 years ago # -
Hi new_u
have tested retroshare on slitaz4, and confirm the dimension font its very strange, but one way to set good characters is possible.
My screen on notebook is 1280x800, and have setting these value
Lxappearance set font 9
qtconfig size 9
add to Xdefaults Xft.dpi: 125
set value obconf at aspect on all 12pt
logout and login and the my result is thesePosted 9 years ago # -
Hi gibor. Thanks for your reply. Yes, tweaking the Xft.dpi value does fix the problem, although after doing that, a lot of font sizes need to be re-adjusted (qtconfig, gtk, openbox, and individual applications).
I think there's a problem with the QT library itself. I'll see if I ask around in the QT forums.
Posted 9 years ago # -
FYI
I have recompiled qt (4.8.6) (3,5hours to make from source) and after these have recompiled retroshare, but anything change for font resolution.
I suspect the bug is inside from retroshare (note my version compiled is 0.5.5c)
the version 0.6 not have a lucky to make, break on error strange.An all case god luck for you :)
Posted 9 years ago # -
Thanks for the additional information gibor! Yes, at first I thought that retroshare was at fault, but since I then saw the same problem in qt's own control panel (see the last image I posted), I tend to think that there's some inconsistency in qt's font handling code.
Posted 9 years ago # -
Posted 9 years ago #
-
Looking sources. Here is UI for qtconfig main window:
ftp://cook.slitaz.org/qt4/source/qt4-4.8.6/tools/qtconfig/mainwindow.uiNote that text in the bottom of Phonon sub-page (“Note: changes to these settings may prevent…”) rendered as separate HTML page (line 1164) with hardcoded font style definitions: “Sans Serif, 9pt”. Also, other small texts are renders as HTML links (but without hardcoded sizes here).
So, it will always be “Sans Serif, 9pt” regardless your font settings. Note, that font size is defined in the points, not pixels. So, font's pixel size is depending on your display's current DPI.
Some calculations. Given:
1pt = 1 inch / 72 (or 1 inch = 72pt)
Your DPI = 125 dots / inchso, 72pt = 125 dots
1pt = 125 / 72 ≈ 1.736 dots
9pt ≈ 16 dotsNote, how font's size is measured:
Your 16 dots is the distance between two line's bases. And size of small letters is ≈ 1/2 of this distance.So, with 125dpi and 9pt font you give ≈ 8 dot size of small letters.
Reverse problem. Magnifying your screenshot I defined your small letters size is 4px. So, full line size is 8-9px. And if 9px=9pt, then your initial DPI is 72.
I think your bigger problem not with hardcoded Qt font size, but with incorrect DPI your graphics system is set. Something wrong with Xorg video driver settings. Probably you not installed native Xorg video driver for your video card, and use some generic driver that returns you default DPI value. Look up Xorg logs, here is my part:
tux@slitaz:/var$ grep -i dpi /var/log/Xorg.0.log /usr/share/fonts/X11/100dpi/, /usr/share/fonts/X11/75dpi/, /usr/share/fonts/X11/100dpi/, /usr/share/fonts/X11/75dpi/ [ 187.998] (**) intel(0): DPI set to (130, 138)
I have an Intel video card with Intel video driver, and they both works well, and set correct DPI, so I not need to fine-tune it using Xft.dpi.
Posted 9 years ago # -
Thanks for your detailed reply Aleksej!
I also had taken a look at source code. In Retroshare's I found in some places hardcoded html similar to the one you found. But here's the code for the icons/buttons at the top, and apparently there's no hard coded font size (though I'm not familiar with qt's api at all so maybe the value is set somewhere else)
action = createPageAction(QIcon(IMAGE_NEWSFEED), tr("News feed"), grp));
in /retroshare-0.5.5/src/retroshare-gui/src/gui/MainWindow.cpp:>I think your bigger problem not with hardcoded Qt font size, but with incorrect DPI your graphics system is set.
For what it's worth : my screen is 12 inches wide, and the resolution is set to 800x600. So, the real dpi of the screen is 66.6 ? I set Xft.dpi to 104 to get the 9pt fonts to look "big enough" although this is a matter of personal preference to some degree.
As to the Xorg log it says
[ 10.993] (**) NV(0): Display dimensions: (320, 240) mm
[ 10.993] (**) NV(0): DPI set to (81, 81)and before that
[ 10.895] (--) NV: Found NVIDIA GeForce 6150SE at 00@00:13:0
So I think the correct drivers are being loaded?
I don't know how Qt is supposed to work, but the fact that some font sizes are hardcoded doesn't seem right? Or using html inside a GUI? That's a bit convoluted for my taste.
Anyway, setting Xft.dpi by hand basically solves the problem so I'll leave it at that.
You've been very helpful Aleksej, I appreciate it! =)
Posted 9 years ago # -
Hi guys, first to trash my retroshare testing, have repacked the binary to tazpkg
from slitaz-4.0 live work (except dimension of characters)
warning if anyone test this packages, tazpkg install over system more dependencygst-plugins-base gstreamer libegl-mesa libgnome-keyring liboil libQt3Support libQtCore libQtDBus libQtGui libQtNetwork libQtScript libQtSql libQtXml libtheora libtheora-enc libupnp qt4-phonon qtconfig
Posted 9 years ago #
Reply
You must log in to post.