update LoadFontData: codePoints can now be nil, codepointCount defaults to 95 (like C raylib does)

This commit is contained in:
JupiterRider 2024-11-03 15:36:07 +01:00
parent 893dfa5f85
commit 735af12e7f
2 changed files with 12 additions and 5 deletions

View file

@ -2900,9 +2900,12 @@ func IsFontReady(font Font) bool {
}
// LoadFontData - Load font data for further use
func LoadFontData(fileData []byte, fontSize int32, codepoints []rune, typ int32) []GlyphInfo {
func LoadFontData(fileData []byte, fontSize int32, codepoints []rune, codepointCount, typ int32) []GlyphInfo {
dataSize := int32(len(fileData))
codepointCount := int32(len(codepoints))
// In case no chars count provided, default to 95
if codepointCount <= 0 {
codepointCount = 95
}
ret := loadFontData(fileData, dataSize, fontSize, codepoints, codepointCount, typ)
return unsafe.Slice(ret, codepointCount)
}