Add missing characters and punctuation
This commit is contained in:
@@ -452,11 +452,81 @@ func rotateLayer(arr []int, gridSize, layer int) {
|
|||||||
|
|
||||||
// createFontMap generates a texture atlas for a given font entry.
|
// createFontMap generates a texture atlas for a given font entry.
|
||||||
func (fm *FontManager) createFontMap(font *FontEntry, scramble bool, baseFont *FontEntry) error {
|
func (fm *FontManager) createFontMap(font *FontEntry, scramble bool, baseFont *FontEntry) error {
|
||||||
var chars []rune
|
// var chars []rune
|
||||||
for i := rune(32); i <= 126; i++ { // Common ASCII characters
|
// for i := rune(32); i <= 126; i++ { // Common ASCII characters
|
||||||
chars = append(chars, i)
|
// chars = append(chars, i)
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
// Standard ASCII (A-Z, a-z, 0-9) + punctuation
|
||||||
|
chars := []rune{
|
||||||
|
// Numbers 0-9
|
||||||
|
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, // 0-9
|
||||||
|
|
||||||
|
// Uppercase A-Z
|
||||||
|
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // A-O
|
||||||
|
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, // P-Z
|
||||||
|
|
||||||
|
// Lowercase a-z
|
||||||
|
97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, // a-m
|
||||||
|
110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, // n-z
|
||||||
|
|
||||||
|
// Basic punctuation (ASCII 32-47, 58-64, 91-96, 123-126)
|
||||||
|
32, // Space
|
||||||
|
33, // !
|
||||||
|
34, // "
|
||||||
|
35, // #
|
||||||
|
36, // $
|
||||||
|
37, // %
|
||||||
|
38, // &
|
||||||
|
39, // '
|
||||||
|
40, // (
|
||||||
|
41, // )
|
||||||
|
42, // *
|
||||||
|
43, // +
|
||||||
|
44, // ,
|
||||||
|
45, // -
|
||||||
|
46, // .
|
||||||
|
47, // /
|
||||||
|
58, // :
|
||||||
|
59, // ;
|
||||||
|
60, // <
|
||||||
|
61, // =
|
||||||
|
62, // >
|
||||||
|
63, // ?
|
||||||
|
64, // @
|
||||||
|
91, // [
|
||||||
|
92, // \
|
||||||
|
93, // ]
|
||||||
|
94, // ^
|
||||||
|
95, // _
|
||||||
|
96, // `
|
||||||
|
123, // {
|
||||||
|
124, // |
|
||||||
|
125, // }
|
||||||
|
126, // ~
|
||||||
|
|
||||||
|
// Common Unicode punctuation
|
||||||
|
161, // ¡
|
||||||
|
191, // ¿
|
||||||
|
8211, // –
|
||||||
|
8212, // —
|
||||||
|
8216, // ‘
|
||||||
|
8217, // ’
|
||||||
|
8220, // “
|
||||||
|
8221, // ”
|
||||||
|
8226, // •
|
||||||
|
8230, // …
|
||||||
|
8240, // ‰
|
||||||
|
8364, // €
|
||||||
|
162, // ¢
|
||||||
|
163, // £
|
||||||
|
165, // ¥
|
||||||
|
169, // ©
|
||||||
|
174, // ®
|
||||||
|
8482, // ™
|
||||||
|
232, // è
|
||||||
|
233, // é
|
||||||
|
}
|
||||||
tempGlyphs := make([]TempGlyph, 0, len(chars))
|
tempGlyphs := make([]TempGlyph, 0, len(chars))
|
||||||
var totalWidth, maxHeight int32
|
var totalWidth, maxHeight int32
|
||||||
padding := int32(2) // 2 pixels of padding between glyphs
|
padding := int32(2) // 2 pixels of padding between glyphs
|
||||||
|
|||||||
Reference in New Issue
Block a user