Dali-Text: Keyboard Shortcuts
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / metrics.h
old mode 100644 (file)
new mode 100755 (executable)
index 232360e..d85fff4
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_TEXT_METRICS_H__
-#define __DALI_TOOLKIT_TEXT_METRICS_H__
+#ifndef DALI_TOOLKIT_TEXT_METRICS_H
+#define DALI_TOOLKIT_TEXT_METRICS_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ class Metrics;
 typedef IntrusivePtr<Metrics> MetricsPtr;
 
 /**
- * @brief A wrapper around FontClient used to get metrics & potentially down-scaled Emoji metrics.
+ * @brief A wrapper around FontClient used to get metrics.
  */
 class Metrics : public RefObject
 {
@@ -63,26 +63,6 @@ public:
   }
 
   /**
-   * @brief Set the maximum Emoji size.
-   *
-   * @param[in] emojiSize Emoticons will be scaled to fit this size in pixels.
-   */
-  void SetMaxEmojiSize( int emojiSize )
-  {
-    mEmojiSize = emojiSize;
-  }
-
-  /**
-   * @brief Get the maximum Emoji size.
-   *
-   * @return The maximum Emoji size.
-   */
-  int GetMaxEmojiSize() const
-  {
-    return mEmojiSize;
-  }
-
-  /**
    * @brief Query the metrics for a font.
    *
    * @param[in] fontId The ID of the font for the required glyph.
@@ -90,7 +70,7 @@ public:
    */
   void GetFontMetrics( FontId fontId, FontMetrics& metrics )
   {
-    mFontClient.GetFontMetrics( fontId, metrics, mEmojiSize ); // inline for performance
+    mFontClient.GetFontMetrics( fontId, metrics ); // inline for performance
   }
 
   /**
@@ -104,7 +84,19 @@ public:
    */
   bool GetGlyphMetrics( GlyphInfo* array, uint32_t size )
   {
-    return mFontClient.GetGlyphMetrics( array, size, mGlyphType, true, mEmojiSize ); // inline for performance
+    return mFontClient.GetGlyphMetrics( array, size, mGlyphType, true ); // inline for performance
+  }
+
+  /**
+   * @brief Whether the font has Italic style.
+   *
+   * @param[in] fontId The font identifier.
+   *
+   * @return true if the font has italic style.
+   */
+  bool HasItalicStyle( FontId fontId ) const
+  {
+    return mFontClient.HasItalicStyle( fontId );
   }
 
 protected:
@@ -121,10 +113,8 @@ private:
    */
   Metrics( TextAbstraction::FontClient& fontClient )
   : mFontClient( fontClient ),
-    mGlyphType( TextAbstraction::BITMAP_GLYPH ),
-    mEmojiSize( 0 )
-  {
-  }
+    mGlyphType( TextAbstraction::BITMAP_GLYPH )
+  {}
 
   // Undefined
   Metrics(const Metrics&);
@@ -136,7 +126,6 @@ private:
 
   TextAbstraction::FontClient mFontClient;
   TextAbstraction::GlyphType mGlyphType;
-  int mEmojiSize;
 };
 
 } // namespace Text
@@ -145,4 +134,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_TEXT_METRICS_H__
+#endif // DALI_TOOLKIT_TEXT_METRICS_H