#include "uicomponents/UIComponents.h"
#include <vector>
+#include <string.h>
+#include <string>
+#include <iostream>
+#include "common/text.h"
+#include "common/typed_text.h"
+#include "font/ui_font.h"
namespace OHOS
{
}
return imageArray;
}
+
+ void updata_char(char *str_,char *str,uint32_t max_len)
+ {
+ strcpy_s(str_,max_len,str);
+ uint32_t j = 0;
+ uint32_t letter = 0;
+ if (str == nullptr) {
+ return ;
+ }
+ while (str[j] != '\0')
+ {
+ int i=j;
+ letter = TypedText::GetUTF8Next(str, j, j);
+ int len=j-i;
+ UIFont* fontEngine= UIFont::GetInstance();
+ GlyphPathData path;
+ if(!fontEngine->GetGlyphPathData(letter, 0, path))
+ {
+ printf("********************* letter%d %d %d not exist\r\n",i,j,letter);
+ char *buf= "□";
+ uint16_t buf_len=strlen(buf);
+ uint16_t offset =0;
+ int num=len/buf_len;
+ int mod_num=len%buf_len;
+ for(int x=0;x<num;x++)
+ {
+ memcpy_s(&str_[i+offset],buf_len,buf,buf_len);
+ offset+=buf_len;
+ }
+ if(mod_num!=0)
+ {
+ for(int x=0;x<num;x++)
+ {
+ str_[i+offset]=' ';
+ offset+=1;
+ }
+ }
+ }
+ }
+ printf("%s\r\n",str_);
+ }
+
}