Lines Matching refs:glyph
91 void Font::drawCachedGlyph(CachedGlyphInfo *glyph, int32_t x, int32_t y) { in drawCachedGlyph() argument
94 int32_t nPenX = x + glyph->mBitmapLeft; in drawCachedGlyph()
95 int32_t nPenY = y - glyph->mBitmapTop + glyph->mBitmapHeight; in drawCachedGlyph()
97 float u1 = glyph->mBitmapMinU; in drawCachedGlyph()
98 float u2 = glyph->mBitmapMaxU; in drawCachedGlyph()
99 float v1 = glyph->mBitmapMinV; in drawCachedGlyph()
100 float v2 = glyph->mBitmapMaxV; in drawCachedGlyph()
102 int32_t width = (int32_t) glyph->mBitmapWidth; in drawCachedGlyph()
103 int32_t height = (int32_t) glyph->mBitmapHeight; in drawCachedGlyph()
111 void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int32_t x, int32_t y, in drawCachedGlyph() argument
113 int32_t nPenX = x + glyph->mBitmapLeft; in drawCachedGlyph()
114 int32_t nPenY = y + glyph->mBitmapTop; in drawCachedGlyph()
116 uint32_t endX = glyph->mBitmapMinX + glyph->mBitmapWidth; in drawCachedGlyph()
117 uint32_t endY = glyph->mBitmapMinY + glyph->mBitmapHeight; in drawCachedGlyph()
125 for (cacheX = glyph->mBitmapMinX, bX = nPenX; cacheX < endX; cacheX++, bX++) { in drawCachedGlyph()
126 for (cacheY = glyph->mBitmapMinY, bY = nPenY; cacheY < endY; cacheY++, bY++) { in drawCachedGlyph()
137 void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int32_t x, int32_t y, Rect *bounds) { in measureCachedGlyph() argument
138 int32_t nPenX = x + glyph->mBitmapLeft; in measureCachedGlyph()
139 int32_t nPenY = y - glyph->mBitmapTop + glyph->mBitmapHeight; in measureCachedGlyph()
141 int32_t width = (int32_t) glyph->mBitmapWidth; in measureCachedGlyph()
142 int32_t height = (int32_t) glyph->mBitmapHeight; in measureCachedGlyph()
237 void Font::updateGlyphCache(CachedGlyphInfo *glyph) { in updateGlyphCache() argument
239 FT_Error error = FT_Load_Glyph( mFace, glyph->mGlyphIndex, FT_LOAD_RENDER ); in updateGlyphCache()
245 glyph->mAdvanceX = mFace->glyph->advance.x; in updateGlyphCache()
246 glyph->mAdvanceY = mFace->glyph->advance.y; in updateGlyphCache()
247 glyph->mBitmapLeft = mFace->glyph->bitmap_left; in updateGlyphCache()
248 glyph->mBitmapTop = mFace->glyph->bitmap_top; in updateGlyphCache()
250 FT_Bitmap *bitmap = &mFace->glyph->bitmap; in updateGlyphCache()
258 glyph->mIsValid = state->cacheBitmap(bitmap, &startX, &startY); in updateGlyphCache()
260 if (!glyph->mIsValid) { in updateGlyphCache()
267 glyph->mBitmapMinX = startX; in updateGlyphCache()
268 glyph->mBitmapMinY = startY; in updateGlyphCache()
269 glyph->mBitmapWidth = bitmap->width; in updateGlyphCache()
270 glyph->mBitmapHeight = bitmap->rows; in updateGlyphCache()
275 glyph->mBitmapMinU = (float)startX / (float)cacheWidth; in updateGlyphCache()
276 glyph->mBitmapMinV = (float)startY / (float)cacheHeight; in updateGlyphCache()
277 glyph->mBitmapMaxU = (float)endX / (float)cacheWidth; in updateGlyphCache()
278 glyph->mBitmapMaxV = (float)endY / (float)cacheHeight; in updateGlyphCache()
282 Font::CachedGlyphInfo *Font::cacheGlyph(uint32_t glyph) { in cacheGlyph() argument
284 mCachedGlyphs.add(glyph, newGlyph); in cacheGlyph()
286 newGlyph->mGlyphIndex = FT_Get_Char_Index(mFace, glyph); in cacheGlyph()
326 CachedGlyphInfo *glyph = mCachedGlyphs.valueAt(i); in ~Font() local
327 delete glyph; in ~Font()