| 111 | } |
| 112 | |
| 113 | CFEGlyph CFEGetGlyphFromGlyphID(CommodettoFontEngine tf, uint16_t glyphID, uint8_t needPixels) |
| 114 | { |
| 115 | CFEGlyph glyph = &tf->glyph; |
| 116 | |
| 117 | if ((glyphID < tf->firstChar) || (glyphID > tf->lastChar)) |
| 118 | return NULL; |
| 119 | |
| 120 | glyphID -= tf->firstChar; |
| 121 | |
| 122 | glyph->dx = c_read8(tf->widthOffsetTable + (glyphID << 1) + 0); |
| 123 | if (glyph->dx & 0x80) |
| 124 | glyph->dx = -128 + (glyph->dx & 0x7f); |
| 125 | |
| 126 | glyph->advance = c_read8(tf->widthOffsetTable + (glyphID << 1) + 1); |
| 127 | if (glyph->advance & 0x80) |
| 128 | glyph->advance = -128 + (glyph->advance & 0x7f); |
| 129 | |
| 130 | glyph->sx = c_read16be(tf->bitmapLocationTable + glyphID); |
| 131 | glyph->w = c_read16be(tf->bitmapLocationTable + glyphID + 1) - glyph->sx; |
| 132 | glyph->h = tf->height; |
| 133 | glyph->substitute = C_NULL; |
| 134 | |
| 135 | return glyph; |
| 136 | } |
| 137 | |
| 138 | CFEGlyph CFEGetGlyphFromUnicode(CommodettoFontEngine tf, uint32_t unicode, uint8_t needPixels) |
| 139 | { |
no outgoing calls
no test coverage detected