Tune Glyph32 and UChar32 to be unsigned

This commit is contained in:
Vincent Wei
2019-01-18 11:43:42 +08:00
parent 1e1a5edd13
commit 94feb0ae44
5 changed files with 18 additions and 14 deletions
+3 -3
View File
@@ -5774,8 +5774,8 @@ typedef struct _WORDINFO WORDINFO;
#define MAX_LEN_MCHAR 6
typedef unsigned short UChar16;
typedef int UChar32;
typedef Uint16 UChar16;
typedef Uint32 UChar32;
#define MCHAR_TYPE_NOSPACING_MARK 0x0001
#define MCHAR_TYPE_ABOVE_MARK 0x0002
@@ -8880,7 +8880,7 @@ MG_EXPORT void GUIAPI DestroyBMPFont (DEVFONT* dev_font);
* @{
*/
typedef int Glyph32;
typedef Uint32 Glyph32;
/**
* \def INV_GLYPH_VALUE
+1 -1
View File
@@ -475,7 +475,7 @@ static void slePaint (HWND hWnd, HDC hdc, PBIDISLEDITDATA sled)
int startx = 0;
int* ranges = NULL;
int nr_ranges = 0;
int* glyph_string = GLYPHS;
Glyph32* glyph_string = GLYPHS;
int i = 0;
int* p = NULL;
+7 -8
View File
@@ -45,14 +45,13 @@ extern "C" {
#endif
typedef struct _GLYPHBUF
{
GLYPHMAPINFO* glyph_map; /* glyph info array */
int* glyphs; /* glyph array */
{
GLYPHMAPINFO* glyph_map; /* glyph info array */
Glyph32* glyphs; /* glyph array */
int glyphs_len; /* glyph array len or buffer used size */
int blocksize; /* block size, a block is an allocate unit */
int glyphs_buffsize; /* glyph string buffer size */
int glyphmap_buffsize; /* glyph map buffer size */
int glyphs_buffsize; /* glyph string buffer size */
int glyphmap_buffsize; /* glyph map buffer size */
} GLYPHBUF;
typedef struct tagBIDISLEDITDATA
@@ -95,7 +94,7 @@ static inline void*
glyphbuf_alloc (GLYPHBUF* glyph_buff, int len, int block_size)
{
glyph_buff->glyphs_buffsize = (len + (block_size - len % block_size))
* sizeof (int);
* sizeof (Glyph32);
glyph_buff->glyphs = malloc (glyph_buff->glyphs_buffsize);
glyph_buff->glyphmap_buffsize = (len + (block_size - len % block_size))
@@ -122,7 +121,7 @@ static inline void* glyphbuf_realloc (GLYPHBUF *glyph_buff, int len)
len * sizeof(int) < glyph_buff->glyphs_buffsize - glyph_buff->blocksize) {
/* realloc glyph string mem */
glyph_buff->glyphs_buffsize = (len + (glyph_buff->blocksize -
len % glyph_buff->blocksize))* sizeof(int);
len % glyph_buff->blocksize))* sizeof(Glyph32);
glyph_buff->glyphs = realloc (glyph_buff->glyphs,
glyph_buff->glyphs_buffsize);
+1 -1
View File
@@ -128,7 +128,7 @@ static int inline get_glyph_advance_in_dc (PDC pdc, Glyph32 glyph_value)
}
static int jump_vowels_ltr (PDC pdc, Glyph32* glyphs, int glyph_num, int* biggest_vowel)
static int jump_vowels_ltr (PDC pdc, Glyph32* glyphs, int glyph_num, Glyph32* biggest_vowel)
{
int i = 0;
int max_advance = 0;
+6 -1
View File
@@ -36,7 +36,12 @@
** glyph-css.c: The implementation of APIs which conform to the specifiction
** of CSS 3
**
** Create date: 2019/01/16
** Reference:
**
** https://www.w3.org/TR/css-text-3/
** https://www.w3.org/TR/css-writing-modes-3/
**
** Create by WEI Yongming at 2019/01/16
*/
#include <stdio.h>