Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#4733 - Multifont

Attached to Project: Rockbox
Opened by Ben Keroack (bk) - Sunday, 26 February 2006, 02:46 GMT+1
Last edited by Paul Louden (Llorean) - Thursday, 02 October 2008, 23:02 GMT+1
Task Type Patches
Category Applications
Status Closed
Assigned To No-one
Player type All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

This is a preliminary test version of multifont support (v01) as a diff against current CVS HEAD. This allows for multiple fonts to be loaded and used non-simultaneously with 3-5 defined contexts depending upon target.

Fonts are specified in the theme .cfg with the following tags: browserfont, wpsfont, menufont, tunerfont, recordfont. The old "font" tag is ignored. A font selected through General Settings->Display->Browse Fonts override all current theme settings, emulating the old behavior. Plugins use sysfont.

NOTE: Recording screen drawing is currently somewhat broken. Actual recording should be unaffected.
This task depends upon

Closed by  Paul Louden (Llorean)
Thursday, 02 October 2008, 23:02 GMT+1
Reason for closing:  Later
Additional comments about closing:  This task is no longer attempting to address getting Multifont in a state for inclusion. The idea of displaying multiple fonts is good, but this implementation is not progressing. If someone wishes to fix this patch to work, or start a new one, come to IRC or the -dev mailing list and it can be reopened for you, and the hurdles remaining discussed.
Comment by Paul van der Heu (paulheu) - Thursday, 16 March 2006, 14:04 GMT+1
You should add remotefont to that list IMO..
Comment by Paul van der Heu (paulheu) - Sunday, 19 March 2006, 10:42 GMT+1
I ran into a problem which is probably related to this patch; when in settings the font will always switch to SYSFONT when displaying/changing settings. when you backup to the settings menu or exit the set font is used again..
Comment by Ben Keroack (bk) - Sunday, 19 March 2006, 18:46 GMT+1
Are you using the status bar? The patch posted here doesn't deal properly with status bar font settings and so can corrupt certain screens with SYSFONT.
Comment by Ben Keroack (bk) - Tuesday, 04 April 2006, 00:01 GMT+1
Now with summer coming along in the northern hemisphere I'll not have as much time to work on this (and it works pretty well for me in my private builds that there's less motivation to get the mergable version out the door).

Attached is an updated patch that should apply cleanly against today's CVS. It includes 45k font buffers, bumped config version and a small convbdf fix.

Here's a rough TODO list for multifont-2.0 which may or may not be ready for 3.1:

* Font cache overhaul
- Unified font cache buffer
- LRU/cache code allows variable-length entry data payloads (for use w/ mixed fonts)
- Make sure not to break unicode or non-Western codepages
* UI
- GUI font choosers for each font type
- Stop ignoring the old "font:" cfg tag, make it work as before
- Fix the FONT_PLUGIN stuff so that plugins consistently use the plugin font
* Other
- Implement an optional remotefont, figure out if a GUI chooser is workable for this
Comment by P.I.Julius (pijulius) - Tuesday, 29 August 2006, 20:57 GMT+1
Here it is my sync for the latest cvs ver, please note that I didn't tested it fully but it seems to work pretty well, at least for me.
Comment by P.I.Julius (pijulius) - Friday, 29 September 2006, 14:28 GMT+1
Sync again
Comment by P.I.Julius (pijulius) - Saturday, 30 September 2006, 13:27 GMT+1
Fix the theme loader so if you load a theme with only "font" declaration in the .cfg file all the custom fonts will be set to that one, this way you can use the new themes which support different fonts for list/menus/wps and old themes which only have the "font" declaration in their config file.
Comment by Max Weninger (maxwen) - Saturday, 30 September 2006, 13:32 GMT+1
Just tried to post the same fix :-)
You are to fast for me
Comment by Max Weninger (maxwen) - Tuesday, 31 October 2006, 02:01 GMT+1
Since the config space becomes to small if you use many fonts
I changed the settings storage format of all fonts.

Instead of always allocating MAX_FILENAME and wasting space
the fonts are stored in the following format

%02d:%s e.g. 07:helvR14 which is <length>:<font>

This saves in this example 10 bytes for a font
I also added reseting all fonts if a theme is loaded

This requires the mutlifont patch
Comment by Max Weninger (maxwen) - Monday, 13 November 2006, 02:39 GMT+1
Found a bug in the my last patch if font file name has exactly the
now maximum allowed length of 17 chars
Comment by Billy (ipodfoo) - Saturday, 16 December 2006, 18:47 GMT+1
Seem to have a problem with the text viewer (viewer.c) (See attached pic).The text seems spaced at 8 pixels for some reason. Im not 100% sure which patch causes it, I use:

custom display width (#5898),
multifont (#4733),
multiple user fonts (#5901),
custom list menu (#5899)
custom line (#5900)

Text is fine in the menu of the plugin.
Comment by Billy (ipodfoo) - Saturday, 16 December 2006, 19:06 GMT+1
Forgot to mention. Text gets clipped only on the right side of ALL plugins (including the viewer.c). (See pic for examples.)
Comment by Billy (ipodfoo) - Sunday, 17 December 2006, 17:51 GMT+1
Hi. Did some updates to my build. Seems the spacing issue in viewer.c is solved now but the clipping still occurs on the right side.
Comment by Billy (ipodfoo) - Sunday, 17 December 2006, 20:39 GMT+1
By the way, seems the squished text happens in the sim but not on the actual player.
Comment by Max Weninger (maxwen) - Sunday, 28 January 2007, 17:06 GMT+1
first try of supporting the new settings code
tried to keep it backward compatible with old themes
by supporting single font themes and multifont themes
Comment by Max Weninger (maxwen) - Sunday, 28 January 2007, 17:43 GMT+1
same for the userfonts patch
Comment by Max Weninger (maxwen) - Sunday, 28 January 2007, 18:02 GMT+1
oops tunerfont was stored wrong
Comment by Max Weninger (maxwen) - Sunday, 28 January 2007, 18:11 GMT+1
forgot to include the changes needed in settings_list.c
Comment by Flake (Flake) - Thursday, 01 February 2007, 04:01 GMT+1
can anybody adapt multifont patch for the current code, please
with the build date it for
Comment by Robert Cotey (coteyr) - Monday, 05 February 2007, 05:47 GMT+1
I think the 20070126 patch is a bit off. It looks like it expects another patch to be present. For instance

--- rockbox_svn.orig/apps/filetree.c
+++ rockbox_svn/apps/filetree.c
@@ -528,7 +528,7 @@ int ft_enter(struct tree_context* c)
font_load(buf, FONT_RECORD);
set_file(buf, (char *)global_settings.recordfont, MAX_FILENAME);
#endif
-
+ /* dont set userfonts because of the buffer problem */
break;

case TREE_ATTR_KBD:

looks for FONT_RECORD but that shouldn't exist yet?
perhaps I am applying the patch incorectly.

Comment by Max Weninger (maxwen) - Monday, 05 February 2007, 11:52 GMT+1
multifont-userfonts require multifont to be applied first
Comment by Mads Michelsen (madsic) - Thursday, 22 February 2007, 04:54 GMT+1
I tried patching using the 20070131 source using first customdisplaywidth (20070116) and then multifont (20070128) (and then onto mf-uf etc.). I can get every other julius patch to work (more or less) but multifont is giving rejects in five different files and (I suspect) is ultimately the cause of several errors. I would try with the source from the 28th if it wasn't five in the morning.... I have also tried manually inserting the rejects which seemed doable but as I said the end result doesn't hold up.
Comment by Max Weninger (maxwen) - Sunday, 11 March 2007, 07:59 GMT+1
Quick and dirty sync for 20070310
Comment by Max Weninger (maxwen) - Sunday, 11 March 2007, 07:59 GMT+1
same for userfonts
Comment by Hepdog (007quick) - Thursday, 15 March 2007, 21:00 GMT+1
Does not patch correctly anymore, needs a sync to svn!
Comment by Max Weninger (maxwen) - Tuesday, 20 March 2007, 08:43 GMT+1
sync against 20070320
Comment by Hepdog (007quick) - Wednesday, 21 March 2007, 18:04 GMT+1
Question, Which patches do I need in order to get this to work! A list would be great. I am trying to patch this with no succes!
Comment by Hepdog (007quick) - Monday, 26 March 2007, 19:48 GMT+1
Needs a sync again! I think some files are missing now!
Comment by Travis Tooke (tdtooke) - Sunday, 01 April 2007, 09:30 GMT+1
I have a quick question. I check out an older revision so I can use these most excellent patches and on the multifont-userfonts patch I always get a malformed patch error for the very first section of that patch. Looking at it it seems to me that all that part does is add the comment "/* dont set userfonts because of the buffer problem */". Is that correct? I work around this problem by just removing that section from the patch and everything works out fine. Since I don't see anyone else mentioning this happening I will assume I'm somehow doing something wrong. Thoughts?
Comment by Max Weninger (maxwen) - Sunday, 01 April 2007, 10:18 GMT+1
correct
Comment by Travis Tooke (tdtooke) - Sunday, 01 April 2007, 23:08 GMT+1
Not to be a nag, but.. Is that correct as in my assumption that the first section just adds that comment, or correct as in I'm doing something wrong?
Comment by Flake (Flake) - Friday, 06 April 2007, 01:20 GMT+1
need a sync please
Comment by TheKind (TheKind) - Saturday, 21 April 2007, 10:25 GMT+1
The WPS code is definitely different than before.
Maybe a good coder could try to upadte this patch ?
Comment by Max Weninger (maxwen) - Thursday, 10 May 2007, 07:53 GMT+1
synced against 20070430
Comment by danny (sldonmtns) - Sunday, 13 May 2007, 01:25 GMT+1
I'm not able to apply the userfonts patch. I think it may be because the patch points towards rockbox_svn. Also, is this patch still needed, or do you just need the mutifont patch now?
Comment by Max Weninger (maxwen) - Sunday, 13 May 2007, 23:07 GMT+1
Use the correct -p<num> (-p1 should do it) option to patch to strip the rockbox_svn prefix
And you need the userfonts patch only if you want to use the customline patch
Comment by Max Weninger (maxwen) - Tuesday, 15 May 2007, 10:56 GMT+1
synced
Comment by Josh Drizin (krazykit) - Monday, 04 June 2007, 19:26 GMT+1
this no longer patches cleanly. It fails on recent svn:

firmware/drivers/lcd-remote-2bit-vi.c
apps/plugins/chessbox/chessbox.c
Comment by Max Weninger (maxwen) - Friday, 22 June 2007, 16:09 GMT+1
synced
Comment by Travis Tooke (tdtooke) - Monday, 02 July 2007, 04:20 GMT+1
synced again
Comment by Matthew Schneider (mschneider) - Monday, 02 July 2007, 21:22 GMT+1
Just a quick question:
Why is it that the userfonts patch never has to be synced? Is it just that it's dependent on the multifont patch?
Comment by Travis Tooke (tdtooke) - Monday, 02 July 2007, 23:54 GMT+1
I think that's probably it; it does seem odd though it never needing a sync.
Comment by Max Weninger (maxwen) - Tuesday, 03 July 2007, 12:13 GMT+1
Yes fortunately the code around the multifont-userfonts patch has not changed for some time :)
Maybe we should merge the two patches
Comment by Nick Brackley (darksaboteur) - Wednesday, 11 July 2007, 13:11 GMT+1
Merge sounds good. Multifont needs a sync
Comment by Travis Tooke (tdtooke) - Friday, 13 July 2007, 12:10 GMT+1
What patches are you using in order Nick? This still patches for me. Here's a merged patch:
Comment by Nick Brackley (darksaboteur) - Friday, 13 July 2007, 13:15 GMT+1
i just tried to apply your patch to the newest SVN source and got
patching file rockbox_svn/firmware/drivers/lcd-remote-2bit-vi.c
Reversed (or previously applied) patch detected! Assume -R? [n]

any ideas?
Comment by Travis Tooke (tdtooke) - Friday, 13 July 2007, 20:26 GMT+1
I believe you're missing scroll-margins Nick, this patch depends on it. The sync I did before would work with the scroll-margins from the tracker and Max's, I'm pretty sure this one will too since the involved code hasn't changed since then. The exact order I apply my patches is ymargin_scrollinfo, Max's scroll-margins(if you use ymargin_scrollinfo this is the one you need), album art, bmpresize, and then multifont_complete.
Comment by Nick Brackley (darksaboteur) - Saturday, 14 July 2007, 04:29 GMT+1
I applied the patches in that order and now i get:
patching file apps/gui/gwps-common.c
Reversed (or previously applied) patch detected! Assume -R? [n]

Here are the patches i applied in order with their flyspray numbers (just to check that i applied the right ones)
6796(ymargin) --> 2954(scroll_margin) --> 3045(album art) --> 5697(bmp resize) --> multifont

Thank you so much for your help so far, it is very appreciated :)
Comment by Travis Tooke (tdtooke) - Sunday, 15 July 2007, 01:24 GMT+1
I can't duplicate that error on my end Nick. I was thinking that maybe the problem was that you were using scroll-margins from the tracker(you need Max's version if you use ymargin_scrollinfo) with ymargin but when I tried it that way it still applied cleanly. The only thing I can suggest is for you to completely erase all your source code and redownload it from svn. It's possible that somewhere along the line something was added from previous patches that you weren't able to remove with -R since the patch failed(just guessing at this point).
Comment by Nick Brackley (darksaboteur) - Sunday, 15 July 2007, 16:24 GMT+1
The problem appears to have fixed itself :) I updated to latest SVN (i was only a couple of revisions behind) and it has all patched and compiled successfully. Thank you for your help :D
Comment by Travis Tooke (tdtooke) - Thursday, 19 July 2007, 02:24 GMT+1
Small update, removed display->setfont(FONT_UI); from gui_quickscreen_draw in apps/gui/quickscreen.c. This fixes the bug where the font changes upon changing anything in the quickscreen or simply exiting back into the WPS.
Comment by Nick Brackley (darksaboteur) - Thursday, 19 July 2007, 08:40 GMT+1
New patch fails to apply with:

patching file firmware/export/lcd.h.orig
Hunk #2 FAILED at 395.
1 out of 2 hunks FAILED -- saving rejects to file firmware/export/lcd.h.orig.rej

Just to check that its not an error at my end, where can I get Max's scroll-margins from?
Thanks again, Nick
Comment by Travis Tooke (tdtooke) - Thursday, 19 July 2007, 08:51 GMT+1
You can get it from http://rockbox.webhop.org/ under Builds based on SVN repository from 20070622. You should bookmark that page, Maxland always has the best goodies :)
Comment by Travis Tooke (tdtooke) - Thursday, 19 July 2007, 08:54 GMT+1
Oh, btw, it's not absolutely necessary for you to use ymargin_scrollinfo, and Max's scrolling-margins. I personally recommend that because putting ymargin into the scrollinfo struct just makes sense to me, but if you're having problems with that you can not use ymargin_scrollinfo and just use scrolling-margins from the tracker.
Comment by Nick Brackley (darksaboteur) - Thursday, 19 July 2007, 08:56 GMT+1
I will look at that thank you.
My concern was that it is failing on a .orig file which to my knowledge should be unaffected by patches, when looking at the code it seems "int y_margin". As in my opinion it would be best if either Max's or the trackers patch could be used and by the looks of it, it shouldn't be too hard to fix. If I'm completly wrong here please let me know so I can stop pestering people....
Comment by Travis Tooke (tdtooke) - Thursday, 19 July 2007, 09:08 GMT+1
Major oops on my part Nick. I was very sloppy, it shouldn't be trying to do anything with .orig files. Don't worry about that hunk failure .orig files are just there for reference and aren't actually used for anything. I'll get a clean version up as soon as possible.
Comment by Travis Tooke (tdtooke) - Thursday, 19 July 2007, 09:19 GMT+1
clean version that doesn't do silly things like patch .orig files.
Comment by Nick Brackley (darksaboteur) - Thursday, 19 July 2007, 09:22 GMT+1
Patch applies cleanly :)
Thanks for the quick fix Travis
Comment by Max Weninger (maxwen) - Thursday, 19 July 2007, 10:06 GMT+1
> Small update, removed display->setfont(FONT_UI); from gui_quickscreen_draw in apps/gui/quickscreen.c.
> This fixes the bug where the font changes upon changing anything in the quickscreen or simply exiting back into the WPS.

thanks! :-)
Comment by Max Weninger (maxwen) - Thursday, 19 July 2007, 10:31 GMT+1
sorry about the scroll_margins confusion. I know its bad style to post patches that depend on
others that are not in the tracker. I started my own scroll_margins patch long time ago
because the original version hat so many problems and failed to sync it with the version in the tracker
Comment by Nick Brackley (darksaboteur) - Saturday, 21 July 2007, 08:09 GMT+1
Fails On SVN 13948
patching file apps/plugins/rockpaint.c
Hunk #6 FAILED at 933.
1 out of 11 hunks FAILED -- saving rejects to file apps/plugins/rockpaint.c.rej

Sync Please :)
Comment by Travis Tooke (tdtooke) - Sunday, 22 July 2007, 06:56 GMT+1
not really a sync, just changed one line in the patch so that hunk wouldn't fail.
Comment by Nick Brackley (darksaboteur) - Monday, 23 July 2007, 07:36 GMT+1
Looking through the patch I found that it modifies screen.c.orig, am I ok to remove this?
Comment by Travis Tooke (tdtooke) - Tuesday, 24 July 2007, 05:16 GMT+1
Yes, looking at the patch I'm not finding it trying to do that so I can only assume that's some strange side effect from me just manually editing it instead of doing a fresh diff.
Comment by Travis Tooke (tdtooke) - Wednesday, 25 July 2007, 06:23 GMT+1
proper resync
Comment by Anonymous Submitter - Friday, 31 August 2007, 19:53 GMT+1
I can't apply the patch to a untouched svn (as of yesterday). Can someone fix/resync it? I can't do that, I don't have the knowledge of the programming languages used in RB. Thanks
Comment by Travis Tooke (tdtooke) - Saturday, 01 September 2007, 13:38 GMT+1
sync
Comment by Anonymous Submitter - Saturday, 22 September 2007, 22:17 GMT+1
This needs a sync, due to the changes made in apps/screen_access.c.
Comment by Travis Tooke (tdtooke) - Sunday, 23 September 2007, 21:02 GMT+1
sync
Comment by Travis Tooke (tdtooke) - Sunday, 30 September 2007, 05:04 GMT+1
@maxwen, There is a theme in development in the forums that is a mockup of a zune theme that has this weird problem. Occasionally the font color of the menu will take on one of the userfonts from the WPS. I just started looking into this myself, but I thought I'd mention it to you since you're "the pro" here so to speak and would definitely know more about this sort of thing than I would.
Comment by Travis Tooke (tdtooke) - Sunday, 30 September 2007, 08:17 GMT+1
It's looking like this is in customline instead. It seems that only scrolling customlines can do this. I'm tinkering around in lcd-16.c with the way fgcolor is handled to see what I can do.
Comment by Travis Tooke (tdtooke) - Sunday, 30 September 2007, 16:54 GMT+1
Nope, it's multifont. I added "gui_list->display->set_foreground(global_settings.fg_color);" to case GUI_LIST_CONTEXT_MENU and case GUI_LIST_CONTEXT_BRWSR in list.c. This seems to fix that, but I cannot stress enough that: I'm completely open to suggestions for a better way of doing this though.
Comment by Thomas Martitz (kugel.) - Monday, 01 October 2007, 17:05 GMT+1
What does it fix? The fonts get messed up when going from wps context menu back to wps?

Did you monologize? You seemed to talk to someone, but here are only posts from you :O
Comment by Travis Tooke (tdtooke) - Tuesday, 02 October 2007, 00:32 GMT+1
I very well may be monologin', but I was aiming all of that at Max (he's forgotten more about multifont than I will every know). There is a theme under development that is a mockup of a zune theme in the forums that had a bug where if you hit menu to escape out of the WPS and go to the menu the font color there would be the font color of one of the customlines from the WPS instead of the default color set by the themes .cfg file. This fixed that. Technically this bug shouldn't have happened, but lately for whatever reason iPods have been very sensitive about this sortof thing with these patches. If you don't have an iPod or never used a theme with noticeably different colors in the WPS then you probably never saw this bug.
Comment by Thomas Martitz (kugel.) - Tuesday, 02 October 2007, 00:43 GMT+1
Ok, no I never noticed that bug, I neither own an iPod nor I used that particular theme.

AnywayCan the bug I addressed be fixed?
Comment by Travis Tooke (tdtooke) - Tuesday, 02 October 2007, 02:00 GMT+1
I'd be more than happy to look at any problem you may be having with this patch, but after scrolling up on this page I can't seem to find a post by you saying what that problem is.
Comment by Thomas Martitz (kugel.) - Tuesday, 02 October 2007, 02:17 GMT+1
I have no problem except this one. But this is a common problem, many (if not all) people are having this.

Note: I can only speak for e200, it might be, that this is only present on the e200.

Basically, when you have set a different menufont and wpsfont this problem occurs: When you go from wps to the wps' context menu, the font changes properly (i.e. snap to nimbus), but when you go back from that context menu(or ay submenu) to the wps by pressing play, the font does not change. It remains the menufont, messing the wps up. Only way to get around is to visit the main menu shortly.
Comment by Travis Tooke (tdtooke) - Tuesday, 02 October 2007, 03:11 GMT+1
I was unaware of that, basically all of the themes that I use with multifont also use customline and customline has a switch case statement setting the userfont that makes that impossible so I never saw this bug. I'm on it, with luck I'll have an updated version up tonight fixing that along with another customline patch which hopefully will kill the last of it's bugs (crossing fingers).
Comment by Travis Tooke (tdtooke) - Tuesday, 02 October 2007, 04:56 GMT+1
This should fix that, got tired of writing out multifont_complete all the time so I'm just calling this one multifont.
Comment by Thomas Martitz (kugel.) - Tuesday, 02 October 2007, 09:34 GMT+1
Cool Thanks.

Just a note: I use custom line as well, however I have this bug. Maybe the problem is caused by custom line?

Anyway, thanks for your effort. I'm gonna test the patch as soon as I get home.
Comment by Thomas Martitz (kugel.) - Tuesday, 02 October 2007, 21:44 GMT+1
sync
Comment by Thomas Martitz (kugel.) - Tuesday, 02 October 2007, 22:03 GMT+1
F**k that, I can't even copy and paste one single line.

Sorry, this is the real sync.

Note: I had to run in twice (normal, -R, normal again) to apply it as a single patch. No problems with album art, bmpresize, ymargin, scroll-margins and custom line applied before.
Comment by Thomas Martitz (kugel.) - Tuesday, 02 October 2007, 22:10 GMT+1
Uhh it doesn't compile. Just 1 line changed in SVN, and such a big impact ;;
Comment by Thomas Martitz (kugel.) - Tuesday, 02 October 2007, 22:28 GMT+1
You might not believe it. I failed at syncing again.

I begin to hate 1 line SVN changes...

Ok, this time it's deeply tested. It's applying and compiling.
Comment by Travis Tooke (tdtooke) - Wednesday, 03 October 2007, 00:57 GMT+1
Heh, I've made a hatchet job of syncing myself a few times ;) So is that bug gone now for you?
Comment by Thomas Martitz (kugel.) - Wednesday, 03 October 2007, 02:02 GMT+1
It seems to work, the sim doesn't have this bug with only multifont applied.

However, I can't test it in a full custom build with some other patches(including custom line), as ymargin doesn't work atm.

Good job anyway, thanks.
Comment by Travis Tooke (tdtooke) - Monday, 08 October 2007, 09:43 GMT+1
Sync, adds support for the new robotkitten plugin.
Comment by Victor Karpunin (kva) - Monday, 08 October 2007, 11:08 GMT+1
I have problems with multifont patch (version from multifont_complete-20070930.patch and later).
After loading simulator StatusBar is empty and then simulator fall. I found that problem with strings "gui_list->display->set_foreground(global_settings.fg_color);" in list.c. Simulator works without them.
Last I tested h3xx simulator with patches: album_art_20071001.patch, scroll-margins_20071006-2.patch, bmpresize-20070430.patch, multifont-20071002c.patch.
Comment by Victor Karpunin (kva) - Monday, 08 October 2007, 11:50 GMT+1
I have problems with multifont patch (version from multifont_complete-20070930.patch and later).
After loading simulator StatusBar is empty and then simulator fall. I found that problem with strings "gui_list->display->set_foreground(global_settings.fg_color);" in list.c. Simulator works without them.
Last I tested h3xx simulator with patches: album_art_20071001.patch, scroll-margins_20071006-2.patch, bmpresize-20070430.patch, multifont-20071002c.patch.
Comment by Travis Tooke (tdtooke) - Monday, 08 October 2007, 12:36 GMT+1
I could wrap those lines in some #ifndefs so you won't have them if you compile a simulator but I have to have those lines to fix a bug that iPods have.
Comment by Travis Tooke (tdtooke) - Friday, 12 October 2007, 05:26 GMT+1
Ok, this should fix you up kva. You won't have to remove those lines now. I believe this may fix some problems non-ipod targets have been having as well since I've added some things that address issues only iPods seem to have.
Comment by Travis Tooke (tdtooke) - Tuesday, 23 October 2007, 04:48 GMT+1
very slight revision.
Comment by Travis Tooke (tdtooke) - Tuesday, 23 October 2007, 16:17 GMT+1
update to go with my tentative slight rewrite of customline. If you have problems with this patch just revert to the old one and let me know.
Comment by Travis Tooke (tdtooke) - Wednesday, 24 October 2007, 07:48 GMT+1
fix warning, fix bug where the font color for the quickscreen can be one of the colors from the WPS. Also back to the old way of doing things since that slight rewrite of customline is not working as I'd hoped.
Comment by Travis Tooke (tdtooke) - Saturday, 27 October 2007, 05:42 GMT+1
Further work on the bug Thomas reported a while back where if a WPS was multifont but not customline the WPS would not display the proper font. While using this I noticed that going to the quickscreen and back to the WPS when the font reset there would be text artifacts left over. Hopefully this will fix that.
Comment by Konstanin (eK3eKyToPa) - Saturday, 10 November 2007, 12:22 GMT+1
Please resync the multifont patch, and for what need is the multifont-userfonts patch , is it included in the last releases of multifont patch ( if not please resync it too )
They gives some error when compiling, there is something about alarm clock , I dont understend it at all.
Comment by Travis Tooke (tdtooke) - Sunday, 11 November 2007, 04:31 GMT+1
sync, and yes, userfonts is included in this.
Comment by harry tu (bookshare) - Tuesday, 25 December 2007, 01:21 GMT+1
multifont needs a sync
Comment by Thomas Martitz (kugel.) - Sunday, 06 January 2008, 01:02 GMT+1
tdooke, before we start to adapt this to viewports, let me upload a synced and cleaned up version. Note that I heavily cleaned it up, as well as deleted 1 hunk (the one in tools/convbdf.c), because I couldn't figure out what it does.
Comment by Travis Tooke (tdtooke) - Sunday, 06 January 2008, 11:03 GMT+1
Ok, here is a rough draft which probably definitely needs improving, but it's a start. This patch now only has one dependency: Viewports http://www.rockbox.org/tracker/task/8385 With the userfonts if you want userfont1 you need to put a 2 for the font because 0 and 1 were used for FONT_SYSFIXED and FONT_UI the way parse_viewports was set up so now 2 through 8 are your userfonts in the wps code corresponding to userfonnts 1 through 7. I tested this out with rayboradio replacing the %e tags with:
%V|265|9|41|15|2|B5B5B5|000000|
%cl:%cM%cp
%V|135|52|175|15|4|F58105|000000|
%al%s%?ia<%ia|%?d2<%d2|>>
%V|135|71|175|15|2|B5B5B5|000000|
%al%s%?id<%id|%?d1<%d1|>>%?iy< (%iy)|>
%V|150|98|160|15|3|F58105|000000|
%al%s%?it<%it|%fn>
%V|135|117|175|15|2|B5B5B5|000000|
%alTrack %pp of %pe - %pc [%pt]
%V|135|135|175|15|2|B5B5B5|000000|
%s%al%?It<Next: %It|%?Fn<Next: %Fn|>>
%V|238|215|62|15|5|333333|000000|
%acVolume: %pv

and everything seemed to work, also I switched to cabbie_unifont to make sure regular themes worked and that worked as well so I think this is ready for you guys to test out.
Comment by Thomas Martitz (kugel.) - Sunday, 06 January 2008, 14:24 GMT+1
in rockbox_svn/tools/convbdf.c:
- if (sscanf(buf, "COPYRIGHT \"%[^\"]", copyright) != 1) {
+ if (sscanf(buf, "COPYRIGHT \"%s\"", copyright) != 1) {

Can you tell what this is for?
Also, sad that you didn't use my cleaned up version. You have so many trailing spaces and stuff.
Couldn't test yet.
Comment by Thomas Martitz (kugel.) - Sunday, 06 January 2008, 14:41 GMT+1
Don't you think it's time to combine GUI_LIST_CONTEXT_MENU and GUI_LIST_CONTEXT_BRWSR? I think it's a bit overkill to have both.

Note: I want to make this committable. The font-caching needs to be changed.
Comment by Dave Chapman (linuxstb) - Sunday, 06 January 2008, 15:19 GMT+1
I´ve only looked through this patch briefly, but it doesn´t appear to implement one of the most important uses for multifont in Rockbox - different fonts on the main LCD and remote LCD in the various screens. Is this possible with this patch?
Comment by Thomas Martitz (kugel.) - Sunday, 06 January 2008, 15:22 GMT+1
Why not? I think this would be great. I just imagine an extra setting in the themes settings menu, set remote font or something.
Comment by Travis Tooke (tdtooke) - Monday, 07 January 2008, 05:31 GMT+1
You can have different fonts on the main LCD as it is. Menufont, Browserfont, Pluginfont, WPSfont, Recorderfont, probably some others I can't think of as well. You'll be happy to know that I just updated with your cleaned up patch Thomas. I'll look into adding remote settings, right now this is just cleaned up per Thomas' patch with some other cleanups (me hunting down occurrences of FONT_UI where it shouldn't be).
Comment by Dave Chapman (linuxstb) - Monday, 07 January 2008, 09:15 GMT+1
I've been thinking a little about different ways to specify fonts, and I wonder what people think about the following:

Replace the screen-specific fonts with a list of fonts, and references to fonts in that list. i.e. the global settings (.cfg file) would contain a "font:" entry "font: fontname1,fontname2,fontname3" (to ensure that there are no missing fonts in the array, and to maintain compatibility with existing .cfg files), and then separate cfg entries specifying which fonts are used for each screen, such as "menufont: 1", "remote_menufont: 2" etc. (0 is reserved as the font number for the system font, so the user-defined fonts start at 1).

This would (I think) simplify the implementation - the core font code (in firmware/) wouldn't care what the fonts are being used for, it would just deal with a variable-sized array of fonts, and if the same font is used multiple times, it would only be loaded once. I think this would also make using a single font cache simpler.

All calls to, for example, display->set_font(FONT_BROWSER) would then be replaced with something like display->set_font(global_settings.font_browser), and the impact of adding a further place where a custom font can be used would just be an integer in the global settings, rather than a font filename.
Comment by Dave Chapman (linuxstb) - Monday, 07 January 2008, 09:30 GMT+1
Hmm, reading my comment again, it seems that lines such as "display->set_font(global_settings.font_browser)" won't work well - we want different fonts for different displays...

Although when the apps/ code is fully adapted to use viewports, the code probably won't need to call set_font any more - it can just specify the font directly in the viewport struct, and we would have separate viewport structs for each screen.
Comment by Travis Tooke (tdtooke) - Monday, 07 January 2008, 10:01 GMT+1
I suspect (since separate viewports did indeed solve all my customline woes) that would solve the one gnawing problem this patch has. For some odd reason switching from rayboradio to a non-multifont theme will cause weird behavior, however switching from literally any other multifont theme to a non-multifont one will not. It's a freak of nature, if there is a bug in your code anywhere that theme will find it! I have a small update, updated that switch-case in wps-parser.c and added a default so I didn't have to have that big ugly if statement setting the font if a wrong number was entered for it in the %V tag. I think it might be best if I wait for further developments on viewports for now so I can see what I'm really going to be working with.
Comment by Travis Tooke (tdtooke) - Monday, 07 January 2008, 10:07 GMT+1
@Thomas, as far as GUI_LIST_CONTEXT_MENU and GUI_LIST_CONTEXT_BRWSR go I agree completely, I do think having both of those is overkill, but as it is if you're going to have both a menufont and a browserfont you have to have that. If it's what is wanted I can kill browserfont.
Comment by Travis Tooke (tdtooke) - Monday, 07 January 2008, 10:15 GMT+1
I really wish I could edit my posts, sorry for the triple post, but that hunk you were wondering about: no idea why that is there. Unless you're creating fonts you'll never use that if it's what I think it is. I believe that code has to do with checking if you're trying to create a rockbox font from a copyrighted font. At any rate I have no idea why that would need to change.
Comment by David Maliniak (major_works) - Monday, 07 January 2008, 19:30 GMT+1
As far as the 20080107 version of the patch goes, there's another gnawing problem, which is that it causes make errors in mpegplayer.c.
Comment by Travis Tooke (tdtooke) - Tuesday, 08 January 2008, 06:55 GMT+1
This one won't do that, also took out getcurfont and made use of Dave's getfont.
Comment by David Maliniak (major_works) - Tuesday, 08 January 2008, 22:58 GMT+1
Still getting the same errors with this latest version, I'm afraid:

CC mpegplayer.c
mpegplayer.c: In function 'draw_putsxy_oriented':
mpegplayer.c:461: error: too few arguments to function 'rb->font_get_width'
mpegplayer.c:468: error: too few arguments to function 'rb->font_get_bits'

This was with clean SVN as well as bmp-resize patch and Viewports patch (latest version reflecting yesterday's commits).

Yesterday on IRC, Kugel opined that there's a hunk missing that's causing these errors.
Comment by Travis Tooke (tdtooke) - Wednesday, 09 January 2008, 00:07 GMT+1
Oops, now I know what your problem is, on line 461 change it to:
width = rb->font_get_width(pf, ch, current_vp->font);
and on 468 make it:
bits = rb->font_get_bits(pf, ch, current_vp->font);

Sorry about that, here's a good patch:
Comment by David Maliniak (major_works) - Wednesday, 09 January 2008, 03:42 GMT+1
Here's what I get with the latest version:

CC mpegplayer.c
mpegplayer.c: In function 'draw_putsxy_oriented':
mpegplayer.c:461: error: 'current_vp' undeclared (first use in this function)
mpegplayer.c:461: error: (Each undeclared identifier is reported only once
mpegplayer.c:461: error: for each function it appears in.)
Comment by Thomas Martitz (kugel.) - Wednesday, 09 January 2008, 03:44 GMT+1
Try FONT_UI instead of current_vp->font. This is what I have.
Comment by Travis Tooke (tdtooke) - Wednesday, 09 January 2008, 05:33 GMT+1
What target are you guys on, sounds like I missed more than mpegplayer.c. FONT_PLUGIN might be a better choice, but FONT_UI will always work.
Comment by David Maliniak (major_works) - Wednesday, 09 January 2008, 16:43 GMT+1
FONT_UI in mpegplayer.c did the trick for me, thanks.

I'm compiling for Sansa e200.
Comment by David Maliniak (major_works) - Wednesday, 09 January 2008, 17:44 GMT+1
FONT_UI in mpegplayer.c did the trick for me, thanks.

I'm compiling for Sansa e200.
Comment by Travis Tooke (tdtooke) - Monday, 14 January 2008, 13:30 GMT+1
If you want JDGordon's new list patch to work remove the hunks for list.c and list.h. As soon as I can I will update this. It's official, FONT_BROWSER will die.
Comment by Travis Tooke (tdtooke) - Monday, 14 January 2008, 13:44 GMT+1
Before I do that though just to be sure, is that what is wanted? Basically the deal is that FONT_BROWSER comes into play when you're in the database or the file browser where the lists tend to be longish so in those instances you may want a smaller font than what you have for FONT_MENU which is mostly used in instances where the list does not need to scroll.
Comment by Travis Tooke (tdtooke) - Monday, 14 January 2008, 18:46 GMT+1
Use this patch if you're using the aforementioned patch, just be sure to apply that one since this now depends on it, if not you can just use the older one. I'll get this properly sorted out later. I'm thinking I will use menufont for the old cases of menu and browser and maybe create remotefont.
Comment by Josh Dionne (JTD121) - Saturday, 19 January 2008, 06:29 GMT+1
So....Do we use the 2008108a and the 20081114? Or just one? Attempting to build (first timer) on H300 as target.
Comment by Travis Tooke (tdtooke) - Saturday, 19 January 2008, 12:18 GMT+1
Use the latest one, you'll want to manually change FONT_UI to FONT_MENU in apps/gui/list.c for the viewports and have it set the font to FONT_MENU in apps/gui/quickscreen.c. I haven't gotten around yet to putting up a proper sync which will be viewports_list friendly. Will probably do that within the next few days.
Comment by Travis Tooke (tdtooke) - Sunday, 20 January 2008, 20:49 GMT+1
This one depends on viewports and viewports_list. If you don't use viewports_list you should be able to just ignore the hunk failures for apps/gui/list.c since what they want to change isn't there anyway.
Comment by Jacob Brooks (jac0b) - Wednesday, 23 January 2008, 03:47 GMT+1
Resynced I think.
Comment by Travis Tooke (tdtooke) - Thursday, 07 February 2008, 12:38 GMT+1
Browserfont has been completely removed in this one, do not use browserfont anymore in your cfgs. Use menufont. For the viewports list if you specify "system" you will get FONT_SYSFIXED, anything else will get FONT_MENU. Fully adapting that to viewports list so that you can use a real font name is on my todo list, this is just a start.
Comment by Travis Tooke (tdtooke) - Thursday, 07 February 2008, 13:49 GMT+1
I'm wanting to remove FONT_PLUGIN as well now that I'm thinking about it. It looks like the patch author had intended to add that to the settings so it would be configurable, but as it is now it's just setting it to FONT_SYSFIXED. I really don't want to add it to the settings myself because we're really pushing it on loading fonts with what we have and the userfonts as it is. Thoughts?
Comment by Jacob Brooks (jac0b) - Tuesday, 12 February 2008, 04:12 GMT+1
I got some errors on this one. Should I use this then the viewports or viewports then this?

http://pastebin.com/m35b25191
Comment by Travis Tooke (tdtooke) - Tuesday, 12 February 2008, 19:02 GMT+1
You do have to apply the viewports patch first. If you're going to use the viewports list patch you need to apply that before as well, but if you don't use that one you can just ignore the 2 hunk failures on apps/gui/list.c since you don't need them in that case.
Comment by Jacob Brooks (jac0b) - Wednesday, 13 February 2008, 00:09 GMT+1
I get this error when patching with the "viewports-wps-v1.diff" already applied.

can't find file to patch at input line 325
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u -r apps/gui/viewport.c apps/gui/viewport.c
|--- apps/gui/viewport.c 2008-02-07 05:12:48.000000000 -0600
|+++ apps/gui/viewport.c 2008-02-07 05:09:32.000000000 -0600
--------------------------
File to patch:
Comment by Jacob Brooks (jac0b) - Wednesday, 13 February 2008, 00:18 GMT+1
I think I fixed it. I just took out the viewport.c entry on line 322 and it compiles fine.
Comment by Sasha Khamkov (sanusart) - Wednesday, 13 February 2008, 00:23 GMT+1
Jacob, all the pathes are fine (vieports_wps, multifont, albomart-smooth-resize).
It's your SVN messed up I think.
Try to download a fresh copy or at least revert it and patch again.
Comment by Michael Hahn (disorganizer) - Wednesday, 13 February 2008, 23:44 GMT+1
ive got the same problem as jacob with a fresh svn.
viewport.c is nonexistant.

and that file is not created by viewports-wps1 patch, so where should it come from?
Comment by Michael Hahn (disorganizer) - Wednesday, 13 February 2008, 23:46 GMT+1
found it. viewport.c is added by the viewports-list patch.
Comment by Jacob Brooks (jac0b) - Thursday, 14 February 2008, 00:01 GMT+1