Hexagonix graphic fonts
September 21, 2024 ยท View on GitHub
Hexagonix graphic fonts
The default installation of Hexagonix also provides a number of fonts that can be loaded by the settings application or the font utility (fnt). These files are used to change the graphical display font for Hexagonix.
Graphics mode fonts for Hexagon are developed as a bitmap in Assembly which, when compiled, generate a binary image of the font with representations of each character. The standard Hexagonix fonts have now been released as open source and are available in the Hexagonix font repository.
How to create your own graphic font
Feel free to download the font modelo, which is already structured but with blank characters, and draw the your own graphic font! For that, you need to know some technical information about them:
- Fonts have a height of 16 and a width of 8 pixels. This information is necessary to ensure that your font does not experience problems during use.
- You can freely divide the placeholders for accents and other graphic features of each character, such as cedilla or portions that fall below the character line, such as y, comma, etc.
- Fonts are drawn in bitmap format. Therefore, each character is a pixel map composed of 0s and 1s. The 0s symbolize undisplayed areas of the character, while the 1s represent the pixels of the character that will be displayed to the user. You must change each character array in the template font by adding the 1s where you want the pixels to appear to form the character. Below you will see an example of a blank character and the same representation of this character ready for the font.
The code below shows the bitmap representation of the hash sign (#) in the font model and the implementation in the font [aurora](https: //github.com/hexagonix/xfnt/blob/main/aurora.asm).
;; Blank representation of the hash (#) character in the template
.quill:
db 00000000b ;; Two pixels high for characters above the letter
db 00000000b
db 00000000b
db 00000000b
db 00000000b
db 00000000b
db 00000000b
db 00000000b
db 00000000b
db 00000000b
db 00000000b
db 00000000b ;; Five pixels tall for characters above the letter
db 00000000b
db 00000000b
db 00000000b
db 00000000b
;; Blank representation of the hash character (#), in aurora font
.quill:
db 00000000b
db 00000000b
db 00000000b
db 00000000b
db 00100010b
db 00100010b
db 01111111b
db 00100010b
db 01111111b
db 00100010b
db 00100010b
db 00000000b
db 00000000b
db 00000000b
db 00000000b
db 00000000b
You should already be able to see, inside the matrix, the hash mark, marked by the presence of 1s.
You can develop as many fonts as you like and play around with different and innovative designs, as well as extend the available characters (using the ASCII reference).