-#ifndef __DALI_TOOLKIT_TEXT_MULTI_LANGUAGE_SUPPORT_IMPL_H__
-#define __DALI_TOOLKIT_TEXT_MULTI_LANGUAGE_SUPPORT_IMPL_H__
+#ifndef DALI_TOOLKIT_TEXT_MULTI_LANGUAGE_SUPPORT_IMPL_H
+#define DALI_TOOLKIT_TEXT_MULTI_LANGUAGE_SUPPORT_IMPL_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.
*
* @return @e true if the font is in the vector of valid fonts.
*/
- bool FindValidFont( FontId fontId ) const;
+ bool IsValidFont( FontId fontId ) const;
Vector<FontId> mValidFonts;
};
*/
struct DefaultFonts
{
+ struct CacheItem
+ {
+ TextAbstraction::FontDescription description;
+ FontId fontId;
+ };
+
/**
* Default constructor.
*/
* @brief Finds a default font for the given @p size.
*
* @param[in] fontClient The font client.
+ * @param[in] description The font's description.
* @param[in] size The given size.
*
* @return The font id of a default font for the given @p size. If there isn't any font cached it returns 0.
*/
- FontId FindFont( TextAbstraction::FontClient& fontClient, PointSize26Dot6 size ) const;
+ FontId FindFont( TextAbstraction::FontClient& fontClient,
+ const TextAbstraction::FontDescription& description,
+ PointSize26Dot6 size ) const;
+
+ void Cache( const TextAbstraction::FontDescription& description, FontId fontId );
- Vector<FontId> mFonts;
+ std::vector<CacheItem> mFonts;
};
/**
void ValidateFonts( const Vector<Character>& text,
const Vector<ScriptRun>& scripts,
const Vector<FontDescriptionRun>& fontDescriptions,
- FontId defaultFontId,
+ const TextAbstraction::FontDescription& defaultFontDescription,
+ TextAbstraction::PointSize26Dot6 defaultFontPointSize,
CharacterIndex startIndex,
Length numberOfCharacters,
Vector<FontRun>& fonts );
} // namespace Dali
-#endif // __DALI_TOOLKIT_TEXT_MULTI_LANGUAGE_SUPPORT_IMPL_H__
+#endif // DALI_TOOLKIT_TEXT_MULTI_LANGUAGE_SUPPORT_IMPL_H