Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
X window screen DPI and font size
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 175

PostPosted: Thu Dec 27, 2012 11:05 am    Post subject: X window screen DPI and font size Reply with quote

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
Back to top
View user's profile Send private message
gerard27
Advocate
Advocate


Joined: 04 Jan 2004
Posts: 2377
Location: Netherlands

PostPosted: Thu Dec 27, 2012 1:49 pm    Post subject: Reply with quote

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:
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
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Dec 27, 2012 2:00 pm    Post subject: Re: X window screen DPI and font size Reply with quote

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
Back to top
View user's profile Send private message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 175

PostPosted: Thu Dec 27, 2012 2:01 pm    Post subject: Reply with quote

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:
Option "DPI" "96x96"
- which by the way I can't - but then I have wrong scaling, or I set
Code:
Option "DPI" "129x129"
, but then I have huge GUI fonts.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Dec 27, 2012 2:07 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 175

PostPosted: Thu Dec 27, 2012 2:12 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Dec 27, 2012 9:08 pm    Post subject: Reply with quote

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:
Quote:
if both resolution values are zero, they are set to 72dpi.


I suggest asking on the freetype mailing list.
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2508
Location: Silver City, NM

PostPosted: Fri Dec 28, 2012 9:14 pm    Post subject: Reply with quote

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:
Quote:
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.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Dec 28, 2012 9:45 pm    Post subject: Re: X window screen DPI and font size Reply with quote

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.
Back to top
View user's profile Send private message
Jimmy Jazz
Guru
Guru


Joined: 04 Oct 2004
Posts: 325
Location: Strasbourg

PostPosted: Fri Dec 28, 2012 10:06 pm    Post subject: Re: X window screen DPI and font size Reply with quote

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:

+----+----+----+
|    |::::|    |
|    |::::|    |
+----+----+----+

motto: WeLCRO
WritE Less Code, Repeat Often
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Dec 29, 2012 4:17 am    Post subject: Re: X window screen DPI and font size Reply with quote

Jimmy Jazz wrote:
Have you tried the media-libs/fontconfig-infinality package ?

Yes, of course. This is about freetype, not fontconfig.
Back to top
View user's profile Send private message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Sun Dec 30, 2012 12:40 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Dec 30, 2012 2:01 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum