165 SkScalerContext* SkScalerContext::getContextFromChar(SkUnichar uni, unsigned& glyphID) {
166 SkScalerContext* ctx = this;
167 for (;;) {
168 glyphID = ctx->generateCharToGlyph(uni);
169 if (glyphID) {
170 break;
171 }
172 ctx = ctx->getNextContext();
173 if (NULL == ctx) {
174 return NULL;
175 }
176 }
177 return ctx;
178 }
928 uint16_t SkScalerContext_FreeType::generateCharToGlyph(SkUnichar uni) {
929 return SkToU16(FT_Get_Char_Index( fFace, uni ));
930 }
3064 /*************************************************************************/
3065 /* */
3066 /* <Function> */
3067 /* FT_Get_Char_Index */
3068 /* */
3069 /* <Description> */
3070 /* Return the glyph index of a given character code. This function */
3071 /* uses a charmap object to do the mapping. */
3072 /* */
3073 /* <Input> */
3074 /* face :: A handle to the source face object. */
3075 /* */
3076 /* charcode :: The character code. */
3077 /* */
3078 /* <Return> */
3079 /* The glyph index. 0~means `undefined character code'. */
3080 /* */
3081 /* <Note> */
3082 /* If you use FreeType to manipulate the contents of font files */
3083 /* directly, be aware that the glyph index returned by this function */
3084 /* doesn't always correspond to the internal indices used within */
3085 /* the file. This is done to ensure that value~0 always corresponds */
3086 /* to the `missing glyph'. */
3087 /* */
3088 FT_EXPORT( FT_UInt )
3089 FT_Get_Char_Index( FT_Face face,
3090 FT_ULong charcode );