Added underline position and thickness to FontMetrics 28/37628/1
authorRichard Underhill <r.underhill@partner.samsung.com>
Wed, 1 Apr 2015 10:53:43 +0000 (11:53 +0100)
committerRichard Underhill <r.underhill@partner.samsung.com>
Wed, 1 Apr 2015 10:53:43 +0000 (11:53 +0100)
Change-Id: I036851956f96fe604a30da0ba3c1be4a51eaf325
Signed-off-by: Richard Underhill <r.underhill@partner.samsung.com>
text/dali/internal/text-abstraction/font-client-plugin-impl.cpp
text/dali/public-api/text-abstraction/font-metrics.cpp
text/dali/public-api/text-abstraction/font-metrics.h

index 5e77174..ba1dd01 100644 (file)
@@ -749,7 +749,9 @@ FontId FontClient::Plugin::CreateFont( const FontPath& path,
             // Indicate that the font is a fixed sized bitmap
             FontMetrics metrics( fixedHeight,
                                  0.0f,
-                                 fixedHeight );
+                                 fixedHeight,
+                                 0.0f,
+                                 0.0f );
 
             mFontCache.push_back( CacheItem( ftFace, path, pointSize, faceIndex, metrics, fixedWidth, fixedHeight ) );
             id = mFontCache.size();
@@ -796,7 +798,9 @@ FontId FontClient::Plugin::CreateFont( const FontPath& path,
 
         FontMetrics metrics( static_cast< float >( ftMetrics.ascender  ) * FROM_266,
                              static_cast< float >( ftMetrics.descender ) * FROM_266,
-                             static_cast< float >( ftMetrics.height    ) * FROM_266 );
+                             static_cast< float >( ftMetrics.height    ) * FROM_266,
+                             static_cast< float >( ftFace->underline_position ) * FROM_266,
+                             static_cast< float >( ftFace->underline_thickness ) * FROM_266 );
 
         mFontCache.push_back( CacheItem( ftFace, path, pointSize, faceIndex, metrics ) );
         id = mFontCache.size();
index f1a172c..63145d4 100644 (file)
@@ -33,10 +33,14 @@ FontMetrics::FontMetrics()
 
 FontMetrics::FontMetrics( float ascenderPixels,
                           float descenderPixels,
-                          float heightPixels )
+                          float heightPixels,
+                          float underlinePositionPixels,
+                          float underlineThicknessPixels )
 : ascender( ascenderPixels ),
   descender( descenderPixels ),
-  height( heightPixels )
+  height( heightPixels ),
+  underlinePosition( underlinePositionPixels ),
+  underlineThickness( underlineThicknessPixels )
 {
 }
 
index 5d274c8..3649dab 100644 (file)
@@ -42,11 +42,15 @@ struct DALI_IMPORT_API FontMetrics
    */
   FontMetrics( float ascenderPixels,
                float descenderPixels,
-               float heightPixels );
-
-  float ascender;   ///< The ascender in pixels.
-  float descender;  ///< The descender in pixels.
-  float height;     ///< The height in pixels.
+               float heightPixels,
+               float underlinePositionPixels,
+               float underlinePositionThickness );
+
+  float ascender;             ///< The ascender in pixels.
+  float descender;            ///< The descender in pixels.
+  float height;               ///< The height in pixels.
+  float underlinePosition;    ///< The underline position in pixels.
+  float underlineThickness;   ///< The vertical height of the underline in pixels.
 };
 
 } // Dali