简体   繁体   English

减少行距CClabelTTF字体cocos2d-x

[英]Reduce Line Spacing CClabelTTF font cocos2d-x

Hi i'm facing problem in adjusting spacing between lines in cocos2d-x using cclabelttf . 嗨,我在使用cclabelttf调整cocos2d-x中的行间距时遇到问题。 i just want to make sure that do we have any property to change line spacing in cocos2d-x 我只想确保我们具有更改cocos2d-x中行距的任何属性

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/ 我最近想减少行距(应用程序范围,而不是单个标签),并在此处写下我的工作: http : //devdiary.arcticempire.ca/2014/05/02/dev-diary-31-cocos2d -X-TTF-线间距/

In short... get the Apple Font Tool Suite, then 简而言之...获取Apple字体工具套件,然后

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. 如果您使用的是Android,则在所有情况下都应在Cocos2dxBitmap.java中将“ top”更改为“ ascent”,将“ bottom”更改为“ descent”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM