Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/takwolf-deprecated/nico-font-tool
A tool for converting fonts to NICO Game Framework format fonts.
https://github.com/takwolf-deprecated/nico-font-tool
font fonts game-engine gamedev nico nim
Last synced: 9 days ago
JSON representation
A tool for converting fonts to NICO Game Framework format fonts.
- Host: GitHub
- URL: https://github.com/takwolf-deprecated/nico-font-tool
- Owner: TakWolf-Deprecated
- License: mit
- Created: 2023-05-01T13:32:32.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-25T05:32:47.000Z (over 1 year ago)
- Last Synced: 2023-08-14T08:03:03.610Z (over 1 year ago)
- Topics: font, fonts, game-engine, gamedev, nico, nim
- Language: Nim
- Homepage:
- Size: 7.96 MB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NICO Font tool
A tool for converting fonts to [NICO Game Framework](https://github.com/ftsf/nico) format fonts.
There is also a Python version see: [nico-font-tool.python](https://github.com/TakWolf/nico-font-tool.python).
## Installation
```commandline
nimble install nico_font_tool
```## Usage
### Command
For example:
```commandline
nicofont ./assets/fonts/quan/quan.ttf ./examples/assets/fonts/demo quan --fontSize=8
```All params:
```text
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](examples/gen_fonts.nim)
```nim
import nico_font_toollet (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
- [Pixie](https://github.com/treeform/pixie)
- [nimPNG](https://github.com/jangko/nimPNG)## License
Under the [MIT license](LICENSE).