gree / lwf

LWF - Lightweight SWF
http://gree.github.com/lwf/
zlib License
627 stars 167 forks source link

Supporting custom TTF fonts in LWF #78

Closed quakeboy closed 10 years ago

quakeboy commented 10 years ago

Can you guide me on how to go about this? I would like to know what files to change and look into.

splhack commented 10 years ago

What is your target platform?

quakeboy commented 10 years ago

Target platform is iOS/Android/Web using Unity3D

splhack commented 10 years ago

LWF can use bitmap fonts that is converted from TTF. https://github.com/gree/unity-bitmapfontrenderer/blob/master/sample/Assets/Resources/BitmapFont/README.txt

Sample setup code for using bitmap font in LWF. https://github.com/splhack/Hello-LWF-Unity/blob/master/Assets/Scripts/Main.cs

quakeboy commented 10 years ago

@splhack thanks for the quick reply. I am aware of support for bitmap fonts.

But I was wondering if I will be able to use a custom TTF directly at runtime. Because there is already support for device fonts, adding support for custom TTF should not be a problem I thought.

splhack commented 10 years ago

Yeah, you can add TextMesh Renderer or something in https://github.com/gree/lwf/blob/master/csharp/unity/renderer/common/lwf_unity_text.cs

quakeboy commented 10 years ago

@splhack Great, thanks for pointing me in the right direction. That would be very helpful. If I managed to get it to work well, I will send a pull request soon