[mythtv-users] OT: How to calculate displaysize
Michael T. Dean
mtdean at thirdcontact.com
Fri Sep 2 18:08:00 UTC 2005
Brian C. Huffman wrote:
>Discussion about mythtv <mythtv-users at mythtv.org> wrote:
>
>
>>2) You can calculate the appropriate "DisplaySize" based on the
>>resolution you're using:
>>
>>Given 1 inch = 25.4millimeters
>>DisplaySize is specified in millimeters
>>You're using a resolution of X x Y:
>>
>>DisplaySize should be set to the truncated integer value (note, you have
>>to do the math yourself, don't specify the equation in your X
>>configuration file):
>>
>>DisplaySize: ((X / 100) * 25.4) ((Y / 100) * 25.4)
>>
>>So, for 1024x768:
>>
>>1024 / 100 = 10.24 * 25.4 = 260.096 = 260
>>768 / 100 = 7.68 * 25.4 = 195.5072 = 195
>>
>>DisplaySize 260 195
>>
>>Some round instead of truncating. I've found that truncating gives best
>>results...
>>
>>
>This doesn't make sense to me (probably why I'm asking the question in the first
>place). You're calculating displaysize based on the resolution rather than the
>physical dimensions of the display.
>
Yep. (Keep reading...)
>The man page for xorg.conf says the following:
>
>DisplaySize width height
> This optional entry gives the width and height, in millimetres, of the
>picture area of the monitor. If given this is used to calculate the horizontal
>and vertical pitch (DPI) of the screen.
>
>If this option is calculated this way, the Xserver could do it by itself?
>
Only if the X server has access to that information. If you're using a
computer monitor (i.e. not a TV), it will almost definitely have access
to that information (which is why you don't typically specify
DisplaySize for your desktop system). If you're using an NTSC/PAL TV,
it almost definitely won't. If you're using an "HDTV monitor" it may or
may not depending on which output you're using (i.e. will with VGA/DVI,
won't with Composite). If you're using a converter box (i.e. VGA->NTSC
or VGA->Component or something) it almost definitely won't.
>Honestly, logic would tell me to get out a tape rule and measure my TV, but
>obviously the information that I'm reading is telling me something different.
>Still confused. :-(
>
>
That would work if you want your fonts to display at the appropriate
sizes for your DisplaySize--as if it were being used as a computer
monitor 2 feet in front of the user. Since most people watch TV from
farther away than 2 feet (i.e. at least 5 to 10 feet), the calculated
(or measured) DisplaySize isn't appropriate--fonts will be unreadably
small.
Also, the whole reason it's important to specify exactly
100dpi--regardless of your actual DisplaySize--is because Myth themes
were designed to use 100dpi. To design the themes, it was critical to
have a way to convert dimenstions between font sizes (i.e. "points" =
1/72 inch) and pixels so that graphic images (which use pixels) line up
with text. Since position information is specified in the themes at
pixel locations--and not calculated dynamically at runtime by Myth--we
have to pick one DPI setting to use. The actual value is unimportant;
however, there can be only one value to ensure all themes line up
properly. The value that was chosen is 100dpi.
So why didn't the Myth devs choose a DPI setting that was more "natural"
and use huge font sizes so you could read the text from 5-10 feet away?
If they had done this, then those who do use their monitors that are 2
feet away from them for watching TV with Myth would find the fonts way
too large. For example, I set my DisplaySize on my Myth box to 100dpi
and output to my TV, but I also use X redisplay to change frontend
settings/etc. sometime and I know some people actually install MythTV on
their desktops to watch TV. With the font-sizes that are used in the
themes, fonts look good on my 27in TV from 5 feet away and in a window
on my 19in monitor from 2 feet away...
All in all, I'd say JDS (and everyone else involved in thinking this
stuff through) did an excellent job of making it work everywhere for
everyone. :) (At least, it works for everyone who configures their
system appropriately.)
Note that many people find that they don't like their font sizes when
using 100dpi, so they go back and change their DisplaySize until they
get the font size they want. The right way to do this is to a) make
sure you have the requested font installed (as the X font server will
give a "close-enough" font if the requested font doesn't exist, and the
given font metrics may not be anything like the requested font in real
life) and b) modify the ui.xml for your theme to specify the desired
font sizes (and/or font names).
Mike
More information about the mythtv-users
mailing list