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()
45 double centerX; ///< The 'x' center of the circular path.
46 double centerY; ///< The 'y' center of the circular path.
47 double radius; ///< The radius in pixels.
48 double invRadius; ///< 1.0 / radius.
49 double beginAngle; ///< The angle in radians where the circular text begins.
50 bool isClockwise:1; ///< Whether the circular text layout is clockwise.
54 * @brief Transforms a vertex to wrap a clockwise circular path.
56 * @param[in] parameters The parameters of the circular path.
57 * @param[in,out] x The 'x' coordinate of the vertex.
58 * @param[in,out] y The 'y' coordinate of the vertex.
60 DALI_ADAPTOR_API void TransformToArcClockwise( const CircularTextParameters& parameters, double& x, double& y );
63 * @brief Transforms a vertex to wrap an anti clockwise circular path.
65 * @param[in] parameters The parameters of the circular path.
66 * @param[in,out] x The 'x' coordinate of the vertex.
67 * @param[in,out] y The 'y' coordinate of the vertex.
69 DALI_ADAPTOR_API void TransformToArcAntiClockwise( const CircularTextParameters& parameters, double& x, double& y );
71 } // namespace TextAbstraction
75 #endif // DALI_PLATFORM_TEXT_ABSTRACTION_TEXT_RENDERER_LAYOUT_HELPER_H