MCPcopy Create free account
hub / github.com/NetHack/NetHack / get_font_glyph

Function get_font_glyph

sys/msdos/font.c:163–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163const unsigned char *
164get_font_glyph(struct BitmapFont *font, uint32 ch, boolean unicode)
165{
166 unsigned index;
167
168 if (unicode) {
169 index = 0;
170 if (ch <= 0x10FFFF && (ch & 0xFFFFD800) != 0xD800) {
171 unsigned i, j, k;
172
173 i = (unsigned) (ch >> 16);
174 j = (unsigned) ((ch >> 8) & 0xFF);
175 k = (unsigned) (ch & 0xFF);
176 if (font->unicode[i] != NULL
177 && font->unicode[i][j] != NULL) {
178 index = font->unicode[i][j][k];
179 }
180 }
181 } else {
182 index = ch;
183 }
184
185 if (index >= font->num_glyphs)
186 index = 0;
187
188 return font->glyphs[index];
189}
190
191static void
192add_unicode_index(struct BitmapFont *font, uint32 ch, unsigned index)

Callers 2

vga_GetBitmapFunction · 0.85
vesa_GetCharPixelRowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected