提交 7adb95f4 编写于 作者: W wangtiantian

IssueNo:https://gitee.com/openharmony/graphic_ui/issues/I4AC8W

Description:fix glyphNode problem
Sig:graphic
Feature or Bugfix:Bugfix
Binary Source:No
Signed-off-by: Nwangtiantian <wangtiantian19@huawei.com>
上级 02ee0ff5
......@@ -374,7 +374,7 @@ int16_t GlyphsManager::GetFontWidth(uint32_t unicode)
return node->advance;
}
int8_t GlyphsManager::GetBitmap(uint32_t unicode, uint8_t* bitmap, GlyphNode* glyphNode)
int8_t GlyphsManager::GetBitmap(uint32_t unicode, uint8_t* bitmap, uint8_t fontId)
{
if (bitmap == nullptr) {
GRAPHIC_LOGE("GlyphsManager::GetBitmap invalid parameter");
......@@ -384,9 +384,9 @@ int8_t GlyphsManager::GetBitmap(uint32_t unicode, uint8_t* bitmap, GlyphNode* gl
GRAPHIC_LOGE("GlyphsManager::GetBitmap fontId not set");
return INVALID_RET_VALUE;
}
const GlyphNode* node = glyphNode;
if (glyphNode == nullptr) {
const GlyphNode* node = GetGlyphNode(unicode);
while ((fontId != 0) && (node != nullptr) && (node->reserve != fontId)) {
SetCurrentFontId(fontId);
node = GetGlyphNode(unicode);
}
if (node == nullptr) {
......@@ -394,6 +394,9 @@ int8_t GlyphsManager::GetBitmap(uint32_t unicode, uint8_t* bitmap, GlyphNode* gl
return INVALID_RET_VALUE;
}
if ((fontId != 0) && (fontId_ != fontId)) {
SetCurrentFontId(fontId);
}
uint32_t offset = curBitMapSectionStart_ + node->dataOff;
uint32_t size = node->kernOff - node->dataOff;
int32_t ret = lseek(fp_, offset, SEEK_SET);
......
......@@ -41,7 +41,7 @@ public:
const GlyphNode* GetGlyphNode(uint32_t unicode);
int8_t GetBitmap(uint32_t unicode, uint8_t* bitmap, GlyphNode* glyphNode = nullptr);
int8_t GetBitmap(uint32_t unicode, uint8_t* bitmap, uint8_t fontId = 0);
void SetRamBuffer(uintptr_t ramAddr);
......
......@@ -215,9 +215,9 @@ uint32_t UIFontBitmap::GetRamUsedLen(uint32_t textManagerRamUsed, uint32_t langF
return dynamicFontRamUsed_ + textManagerRamUsed + bitmapRamUsed_ + langFontRamUsed;
}
int8_t UIFontBitmap::GetDynamicFontBitmap(uint32_t unicode, uint8_t* bitmap, GlyphNode* glyphNode)
int8_t UIFontBitmap::GetDynamicFontBitmap(uint32_t unicode, uint8_t* bitmap, uint8_t fontId)
{
return dynamicFont_.GetBitmap(unicode, bitmap, glyphNode);
return dynamicFont_.GetBitmap(unicode, bitmap, fontId);
}
uint8_t* UIFontBitmap::GetCacheBitmap(uint8_t fontId, uint32_t unicode)
......@@ -289,7 +289,7 @@ uint8_t* UIFontBitmap::SearchInFont(uint32_t unicode, GlyphNode& glyphNode, uint
}
uint32_t bitmapSize = glyphNode.kernOff - glyphNode.dataOff;
bitmap = bitmapCache_->GetSpace(fontId, unicode, bitmapSize);
ret = dynamicFont_.GetBitmap(unicode, bitmap, &glyphNode);
ret = dynamicFont_.GetBitmap(unicode, bitmap, fontId);
if (ret == RET_VALUE_OK) {
return bitmap;
}
......
......@@ -47,7 +47,7 @@ protected:
uint32_t GetBitmapRamUsed();
uint32_t GetDynamicFontRamUsed();
uint32_t GetRamUsedLen(uint32_t textManagerRamUsed, uint32_t langFontRamUsed);
int8_t GetDynamicFontBitmap(uint32_t unicode, uint8_t* bitmap, GlyphNode* glyphNode = nullptr);
int8_t GetDynamicFontBitmap(uint32_t unicode, uint8_t* bitmap, uint8_t fontId = 0);
uint8_t* GetCacheBitmap(uint8_t fontId, uint32_t unicode);
uint8_t* GetCacheSpace(uint8_t fontId, uint32_t unicode, uint32_t size);
void PutCacheSpace(uint8_t* addr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册