nico font tool
1.0.0
將字體轉換為NICO遊戲框架格式字體的工具。
還有一個python版本,請參見:nico-font-tool.python。
nimble install nico_font_tool
例如:
nicofont ./assets/fonts/quan/quan.ttf ./examples/assets/fonts/demo quan --fontSize=8
所有參數:
nicofont {fontFilePath} {outputsDir} {outputsName}
options:
-fs, --fontSize
Glyph rasterize size when using OpenType font.
-gox, --glyphOffsetX
Glyph offset x.
-goy, --glyphOffsetY
Glyph offset y.
-gaw, --glyphAdjustWidth
Glyph adjust width.
-gah, --glyphAdjustHeight
Glyph adjust height.
-m, --mode
Png sheet color mode, can be 'palette' or 'rgba', default is 'palette'.
請參閱:gen_fonts
import nico_font_tool
let (sheetData, alphabet) = createSheet ( " your/font/file/path.ttf " , 8 )
savePalettePng (sheetData, " outputs/palette/dir " , " outputsName " )
saveDatFile (alphabet, " outputs/palette/dir " , " outputsName " )
saveRgbaPng (sheetData, " outputs/rgba/dir " , " outputsName " )
saveDatFile (alphabet, " outputs/rgba/dir " , " outputsName " )根據麻省理工學院許可。