[mythtv-users] Merge of OSD and Main themes causes WAF to Plummet

Michael T. Dean mtdean at thirdcontact.com
Mon Feb 28 18:13:21 UTC 2011

On 02/28/2011 10:12 AM, Dan Armbrust wrote:
> Personally, I think the inability to change font sizes without editing
> a theme is about the most stupid design decision myth has made in
> quite a while.

Here's why you can't do it:

cd &&
rm -rf ~mythtv/.mythtv/themes/Terra &&
rm -rf ~mythtv/.mythtv/themes/BigTerra &&
mkdir ~mythtv/.mythtv/themes/BigTerra &&
if [ -d /usr/share/mythtv/themes/Terra ]; then
   cd /usr/share/mythtv/themes/Terra
elif [ -d /usr/local/share/mythtv/themes/Terra ]; then
   cd /usr/local/share/mythtv/themes/Terra
fi &&
find . -print0 | cpio -dpmv0 ~mythtv/.mythtv/themes/BigTerra &&
cd ~mythtv/.mythtv/themes/BigTerra &&
mv base.xml{,-orig} &&
mv osd.xml{,-orig} &&
perl -w -e 'my $scale = 1.5; my ($size, $newsize); while (<STDIN>) { if 
(m#^(\s+)\<pixelsize\>(\d+)\</pixelsize\>#) { $size = $2; $newsize = 
($size * $scale); printf (STDERR "Changing font size from $size to 
%d\n", $newsize); printf ("$1<pixelsize>%d</pixelsize>\n", $newsize); } 
else { print $_; } }' < base.xml-orig > base.xml &&
perl -w -e 'my $scale = 1.5; my ($size, $newsize); while (<STDIN>) { if 
(m#^(\s+)\<pixelsize\>(\d+)\</pixelsize\>#) { $size = $2; $newsize = 
($size * $scale); printf (STDERR "Changing font size from $size to 
%d\n", $newsize); printf ("$1<pixelsize>%d</pixelsize>\n", $newsize); } 
else { print $_; } }' < osd.xml-orig > osd.xml

Now start up mythfrontend, and notice how none of the text fits in the 
spaces it was given.

mythfrontend -O Theme=BigTerra

If you want to use the theme as is where none of the text fits, feel 
free.  Or, feel free to change the value of $scale (to 1.25 or 1.75 or 2 
or ...) and see how much of an effect it has.  But if you use it with 
the wrong font sizes, please don't ever submit any tickets/bug reports 
about text not fitting.  (And this is why we won't provide a setting 
that lets users increase the font size--because it /does/ break the 
theme layout, which would result in bug reports for things we can't fix.)

Most importantly, notice just how /few/ changes were made--few enough 
that someone could easily do it manually.  In total, 6 font definitions 
were changed in base.xml and 2 in osd.xml.  Almost all of the above 
commands were simply done to prevent you from breaking your real Terra 
theme, so the process looks much more difficult than it really is (it's 
as simple as opening base.xml and osd.xml in your favorite text editor 
and changing the pixelsize values--or for some themes, the size 
values--for fontdef elements).

(Now if you want to do it right, start going through and adjusting the 
size of all the areas where text is placed so that the text fits with 
the new, larger fonts.  When finished, you'll have spent a great deal of 
time on the project, and have a totally different theme from the one you 
started editing.)

Note, also, how all those programs that /do/ allow you to change font 
sizes have much simpler UIs than MythTV does.  We have text elements 
spread all around the screen with specified widths and heights and that 
must line up with graphical elements.  Now, imagine a DVD menu.  It does 
the same thing--aligns "text" elements (really, they're images) with 
graphical elements (items in the video image).  Imagine, now, if you 
changed the "font size" of the "text" for the DVD menu.  None of the 
menu items would line up properly with the image on which they're 
overlaid.  This is the same problem MythTV is facing.  There's really 
nothing we can do about it.  Therefore, if you want bigger fonts, you 
have 2 options:  1) use a different theme or 2) get a (physically) 
larger display.

Now, please, no one should respond to this thread with any complaints 
about font size being hard to change until they've done the above and 
/seen/ the effects of changing fonts without changing the associated 
text areas.


More information about the mythtv-users mailing list