- Home /
Font probem - extended characters
Does anyone know why a string that contains latin characters is being displayed with errors?
Here is an example (notice the latin character "ă", that sounds like a in "another" instead of a in "hause"):
matr_stringuri [88, 2] = "furnică";
Here is what a GUIText displays this array element as:
Until 2 days ago this worked fine, when MonoDevelop had a saving problem (something about loosing some content or ASCII characters,,, did not pay attention at the time). For strings without those special characters, the code works fine.
I imported the Arial font that I know has those characters and assigned it to the GUI. Did not solve the problem.
Also, Unity started raising this error "(script_1.cs(4190,37): error CS1525: Unexpected symbol ', expecting
)', ,',
;', [', or
=')" even though MonoDevelop accepted this code ( matr_stringuri [20, 1] = "ă")
bool LiteraĂ = GUI.Button(new Rect(20+10/10*distanta_intre_litere,(primul_rand -matr_floaturi [20, 1]*20 ),latime_litera,inaltime_litera), matr_stringuri [20,1], alfabetStyle);
If I remove the latin character, Unity runs but with the display problem I mentionned:
bool LiteraAA = GUI.Button(new Rect(20+10/10*distanta_intre_litere,(primul_rand -matr_floaturi [20, 1]*20 ),latime_litera,inaltime_litera), matr_stringuri [20,1], alfabetStyle);
Again, the code worked fine 2 days ago.
I've re-writen the code, even copy pasted it from a backup. For the life of me I don't understand this problem.
Help please.
Answer by jpthek9 · Jan 08, 2015 at 04:53 PM
Hmm... that's really strange. Have you considered that it might be an issue of the font and not the software? Try using a different font or the one you were using before.
Answer by Daniel Greenhorn · Jan 09, 2015 at 04:42 AM
Hi, jpthek9 I did indeed thought it may be a font problem (or windows settings problem).
Until 2 days ago I used the default Arial Unity font. Imported 2 fonts that have those characters (ARIAL and LIBERATION SANS). Did not help. One of the 2 GUITexts I found this morning to be using a font ARIAL and the other Unity's Arial. Changed them both to each of the fonts.
I had a hunch it was a MonoDevelop problem so I disabled this script, created a new one and loaded it from an older backup copy. The latin letters returned to normal...
I'll have to figure it out why it worked then and not now...
Maybe when the Monodevelop save problem occured (I had to open the script from a MonoDevelop backup file), it saved to a default format that did not know those special characters even though they were written correctly. Subsequent edits on that script file inherited the problem. Or, more likely, a format that Unity can't fully display (errors in Unity not in monodevelop).
Maybe the problem is caused by the script being 4122 lines long? 3k are loading static array values. Also, Monodevelop does not minimize sometimes.
The problem did solve when I created a new script file from scratch.
I'll update as I find more or my hunch is confirmed.
I'm glad you got it working! Yeah, I'm not so sure about the really technical aspects of computers but gawsh that's a lot of static variables.
Well it's an alphabet game so it had to be big (word+img+spoken). Would have used a xls file ins$$anonymous$$d but could not figure out the way to make it work.