Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide
translations



Rockbox mail archive

Subject: Re: fredwbauer: r30826 - in trunk: apps apps/gui firmware firmware/export

Re: fredwbauer: r30826 - in trunk: apps apps/gui firmware firmware/export

From: Jonathan Gordon <jdgordy_at_gmail.com>
Date: Tue, 25 Oct 2011 19:57:34 +1100

On 25 October 2011 19:49, Thomas Martitz <kugel_at_rockbox.org> wrote:
> Am 25.10.2011 09:36, schrieb Jonathan Gordon:
>>>
>>> One question about the patch though: Why separate setfont() and
>>> setuifont()?
>>> I imagine one could be sufficient, but perhaps I'm missing something.
>>>
>>> Best regards.
>>>
>> There are a few issues here:
>> The biggest issue is that the lcd API is full of 10 years of
>> evolution. First the multiscreen api came in, and then viewports, both
>> adding different bits of cruft. (not necessarily bad cruft). lcd_*
>> functions *mostly* work on the current viewport (lcd_setfont()
>> included), and some work on a specific viewport, and others work on
>> the actual display as a whole.
>>
>> lcd_setfont() changes the current viewports font number. Should this
>> be removed completly? The *only* time the caller doesnt have access to
>> the viewport struct is with the default viewport (which we are trying
>> to slowly get away from, and this should only happen in plugins now,
>> so no, we cant remove it just yet).
>>
>> screen_access->setfont() is a wrapper for lcd_setfont() to make sure
>> FONT_UI gets set correctly. screen_access->setuifont() does not call
>> lcd_setfont() and only sets global_settings.font_ui[screen].
>> screen_acces->getuifont() just returns the
>> global_settings.font_ui[screen] value (and there is no lcd_getfont()).
>>
>
> Okay, I understand the difference. But why does there need to be one? In
> your patch you call them both most of the time.
>
> I understand setfont() sets the current (i.e. default vp) font, and
> setuifont() sets the id which was previously constant (FONT_UI). FONT_UI is
> the alias for the screen's default font which is in fact simply the font of
> the default vp.
> So, from my understanding you want to do both calls at the same time. Unless
> there is a reason to separate these steps which I'm missing, I suggest the
> behavior to be merged in setfont().
>
> Best regards.
>

setuifont() should only be called when actually loading a new font
from disk. I didnt really want to add it at all so its just there for
more completeness.
Received on 2011-10-25

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy