1 /* 2 * Copyright (c) 2020-2021 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 #ifndef GRAPHIC_LITE_UI_FONT_BUILDER_H 16 #define GRAPHIC_LITE_UI_FONT_BUILDER_H 17 18 #include "font/ui_font_header.h" 19 #include "gfx_utils/heap_base.h" 20 21 namespace OHOS { 22 class UIFontBuilder : public HeapBase { 23 public: 24 25 static UIFontBuilder* GetInstance(); 26 27 void SetTextLangFontsTable(const UITextLanguageFontParam* uiTextLangFontsTable, uint16_t totalFontId); 28 29 void SetLangTextDefaultParamTable(const LangTextParam* langTextDefaultParamTable, uint8_t totalLangId); 30 31 void SetMaxTextId(uint16_t totalTextId); 32 33 UITextLanguageFontParam* GetTextLangFontsTable(uint16_t langFontId); 34 35 uint8_t GetTotalLangId() const; 36 37 uint16_t GetTotalFontId() const; 38 39 uint16_t GetBitmapFontIdMax() const; 40 41 uint16_t GetTotalTextId() const; 42 43 LangTextParam* GetLangTextDefaultParamTable(); 44 45 UITextLanguageFontParam* uiTextLangFontsTable_; 46 LangTextParam* langTextDefaultParamTable_; 47 48 private: 49 UIFontBuilder(); ~UIFontBuilder()50 ~UIFontBuilder() {} 51 uint8_t totalLangId_; 52 uint16_t totalFontId_; 53 uint16_t totalTextId_; 54 }; 55 } 56 #endif // GRAPHIC_LITE_UI_FONT_BUILDER_H 57