0
votes

Hi i'm facing problem in adjusting spacing between lines in cocos2d-x using cclabelttf . i just want to make sure that do we have any property to change line spacing in cocos2d-x

1
Same question for me but for cocos2D v3.lsmpascal

1 Answers

1
votes

I recently wanted to reduce my line spacing (app-wide, not for a single label), and wrote up my work here: http://devdiary.arcticempire.ca/2014/05/02/dev-diary-31-cocos2d-x-ttf-line-spacing/

In short... get the Apple Font Tool Suite, then

ftxdumperfuser -t hhea -A d font.ttf  # export font header to XML
[Edit XML - set lineGap to 0 and adjust ascender and descender as you like.
Test with all characters you'll want to print]
ftxdumperfuser -t hhea -A f font.ttf  # import XML to font header

If you're using Android, you should change "top" to "ascent" and "bottom" to "descent" in all cases in Cocos2dxBitmap.java.