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 5e771744f7804d411269729f13d9cf3a97a136fb..ba1dd012adbfdcc825f079a456b45b2e65053c49 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 f1a172c771b0200ddf11602f165595d3dcb6777b..63145d4cbc45244a18e1aa805665fa3973352a50 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 5d274c8bcee2afc37a306dfb6e44853e3544132e..3649dab641f0cb671024364ba01c53b8a34f457c 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