17c804472Sopenharmony_ci/*
27c804472Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
37c804472Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
47c804472Sopenharmony_ci * you may not use this file except in compliance with the License.
57c804472Sopenharmony_ci * You may obtain a copy of the License at
67c804472Sopenharmony_ci *
77c804472Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
87c804472Sopenharmony_ci *
97c804472Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
107c804472Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
117c804472Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
127c804472Sopenharmony_ci * See the License for the specific language governing permissions and
137c804472Sopenharmony_ci * limitations under the License.
147c804472Sopenharmony_ci */
157c804472Sopenharmony_ci
167c804472Sopenharmony_ci#include "ui_font_vector.h"
177c804472Sopenharmony_ci
187c804472Sopenharmony_cinamespace {
197c804472Sopenharmony_ci    int8_t defaultRetVal = 1;
207c804472Sopenharmony_ci}
217c804472Sopenharmony_ci
227c804472Sopenharmony_cinamespace OHOS {
237c804472Sopenharmony_ci    UIFontVector::UIFontVector() {}
247c804472Sopenharmony_ci
257c804472Sopenharmony_ci    UIFontVector::~UIFontVector() {}
267c804472Sopenharmony_ci
277c804472Sopenharmony_ci    bool UIFontVector::IsColorEmojiFont(FT_Face& face)
287c804472Sopenharmony_ci    {
297c804472Sopenharmony_ci        return true;
307c804472Sopenharmony_ci    }
317c804472Sopenharmony_ci
327c804472Sopenharmony_ci    int8_t SetupColorFont(FT_Face face, uint8_t fontSize)
337c804472Sopenharmony_ci    {
347c804472Sopenharmony_ci        return defaultRetVal;
357c804472Sopenharmony_ci    }
367c804472Sopenharmony_ci
377c804472Sopenharmony_ci    uint8_t UIFontVector::RegisterFontInfo(const char* ttfName, uint8_t shaping)
387c804472Sopenharmony_ci    {
397c804472Sopenharmony_ci        return defaultRetVal;
407c804472Sopenharmony_ci    }
417c804472Sopenharmony_ci
427c804472Sopenharmony_ci    uint8_t UIFontVector::RegisterFontInfo(const UITextLanguageFontParam* fontsTable, uint8_t num)
437c804472Sopenharmony_ci    {
447c804472Sopenharmony_ci        return defaultRetVal;
457c804472Sopenharmony_ci    }
467c804472Sopenharmony_ci
477c804472Sopenharmony_ci    uint8_t UIFontVector::RegisterTtcFontInfo(const char* ttcName, const TtfInfo* ttfInfo, uint8_t count)
487c804472Sopenharmony_ci    {
497c804472Sopenharmony_ci        return defaultRetVal;
507c804472Sopenharmony_ci    }
517c804472Sopenharmony_ci
527c804472Sopenharmony_ci    uint8_t UIFontVector::UnregisterTtcFontInfo(const char* ttcName, const TtfInfo* ttfInfo, uint8_t count)
537c804472Sopenharmony_ci    {
547c804472Sopenharmony_ci        return defaultRetVal;
557c804472Sopenharmony_ci    }
567c804472Sopenharmony_ci
577c804472Sopenharmony_ci    uint8_t UIFontVector::UnregisterFontInfo(const UITextLanguageFontParam* fontsTable, uint8_t num)
587c804472Sopenharmony_ci    {
597c804472Sopenharmony_ci        return defaultRetVal;
607c804472Sopenharmony_ci    }
617c804472Sopenharmony_ci
627c804472Sopenharmony_ci    uint8_t UIFontVector::UnregisterFontInfo(const char* ttfName)
637c804472Sopenharmony_ci    {
647c804472Sopenharmony_ci        return defaultRetVal;
657c804472Sopenharmony_ci    }
667c804472Sopenharmony_ci
677c804472Sopenharmony_ci    const UITextLanguageFontParam* UIFontVector::GetFontInfo(uint16_t fontId) const
687c804472Sopenharmony_ci    {
697c804472Sopenharmony_ci        return nullptr;
707c804472Sopenharmony_ci    }
717c804472Sopenharmony_ci
727c804472Sopenharmony_ci    int32_t UIFontVector::OpenVectorFont(uint8_t ttfId)
737c804472Sopenharmony_ci    {
747c804472Sopenharmony_ci        return defaultRetVal;
757c804472Sopenharmony_ci    }
767c804472Sopenharmony_ci
777c804472Sopenharmony_ci    bool UIFontVector::GetTtfInfo(uint8_t ttfId, uint8_t* ttfBuffer, uint32_t ttfBufferSize, TtfHeader& ttfHeader)
787c804472Sopenharmony_ci    {
797c804472Sopenharmony_ci        return true;
807c804472Sopenharmony_ci    }
817c804472Sopenharmony_ci
827c804472Sopenharmony_ci    bool UIFontVector::GetTtfInfoFromTtf(uint8_t* ttfBuffer, uint32_t ttfBufferSize, TtfHeader& ttfHeader,
837c804472Sopenharmony_ci        UITextLanguageFontParam fontInfo)
847c804472Sopenharmony_ci    {
857c804472Sopenharmony_ci        return true;
867c804472Sopenharmony_ci    }
877c804472Sopenharmony_ci
887c804472Sopenharmony_ci    struct TtcHeader {
897c804472Sopenharmony_ci        uint32_t ttcTag;
907c804472Sopenharmony_ci        uint16_t major;
917c804472Sopenharmony_ci        uint16_t minor;
927c804472Sopenharmony_ci        int32_t numFonts;
937c804472Sopenharmony_ci    };
947c804472Sopenharmony_ci
957c804472Sopenharmony_ci    bool UIFontVector::GetTtfInfoFromTtc(uint8_t* ttfBuffer, uint32_t ttfBufferSize, TtfHeader& ttfHeader,
967c804472Sopenharmony_ci        UITextLanguageFontParam fontInfo)
977c804472Sopenharmony_ci    {
987c804472Sopenharmony_ci        return true;
997c804472Sopenharmony_ci    }
1007c804472Sopenharmony_ci
1017c804472Sopenharmony_ci    bool UIFontVector::IsVectorFont() const
1027c804472Sopenharmony_ci    {
1037c804472Sopenharmony_ci        return true;
1047c804472Sopenharmony_ci    }
1057c804472Sopenharmony_ci
1067c804472Sopenharmony_ci    uint8_t UIFontVector::GetFontWeight(uint16_t fontId)
1077c804472Sopenharmony_ci    {
1087c804472Sopenharmony_ci        return defaultRetVal;
1097c804472Sopenharmony_ci    }
1107c804472Sopenharmony_ci
1117c804472Sopenharmony_ci    int8_t UIFontVector::SetFontPath(const char* path, FontType type)
1127c804472Sopenharmony_ci    {
1137c804472Sopenharmony_ci        return defaultRetVal;
1147c804472Sopenharmony_ci    }
1157c804472Sopenharmony_ci
1167c804472Sopenharmony_ci    int8_t UIFontVector::GetFaceInfo(uint16_t fontId, uint8_t fontSize, FaceInfo& faceInfo)
1177c804472Sopenharmony_ci    {
1187c804472Sopenharmony_ci        return defaultRetVal;
1197c804472Sopenharmony_ci    }
1207c804472Sopenharmony_ci
1217c804472Sopenharmony_ci    uint16_t UIFontVector::GetHeight(uint16_t fontId, uint8_t fontSize)
1227c804472Sopenharmony_ci    {
1237c804472Sopenharmony_ci        return defaultRetVal;
1247c804472Sopenharmony_ci    }
1257c804472Sopenharmony_ci
1267c804472Sopenharmony_ci    uint16_t UIFontVector::GetShapingFontId(char* text, uint8_t& ttfId, uint32_t& script,
1277c804472Sopenharmony_ci        uint16_t fontId, uint8_t size) const
1287c804472Sopenharmony_ci    {
1297c804472Sopenharmony_ci        return defaultRetVal;
1307c804472Sopenharmony_ci    }
1317c804472Sopenharmony_ci
1327c804472Sopenharmony_ci    uint16_t UIFontVector::GetFontId(const char* ttfName, uint8_t fontSize) const
1337c804472Sopenharmony_ci    {
1347c804472Sopenharmony_ci        return defaultRetVal;
1357c804472Sopenharmony_ci    }
1367c804472Sopenharmony_ci
1377c804472Sopenharmony_ci    uint16_t UIFontVector::GetFontId(uint32_t unicode) const
1387c804472Sopenharmony_ci    {
1397c804472Sopenharmony_ci        return defaultRetVal;
1407c804472Sopenharmony_ci    }
1417c804472Sopenharmony_ci
1427c804472Sopenharmony_ci    int16_t UIFontVector::GetWidth(uint32_t unicode, uint16_t fontId, uint8_t fontSize)
1437c804472Sopenharmony_ci    {
1447c804472Sopenharmony_ci        return defaultRetVal;
1457c804472Sopenharmony_ci    }
1467c804472Sopenharmony_ci
1477c804472Sopenharmony_ci    int8_t UIFontVector::GetFontHeader(FontHeader& fontHeader, uint16_t fontId, uint8_t fontSize)
1487c804472Sopenharmony_ci    {
1497c804472Sopenharmony_ci        return defaultRetVal;
1507c804472Sopenharmony_ci    }
1517c804472Sopenharmony_ci
1527c804472Sopenharmony_ci    void UIFontVector::SaveGlyphNode(uint32_t unicode, uint16_t fontKey, Metric *metric) {}
1537c804472Sopenharmony_ci
1547c804472Sopenharmony_ci    int8_t UIFontVector::GetGlyphNode(uint32_t unicode, GlyphNode& glyphNode, uint16_t fontId, uint8_t fontSize)
1557c804472Sopenharmony_ci    {
1567c804472Sopenharmony_ci        return defaultRetVal;
1577c804472Sopenharmony_ci    }
1587c804472Sopenharmony_ci
1597c804472Sopenharmony_ci    uint8_t* UIFontVector::GetBitmap(uint32_t unicode, GlyphNode& glyphNode, uint16_t fontId, uint8_t fontSize)
1607c804472Sopenharmony_ci    {
1617c804472Sopenharmony_ci        return nullptr;
1627c804472Sopenharmony_ci    }
1637c804472Sopenharmony_ci
1647c804472Sopenharmony_ci    bool UIFontVector::IsEmojiFont(uint16_t fontId)
1657c804472Sopenharmony_ci    {
1667c804472Sopenharmony_ci        return true;
1677c804472Sopenharmony_ci    }
1687c804472Sopenharmony_ci
1697c804472Sopenharmony_ci    uint8_t UIFontVector::IsGlyphFont(uint32_t unicode)
1707c804472Sopenharmony_ci    {
1717c804472Sopenharmony_ci        return defaultRetVal;
1727c804472Sopenharmony_ci    }
1737c804472Sopenharmony_ci
1747c804472Sopenharmony_ci    void UIFontVector::SetFace(FaceInfo& faceInfo, uint32_t unicode) {}
1757c804472Sopenharmony_ci
1767c804472Sopenharmony_ci    void UIFontVector::SetFace(FaceInfo& faceInfo, uint32_t unicode, TextStyle textStyle) {}
1777c804472Sopenharmony_ci
1787c804472Sopenharmony_ci    void UIFontVector::ClearFontGlyph(FT_Face face) {}
1797c804472Sopenharmony_ci
1807c804472Sopenharmony_ci    inline uint16_t UIFontVector::GetKey(uint16_t fontId, uint8_t size)
1817c804472Sopenharmony_ci    {
1827c804472Sopenharmony_ci        return defaultRetVal;
1837c804472Sopenharmony_ci    }
1847c804472Sopenharmony_ci
1857c804472Sopenharmony_ci    uint16_t UIFontVector::GetOffsetPosY(const char* text, uint16_t lineLength, bool& isEmojiLarge,
1867c804472Sopenharmony_ci        uint16_t fontId, uint8_t fontSize)
1877c804472Sopenharmony_ci    {
1887c804472Sopenharmony_ci        return defaultRetVal;
1897c804472Sopenharmony_ci    }
1907c804472Sopenharmony_ci
1917c804472Sopenharmony_ci    uint16_t UIFontVector::GetLineMaxHeight(const char* text, uint16_t lineLength, uint16_t fontId,
1927c804472Sopenharmony_ci        uint8_t fontSize, uint16_t& letterIndex, SpannableString* spannableString)
1937c804472Sopenharmony_ci    {
1947c804472Sopenharmony_ci        return defaultRetVal;
1957c804472Sopenharmony_ci    }
1967c804472Sopenharmony_ci
1977c804472Sopenharmony_ci    uint16_t UIFontVector::GetMaxSubLineHeight(uint16_t textNum, uint16_t loopNum, uint16_t maxHeight,
1987c804472Sopenharmony_ci        uint16_t emojiNum)
1997c804472Sopenharmony_ci    {
2007c804472Sopenharmony_ci        return defaultRetVal;
2017c804472Sopenharmony_ci    }
2027c804472Sopenharmony_ci
2037c804472Sopenharmony_ci    void UIFontVector::SetPsramMemory(uintptr_t psramAddr, uint32_t psramLen) {}
2047c804472Sopenharmony_ci
2057c804472Sopenharmony_ci    int8_t UIFontVector::SetCurrentLangId(uint8_t langId)
2067c804472Sopenharmony_ci    {
2077c804472Sopenharmony_ci        return defaultRetVal;
2087c804472Sopenharmony_ci    }
2097c804472Sopenharmony_ci} // namespace OHOS
210