Drawing font error in HTML5

N

Nathan Archer

Guest
Hey, I'm having an error with drawing in my HTML5 game. It seems like once I have a string that's long enough, or it uses a certain font or is drawn with a certain font color, there's some kind of data leak and it becomes a garbled mess.


It has an outline by drawing the same text 8 times. This is what it looks like in a different font:



It's supposed to draw the same font twice, but is instead drawing some cursive font as the background font, and it is only looking at the characters partially. The type of secondary font seems to be something random, not a font that I have added.

Really weird. Any idea how to fix this?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Do you clear the compiler cache between builds after changing the font resource? You should ALWAYS clear the cache when you change a resource and test on HTML5.
 
N

Nathan Archer

Guest
Do you clear the compiler cache between builds after changing the font resource? You should ALWAYS clear the cache when you change a resource and test on HTML5.
Is this the same thing as "Build clean"?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
It's the button at the top of the IDE that looks like a broom, beside the play/debug/etc... buttons
 
N

Nathan Archer

Guest
I have seen an issue that isn't quite the same as yours (I think, hard to tell).. But have you played around with webgl on or off in the HTML5 settings, and if not, what happens if you turn it off?
I have the same error with it disabled. Well to be more correct, there are different graphical artifacts. Not necessarily an identifiable font. I can't find a consistent rule as to what causes this. It seems random but it becomes more often with longer text messages and fonts that differ from the main impact font.

 
Last edited by a moderator:

chamaeleon

Member
I have the same error with it disabled. Well to be more correct, there are different graphical artifacts. Not necessarily an identifiable font. I can't find a consistent rule as to what causes this. It seems random but it becomes more often with longer text messages and fonts that differ from the main impact font.
Out of curiosity, if you use a rotation of 0, what does it look like? I realize it doesn't match what you're trying to do in connection with the picture..
 
N

Nathan Archer

Guest
Out of curiosity, if you use a rotation of 0, what does it look like? I realize it doesn't match what you're trying to do in connection with the picture..
Same problem happens. There isn't a consistent digital artifact. Seems like there's three forms, failing to draw a few characters, sometimes just one in the whole text. Sometimes jumbled text of a different font, and sometimes blocks of mess.



 
N

Nathan Archer

Guest
I think I'm getting somewhere figuring out where the error comes from. It seems like there's a limited amount of characters HTML5 can handle, and once you surpass that amount everything becomes garbled. Like if I have half the amount of total characters allowed, and I draw them all in Font A and Font B, then Font C becomes garbled. If I draw the full amount in Font A, then Font B and Font C become garbled if I switch to them.

Any way I can clear this font/character cache?
 
Top