Fixed else condition in GetGlyphMetrics() 12/36812/1
authorPaul Wisbey <p.wisbey@samsung.com>
Sun, 15 Mar 2015 17:22:37 +0000 (17:22 +0000)
committerPaul Wisbey <p.wisbey@samsung.com>
Sun, 15 Mar 2015 17:23:55 +0000 (17:23 +0000)
Change-Id: I20fdafceefd057a6f0ad8dac80dcdead6b209db0

text/dali/internal/text-abstraction/font-client-plugin-impl.cpp

index 2b67f4104934dab04835f6c7c3136806780600d8..3b730f578e012389dd673582c8b4d7b0c2d14c6c 100644 (file)
@@ -507,30 +507,32 @@ bool FontClient::Plugin::GetGlyphMetrics( GlyphInfo* array,
           success = false;
         }
       }
-
-      int error = FT_Load_Glyph( ftFace, array[i].index, FT_LOAD_DEFAULT );
-
-      if( FT_Err_Ok == error )
+      else
       {
-        array[i].width  = static_cast< float >( ftFace->glyph->metrics.width ) * FROM_266;
-        array[i].height = static_cast< float >( ftFace->glyph->metrics.height ) * FROM_266 ;
-        if( horizontal )
+        int error = FT_Load_Glyph( ftFace, array[i].index, FT_LOAD_DEFAULT );
+
+        if( FT_Err_Ok == error )
         {
-          array[i].xBearing = static_cast< float >( ftFace->glyph->metrics.horiBearingX ) * FROM_266;
-          array[i].yBearing = static_cast< float >( ftFace->glyph->metrics.horiBearingY ) * FROM_266;
-          array[i].advance  = static_cast< float >( ftFace->glyph->metrics.horiAdvance ) * FROM_266;
+          array[i].width  = static_cast< float >( ftFace->glyph->metrics.width ) * FROM_266;
+          array[i].height = static_cast< float >( ftFace->glyph->metrics.height ) * FROM_266 ;
+          if( horizontal )
+          {
+            array[i].xBearing = static_cast< float >( ftFace->glyph->metrics.horiBearingX ) * FROM_266;
+            array[i].yBearing = static_cast< float >( ftFace->glyph->metrics.horiBearingY ) * FROM_266;
+            array[i].advance  = static_cast< float >( ftFace->glyph->metrics.horiAdvance ) * FROM_266;
+          }
+          else
+          {
+            array[i].xBearing = static_cast< float >( ftFace->glyph->metrics.vertBearingX ) * FROM_266;
+            array[i].yBearing = static_cast< float >( ftFace->glyph->metrics.vertBearingY ) * FROM_266;
+            array[i].advance  = static_cast< float >( ftFace->glyph->metrics.vertAdvance ) * FROM_266;
+          }
         }
         else
         {
-          array[i].xBearing = static_cast< float >( ftFace->glyph->metrics.vertBearingX ) * FROM_266;
-          array[i].yBearing = static_cast< float >( ftFace->glyph->metrics.vertBearingY ) * FROM_266;
-          array[i].advance  = static_cast< float >( ftFace->glyph->metrics.vertAdvance ) * FROM_266;
+          success = false;
         }
       }
-      else
-      {
-        success = false;
-      }
     }
     else
     {