mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-28 16:17:09 +08:00
Compare commits
156
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4b18828b2 | ||
|
|
36167be7e6 | ||
|
|
4b633c801d | ||
|
|
33fd8a8668 | ||
|
|
94f44890a5 | ||
|
|
cc7441c4dd | ||
|
|
6fdc0281ba | ||
|
|
136a51d9b8 | ||
|
|
5e871c486b | ||
|
|
fdd69bf470 | ||
|
|
10e55b0d4f | ||
|
|
682c81d636 | ||
|
|
9eb4e54b75 | ||
|
|
e43bc07a63 | ||
|
|
508130afdc | ||
|
|
d60c057dc4 | ||
|
|
8f5a741af6 | ||
|
|
bee1bc87c4 | ||
|
|
3a9274e9a0 | ||
|
|
44ee735cd6 | ||
|
|
2c010cdbeb | ||
|
|
a04ae43bdb | ||
|
|
5c333445c5 | ||
|
|
dd93e67a3d | ||
|
|
d886268eee | ||
|
|
090824cb91 | ||
|
|
00eb4e363f | ||
|
|
f73f0786ee | ||
|
|
dacc81cf2a | ||
|
|
97c6249af5 | ||
|
|
7ce1fe47ff | ||
|
|
8e66bb366e | ||
|
|
ce7fd6e776 | ||
|
|
957f9cbb47 | ||
|
|
2a7e3003bd | ||
|
|
19cd208a6e | ||
|
|
6a44111a35 | ||
|
|
fd5d55942b | ||
|
|
d4e7f048f0 | ||
|
|
d90c4d5842 | ||
|
|
0f562cd39f | ||
|
|
fb01003c45 | ||
|
|
9bcea02975 | ||
|
|
c51ae8d1c1 | ||
|
|
b8a5ad2d73 | ||
|
|
39b8c88d1b | ||
|
|
1e73f6713a | ||
|
|
97babaa4e2 | ||
|
|
c6c486f306 | ||
|
|
338f10b896 | ||
|
|
2353a873a8 | ||
|
|
52c539e870 | ||
|
|
64d63a84c5 | ||
|
|
3d80d73450 | ||
|
|
2e04898fbe | ||
|
|
f390e1a091 | ||
|
|
848c1d7ce1 | ||
|
|
0c0becc780 | ||
|
|
0e918da2a4 | ||
|
|
7f36c339b7 | ||
|
|
871486daab | ||
|
|
0cffc8798f | ||
|
|
4d4a3901eb | ||
|
|
50e95cb461 | ||
|
|
d223edf0ba | ||
|
|
8e88082f07 | ||
|
|
5b1762b637 | ||
|
|
6c83ea4ceb | ||
|
|
5aa5e75813 | ||
|
|
1ba35dcbf6 | ||
|
|
8828824b23 | ||
|
|
e3f2cc22ec | ||
|
|
93aae6782e | ||
|
|
b746d2927e | ||
|
|
79e3be705c | ||
|
|
a052b7bf55 | ||
|
|
74a84362ca | ||
|
|
d673008f5a | ||
|
|
09c9438de8 | ||
|
|
0734180d70 | ||
|
|
8ca8deb02d | ||
|
|
9aa719aeb3 | ||
|
|
447eebbafc | ||
|
|
19f8689a20 | ||
|
|
60902f83d5 | ||
|
|
a725acfd5e | ||
|
|
0191772111 | ||
|
|
a11cef5f2e | ||
|
|
cf4c75bcbc | ||
|
|
f85801dcbe | ||
|
|
4e67f8c56b | ||
|
|
1cfd2fe324 | ||
|
|
5ef2e0fa42 | ||
|
|
57b71e985c | ||
|
|
d9d76ec59b | ||
|
|
7935883267 | ||
|
|
0385def7b2 | ||
|
|
565f4b34e5 | ||
|
|
70ba8a0420 | ||
|
|
4bdbe4a002 | ||
|
|
2c98ef96da | ||
|
|
6663c98787 | ||
|
|
bbf2376f7a | ||
|
|
21ac9f2def | ||
|
|
a10d28dd11 | ||
|
|
856126c72e | ||
|
|
547fc0059c | ||
|
|
195363dc82 | ||
|
|
54288e5687 | ||
|
|
9d46406a95 | ||
|
|
d365feca5d | ||
|
|
f34ac9d0fe | ||
|
|
3a02b056ca | ||
|
|
1a1e8cf652 | ||
|
|
94feb0ae44 | ||
|
|
1e1a5edd13 | ||
|
|
ae9b14201b | ||
|
|
742150d4f1 | ||
|
|
03eac03c8c | ||
|
|
8cd6b037ec | ||
|
|
b35e38bdff | ||
|
|
58275c88e9 | ||
|
|
31b43521d0 | ||
|
|
e68ee00b85 | ||
|
|
6e54d4a7d7 | ||
|
|
69b1d63569 | ||
|
|
817f4063a1 | ||
|
|
c9ec23dc70 | ||
|
|
972085fa56 | ||
|
|
c2e24b61e3 | ||
|
|
bd1fb67930 | ||
|
|
0fcedfca08 | ||
|
|
c39ce7c0b8 | ||
|
|
97014ccdc8 | ||
|
|
48e7f6e928 | ||
|
|
473f9f98ff | ||
|
|
95d09a7673 | ||
|
|
53253ed101 | ||
|
|
4bd7c0eef4 | ||
|
|
9af71438dd | ||
|
|
747894247b | ||
|
|
1ed5b44926 | ||
|
|
16287af2a6 | ||
|
|
82033a44dd | ||
|
|
1c9537fc63 | ||
|
|
612c395c06 | ||
|
|
8dc0ee2ade | ||
|
|
caefd7355a | ||
|
|
9ea0e15dba | ||
|
|
83c8984c74 | ||
|
|
c975fe5b8d | ||
|
|
b4569adbd5 | ||
|
|
4761333a1a | ||
|
|
715a44beeb | ||
|
|
e6bb4fa05f | ||
|
|
c436af69bb |
+16
@@ -0,0 +1,16 @@
|
||||
The current main maintainers and/or developers:
|
||||
|
||||
* WEI Yongming
|
||||
|
||||
As employed engineers of [Beijing FMSoft Technologies Co., Ltd.],
|
||||
the following people have participated in the development of MiniGUI Core:
|
||||
|
||||
* HOU Huihua
|
||||
* WAN Zheng
|
||||
* DONG Kai
|
||||
* DONG Junjie
|
||||
* YAN Xiaowei
|
||||
|
||||
For community contributors, please see RELASENOTES.md documentation.
|
||||
|
||||
[Beijing FMSoft Technologies Co., Ltd.]: http://www.fmsoft.cn
|
||||
@@ -3216,7 +3216,7 @@ alExtra.(xwyan)
|
||||
* src/gui/lf_flat.c
|
||||
* src/gui/lf_skin.c
|
||||
|
||||
08/24: ENHANCEMENT #1: Add a new method for FONTOPS: get_glyph_type to return
|
||||
08/24: ENHANCEMENT #1: Add a new method for FONTOPS: get_char_type to return
|
||||
the glyph type the devfont can give us.
|
||||
* src/include/devfont.h
|
||||
* src/font/*.c
|
||||
@@ -4761,7 +4761,7 @@ create_skin_main_window_ex:
|
||||
* ext/skin/skin.c
|
||||
|
||||
05/16. ENHANCEMENT #8: Support for UTF-16LE and UTF-16BE charsets/encodings.
|
||||
* Change the definition of UChar32 to 'int'.
|
||||
* Change the definition of Uchar32 to 'int'.
|
||||
* include/gdi.h
|
||||
|
||||
05/16. ENHANCEMENT #11: Support for FreeType2.
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ PROJECT_NAME = "MiniGUI API Reference (MiniGUI-Standalone)"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = v3.2.0
|
||||
PROJECT_NUMBER = v3.4.0
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
||||
+151
-85
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,9 @@
|
||||
Version 3.2.0 (2018/02/10)
|
||||
Version 3.4.0 (2019/06/30)
|
||||
|
||||
This release needs the following resource packages:
|
||||
|
||||
* minigui-res-3.0.13.tar.gz
|
||||
* minigui-res-3.4.0.tar.gz
|
||||
|
||||
The latest samples package is:
|
||||
|
||||
* mg-samples-3.2.0.tar.gz
|
||||
* mg-samples-3.4.0.tar.gz
|
||||
|
||||
+23
-15
@@ -2003,7 +2003,7 @@ case "$use_ttf_lib" in
|
||||
[Define if include ttf cache])
|
||||
|
||||
AC_ARG_WITH(ttfcachesize,
|
||||
[ --with-ttfcachesize=[64/128/256/512/1024]])
|
||||
[ --with-ttfcachesize=[64/128/256/512/1024/2048]])
|
||||
|
||||
case "$with_ttfcachesize" in
|
||||
64)
|
||||
@@ -2026,30 +2026,38 @@ case "$use_ttf_lib" in
|
||||
AC_DEFINE(_MGTTF_CACHE_SIZE, 1024,
|
||||
[Define if compile max ttf cahce size for 1024k])
|
||||
;;
|
||||
2048)
|
||||
AC_DEFINE(_MGTTF_CACHE_SIZE, 2048,
|
||||
[Define if compile max ttf cahce size for 2048k])
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE(_MGTTF_CACHE_SIZE, 256,
|
||||
[Define if compile max ttf cahce size for 256k])
|
||||
AC_DEFINE(_MGTTF_CACHE_SIZE, 1024,
|
||||
[Define if compile max ttf cahce size for 1024k (default value)])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_ARG_WITH(ttfcachenum,
|
||||
[ --with-mttfcachenum=[10/20/40]])
|
||||
[ --with-mttfcachenum=[16/32/64/128]])
|
||||
case "$with_mttfcachenum" in
|
||||
10)
|
||||
AC_DEFINE(_MGMAX_TTF_CACHE, 10,
|
||||
[Define if compile max ttf cahce number for 10])
|
||||
16)
|
||||
AC_DEFINE(_MGMAX_TTF_CACHE, 16,
|
||||
[Define if compile max ttf cahce number for 16])
|
||||
;;
|
||||
20)
|
||||
AC_DEFINE(_MGMAX_TTF_CACHE, 20,
|
||||
[Define if compile max ttf cahce number for 20])
|
||||
32)
|
||||
AC_DEFINE(_MGMAX_TTF_CACHE, 32,
|
||||
[Define if compile max ttf cahce number for 32])
|
||||
;;
|
||||
40)
|
||||
AC_DEFINE(_MGMAX_TTF_CACHE, 40,
|
||||
[Define if compile max ttf cahce number for 40])
|
||||
64)
|
||||
AC_DEFINE(_MGMAX_TTF_CACHE, 64,
|
||||
[Define if compile max ttf cahce number for 64])
|
||||
;;
|
||||
128)
|
||||
AC_DEFINE(_MGMAX_TTF_CACHE, 128,
|
||||
[Define if compile max ttf cahce number for 128])
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE(_MGMAX_TTF_CACHE, 10,
|
||||
[Define if compile max ttf cahce number for 10 (default value)])
|
||||
AC_DEFINE(_MGMAX_TTF_CACHE, 32,
|
||||
[Define if compile max ttf cahce number for 32 (default value)])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -239,9 +239,9 @@ int GUIAPI GetFirstWord (PLOGFONT log_font, const char* mstr, int len,
|
||||
496 static int euckr_is_this_charset (const unsigned char* charset)
|
||||
497 {
|
||||
498 int i;
|
||||
499 char name [LEN_FONT_NAME + 1];
|
||||
499 char name [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
500
|
||||
501 for (i = 0; i < LEN_FONT_NAME + 1; i++) {
|
||||
501 for (i = 0; i < LEN_LOGFONT_NAME_FIELD + 1; i++) {
|
||||
502 if (charset [i] == '\0')
|
||||
503 break;
|
||||
504 name [i] = toupper (charset [i]);
|
||||
@@ -388,9 +388,9 @@ int GUIAPI GetFirstWord (PLOGFONT log_font, const char* mstr, int len,
|
||||
|
||||
<table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td> <pre>
|
||||
228 typedef struct _LOGFONT {
|
||||
229 char type [LEN_FONT_NAME + 1];
|
||||
230 char family [LEN_FONT_NAME + 1];
|
||||
231 char charset [LEN_FONT_NAME + 1];
|
||||
229 char type [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
230 char family [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
231 char charset [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
232 DWORD style;
|
||||
233 int size;
|
||||
234 int rotation;
|
||||
|
||||
+81
-67
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -2,12 +2,12 @@
|
||||
* \file control.h
|
||||
* \author Wei Yongming <vincent@minigui.org>
|
||||
* \date 2001/12/29
|
||||
*
|
||||
*
|
||||
* \brief This file includes interfaces of standard controls of MiniGUI.
|
||||
*
|
||||
\verbatim
|
||||
|
||||
This file is part of MiniGUI, a mature cross-platform windowing
|
||||
This file is part of MiniGUI, a mature cross-platform windowing
|
||||
and Graphics User Interface (GUI) support system for embedded systems
|
||||
and smart IoT devices.
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
/*
|
||||
* $Id: control.h 11349 2009-03-02 05:00:43Z weiym $
|
||||
*
|
||||
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
|
||||
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
|
||||
* pSOS, ThreadX, NuCleus, OSE, and Win32.
|
||||
*
|
||||
*/
|
||||
|
||||
+3888
-1807
File diff suppressed because it is too large
Load Diff
+339
-339
File diff suppressed because it is too large
Load Diff
+1011
-1011
File diff suppressed because it is too large
Load Diff
+426
-428
File diff suppressed because it is too large
Load Diff
+37
-38
@@ -44,21 +44,20 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _GLYPHBUF
|
||||
{
|
||||
GLYPHMAPINFO* glyph_map; /* glyph info array */
|
||||
int* glyphs; /* glyph array */
|
||||
int glyphs_len; /* glyph array len or buffer used size */
|
||||
|
||||
typedef struct _ACHARBUF
|
||||
{
|
||||
ACHARMAPINFO* achar_map; /* achar info array */
|
||||
Achar32* achars; /* achar array */
|
||||
int achars_len; /* achar 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 */
|
||||
} GLYPHBUF;
|
||||
int achars_buffsize; /* achar string buffer size */
|
||||
int acharmap_buffsize; /* achar map buffer size */
|
||||
} ACHARBUF;
|
||||
|
||||
typedef struct tagBIDISLEDITDATA
|
||||
{
|
||||
StrBuffer str_content; // string text buffer
|
||||
GLYPHBUF glyph_content; // glyph string buffer
|
||||
ACHARBUF achar_content; // achar string buffer
|
||||
|
||||
int editPos; // current edit position
|
||||
int selStart; // selection start position
|
||||
@@ -92,48 +91,48 @@ typedef struct tagBIDISLEDITDATA
|
||||
typedef BIDISLEDITDATA* PBIDISLEDITDATA;
|
||||
|
||||
static inline void*
|
||||
glyphbuf_alloc (GLYPHBUF* glyph_buff, int len, int block_size)
|
||||
acharbuf_alloc (ACHARBUF* achar_buff, int len, int block_size)
|
||||
{
|
||||
glyph_buff->glyphs_buffsize = (len + (block_size - len % block_size))
|
||||
* sizeof (int);
|
||||
glyph_buff->glyphs = malloc (glyph_buff->glyphs_buffsize);
|
||||
achar_buff->achars_buffsize = (len + (block_size - len % block_size))
|
||||
* sizeof (Achar32);
|
||||
achar_buff->achars = malloc (achar_buff->achars_buffsize);
|
||||
|
||||
glyph_buff->glyphmap_buffsize = (len + (block_size - len % block_size))
|
||||
* sizeof (GLYPHMAPINFO);
|
||||
glyph_buff->glyph_map = malloc (glyph_buff->glyphmap_buffsize);
|
||||
achar_buff->acharmap_buffsize = (len + (block_size - len % block_size))
|
||||
* sizeof (ACHARMAPINFO);
|
||||
achar_buff->achar_map = malloc (achar_buff->acharmap_buffsize);
|
||||
|
||||
glyph_buff->glyphs_len = len;
|
||||
glyph_buff->blocksize = block_size;
|
||||
achar_buff->achars_len = len;
|
||||
achar_buff->blocksize = block_size;
|
||||
|
||||
return glyph_buff->glyphs;
|
||||
return achar_buff->achars;
|
||||
}
|
||||
|
||||
static inline void glyphbuf_free (GLYPHBUF *glyph_buff)
|
||||
static inline void acharbuf_free (ACHARBUF *achar_buff)
|
||||
{
|
||||
if (glyph_buff) {
|
||||
free (glyph_buff->glyphs);
|
||||
free (glyph_buff->glyph_map);
|
||||
if (achar_buff) {
|
||||
free (achar_buff->achars);
|
||||
free (achar_buff->achar_map);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void* glyphbuf_realloc (GLYPHBUF *glyph_buff, int len)
|
||||
static inline void* acharbuf_realloc (ACHARBUF *achar_buff, int len)
|
||||
{
|
||||
if (len * sizeof(int) > glyph_buff->glyphs_buffsize ||
|
||||
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);
|
||||
glyph_buff->glyphs = realloc (glyph_buff->glyphs,
|
||||
glyph_buff->glyphs_buffsize);
|
||||
if (len * sizeof(int) > achar_buff->achars_buffsize ||
|
||||
len * sizeof(int) < achar_buff->achars_buffsize - achar_buff->blocksize) {
|
||||
/* realloc achar string mem */
|
||||
achar_buff->achars_buffsize = (len + (achar_buff->blocksize -
|
||||
len % achar_buff->blocksize))* sizeof(Achar32);
|
||||
achar_buff->achars = realloc (achar_buff->achars,
|
||||
achar_buff->achars_buffsize);
|
||||
|
||||
/* realloc glyph map mem */
|
||||
glyph_buff->glyphmap_buffsize = (len + (glyph_buff->blocksize -
|
||||
len % glyph_buff->blocksize))* sizeof(GLYPHMAPINFO);
|
||||
glyph_buff->glyph_map = realloc (glyph_buff->glyph_map,
|
||||
glyph_buff->glyphmap_buffsize);
|
||||
/* realloc achar map mem */
|
||||
achar_buff->acharmap_buffsize = (len + (achar_buff->blocksize -
|
||||
len % achar_buff->blocksize))* sizeof(ACHARMAPINFO);
|
||||
achar_buff->achar_map = realloc (achar_buff->achar_map,
|
||||
achar_buff->acharmap_buffsize);
|
||||
}
|
||||
|
||||
return glyph_buff->glyphs;
|
||||
return achar_buff->achars;
|
||||
}
|
||||
|
||||
BOOL RegisterBIDISLEditControl (void);
|
||||
|
||||
@@ -271,30 +271,30 @@ static void set_keyboard_layout(HWND hDlg)
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (cur_type == GLYPH_TYPE_RTL) {
|
||||
if (l_glyph_type == GLYPH_TYPE_RTL)
|
||||
if (cur_type == CHAR_TYPE_RTL) {
|
||||
if (l_char_type == CHAR_TYPE_RTL)
|
||||
return INSERTPOS_BEFORE (sled, l_glyph_index);
|
||||
else if (r_glyph_type == GLYPH_TYPE_RTL)
|
||||
else if (r_char_type == CHAR_TYPE_RTL)
|
||||
return INSERTPOS_AFTER (sled, r_glyph_index);
|
||||
else
|
||||
{
|
||||
if (l_glyph_type == GLYPH_TYPE_LTR)
|
||||
if (l_char_type == CHAR_TYPE_LTR)
|
||||
return INSERTPOS_AFTER (sled, l_glyph_index);
|
||||
else if (l_glyph_type == GLYPH_TYPE_LTR)
|
||||
else if (l_char_type == CHAR_TYPE_LTR)
|
||||
return INSERTPOS_BEFORE (sled, r_glyph_index);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (l_glyph_type == GLYPH_TYPE_LTR)
|
||||
if (l_char_type == CHAR_TYPE_LTR)
|
||||
return INSERTPOS_AFTER (sled, l_glyph_index);
|
||||
else if (r_glyph_type == GLYPH_TYPE_LTR)
|
||||
else if (r_char_type == CHAR_TYPE_LTR)
|
||||
return INSERTPOS_BEFORE (sled, r_glyph_index);
|
||||
else {
|
||||
if (l_glyph_type == GLYPH_TYPE_RTL)
|
||||
if (l_char_type == CHAR_TYPE_RTL)
|
||||
return INSERTPOS_BEFORE (sled, l_glyph_index);
|
||||
else if (l_glyph_type == GLYPH_TYPE_RTL)
|
||||
else if (l_char_type == CHAR_TYPE_RTL)
|
||||
return INSERTPOS_AFTER (sled, r_glyph_index);
|
||||
else
|
||||
return 0;
|
||||
|
||||
@@ -3,16 +3,19 @@ SUBDIRS = in-core
|
||||
noinst_LTLIBRARIES = libfont.la
|
||||
|
||||
SRC_FILES = charset.c charset-arabic.c charset-bidi.c \
|
||||
unicode-comp.c unicode-script.c language-code.c \
|
||||
sysfont.c logfont.c devfont.c fontname.c \
|
||||
rawbitmap.c varbitmap.c qpf.c upf.c \
|
||||
fontcache.c freetype2.c font-engines.c\
|
||||
gbunimap.c gbkunimap.c gb18030unimap.c big5unimap.c \
|
||||
ujisunimap.c sjisunimap.c euckrunimap.c \
|
||||
textops.c mapunitogb.c mapunitogbk.c mapunitobig5.c mapunitogb18030.c \
|
||||
bitmapfont.c scripteasy.c
|
||||
bitmapfont.c scripteasy.c \
|
||||
unicode-emoji.c
|
||||
|
||||
HDR_FILES = charset.h rawbitmap.h varbitmap.h freetype2.h qpf.h \
|
||||
upf.h bitmapfont.h gunichartables.h se_minigui.h unicode-bidi-tables.h
|
||||
HDR_FILES = charset.h rawbitmap.h varbitmap.h freetype2.h qpf.h se_minigui.h \
|
||||
upf.h bitmapfont.h unicode-bidi-tables.h \
|
||||
unicode-tables.h unicode-break.h unicode-decomp.h unicode-comp.h unicode-emoji-table.h
|
||||
|
||||
EXTRA_DIST = convgbmap.c jisunimap.c $(SRC_FILES) $(HDR_FILES) \
|
||||
makefile.ng makefile.msvc
|
||||
|
||||
+10
-7
@@ -190,7 +190,7 @@ static void destroy (GLYPHTREENODE *root)
|
||||
|
||||
/*** device font ops ***/
|
||||
|
||||
static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
|
||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||
{
|
||||
return DEVFONTGLYPHTYPE_PRERDRBMP;
|
||||
}
|
||||
@@ -210,8 +210,11 @@ static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
|
||||
return ((BMPFONTINFO *)devfont->data)->height;
|
||||
}
|
||||
|
||||
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
|
||||
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
|
||||
{
|
||||
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
|
||||
SET_DEVFONT_SCALE (logfont, df_slot, 1);
|
||||
|
||||
return ((BMPFONTINFO *)devfont->data)->height;
|
||||
}
|
||||
|
||||
@@ -365,7 +368,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
|
||||
/**************************** Global data ************************************/
|
||||
FONTOPS __mg_bitmap_font_ops = {
|
||||
get_glyph_type,
|
||||
get_glyph_bmptype,
|
||||
get_ave_width,
|
||||
get_max_width,
|
||||
get_font_height,
|
||||
@@ -469,7 +472,7 @@ DEVFONT *CreateBMPDevFont (const char *bmpfont_name, const BITMAP* glyph_bmp,
|
||||
{
|
||||
DEVFONT* bitmapfont_dev_font = NULL;
|
||||
CHARSETOPS* charset_ops;
|
||||
char charset[LEN_FONT_NAME + 1];
|
||||
char charset[LEN_LOGFONT_NAME_FIELD + 1];
|
||||
BMPFONTINFO *bmpfont_info;
|
||||
int offset;
|
||||
|
||||
@@ -484,7 +487,7 @@ DEVFONT *CreateBMPDevFont (const char *bmpfont_name, const BITMAP* glyph_bmp,
|
||||
goto error_create;
|
||||
}
|
||||
|
||||
offset = (charset_ops->char_glyph_value) (NULL, 0,
|
||||
offset = (charset_ops->get_char_value) (NULL, 0,
|
||||
(const unsigned char*) start_mchar, 0);
|
||||
|
||||
bmpfont_info = build_bmpfont_info (bmpfont_name, glyph_bmp,
|
||||
@@ -547,7 +550,7 @@ BOOL AddGlyphsToBMPFont (DEVFONT* dev_font, BITMAP* glyph_bmp,
|
||||
return FALSE;
|
||||
|
||||
/* Insert a node in the avl tree */
|
||||
offset = (*dev_font->charset_ops->char_glyph_value) (NULL, 0,
|
||||
offset = (*dev_font->charset_ops->get_char_value) (NULL, 0,
|
||||
(const unsigned char*)start_mchar, 0);
|
||||
|
||||
if (look_up (root, offset) == NULL) {
|
||||
@@ -641,7 +644,7 @@ static int avl_look_up (DEVFONT *dev_font, char *start_mchar, int n)
|
||||
GLYPHTREENODE *p;
|
||||
int offset;
|
||||
|
||||
offset = (*dev_font->charset_ops->char_glyph_value) (NULL, 0,
|
||||
offset = (*dev_font->charset_ops->get_char_value) (NULL, 0,
|
||||
(const unsigned char*)start_mchar, n);
|
||||
offset += n;
|
||||
|
||||
|
||||
+196
-192
File diff suppressed because it is too large
Load Diff
+117
-94
File diff suppressed because it is too large
Load Diff
+1001
-435
File diff suppressed because it is too large
Load Diff
+217
-88
File diff suppressed because it is too large
Load Diff
+29
-63
File diff suppressed because it is too large
Load Diff
+129
-29
File diff suppressed because it is too large
Load Diff
+127
-118
File diff suppressed because it is too large
Load Diff
+333
-250
File diff suppressed because it is too large
Load Diff
+31
-29
@@ -1,33 +1,33 @@
|
||||
/*
|
||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||
* and Graphics User Interface (GUI) support system for embedded systems
|
||||
* and smart IoT devices.
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* Or,
|
||||
*
|
||||
*
|
||||
* As this program is a library, any link to this program must follow
|
||||
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
||||
* GPLv3, you need to be licensed from FMSoft.
|
||||
*
|
||||
*
|
||||
* If you have got a commercial license of this program, please use it
|
||||
* under the terms and conditions of the commercial license.
|
||||
*
|
||||
*
|
||||
* For more information about the commercial license, please refer to
|
||||
* <http://www.minigui.com/en/about/licensing-policy/>.
|
||||
*/
|
||||
@@ -40,6 +40,14 @@
|
||||
#ifndef GUI_FREETYP2_H
|
||||
#define GUI_FREETYP2_H
|
||||
|
||||
#undef TTF_DBG
|
||||
|
||||
#ifndef TTF_DBG
|
||||
#define DP(x)
|
||||
#else
|
||||
#define DP(x) do { printf x; } while (0)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
@@ -63,14 +71,13 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _MGFONT_TTF_CACHE
|
||||
typedef unsigned long HCACHE;
|
||||
typedef int (* MakeHashKeyFunc)(unsigned short unicode);
|
||||
#endif
|
||||
typedef void* HCACHE;
|
||||
typedef int (* MakeHashKeyFunc)(Uchar32 unicode);
|
||||
#endif
|
||||
|
||||
typedef struct tagFTFACEINFO {
|
||||
#ifdef _MGFONT_TTF_CACHE
|
||||
/*should be MAX_PATH*/
|
||||
char filepathname[256];
|
||||
char* filepathname;
|
||||
int face_index;
|
||||
int cmap_index;
|
||||
#else
|
||||
@@ -115,39 +122,34 @@ typedef struct tagFTINSTANCEINFO {
|
||||
#define _TTF_HASH_NDIR 37
|
||||
|
||||
typedef struct tagTTFCACHEINFO {
|
||||
unsigned short unicode;
|
||||
short glyph_code;
|
||||
Uchar32 unicode;
|
||||
FT_UInt glyph_code;
|
||||
FT_Vector advance;
|
||||
FT_BBox bbox;
|
||||
FT_Vector delta;
|
||||
int flag;
|
||||
int pitch;
|
||||
int width;
|
||||
int height;
|
||||
void *bitmap;
|
||||
} TTFCACHEINFO, *PTTFCACHEINFO;
|
||||
|
||||
extern HCACHE __mg_ttc_create(char *family, char *charset,
|
||||
DWORD style, int size, int rotation,
|
||||
extern HCACHE __mg_ttc_create(const char *df_name,
|
||||
int style, int size, int rotation,
|
||||
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey);
|
||||
extern HCACHE __mg_ttc_is_exist(const char *df_name,
|
||||
int style, int size, int rotation);
|
||||
|
||||
extern int __mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size);
|
||||
extern void __mg_ttc_release(HCACHE hCache);
|
||||
extern int __mg_ttc_sys_init(int maxCache, int cacheSize);
|
||||
extern void __mg_ttc_sys_deinit(void);
|
||||
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache,
|
||||
unsigned short unicode, int *size);
|
||||
extern HCACHE __mg_ttc_is_exist(char *family, char *charset,
|
||||
DWORD style, int size, int rotation);
|
||||
Uchar32 unicode, int *size);
|
||||
extern void __mg_ttc_refer(HCACHE hCache);
|
||||
|
||||
#endif
|
||||
|
||||
#undef TTF_DBG
|
||||
|
||||
#ifndef TTF_DBG
|
||||
#define DP(x)
|
||||
#else
|
||||
#define DP(x) do { printf x; } while (0)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+342
-313
File diff suppressed because it is too large
Load Diff
+669
-669
File diff suppressed because it is too large
Load Diff
+37
-31
@@ -154,7 +154,7 @@ static void clear_glyph_tree (QPF_GLYPHTREE* tree)
|
||||
free (tree->more);
|
||||
}
|
||||
|
||||
static void* load_font_data (const char* font_name, const char* file_name)
|
||||
static void* load_font_data (DEVFONT* devfont, const char* font_name, const char* file_name)
|
||||
{
|
||||
FILE* fp = NULL;
|
||||
uchar* data;
|
||||
@@ -222,7 +222,7 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void unload_font_data (void* data)
|
||||
static void unload_font_data (DEVFONT* devfont, void* data)
|
||||
{
|
||||
QPFINFO* qpf_info = (QPFINFO*)data;
|
||||
|
||||
@@ -275,7 +275,7 @@ static unsigned char def_smooth_bitmap [] =
|
||||
static QPF_GLYPH def_glyph = {&def_metrics, def_bitmap};
|
||||
static QPF_GLYPH def_smooth_glyph = {&def_smooth_metrics, def_smooth_bitmap};
|
||||
|
||||
static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
|
||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||
{
|
||||
if (QPFONT_INFO_P (devfont)->fm->flags & FLAG_MODE_SMOOTH)
|
||||
return DEVFONTGLYPHTYPE_GREYBMP;
|
||||
@@ -302,7 +302,7 @@ static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
|
||||
* GET_DEVFONT_SCALE (logfont, devfont);
|
||||
}
|
||||
|
||||
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
|
||||
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
|
||||
{
|
||||
int height = QPFONT_INFO_P (devfont)->fm->ascent +
|
||||
QPFONT_INFO_P (devfont)->fm->descent;
|
||||
@@ -311,7 +311,8 @@ static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
|
||||
if (logfont->style & FS_OTHER_AUTOSCALE)
|
||||
scale = font_GetBestScaleFactor (height, expect);
|
||||
|
||||
SET_DEVFONT_SCALE (logfont, devfont, scale);
|
||||
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
|
||||
SET_DEVFONT_SCALE (logfont, df_slot, scale);
|
||||
|
||||
return height * scale;
|
||||
}
|
||||
@@ -329,23 +330,24 @@ static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
||||
}
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
{
|
||||
unsigned int uc16;
|
||||
QPF_GLYPH* glyph;
|
||||
|
||||
if(devfont->charset_ops->conv_to_uc32)
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||
else
|
||||
uc16 = glyph_value;
|
||||
|
||||
|
||||
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
|
||||
|
||||
if (glyph == NULL) {
|
||||
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
|
||||
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) { /* ASCII */
|
||||
unsigned char ascii_ch = uc16;
|
||||
return logfont->sbc_devfont->font_ops->get_glyph_monobitmap (logfont,
|
||||
logfont->sbc_devfont, ascii_ch, pitch, scale);
|
||||
return logfont->devfonts[0]->font_ops->get_glyph_monobitmap (logfont,
|
||||
logfont->devfonts[0], ascii_ch, sz, pitch, scale);
|
||||
}
|
||||
else
|
||||
glyph = &def_glyph;
|
||||
@@ -365,11 +367,12 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
}
|
||||
|
||||
static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
{
|
||||
unsigned int uc16;
|
||||
QPF_GLYPH* glyph;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (scale)
|
||||
*scale = GET_DEVFONT_SCALE (logfont, devfont);
|
||||
|
||||
@@ -400,6 +403,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
QPF_GLYPH* glyph;
|
||||
unsigned short scale = GET_DEVFONT_SCALE (logfont, devfont);
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if(devfont->charset_ops->conv_to_uc32)
|
||||
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||
else
|
||||
@@ -408,21 +412,21 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
|
||||
|
||||
if (glyph == NULL) {
|
||||
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
|
||||
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) { /* ASCII */
|
||||
unsigned char ascii_ch = uc16;
|
||||
if (logfont->sbc_devfont->font_ops->get_glyph_bbox) {
|
||||
return logfont->sbc_devfont->font_ops->get_glyph_bbox (logfont,
|
||||
logfont->sbc_devfont, ascii_ch,
|
||||
if (logfont->devfonts[0]->font_ops->get_glyph_bbox) {
|
||||
return logfont->devfonts[0]->font_ops->get_glyph_bbox (logfont,
|
||||
logfont->devfonts[0], ascii_ch,
|
||||
px, py, pwidth, pheight);
|
||||
}
|
||||
else {
|
||||
int width, height, ascent;
|
||||
logfont->sbc_devfont->font_ops->get_glyph_advance
|
||||
(logfont, logfont->sbc_devfont, glyph_value, &width, 0);
|
||||
height = logfont->sbc_devfont->font_ops->get_font_height
|
||||
(logfont, logfont->sbc_devfont);
|
||||
ascent = logfont->sbc_devfont->font_ops->get_font_ascent
|
||||
(logfont, logfont->sbc_devfont);
|
||||
logfont->devfonts[0]->font_ops->get_glyph_advance
|
||||
(logfont, logfont->devfonts[0], glyph_value, &width, 0);
|
||||
height = logfont->devfonts[0]->font_ops->get_font_height
|
||||
(logfont, logfont->devfonts[0]);
|
||||
ascent = logfont->devfonts[0]->font_ops->get_font_ascent
|
||||
(logfont, logfont->devfonts[0]);
|
||||
|
||||
if (pwidth) *pwidth = width;
|
||||
if (pheight) *pheight = height;
|
||||
@@ -452,6 +456,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
QPF_GLYPH* glyph;
|
||||
int advance;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if(devfont->charset_ops->conv_to_uc32)
|
||||
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||
else
|
||||
@@ -460,11 +465,11 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
|
||||
|
||||
if (glyph == NULL) {
|
||||
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
|
||||
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) { /* ASCII */
|
||||
unsigned char ascii_ch = uc16;
|
||||
if (logfont->sbc_devfont->font_ops->get_glyph_advance) {
|
||||
return logfont->sbc_devfont->font_ops->
|
||||
get_glyph_advance (logfont, logfont->sbc_devfont,
|
||||
if (logfont->devfonts[0]->font_ops->get_glyph_advance) {
|
||||
return logfont->devfonts[0]->font_ops->
|
||||
get_glyph_advance (logfont, logfont->devfonts[0],
|
||||
ascii_ch, px, py);
|
||||
}
|
||||
}
|
||||
@@ -498,17 +503,18 @@ static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_
|
||||
unsigned int uc16;
|
||||
QPF_GLYPH* glyph;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if(devfont->charset_ops->conv_to_uc32)
|
||||
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||
else
|
||||
uc16 = glyph_value;
|
||||
|
||||
|
||||
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
|
||||
|
||||
if (glyph == NULL) {
|
||||
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) /* ASCII */
|
||||
return logfont->sbc_devfont->font_ops->is_glyph_existed (logfont,
|
||||
logfont->sbc_devfont, glyph_value);
|
||||
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) /* ASCII */
|
||||
return logfont->devfonts[0]->font_ops->is_glyph_existed (logfont,
|
||||
logfont->devfonts[0], glyph_value);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
@@ -522,7 +528,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
|
||||
|
||||
/**************************** Global data ************************************/
|
||||
FONTOPS __mg_qpf_ops = {
|
||||
get_glyph_type,
|
||||
get_glyph_bmptype,
|
||||
get_ave_width,
|
||||
get_max_width,
|
||||
get_font_height,
|
||||
|
||||
+14
-16
@@ -65,11 +65,7 @@
|
||||
#define RBFONT_INFO(devfont) ((RBFINFO*)(devfont.data))
|
||||
|
||||
/********************** Load/Unload of raw bitmap font ***********************/
|
||||
#if 0
|
||||
static void* load_font_data (char* font_name, char* file_name,
|
||||
char* real_font_name)
|
||||
#endif
|
||||
static void* load_font_data (const char* font_name, const char* file_name)
|
||||
static void* load_font_data (DEVFONT* devfont, const char* font_name, const char* file_name)
|
||||
{
|
||||
FILE* fp = NULL;
|
||||
RBFINFO* rbf_info = calloc (1, sizeof(RBFINFO));
|
||||
@@ -129,7 +125,7 @@ error_load:
|
||||
|
||||
/********************** Init/Term of raw bitmap font ***********************/
|
||||
|
||||
static void unload_font_data (void* data)
|
||||
static void unload_font_data (DEVFONT* devfont, void* data)
|
||||
{
|
||||
RBFINFO* rbfinfo = (RBFINFO*)data;
|
||||
#ifdef HAVE_MMAP
|
||||
@@ -143,7 +139,7 @@ static void unload_font_data (void* data)
|
||||
|
||||
/*************** Raw bitmap font operations *********************************/
|
||||
|
||||
static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
|
||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||
{
|
||||
return DEVFONTGLYPHTYPE_MONOBMP;
|
||||
}
|
||||
@@ -158,7 +154,7 @@ static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
|
||||
return RBFONT_INFO_P (devfont)->height * GET_DEVFONT_SCALE (logfont, devfont);
|
||||
}
|
||||
|
||||
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
|
||||
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
|
||||
{
|
||||
int height = RBFONT_INFO_P (devfont)->height;
|
||||
unsigned short scale = 1;
|
||||
@@ -166,7 +162,8 @@ static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
|
||||
if (logfont->style & FS_OTHER_AUTOSCALE)
|
||||
scale = font_GetBestScaleFactor (height, expect);
|
||||
|
||||
SET_DEVFONT_SCALE (logfont, devfont, scale);
|
||||
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
|
||||
SET_DEVFONT_SCALE (logfont, df_slot, scale);
|
||||
|
||||
return height * scale;
|
||||
}
|
||||
@@ -192,7 +189,7 @@ static int get_font_ascent (LOGFONT* logfont, DEVFONT* devfont)
|
||||
static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
||||
{
|
||||
int height = RBFONT_INFO_P (devfont)->height;
|
||||
|
||||
|
||||
height *= GET_DEVFONT_SCALE (logfont, devfont);
|
||||
|
||||
if (height >= 40)
|
||||
@@ -208,13 +205,13 @@ static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
||||
}
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
{
|
||||
int bitmap_size;
|
||||
Glyph32 glyph_tmp = glyph_value;
|
||||
|
||||
if (glyph_tmp >= RBFONT_INFO_P (devfont)->nr_glyphs)
|
||||
glyph_tmp = devfont->charset_ops->def_glyph_value;
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (glyph_value >= RBFONT_INFO_P (devfont)->nr_glyphs)
|
||||
glyph_value = devfont->charset_ops->def_char_value;
|
||||
|
||||
bitmap_size = ((RBFONT_INFO_P (devfont)->width + 7) >> 3)
|
||||
* RBFONT_INFO_P (devfont)->height;
|
||||
@@ -224,12 +221,13 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
if (scale)
|
||||
*scale = GET_DEVFONT_SCALE (logfont, devfont);
|
||||
|
||||
return RBFONT_INFO_P (devfont)->data + bitmap_size * glyph_tmp;
|
||||
return RBFONT_INFO_P (devfont)->data + bitmap_size * glyph_value;
|
||||
}
|
||||
|
||||
static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont,
|
||||
Glyph32 glyph_value)
|
||||
{
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (glyph_value > RBFONT_INFO_P(devfont)->nr_glyphs)
|
||||
return FALSE;
|
||||
else
|
||||
@@ -268,7 +266,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
|
||||
|
||||
/**************************** Global data ************************************/
|
||||
FONTOPS __mg_rbf_ops = {
|
||||
get_glyph_type,
|
||||
get_glyph_bmptype,
|
||||
get_ave_width,
|
||||
get_ave_width, // max_width same as ave_width
|
||||
get_font_height,
|
||||
|
||||
+12
-6
@@ -103,7 +103,7 @@ static void unlock(void)
|
||||
static BOOL load_fonts(void)
|
||||
{
|
||||
int i;
|
||||
int font_table_size = se_font_desc.font_name_map_size;
|
||||
int font_table_size = se_font_desc.font_name_map_size;
|
||||
BOOL result = FALSE;
|
||||
|
||||
#if SE_MINIGUI_TRACE
|
||||
@@ -113,7 +113,7 @@ static BOOL load_fonts(void)
|
||||
se_dev_fonts = calloc (font_table_size, sizeof (DEVFONT));
|
||||
|
||||
for (i = 0; i < font_table_size; i++) {
|
||||
char charset[LEN_FONT_NAME + 1];
|
||||
char charset[LEN_LOGFONT_NAME_FIELD + 1];
|
||||
CHARSETOPS *charset_ops;
|
||||
const char *font_name;
|
||||
int font_id;
|
||||
@@ -158,7 +158,7 @@ static BOOL load_fonts(void)
|
||||
if ((nr_charsets = charsetGetCharsetsNumber (charsets)) > 1) {
|
||||
int j;
|
||||
for (j = 1; j < nr_charsets; j++) {
|
||||
char charset [LEN_FONT_NAME + 1];
|
||||
char charset [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
CHARSETOPS* charset_ops;
|
||||
DEVFONT* new_devfont;
|
||||
|
||||
@@ -334,6 +334,7 @@ static int get_glyph_width (LOGFONT* logfont, DEVFONT* devfont,
|
||||
SeLogFont selogfont;
|
||||
int width;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||
else
|
||||
@@ -364,7 +365,7 @@ static int get_max_width (LOGFONT* logfont, DEVFONT* devfont)
|
||||
return logfont->size;
|
||||
}
|
||||
|
||||
static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
|
||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||
{
|
||||
if (logfont->style & FS_WEIGHT_BOOK)
|
||||
return DEVFONTGLYPHTYPE_GREYBMP;
|
||||
@@ -440,6 +441,7 @@ static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
printf("in get_glyph_greybitmap....\n");
|
||||
#endif
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||
else
|
||||
@@ -466,7 +468,7 @@ static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
}
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
{
|
||||
seunichar16 wc;
|
||||
SeLogFont selogfont;
|
||||
@@ -476,6 +478,7 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
printf("in get_char_bitmap....\n");
|
||||
#endif
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||
else
|
||||
@@ -505,6 +508,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
if(px == 0 && py == 0 && pwidth == 0 && pheight == 0)
|
||||
return 1;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||
else
|
||||
@@ -534,6 +538,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
SeLogFont selogfont;
|
||||
int x = *px;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||
else
|
||||
@@ -558,6 +563,7 @@ static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_
|
||||
int uni_char;
|
||||
int x, y, width, height;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if(devfont->charset_ops->conv_to_uc32)
|
||||
uni_char = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||
else
|
||||
@@ -577,7 +583,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
|
||||
|
||||
/**************************** Global data ************************************/
|
||||
static FONTOPS scripteasy_font_ops = {
|
||||
get_glyph_type,
|
||||
get_glyph_bmptype,
|
||||
get_ave_width,
|
||||
get_max_width,
|
||||
get_font_height,
|
||||
|
||||
+13
-13
@@ -102,10 +102,10 @@ BOOL mg_InitSysFont (void)
|
||||
|
||||
for (i = 0; i < nr_fonts; i++) {
|
||||
char key [11];
|
||||
char type [LEN_FONT_NAME + 1];
|
||||
char family [LEN_FONT_NAME + 1];
|
||||
char style [LEN_FONT_NAME + 1];
|
||||
char charset [LEN_FONT_NAME + 1];
|
||||
char type [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
char family [LEN_LOGFONT_FAMILY_FILED + 1];
|
||||
char style [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
char charset [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
char font_name [LEN_DEVFONT_NAME + 1];
|
||||
int height;
|
||||
int j = 0, need = 0;
|
||||
@@ -205,28 +205,28 @@ void mg_TermSysFont (void)
|
||||
const char* GUIAPI GetSysCharset (BOOL wchar)
|
||||
{
|
||||
if (wchar) {
|
||||
if (g_SysLogFont[1]->mbc_devfont)
|
||||
return MBC_DEVFONT_INFO_P (g_SysLogFont[1])->charset_ops->name;
|
||||
if (g_SysLogFont[1]->devfonts[1])
|
||||
return g_SysLogFont[1]->devfonts[1]->charset_ops->name;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
return SBC_DEVFONT_INFO_P (g_SysLogFont[0])->charset_ops->name;
|
||||
else
|
||||
return g_SysLogFont[0]->devfonts[0]->charset_ops->name;
|
||||
}
|
||||
|
||||
int GUIAPI GetSysCharWidth (void)
|
||||
{
|
||||
DEVFONT* sbc_devfont = g_SysLogFont[0]->sbc_devfont;
|
||||
DEVFONT* sbc_devfont = g_SysLogFont[0]->devfonts[0];
|
||||
|
||||
return sbc_devfont->font_ops->get_ave_width (g_SysLogFont[0], sbc_devfont);
|
||||
}
|
||||
|
||||
int GUIAPI GetSysCCharWidth (void)
|
||||
{
|
||||
DEVFONT* mbc_devfont = g_SysLogFont[1]->mbc_devfont;
|
||||
DEVFONT* mbc_devfont = g_SysLogFont[1]->devfonts[1];
|
||||
|
||||
if (mbc_devfont)
|
||||
return mbc_devfont->font_ops->get_ave_width (g_SysLogFont[1], mbc_devfont);
|
||||
return mbc_devfont->font_ops->get_ave_width (g_SysLogFont[1], mbc_devfont);
|
||||
else
|
||||
return GetSysCharWidth () * 2;
|
||||
}
|
||||
@@ -238,14 +238,14 @@ int GUIAPI GetSysCharHeight (void)
|
||||
|
||||
int GUIAPI GetSysFontMaxWidth (int font_id)
|
||||
{
|
||||
DEVFONT* sbc_devfont = g_SysLogFont[font_id]->sbc_devfont;
|
||||
DEVFONT* sbc_devfont = g_SysLogFont[font_id]->devfonts[0];
|
||||
|
||||
return sbc_devfont->font_ops->get_max_width (g_SysLogFont[font_id], sbc_devfont);
|
||||
}
|
||||
|
||||
int GUIAPI GetSysFontAveWidth (int font_id)
|
||||
{
|
||||
DEVFONT* sbc_devfont = g_SysLogFont[font_id]->sbc_devfont;
|
||||
DEVFONT* sbc_devfont = g_SysLogFont[font_id]->devfonts[0];
|
||||
|
||||
return sbc_devfont->font_ops->get_ave_width (g_SysLogFont[font_id], sbc_devfont);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ BOOL mg_InitSysFont (void)
|
||||
|
||||
for (i = 0; i < nr_fonts; i++) {
|
||||
char key [11];
|
||||
char charset [LEN_FONT_NAME + 1];
|
||||
char charset [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
char file [MAX_PATH + 1];
|
||||
|
||||
sprintf (key, "name%d", i);
|
||||
|
||||
@@ -6,8 +6,7 @@ u:arabic_test_unicode
|
||||
hex:arabic_test_hex
|
||||
|
||||
MINIGUI_COMMON = /usr/local/include/minigui
|
||||
LIBS = -lminigui_ths -lm -ljpeg -lz -lpng -lpthread -lttf
|
||||
#LIBS = -lminigui_ths -lm -ljpeg -lz -lpng -lpthread -lfreetype
|
||||
LIBS = -lminigui_ths -lm -ljpeg -lz -lpng -lpthread -lfreetype
|
||||
|
||||
arabic_test:arabic_test.c $(MINIGUI_COMMON)
|
||||
gcc arabic_test.c -Wall -g -o arabic_test $(LIBS)
|
||||
|
||||
@@ -149,7 +149,7 @@ void read_total_file( void )
|
||||
fclose (fp);
|
||||
}
|
||||
|
||||
static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
|
||||
static LRESULT HelloWinProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HDC hdc;
|
||||
switch (message) {
|
||||
|
||||
@@ -101,10 +101,10 @@ static int test_correctness ()
|
||||
if (index < 0) /* not a letter.*/
|
||||
continue;
|
||||
|
||||
glyph_value = iso8859_6_char_glyph_value (NULL, 0, c, 1);
|
||||
glyph_value = iso8859_6_get_char_value (NULL, 0, c, 1);
|
||||
fprintf (stderr, "%x 's glyph value = %x\n", *c, glyph_value);
|
||||
|
||||
if (!test_glyph_value (index, glyph_value)) {
|
||||
if (!iso8859_6_test_glyph_value (index, glyph_value)) {
|
||||
fprintf (stderr, "Shape error: %x\n", *c);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ helloworld:helloworld.c
|
||||
gcc helloworld.c -Wall -g -o helloworld -lminigui_ths -lm -ljpeg -lz -lfreetype -lpng -lpthread
|
||||
|
||||
hebrew_test:hebrew_test.c
|
||||
gcc hebrew_test.c -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lttf -lpng -lpthread
|
||||
gcc hebrew_test.c -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lfreetype -lpng -lpthread
|
||||
|
||||
hebrew_test_release:hebrew_test.c
|
||||
gcc hebrew_test.c -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lttf -lpng -lpthread
|
||||
gcc hebrew_test.c -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lfreetype -lpng -lpthread
|
||||
|
||||
hebrew_test_debug:hebrew_test.c
|
||||
gcc hebrew_test.c -DARABIC_DEBUG -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lttf -lpng -lpthread
|
||||
gcc hebrew_test.c -DARABIC_DEBUG -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lfreetype -lpng -lpthread
|
||||
|
||||
hebrew_test_unicode:hebrew_test.c
|
||||
gcc hebrew_test.c -DARABIC_UNICODE -DARABIC_DEBUG -g -o hebrew_test_u -lminigui_ths -lm -lfreetype -ljpeg -lz -lpng -lpthread
|
||||
|
||||
@@ -59,23 +59,23 @@ char filename[256];
|
||||
char fontname[50];
|
||||
|
||||
BOOL textout = TRUE;
|
||||
RECT arabic_rc = {0, 0, 640, 480};
|
||||
RECT hebrew_rc = {0, 0, 640, 480};
|
||||
int line_num = 0;
|
||||
|
||||
static char msg_text [256] = "Show text with TextOut.";
|
||||
|
||||
static FILE *fp = NULL;
|
||||
static PLOGFONT logfont_iso8859_8;
|
||||
//static char arabic_text[] = {0xc7,0xe4,0xe1,0xd1,0xea,0xe2,0xa0,0xc7,0xe4,0xca,0xe2,0xe6,0xea,0x00};
|
||||
//static char hebrew_text[] = {0xc7,0xe4,0xe1,0xd1,0xea,0xe2,0xa0,0xc7,0xe4,0xca,0xe2,0xe6,0xea,0x00};
|
||||
|
||||
static int reset_fp_pos()
|
||||
{
|
||||
arabic_rc.left = 0;
|
||||
arabic_rc.top = 0;
|
||||
arabic_rc.right = g_rcScr.right - 24;
|
||||
arabic_rc.bottom = g_rcScr.bottom;
|
||||
hebrew_rc.left = 0;
|
||||
hebrew_rc.top = 0;
|
||||
hebrew_rc.right = g_rcScr.right - 24;
|
||||
hebrew_rc.bottom = g_rcScr.bottom;
|
||||
if(!fp){
|
||||
DBGLOG2("============================= arabic_test %s===============================\n", filename);
|
||||
DBGLOG2("============================= hebrew_test %s===============================\n", filename);
|
||||
fp = fopen(filename, "rb");
|
||||
if (!fp) {
|
||||
DBGLOG2("cannot open %s\n", filename);
|
||||
@@ -140,7 +140,7 @@ void read_total_file( void )
|
||||
fclose (fp);
|
||||
}
|
||||
|
||||
static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
|
||||
static LRESULT HelloWinProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HDC hdc;
|
||||
switch (message) {
|
||||
@@ -196,13 +196,13 @@ static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
if(textout == TRUE) {
|
||||
if(GetTextAlign(hdc) == TA_RIGHT)
|
||||
TextOut(hdc, arabic_rc.right, i*line_height, pline);
|
||||
TextOut(hdc, hebrew_rc.right, i*line_height, pline);
|
||||
else
|
||||
TextOut(hdc, arabic_rc.left, i*line_height, pline);
|
||||
TextOut(hdc, hebrew_rc.left, i*line_height, pline);
|
||||
}
|
||||
else{
|
||||
int height = DrawText(hdc, pline, -1, &arabic_rc, DT_RIGHT);
|
||||
arabic_rc.top += height;
|
||||
int height = DrawText(hdc, pline, -1, &hebrew_rc, DT_RIGHT);
|
||||
hebrew_rc.top += height;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@@ -210,7 +210,7 @@ static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
|
||||
/*
|
||||
else{
|
||||
read_total_file();
|
||||
DrawText(hdc, filebuf, -1, &arabic_rc, DT_RIGHT);
|
||||
DrawText(hdc, filebuf, -1, &hebrew_rc, DT_RIGHT);
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+39
-39
File diff suppressed because it is too large
Load Diff
+6
-3
@@ -79,7 +79,7 @@ static encstruct default_enc;
|
||||
|
||||
#define CHARSPACEUNIT2PIXEL(x) (x/1000)
|
||||
|
||||
static void* load_font_data (const char* font_name, const char* file_name)
|
||||
static void* load_font_data (DEVFONT* devfont, const char* font_name, const char* file_name)
|
||||
{
|
||||
int j;
|
||||
int font_id;
|
||||
@@ -109,7 +109,7 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void unload_font_data (void* data)
|
||||
static void unload_font_data (DEVFONT* devfont, void* data)
|
||||
{
|
||||
free (data);
|
||||
}
|
||||
@@ -200,8 +200,11 @@ static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
|
||||
return type1_inst_info->font_height;
|
||||
}
|
||||
|
||||
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
|
||||
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
|
||||
{
|
||||
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
|
||||
SET_DEVFONT_SCALE (logfont, df_slot, scale);
|
||||
|
||||
return expect;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
typedef struct _bidichar_type_map
|
||||
{
|
||||
Uint32 type; // Type of Unicode characters
|
||||
Glyph32 glyph; // Starting index of Unicode character
|
||||
Uchar32 chv; // Starting index of Unicode character
|
||||
Uint8 count; // Total number of Unicode characters of same type starting from glyphn
|
||||
} BIDICHAR_TYPE_MAP;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||
* and Graphics User Interface (GUI) support system for embedded systems
|
||||
* and smart IoT devices.
|
||||
*
|
||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Or,
|
||||
*
|
||||
* As this program is a library, any link to this program must follow
|
||||
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
||||
* GPLv3, you need to be licensed from FMSoft.
|
||||
*
|
||||
* If you have got a commercial license of this program, please use it
|
||||
* under the terms and conditions of the commercial license.
|
||||
*
|
||||
* For more information about the commercial license, please refer to
|
||||
* <http://www.minigui.com/en/about/licensing-policy/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
** Some operators to check Emoji.
|
||||
** Implementation of the functions is based on some code from LGPL'd Pango.
|
||||
**
|
||||
** Created by WEI Yongming at 2019/02/26
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
#include "unicode-ops.h"
|
||||
#include "unicode-emoji-table.h"
|
||||
|
||||
static int interval_compare(const void *key, const void *elt)
|
||||
{
|
||||
Uchar32 c = (Uchar32)(intptr_t)key;
|
||||
struct Interval *interval = (struct Interval *)elt;
|
||||
|
||||
if (c < interval->start)
|
||||
return -1;
|
||||
if (c > interval->end)
|
||||
return +1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define DEFINE_unicode_is_(name) \
|
||||
BOOL _unicode_is_##name (Uchar32 ch) \
|
||||
{ \
|
||||
if (bsearch ((void*)((intptr_t)ch), \
|
||||
_unicode_##name##_table, \
|
||||
TABLESIZE (_unicode_##name##_table), \
|
||||
sizeof _unicode_##name##_table[0], \
|
||||
interval_compare)) \
|
||||
return TRUE; \
|
||||
\
|
||||
return FALSE; \
|
||||
}
|
||||
|
||||
DEFINE_unicode_is_(emoji)
|
||||
DEFINE_unicode_is_(emoji_presentation)
|
||||
DEFINE_unicode_is_(emoji_modifier)
|
||||
DEFINE_unicode_is_(emoji_modifier_base)
|
||||
DEFINE_unicode_is_(emoji_extended_pictographic)
|
||||
|
||||
BOOL _unicode_is_emoji_text_default(Uchar32 ch)
|
||||
{
|
||||
return _unicode_is_emoji(ch) && !_unicode_is_emoji_presentation(ch);
|
||||
}
|
||||
|
||||
BOOL _unicode_is_emoji_emoji_default(Uchar32 ch)
|
||||
{
|
||||
return _unicode_is_emoji_presentation(ch);
|
||||
}
|
||||
|
||||
BOOL _unicode_is_emoji_keycap_base(Uchar32 ch)
|
||||
{
|
||||
return (ch >= '0' && ch <= '9') || ch == '#' || ch == '*';
|
||||
}
|
||||
|
||||
BOOL _unicode_is_regional_indicator(Uchar32 ch)
|
||||
{
|
||||
return (ch >= 0x1F1E6 && ch <= 0x1F1FF);
|
||||
}
|
||||
|
||||
#endif /* _MGCHARSET_UNICODE */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+64
-69
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -40,9 +40,9 @@
|
||||
#ifndef GUI_FONT_UPF_H
|
||||
#define GUI_FONT_UPF_H
|
||||
|
||||
#define LEN_VERSION_MAX 10
|
||||
#define LEN_VENDER_NAME_MAX 12
|
||||
#define LEN_DEVFONT_NAME_MAX 127
|
||||
#define LEN_VERSION_MAX 10
|
||||
#define LEN_VENDER_NAME_MAX 12
|
||||
#define LEN_UPF_NAME_MAX 127
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -100,7 +100,7 @@ typedef struct
|
||||
char vender_name [LEN_VENDER_NAME_MAX];
|
||||
Uint16 endian;
|
||||
|
||||
char font_name [LEN_DEVFONT_NAME_MAX + 1];
|
||||
char font_name [LEN_UPF_NAME_MAX + 1];
|
||||
|
||||
Uint8 width;
|
||||
Uint8 height;
|
||||
|
||||
@@ -197,13 +197,13 @@ static BOOL get_font_propt(FILE* fp, char* family, char* font_rrncnn, char* cha
|
||||
/*FAMILY_NAME*/
|
||||
if (strcmp (line_buf, "FAMILY_NAME") == 0)
|
||||
{
|
||||
if (strlen(body) > LEN_FONT_NAME)
|
||||
if (strlen(body) > LEN_LOGFONT_NAME_FIELD)
|
||||
{
|
||||
fprintf(stderr, "the FAMILY_NAME is too long, "
|
||||
"please truncation it to less than %d\n", LEN_FONT_NAME-2);
|
||||
"please truncation it to less than %d\n", LEN_LOGFONT_NAME_FIELD-2);
|
||||
return FALSE;
|
||||
}
|
||||
strncpy (family, body, LEN_FONT_NAME);
|
||||
strncpy (family, body, LEN_LOGFONT_NAME_FIELD);
|
||||
}
|
||||
else if (strcmp (line_buf, "WEIGHT_NAME") == 0)
|
||||
set_rrncnn (font_rrncnn, SET_WEIGHT_POS, body);
|
||||
@@ -216,7 +216,7 @@ static BOOL get_font_propt(FILE* fp, char* family, char* font_rrncnn, char* cha
|
||||
|
||||
/*FIXME must inorder*/
|
||||
else if (strcmp (line_buf, "CHARSET_REGISTRY") == 0)
|
||||
strncpy (charset, body, LEN_FONT_NAME);
|
||||
strncpy (charset, body, LEN_LOGFONT_NAME_FIELD);
|
||||
else if (strcmp (line_buf, "CHARSET_ENCODING") == 0)
|
||||
{
|
||||
if (body[0] != '-')
|
||||
@@ -494,8 +494,8 @@ typedef struct _FONT_PROPT {
|
||||
} FONT_PROPT;
|
||||
|
||||
char font_name [LEN_UNIDEVFONT_NAME];
|
||||
char family [LEN_FONT_NAME];
|
||||
char charset [LEN_FONT_NAME];
|
||||
char family [LEN_LOGFONT_NAME_FIELD];
|
||||
char charset [LEN_LOGFONT_NAME_FIELD];
|
||||
char new_file_name [LEN_UNIDEVFONT_NAME+5];
|
||||
|
||||
#define MAKE_HEADER(header, glyph_num)\
|
||||
|
||||
@@ -54,7 +54,7 @@ typedef int BOOL;
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
#define LEN_FONT_NAME 23
|
||||
#define LEN_LOGFONT_NAME_FIELD 23
|
||||
#define LEN_DEVFONT_NAME 79
|
||||
|
||||
extern VBFINFO extern_vbfinfo;
|
||||
@@ -64,8 +64,8 @@ extern VBFINFO extern_vbfinfo;
|
||||
BOOL dumpVBF (VBFINFO* vbf, char* file)
|
||||
{
|
||||
FILE* fp;
|
||||
char family [LEN_FONT_NAME + 1];
|
||||
char style [LEN_FONT_NAME + 1];
|
||||
char family [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
char style [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
int len_offsets;
|
||||
int len_widths;
|
||||
int len_header;
|
||||
|
||||
Executable
+70
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
from __future__ import print_function, division, absolute_import
|
||||
import sys
|
||||
import os.path
|
||||
from collections import OrderedDict
|
||||
|
||||
if len (sys.argv) != 2:
|
||||
print("usage: ./gen-emoji-table.py emoji-data.txt", file=sys.stderr)
|
||||
sys.exit (1)
|
||||
|
||||
f = open(sys.argv[1])
|
||||
header = [f.readline () for _ in range(10)]
|
||||
|
||||
ranges = OrderedDict()
|
||||
for line in f.readlines():
|
||||
line = line.strip()
|
||||
if not line or line[0] == '#':
|
||||
continue
|
||||
rang, typ = [s.strip() for s in line.split('#')[0].split(';')[:2]]
|
||||
|
||||
rang = [int(s, 16) for s in rang.split('..')]
|
||||
if len(rang) > 1:
|
||||
start, end = rang
|
||||
else:
|
||||
start = end = rang[0]
|
||||
|
||||
if typ not in ranges:
|
||||
ranges[typ] = []
|
||||
if ranges[typ] and ranges[typ][-1][1] == start - 1:
|
||||
ranges[typ][-1] = (ranges[typ][-1][0], end)
|
||||
else:
|
||||
ranges[typ].append((start, end))
|
||||
|
||||
|
||||
|
||||
print("/* == Start of generated table == */")
|
||||
print("/*")
|
||||
print(" * The following tables are generated by running:")
|
||||
print(" *")
|
||||
print(" * ./gen-emoji-table.py emoji-data.txt")
|
||||
print(" *")
|
||||
print(" * on file with this header:")
|
||||
print(" *")
|
||||
for l in header:
|
||||
print(" * %s" % (l.strip()))
|
||||
print(" */")
|
||||
print()
|
||||
print("#ifndef UNICODE_EMOJI_TABLE_H")
|
||||
print("#define UNICODE_EMOJI_TABLE_H")
|
||||
print()
|
||||
print("struct Interval {\n Uchar32 start, end;\n};")
|
||||
|
||||
for typ,s in ranges.items():
|
||||
if typ not in ['emoji',
|
||||
'emoji_presentation',
|
||||
'emoji_modifier',
|
||||
'emoji_modifier_base',
|
||||
'extended_pictographic']: continue
|
||||
print()
|
||||
print("static const struct Interval _unicode_%s_table[] =" % typ)
|
||||
print("{")
|
||||
for pair in sorted(s):
|
||||
print(" {0x%04X, 0x%04X}," % pair)
|
||||
print("};")
|
||||
|
||||
print()
|
||||
print("#endif /* UNICODE_EMOJI_TABLE_H */")
|
||||
print()
|
||||
print("/* == End of generated table == */")
|
||||
Executable
+1552
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,142 @@
|
||||
aa Afar
|
||||
ab Abkhazian
|
||||
af Afrikaans
|
||||
am Amharic
|
||||
ar Arabic
|
||||
as Assamese
|
||||
ay Aymara
|
||||
az Azerbaijani
|
||||
ba Bashkir
|
||||
be Byelorussian
|
||||
bg Bulgarian
|
||||
bh Bihari
|
||||
bi Bislama
|
||||
bn Bengali
|
||||
bo Tibetan
|
||||
br Breton
|
||||
ca Catalan
|
||||
co Corsican
|
||||
cs Czech
|
||||
cy Welch
|
||||
da Danish
|
||||
de German
|
||||
dz Bhutani
|
||||
el Greek
|
||||
en English
|
||||
eo Esperanto
|
||||
es Spanish
|
||||
et Estonian
|
||||
eu Basque
|
||||
fa Persian
|
||||
fi Finnish
|
||||
fj Fiji
|
||||
fo Faeroese
|
||||
fr French
|
||||
fy Frisian
|
||||
ga Irish
|
||||
gd Scots Gaelic
|
||||
gl Galician
|
||||
gn Guarani
|
||||
gu Gujarati
|
||||
ha Hausa
|
||||
hi Hindi
|
||||
he Hebrew
|
||||
hr Croatian
|
||||
hu Hungarian
|
||||
hy Armenian
|
||||
ia Interlingua
|
||||
id Indonesian
|
||||
ie Interlingue
|
||||
ik Inupiak
|
||||
in former Indonesian
|
||||
is Icelandic
|
||||
it Italian
|
||||
iu Inuktitut (Eskimo)
|
||||
iw former Hebrew
|
||||
ja Japanese
|
||||
ji former Yiddish
|
||||
jw Javanese
|
||||
ka Georgian
|
||||
kk Kazakh
|
||||
kl Greenlandic
|
||||
km Cambodian
|
||||
kn Kannada
|
||||
ko Korean
|
||||
ks Kashmiri
|
||||
ku Kurdish
|
||||
ky Kirghiz
|
||||
la Latin
|
||||
ln Lingala
|
||||
lo Laothian
|
||||
lt Lithuanian
|
||||
lv Latvian, Lettish
|
||||
mg Malagasy
|
||||
mi Maori
|
||||
mk Macedonian
|
||||
ml Malayalam
|
||||
mn Mongolian
|
||||
mo Moldavian
|
||||
mr Marathi
|
||||
ms Malay
|
||||
mt Maltese
|
||||
my Burmese
|
||||
na Nauru
|
||||
ne Nepali
|
||||
nl Dutch
|
||||
no Norwegian
|
||||
oc Occitan
|
||||
om (Afan) Oromo
|
||||
or Oriya
|
||||
pa Punjabi
|
||||
pl Polish
|
||||
ps Pashto, Pushto
|
||||
pt Portuguese
|
||||
qu Quechua
|
||||
rm Rhaeto-Romance
|
||||
rn Kirundi
|
||||
ro Romanian
|
||||
ru Russian
|
||||
rw Kinyarwanda
|
||||
sa Sanskrit
|
||||
sd Sindhi
|
||||
sg Sangro
|
||||
sh Serbo-Croatian
|
||||
si Singhalese
|
||||
sk Slovak
|
||||
sl Slovenian
|
||||
sm Samoan
|
||||
sn Shona
|
||||
so Somali
|
||||
sq Albanian
|
||||
sr Serbian
|
||||
ss Siswati
|
||||
st Sesotho
|
||||
su Sudanese
|
||||
sv Swedish
|
||||
sw Swahili
|
||||
ta Tamil
|
||||
te Tegulu
|
||||
tg Tajik
|
||||
th Thai
|
||||
ti Tigrinya
|
||||
tk Turkmen
|
||||
tl Tagalog
|
||||
tn Setswana
|
||||
to Tonga
|
||||
tr Turkish
|
||||
ts Tsonga
|
||||
tt Tatar
|
||||
tw Twi
|
||||
ug Uigur
|
||||
uk Ukrainian
|
||||
ur Urdu
|
||||
uz Uzbek
|
||||
vi Vietnamese
|
||||
vo Volapuk
|
||||
wo Wolof
|
||||
xh Xhosa
|
||||
yi Yiddish
|
||||
yo Yoruba
|
||||
za Zhuang
|
||||
zh Chinese
|
||||
zu Zulu
|
||||
File diff suppressed because it is too large
Load Diff
+68
-58
File diff suppressed because it is too large
Load Diff
+50
-38
@@ -1,39 +1,39 @@
|
||||
/*
|
||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||
* and Graphics User Interface (GUI) support system for embedded systems
|
||||
* and smart IoT devices.
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* Or,
|
||||
*
|
||||
*
|
||||
* As this program is a library, any link to this program must follow
|
||||
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
||||
* GPLv3, you need to be licensed from FMSoft.
|
||||
*
|
||||
*
|
||||
* If you have got a commercial license of this program, please use it
|
||||
* under the terms and conditions of the commercial license.
|
||||
*
|
||||
*
|
||||
* For more information about the commercial license, please refer to
|
||||
* <http://www.minigui.com/en/about/licensing-policy/>.
|
||||
*/
|
||||
/*
|
||||
** varbitmap.h: the head file of raw bitmap font operation set.
|
||||
**
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef GUI_FONT_VARBITMAP_H
|
||||
@@ -43,43 +43,55 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
typedef struct _VBF_BBOX
|
||||
{
|
||||
typedef struct _VBF_BBOX {
|
||||
char x, y, w, h;
|
||||
} VBF_BBOX;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char ver_info [4]; /* font version*/
|
||||
const char* name; /* font name*/
|
||||
typedef struct {
|
||||
/* font version*/
|
||||
char ver_info [4];
|
||||
/* font name*/
|
||||
const char* name;
|
||||
|
||||
char max_width; /* The max width in pixels. */
|
||||
char ave_width; /* The average width in pixels. */
|
||||
char height; /* The height in pixels. */
|
||||
char descent; /* The pixels below the base line. */
|
||||
/* The max width in pixels. */
|
||||
char max_width;
|
||||
/* The average width in pixels. */
|
||||
char ave_width;
|
||||
/* The height in pixels. */
|
||||
char height;
|
||||
/* The pixels below the base line. */
|
||||
char descent;
|
||||
|
||||
int first_glyph; /* The glyph number of the first character in this font.*/
|
||||
int last_glyph; /* The glyph number of the last character in this font.*/
|
||||
int def_glyph; /* The glyph number of the default character in this font.*/
|
||||
/* The glyph number of the first character in this font.*/
|
||||
int first_glyph;
|
||||
/* The glyph number of the last character in this font.*/
|
||||
int last_glyph;
|
||||
/* The glyph number of the default character in this font.*/
|
||||
int def_glyph;
|
||||
|
||||
unsigned int font_size; /* used by mmap. It should be zero for in-core vbfs. */
|
||||
/* used by mmap. It should be zero for in-core vbfs. */
|
||||
unsigned int font_size;
|
||||
|
||||
const VBF_BBOX* bbox; /* The pointer to the glyph bounding box array or NULL. */
|
||||
/* The pointer to the glyph bounding box array or NULL. */
|
||||
const VBF_BBOX* bbox;
|
||||
|
||||
const char* advance_x; /* The pointer to the glyph advance x array.
|
||||
If bbox is NULL, the array contains the width of each glyph.
|
||||
If advance_x is NULL, the glyph has the universal width,
|
||||
that's max_width. */
|
||||
const char* advance_y; /* The pointer to the glyph advance y array.
|
||||
If bbox is NULL, advance_y should be NULL.
|
||||
If bbox is not NULL and advance_y is NULL,
|
||||
all glyph has the universal advance_y, that is, zero. */
|
||||
/* The pointer to the glyph advance x array.
|
||||
If bbox is NULL, the array contains the width of each glyph.
|
||||
If advance_x is NULL, the glyph has the universal width,
|
||||
that's max_width. */
|
||||
const char* advance_x;
|
||||
/* The pointer to the glyph advance y array.
|
||||
If bbox is NULL, advance_y should be NULL.
|
||||
If bbox is not NULL and advance_y is NULL,
|
||||
all glyph has the universal advance_y, that is, zero. */
|
||||
const char* advance_y;
|
||||
|
||||
const unsigned int* bits_offset; /* The pointer to the glyph bitmap offset array
|
||||
whose number will be used to fetch glyph bitmap
|
||||
from bits array or NULL. */
|
||||
const unsigned char* all_glyph_bits; /* The 8-bit right-padded bitmap data for all glyphs. */
|
||||
/* The pointer to the glyph bitmap offset array
|
||||
whose number will be used to fetch glyph bitmap
|
||||
from bits array or NULL. */
|
||||
const unsigned int* bits_offset;
|
||||
/* The 8-bit right-padded bitmap data for all glyphs. */
|
||||
const unsigned char* all_glyph_bits;
|
||||
} VBFINFO;
|
||||
|
||||
#define VBF_LEN_VERSION_INFO 10
|
||||
|
||||
+2
-2
@@ -681,9 +681,9 @@ BOOL GUIAPI TranslateKeyMsgToChar (int message, WPARAM wParam, LPARAM lParam, WO
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
static UChar32 utf8_to_wc (const unsigned char* mstr, int* utf8_len)
|
||||
static Uchar32 utf8_to_wc (const unsigned char* mstr, int* utf8_len)
|
||||
{
|
||||
UChar32 wc = *((unsigned char *)(mstr++));
|
||||
Uchar32 wc = *((unsigned char *)(mstr++));
|
||||
int n, t;
|
||||
|
||||
*utf8_len = 1;
|
||||
|
||||
@@ -70,13 +70,13 @@
|
||||
|
||||
typedef struct _CHARSET
|
||||
{
|
||||
char name [LEN_FONT_NAME + 1];
|
||||
char name [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
struct _CHARSET* next;
|
||||
}CHARSET;
|
||||
|
||||
typedef struct _FAMILY
|
||||
{
|
||||
char name [LEN_FONT_NAME + 1];
|
||||
char name [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
CHARSET chset_head;
|
||||
struct _FAMILY* next;
|
||||
}FAMILY;
|
||||
@@ -98,8 +98,8 @@ static FAMILY* find_insert_family (FAMILY* head, const char* fami_name)
|
||||
}
|
||||
|
||||
cur = (FAMILY*)malloc(sizeof(*cur));
|
||||
strncpy (cur->name, fami_name, LEN_FONT_NAME);
|
||||
cur->name [LEN_FONT_NAME] = '\0';
|
||||
strncpy (cur->name, fami_name, LEN_LOGFONT_NAME_FIELD);
|
||||
cur->name [LEN_LOGFONT_NAME_FIELD] = '\0';
|
||||
cur->chset_head.next = NULL;
|
||||
cur->next = NULL;
|
||||
|
||||
@@ -133,8 +133,8 @@ static void insert_chset (FAMILY* fami, const char* chset_name)
|
||||
}
|
||||
|
||||
cur = (CHARSET*)malloc(sizeof(*cur));
|
||||
strncpy (cur->name, chset_name, LEN_FONT_NAME);
|
||||
cur->name [LEN_FONT_NAME] = '\0';
|
||||
strncpy (cur->name, chset_name, LEN_LOGFONT_NAME_FIELD);
|
||||
cur->name [LEN_LOGFONT_NAME_FIELD] = '\0';
|
||||
cur->next = NULL;
|
||||
|
||||
pre->next = cur;
|
||||
@@ -416,7 +416,7 @@ static void insert_strings (HWND hWnd, char** strs, int str_num)
|
||||
|
||||
static int fresh_chset_list (HWND hWnd)
|
||||
{
|
||||
char str_buffer [LEN_FONT_NAME + 1];
|
||||
char str_buffer [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
HWND fami_lb;
|
||||
HWND chset_lb;
|
||||
int cur_sel;
|
||||
@@ -455,7 +455,7 @@ static int fresh_chset_list (HWND hWnd)
|
||||
static int insert_listboxs (HWND hWnd)
|
||||
{
|
||||
FAMILY* fami_cur = ((FAMILY*)GetWindowAdditionalData(hWnd))->next;
|
||||
char str_buffer [LEN_FONT_NAME + 1];
|
||||
char str_buffer [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
int i;
|
||||
HWND hctrl;
|
||||
|
||||
@@ -496,8 +496,8 @@ static int insert_listboxs (HWND hWnd)
|
||||
|
||||
static LOGFONT* create_sel_font(HWND hWnd)
|
||||
{
|
||||
char family [LEN_FONT_NAME +1];
|
||||
char chset [LEN_FONT_NAME +1];
|
||||
char family [LEN_LOGFONT_NAME_FIELD +1];
|
||||
char chset [LEN_LOGFONT_NAME_FIELD +1];
|
||||
char weight;
|
||||
char slant;
|
||||
char flip;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
noinst_HEADERS = \
|
||||
accelkey.h bidi.h bitmap.h cliprect.h ctrlclass.h \
|
||||
noinst_HEADERS = \
|
||||
accelkey.h bidi.h bitmap.h cliprect.h ctrlclass.h \
|
||||
cursor.h dc.h event.h list.h element.h \
|
||||
ial.h inline.h internals.h zorder.h menu.h misc.h \
|
||||
ial.h inline.h internals.h zorder.h menu.h misc.h \
|
||||
msgstr.h sysfont.h timer.h devfont.h fontname.h \
|
||||
readbmp.h icon.h blockheap.h \
|
||||
ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \
|
||||
gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \
|
||||
md5.h glyph.h license.h mgsock.h
|
||||
md5.h glyph.h license.h mgsock.h unicode-ops.h
|
||||
|
||||
+15
-12
@@ -62,24 +62,27 @@ extern "C" {
|
||||
typedef struct _TYPERUN TYPERUN;
|
||||
|
||||
typedef struct _BIDICHAR_MIRROR_MAP {
|
||||
Glyph32 glyph;
|
||||
Glyph32 mirrored;
|
||||
Achar32 chv;
|
||||
Achar32 mirrored;
|
||||
} BIDICHAR_MIRROR_MAP;
|
||||
|
||||
typedef void (*CB_DO_REORDER) (void* context, int len, int pos);
|
||||
Achar32* __mg_charset_bidi_achars_reorder (const CHARSETOPS* charset_ops,
|
||||
Achar32* achars, int len, int pel,
|
||||
void* extra, CB_REVERSE_EXTRA cb_reverse_extra);
|
||||
|
||||
Glyph32* __mg_charset_bidi_glyphs_reorder (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len);
|
||||
/*
|
||||
Achar32* __mg_charset_bidi_map_reorder (const CHARSETOPS* charset_ops,
|
||||
Achar32* achars, int len, GLYPHMAPINFO* map, int pel);
|
||||
|
||||
Glyph32* __mg_charset_bidi_map_reorder (const CHARSETOPS* charset_ops, Glyph32* glyphs,
|
||||
int len, GLYPHMAPINFO* map);
|
||||
Achar32* __mg_charset_bidi_index_reorder (const CHARSETOPS* charset_ops,
|
||||
Achar32* achars, int len, int* index_map, int pel);
|
||||
*/
|
||||
|
||||
void __mg_charset_bidi_get_embeddlevels (const CHARSETOPS* charset_ops, Glyph32* glyphs,
|
||||
int len, Uint8* embedding_level_list, Uint8 type);
|
||||
void __mg_charset_bidi_get_embeddlevels (const CHARSETOPS* charset_ops,
|
||||
Achar32* achars, int len, int pel, Uint8* embedding_levels, Uint8 type);
|
||||
|
||||
Glyph32* __mg_charset_bidi_index_reorder (const CHARSETOPS* charset_ops, Glyph32* glyphs,
|
||||
int len, int* index_map);
|
||||
|
||||
Uint32 __mg_charset_bidi_str_base_dir (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len);
|
||||
Uint32 __mg_charset_bidi_str_base_dir (const CHARSETOPS* charset_ops,
|
||||
Achar32* achars, int len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -159,6 +159,7 @@ struct tagDC
|
||||
|
||||
int tabstop;
|
||||
int cExtra; /* Character extra */
|
||||
int wExtra; /* Word extra */
|
||||
int alExtra; /* Above line extra */
|
||||
int blExtra; /* Bellow line extra */
|
||||
|
||||
|
||||
+116
-49
File diff suppressed because it is too large
Load Diff
@@ -53,6 +53,7 @@ BOOL fontGetTypeNameFromName (const char* name, char* type);
|
||||
int fontConvertFontType (const char* type);
|
||||
|
||||
BOOL fontGetFamilyFromName (const char* name, char* family);
|
||||
BOOL fontDoesMatchFamily (const char* name, const char* family);
|
||||
|
||||
BOOL fontCopyStyleFromName (const char* name, char* style);
|
||||
DWORD fontGetStyleFromName (const char* name);
|
||||
|
||||
@@ -41,8 +41,6 @@
|
||||
#ifndef GUI_GDI_GLYPH_H
|
||||
#define GUI_GDI_GLYPH_H
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||
* and Graphics User Interface (GUI) support system for embedded systems
|
||||
* and smart IoT devices.
|
||||
*
|
||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Or,
|
||||
*
|
||||
* As this program is a library, any link to this program must follow
|
||||
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
||||
* GPLv3, you need to be licensed from FMSoft.
|
||||
*
|
||||
* If you have got a commercial license of this program, please use it
|
||||
* under the terms and conditions of the commercial license.
|
||||
*
|
||||
* For more information about the commercial license, please refer to
|
||||
* <http://www.minigui.com/en/about/licensing-policy/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
** unicode-ops.h: Declaration of Unicode operators.
|
||||
**
|
||||
** Current maintainer: Wei Yongming.
|
||||
**
|
||||
** Create date: 2019/02/26
|
||||
*/
|
||||
|
||||
#ifndef GUI_UNICODE_OPS_H
|
||||
#define GUI_UNICODE_OPS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BOOL _unicode_is_emoji(Uchar32 ch);
|
||||
BOOL _unicode_is_emoji_presentation(Uchar32 ch);
|
||||
BOOL _unicode_is_emoji_modifier(Uchar32 ch);
|
||||
BOOL _unicode_is_emoji_modifier_base(Uchar32 ch);
|
||||
BOOL _unicode_is_emoji_extended_pictographic(Uchar32 ch);
|
||||
|
||||
BOOL _unicode_is_emoji_text_default(Uchar32 ch);
|
||||
BOOL _unicode_is_emoji_emoji_default(Uchar32 ch);
|
||||
BOOL _unicode_is_emoji_keycap_base(Uchar32 ch);
|
||||
BOOL _unicode_is_regional_indicator(Uchar32 ch);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif // GUI_UNICODE_OPS_H
|
||||
|
||||
@@ -1038,7 +1038,7 @@ static int srvChangeCaption (int cli, int idx_znode, const char *caption)
|
||||
if (caplen < 32) {
|
||||
strcpy (nodes[idx_znode].caption, caption);
|
||||
} else {
|
||||
GetTextCharPos (menufont, caption, caplen, (32 - 3), /* '...' = 3*/
|
||||
get_text_char_pos (menufont, caption, caplen, (32 - 3), /* '...' = 3*/
|
||||
&fit_chars, pos_chars);
|
||||
memcpy(nodes[idx_znode].caption,
|
||||
caption, pos_chars[fit_chars-1]);
|
||||
|
||||
@@ -1340,11 +1340,11 @@ static HWND dskSetActiveZOrderNode (int cli, int idx_znode)
|
||||
return old_hwnd;
|
||||
}
|
||||
|
||||
static void GetTextCharPos (PLOGFONT log_font, const char *text,
|
||||
static void get_text_char_pos (PLOGFONT log_font, const char *text,
|
||||
int len, int fit_bytes, int *fit_chars, int *pos_chars)
|
||||
{
|
||||
DEVFONT* sbc_devfont = log_font->sbc_devfont;
|
||||
DEVFONT* mbc_devfont = log_font->mbc_devfont;
|
||||
DEVFONT* sbc_devfont = log_font->devfonts[0];
|
||||
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||
int len_cur_char;
|
||||
int left_bytes = len;
|
||||
int char_count = 0, bytes = 0;
|
||||
@@ -1624,11 +1624,11 @@ static int AllocZOrderNode (int cli, HWND hwnd, HWND main_win,
|
||||
strcpy (nodes[free_slot].caption, caption);
|
||||
} else {
|
||||
int tail_pos;
|
||||
GetTextCharPos (menufont, caption, caplen, (32 - 3), /* '...' = 3*/
|
||||
get_text_char_pos (menufont, caption, caplen, (32 - 3), /* '...' = 3*/
|
||||
&fit_chars, pos_chars);
|
||||
|
||||
tail_pos = pos_chars[fit_chars-1];
|
||||
|
||||
|
||||
if ((tail_pos + 3) >= 32 && fit_chars > 4) {
|
||||
tail_pos = pos_chars[fit_chars-2];
|
||||
if (tail_pos + 3 >= 32) {
|
||||
@@ -1640,7 +1640,7 @@ static int AllocZOrderNode (int cli, HWND hwnd, HWND main_win,
|
||||
}
|
||||
memcpy(nodes[free_slot].caption, caption, tail_pos);
|
||||
strcpy ((nodes[free_slot].caption + tail_pos), "...");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ static pthread_mutex_t timerLock;
|
||||
#define TIMER_UNLOCK()
|
||||
#endif
|
||||
|
||||
#ifdef __LINUX__
|
||||
#if defined(__LINUX__) && defined(_MGRM_THREADS)
|
||||
# define _MG_USE_BETTER_TIMER
|
||||
#endif /* __LINUX__ */
|
||||
|
||||
|
||||
+13
-87
@@ -1415,7 +1415,6 @@ static int _PutBoxKey (GAL_Surface* dst, BYTE* dstrow, BYTE* srcrow, Uint32 w, U
|
||||
dstrow += dst->pitch;
|
||||
}
|
||||
}
|
||||
#ifndef _FOR_MONOBITMAP
|
||||
else while ( h-- ) {
|
||||
dstpixels = dstrow;
|
||||
srcpixels = srcrow;
|
||||
@@ -1426,29 +1425,7 @@ static int _PutBoxKey (GAL_Surface* dst, BYTE* dstrow, BYTE* srcrow, Uint32 w, U
|
||||
unsigned sG;
|
||||
unsigned sB;
|
||||
RETRIEVE_RGB_PIXEL (srcpixels, bpp, pixel);
|
||||
if ( pixel != ckey ) {
|
||||
RGB_FROM_PIXEL (pixel, dstfmt, sR, sG, sB);
|
||||
ASSEMBLE_RGBA (dstpixels, bpp, dstfmt, sR, sG, sB, alpha);
|
||||
}
|
||||
dstpixels += bpp;
|
||||
srcpixels += bpp;
|
||||
},
|
||||
w);
|
||||
srcrow += box->bmPitch;
|
||||
dstrow += dst->pitch;
|
||||
}
|
||||
#else
|
||||
else while ( h-- ) {
|
||||
dstpixels = dstrow;
|
||||
srcpixels = srcrow;
|
||||
DUFFS_LOOP(
|
||||
{
|
||||
Uint32 pixel;
|
||||
unsigned sR;
|
||||
unsigned sG;
|
||||
unsigned sB;
|
||||
RETRIEVE_RGB_PIXEL (srcpixels, bpp, pixel);
|
||||
if (pixel != ckey || ( pixel == ckey && box->bmType & BMP_TYPE_MONOKEY) ) {
|
||||
if (pixel != ckey || (pixel == ckey && box->bmType & BMP_TYPE_REPLACEKEY)) {
|
||||
if (pixel == ckey)
|
||||
pixel = box->bmColorRep;
|
||||
RGB_FROM_PIXEL (pixel, dstfmt, sR, sG, sB);
|
||||
@@ -1461,7 +1438,6 @@ static int _PutBoxKey (GAL_Surface* dst, BYTE* dstrow, BYTE* srcrow, Uint32 w, U
|
||||
srcrow += box->bmPitch;
|
||||
dstrow += dst->pitch;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1929,76 +1905,26 @@ BYTE* gal_PutPixelKeyAlphaChannel (GAL_Surface* dst, BYTE* dstrow,
|
||||
BYTE* gal_PutPixelKey (GAL_Surface* dst, BYTE* dstrow,
|
||||
Uint32 pixel, MYBITMAP_CONTXT* mybmp)
|
||||
{
|
||||
//BYTE* dstpixels = dstrow;
|
||||
//BYTE* srcpixels = srcrow;
|
||||
Uint32 ckey = mybmp->colorKey;
|
||||
GAL_PixelFormat *dstfmt = dst->format;
|
||||
int bpp = dstfmt->BytesPerPixel;
|
||||
unsigned alpha = dstfmt->Amask ? GAL_ALPHA_OPAQUE : 0;
|
||||
|
||||
if (bpp == 1) {
|
||||
//while (h--) {
|
||||
//unsigned int i;
|
||||
//dstpixels = dstrow;
|
||||
//srcpixels = srcrow;
|
||||
//for (i = 0; i < w; i++) {
|
||||
if (pixel != ckey)
|
||||
*dstrow = pixel;
|
||||
dstrow += bpp;
|
||||
//srcpixels += bpp;
|
||||
//}
|
||||
//srcrow += box->bmPitch;
|
||||
//dstrow += dst->pitch;
|
||||
//}
|
||||
if (pixel != ckey)
|
||||
*dstrow = pixel;
|
||||
dstrow += bpp;
|
||||
}
|
||||
#ifndef _FOR_MONOBITMAP
|
||||
else /*while ( h-- )*/ {
|
||||
//dstpixels = dstrow;
|
||||
//srcpixels = srcrow;
|
||||
//DUFFS_LOOP(
|
||||
{
|
||||
//Uint32 pixel;
|
||||
unsigned sR;
|
||||
unsigned sG;
|
||||
unsigned sB;
|
||||
//RETRIEVE_RGB_PIXEL (srcpixels, bpp, pixel);
|
||||
if ( pixel != ckey ) {
|
||||
RGB_FROM_PIXEL (pixel, dstfmt, sR, sG, sB);
|
||||
ASSEMBLE_RGBA (dstrow, bpp, dstfmt, sR, sG, sB, alpha);
|
||||
}
|
||||
dstrow += bpp;
|
||||
//srcpixels += bpp;
|
||||
}//,
|
||||
//w);
|
||||
//srcrow += box->bmPitch;
|
||||
//dstrow += dst->pitch;
|
||||
else {
|
||||
unsigned sR;
|
||||
unsigned sG;
|
||||
unsigned sB;
|
||||
if (pixel != ckey) {
|
||||
RGB_FROM_PIXEL (pixel, dstfmt, sR, sG, sB);
|
||||
ASSEMBLE_RGBA (dstrow, bpp, dstfmt, sR, sG, sB, alpha);
|
||||
}
|
||||
dstrow += bpp;
|
||||
}
|
||||
#else
|
||||
else /*while ( h-- )*/ {
|
||||
//dstpixels = dstrow;
|
||||
//srcpixels = srcrow;
|
||||
//DUFFS_LOOP(
|
||||
{
|
||||
//Uint32 pixel;
|
||||
unsigned sR;
|
||||
unsigned sG;
|
||||
unsigned sB;
|
||||
//RETRIEVE_RGB_PIXEL (srcpixels, bpp, pixel);
|
||||
//here,the MYBITMAP has no BMP_TYPE_MONOKEY,need to fixed
|
||||
if (pixel != ckey || ( pixel == ckey && mybmp->mybmp->flag & BMP_TYPE_MONOKEY) ) {
|
||||
if (pixel == ckey)
|
||||
pixel ^=1 ;
|
||||
RGB_FROM_PIXEL (pixel, dstfmt, sR, sG, sB);
|
||||
ASSEMBLE_RGBA (dstrow, bpp, dstfmt, sR, sG, sB, alpha);
|
||||
}
|
||||
dstrow += bpp;
|
||||
//srcpixels += bpp;
|
||||
}//,
|
||||
//w);
|
||||
//srcrow += box->bmPitch;
|
||||
//dstrow += dst->pitch;
|
||||
}
|
||||
#endif
|
||||
|
||||
return dstrow;
|
||||
}
|
||||
|
||||
@@ -4,9 +4,8 @@ noinst_LTLIBRARIES = libnewgdi.la
|
||||
|
||||
if MG_MINIMALGDI
|
||||
SRC_FILES = gdi.c attr.c clip.c coor.c rect.c \
|
||||
bitmap.c \
|
||||
pixel.c pixel_ops.c \
|
||||
region.c polygon.c
|
||||
bitmap.c pixel.c pixel_ops.c \
|
||||
region.c polygon.c
|
||||
else
|
||||
SRC_FILES = gdi.c attr.c clip.c map.c coor.c rect.c \
|
||||
palette.c readbmp.c icon.c screen.c bitmap.c \
|
||||
@@ -14,12 +13,12 @@ SRC_FILES = gdi.c attr.c clip.c map.c coor.c rect.c \
|
||||
region.c generators.c polygon.c flood.c \
|
||||
advapi.c midash.c mispans.c miwideline.c \
|
||||
mifillarc.c mifpolycon.c miarc.c rotatebmp.c \
|
||||
text.c glyph.c bidi.c \
|
||||
textout.c tabbedtextout.c drawtext.c
|
||||
text.c achar.c glyph.c bidi.c glyph-unicode.c \
|
||||
textout.c tabbedtextout.c drawtext.c
|
||||
endif
|
||||
|
||||
HDR_FILES = drawtext.h mi.h midc.h mistruct.h miwideline.h \
|
||||
pixel_ops.h mifillarc.h mispans.h polygon.h mifpoly.h
|
||||
pixel_ops.h mifillarc.h mispans.h polygon.h mifpoly.h
|
||||
|
||||
libnewgdi_la_SOURCES = $(SRC_FILES) $(HDR_FILES)
|
||||
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
/*
|
||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||
* and Graphics User Interface (GUI) support system for embedded systems
|
||||
* and smart IoT devices.
|
||||
*
|
||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Or,
|
||||
*
|
||||
* As this program is a library, any link to this program must follow
|
||||
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
||||
* GPLv3, you need to be licensed from FMSoft.
|
||||
*
|
||||
* If you have got a commercial license of this program, please use it
|
||||
* under the terms and conditions of the commercial license.
|
||||
*
|
||||
* For more information about the commercial license, please refer to
|
||||
* <http://www.minigui.com/en/about/licensing-policy/>.
|
||||
*/
|
||||
/*
|
||||
** achar.c: API implementation for abstract character.
|
||||
**
|
||||
** Create date: 2019/03/05
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
#include "window.h"
|
||||
#include "devfont.h"
|
||||
|
||||
Achar32 GUIAPI GetACharValue (LOGFONT* logfont, const char* mchar,
|
||||
int mchar_len, const char* pre_mchar, int pre_len)
|
||||
{
|
||||
int len_cur_char;
|
||||
Achar32 chv = INV_ACHAR_VALUE;
|
||||
DEVFONT* sbc_devfont = logfont->devfonts[0];
|
||||
DEVFONT* mbc_devfont = logfont->devfonts[1];
|
||||
|
||||
if (mbc_devfont) {
|
||||
len_cur_char = mbc_devfont->charset_ops->len_first_char
|
||||
((const unsigned char*)mchar, mchar_len);
|
||||
|
||||
if (len_cur_char > 0) {
|
||||
chv = mbc_devfont->charset_ops->get_char_value
|
||||
((Uint8*)pre_mchar, pre_len, (Uint8*)mchar, mchar_len);
|
||||
|
||||
return SET_MBCHV(chv);
|
||||
}
|
||||
}
|
||||
|
||||
len_cur_char = sbc_devfont->charset_ops->len_first_char
|
||||
((const unsigned char*)mchar, mchar_len);
|
||||
|
||||
if (len_cur_char > 0) {
|
||||
chv = sbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, (Uint8*)mchar, mchar_len);
|
||||
}
|
||||
|
||||
return chv;
|
||||
}
|
||||
|
||||
Achar32 GUIAPI GetShapedAChar (LOGFONT* logfont, const char* mchar,
|
||||
int mchar_len, ACHARSHAPETYPE shape_type)
|
||||
{
|
||||
int len_cur_char;
|
||||
|
||||
Achar32 chv = INV_ACHAR_VALUE;
|
||||
DEVFONT* sbc_devfont = logfont->devfonts[0];
|
||||
DEVFONT* mbc_devfont = logfont->devfonts[1];
|
||||
|
||||
if (mbc_devfont) {
|
||||
len_cur_char = mbc_devfont->charset_ops->len_first_char (
|
||||
(const unsigned char*)mchar, mchar_len);
|
||||
|
||||
if (len_cur_char > 0) {
|
||||
if (mbc_devfont->charset_ops->get_shaped_char_value)
|
||||
chv = mbc_devfont->charset_ops->get_shaped_char_value(
|
||||
(const unsigned char*)mchar, mchar_len, shape_type);
|
||||
else
|
||||
chv = mbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, (Uint8*)mchar, len_cur_char);
|
||||
|
||||
return SET_MBCHV(chv);
|
||||
}
|
||||
}
|
||||
|
||||
len_cur_char = sbc_devfont->charset_ops->len_first_char
|
||||
((const unsigned char*)mchar, mchar_len);
|
||||
|
||||
if (len_cur_char > 0) {
|
||||
if (sbc_devfont->charset_ops->get_shaped_char_value)
|
||||
chv = sbc_devfont->charset_ops->get_shaped_char_value(
|
||||
(const unsigned char*)mchar, mchar_len, shape_type);
|
||||
else
|
||||
chv = sbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, (Uint8*)mchar, len_cur_char);
|
||||
|
||||
}
|
||||
|
||||
return chv;
|
||||
}
|
||||
|
||||
BOOL GUIAPI GetMirrorAChar (LOGFONT* logfont, Achar32 chv, Achar32* mirrored)
|
||||
{
|
||||
DEVFONT* devfont = SELECT_DEVFONT_BY_ACHAR(logfont, chv);
|
||||
|
||||
*mirrored = INV_ACHAR_VALUE;
|
||||
if (devfont->charset_ops->bidi_mirror_char) {
|
||||
return devfont->charset_ops->bidi_mirror_char(REAL_ACHAR(chv),
|
||||
mirrored);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Uint32 GUIAPI GetACharType (LOGFONT* logfont, Achar32 chv)
|
||||
{
|
||||
DEVFONT* devfont = SELECT_DEVFONT_BY_ACHAR(logfont, chv);
|
||||
return devfont->charset_ops->char_type (REAL_ACHAR (chv));
|
||||
}
|
||||
|
||||
Uint32 GetGlyphBIDIType (LOGFONT* log_font, Achar32 chv)
|
||||
{
|
||||
DEVFONT* devfont = SELECT_DEVFONT_BY_ACHAR(log_font, chv);
|
||||
|
||||
if (devfont == NULL ||
|
||||
devfont->charset_ops->bidi_char_type == NULL)
|
||||
return BIDI_TYPE_INVALID;
|
||||
|
||||
return devfont->charset_ops->bidi_char_type (REAL_ACHAR (chv));
|
||||
}
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
Uchar32 GUIAPI Achar2UChar(LOGFONT* logfont, Achar32 chv)
|
||||
{
|
||||
Uchar32 uc;
|
||||
DEVFONT* devfont = SELECT_DEVFONT_BY_ACHAR(logfont, chv);
|
||||
|
||||
if (devfont) {
|
||||
chv = REAL_ACHAR(chv);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
uc = devfont->charset_ops->conv_to_uc32(chv);
|
||||
else
|
||||
uc = chv;
|
||||
|
||||
return uc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GUIAPI AChars2UChars(LOGFONT* logfont, const Achar32* chs,
|
||||
Uchar32* ucs, int n)
|
||||
{
|
||||
int i;
|
||||
Uchar32 uc;
|
||||
DEVFONT* devfont;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
Achar32 chv = chs[i];
|
||||
devfont = SELECT_DEVFONT_BY_ACHAR(logfont, chv);
|
||||
if (devfont) {
|
||||
chv = REAL_ACHAR(chv);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
uc = devfont->charset_ops->conv_to_uc32(chv);
|
||||
else
|
||||
uc = chv;
|
||||
|
||||
ucs[i] = uc;
|
||||
}
|
||||
else
|
||||
return i + 1;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif /* _MGCHARSET_UNICODE */
|
||||
+9
-40
@@ -162,37 +162,6 @@ static void make_gray_pixels (PDC pdc)
|
||||
|
||||
static void make_filter_pixels (PDC pdc)
|
||||
{
|
||||
#if 0 // VincentWei: use FS_RENDER_MASK instead (3.4.0)
|
||||
if (pdc->pLogFont->style & FS_WEIGHT_BOOK) {
|
||||
int i;
|
||||
Uint8 r, g, b, a;
|
||||
|
||||
if (make_alpha_pixel_format (pdc))
|
||||
return;
|
||||
|
||||
GAL_GetRGB (pdc->textcolor, pdc->surface->format, &r, &g, &b);
|
||||
|
||||
a = 0;
|
||||
for (i = 0; i < 16; i++) {
|
||||
pdc->filter_pixels [i] = GAL_MapRGBA (pdc->alpha_pixel_format,
|
||||
r, g, b, a);
|
||||
a += 16;
|
||||
}
|
||||
|
||||
pdc->filter_pixels [16] = GAL_MapRGBA (pdc->alpha_pixel_format,
|
||||
r, g, b, 255);
|
||||
|
||||
}
|
||||
else if (pdc->pLogFont->style & FS_WEIGHT_LIGHT) {
|
||||
gal_pixel trans = pdc->bkcolor ^ 1;
|
||||
if (trans == pdc->textcolor)
|
||||
trans = pdc->bkcolor ^ 3;
|
||||
|
||||
pdc->filter_pixels [0] = trans;
|
||||
pdc->filter_pixels [1] = pdc->bkcolor;
|
||||
pdc->filter_pixels [2] = pdc->textcolor;
|
||||
}
|
||||
#else
|
||||
switch (pdc->pLogFont->style & FS_RENDER_MASK) {
|
||||
case FS_RENDER_GREY: {
|
||||
int i;
|
||||
@@ -215,21 +184,21 @@ static void make_filter_pixels (PDC pdc)
|
||||
break;
|
||||
}
|
||||
|
||||
case FS_RENDER_OUTLINE: {
|
||||
gal_pixel trans = pdc->bkcolor ^ 1;
|
||||
if (trans == pdc->textcolor)
|
||||
trans = pdc->bkcolor ^ 3;
|
||||
case FS_RENDER_MONO:
|
||||
if (pdc->pLogFont->style & FS_DECORATE_OUTLINE) {
|
||||
gal_pixel trans = pdc->bkcolor ^ 1;
|
||||
if (trans == pdc->textcolor)
|
||||
trans = pdc->bkcolor ^ 3;
|
||||
|
||||
pdc->filter_pixels [0] = trans;
|
||||
pdc->filter_pixels [1] = pdc->bkcolor;
|
||||
pdc->filter_pixels [2] = pdc->textcolor;
|
||||
pdc->filter_pixels [0] = trans;
|
||||
pdc->filter_pixels [1] = pdc->bkcolor;
|
||||
pdc->filter_pixels [2] = pdc->textcolor;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Uint32 GUIAPI SetDCAttr (HDC hdc, int attr, Uint32 value)
|
||||
|
||||
+447
-596
File diff suppressed because it is too large
Load Diff
+53
-266
File diff suppressed because it is too large
Load Diff
@@ -69,7 +69,7 @@ static inline int _gdi_get_glyph_advance (PDC pdc, Glyph32 glyph_value,
|
||||
BOOL direction, int x, int y, int* adv_x, int* adv_y, BBOX* bbox)
|
||||
{
|
||||
LOGFONT* logfont = pdc->pLogFont;
|
||||
DEVFONT* devfont = SELECT_DEVFONT(logfont, glyph_value);
|
||||
DEVFONT* devfont = SELECT_DEVFONT_BY_GLYPH(logfont, glyph_value);
|
||||
glyph_value = REAL_GLYPH (glyph_value);
|
||||
|
||||
return _font_get_glyph_advance (logfont, devfont, glyph_value,
|
||||
@@ -89,9 +89,9 @@ void _gdi_calc_glyphs_size_from_two_points (PDC pdc, int x0, int y0,
|
||||
int x1, int y1, SIZE* size);
|
||||
|
||||
typedef BOOL (*CB_ONE_GLYPH) (void* context, Glyph32 glyph_value,
|
||||
int glyph_type);
|
||||
unsigned int char_type);
|
||||
|
||||
int _gdi_output_visual_glyphs(PDC pdc, Glyph32* visual_glyphs, int nr_glyphs,
|
||||
int _gdi_output_visual_achars(PDC pdc, Glyph32* visual_glyphs, int nr_glyphs,
|
||||
BOOL direction, CB_ONE_GLYPH cb_one_glyph, void* context);
|
||||
|
||||
int _gdi_reorder_text (PDC pdc, const unsigned char* text, int text_len,
|
||||
|
||||
+15
-10
@@ -1733,7 +1733,7 @@ static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient)
|
||||
pdc->pLogFont = GetSystemFont (SYSLOGFONT_WCHAR_DEF);
|
||||
pdc->tabstop = 8;
|
||||
pdc->CurTextPos.x = pdc->CurTextPos.y = 0;
|
||||
pdc->cExtra = pdc->alExtra = pdc->blExtra = 0;
|
||||
pdc->cExtra = pdc->wExtra = pdc->alExtra = pdc->blExtra = 0;
|
||||
|
||||
pdc->mapmode = MM_TEXT;
|
||||
pdc->ta_flags = TA_LEFT | TA_TOP | TA_NOUPDATECP;
|
||||
@@ -1812,8 +1812,9 @@ static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient)
|
||||
[pdc->surface->format->BytesPerPixel - 1];
|
||||
pdc->draw_src_span = draw_src_span_ops [pdc->rop]
|
||||
[pdc->surface->format->BytesPerPixel - 1];
|
||||
pdc->user_comp_ctxt = pdc->surface->format;
|
||||
|
||||
pdc->cur_dst = (BYTE*)pdc->surface->pixels
|
||||
pdc->cur_dst = (BYTE*)pdc->surface->pixels
|
||||
+ pdc->surface->pitch * pdc->DevRC.top
|
||||
+ pdc->surface->format->BytesPerPixel * pdc->DevRC.left;
|
||||
|
||||
@@ -1833,12 +1834,12 @@ static void dc_InitMemDCFrom (PDC pdc, const PDC pdc_ref)
|
||||
|
||||
/* copy attributes from reference DC
|
||||
* gal_pixel bkcolor, pencolor, brushcolor, textcolor;
|
||||
* int bkmode, tabstop, cExtra, alExtra, blExtra, mapmode, ta_flags, bidi_flags;
|
||||
* int bkmode, tabstop, cExtra, wExtra, alExtra, blExtra, mapmode, ta_flags, bidi_flags;
|
||||
*/
|
||||
memcpy (&pdc->bkcolor, &pdc_ref->bkcolor,
|
||||
sizeof (gal_pixel)*4 + sizeof (int)*8);
|
||||
memcpy (&pdc->bkcolor, &pdc_ref->bkcolor,
|
||||
sizeof (gal_pixel)*4 + sizeof (int)*9);
|
||||
#ifdef _MGHAVE_ADV_2DAPI
|
||||
memcpy (&pdc->pen_type, &pdc_ref->pen_type,
|
||||
memcpy (&pdc->pen_type, &pdc_ref->pen_type,
|
||||
(sizeof(int)*7) + sizeof(POINT) + (sizeof (void*)*3));
|
||||
#endif
|
||||
pdc->pLogFont = pdc_ref->pLogFont;
|
||||
@@ -1864,6 +1865,7 @@ static void dc_InitMemDCFrom (PDC pdc, const PDC pdc_ref)
|
||||
[pdc->surface->format->BytesPerPixel - 1];
|
||||
pdc->draw_src_span = draw_src_span_ops [pdc->rop]
|
||||
[pdc->surface->format->BytesPerPixel - 1];
|
||||
pdc->user_comp_ctxt = pdc->surface->format;
|
||||
|
||||
pdc->cur_dst = (BYTE*)pdc->surface->pixels
|
||||
+ pdc->surface->pitch * pdc->DevRC.top
|
||||
@@ -1898,7 +1900,7 @@ static void dc_InitScreenDC (PDC pdc, GAL_Surface *surface)
|
||||
pdc->pLogFont = GetSystemFont (SYSLOGFONT_WCHAR_DEF);
|
||||
pdc->tabstop = 8;
|
||||
pdc->CurTextPos.x = pdc->CurTextPos.y = 0;
|
||||
pdc->cExtra = pdc->alExtra = pdc->blExtra = 0;
|
||||
pdc->cExtra = pdc->wExtra = pdc->alExtra = pdc->blExtra = 0;
|
||||
|
||||
pdc->mapmode = MM_TEXT;
|
||||
pdc->ta_flags = TA_LEFT | TA_TOP | TA_NOUPDATECP;
|
||||
@@ -1955,6 +1957,7 @@ static void dc_InitScreenDC (PDC pdc, GAL_Surface *surface)
|
||||
[pdc->surface->format->BytesPerPixel - 1];
|
||||
pdc->draw_src_span = draw_src_span_ops [pdc->rop]
|
||||
[pdc->surface->format->BytesPerPixel - 1];
|
||||
pdc->user_comp_ctxt = pdc->surface->format;
|
||||
|
||||
pdc->cur_dst = pdc->surface->pixels;
|
||||
pdc->move_to = move_to_ops [pdc->surface->format->BytesPerPixel - 1];
|
||||
@@ -1966,7 +1969,7 @@ static void dc_InitScreenDC (PDC pdc, GAL_Surface *surface)
|
||||
/* Init bitmap scaler ALG */
|
||||
SetBitmapScalerType((HDC)pdc, BITMAP_SCALER_DDA);
|
||||
}
|
||||
|
||||
|
||||
int GUIAPI GetRasterOperation (HDC hdc)
|
||||
{
|
||||
PDC pdc;
|
||||
@@ -1992,6 +1995,7 @@ int GUIAPI SetRasterOperation (HDC hdc, int rop)
|
||||
[pdc->surface->format->BytesPerPixel - 1];
|
||||
pdc->draw_src_span = draw_src_span_ops [rop]
|
||||
[pdc->surface->format->BytesPerPixel - 1];
|
||||
pdc->user_comp_ctxt = pdc->surface->format;
|
||||
}
|
||||
|
||||
return old;
|
||||
@@ -3434,8 +3438,8 @@ HWND GUIAPI WindowFromDC (HDC hdc)
|
||||
typedef struct _DCSTATE
|
||||
{
|
||||
GAL_Color bkcolor, pencolor, brushcolor, textcolor;
|
||||
/* bkmode, tabstop, cExtra, alExtra, blExtra, mapmode, ta_flags, bidi_flags */
|
||||
char attrs_g1 [sizeof(int)*8];
|
||||
/* bkmode, tabstop, cExtra, wExtra, alExtra, blExtra, mapmode, ta_flags, bidi_flags */
|
||||
char attrs_g1 [sizeof(int)*9];
|
||||
|
||||
#ifdef _MGHAVE_ADV_2DAPI
|
||||
/*
|
||||
@@ -3643,6 +3647,7 @@ BOOL GUIAPI RestoreDC (HDC hdc, int saved_dc)
|
||||
[pdc->surface->format->BytesPerPixel - 1];
|
||||
pdc->draw_src_span = draw_src_span_ops [pdc->rop]
|
||||
[pdc->surface->format->BytesPerPixel - 1];
|
||||
pdc->user_comp_ctxt = pdc->surface->format;
|
||||
}
|
||||
else if (ROP_COMP_USER == pdc->rop) {
|
||||
pdc->draw_pixel = dc_state->user_set_pixel;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+456
-2346
File diff suppressed because it is too large
Load Diff
@@ -32,6 +32,8 @@
|
||||
* <http://www.minigui.com/en/about/licensing-policy/>.
|
||||
*/
|
||||
/*
|
||||
** NOTE: DEPRECATED.
|
||||
**
|
||||
** logfont.c: Log fonts management.
|
||||
**
|
||||
** Current maintainer: Wei Yongming.
|
||||
@@ -67,7 +69,7 @@ static PLOGFONT gdiCreateLogFont ( const char* type, const char* family,
|
||||
{
|
||||
PLOGFONT log_font;
|
||||
int sbc_descent, mbc_descent = 0;
|
||||
char dev_family [LEN_FONT_NAME + 1];
|
||||
char dev_family [LEN_LOGFONT_NAME_FIELD + 1];
|
||||
DEVFONT* sbc_devfont, *mbc_devfont;
|
||||
|
||||
// is valid style?
|
||||
@@ -89,17 +91,17 @@ static PLOGFONT gdiCreateLogFont ( const char* type, const char* family,
|
||||
#endif
|
||||
|
||||
if (type) {
|
||||
strncpy (log_font->type, type, LEN_FONT_NAME);
|
||||
log_font->type [LEN_FONT_NAME] = '\0';
|
||||
strncpy (log_font->type, type, LEN_LOGFONT_NAME_FIELD);
|
||||
log_font->type [LEN_LOGFONT_NAME_FIELD] = '\0';
|
||||
}
|
||||
else
|
||||
strcpy (log_font->type, FONT_TYPE_NAME_ALL);
|
||||
|
||||
strncpy (log_font->family, family, LEN_FONT_NAME);
|
||||
log_font->family [LEN_FONT_NAME] = '\0';
|
||||
strncpy (log_font->family, family, LEN_LOGFONT_NAME_FIELD);
|
||||
log_font->family [LEN_LOGFONT_NAME_FIELD] = '\0';
|
||||
|
||||
strncpy (log_font->charset, charset, LEN_FONT_NAME);
|
||||
log_font->charset [LEN_FONT_NAME] = '\0';
|
||||
strncpy (log_font->charset, charset, LEN_LOGFONT_NAME_FIELD);
|
||||
log_font->charset [LEN_LOGFONT_NAME_FIELD] = '\0';
|
||||
|
||||
if (size > FONT_MAX_SIZE)
|
||||
log_font->size = FONT_MAX_SIZE;
|
||||
@@ -138,25 +140,25 @@ static PLOGFONT gdiCreateLogFont ( const char* type, const char* family,
|
||||
// family name
|
||||
if (log_font->mbc_devfont) {
|
||||
fontGetFamilyFromName (log_font->mbc_devfont->name, dev_family);
|
||||
strncpy (log_font->family, dev_family, LEN_FONT_NAME);
|
||||
log_font->family [LEN_FONT_NAME] = '\0';
|
||||
strncpy (log_font->family, dev_family, LEN_LOGFONT_NAME_FIELD);
|
||||
log_font->family [LEN_LOGFONT_NAME_FIELD] = '\0';
|
||||
}
|
||||
else {
|
||||
fontGetFamilyFromName (log_font->sbc_devfont->name, dev_family);
|
||||
strncpy (log_font->family, dev_family, LEN_FONT_NAME);
|
||||
log_font->family [LEN_FONT_NAME] = '\0';
|
||||
strncpy (log_font->family, dev_family, LEN_LOGFONT_NAME_FIELD);
|
||||
log_font->family [LEN_LOGFONT_NAME_FIELD] = '\0';
|
||||
}
|
||||
|
||||
// charset name
|
||||
if (log_font->mbc_devfont) {
|
||||
strncpy (log_font->charset,
|
||||
log_font->mbc_devfont->charset_ops->name, LEN_FONT_NAME);
|
||||
log_font->charset [LEN_FONT_NAME] = '\0';
|
||||
log_font->mbc_devfont->charset_ops->name, LEN_LOGFONT_NAME_FIELD);
|
||||
log_font->charset [LEN_LOGFONT_NAME_FIELD] = '\0';
|
||||
}
|
||||
else {
|
||||
strncpy (log_font->charset,
|
||||
log_font->sbc_devfont->charset_ops->name, LEN_FONT_NAME);
|
||||
log_font->charset [LEN_FONT_NAME] = '\0';
|
||||
log_font->sbc_devfont->charset_ops->name, LEN_LOGFONT_NAME_FIELD);
|
||||
log_font->charset [LEN_LOGFONT_NAME_FIELD] = '\0';
|
||||
}
|
||||
|
||||
// size
|
||||
@@ -215,9 +217,9 @@ PLOGFONT GUIAPI CreateLogFont (const char* type, const char* family,
|
||||
|
||||
PLOGFONT GUIAPI CreateLogFontByName (const char* font_name)
|
||||
{
|
||||
char type[LEN_FONT_NAME + 1];
|
||||
char family[LEN_FONT_NAME + 1];
|
||||
char charset[LEN_FONT_NAME + 1];
|
||||
char type[LEN_LOGFONT_NAME_FIELD + 1];
|
||||
char family[LEN_LOGFONT_NAME_FIELD + 1];
|
||||
char charset[LEN_LOGFONT_NAME_FIELD + 1];
|
||||
DWORD style;
|
||||
int height;
|
||||
|
||||
@@ -110,7 +110,6 @@ BOOL GUIAPI InitBitmapPixelFormat (HDC hdc, PBITMAP bmp)
|
||||
if (bmp->bmType & BMP_TYPE_ALPHA) {
|
||||
if (device_has_alpha(hdc) || bmp->bmBitsPerPixel <= 8) {
|
||||
bmp->bmType &= ~BMP_TYPE_ALPHA_MASK;
|
||||
bmp->bmType &= ~BMP_TYPE_PRIV_PIXEL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1262,7 +1261,6 @@ int GUIAPI FillBoxWithMyBitmap (HDC hdc, int x, int y, MYBITMAP* mybmp, RGB* pal
|
||||
}
|
||||
|
||||
//bmp->bmType |= BMP_TYPE_ALPHA;
|
||||
//bmp->bmType |= BMP_TYPE_PRIV_PIXEL;
|
||||
}
|
||||
else { /* for bpp <= 8, just strip alpha */
|
||||
AlphaPixelFormat = pdc->surface->format;
|
||||
|
||||
+107
-90
File diff suppressed because it is too large
Load Diff
+14
-10
@@ -61,18 +61,22 @@ int GUIAPI GetFontHeight (HDC hdc)
|
||||
|
||||
int GUIAPI GetMaxFontWidth (HDC hdc)
|
||||
{
|
||||
int i;
|
||||
DEVFONT* df;
|
||||
PDC pdc = dc_HDC2PDC(hdc);
|
||||
DEVFONT* sbc_devfont = pdc->pLogFont->sbc_devfont;
|
||||
DEVFONT* mbc_devfont = pdc->pLogFont->mbc_devfont;
|
||||
int sbc_max_width = (*sbc_devfont->font_ops->get_max_width)
|
||||
(pdc->pLogFont, sbc_devfont);
|
||||
int mbc_max_width = 0;
|
||||
int max_width = 0;
|
||||
|
||||
if (mbc_devfont)
|
||||
mbc_max_width = (*mbc_devfont->font_ops->get_max_width)
|
||||
(pdc->pLogFont, mbc_devfont);
|
||||
|
||||
return (sbc_max_width > mbc_max_width) ? sbc_max_width : mbc_max_width;
|
||||
for (i = 0; i < MAXNR_DEVFONTS; i++) {
|
||||
int value;
|
||||
df = pdc->pLogFont->devfonts[i];
|
||||
if (df == NULL)
|
||||
break;
|
||||
|
||||
value = df->font_ops->get_max_width(pdc->pLogFont, df);
|
||||
max_width = MAX(max_width, value);
|
||||
}
|
||||
|
||||
return max_width;
|
||||
}
|
||||
|
||||
void GUIAPI GetLastTextOutPos (HDC hdc, POINT* pt)
|
||||
|
||||
+91
-77
File diff suppressed because it is too large
Load Diff
@@ -3850,7 +3850,7 @@ static int texteditor_get_text_count(mTextEditor* self, int start_with, BOOL bTe
|
||||
return len;
|
||||
}
|
||||
|
||||
if(plogfont->mbc_devfont == NULL)
|
||||
if(plogfont->devfonts[1] == NULL)
|
||||
return len;
|
||||
|
||||
while(idx < len)
|
||||
|
||||
Reference in New Issue
Block a user