https://github.com/axmandm/sgdk-custom-fonts
https://github.com/axmandm/sgdk-custom-fonts
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/axmandm/sgdk-custom-fonts
- Owner: axmandm
- Created: 2020-06-23T21:23:06.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-23T21:25:01.000Z (almost 5 years ago)
- Last Synced: 2024-07-31T20:26:53.852Z (9 months ago)
- Language: Assembly
- Size: 250 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This builds on https://github.com/axmandm/sgdk-input, and replaces the default SGDK font with something a little nicer.
You need a font image in png format. This needs to have each character 8x8 pixels. There are some here that will require a little editing in GIMP or similar to make work: https://files.somniafabularum.com/fonts/bitmap - use the \sgdk\res\image\font_default.png as a guide.
Create a new .res file, font.res, with the image file referenced:
`IMAGE custom_font "font.png" BEST NONE`
Using BEST alone resulted in corruption for me, so I disable "map optimisation" - see "\sgdk\bin\rescomp.txt for more information.
Within int main() issue the commands to load the custom font:
`VDP_loadFont(custom_font.tileset, DMA);*`
In this instance, I want to pull the colours within the font tiles, and set them as PAL0 - pallete 0. This will not work for more complicated projects where specific pallets are to be used, but at this stage it works fine.
`VDP_setPalette(PAL0, custom_font.palette->data);`