No description
Find a file
2023-06-25 13:32:31 +08:00
assets/fonts 调整测试字体 2023-06-25 13:32:31 +08:00
examples 调整测试字体 2023-06-25 13:32:31 +08:00
tests 调整目录结构 2023-05-23 17:54:26 +08:00
.gitignore 更新 Readme 2023-05-24 14:48:49 +08:00
LICENSE 添加许可证 2023-05-01 12:07:17 +08:00
nico_font_tool.nim 代码整理 2023-05-24 14:12:48 +08:00
nico_font_tool.nimble 修复 https://github.com/TakWolf/nico-font-tool/issues/10 2023-05-26 01:06:20 +08:00
nicofont.nim 修复描述 2023-05-24 15:16:58 +08:00
README.md 修复描述 2023-05-24 15:16:58 +08:00

NICO Font tool

A tool for converting fonts to NICO Game Framework format fonts.

There is also a Python version see: nico-font-tool.python.

Installation

nimble install nico_font_tool

Usage

Command

For example:

nicofont ./assets/fonts/quan/quan.ttf ./examples/assets/fonts/demo quan --fontSize=8

All params:

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'.

Scripts

See: 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")

Dependencies

License

Under the MIT license.