1 #ifndef DALI_PLATFORM_TEXT_ABSTRACTION_TEXT_RENDERER_LAYOUT_HELPER_H
2 #define DALI_PLATFORM_TEXT_ABSTRACTION_TEXT_RENDERER_LAYOUT_HELPER_H
5 * Copyright (c) 2019 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.
22 #include <dali/public-api/common/dali-common.h>
23 #include <dali/public-api/dali-adaptor-common.h>
28 namespace TextAbstraction
32 * @brief Parameters used to transform the vertices of the glyphs to wrap a circular path.
34 struct DALI_ADAPTOR_API CircularTextParameters
36 CircularTextParameters()
43 synthesizeItalic{ false }
46 double centerX; ///< The 'x' center of the circular path.
47 double centerY; ///< The 'y' center of the circular path.
48 double radius; ///< The radius in pixels.
49 double invRadius; ///< 1.0 / radius.
50 double beginAngle; ///< The angle in radians where the circular text begins.
51 bool isClockwise:1; ///< Whether the circular text layout is clockwise.
52 bool synthesizeItalic:1; ///< Whether to synthesize italic.
56 * @brief Transforms a vertex to wrap a circular path.
58 * @param[in] parameters The parameters of the circular path.
59 * @param[in,out] x The 'x' coordinate of the vertex.
60 * @param[in,out] y The 'y' coordinate of the vertex.
62 DALI_ADAPTOR_API void TransformToArc( const CircularTextParameters& parameters, double& x, double& y );
64 } // namespace TextAbstraction
68 #endif // DALI_PLATFORM_TEXT_ABSTRACTION_TEXT_RENDERER_LAYOUT_HELPER_H