X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fmetrics.h;h=d85fff4866c74b335213f609473624e95e2a1f7e;hp=147ae79b90907c1dd595317b2227be8c25b4a708;hb=610495b8647d1a25c98bf0773ccc0dd6d1996263;hpb=766fdcbec7da7e0bcdc4964c56211b195b257c16 diff --git a/dali-toolkit/internal/text/metrics.h b/dali-toolkit/internal/text/metrics.h old mode 100644 new mode 100755 index 147ae79..d85fff4 --- a/dali-toolkit/internal/text/metrics.h +++ b/dali-toolkit/internal/text/metrics.h @@ -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. @@ -22,6 +22,9 @@ #include #include +// INTERNAL INCLUDES +#include + namespace Dali { @@ -35,7 +38,7 @@ class Metrics; typedef IntrusivePtr 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 { @@ -50,23 +53,13 @@ public: } /** - * @brief Set the maximum Emoji size. + * @brief Used to switch between bitmap & vector based glyphs * - * @param[in] emojiSize Emoticons will be scaled to fit this size in pixels. + * @param[in] glyphType The type of glyph; note that metrics for bitmap & vector based glyphs are different. */ - void SetMaxEmojiSize( int emojiSize ) + void SetGlyphType( TextAbstraction::GlyphType glyphType ) { - mEmojiSize = emojiSize; - } - - /** - * @brief Get the maximum Emoji size. - * - * @return The maximum Emoji size. - */ - int GetMaxEmojiSize() const - { - return mEmojiSize; + mGlyphType = glyphType; } /** @@ -77,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 } /** @@ -91,7 +84,19 @@ public: */ bool GetGlyphMetrics( GlyphInfo* array, uint32_t size ) { - return mFontClient.GetGlyphMetrics( array, size, 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: @@ -108,9 +113,8 @@ private: */ Metrics( TextAbstraction::FontClient& fontClient ) : mFontClient( fontClient ), - mEmojiSize( 0 ) - { - } + mGlyphType( TextAbstraction::BITMAP_GLYPH ) + {} // Undefined Metrics(const Metrics&); @@ -121,8 +125,7 @@ private: private: TextAbstraction::FontClient mFontClient; - - int mEmojiSize; + TextAbstraction::GlyphType mGlyphType; }; } // namespace Text @@ -131,4 +134,4 @@ private: } // namespace Dali -#endif // __DALI_TOOLKIT_TEXT_METRICS_H__ +#endif // DALI_TOOLKIT_TEXT_METRICS_H