Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: font-patch against AIO0804



Carsten Koch wrote:
> 
> Hi Alessio,
> 
> I'm using vdr 1.0.4 with the latest AIO including your font patch.
> I noticed that the characters in a highlighted rectangle (such as
> a highlighted line or the 4 color rectangles at the bottom) seem to
> be placed asymmetrically in the vertical direction.
> As an example, a '/' character looks like
> this:   +-------+
>         |       |
>         |      *|
>         |     * |
>         |    *  |
>         |   *   |
>         |  *    |
>         | *     |
>         |*      |
>         |       |
>         |       |
>         |       |
>         |       |
>         +-------+
> 
> while I believe it should look more like
> this:   +-------+
>         |       |
>         |      *|
>         |     * |
>         |    *  |
>         |   *   |
>         |  *    |
>         | *     |
>         |*      |
>         |       |
>         +-------+
> Is it just my imagination or could the line spacing be reduced by one
> or more pixels, thereby allowing even more lines per screen?
> As an example, to me the main menu does look much more "spread out" in
> the vertical direction (more space between the lines) than without your patch.
> Could it be that still the old vertical spacing is used and your patch
> "only" allows for more characters per line and not for more lines per
> screen?

In short: the answer is yes.

The font size is hardcoded in dvbapi.h:

  enum { charWidth  = 12, // average character width
         lineHeight = 27  // smallest text height

Klaus, I believe this is something you forgot to change when you changed
from the firmware fonts, where such hardcoded constants were the best you
could do, to vdr's own fonts, where we really know the true font size.

As a quick experiment, I changed lineHeight from 27 to 22 and sure enough
the line spacing looks correct now and there is enough OSD memory for four
additional lines per screen! Of course, a proper fix would change lineHeight
from an enum to a member variable which is preset to something that has been
determined using cFont::Height.

Unfortunately, when I tested my quick modification further, I found another
problem: The calendar patch (which I really love!) seems to use a line height
that is even more hardcoded than the enum in dvbapi.h. ;-)
In other words: when I change lineHeight to anything other than 27, the
calendar patch starts displaying crazy garbage instead of the EPG overview.
I suppose that we have a situation here where three coincidents were piled
on top of each other and have now created something that is a bit hard to
untangle: 

1. Klaus forgot to change lineHeight from hardcoded to font-dependent when
   he introduced vdr's own fonts.
2. Alessio's small fonts created line spacing with a lot of unused space.
3. Gerald's calendar patch took advantage of that space to draw the boxes.
   (BTW: Does the calendar patch work right without the small font patch?
    I have not tested that, but I would guess that it does not)

I'd really like to help fix all that but I do not know where to start.
I guess the calendar patch does need some extra space between the lines.
But does that mean all other OSD screens must also have relatively large
gaps between the lines?

I believe one clean way of fixing this would be:

*  Change setup parameters OSDwidth and OSDheight from lines/columns to pixels.
*  Remove charWidth and lineHeight constants and calculate x/y positions
   based on the actual font's width and height.
*  For the calendar patch, create a special text display mode that 
   adds 2 to the font height to allow for the boxes and creates the
   corresponding (smaller) number of lines per screen.

Alessio, Gerald, Klaus, what do you say?
Should I just forget about the whole thing ("never touch a running system")?

Carsten.




Home | Main Index | Thread Index