1 #ifndef DALI_TEXT_ABSTRACTION_INTERNAL_HARFBUZZ_PROXY_FONT_H
2 #define DALI_TEXT_ABSTRACTION_INTERNAL_HARFBUZZ_PROXY_FONT_H
5 * Copyright (c) 2022 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.
21 #include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
22 #include <dali/internal/text/text-abstraction/font-client-impl.h> // for HarfBuzzFontHandle
23 #include <dali/internal/text/text-abstraction/plugin/font-face-glyph-cache-manager.h>
27 #include FT_FREETYPE_H
29 namespace Dali::TextAbstraction::Internal
32 * @brief Helper class to shape of FT_Face by harfbuzz library.
33 * @note Current class only be used for font face cache item.
35 class HarfBuzzProxyFont
39 * @brief Constructor harfbuzz font data integrated with FreeType face and our font face cache item.
41 * @param[in] freeTypeFace The FreeType face.
42 * @param[in] requestedPointSize The requiested point size of font.
43 * @param[in] horizontalDpi Horizontal DPI.
44 * @param[in] verticalDpi Vertical DPI.
45 * @param[in] glyphCacheManager Glyph caching system for this harfbuzz font. It will be used as harfbuzz callback data.
47 HarfBuzzProxyFont(FT_Face freeTypeFace, const PointSize26Dot6& requestedPointSize, const uint32_t& horizontalDpi, const uint32_t& verticalDpi, GlyphCacheManager* glyphCacheManager);
56 * @brief Get the created harfbuzz font data integrated with FreeType face and our font face cache item.
58 * @return Created harfbuzz font data. or nullptr if there is something error.
60 HarfBuzzFontHandle GetHarfBuzzFont() const;
64 HarfBuzzProxyFont() = delete; // Do not use default construct
65 HarfBuzzProxyFont(const HarfBuzzProxyFont& rhs) = delete; // Do not use copy construct
66 HarfBuzzProxyFont(HarfBuzzProxyFont&& rhs) = delete; // Do not use move construct
68 struct Impl; // Harfbuzz callback can access this struct.
69 uint32_t mHorizontalDpi; ///< Horizontal DPI.
70 uint32_t mVerticalDpi; ///< VerticalDPI.
73 // Private member value area.
77 } // namespace Dali::TextAbstraction::Internal
79 #endif //DALI_TEXT_ABSTRACTION_INTERNAL_HARFBUZZ_PROXY_FONT_H