Browse Source

update:更新gtfont灰度绘制算法

Dozingfiretruck 8 months ago
parent
commit
9500072a9d

+ 2 - 2
components/eink/luat_lib_eink.c

@@ -1086,7 +1086,7 @@ static int l_eink_draw_gtfont_gb2312_gray(lua_State* L) {
 		fontCode++;
 		fontCode++;
 		get_font(buf, str<0x80?VEC_HZ_ASCII_STY:VEC_BLACK_STY, str, size*font_g, size*font_g, size*font_g);
 		get_font(buf, str<0x80?VEC_HZ_ASCII_STY:VEC_BLACK_STY, str, size*font_g, size*font_g, size*font_g);
 		Gray_Process(buf,size,size,font_g);
 		Gray_Process(buf,size,size,font_g);
-		gtfont_draw_gray_hz(buf, x, y, size , size, font_g, 1,Paint_DrawPixel,&econf.ctxs[econf.ctx_index]->paint,1);
+		gtfont_draw_gray_hz(buf, x, y, size , size, font_g, Paint_DrawPixel,&econf.ctxs[econf.ctx_index]->paint,1);
 		x+=size;
 		x+=size;
 		i+=2;
 		i+=2;
 	}
 	}
@@ -1144,7 +1144,7 @@ static int l_eink_draw_gtfont_utf8_gray(lua_State* L) {
 			uint16_t str = gt_unicode2gb18030(e);
 			uint16_t str = gt_unicode2gb18030(e);
 			get_font(buf, str<0x80?VEC_HZ_ASCII_STY:VEC_BLACK_STY, str, size*font_g, size*font_g, size*font_g);
 			get_font(buf, str<0x80?VEC_HZ_ASCII_STY:VEC_BLACK_STY, str, size*font_g, size*font_g, size*font_g);
 			Gray_Process(buf,size,size,font_g);
 			Gray_Process(buf,size,size,font_g);
-      gtfont_draw_gray_hz(buf, x, y, size , size, font_g, 1,Paint_DrawPixel,&econf.ctxs[econf.ctx_index]->paint,1);
+      gtfont_draw_gray_hz(buf, x, y, size , size, font_g, Paint_DrawPixel,&econf.ctxs[econf.ctx_index]->paint,1);
         	x+=size;
         	x+=size;
         }
         }
     }
     }

+ 41 - 121
components/gtfont/luat_gtfont.c

@@ -11,9 +11,9 @@
 #include "luat_log.h"
 #include "luat_log.h"
 
 
 #ifdef LUAT_USE_LCD
 #ifdef LUAT_USE_LCD
-extern luat_color_t lcd_str_fg_color,lcd_str_bg_color;
+extern luat_color_t BACK_COLOR, FORE_COLOR;
 #else
 #else
-static luat_color_t lcd_str_fg_color  = LCD_BLACK ,lcd_str_bg_color  = LCD_WHITE ;
+static luat_color_t BACK_COLOR = LCD_WHITE, FORE_COLOR = LCD_BLACK;
 #endif
 #endif
 
 
 luat_spi_device_t* gt_spi_dev = NULL;
 luat_spi_device_t* gt_spi_dev = NULL;
@@ -103,7 +103,7 @@ unsigned int gtfont_draw_w(unsigned char *pBits,unsigned int x,unsigned int y,un
 				}else{
 				}else{
 					/* 显示一个像素点 */
 					/* 显示一个像素点 */
 					if (dw<k+(j*8)) dw = k+(j*8);
 					if (dw<k+(j*8)) dw = k+(j*8);
-					if (mode == 0)point((luat_lcd_conf_t *)userdata, x+k+(j*8), y+i, lcd_str_fg_color);
+					if (mode == 0)point((luat_lcd_conf_t *)userdata, x+k+(j*8), y+i, FORE_COLOR);
 					else if (mode == 1)point((Paint *)userdata, x+k+(j*8), y+i, 0x0000);
 					else if (mode == 1)point((Paint *)userdata, x+k+(j*8), y+i, 0x0000);
 					else if (mode == 2)point((u8g2_t *)userdata, x+k+(j*8), y+i, 0x0000);
 					else if (mode == 2)point((u8g2_t *)userdata, x+k+(j*8), y+i, 0x0000);
 				}
 				}
@@ -120,13 +120,10 @@ unsigned int gtfont_draw_w(unsigned char *pBits,unsigned int x,unsigned int y,un
  * 灰度数据显示函数 1阶灰度/2阶灰度/4阶灰度
  * 灰度数据显示函数 1阶灰度/2阶灰度/4阶灰度
  * 参数 :
  * 参数 :
  * data灰度数据;  x,y=显示起始坐标 ; w 宽度, h 高度,grade 灰度阶级[1阶/2阶/4阶]
  * data灰度数据;  x,y=显示起始坐标 ; w 宽度, h 高度,grade 灰度阶级[1阶/2阶/4阶]
- * HB_par	1 白底黑字	0 黑底白字
  *------------------------------------------------------------------------------------------*/
  *------------------------------------------------------------------------------------------*/
 unsigned int gtfont_draw_gray_hz (unsigned char *data,unsigned short x,unsigned short y,
 unsigned int gtfont_draw_gray_hz (unsigned char *data,unsigned short x,unsigned short y,
-                unsigned short w ,unsigned short h,
-                unsigned char grade,unsigned char HB_par,
-                int(*point)(void*,uint16_t, uint16_t, uint32_t),
-                void* userdata,int mode){
+                unsigned short w ,unsigned short h,unsigned char grade,
+                int(*point)(void*,uint16_t, uint16_t, uint32_t),void* userdata,int mode){
 	unsigned int temp=0,gray,x_temp=x,dw=0;
 	unsigned int temp=0,gray,x_temp=x,dw=0;
 	unsigned int i=0,j=0,t;
 	unsigned int i=0,j=0,t;
 	unsigned char c,c2,*p;
 	unsigned char c,c2,*p;
@@ -138,145 +135,68 @@ unsigned int gtfont_draw_gray_hz (unsigned char *data,unsigned short x,unsigned
 			c=*p++;
 			c=*p++;
 			for(j=0;j<4;j++){
 			for(j=0;j<4;j++){
 				color2bit=(c>>6);//获取像素点的2bit颜色值
 				color2bit=(c>>6);//获取像素点的2bit颜色值
-				if(HB_par==1)color2bit= (3-color2bit)*250/3;//白底黑字
-				else color2bit= color2bit*250/3;//黑底白字
-				gray=color2bit/8;
-				color=(0x001f&gray)<<11;							//r-5
-				color=color|(((0x003f)&(gray*2))<<5);	//g-6
-				color=color|(0x001f&gray);						//b-5
-				temp=color;
-				temp=temp;
-				c<<=2;
-				if(x<(x_temp+w)){
-					if (mode == 0)point((luat_lcd_conf_t *)userdata,x,y,temp);
-					else if (mode == 1)point((Paint *)userdata, x,y,temp);
-                    if (HB_par){
-                        if (temp != 0xFFDF && dw < x){
-                            dw = x;
-                        }
-                    }
-				}
-				x++;
-				if(x>=x_temp+(w+7)/8*8) {x=x_temp; y++;}
-			}
-		}
-	}
-	else if(grade==3){
-		for(i=0;i<t*h;i+=3){
-			c=*p; c2=*(p+1);
-			color3bit[0]=(c>>5)&0x07;
-			color3bit[1]=(c>>2)&0x07;
-			color3bit[2]=((c<<1)|(c2>>7))&0x07;
-			p++;
-			c=*p; c2=*(p+1);
-			color3bit[3]=(c>>4)&0x07;
-			color3bit[4]=(c>>1)&0x07;
-			color3bit[5]=((c<<2)|(c2>>6))&0x07;
-			p++;
-			c=*p;
-			color3bit[6]=(c>>3)&0x07;
-			color3bit[7]=(c>>0)&0x07;
-			p++;
-			for(j=0;j<8;j++){
-				if(HB_par==1)color3bit[j]= (7-color3bit[j])*255/7;//白底黑字
-				else color3bit[j]=color3bit[j]*255/7;//黑底白字
-				gray =color3bit[j]/8;
-				color=(0x001f&gray)<<11;							//r-5
-				color=color|(((0x003f)&(gray*2))<<5);	//g-6
-				color=color|(0x001f&gray);						//b-5
-				temp =color;
-				if(x<(x_temp+w)){
-					if (mode == 0)point((luat_lcd_conf_t *)userdata,x,y,temp);
-					else if (mode == 1)point((Paint *)userdata, x,y,temp);
-                    if (HB_par){
-                        if (temp != 0xFFDF && dw < x){
+                if (color2bit!=0){
+                    color2bit=(3-color2bit)*255/3;//白底黑字
+                    gray=color2bit/8;
+                    color=(0x001f&gray)<<11;							//r-5
+                    color=color|(((0x003f)&(gray*2))<<5);	//g-6
+                    color=color|(0x001f&gray);						//b-5
+                    temp=color;
+                    if(x<(x_temp+w)){
+                        if (mode == 0)point((luat_lcd_conf_t *)userdata,x,y,temp);
+                        else if (mode == 1)point((Paint *)userdata, x,y,temp);
+                        // LLOGD("x_temp:%d,x:%d,dw:%d,temp:0x%x",x_temp,x,dw,temp);
+                        if (dw < x){
                             dw = x;
                             dw = x;
                         }
                         }
                     }
                     }
-				}
+                }
+                c<<=2;
 				x++;
 				x++;
 				if(x>=x_temp+(w+7)/8*8) {x=x_temp; y++;}
 				if(x>=x_temp+(w+7)/8*8) {x=x_temp; y++;}
 			}
 			}
 		}
 		}
-	}
-	else if(grade==4){
+	}else if(grade==4){
 		for(i=0;i<t*h;i++){
 		for(i=0;i<t*h;i++){
 			c=*p++;
 			c=*p++;
 			for(j=0;j<2;j++){
 			for(j=0;j<2;j++){
 				color4bit=(c>>4);
 				color4bit=(c>>4);
-				if(HB_par==1)color4bit= (15-color4bit)*255/15;//白底黑字
-				else color4bit= color4bit*255/15;//黑底白字
-				gray=color4bit/8;
-				color=(0x001f&gray)<<11;				//r-5
-				color=color|(((0x003f)&(gray*2))<<5);	//g-6
-				color=color|(0x001f&gray);				//b-5
-				temp=color;
-				c<<=4;
-				if(x<(x_temp+w)){
-					if (mode == 0)point((luat_lcd_conf_t *)userdata,x,y,temp);
-					else if (mode == 1)point((Paint *)userdata, x,y,temp);
-                    if (HB_par){
+                if (color4bit!=0){
+                    color4bit= (15-color4bit)*255/15;//白底黑字
+                    gray=color4bit/8;
+                    color=((0x001f&gray))<<11;				//r-5
+                    color=color|(((0x003f&(gray*2)))<<5);	//g-6
+                    color=color|((0x001f&gray));				//b-5
+                    temp=color;
+                    if(x<(x_temp+w)){
+                        if (mode == 0)point((luat_lcd_conf_t *)userdata,x,y,temp);
+                        else if (mode == 1)point((Paint *)userdata, x,y,temp);
                         // LLOGD("x_temp:%d,x:%d,dw:%d,temp:0x%x",x_temp,x,dw,temp);
                         // LLOGD("x_temp:%d,x:%d,dw:%d,temp:0x%x",x_temp,x,dw,temp);
-                        if (temp != 0xFFDF && dw < x){
+                        if (dw < x){
                             // LLOGD("x_temp:%d,x:%d,dw:%d",x_temp,x,dw);
                             // LLOGD("x_temp:%d,x:%d,dw:%d",x_temp,x,dw);
                             dw = x;
                             dw = x;
                         }
                         }
                     }
                     }
-				}
-				x++;
-				if(x>=x_temp+(w+7)/8*8) {x=x_temp; y++;}
-			}
-		}
-	}
-	else if(grade==5 || grade==6){
-		for(i=0;i<t*h;i++){
-			c=*p++;
-			for(j=0;j<2;j++){
-				color4bit=(c>>4);
-				if(HB_par==1)color4bit= (15-color4bit)*255/15;//白底黑字
-				else color4bit= color4bit*255/15;//黑底白字
-                if(color4bit > 0x00 && color4bit < 0xFF && grade == 5)
-                    color4bit = color4bit - 0x11;
-                else if(color4bit >= 0x11 && color4bit < 0xFF && grade == 6)
-                    color4bit = (color4bit == 0x11) ? (color4bit - 0x11) : (color4bit - 0x22);
-				gray=color4bit/8;
-				color=(0x001f&gray)<<11;				//r-5
-				color=color|(((0x003f)&(gray*2))<<5);	//g-6
-				color=color|(0x001f&gray);				//b-5
-				temp=color;
-				c<<=4;
-				if(x<(x_temp+w)){
-					if (mode == 0)point((luat_lcd_conf_t *)userdata,x,y,temp);
-					else if (mode == 1)point((Paint *)userdata, x,y,temp);
-                    if (HB_par){
-                        if (temp != 0xFFDF && dw < x){
-                            dw = x;
-                        }
-                    }
-				}
+                }
+                c<<=4;
 				x++;
 				x++;
 				if(x>=x_temp+(w+7)/8*8) {x=x_temp; y++;}
 				if(x>=x_temp+(w+7)/8*8) {x=x_temp; y++;}
 			}
 			}
 		}
 		}
-	}
-	else{   //1bits
+	}else{   //1bits
 		for(i=0;i<t*h;i++){
 		for(i=0;i<t*h;i++){
 			c=*p++;
 			c=*p++;
 			for(j=0;j<8;j++){
 			for(j=0;j<8;j++){
-				if(c&0x80) color=lcd_str_fg_color;
-				else color=lcd_str_bg_color;
-				c<<=1;
-				if(x<(x_temp+w)){
-					if(color == lcd_str_fg_color){
-						if (mode == 0)point((luat_lcd_conf_t *)userdata,x,y,color);
-						else if (mode == 1)point((Paint *)userdata, x,y,color);
-					}
-                    if (HB_par){
-                        if (temp != lcd_str_bg_color && dw < x){
+				if(c&0x80) {
+                    if(x<(x_temp+w)){
+                        if (mode == 0)point((luat_lcd_conf_t *)userdata,x,y,FORE_COLOR);
+                        else if (mode == 1)point((Paint *)userdata, x,y,FORE_COLOR);
+                        if (dw < x){
                             dw = x;
                             dw = x;
                         }
                         }
                     }
                     }
-				}
+                }
+				c<<=1;
 				x++;
 				x++;
 				if(x>=x_temp+(w+7)/8*8) {x=x_temp; y++;}
 				if(x>=x_temp+(w+7)/8*8) {x=x_temp; y++;}
 			}
 			}

+ 2 - 4
components/gtfont/luat_gtfont.h

@@ -10,10 +10,8 @@ extern luat_spi_device_t* gt_spi_dev;
 
 
 unsigned int gtfont_draw_w(unsigned char *pBits,unsigned int x,unsigned int y,unsigned int size,unsigned int widt,unsigned int high,int(*point)(void*,uint16_t, uint16_t, uint32_t),void* userdata,int mode);
 unsigned int gtfont_draw_w(unsigned char *pBits,unsigned int x,unsigned int y,unsigned int size,unsigned int widt,unsigned int high,int(*point)(void*,uint16_t, uint16_t, uint32_t),void* userdata,int mode);
 unsigned int gtfont_draw_gray_hz (unsigned char *data,unsigned short x,unsigned short y,
 unsigned int gtfont_draw_gray_hz (unsigned char *data,unsigned short x,unsigned short y,
-                unsigned short w ,unsigned short h,
-                unsigned char grade,unsigned char HB_par,
-                int(*point)(void*,uint16_t, uint16_t, uint32_t),
-                void* userdata,int mode);
+                unsigned short w ,unsigned short h,unsigned char grade,
+                int(*point)(void*,uint16_t, uint16_t, uint32_t),void* userdata,int mode);
 unsigned int gtfont_get_width(unsigned char *p,unsigned int zfwidth,unsigned int zfhigh );
 unsigned int gtfont_get_width(unsigned char *p,unsigned int zfwidth,unsigned int zfhigh );
 
 
 uint32_t gt_unicode2gb18030(uint32_t unicode);
 uint32_t gt_unicode2gb18030(uint32_t unicode);

+ 14 - 15
components/lcd/luat_lib_lcd.c

@@ -85,7 +85,6 @@ void lcd_auto_flush(luat_lcd_conf_t *conf) {
   luat_lcd_flush(conf);
   luat_lcd_flush(conf);
 }
 }
 
 
-luat_color_t lcd_str_fg_color,lcd_str_bg_color;
 luat_lcd_conf_t *l_lcd_get_default_conf(void) {return lcd_dft_conf;}
 luat_lcd_conf_t *l_lcd_get_default_conf(void) {return lcd_dft_conf;}
 LUAT_WEAK void luat_lcd_IF_init(luat_lcd_conf_t* conf){}
 LUAT_WEAK void luat_lcd_IF_init(luat_lcd_conf_t* conf){}
 LUAT_WEAK int luat_lcd_init_in_service(luat_lcd_conf_t* conf){return -1;}
 LUAT_WEAK int luat_lcd_init_in_service(luat_lcd_conf_t* conf){return -1;}
@@ -968,11 +967,11 @@ static void u8g2_font_decode_len(u8g2_t *u8g2, uint8_t len, uint8_t is_foregroun
     {
     {
       if ( is_foreground )
       if ( is_foreground )
       {
       {
-	    u8g2_draw_hv_line(u8g2, x, y, current, decode->dir, lcd_str_fg_color);
+	    u8g2_draw_hv_line(u8g2, x, y, current, decode->dir, FORE_COLOR);
       }
       }
       // else if ( decode->is_transparent == 0 )
       // else if ( decode->is_transparent == 0 )
       // {
       // {
-	    // u8g2_draw_hv_line(u8g2, x, y, current, decode->dir, lcd_str_bg_color);
+	    // u8g2_draw_hv_line(u8g2, x, y, current, decode->dir, BACK_COLOR);
       // }
       // }
     }
     }
     /* check, whether the end of the run length code has been reached */
     /* check, whether the end of the run length code has been reached */
@@ -1114,8 +1113,8 @@ static int l_lcd_draw_str(lua_State* L) {
     x = luaL_checkinteger(L, 1);
     x = luaL_checkinteger(L, 1);
     y = luaL_checkinteger(L, 2);
     y = luaL_checkinteger(L, 2);
     data = (const uint8_t*)luaL_checklstring(L, 3, &sz);
     data = (const uint8_t*)luaL_checklstring(L, 3, &sz);
-    lcd_str_fg_color = (luat_color_t)luaL_optinteger(L, 4,FORE_COLOR);
-    // lcd_str_bg_color = (uint32_t)luaL_optinteger(L, 5,BACK_COLOR);
+    FORE_COLOR = (luat_color_t)luaL_optinteger(L, 4,FORE_COLOR);
+    // BACK_COLOR = (uint32_t)luaL_optinteger(L, 5,BACK_COLOR);
     if (sz == 0)
     if (sz == 0)
         return 0;
         return 0;
     if (lcd_dft_conf == NULL) {
     if (lcd_dft_conf == NULL) {
@@ -1189,8 +1188,8 @@ static int l_lcd_draw_gtfont_gbk(lua_State *L) {
     unsigned char size = luaL_checkinteger(L, 2);
     unsigned char size = luaL_checkinteger(L, 2);
 	int x = luaL_checkinteger(L, 3);
 	int x = luaL_checkinteger(L, 3);
 	int y = luaL_checkinteger(L, 4);
 	int y = luaL_checkinteger(L, 4);
-    lcd_str_fg_color = (luat_color_t)luaL_optinteger(L, 5,FORE_COLOR);
-    // lcd_str_bg_color = (luat_color_t)luaL_optinteger(L, 6,BACK_COLOR);
+    FORE_COLOR = (luat_color_t)luaL_optinteger(L, 5,FORE_COLOR);
+    // BACK_COLOR = (luat_color_t)luaL_optinteger(L, 6,BACK_COLOR);
   
   
     if (lcd_dft_conf == NULL) {
     if (lcd_dft_conf == NULL) {
         LLOGE("lcd not init");
         LLOGE("lcd not init");
@@ -1257,8 +1256,8 @@ static int l_lcd_draw_gtfont_gbk_gray(lua_State* L) {
 	unsigned char font_g = luaL_optinteger(L, 3, 4);
 	unsigned char font_g = luaL_optinteger(L, 3, 4);
 	int x = luaL_checkinteger(L, 4);
 	int x = luaL_checkinteger(L, 4);
 	int y = luaL_checkinteger(L, 5);
 	int y = luaL_checkinteger(L, 5);
-    lcd_str_fg_color = (luat_color_t)luaL_optinteger(L, 6,FORE_COLOR);
-    // lcd_str_bg_color = (luat_color_t)luaL_optinteger(L, 7,BACK_COLOR);
+    FORE_COLOR = (luat_color_t)luaL_optinteger(L, 6,FORE_COLOR);
+    // BACK_COLOR = (luat_color_t)luaL_optinteger(L, 7,BACK_COLOR);
     int buff_size = size*4*size*4/8+512;
     int buff_size = size*4*size*4/8+512;
     unsigned char* buf = luat_heap_malloc(buff_size);
     unsigned char* buf = luat_heap_malloc(buff_size);
     if (buf == NULL){
     if (buf == NULL){
@@ -1275,7 +1274,7 @@ static int l_lcd_draw_gtfont_gbk_gray(lua_State* L) {
         unsigned int* width = NULL;
         unsigned int* width = NULL;
         width = get_Font_Gray(buf,str<0x80?VEC_HZ_ASCII_STY:VEC_BLACK_STY,str,size, size);
         width = get_Font_Gray(buf,str<0x80?VEC_HZ_ASCII_STY:VEC_BLACK_STY,str,size, size);
         // LLOGW("get_Font_Gray width[0]:%d width[1]:%d",width[0], width[1]);
         // LLOGW("get_Font_Gray width[0]:%d width[1]:%d",width[0], width[1]);
-        int dw = gtfont_draw_gray_hz(buf, x, y, width[0] , size, width[1], 1,luat_lcd_draw_point,lcd_dft_conf,0);
+        int dw = gtfont_draw_gray_hz(buf, x, y, width[0] , size, width[1], luat_lcd_draw_point,lcd_dft_conf,0);
         x+=dw;
         x+=dw;
 		i+=2;
 		i+=2;
 	}
 	}
@@ -1305,8 +1304,8 @@ static int l_lcd_draw_gtfont_utf8(lua_State *L) {
     unsigned char size = luaL_checkinteger(L, 2);
     unsigned char size = luaL_checkinteger(L, 2);
     int x = luaL_checkinteger(L, 3);
     int x = luaL_checkinteger(L, 3);
     int y = luaL_checkinteger(L, 4);
     int y = luaL_checkinteger(L, 4);
-    lcd_str_fg_color = (luat_color_t)luaL_optinteger(L, 5,FORE_COLOR);
-    // lcd_str_bg_color = (luat_color_t)luaL_optinteger(L, 6,BACK_COLOR);
+    FORE_COLOR = (luat_color_t)luaL_optinteger(L, 5,FORE_COLOR);
+    // BACK_COLOR = (luat_color_t)luaL_optinteger(L, 6,BACK_COLOR);
     int buff_size = size*size/8+512;
     int buff_size = size*size/8+512;
     unsigned char* buf = luat_heap_malloc(buff_size);
     unsigned char* buf = luat_heap_malloc(buff_size);
     if (buf == NULL){
     if (buf == NULL){
@@ -1356,8 +1355,8 @@ static int l_lcd_draw_gtfont_utf8_gray(lua_State* L) {
 	unsigned char font_g = luaL_optinteger(L, 3, 4);
 	unsigned char font_g = luaL_optinteger(L, 3, 4);
 	int x = luaL_checkinteger(L, 4);
 	int x = luaL_checkinteger(L, 4);
 	int y = luaL_checkinteger(L, 5);
 	int y = luaL_checkinteger(L, 5);
-    lcd_str_fg_color = (luat_color_t)luaL_optinteger(L, 6,FORE_COLOR);
-    // lcd_str_bg_color = (luat_color_t)luaL_optinteger(L, 7,BACK_COLOR);
+    FORE_COLOR = (luat_color_t)luaL_optinteger(L, 6,FORE_COLOR);
+    // BACK_COLOR = (luat_color_t)luaL_optinteger(L, 7,BACK_COLOR);
     uint16_t buff_size = size*4*size*4/8+512;
     uint16_t buff_size = size*4*size*4/8+512;
     unsigned char* buf = luat_heap_malloc(buff_size);
     unsigned char* buf = luat_heap_malloc(buff_size);
     // LLOGD("buff_size:%d buf:%p", buff_size,buf);
     // LLOGD("buff_size:%d buf:%p", buff_size,buf);
@@ -1376,7 +1375,7 @@ static int l_lcd_draw_gtfont_utf8_gray(lua_State* L) {
             unsigned int* width = NULL;
             unsigned int* width = NULL;
             width = get_Font_Gray(buf,str<0x80?VEC_HZ_ASCII_STY:VEC_BLACK_STY,str,size, size);
             width = get_Font_Gray(buf,str<0x80?VEC_HZ_ASCII_STY:VEC_BLACK_STY,str,size, size);
             // LLOGW("get_Font_Gray size:%d width[0]:%d width[1]:%d", size, width[0], width[1]);
             // LLOGW("get_Font_Gray size:%d width[0]:%d width[1]:%d", size, width[0], width[1]);
-            int dw = gtfont_draw_gray_hz(buf, x, y, width[0] , size, width[1], 1,luat_lcd_draw_point,lcd_dft_conf,0);
+            int dw = gtfont_draw_gray_hz(buf, x, y, width[0] , size, width[1], luat_lcd_draw_point,lcd_dft_conf,0);
         	// LLOGW("gtfont_draw_gray_hz dw:%d",dw);
         	// LLOGW("gtfont_draw_gray_hz dw:%d",dw);
             x+=dw;
             x+=dw;
         }
         }