| | 1290 | /* Draw an outline for the character if requested |
|---|
| | 1291 | and if we have a valid outline color to draw with. */ |
|---|
| | 1292 | if (strex && |
|---|
| | 1293 | (strex->flags & gdFTEX_DRAWOUTLINE) == gdFTEX_DRAWOUTLINE && |
|---|
| | 1294 | (im && (im->trueColor || (strex->outlinecolor <= 255 && |
|---|
| | 1295 | strex->outlinecolor >= -255)))) |
|---|
| | 1296 | { |
|---|
| | 1297 | FT_Glyph borderimg; |
|---|
| | 1298 | FT_Stroker stroker; |
|---|
| | 1299 | |
|---|
| | 1300 | /* Copy the image to work the outline */ |
|---|
| | 1301 | FT_Glyph_Copy(image, &borderimg); |
|---|
| | 1302 | |
|---|
| | 1303 | /* Extract the character stroker */ |
|---|
| | 1304 | FT_Stroker_New (face->memory, &stroker); |
|---|
| | 1305 | FT_Stroker_Set (stroker, |
|---|
| | 1306 | 80, |
|---|
| | 1307 | FT_STROKER_LINECAP_ROUND, |
|---|
| | 1308 | FT_STROKER_LINEJOIN_ROUND, |
|---|
| | 1309 | 1); |
|---|
| | 1310 | FT_Glyph_Stroke (&borderimg, stroker, 1); |
|---|
| | 1311 | |
|---|
| | 1312 | /* Draw the stroker on the image */ |
|---|
| | 1313 | if (borderimg->format != ft_glyph_format_bitmap) |
|---|
| | 1314 | { |
|---|
| | 1315 | err = FT_Glyph_To_Bitmap (&borderimg, ft_render_mode_normal, 0, 1); |
|---|
| | 1316 | if (err) |
|---|
| | 1317 | { |
|---|
| | 1318 | gdCacheDelete (tc_cache); |
|---|
| | 1319 | gdMutexUnlock (gdFontCacheMutex); |
|---|
| | 1320 | return "Problem rendering glyph"; |
|---|
| | 1321 | } |
|---|
| | 1322 | } |
|---|
| | 1323 | bm = (FT_BitmapGlyph) borderimg; |
|---|
| | 1324 | |
|---|
| | 1325 | /* Draw the actual character outline */ |
|---|
| | 1326 | gdft_draw_bitmap (tc_cache, im, strex->outlinecolor, bm->bitmap, |
|---|
| | 1327 | x + (penf.x * cos_a + penf.y * sin_a)*hdpi/(METRIC_RES*64) + bm->left, |
|---|
| | 1328 | y - (penf.x * sin_a - penf.y * cos_a)*vdpi/(METRIC_RES*64) - bm->top); |
|---|
| | 1329 | |
|---|
| | 1330 | FT_Done_Glyph (borderimg); |
|---|
| | 1331 | } |
|---|
| | 1332 | |
|---|