- Home /
Font size different on iPhone?
I've imported a .ttf font and set the Character to ASCII default set (it said I couldn't use dynamic fonts ) everything works fine on the mac, but when I deploy to device the font size appears to be the default size. I can set it to size 72 and it takes up most of the screen on the mac, but on the device the size never changes, anyone know what could be wrong?
Do you have your project set up correctly?
1)File>BuildSettings - $$anonymous$$ake sure your platform is set to iOS and click switch platform
2)In the Game window, set your resolution to the resolution you want your game to be. Then build that way. Works for me.
Yeah it's set up, I've been deploying to device for some time now. I'm using iPhone tall 2:3 as the game window resolution, everything else looks identical on the phone as far as I can tell (it's orthographic 2d)
You're right that it's resolution based, the problem is the game window would have to be huge to be 'actual' iPhone 4 resolution, and that doesn't help when the same app is deploying to iPhone 3 which is far smaller, there's no way to make it relative ?
I'm having the same problem when building for Android. A GUIText set to Font Size 38 will look ok on PC but when I build to Android the size is default, therefore, too small. Sorry to bump this old question again, but does anybody know why? Cheers
Answer by tw1st3d · Aug 13, 2012 at 07:53 PM
iPhones can't import .ttf files, which is why using .ttf files for an iOS/Mac game is a bad idea. Use Helvetica and test the font sizes for both the Mac and iPhone and see what happens. If it still doesn't change, you need to make a conditional about whether or not it's on an iPhone and define the font size directly through that.
Good Luck.
Answer by biohazard2u · Aug 14, 2012 at 03:11 PM
Yes tw1st3d, that answer pointed me the right way, although I found this to be the best solution.
http://forum.unity3d.com/threads/58161-Unity-3-b6-iPhone-Fonts-problem
As Darell Nar is saying, dynamic fonts are only supported on PC and MAC platforms. This is what he says (and totally works out):
So in order to get fonts to work on Mobile devices you must use Unicode for the Character set. This is what you need to do. - Import a TTF font file in Unity. - Set the Character Set to Unicode. - All other information is up to you, size, anti-aliasing, etc - If you use the font in a GUIText, make sure that the "Font Size" is set to "0" and "Font Style" is set to "Normal". If one of your GUIText is set with different values for those two fields, you will get the error message!
So, you won’t be able to dynamically change the font size on your inspector or script, you will need to go to your font of choice and there select Character to Unicode and Font Size to whatever you want.
Thanks a lot to tw1st3d and Darrell Nar for your answers.
Your answer
Follow this Question
Related Questions
iOS Font Size much smaller on iPad 4 1 Answer
Textures sizes Web/PC vs iOS. 1 Answer
iOS GUIText size issue 1 Answer
size of GUI pics too big 1 Answer
max texture size ios 1 Answer