summaryrefslogtreecommitdiffstats
path: root/src/base/ftglyph.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/ftglyph.c')
-rw-r--r--src/base/ftglyph.c62
1 files changed, 29 insertions, 33 deletions
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index 5dd28a8..c62b3db 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -424,15 +424,16 @@
FT_Matrix* matrix,
FT_Vector* delta )
{
- const FT_Glyph_Class* clazz;
- FT_Error error = FT_Err_Ok;
+ FT_Error error = FT_Err_Ok;
if ( !glyph || !glyph->clazz )
error = FT_THROW( Invalid_Argument );
else
{
- clazz = glyph->clazz;
+ const FT_Glyph_Class* clazz = glyph->clazz;
+
+
if ( clazz->glyph_transform )
{
/* transform glyph image */
@@ -466,38 +467,33 @@
if ( !glyph || !glyph->clazz )
return;
- else
+
+ clazz = glyph->clazz;
+ if ( !clazz->glyph_bbox )
+ return;
+
+ /* retrieve bbox in 26.6 coordinates */
+ clazz->glyph_bbox( glyph, acbox );
+
+ /* perform grid fitting if needed */
+ if ( bbox_mode == FT_GLYPH_BBOX_GRIDFIT ||
+ bbox_mode == FT_GLYPH_BBOX_PIXELS )
{
- clazz = glyph->clazz;
- if ( !clazz->glyph_bbox )
- return;
- else
- {
- /* retrieve bbox in 26.6 coordinates */
- clazz->glyph_bbox( glyph, acbox );
-
- /* perform grid fitting if needed */
- if ( bbox_mode == FT_GLYPH_BBOX_GRIDFIT ||
- bbox_mode == FT_GLYPH_BBOX_PIXELS )
- {
- acbox->xMin = FT_PIX_FLOOR( acbox->xMin );
- acbox->yMin = FT_PIX_FLOOR( acbox->yMin );
- acbox->xMax = FT_PIX_CEIL( acbox->xMax );
- acbox->yMax = FT_PIX_CEIL( acbox->yMax );
- }
-
- /* convert to integer pixels if needed */
- if ( bbox_mode == FT_GLYPH_BBOX_TRUNCATE ||
- bbox_mode == FT_GLYPH_BBOX_PIXELS )
- {
- acbox->xMin >>= 6;
- acbox->yMin >>= 6;
- acbox->xMax >>= 6;
- acbox->yMax >>= 6;
- }
- }
+ acbox->xMin = FT_PIX_FLOOR( acbox->xMin );
+ acbox->yMin = FT_PIX_FLOOR( acbox->yMin );
+ acbox->xMax = FT_PIX_CEIL( acbox->xMax );
+ acbox->yMax = FT_PIX_CEIL( acbox->yMax );
+ }
+
+ /* convert to integer pixels if needed */
+ if ( bbox_mode == FT_GLYPH_BBOX_TRUNCATE ||
+ bbox_mode == FT_GLYPH_BBOX_PIXELS )
+ {
+ acbox->xMin >>= 6;
+ acbox->yMin >>= 6;
+ acbox->xMax >>= 6;
+ acbox->yMax >>= 6;
}
- return;
}