[mythtv-users] MythArchive - blank title text

Michael T. Dean mtdean at thirdcontact.com
Sat Jul 14 23:45:45 UTC 2007


On 07/14/2007 01:56 PM, Paul Harrison wrote:
> If you are confident the new fonts are correct

Yes (at least from an "as the artist seems to have intended"
standpoint).  I can try to get in touch with Primoz Peterlin (maintainer
of the FreeFont package) and see if it is truly as he intended or see if
he'd be willing to change it for his next release.

>  and consistent with the
> way other fonts would work

This isn't so much true.  With Bitstream Vera, you'd get height values
similar to the old FreeSans height.  It seems to also ignore
superscript/subscript placement when providing a font-level height value.

>  then I suggest we keep them as they are and I
> will somehow work around the problem in MythArchive.
>   

Replacing FreeFont fonts with another license-compatible font may be the
"easiest" fix that doesn't involve custom font modifications.  I don't
know how the Bitstream Vera license would mix with Myth's GPL, though,
and don't know of any GPL'ed fonts other than FreeFont, so this may not
be possible.

> It would be nice to get this fixed in PIL but I don't think its being
> actively developed any more, there hasn't been any updates in quite a
> while.

That may be why most people who seem to encounter similar issues on the
'net seem to resort to switching to aggdraw.

>  In any case it would be months before the changes filter down
> into all the distributions.
>
> Moving and resizing the text boxes would be the easiest solution but
> isn't ideal because it means having to have some of them overlapping
> each other and if a user where to use another font it would probably
> require changing them all again so things line up properly. Also PIL
> doesn't have any way to draw multi line text so MythArchive has to split
> the text up into lines and draw each line individually. It uses the text
> height returned by textsize() to position the text which worked quite
> well with the old font but the spacing is going to be to big with the
> new font. I'd probably have to calculate the line spacing based on the
> font size + a fixed % or something like that.
>   

That would definitely be a very font-dependent design, so I agree it's
not ideal.

> Another alternative would be to find a way to get the actual text size
> not including these extra areas above and below the text. That would
> allow the script to position the text exactly where the theme files want
> for all fonts.
>   

That's easy to do with FreeType.  PIL just doesn't seem to have made the
glyph height available to Python, yet.  If you have any ideas for how we
could get from FreeType to Python, I might be able to help.

Also, Myth has support for FreeType for the OSD's, etc., so I don't know
if it would be possible to make some interface between the Python and
C++ code (I think PIL also has some support for QT pixmap format, but
perhaps only in the newest version or so).  This may also have the
advantage of allowing for reuse of the fonts/glyphs through Gregg's
up-and-coming generic cache.  (But I have to admit I know nothing about
the ease of interfacing the two.)

Mike


More information about the mythtv-users mailing list