- Home /
Dynamic Font On Android Can't display some texts
I am using Unity4.1.2f1 with the newest NGUI plugin. And I create a dynamic font prefab with Arial true type font. Then I create two NGUI Label with this dynamic font prefab, one label with some Chinese words and one with some Korean words.But I compiled the demo onto my android device, there was a weird problem: I tested the demo on two Nexus4 device with Android 4.2.2, on one device the Chinese couldn't display but on another the Korean couldn't display. And I logged the results of the Font.GetCharacterInfo, I found when the device can't display Chinese/Korean, the characterInfo was invalid, such as the xMin and xMax of uvs was the same, so the text size is 0. Then I tested the same demo on my SAMSUNG I9100 device with Android 2.3.5, both Chinese and Korean displayed correctly.
So I guess there is a issue with the dynamic font in Unity, can anyone kindly help me to fix this issue?
Does Android support dynamic font??? I think iOS doesn't so I'm reckoning Android doesn't either.
Answer by particled · Oct 14, 2013 at 08:14 AM
Submitted bug report with repro months ago, never heard back. Responded on this thread, too, comment was never accepted. 552747, 552752.
$$anonymous$$aybe you posted as an answer and it was converted to comment invoking the -1 Answers bug and losing your comment to the Ether forever. It happens.
Wow. That is a suboptimal bug. Thanks for the explanation.
So with 2Dtoolkit I can dynamically place text on GUI buttons for example?
@meat - that is utterly and totally correct. it, literally, could not be easier.
LOO$$anonymous$$ at the image I posted in the other long answer linked above. LOO$$anonymous$$ at the yellow "x33" (bottom of second image)
It's literally this simple ... scoreObject.text = "33"; scoreObject.commit();
you just se the ".text" to what you want, and go "commit()"
it's all done in one draw call. it works on every platform. it's ALWAYS the CORRECT SIZE utterly regardless of screen resolution or anything else.
there's, realistically, no other approach that is viable in Unity. the weeks, months, you spend trying to figure out unity's dynamic/whatever android/whtever type .. it will litreally take you 1 $$anonymous$$utes to download 2DTk, 3 $$anonymous$$utes to figure out how to click "Add Text $$anonymous$$esh", and 1 $$anonymous$$ute to figure out how to change the text in code.
"dynamically place text on GUI buttons" we work for clients on a number of million-user games you play everyday, literally every single project we touch we just scrap every aspect of typography and click in 2DT$$anonymous$$.(which takes like '2 $$anonymous$$utes') the only way I would even be able to approach dynamic text on buttons, is this pipeline - I mean you could assign one, two man months to just figuring out unity dynamic whatever bugs etc.
if you talking for UI, you may prefer a second camera just for the UI. if it's a 2D game (sidescroller or the like), just sit the score or whatever it is in the scene near your main camera. total simplicity
it's unclear if "Unity2D" which is co$$anonymous$$g next year will have a simple textmesh system like in 2dT$$anonymous$$, for today anyway, this is the only real world solution - enjoy!
Answer by Fattie · Oct 14, 2013 at 08:19 AM
@part, for every type need in Unity3D, I truly recommend just grabbing 2dToolkit. the whole problem is utterly solved in literally less than a minute.
http://answers.unity3d.com/questions/384623/setting-font-size-according-to-screen-dpi.html
notice the long comment (with two images). Additionally you can just use glyphdesigner, and use absolutely any font or type style you need.
We just now never, ever use any other system for typography in Unity - it's the only way to go. For type in your UI, or type "in the 3D world" (floating messages, etc) .. it's literally the inly way to go.
Hope it helps
HOWEVER if you are trying to do Asian type, you are f---ed, there is no good solution :/ Unity's dynamic/etc type is a shambles. Sorry.
Answer by unimechanic · Jul 15, 2013 at 06:03 PM
These problems are known, but there isn't a solid bug report with test project:
http://www.tasharen.com/forum/index.php?topic=4953.0
If you can reproduce this problem, please submit a bug report with a minimal sample project.
Answer by mikecy · Sep 30, 2013 at 11:47 AM
Please refer to this like, I think this problem may be a bug of Unity:
http://forum.unity3d.com/threads/190158-Dynamic-Font-Missing-Character-Info-on-certain-devices
Thought?
Your answer
Follow this Question
Related Questions
NullReferenceException when looking at target in an Editor class (CustomEditor) 2 Answers
Why does fmod(x,1.0) not work in Unity4, but fmod(x,1.0001) does? 0 Answers
Error with my float variable? 1 Answer
Unity4 Ignoring Inspector/Initialized Public Value in Build 1 Answer
Unity pro 4, shadow problems 0 Answers