| 174 | } |
| 175 | |
| 176 | FT_GlyphSlot FontRendererImpl::RenderCharacterBitmap(int face_id, uint32_t character, FontRenderer::RCB_Flags flags) { |
| 177 | FT_Face face = faces_[face_id].face; |
| 178 | // Get index of a glyph |
| 179 | int glyph_index = FT_Get_Char_Index(face, character); |
| 180 | // Load glyph into slot |
| 181 | int error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT); |
| 182 | if (error) { |
| 183 | FatalError("Error", "Failed to load font glyph into slot"); |
| 184 | } |
| 185 | // Render glyph in slot |
| 186 | if (flags & FontRenderer::RCB_RENDER) { |
| 187 | error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL); |
| 188 | if (error) { |
| 189 | FatalError("Error", "Failed to render glyph"); |
| 190 | } |
| 191 | } |
| 192 | return face->glyph; |
| 193 | } |
| 194 | |
| 195 | void FontRendererImpl::GetKerning(int face_id, char character_a, char character_b, FT_Vector *vec) { |
| 196 | FT_Face face = faces_[face_id].face; |
no test coverage detected