Author Topic: Font creation results in font size of 0  (Read 2541 times)

alankley

  • Guest
Font creation results in font size of 0
« on: September 30, 2012, 11:17:42 AM »
I can not get word wrapping to work in my UILabel using a font I created using the Font tool.  Multi-line is selected and i have set a non-zero Line Width for the UILabel.  Tracing through the code I see that UIFont.WrapText immediately returns due to mFont.charSize being 0.  I do notice that my created font in the Unity editor shows the font size to be 0.  I have tried creating the font with and without an Atlas.  What am I missing?
Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Font creation results in font size of 0
« Reply #1 on: September 30, 2012, 01:18:23 PM »
Sounds like you didn't create the font properly. Check inside the TXT file for the font to see what's there. The data is likely missing. Make sure to follow the video closely.

alankley

  • Guest
Re: Font creation results in font size of 0
« Reply #2 on: September 30, 2012, 08:39:46 PM »
Thanks for the reply Aren.  I'm not sure what video you are referring to. If it is the "Atlas Maker, Font Maker" i did not find it helpful to my problem.  You are right, however, the .txt file being generated by bmGlyph has a bad value.  The lineHeight value is set to 0 and the base is set to -20.  Setting the lineHeight to non-zero i can create the font in Unity with a good font size.   Though I'm not sure what value to set it to.  Can I make it the same height as my font size value ?  And more importantly, what values could I possible be setting in bmGlyph causing it to save a lineHeight of 0?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Font creation results in font size of 0
« Reply #3 on: September 30, 2012, 08:43:06 PM »
Did you actually select which glyphs get exported? If yes, just try it with a different font such as Arial.

alankley

  • Guest
Re: Font creation results in font size of 0
« Reply #4 on: September 30, 2012, 08:48:01 PM »
Yes.  As a matter of fact I'm working on a Turkish version of our game so I needed to bring in extra glyphs.  I just searched and it looks like I may be running into a bug with bmGlph.  I am running 1.4 and in 1.6 (1.7 is the latest) they have a fix for a bug related to linehHeight=0  (http://www.bmglyph.com/todo-list/) .  Sorry for the trouble, i will upgrade my version of bmGlyph.  Although I'm still curious how the lineHeight gets generated and how it relates to the font size.