Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:35 12 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Invalid font #10...

     Page 1 of 2    
Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9755
Posted: 02:34pm 31 Aug 2017
Copy link to clipboard 
Print this post

Anyone else seeing this?

MM+ ver 5.0405

I keep getting this message when calling GUI pages - but I am not using any font #10.
Font #10 does not exist, either in the library or in any other form.





Font #10 is not referenced in any GUI pages, including pages 7, 8 and 4.
I do use fonts 7,8 and 4, but I don't use a font #10
Fonts 7 and 8 are in the library.

EDIT: Relevant GUI page code....

  Quote  '---------------------
GUI Setup 4 'EXIT and OK buttons for any page
Font 7,2
GUI button BU_EXIT,"EXIT",75,400,200,50,RGB(blue),RGB(gray)
GUI button BU_OK,"OK",525,400,200,50,RGB(red),RGB(gray)
'---------------------
GUI Setup 5 'Confirm delete/disable entry
Font 7,3
GUI DISPLAYBOX CONFIRM,0,0,MM.HRES,75,RGB(Cyan),RGB(BLACK)
CtrlVal(CONFIRM)="CONFIRM DELETE!"
Font 4,1
GUI Caption CAP_CD_CFD,"Touch OK to confirm delete, or EXIT...",100,225,LT,RGB(red),RGB(White)
'---------------------
GUI Setup 6 'Menu buttons 1-3
Font 7,2
GUI button BU_MENU1,"1",50,200,75,50,RGB(BLACK),RGB(gray)
GUI button BU_MENU2,"2",50,275,75,50,RGB(BLACK),RGB(gray)
GUI button BU_MENU3,"3",50,350,75,50,RGB(BLACK),RGB(gray)
'---------------------
GUI Setup 7 'Database (create an entry)
Font 7,3
GUI DISPLAYBOX DB_CREATE,0,0,MM.HRES,75,RGB(red),RGB(BLACK)
CtrlVal(DB_CREATE)="EDIT DATABASE:"
'---------------------
GUI Setup 8 'Village Area radio buttons
Font 4,1
GUI Caption CAP_VA_SEL,"Touch radio button to select AREA...",150,100,LT,RGB(Cyan)
Colour RGB(Green)


EDIT: MMEDIT finds no reference to font #10 anywhere in the code:




Edited by Grogster 2017-09-02
Smoke makes things work. When the smoke gets out, it stops!
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1945
Posted: 02:59pm 31 Aug 2017
Copy link to clipboard 
Print this post

EDIT Wrong INFO:

This is the code that causes the error and doesn't work for me in "plus MMBasic Ver 5.04.05" on an E100. I'm not concerned as I just list the controls instead.

GUI REDRAW ALL

Error: Invalid Font number #13

GUI REDRAW XX or GUI REDRAW X1,X2,X3 is OK.

Your error may be another variation of this?

Mike

Edited by KeepIS 2017-09-02
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1945
Posted: 03:09pm 31 Aug 2017
Copy link to clipboard 
Print this post

Updated my last post - Reason - wrong info:
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9755
Posted: 03:15pm 31 Aug 2017
Copy link to clipboard 
Print this post

Hi there. Thanks for posting. It's nice to know I am not insane.

Yes, this is indeed very interesting.

I reflashed the PIC32 to 5.0405 to be totally sure I did not have corrupted flash or something, but same problem, so I suspect a bug.

I have been able to narrow it down.

In line 700 - PAGE 7,8,4, if I make that PAGE 7,8, it falls over with the same error, but if I make that PAGE 7 this works just fine - no font #10 error message.

Naturally, this means some pages of GUI are not there, but the purpose of this test, was to try to home in on where the problem is.

Next thing to try was some console commands, and it seems to be directly linked to my attempts to call GUI page 7. I can call any other page I like - no problems, but as soon as I call page 7, I get the error:





EDIT: MOST strange. Now I put the PAGE 7,8 back and it worked. So I changed it again to PAGE 7,8,4 and now THAT works, and everything works as it should.

I have not altered the code(other then playing with line 700), I have not changed the library. WTF? Edited by Grogster 2017-09-02
Smoke makes things work. When the smoke gets out, it stops!
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1945
Posted: 03:26pm 31 Aug 2017
Copy link to clipboard 
Print this post

Hi, it appears to change with code, I also use PAGE's 1 to 9 in my code and I have no problems with any Page, however Page 9 is not declared as I use it for the CLS command to not wipe out the GUI on the current or new page.

IE:

Page 9 'dummy page
CLS
Page 2 'new GUI page


I read somewhere that CLS was supposed to preserve the GUI Page, but it does not do that for me, I found the above code works if I need to use CLS.

Mike.

EDIT: Actually CLS does a GUI HIDE ALL, so you would use GUI SHOW ALL after it but
switching a dummy page is easy.Edited by KeepIS 2017-09-02
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9755
Posted: 03:32pm 31 Aug 2017
Copy link to clipboard 
Print this post

Hmmmmmmmm - MOST interesting.

I have taken the chance at this point in time, to use IPE to read the entire chip with it's currently-working code, and setup.

The hope being that if this happens again, I can reflash to where I am now, and hopefully just continue on from there. Saves having to reflash, then configure all the peripherials, load the initial code, load the library etc....

This may or may not actually help later on if the bug changes with code as you suggest, but I feel this is at least one base covered. Edited by Grogster 2017-09-02
Smoke makes things work. When the smoke gets out, it stops!
 
GoodToGo!

Senior Member

Joined: 23/04/2017
Location: Australia
Posts: 188
Posted: 04:34pm 31 Aug 2017
Copy link to clipboard 
Print this post

Hey Grogs,

Sounds remarkably similar to the issue I had back in June..... Page 3 invalid font

Never got it sorted out, ended using a different page number....

Good luck!

GTG!
...... Don't worry mate, it'll be GoodToGo!
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 06:50pm 31 Aug 2017
Copy link to clipboard 
Print this post

@GoodToGo,

Just tried your program referred to in the link and it works fine under 5.04.05 on an Explore 100 and an MZ144.

@Grogster

Can you provide some working code example of the failure (I can not see anything wrong looking at your code snippit).

panky

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1945
Posted: 10:03pm 31 Aug 2017
Copy link to clipboard 
Print this post

I think if you read his post's he said it now works correctly, so yes that code will work as there is nothing wrong with it, but sometimes for no reason it can stop and throw a stupid incorrect error, I have had the same thing happen with some GUI code.

NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3308
Posted: 12:13am 01 Sep 2017
Copy link to clipboard 
Print this post

There is something wrong here as a number of people have had "Invalid font" errors which seem to come and go at random. I have run the suspect code from some of them but it never caused an error for me. Regardless, there are too many reports like this for it to be some random cosmic ray strike.

I'm camping in the outback at this time but when I get back to civilisation I will try again to find out what is going wrong. If anyone can reliably demo this problem with a short bit of code I will be eternally grateful.

Geoff
Geoff Graham - http://geoffg.net
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9755
Posted: 02:15am 01 Sep 2017
Copy link to clipboard 
Print this post

@ GoodToGo - Yes, I remember that thread now! Re-reading it now, I see I even posted that I have a big program with lots of pages and no problems. Now it is this same big program with lots of pages that is doing that odd invalid font message - I posted too soon!

@ Panky & KeepIS - Yes, was not working, then suddenly started working again and I don't know why. Very strange stuff.

@ Geoff - I will post code if I can make it happen simply, but I think GTG's code in the other thread is about as simple as you could possibly get:




Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9755
Posted: 06:21pm 05 Sep 2017
Copy link to clipboard 
Print this post

Here is another shot of the problem - it appears to be self-correcting, but only from the command-prompt:





Note that it fell over at the Font #10 thing again, and that typing PAGE 7 results in the error. Typing PAGE 8 works. Typing PAGE 4 works. Typing PAGE 7 a 2nd time, then works as it should. Typing the full PAGE 7,8,4 then works fine. Running the code then works fine.

Not sure if that helps at all, but feels like a problem calling the PAGE command more then once for certain pages. PAGE 7 was the problem last time too - not sure if that means anything.
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9755
Posted: 02:39pm 06 Sep 2017
Copy link to clipboard 
Print this post

UPDATE:

Appears to only happen from power-up.

That is, from initial power-up, you get this error if you are going to get it, but you can work-around it at the console, by calling the offending page TWICE. The first attempt(at the console) always generates the same error, then 2nd attempt does not.

From that point on, RUN the code, it works fine.
Even CPU RESTART and the code works fine.






Smoke makes things work. When the smoke gets out, it stops!
 
GoodToGo!

Senior Member

Joined: 23/04/2017
Location: Australia
Posts: 188
Posted: 05:55pm 07 Sep 2017
Copy link to clipboard 
Print this post

When I get a chance I'll dig out my LCD+ backpack and re-run my original code......

GTG!
...... Don't worry mate, it'll be GoodToGo!
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 10:59pm 07 Sep 2017
Copy link to clipboard 
Print this post

@Grogster,

Would you be able to post the full code so we can run and investigate a source of the problem?

Doug.

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
GoodToGo!

Senior Member

Joined: 23/04/2017
Location: Australia
Posts: 188
Posted: 02:45pm 08 Sep 2017
Copy link to clipboard 
Print this post

  Grogster said  
Appears to only happen from power-up.

That is, from initial power-up, you get this error if you are going to get it, but you can work-around it at the console, by calling the offending page TWICE. The first attempt(at the console) always generates the same error, then 2nd attempt does not.

From that point on, RUN the code, it works fine.
Even CPU RESTART and the code works fine.


Confirmed! The exact same sequence occurs with my test code.


> run
[56] Page 3,9
Error: Invalid font number #16
> page 3
> run
[56] Page 3,9
Error: Invalid font number #16
> page 9
Error: Invalid font number #16
> page 9
> run
(Works)

** Reset MM+ by reset switch **

> Micromite Plus MMBasic Ver 5.04.05
Copyright 2011-2017 Geoff Graham

> run
(Works)

**Cycle power to MM+**

Micromite Plus MMBasic Ver 5.04.05
Copyright 2011-2017 Geoff Graham

> run
[56] Page 3,9
Error: Invalid font number #16
> page 9
Error: Invalid font number #16
> page 9
> run
(Works)


Interestingly, now it's page 9 that's having a hernia, not page 3.

Code below if anyone wants to have a play....

option default integer
base = 1

'Page 3 GUI Elements

const Page3label_CH = 54
const Page3label_MaxAmps = 55
const Page3label_TripAmps = 56
const Page3label_Status = 57
const Page3label_Ch1 = 58
const Page3label_Ch2 = 59
const Page3label_Ch3 = 60
const Page3label_Ch4 = 61
const Page3MaxAmps_Ch1 = 62
const Page3MaxAmps_Ch2 = 63
const Page3MaxAmps_Ch3 = 64
const Page3MaxAmps_Ch4 = 65
const Page3TripAmps_Ch1 = 66
const Page3TripAmps_Ch2 = 67
const Page3TripAmps_Ch3 = 68
const Page3TripAmps_Ch4 = 69
const Page3Status_Ch1 = 70
const Page3Status_Ch2 = 71
const Page3Status_Ch3 = 72
const Page3Status_Ch4 = 73
const Page3Frame = 74

'Tab Elements
const Tab1 = 91
const Tab2 = 92
const Tab3 = 93
const Tab4 = 94

'Misc Variables
const Ok = 1
const Trip = 2
const Fail = 3
Dim as Float TripAmps(4), MaxAmps(4)

'------------------------------------------------------------------

'Main Program for testing

CLS
pwm 2, 500, 50 'Set backlight to on (MM+ LCD Backpack)
font 1, 1 'Set font to #1, scale 1.

for I = 1 to 4
TripAmps(I) = 1.25 'Test figures for display
MaxAmps(I) = 1.43
next I

GuiSetup 'Setup Pages
page 3,9
gui show all

do
for I = 1 to 4
ChangeStatus(Page3Status_ch1,I)
ChangeStatus(Page3Status_ch2,I)
ChangeStatus(Page3Status_ch3,I)
ChangeStatus(Page3Status_ch4,I)
pause 500
next I
loop

'------------------------------------------------------------------

Sub ChangeStatus(Element,State)

select case State
Case Ok
gui fcolour rgb(green),Element
gui bcolour rgb(black),Element
ctrlval(Element) = "OK"
Case Trip
gui fcolour rgb(yellow),Element
gui bcolour rgb(red),Element
ctrlval(Element) = "TRIP"
case Fail
gui fcolour rgb(Black),Element
gui bcolour rgb(red),Element
ctrlval(Element) = "FAIL"
Case else
gui fcolour rgb(red),Element
gui bcolour rgb(black),Element
ctrlval(Element) = "????"
end select
end sub

'------------------------------------------------------------------

sub GuiSetup

'Tab Buttons

GUI SETUP 9
GUI Switch Tab1, "Main", 0, 0, 78, 30, RGB(white), RGB(Gray)
GUI Switch Tab2, "Relays", 80, 0, 78, 30, RGB(White)
GUI Switch Tab3, "Current", 160, 0, 78, 30, RGB(White)
GUI Switch Tab4, "Config", 240, 0, 78, 30, RGB(White)
CtrlVal(Tab1) = 0
CtrlVal(Tab2) = 1
CtrlVal(Tab3) = 1
CtrlVal(Tab4) = 1

'Page 3

GUI SETUP 3

Gui frame Page3Frame,"Current (Amps) Page",0,45,320,193,rgb(white)
gui caption Page3label_CH, "CH.", 10,60,,rgb(cyan)
gui caption Page3label_TripAmps, "Trip Amps", 68,60,,rgb(cyan)
gui caption Page3label_MaxAmps, "Max Amps", 159,60,,rgb(cyan)
gui caption Page3label_Status, "Status", 250,60,,rgb(cyan)
gui caption Page3label_Ch1, "1", 18,93,,rgb(cyan)
gui caption Page3label_Ch2, "2", 18,131,,rgb(cyan)
gui caption Page3label_Ch3, "3", 18,169,,rgb(cyan)
gui caption Page3label_Ch4, "4", 18,207,,rgb(cyan)

gui caption Page3TripAmps_Ch1,str$(TripAmps(1),2,2)+"A",76,93,,rgb(white)
gui caption Page3TripAmps_Ch2,str$(TripAmps(2),2,2)+"A",76,131,,rgb(white)
gui caption Page3TripAmps_Ch3,str$(TripAmps(3),2,2)+"A",76,169,,rgb(white)
gui caption Page3TripAmps_Ch4,str$(TripAmps(4),2,2)+"A",76,207,,rgb(white)

gui caption Page3MaxAmps_Ch1,str$(MaxAmps(1),2,2)+"A",163,93,,rgb(white)
gui caption Page3MaxAmps_Ch2,str$(MaxAmps(2),2,2)+"A",163,131,,rgb(white)
gui caption Page3MaxAmps_Ch3,str$(MaxAmps(3),2,2)+"A",163,169,,rgb(white)
gui caption Page3MaxAmps_Ch4,str$(MaxAmps(4),2,2)+"A",163,207,,rgb(white)

gui displaybox Page3Status_Ch1,250,87,45,25,rgb(green),rgb(black)
gui displaybox Page3Status_Ch2,250,125,45,25,rgb(green),rgb(black)
gui displaybox Page3Status_Ch3,250,163,45,25,rgb(green),rgb(black)
gui displaybox Page3Status_Ch4,250,201,45,25,rgb(green),rgb(black)

ctrlval(Page3Status_Ch1) = "OK"
ctrlval(Page3Status_Ch2) = "OK"
ctrlval(Page3Status_Ch3) = "OK"
ctrlval(Page3Status_Ch4) = "OK"
end sub


Blanked the MM+, loaded with below and.......
memory
Flash:
1K ( 1%) Program (7 lines)
99K (99%) Free

RAM:
0K ( 0%) 0 Variables
0K ( 0%) General
101K (100%) Free
> list

GuiSetup
Page 3

Sub GuiSetup
GUI SETUP 3
End Sub
> run
[3] Page 3
Error: Invalid font number #16
>



Hope it helps with the bug squashing

GTG!
...... Don't worry mate, it'll be GoodToGo!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9755
Posted: 06:34pm 08 Sep 2017
Copy link to clipboard 
Print this post

@ panky - No, it is 1700 line long, and effectively closed-source(by me). I am 99.9% sure this is not a programming bug on my part.

@ GTG - Nice extra information, thanks. Also nice to see you are getting the same error(ignoring the font number for now) AT THE SAME POINT in the procedure, which should help isolate where this is happening(when Geoff reads this and/or gets the time to look at it)
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9755
Posted: 06:47pm 13 Oct 2017
Copy link to clipboard 
Print this post

BUMP!

Geoff - have you had any time to look at this one? No problem if not as I know you will squish it in due course, but I ran into it again today when I powered up one of my boards.

As with the previous posts, you only run into this error once from power-up. Once you clear it by typing the page(s) in at the command prompt TWICE, it then works flawlessly until you next turn off the power.
Smoke makes things work. When the smoke gets out, it stops!
 
ion507
Newbie

Joined: 05/12/2014
Location: Australia
Posts: 14
Posted: 01:57pm 18 Oct 2017
Copy link to clipboard 
Print this post

I also experienced this happening a couple of days ago on my E100 project. I upgraded 5 boards to V5.04.05 a few weeks back but didn't get much time to work on my timer project. The timer is mostly up and running but I'm still trying to develop a couple more features using trial and error programming through MMIDE. In my program there is an initial selection menu then it displays a warning page before running the selection. I know that it had worked several times up till this week so when Error: Invalid font number #10 came up on the screen I thought my last program changes must have caused the problem. The error pointed to the Page 30, 31 line in the code below. This was not a recent change.
CLS
Page 30, 31 'WARNING - PRESS TO FACE TARGETS
Do
If FLAG_1 = 0 THEN
Loop
EndIf

I tried with just “Page 30” on the line and the program ran. I tried with just “Page 31” on the line and the error returned. This is the code for 31:

GUI SETUP 31 ' TARGET WARNING_PAGE
Font 4, 2
GUI BUTTON WARNING_GO, "PRESS TO FACE TARGETS", 30, 120, 740, 240, RGB(BLACK), RGB(RED)

I tried changing the font thinking that this was the problem but no joy. The E100 PCB I was using had been damaged when I tried to solder in my first SMD PIC so I tried another board but it also showed the same problem. That’s when I suspected that V5.04 might be causing the error. I’ve gone back to V5.03.02 and it seems to be working correctly on both boards.

When the error began to appear I had been using VAR SAVE and VAR RESTORE for the first time. I don’t know if this caused it.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9755
Posted: 08:46pm 18 Oct 2017
Copy link to clipboard 
Print this post

Hi there.

I can confirm that I have had an email from Geoff on this matter, and this invalid font issue IS on his bug-list for the next release, but he mentioned that won't be for at least a month or so - he's away seeing the world again.
Smoke makes things work. When the smoke gets out, it stops!
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025