MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / grfont_KeyToAscii

Function grfont_KeyToAscii

grtext/grfont.cpp:1056–1069  ·  view source on GitHub ↗

returns character equivalent in font (converts lowercase to uppercase if no lowercase version avail) similar to ddio_KeyToAscii

Source from the content-addressed store, hash-verified

1054// returns character equivalent in font (converts lowercase to uppercase if no lowercase version avail)
1055// similar to ddio_KeyToAscii
1056int grfont_KeyToAscii(int font, int key) {
1057 key = ddio_KeyToAscii(key);
1058
1059 if (font >= 0 && font < MAX_FONTS) {
1060 tFontInfo *ft = &Fonts[font];
1061
1062 // save current x and get this font
1063 if (key > ft->font.max_ascii && (ft->font.flags & FT_UPPERCASE)) {
1064 return toupper(key);
1065 }
1066 }
1067
1068 return key;
1069}
1070
1071// MTS: Unused?
1072// returns the raw bitmap data for a character in a font, its width and height

Callers 1

OnKeyDownMethod · 0.85

Calls 1

ddio_KeyToAsciiFunction · 0.85

Tested by

no test coverage detected