change glyph.x/y/w/h to 16bits

This commit is contained in:
lixianjing 2019-10-15 17:54:52 +08:00
parent 20ef92f8ea
commit 2a4a9c5d3c
5 changed files with 1276 additions and 1253 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,7 @@
* 增加tk\_iostream\_noisy。
* 完善窗口管理器(感谢大恒提供补丁)
* 前一个窗口为normal window时才支持窗口动画。
* glyph的x/y/w/h改为16位以防超大字体溢出问题。
* 2019/10/14
* 修改widget\_set\_value把value当uint32的BUG.

View File

@ -61,29 +61,29 @@ typedef struct _font_t font_t;
#pragma pack(push, 1)
typedef struct _glyph_t {
/**
* @property {int8_t} x
* @property {int16_t} x
* @annotation ["readable"]
* x坐标
*/
int8_t x;
int16_t x;
/**
* @property {int8_t} y
* @property {int16_t} y
* @annotation ["readable"]
* y坐标
*/
int8_t y;
int16_t y;
/**
* @property {uint8_t} w
* @property {uint16_t} w
* @annotation ["readable"]
*
*/
uint8_t w;
uint16_t w;
/**
* @property {uint8_t} h
* @property {uint16_t} h
* @annotation ["readable"]
*
*/
uint8_t h;
uint16_t h;
/**
* @property {uint16_t} advance
* @annotation ["readable"]

View File

@ -90,10 +90,10 @@ uint32_t font_gen_buff(font_t* font, uint16_t font_size, const char* str, uint8_
uint32_t data_size = (g.pitch ? g.pitch : g.w) * g.h;
return_value_if_fail(buff_size > (iter->offset + data_size + 4), 0);
save_uint8(p, g.x);
save_uint8(p, g.y);
save_uint8(p, g.w);
save_uint8(p, g.h);
save_uint16(p, g.x);
save_uint16(p, g.y);
save_uint16(p, g.w);
save_uint16(p, g.h);
save_uint16(p, g.advance);
save_uint8(p, g.format);
save_uint8(p, g.pitch);