1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef ROSEN_MODULES_TEXGINE_SRC_SHAPER_H 17 #define ROSEN_MODULES_TEXGINE_SRC_SHAPER_H 18 19 #include "line_metrics.h" 20 #include "texgine/typography_style.h" 21 22 namespace OHOS { 23 namespace Rosen { 24 namespace TextEngine { 25 class Shaper { 26 public: 27 /* 28 * @brief Text shaping, in this, will do text breaker, bidirectional text processing 29 * line breaker, text merge, text reverse, and shape with harfbuzz 30 * @param spans The text or non text what user want to panit 31 * @param style Typography Style that user want 32 * @param fontProviders The font providers setting by user 33 * @param widthLimit The maximum display width set by the user 34 */ 35 static std::vector<LineMetrics> DoShape(std::vector<VariantSpan> spans, const TypographyStyle &tstyle, 36 const std::shared_ptr<FontProviders> &fontProviders, const double widthLimit); 37 }; 38 } // namespace TextEngine 39 } // namespace Rosen 40 } // namespace OHOS 41 42 #endif // ROSEN_MODULES_TEXGINE_SRC_SHAPER_H 43