Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

X window screen DPI and font size

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
13 posts • Page 1 of 1
Author
Message
nagmat84
Guru
Guru
Posts: 327
Joined: Tue Mar 27, 2007 7:31 pm

X window screen DPI and font size

  • Quote

Post by nagmat84 » Thu Dec 27, 2012 11:05 am

Hello,
my laptop panel has a native resolution of 1680x1050 pixels and and size of 331x207 millimeters. Hence, the actual resolution is 129x129 dpi. Now I have two options

a) Do not set any special options in "xorg.conf". In that case X assumes 96 DPI and "xdpyinfo" falsely claims the display to be 444x277 millimeters.

b) Use the "DisplaySize" option in the "Monitor" section of "xorg.conf" and inform X about the correct size of my panel.

Both ways have sigmificant drawbacks.

If I choose option a) all applications that have some kind of "scaling function", for e.g. PDF viewer, Word processors, etc., do not show the paper size, e.g. A4, US Letter, etc., at their correct physical size, if 100% scaling is chosen. Of course, that is an expected behaviour, because these applications depend on wrong DPI information.

If I choose option b) this perfectly works. But now, another problem arises. By default most desktop environements use a font size of 10pt to render graphical elements. This looks "normal" with 96 DPI. If I switch to 129DPI, a 10pt font becomes extremly large. I must use 7pt or 8pt to return to a "usual" dektop experience. (For some reason 1pt = 1/72 inch is not true if it comes to on-screen presentation.)

Now, if I write an (html) email this email is also composed with a 7pt setting by default. The result is a lot of complains by the recipients about small letters on their screen. Of course, I could explicitly force my email composer to use a 10pt font rather than the system default, but that again would result into huge glyphs on my screen.

What the hell is wrong with font scaling on desktops? And more important how to a achieve
a) a correct DPI setting for my screen (129 DPI) such that scaling works properly
b) a correct font scaling of GUI elements (1pt = 1/72 inch) on screen
at the same time?

Matthias
Top
gerard27
Advocate
Advocate
Posts: 2377
Joined: Sun Jan 04, 2004 3:30 pm
Location: Netherlands

  • Quote

Post by gerard27 » Thu Dec 27, 2012 1:49 pm

Hi nagmat84,

I had a similar problem with Gimp.
I was used to have dimensions of pictures at 100% on the screen to be exact.
Then when I installed this HP LP2475w monitor things were way off.
I don't remember all the steps I took to correct it couple of years ago.
Anyway the problem was the EDID of the monitor.
It set dpi at 87x91 if I remember right.
The solution was to disable EDIDDPI and set my own.
Here's my xorg.conf:

Code: Select all

Section "InputClass"
	Identifier "keyboard-all"
	Driver "evdev"
	Option "XkbLayout" "us_intl"
	Option "XkbOptions" "terminate:ctrl_alt_bksp"

	MatchIsKeyboard "on"
EndSection

Section "Device"
  Identifier "nvidia"
     Driver "nvidia"
  Option "RenderAccel" "true"
  Option "AllowGLXWithComposite" "true"
  Option "AddARGBGLXVisuals" "true"
  Option "RandRRotation" "true"
EndSection


Section "Screen"
    Identifier "Screen0"
    Device "VideoCard0"
    Monitor "Monitor0"
    Option "UseEDIDDPI" "False"
    Option "DPI" "94 x 94"
EndSection
    
Section "Files"
    ModulePath "/usr/lib64/xorg/modules"
    ModulePath "/usr/lib64/opengl/xorg-x11/extensions/"
EndSection

# (These data were taken from LP2475w edid)

	# EDID version 1 revision 3
Section "Monitor"
        # Block type: 2:0 3:fc
        Identifier "HP LP2475w"
        VendorName "HWP"
        ModelName "HP LP2475w"
        # Block type: 2:0 3:fc
        # Block type: 2:0 3:fd
        HorizSync 30-94
        VertRefresh 48-85
        # Max dot clock (video bandwidth) 170 MHz
        # Block type: 2:0 3:ff
        # DPMS capabilities: Active off:yes  Suspend:yes  Standby:yes
        Mode    "1920x1200"     # vfreq 59.950Hz, hfreq 74.038kHz
                DotClock        154.000000
                HTimings        1920 1968 2000 2080
                VTimings        1200 1203 1209 1235
                Flags   "-HSync" "+VSync"
        EndMode
        # Block type: 2:0 3:fc
        # Block type: 2:0 3:fd
        # Block type: 2:0 3:ff
        Option "DPMS" "True"
EndSection
The dimension option did not work.
Hope this helps.
Gerard.
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Top
PaulBredbury
Watchman
Watchman
User avatar
Posts: 7310
Joined: Thu Jul 14, 2005 3:47 pm

Re: X window screen DPI and font size

  • Quote

Post by PaulBredbury » Thu Dec 27, 2012 2:00 pm

For some reason, possibly fear of patents, standard font rendering is still in the dark ages. Anyway, go with your option B.
nagmat84 wrote:if I write an (html) email this email is also composed with a 7pt setting by default
Using what? Is this something like google mail within a web browser?
Improve your font rendering and ALSA sound
Top
nagmat84
Guru
Guru
Posts: 327
Joined: Tue Mar 27, 2007 7:31 pm

  • Quote

Post by nagmat84 » Thu Dec 27, 2012 2:01 pm

Hi,
thanks for the reply, but it does not help. You did not understand my point. The "dimension" option works and does exaxtly what it is supposed to do. The problem is that that I am stuck to an other-or option:
a) I use the dimension options and get a correctly high DPI of my monitor. Then Gimp, etc. do correct scaling. But desktop GUI fonts become unusual large.
b) I do not use the dimension option and stay with a falsely low DPI. Then desktop GUI fonts are scaled normally, but every other software scales wrongly because of wrong assumptions.
If I was using the option DPI, that actually is not supported by the nouveau driver but only by the nvidia driver, it would result in the same either-or option. Either I set

Code: Select all

Option "DPI" "96x96"
- which by the way I can't - but then I have wrong scaling, or I set

Code: Select all

Option "DPI" "129x129"
, but then I have huge GUI fonts.
Top
PaulBredbury
Watchman
Watchman
User avatar
Posts: 7310
Joined: Thu Jul 14, 2005 3:47 pm

  • Quote

Post by PaulBredbury » Thu Dec 27, 2012 2:07 pm

nagmat84 wrote:but then I have huge GUI fonts.
So set them to 7pt, as you mentioned - that's exactly what I do, on a 1920x1080 monitor.
Top
nagmat84
Guru
Guru
Posts: 327
Joined: Tue Mar 27, 2007 7:31 pm

  • Quote

Post by nagmat84 » Thu Dec 27, 2012 2:12 pm

No, an html email has nothing to do with a web mail client. A html email is an ordinary email that uses html tags in its message body. Every email client (KMail, Tunderbird, Evolution, Outlook) can read and write html emails. Of course most of the time I write pure text emails, but from time to time I need text decoration in my mails and then I write a html email. But yes, if I was using a web mail client I would have the same problem, because my firefox also uses 7pt font.

Anyway, the whole email story was just meant as an example to illustrate where the problem becomes obvious. I would like to get this problem solved for its own sake.

If I choose a font to be 10pt, I want this font to be displayed at 10pt no matter what my display solution is like. In the ideal world something like this would happen:
10 pt = 10/72 inch, 10/72 inch * 130 dpi = 18 pixel.
But for some reason, this is not true.
Top
PaulBredbury
Watchman
Watchman
User avatar
Posts: 7310
Joined: Thu Jul 14, 2005 3:47 pm

  • Quote

Post by PaulBredbury » Thu Dec 27, 2012 9:08 pm

OK, now I understand you. Yeah, it's nuts, and the explanation probably involves a history lesson of Apple's (72 DPI), and Microsoft's (96 DPI), legacy font-rendering choices, and how the APIs are stuck-in-the-mud over the need for backwards compatibility.

Some quick googling reveals these not-very-helpful nuggets: gnu, os2.

I thought this was amusing:
if both resolution values are zero, they are set to 72dpi.
I suggest asking on the freetype mailing list.
Top
BitJam
Advocate
Advocate
Posts: 2516
Joined: Tue Aug 12, 2003 4:15 pm
Location: Silver City, NM

  • Quote

Post by BitJam » Fri Dec 28, 2012 9:14 pm

nagmat84 wrote:Every email client (KMail, Tunderbird, Evolution, Outlook) can read and write html emails.
I don't think this is true. For example, the Claws-mail FAQ says:
Does Claws Mail allow me to write HTML styled messages?
No. A discussion has gone around over this topic, and the outcome was that HTML mail is not wanted. If you really need to send HTML, you can of course attach a webpage to an e-mail.
Your assumption that HTML email has ubiquitous support on Linux could be the root of your problem. Many people still see HTML email as an abomination. You need to get an email client that allows you to set the font size independently from your desktop font size.

My first Linux laptop (well over a decade ago) had a very high dpi. I was usually able to make it work by adjusting the dpi and the various default font sizes. The biggest drawback (back then) was that browser images where "too small". With all the improvements to HTML there are now many problems with pages becoming unreadable and unusable because I tend to use font sizes that are larger than the page designers planned for.

A perfect solution is probably not possible but I'd bet you can get something quite workable by using a compromise between your dpi setting and you font sizes. Although perhaps I'm underestimating your need to have images show up correctly when set to 100%. ISTM that is a very leaky metaphor and dpi is generally used to adjust font sizes, nothing more.
Top
PaulBredbury
Watchman
Watchman
User avatar
Posts: 7310
Joined: Thu Jul 14, 2005 3:47 pm

Re: X window screen DPI and font size

  • Quote

Post by PaulBredbury » Fri Dec 28, 2012 9:45 pm

nagmat84 wrote:I must use 7pt or 8pt to return to a "usual" dektop experience
I think this is because the legacy situation (Microsoft's, since that's where the popular TrueType comes from) is to get the common "print size" of 10pt looking OK and readable at 96 DPI on a screen of say 1024x768. Even though that number 96 is just a convenient lie.

The calculations I believe are performed for the dots rather than the inches, following the legacy-convenient lie, so increasing the dots to be used, increases the size of the on-screen fonts. "Per inch" didn't matter at 96 DPI, nor at whatever we set it to.
Top
Jimmy Jazz
Guru
Guru
User avatar
Posts: 335
Joined: Mon Oct 04, 2004 5:29 pm
Location: Strasbourg

Re: X window screen DPI and font size

  • Quote

Post by Jimmy Jazz » Fri Dec 28, 2012 10:06 pm

nagmat84 wrote:Hello,

What the hell is wrong with font scaling on desktops? And more important how to a achieve
a) a correct DPI setting for my screen (129 DPI) such that scaling works properly
b) a correct font scaling of GUI elements (1pt = 1/72 inch) on screen
at the same time?

Matthias
Have you tried the media-libs/fontconfig-infinality package ?
« La seule condition au triomphe du mal, c'est l'inaction des gens de bien » E.Burke

Code: Select all

+----+----+----+
|    |::::|    |
|    |::::|    |
+----+----+----+ 
motto: WeLCRO
WritE Less Code, Repeat Often
Top
PaulBredbury
Watchman
Watchman
User avatar
Posts: 7310
Joined: Thu Jul 14, 2005 3:47 pm

Re: X window screen DPI and font size

  • Quote

Post by PaulBredbury » Sat Dec 29, 2012 4:17 am

Jimmy Jazz wrote:Have you tried the media-libs/fontconfig-infinality package ?
Yes, of course. This is about freetype, not fontconfig.
Top
_______0
Guru
Guru
Posts: 521
Joined: Mon Oct 15, 2012 6:05 pm

  • Quote

Post by _______0 » Sun Dec 30, 2012 12:40 pm

ok, leaving aside m$$ and o$$x history, what's the proper DPI font for modern monitor with 1080p resolution?

Is there a concise answer that I can put into a file and have change take effect immediately?

thnks

ps: metric unit would be more helpful here.
Top
PaulBredbury
Watchman
Watchman
User avatar
Posts: 7310
Joined: Thu Jul 14, 2005 3:47 pm

  • Quote

Post by PaulBredbury » Sun Dec 30, 2012 2:01 pm

Well, the easy answer is to just leave the DPI as it is. It's probably correct (from the monitor's EDID having been read), or defaulted to 96x96.

It's "dots per inch" - dunno what sort of metric measurement you were hoping to see.
Top
Post Reply

13 posts • Page 1 of 1

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Authors
Gentoo is a trademark of the Gentoo Foundation, Inc. and of Förderverein Gentoo e.V.
The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-4.0 license.
The Gentoo Name and Logo Usage Guidelines apply.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy