| 161 | } |
| 162 | |
| 163 | const unsigned char * |
| 164 | get_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 | |
| 191 | static void |
| 192 | add_unicode_index(struct BitmapFont *font, uint32 ch, unsigned index) |
no outgoing calls
no test coverage detected