1 #ifndef DALI_TEST_ABSTRACTION_INTERNAL_FONT_CACHE_ITEM_INTERFACE_H
2 #define DALI_TEST_ABSTRACTION_INTERNAL_FONT_CACHE_ITEM_INTERFACE_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 #include <dali/devel-api/text-abstraction/font-client.h>
21 #include <dali/devel-api/text-abstraction/font-metrics.h>
22 #include <dali/devel-api/text-abstraction/glyph-info.h>
25 #include FT_FREETYPE_H
27 namespace Dali::TextAbstraction::Internal
29 struct FontCacheItemInterface
32 * Get the font metrics
34 * @param[out] metrics The metrics struct to fill out
36 virtual void GetFontMetrics(FontMetrics& metrics, unsigned int dpiVertical) const = 0;
41 * @param[in,out] glyph The glyph to fill
43 virtual bool GetGlyphMetrics(GlyphInfo& glyph, unsigned int dpiVertical, bool horizontal) const = 0;
46 * Create a bitmap for the given glyph
48 * @param[in] glyphIndex The index of the glyph
49 * @param[out] data The bitmap data for the glyph
50 * @param[in] outlineWidth
51 * @param[in] isItalicRequired
52 * @param[in] isBoldRequired
54 virtual void CreateBitmap(GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth, bool isItalicRequired, bool isBoldRequired) const = 0;
57 * Return true if the glyph is colored
59 * @param[in] glyphIndex The index of the glyph
60 * @return true if the glyph is colored
62 virtual bool IsColorGlyph(GlyphIndex glyphIndex) const = 0;
65 * Check if the character is supported by this font
66 * @param[in] character The character to test
68 virtual bool IsCharacterSupported(Character character) = 0;
71 * Get the point size of this font
72 * @return the point size
74 virtual PointSize26Dot6 GetPointSize() const = 0;
77 * Get the index into this font's glyph table of the character
79 * @param[in] character to look up
80 * @return the glyph index of this character
82 virtual GlyphIndex GetGlyphIndex(Character character) const = 0;
85 * Get the freetype typeface for this font.
87 virtual FT_Face GetTypeface() const = 0;
90 * @return true if this font has an italic style
92 virtual bool HasItalicStyle() const = 0;
95 } // namespace Dali::TextAbstraction::Internal
97 #endif // DALI_TEST_ABSTRACTION_INTERNAL_FONT_CACHE_ITEM_INTERFACE_H