From: Paul Wisbey Date: Sun, 15 Mar 2015 11:57:18 +0000 (+0000) Subject: Framework for Font styles X-Git-Tag: dali_1.0.38~8^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da3bc70674ba0fd25e3b58838ec6f93ec29cbb5d;p=platform%2Fcore%2Fuifw%2Fdali-core.git Framework for Font styles Change-Id: I4ef46e6e2d6ce644aa4a4aa507aa274728f9c736 --- diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.cpp index ee71ec4e0..30ae3102d 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.cpp +++ b/automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.cpp @@ -162,6 +162,25 @@ bool TestPlatformAbstraction::IsLoading() return mIsLoadingResult; } +/** + * @copydoc PlatformAbstraction::GetDefaultFontDescription() + */ +void TestPlatformAbstraction::GetDefaultFontDescription( std::string& family, std::string& style ) const +{ + mTrace.PushCall("GetDefaultFontFamily", ""); + family = mGetDefaultFontFamilyResult; + style = mGetDefaultFontStyleResult; +} + +/** + * @copydoc PlatformAbstraction::GetDefaultFontSize() + */ +int TestPlatformAbstraction::GetDefaultFontSize() const +{ + mTrace.PushCall("GetDefaultFontSize", ""); + return mGetDefaultFontSizeResult; +} + /** * @copydoc PlatformAbstraction::SetDpi() */ diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.h b/automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.h index 682dd0df3..3c19c7518 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.h +++ b/automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.h @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include #include +#include // INTERNAL INCLUDES #include @@ -132,6 +133,16 @@ public: */ virtual bool IsLoading(); + /** + * @copydoc PlatformAbstraction::GetDefaultFontFamily() + */ + virtual void GetDefaultFontDescription( std::string& family, std::string& style ) const; + + /** + * @copydoc PlatformAbstraction::GetDefaultFontSize() + */ + virtual int GetDefaultFontSize() const; + /** * @copydoc PlatformAbstraction::SetDpi() */ @@ -221,6 +232,9 @@ private: size_t mSeconds; size_t mMicroSeconds; bool mIsLoadingResult; + std::string mGetDefaultFontFamilyResult; + std::string mGetDefaultFontStyleResult; + int mGetDefaultFontSizeResult; Resources mResources; Integration::ResourceRequest* mRequest; Vector2 mSize; diff --git a/dali/integration-api/platform-abstraction.h b/dali/integration-api/platform-abstraction.h index 9708d1cb3..d256ccd7c 100644 --- a/dali/integration-api/platform-abstraction.h +++ b/dali/integration-api/platform-abstraction.h @@ -161,6 +161,27 @@ public: */ virtual void JoinLoaderThreads() = 0; + // Font Queries + + /** + * Called by Dali to retrieve the default font family & style for the platform. + * Multi-threading note: this method will be called from the main thread only i.e. not + * from within the Core::Render() method. + * @param[out] The default font family. + * @param[out] The default font style. + */ + virtual void GetDefaultFontDescription( std::string& family, std::string& style ) const = 0; + + /** + * Called by Dali to retrieve the default font size for the platform. + * This is an accessibility size, which is mapped to a UI Control specific point-size in stylesheets. + * For example if zero the smallest size, this could potentially map to TextLabel point-size 8. + * Multi-threading note: this method will be called from the main thread only i.e. not + * from within the Core::Render() method. + * @return The default font size. + */ + virtual int GetDefaultFontSize() const = 0; + /** * Sets horizontal and vertical pixels per inch value that is used by the display * @param[in] dpiHorizontal horizontal dpi value