From efe623eae9eb4ee5f67b77b03ff140d3ce0a0512 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Tue, 11 Nov 2025 18:02:26 +0800 Subject: [PATCH] =?utf8?q?=E6=A0=B9=E6=8D=AE=E6=B5=B7=E6=80=9D=E6=96=B9?= =?utf8?q?=E6=A1=88=E5=87=8F=E5=B0=914gai=20ui=E7=95=8C=E9=9D=A2=E5=87=BA?= =?utf8?q?=E7=8E=B0=E5=8F=A0=E5=AD=97=E6=A6=82=E7=8E=87=E8=BF=98=E9=9C=80?= =?utf8?q?=E8=A6=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../third_party/freetype/src/base/ftsystem.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/code/sdk/open_source/openharmony/third_party/freetype/src/base/ftsystem.c b/code/sdk/open_source/openharmony/third_party/freetype/src/base/ftsystem.c index f92b3a03d..a250cde47 100644 --- a/code/sdk/open_source/openharmony/third_party/freetype/src/base/ftsystem.c +++ b/code/sdk/open_source/openharmony/third_party/freetype/src/base/ftsystem.c @@ -33,6 +33,7 @@ #include FT_ERRORS_H #include FT_TYPES_H +#include "graphic_hardware_config.h" /************************************************************************** * @@ -224,9 +225,28 @@ file = STREAM_FILE( stream ); + #if defined(BOARD_N9) || defined(BOARD_FD230) //减少4gai叠字概率,还未完全解决 + long oriFilePos = ftell(file); + if ( stream->pos != offset ) { // seek可能就走这里,偏移,读取count为0 + ft_fseek( file, (long)offset, SEEK_SET ); // LWJ: 位置错了,可以强制偏移,以入参为准 + // printf("[LTT] [%s: %d] seek: offset %d, stream->pos: %d\n", + // __FUNCTION__, __LINE__, offset, stream->pos); // todo: 可以放开,每次强制偏移保证位置正确,再去读数据 + } else { // 检测是否有可能记录的位置和实际File位置不一致的情况 + if (oriFilePos != offset) { + // printf("[LTT] [%s: %d] oriFilePos : %d, not equal to, offset: %d!!!!!!!!!\n", + // __FUNCTION__, __LINE__, oriFilePos, offset); + ft_fseek( file, (long)offset, SEEK_SET ); // LWJ: 位置错了,可以强制偏移,以入参为准 + } + } + if (count != 0) { + // printf("[LTT] [%s: %d] ft_ansi_stream_io READ: buffer %p, file->pos: %d, stream->pos: %d, offset: %d, count: %u\n", + // __FUNCTION__, __LINE__, buffer, ftell(file), stream->pos, offset, count); + } + #else if ( stream->pos != offset ) ft_fseek( file, (long)offset, SEEK_SET ); + #endif return (unsigned long)ft_fread( buffer, 1, count, file ); } -- 2.17.1