Line spacing in CCLabelTTF

Hello guys!

I’ve been trying to increase line spacing in CCLabelTTF because the font we use is entirely uppercase, which for the flow and context of the game is pretty cool, but some testers reported getting tired of all the reading (which is an important part of the game).
Anyone knows how this can be done?

Try using CCLabelAtlas instead. It uses a charmap ( a spritesheet of images with characters ) in which you can use your own sizes for each character, plus, any design you may want to add.
For example, if you want each letter to be 32 pixels wide and 64 pixels high, just make a charmap composed of 32x64 images with characters in it.

ios or android? I decreased the line spacing in my game’s android version by not so elegant two line fix in Cocos2dxBitmap.java.

sergio migueis wrote:

Hello guys!
>
I’ve been trying to increase line spacing in CCLabelTTF because the font we use is entirely uppercase, which for the flow and context of the game is pretty cool, but some testers reported getting tired of all the reading (which is an important part of the game).
Anyone knows how this can be done?

Hi, I have a question about line spacing.

I use cocos 2.1.5 and CCLabelTTF.

With some fonts (all true type) line spacing is different between Ios and Android.

Instead other fonts are rendered in the same way in the two systems

This is very strange and creates some difficulties.

Do you know the problem? Do you have useful info to tell me.

thanks
Don

iOS seems to use the font’s ascender and descender (vertical positions) to do line spacing, while Android uses the font’s top and bottom. (ie: bounding box) I recently wanted to change the line spacing of the font in my game, and wrote up what I found out here, including a fix. (that worked in my case, anyway)

http://devdiary.arcticempire.ca/2014/05/02/dev-diary-31-cocos2d-x-ttf-line-spacing/