mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-28 16:17:09 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b01f35cac | ||
|
|
e0b6a64402 | ||
|
|
084d7e58a2 | ||
|
|
88753a5fd0 | ||
|
|
b739daadba | ||
|
|
5529ab1e10 | ||
|
|
032fdcc3bb | ||
|
|
1cb9922dad | ||
|
|
8ac0d539d0 | ||
|
|
e3ae994212 | ||
|
|
b0145a15d2 | ||
|
|
9dab380f3e | ||
|
|
d1facd5468 | ||
|
|
5996ede23b | ||
|
|
837cd49045 | ||
|
|
dc4f54ffe4 | ||
|
|
f611fe3859 | ||
|
|
4ff5097dfb | ||
|
|
49421e1f88 | ||
|
|
6e33602e7d | ||
|
|
d13c31a08a | ||
|
|
704b6287ff | ||
|
|
1df726dd10 | ||
|
|
b2afe815b5 | ||
|
|
f648c1a8c7 | ||
|
|
4d2fe61e52 | ||
|
|
9644964e9c | ||
|
|
61b799af88 | ||
|
|
2f52006cde | ||
|
|
cf063aad32 | ||
|
|
0855e8b972 | ||
|
|
a501557532 | ||
|
|
820d6aeac4 | ||
|
|
215242e3e8 | ||
|
|
c79f09fe87 | ||
|
|
f68c26860a | ||
|
|
53f1a05526 | ||
|
|
6a5cfd1052 | ||
|
|
1c79cf510f | ||
|
|
86965a0e9c | ||
|
|
9cca87878c | ||
|
|
2cffa1154c | ||
|
|
9adea7df64 | ||
|
|
8f70dfcf69 | ||
|
|
ccf1e6f7a5 | ||
|
|
913ea4db23 | ||
|
|
55baa8c741 | ||
|
|
db63d8cad3 | ||
|
|
338fb0276e | ||
|
|
8dd64e7f2d | ||
|
|
c1cbb8423e | ||
|
|
a95ee5b181 | ||
|
|
9d9bf95c21 | ||
|
|
ed6ceaa49c | ||
|
|
f5e1144cbe | ||
|
|
c890e4296a | ||
|
|
d09313407e | ||
|
|
7dfe5954f5 | ||
|
|
390c5de6ef | ||
|
|
274fdaaa31 | ||
|
|
04725fc892 | ||
|
|
4da29f635d | ||
|
|
3e5ff0af91 | ||
|
|
1820e74b77 | ||
|
|
2278c4975c | ||
|
|
af8a04570d | ||
|
|
452edfa831 | ||
|
|
4fba705082 | ||
|
|
a049e387e0 | ||
|
|
c67a18536d | ||
|
|
d9e09ac34f | ||
|
|
65972861a0 | ||
|
|
96b06544b3 | ||
|
|
838530d6b1 | ||
|
|
c276122f60 | ||
|
|
46a8b1768a | ||
|
|
d5b57e8200 | ||
|
|
ee179e6995 | ||
|
|
3571d88f3d | ||
|
|
8ba346eec5 | ||
|
|
e110cb61f4 | ||
|
|
d29aa1d881 | ||
|
|
6337f5d6fa | ||
|
|
14bfe263a3 | ||
|
|
cbd54e0766 | ||
|
|
ceaec7e3d3 | ||
|
|
aab8d6e2c6 | ||
|
|
8a856e5b99 | ||
|
|
46f48a0d6c | ||
|
|
40fc11f324 | ||
|
|
d63fe9849b | ||
|
|
349f310148 | ||
|
|
ac60980bc2 | ||
|
|
e7002ad870 | ||
|
|
6838a67e7d | ||
|
|
9a8d997f63 | ||
|
|
f8b0a89d90 | ||
|
|
72f61f17be | ||
|
|
676dd0e6da | ||
|
|
02c7a6e07c | ||
|
|
8f841a0bc0 | ||
|
|
f218b7b892 | ||
|
|
1e1dd76fb1 | ||
|
|
4ba0bcd0fe | ||
|
|
cc9d9f6d42 | ||
|
|
4c9e8138b1 | ||
|
|
f79a1bd86a | ||
|
|
211135fbc5 | ||
|
|
537b659fc7 | ||
|
|
6b45b74e32 | ||
|
|
0ceb5616bf | ||
|
|
62f9cf9e48 | ||
|
|
6842cd3933 | ||
|
|
2c5ddd93cb | ||
|
|
64ddca1e2f | ||
|
|
9dea317925 | ||
|
|
a4e8a42707 | ||
|
|
005519e7cc | ||
|
|
da7c2175dd | ||
|
|
c7e6a867f4 | ||
|
|
30c6033e8c | ||
|
|
5a5d5d3bbb | ||
|
|
bdd75353d2 | ||
|
|
ce7b9eccca | ||
|
|
c66f1a5fa3 | ||
|
|
ba240cd53b | ||
|
|
ca9d0200f3 | ||
|
|
5dd2a21919 | ||
|
|
11124ef8a0 | ||
|
|
e8714be5ef | ||
|
|
13341e864c | ||
|
|
e1a464b32f | ||
|
|
a7601d8cfe | ||
|
|
98ae3a6b35 | ||
|
|
f82e15ed5e | ||
|
|
690f5487ab | ||
|
|
4e0a9a8d37 | ||
|
|
c6f1004ba6 | ||
|
|
a4e9f56c08 | ||
|
|
d84a7ffbbe | ||
|
|
11865764da | ||
|
|
fdc449335d | ||
|
|
27e508848d | ||
|
|
cc01ce0bbc | ||
|
|
0093ac3edc | ||
|
|
45db7410c0 | ||
|
|
e6df345736 | ||
|
|
e7b05090cd | ||
|
|
b82128091e | ||
|
|
adab30261c | ||
|
|
7e0b378475 | ||
|
|
d1ef9e2598 | ||
|
|
5887668b17 | ||
|
|
e6cb8f272b | ||
|
|
90e4ee91fe | ||
|
|
83207ca329 | ||
|
|
dcd31bed7c | ||
|
|
76cf8a02af | ||
|
|
10d8b43c61 | ||
|
|
554b709890 | ||
|
|
d877e86adc | ||
|
|
c5e5bd01e8 | ||
|
|
e3760457c4 | ||
|
|
c6ed1626f9 | ||
|
|
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
|
||||
|
||||
+152
-86
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
|
||||
|
||||
+115
-94
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
|
||||
+156
-103
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.
|
||||
*
|
||||
*/
|
||||
|
||||
+66
-66
File diff suppressed because it is too large
Load Diff
+5771
-1974
File diff suppressed because it is too large
Load Diff
+660
-339
File diff suppressed because it is too large
Load Diff
+1012
-1012
File diff suppressed because it is too large
Load Diff
+444
-446
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);
|
||||
|
||||
+141
-141
File diff suppressed because it is too large
Load Diff
+189
-189
File diff suppressed because it is too large
Load Diff
+32
-32
@@ -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/>.
|
||||
*/
|
||||
@@ -56,7 +56,7 @@
|
||||
#include "ctrlmisc.h"
|
||||
#include "progressbar_impl.h"
|
||||
|
||||
static void pbarNormalizeParams (const CONTROL* pCtrl,
|
||||
static void pbarNormalizeParams (const CONTROL* pCtrl,
|
||||
PROGRESSDATA* pData, BOOL fNotify)
|
||||
{
|
||||
if (pData->nPos >= pData->nMax) {
|
||||
@@ -72,8 +72,8 @@ static void pbarNormalizeParams (const CONTROL* pCtrl,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
pbarOnNewPos (const CONTROL* pCtrl,
|
||||
static void
|
||||
pbarOnNewPos (const CONTROL* pCtrl,
|
||||
PROGRESSDATA* pData, unsigned int new_pos)
|
||||
{
|
||||
unsigned int old_pos;
|
||||
@@ -97,32 +97,32 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
HDC hdc;
|
||||
PCONTROL pCtrl;
|
||||
PROGRESSDATA* pData;
|
||||
|
||||
pCtrl = gui_Control (hwnd);
|
||||
|
||||
|
||||
pCtrl = gui_Control (hwnd);
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case MSG_CREATE:
|
||||
if (!(pData = malloc (sizeof (PROGRESSDATA)))) {
|
||||
_MG_PRINTF ("CONTROL>ProgressBar: Create control failure!\n");
|
||||
_WRN_PRINTF ("Create control failure!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
pData->nMax = 100;
|
||||
pData->nMin = 0;
|
||||
pData->nPos = 0;
|
||||
pData->nStepInc = 10;
|
||||
|
||||
|
||||
pCtrl->dwAddData2 = (DWORD)pData;
|
||||
break;
|
||||
|
||||
|
||||
case MSG_DESTROY:
|
||||
free ((void *)(pCtrl->dwAddData2));
|
||||
break;
|
||||
|
||||
case MSG_NCPAINT:
|
||||
return 0;
|
||||
|
||||
|
||||
case MSG_GETDLGCODE:
|
||||
return DLGC_STATIC;
|
||||
|
||||
@@ -135,8 +135,8 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
PROGRESSDATA *data = (PROGRESSDATA *)pCtrl->dwAddData2;
|
||||
hdc = BeginPaint (hwnd);
|
||||
GetWindowInfo (hwnd)->we_rdr->draw_progress (hwnd,
|
||||
hdc, data->nMax, data->nMin,
|
||||
GetWindowInfo (hwnd)->we_rdr->draw_progress (hwnd,
|
||||
hdc, data->nMax, data->nMin,
|
||||
data->nPos, pCtrl->dwStyle & PBS_VERTICAL);
|
||||
|
||||
EndPaint (hwnd, hdc);
|
||||
@@ -160,7 +160,7 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
InvalidateRect (hwnd, NULL, TRUE);
|
||||
return PB_OKAY;
|
||||
|
||||
|
||||
case PBM_SETSTEP:
|
||||
pData = (PROGRESSDATA *)pCtrl->dwAddData2;
|
||||
if ((int)wParam > (int)(pData->nMax - pData->nMin))
|
||||
@@ -168,39 +168,39 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
pData->nStepInc = wParam;
|
||||
return PB_OKAY;
|
||||
|
||||
|
||||
case PBM_SETPOS:
|
||||
pData = (PROGRESSDATA *)pCtrl->dwAddData2;
|
||||
|
||||
|
||||
if (pData->nPos == wParam)
|
||||
return PB_OKAY;
|
||||
|
||||
pbarOnNewPos (pCtrl, pData, wParam);
|
||||
return PB_OKAY;
|
||||
|
||||
|
||||
case PBM_DELTAPOS:
|
||||
pData = (PROGRESSDATA *)pCtrl->dwAddData2;
|
||||
|
||||
if (wParam == 0)
|
||||
return PB_OKAY;
|
||||
|
||||
|
||||
pbarOnNewPos (pCtrl, pData, pData->nPos + wParam);
|
||||
return PB_OKAY;
|
||||
|
||||
|
||||
case PBM_STEPIT:
|
||||
pData = (PROGRESSDATA *)pCtrl->dwAddData2;
|
||||
|
||||
|
||||
if (pData->nStepInc == 0)
|
||||
return PB_OKAY;
|
||||
|
||||
pbarOnNewPos (pCtrl, pData, pData->nPos + pData->nStepInc);
|
||||
return PB_OKAY;
|
||||
|
||||
|
||||
case MSG_FONTCHANGED:
|
||||
InvalidateRect (hwnd, NULL, TRUE);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return DefaultControlProc (hwnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ BOOL RegisterProgressBarControl (void)
|
||||
WndClass.dwStyle = WS_NONE;
|
||||
WndClass.dwExStyle = WS_EX_NONE;
|
||||
WndClass.hCursor = GetSystemCursor (0);
|
||||
WndClass.iBkColor =
|
||||
WndClass.iBkColor =
|
||||
GetWindowElementPixel (HWND_NULL, WE_MAINC_THREED_BODY);
|
||||
WndClass.WinProc = ProgressBarCtrlProc;
|
||||
|
||||
|
||||
+143
-144
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
|
||||
@@ -916,7 +916,7 @@ textdoc_insert_text (TextDoc *txtdoc, const char* newtext, int len)
|
||||
/* insert last strings */
|
||||
/* FIXME */
|
||||
if (!nextnode) {
|
||||
_MG_PRINTF ("CONTROL>TextEdit: (Warning) nextnode is NULL!\n");
|
||||
_WRN_PRINTF ("nextnode is NULL!");
|
||||
/* set_current_node (txtdoc, LASTNODE(txtdoc), FALSE, TRUE); */
|
||||
}
|
||||
else {
|
||||
@@ -1446,7 +1446,7 @@ static int get_line_nr (HWND hWnd, PTEDATA ptedata, TextNode *node, int indent)
|
||||
HDC hdc;
|
||||
|
||||
if (!node) {
|
||||
_MG_PRINTF ("CONTROL>TextEdit: (Warning) pass NULL text node to get_line_nr\n");
|
||||
_WRN_PRINTF ("pass NULL text node to get_line_nr");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1571,7 +1571,7 @@ set_line_width (HWND hWnd, PTEDATA ptedata, TextNode *node, int indent)
|
||||
HDC hdc;
|
||||
|
||||
if (!node) {
|
||||
_MG_PRINTF ("CONTROL>TextEdit: (Warning) pass NULL text node to set_line_width\n");
|
||||
_WRN_PRINTF ("pass NULL text node to set_line_width");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
+64
-64
File diff suppressed because it is too large
Load Diff
+18
-18
@@ -216,7 +216,7 @@ static int LWZReadByte (MG_RWops *area, int flag, int input_code_size)
|
||||
while (code >= clear_code) {
|
||||
*sp++ = table[1][code];
|
||||
if (code == table[0][code]) {
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: circular table entry\n");
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: circular table entry\n");
|
||||
return -1;
|
||||
}
|
||||
code = table[0][code];
|
||||
@@ -259,7 +259,7 @@ static int GetCode(MG_RWops *area, int code_size, int flag)
|
||||
if ((curbit + code_size) >= lastbit) {
|
||||
if (done) {
|
||||
if (curbit >= lastbit)
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: bad decode\n");
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: bad decode\n");
|
||||
return -1;
|
||||
}
|
||||
buf[0] = buf[last_byte - 2];
|
||||
@@ -362,7 +362,7 @@ static int ReadGIFGlobal (MG_RWops *area, GIFSCREEN* GifScreen)
|
||||
version [3] = '\0';
|
||||
|
||||
if (strcmp ((const char*)version, "87a") != 0 && strcmp ((const char*)version, "89a") != 0) {
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: GIF version number not 87a or 89a.\n");
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: GIF version number not 87a or 89a.\n");
|
||||
return -1; /* image loading error*/
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ static int ReadGIFGlobal (MG_RWops *area, GIFSCREEN* GifScreen)
|
||||
GifScreen->disposal = 0;
|
||||
|
||||
if (!ReadOK (area, buf, 7)) {
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: bad screen descriptor\n");
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: bad screen descriptor\n");
|
||||
return -1; /* image loading error*/
|
||||
}
|
||||
GifScreen->Width = LM_to_uint (buf[0], buf[1]);
|
||||
@@ -384,10 +384,10 @@ static int ReadGIFGlobal (MG_RWops *area, GIFSCREEN* GifScreen)
|
||||
GifScreen->AspectRatio = buf[6];
|
||||
|
||||
if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: have global colormap: %d\n",
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: have global colormap: %d\n",
|
||||
GifScreen->Background);
|
||||
if (ReadColorMap (area, GifScreen->BitPixel, GifScreen->ColorMap)) {
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: bad global colormap\n");
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: bad global colormap\n");
|
||||
return -1; /* image loading error*/
|
||||
}
|
||||
}
|
||||
@@ -399,7 +399,7 @@ static int ReadImageDesc (MG_RWops *area, IMAGEDESC* ImageDesc, GIFSCREEN* GifSc
|
||||
{
|
||||
unsigned char buf[16];
|
||||
if (!ReadOK (area, buf, 9)) {
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: bad image size\n");
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: bad image size\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -414,9 +414,9 @@ static int ReadImageDesc (MG_RWops *area, IMAGEDESC* ImageDesc, GIFSCREEN* GifSc
|
||||
ImageDesc->interlace = BitSet(buf[8], INTERLACE);
|
||||
|
||||
if (ImageDesc->haveColorMap) {
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: have local colormap\n");
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: have local colormap\n");
|
||||
if (ReadColorMap (area, ImageDesc->bitPixel, ImageDesc->ColorMap) < 0) {
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: bad local colormap\n");
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: bad local colormap\n");
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
@@ -437,12 +437,12 @@ static int ReadImage (MG_RWops* area, MYBITMAP* bmp, IMAGEDESC* ImageDesc, GIFSC
|
||||
* initialize the compression routines
|
||||
*/
|
||||
if (!ReadOK (area, &c, 1)) {
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: eof on image data\n");
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: eof on image data\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (LWZReadByte (area, TRUE, c) < 0) {
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: error reading image\n");
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: error reading image\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -549,11 +549,11 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
|
||||
anim->bk.a = 0;
|
||||
}
|
||||
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: Background: %d, %d, %d.\n",
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: Background: %d, %d, %d.\n",
|
||||
anim->bk.r, anim->bk.g, anim->bk.b);
|
||||
|
||||
if ((ok = ReadOK (area, &c, 1)) == 0) {
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -561,11 +561,11 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
|
||||
switch (c) {
|
||||
case '!':
|
||||
if ( (ok = ReadOK (area, &c, 1)) == 0) {
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
|
||||
goto error;
|
||||
}
|
||||
DoExtension (area, c, &GifScreen);
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: Extension info: %d, %d, %d, %d, %d, %d\n",
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: Extension info: %d, %d, %d, %d, %d, %d\n",
|
||||
GifScreen.Width, GifScreen.Height,
|
||||
GifScreen.AspectRatio, GifScreen.delayTime,
|
||||
GifScreen.disposal, GifScreen.transparent);
|
||||
@@ -579,7 +579,7 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
|
||||
if (ReadImage (area, &mybmp, &ImageDesc, &GifScreen, 0) < 0)
|
||||
goto error;
|
||||
}
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: Image Descriptor: %d, %d, %d, %d, %d\n",
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: Image Descriptor: %d, %d, %d, %d, %d\n",
|
||||
ImageDesc.Top, ImageDesc.Left,
|
||||
ImageDesc.Width, ImageDesc.Height,
|
||||
ImageDesc.haveColorMap);
|
||||
@@ -595,14 +595,14 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
|
||||
frame->width = mybmp.w;
|
||||
frame->height = mybmp.h;
|
||||
frame->delay_time = (GifScreen.delayTime>10)?GifScreen.delayTime:10;
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: frame info: %d, %d, %d, %d\n",
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: frame info: %d, %d, %d, %d\n",
|
||||
frame->off_x, frame->off_y, frame->delay_time,
|
||||
GifScreen.transparent);
|
||||
|
||||
if ((frame->mem_dc = CreateMemDCFromMyBitmap (&mybmp, ImageDesc.ColorMap)) == 0) {
|
||||
free (mybmp.bits);
|
||||
free (frame);
|
||||
_MG_PRINTF ("EX_CTRL>GIF89a: Error when expand frame bitmap.\n");
|
||||
_WRN_PRINTF ("EX_CTRL>GIF89a: Error when expand frame bitmap.\n");
|
||||
goto error;
|
||||
}
|
||||
frame->bits = mybmp.bits;
|
||||
|
||||
@@ -1108,7 +1108,7 @@ void GridCellTypeNumber_set_text_value(gvGridCellData* cell, int row, int col, c
|
||||
if (INF[0] != 'I' && INF[0] != 'i')
|
||||
cell->data.number.num = number;
|
||||
else
|
||||
_MG_PRINTF ("EX_CTRL>Grid: The inputed number is too big!\n");
|
||||
_WRN_PRINTF ("EX_CTRL>Grid: The inputed number is too big!\n");
|
||||
}
|
||||
|
||||
double GridCellTypeNumber_get_double_value(gvGridCellData* cell, int row, int col)
|
||||
|
||||
+31
-8
@@ -2,23 +2,46 @@ SUBDIRS = in-core
|
||||
|
||||
noinst_LTLIBRARIES = libfont.la
|
||||
|
||||
SRC_FILES = charset.c charset-arabic.c charset-bidi.c \
|
||||
SRC_FILES = charset.c charset-arabic.c legacy-bidi.c charset-unicode.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 \
|
||||
nullfont.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
|
||||
textops.c \
|
||||
mapunitogb.c mapunitogbk.c mapunitobig5.c mapunitogb18030.c \
|
||||
bitmapfont.c scripteasy.c \
|
||||
unicode-emoji.c unicode-vop.c \
|
||||
unicode-bidi.c \
|
||||
unicode-break.c unicode-break-arabic.c unicode-break-indic.c unicode-break-thai.c \
|
||||
unicode-joining-types.c unicode-joining.c unicode-shape.c \
|
||||
unicode-shape-arabic.c harzbuff-minigui-funcs.c \
|
||||
unicode-iterators.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-tables.h unicode-script-table.h \
|
||||
unicode-decomp.h unicode-comp.h \
|
||||
unicode-emoji-tables.h \
|
||||
legacy-bidi-tables.inc \
|
||||
unicode-bidi.h unicode-vop-table.inc \
|
||||
unicode-joining-types-list.inc \
|
||||
unicode-joining-type-table.inc \
|
||||
unicode-arabic-shaping-table.inc \
|
||||
unicode-arabic-misc-table.inc \
|
||||
unicode-bidi-bidi-types-list.inc \
|
||||
unicode-bidi-bidi-type-table.inc \
|
||||
unicode-bidi-brackets-table.inc \
|
||||
unicode-bidi-brackets-type-table.inc \
|
||||
unicode-bidi-mirroring-table.inc \
|
||||
script-language-table.inc \
|
||||
emoji_presentation_scanner.inc
|
||||
|
||||
EXTRA_DIST = convgbmap.c jisunimap.c $(SRC_FILES) $(HDR_FILES) \
|
||||
makefile.ng makefile.msvc
|
||||
|
||||
# AM_CPPFLAGS = $(FT1_INC_DIR) $(FT2_INC_DIR)
|
||||
AM_CPPFLAGS = $(FT2_INC_DIR)
|
||||
AM_CPPFLAGS = $(FT2_INC_DIR) $(HB_INC_DIR)
|
||||
AM_CPPFLAGS += -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
||||
|
||||
libfont_la_SOURCES = $(SRC_FILES) $(HDR_FILES)
|
||||
|
||||
+11
-8
@@ -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;
|
||||
}
|
||||
|
||||
@@ -271,7 +274,7 @@ get_glyph_prbitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
bmp->bmHeight = 0;
|
||||
bmp->bmPitch = 0;
|
||||
|
||||
_MG_PRINTF ("FONT>Bitmap: "
|
||||
_DBG_PRINTF ("FONT>Bitmap: "
|
||||
"Glyph %d does not exist and is replaced with default glyph. \n",
|
||||
glyph_value);
|
||||
return 1;
|
||||
@@ -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;
|
||||
|
||||
|
||||
+207
-194
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+391
-1156
File diff suppressed because it is too large
Load Diff
+333
-105
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+15
-11
@@ -1,45 +1,48 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
|
||||
typedef struct {
|
||||
char* type;
|
||||
FONTOPS* ops;
|
||||
char* type;
|
||||
FONTOPS* ops;
|
||||
}FONTOPS_INFO;
|
||||
|
||||
extern FONTOPS __mg_null_font_ops;
|
||||
|
||||
#ifdef _MGFONT_RBF
|
||||
extern FONTOPS __mg_rbf_ops;
|
||||
#endif
|
||||
@@ -61,6 +64,7 @@ extern FONTOPS __mg_ttf_ops;
|
||||
#endif
|
||||
|
||||
FONTOPS_INFO __mg_fontops_infos[] = {
|
||||
{FONT_TYPE_NAME_BITMAP_NUF, &__mg_null_font_ops},
|
||||
#ifdef _MGFONT_RBF
|
||||
{FONT_TYPE_NAME_BITMAP_RAW, &__mg_rbf_ops},
|
||||
#endif
|
||||
|
||||
+33
-78
File diff suppressed because it is too large
Load Diff
+175
-29
File diff suppressed because it is too large
Load Diff
+131
-122
File diff suppressed because it is too large
Load Diff
+504
-382
File diff suppressed because it is too large
Load Diff
+47
-37
@@ -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,12 @@
|
||||
#ifndef GUI_FREETYP2_H
|
||||
#define GUI_FREETYP2_H
|
||||
|
||||
#ifndef TTF_DBG
|
||||
#define DP(x)
|
||||
#else
|
||||
#define DP(x) do { printf x; } while (0)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
@@ -63,19 +69,17 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _MGFONT_TTF_CACHE
|
||||
typedef unsigned long HCACHE;
|
||||
typedef int (* MakeHashKeyFunc)(unsigned short unicode);
|
||||
#endif
|
||||
typedef void* HCACHE;
|
||||
typedef int (* MakeHashKeyFunc)(Glyph32 gv);
|
||||
#endif
|
||||
|
||||
typedef struct tagFTFACEINFO {
|
||||
#ifdef _MGFONT_TTF_CACHE
|
||||
/*should be MAX_PATH*/
|
||||
char filepathname[256];
|
||||
char* filepathname;
|
||||
int face_index;
|
||||
int cmap_index;
|
||||
#else
|
||||
FT_Face face;
|
||||
#endif
|
||||
FT_Face face;
|
||||
BOOL valid;
|
||||
} FTFACEINFO, *PFTFACEINFO;
|
||||
|
||||
@@ -85,9 +89,8 @@ typedef struct tagFTINSTANCEINFO {
|
||||
FTC_ImageTypeRec image_type;
|
||||
FT_Int glyph_done;
|
||||
HCACHE cache;
|
||||
#else
|
||||
FT_Size size;
|
||||
#endif
|
||||
FT_Size size;
|
||||
FT_Matrix matrix;
|
||||
FT_Glyph glyph;
|
||||
int rotation;
|
||||
@@ -101,11 +104,12 @@ typedef struct tagFTINSTANCEINFO {
|
||||
int ascent;
|
||||
int descent;
|
||||
|
||||
FT_Bool use_kerning; /*FT_HAS_KERNING(face)*/
|
||||
FT_Vector delta;
|
||||
int is_index_old;
|
||||
FT_Bool use_kerning;
|
||||
FT_UInt cur_index;
|
||||
#if 0
|
||||
int is_index_old;
|
||||
FT_UInt prev_index;
|
||||
#endif
|
||||
|
||||
FT_LcdFilter ft_lcdfilter;
|
||||
} FTINSTANCEINFO, *PFTINSTANCEINFO;
|
||||
@@ -114,38 +118,44 @@ typedef struct tagFTINSTANCEINFO {
|
||||
|
||||
#define _TTF_HASH_NDIR 37
|
||||
|
||||
#define CACHE_VALID_ADVANCE 0x01
|
||||
#define CACHE_VALID_BBOX 0x02
|
||||
#define CACHE_VALID_BITMAP 0x04
|
||||
|
||||
typedef struct tagTTFCACHEINFO {
|
||||
unsigned short unicode;
|
||||
short glyph_code;
|
||||
FT_UInt glyph_code;
|
||||
Uint32 valid_advance:1;
|
||||
Uint32 valid_bbox:1;
|
||||
Uint32 valid_bitmap:1;
|
||||
Uint32 reserved_flags:28;
|
||||
|
||||
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);
|
||||
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size);
|
||||
extern void __mg_ttc_refer(HCACHE hCache);
|
||||
|
||||
#ifdef _MGCOMPLEX_SCRIPTS
|
||||
extern void __mg_init_harzbuff_funcs(void);
|
||||
extern void __mg_term_harzbuff_funcs(void);
|
||||
#endif
|
||||
|
||||
#undef TTF_DBG
|
||||
|
||||
#ifndef TTF_DBG
|
||||
#define DP(x)
|
||||
#else
|
||||
#define DP(x) do { printf x; } while (0)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
** harzbuff-minigui-funcs.c:
|
||||
**
|
||||
** Functions for using HarfBuzz with the MiniGUI to provide Unicode data.
|
||||
**
|
||||
** Create by WEI Yongming at 2019/03/14
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#if defined(_MGCHARSET_UNICODE) && defined(_MGCOMPLEX_SCRIPTS)
|
||||
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
|
||||
#include <hb.h>
|
||||
|
||||
static hb_unicode_combining_class_t
|
||||
hb_minigui_unicode_combining_class (hb_unicode_funcs_t *ufuncs,
|
||||
hb_codepoint_t unicode,
|
||||
void *user_data)
|
||||
|
||||
{
|
||||
return (hb_unicode_combining_class_t) UCharCombiningClass (unicode);
|
||||
}
|
||||
|
||||
static hb_unicode_general_category_t
|
||||
hb_minigui_unicode_general_category (hb_unicode_funcs_t *ufuncs,
|
||||
hb_codepoint_t unicode,
|
||||
void *user_data)
|
||||
{
|
||||
/* hb_unicode_general_category_t and GUnicodeType are identical */
|
||||
return (hb_unicode_general_category_t) UCharGetCategory (unicode);
|
||||
}
|
||||
|
||||
static hb_codepoint_t
|
||||
hb_minigui_unicode_mirroring (hb_unicode_funcs_t *ufuncs,
|
||||
hb_codepoint_t unicode,
|
||||
void *user_data)
|
||||
{
|
||||
UCharGetMirror (unicode, &unicode);
|
||||
return unicode;
|
||||
}
|
||||
|
||||
static hb_script_t
|
||||
hb_minigui_unicode_script (hb_unicode_funcs_t *ufuncs,
|
||||
hb_codepoint_t unicode,
|
||||
void *user_data)
|
||||
{
|
||||
return ScriptTypeToISO15924 (UCharGetScriptType(unicode));
|
||||
}
|
||||
|
||||
static hb_bool_t
|
||||
hb_minigui_unicode_compose (hb_unicode_funcs_t *ufuncs,
|
||||
hb_codepoint_t a,
|
||||
hb_codepoint_t b,
|
||||
hb_codepoint_t *ab,
|
||||
void *user_data)
|
||||
{
|
||||
return UCharCompose (a, b, ab);
|
||||
}
|
||||
|
||||
static hb_bool_t
|
||||
hb_minigui_unicode_decompose (hb_unicode_funcs_t *ufuncs,
|
||||
hb_codepoint_t ab,
|
||||
hb_codepoint_t *a,
|
||||
hb_codepoint_t *b,
|
||||
void *user_data)
|
||||
{
|
||||
return UCharDecompose(ab, a, b);
|
||||
}
|
||||
|
||||
static hb_unicode_funcs_t *funcs;
|
||||
static hb_unicode_funcs_t *get_unicode_funcs(void)
|
||||
{
|
||||
funcs = hb_unicode_funcs_create (NULL);
|
||||
|
||||
hb_unicode_funcs_set_combining_class_func (funcs,
|
||||
hb_minigui_unicode_combining_class, NULL, NULL);
|
||||
hb_unicode_funcs_set_general_category_func (funcs,
|
||||
hb_minigui_unicode_general_category, NULL, NULL);
|
||||
hb_unicode_funcs_set_mirroring_func (funcs,
|
||||
hb_minigui_unicode_mirroring, NULL, NULL);
|
||||
hb_unicode_funcs_set_script_func (funcs,
|
||||
hb_minigui_unicode_script, NULL, NULL);
|
||||
hb_unicode_funcs_set_compose_func (funcs,
|
||||
hb_minigui_unicode_compose, NULL, NULL);
|
||||
hb_unicode_funcs_set_decompose_func (funcs,
|
||||
hb_minigui_unicode_decompose, NULL, NULL);
|
||||
|
||||
hb_unicode_funcs_make_immutable (funcs);
|
||||
|
||||
return funcs;
|
||||
}
|
||||
|
||||
typedef hb_unicode_funcs_t *(*hb_get_unicode_funcs) (void);
|
||||
extern hb_get_unicode_funcs __hb_extern_get_unicode_funcs;
|
||||
|
||||
void __mg_init_harzbuff_funcs(void)
|
||||
{
|
||||
_DBG_PRINTF("%s: called\n", __FUNCTION__);
|
||||
__hb_extern_get_unicode_funcs = get_unicode_funcs;
|
||||
}
|
||||
|
||||
void __mg_term_harzbuff_funcs(void)
|
||||
{
|
||||
_DBG_PRINTF("%s: called\n", __FUNCTION__);
|
||||
|
||||
if (funcs) {
|
||||
hb_unicode_funcs_destroy(funcs);
|
||||
}
|
||||
else {
|
||||
_ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n",
|
||||
__FUNCTION__);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* defined(_MGCHARSET_UNICODE) && defined(_MGCOMPLEX_SCRIPTS) */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,85 @@
|
||||
/* == Start of generated table == */
|
||||
/*
|
||||
* The following table is generated by running:
|
||||
*
|
||||
* ./gen-ascii-bidi-tables.py
|
||||
*
|
||||
* on ucd/UnicodeData.txt files with these headers:
|
||||
*
|
||||
* UnicodeData.txt does not have a header.
|
||||
*/
|
||||
|
||||
#ifndef _MGFONT_ISO8859_BIDI_TABLES_H
|
||||
#define _MGFONT_ISO8859_BIDI_TABLES_H
|
||||
|
||||
static const BidiType __mg_iso8859_1_bidi_char_type_map[] =
|
||||
{
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_SS, BIDI_TYPE_BS, BIDI_TYPE_SS,
|
||||
BIDI_TYPE_WS, BIDI_TYPE_BS, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BS, BIDI_TYPE_BS, BIDI_TYPE_BS, BIDI_TYPE_SS,
|
||||
BIDI_TYPE_WS, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ET,
|
||||
BIDI_TYPE_ET, BIDI_TYPE_ET, BIDI_TYPE_ON, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ES,
|
||||
BIDI_TYPE_CS, BIDI_TYPE_ES, BIDI_TYPE_CS, BIDI_TYPE_CS,
|
||||
BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_EN,
|
||||
BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_EN,
|
||||
BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_CS, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BS, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
|
||||
BIDI_TYPE_CS, BIDI_TYPE_ON, BIDI_TYPE_ET, BIDI_TYPE_ET,
|
||||
BIDI_TYPE_ET, BIDI_TYPE_ET, BIDI_TYPE_ON, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_BN, BIDI_TYPE_ON, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ET, BIDI_TYPE_ET, BIDI_TYPE_EN, BIDI_TYPE_EN,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_ON, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_EN, BIDI_TYPE_LTR, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
|
||||
};
|
||||
|
||||
#endif /* !_MGFONT_ISO8859_BIDI_TABLES_H */
|
||||
|
||||
/* == End of generated table == */
|
||||
File diff suppressed because it is too large
Load Diff
+373
-314
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,185 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
/*
|
||||
** nullfont.c: The Null Font operation set.
|
||||
**
|
||||
** Created by WEI Yongming at 2019/03/27
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
|
||||
#include "devfont.h"
|
||||
#include "charset.h"
|
||||
#include "fontname.h"
|
||||
|
||||
#define NUF_WIDTH 8
|
||||
#define NUF_HEIGHT 1
|
||||
|
||||
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
|
||||
{
|
||||
return DEVFONTGLYPHTYPE_MONOBMP;
|
||||
}
|
||||
|
||||
static int get_max_width (LOGFONT* logfont, DEVFONT* devfont)
|
||||
{
|
||||
return NUF_WIDTH;
|
||||
}
|
||||
|
||||
static int get_ave_width (LOGFONT* logfont, DEVFONT* devfont)
|
||||
{
|
||||
return NUF_WIDTH;
|
||||
}
|
||||
|
||||
static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
|
||||
{
|
||||
return GET_DEVFONT_SCALE (logfont, devfont);
|
||||
}
|
||||
|
||||
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, expect);
|
||||
|
||||
return expect;
|
||||
}
|
||||
|
||||
static int get_font_ascent (LOGFONT* logfont, DEVFONT* devfont)
|
||||
{
|
||||
return GET_DEVFONT_SCALE (logfont, devfont);
|
||||
}
|
||||
|
||||
static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
Glyph32 glyph_value,
|
||||
int* px, int* py, int* pwidth, int* pheight)
|
||||
{
|
||||
int scale = GET_DEVFONT_SCALE (logfont, devfont);
|
||||
|
||||
if (pwidth)
|
||||
*pwidth = NUF_WIDTH;
|
||||
if (pheight)
|
||||
*pheight = NUF_HEIGHT;
|
||||
if (py)
|
||||
*py -= scale;
|
||||
|
||||
return NUF_WIDTH;
|
||||
}
|
||||
|
||||
static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
Glyph32 glyph_value, int* px, int* py)
|
||||
{
|
||||
if (px)
|
||||
*px += NUF_WIDTH;
|
||||
return NUF_WIDTH;
|
||||
}
|
||||
|
||||
static unsigned char null_bitmap = 0x18;
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
|
||||
{
|
||||
if (sz) {
|
||||
sz->cx = 8;
|
||||
sz->cy = 1;
|
||||
}
|
||||
|
||||
if (pitch)
|
||||
*pitch = 1;
|
||||
|
||||
if (scale)
|
||||
*scale = GET_DEVFONT_SCALE (logfont, devfont);
|
||||
|
||||
return &null_bitmap;
|
||||
}
|
||||
|
||||
static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 gv)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void* load_font_data (DEVFONT* devfont, const char* fontname,
|
||||
const char* filename)
|
||||
{
|
||||
return &null_bitmap;
|
||||
}
|
||||
|
||||
static void unload_font_data (DEVFONT* devfont, void* data)
|
||||
{
|
||||
if (data != &null_bitmap) {
|
||||
_WRN_PRINTF("data is not null_bitmap");
|
||||
}
|
||||
}
|
||||
|
||||
FONTOPS __mg_null_font_ops = {
|
||||
get_glyph_bmptype,
|
||||
get_ave_width,
|
||||
get_max_width,
|
||||
get_font_height,
|
||||
get_font_size,
|
||||
get_font_ascent,
|
||||
get_font_descent,
|
||||
|
||||
is_glyph_existed,
|
||||
get_glyph_advance,
|
||||
get_glyph_bbox,
|
||||
|
||||
get_glyph_monobitmap,
|
||||
NULL,
|
||||
NULL,
|
||||
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
is_rotatable,
|
||||
load_font_data,
|
||||
unload_font_data
|
||||
};
|
||||
|
||||
+669
-669
File diff suppressed because it is too large
Load Diff
+43
-36
File diff suppressed because it is too large
Load Diff
+17
-17
@@ -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,9 @@ 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 +190,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 +206,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 +222,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
|
||||
@@ -241,7 +240,8 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
{
|
||||
int advance = RBFONT_INFO_P (devfont)->width *
|
||||
GET_DEVFONT_SCALE (logfont, devfont);
|
||||
*px += advance;
|
||||
if (px)
|
||||
*px += advance;
|
||||
return advance;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,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,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+49
-40
File diff suppressed because it is too large
Load Diff
+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_FIELD + 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
+345
-341
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,92 @@
|
||||
/* The tables in this file should all be sorted on their first item. */
|
||||
|
||||
const PairMap mandatory_liga_table[] = {
|
||||
{{0xFEDF, 0xFE82}, 0xFEF5},
|
||||
{{0xFEDF, 0xFE84}, 0xFEF7},
|
||||
{{0xFEDF, 0xFE88}, 0xFEF9},
|
||||
{{0xFEDF, 0xFE8E}, 0xFEFB},
|
||||
{{0xFEE0, 0xFE82}, 0xFEF6},
|
||||
{{0xFEE0, 0xFE84}, 0xFEF8},
|
||||
{{0xFEE0, 0xFE88}, 0xFEFA},
|
||||
{{0xFEE0, 0xFE8E}, 0xFEFC},
|
||||
};
|
||||
|
||||
|
||||
const PairMap console_liga_table[] = {
|
||||
{{0x0640, 0xFC60}, 0xFCF2},
|
||||
{{0x0640, 0xFC61}, 0xFCF3},
|
||||
{{0x0640, 0xFC62}, 0xFCF4},
|
||||
{{0x0640, 0xFE70}, 0xFE71},
|
||||
{{0x0640, 0xFE76}, 0xFE77},
|
||||
{{0x0640, 0xFE78}, 0xFE79},
|
||||
{{0x0640, 0xFE7A}, 0xFE7B},
|
||||
{{0x0640, 0xFE7C}, 0xFE7D},
|
||||
{{0x0640, 0xFE7E}, 0xFE7F},
|
||||
{{0xFBE8, 0x0654}, 0xFE8B},
|
||||
{{0xFBE9, 0x0654}, 0xFE8C},
|
||||
{{0xFBFC, 0x0654}, 0xFE89},
|
||||
{{0xFBFC, 0x0670}, 0xFC5D},
|
||||
{{0xFBFD, 0x0654}, 0xFE8A},
|
||||
{{0xFBFD, 0x0670}, 0xFC90},
|
||||
{{0xFE7C, 0x0670}, 0xFC63},
|
||||
{{0xFE7C, 0xFE72}, 0xFC5E},
|
||||
{{0xFE7C, 0xFE74}, 0xFC5F},
|
||||
{{0xFE7C, 0xFE76}, 0xFC60},
|
||||
{{0xFE7C, 0xFE78}, 0xFC61},
|
||||
{{0xFE7C, 0xFE7A}, 0xFC62},
|
||||
{{0xFE7D, 0xFE76}, 0xFCF2},
|
||||
{{0xFE7D, 0xFE77}, 0xFCF2},
|
||||
{{0xFE7D, 0xFE78}, 0xFCF3},
|
||||
{{0xFE7D, 0xFE79}, 0xFCF3},
|
||||
{{0xFE7D, 0xFE7A}, 0xFCF4},
|
||||
{{0xFE7D, 0xFE7B}, 0xFCF4},
|
||||
{{0xFE8D, 0x0653}, 0xFE81},
|
||||
{{0xFE8D, 0x0654}, 0xFE83},
|
||||
{{0xFE8D, 0x0655}, 0xFE87},
|
||||
{{0xFE8D, 0xFE70}, 0xFD3D},
|
||||
{{0xFE8E, 0x0653}, 0xFE82},
|
||||
{{0xFE8E, 0x0654}, 0xFE84},
|
||||
{{0xFE8E, 0x0655}, 0xFE88},
|
||||
{{0xFE8E, 0xFE70}, 0xFD3C},
|
||||
{{0xFEE9, 0x0654}, 0xFBA4},
|
||||
{{0xFEEA, 0x0654}, 0xFBA5},
|
||||
{{0xFEED, 0x0654}, 0xFE85},
|
||||
{{0xFEEE, 0x0654}, 0xFE86},
|
||||
{{0xFEEF, 0x0654}, 0xFE89},
|
||||
{{0xFEEF, 0x0670}, 0xFC5D},
|
||||
{{0xFEF0, 0x0654}, 0xFE8A},
|
||||
{{0xFEF0, 0x0670}, 0xFC90},
|
||||
{{0xFEF1, 0x0654}, 0xFE89},
|
||||
{{0xFEF1, 0x0670}, 0xFC5D},
|
||||
{{0xFEF2, 0x0654}, 0xFE8A},
|
||||
{{0xFEF2, 0x0670}, 0xFC90},
|
||||
{{0xFEF3, 0x0654}, 0xFE8B},
|
||||
{{0xFEF4, 0x0654}, 0xFE8C},
|
||||
{{0xFEFB, 0x0653}, 0xFEF5},
|
||||
{{0xFEFB, 0x0654}, 0xFEF7},
|
||||
{{0xFEFB, 0x0655}, 0xFEF9},
|
||||
{{0xFEFC, 0x0653}, 0xFEF6},
|
||||
{{0xFEFC, 0x0654}, 0xFEF8},
|
||||
{{0xFEFC, 0x0655}, 0xFEFA},
|
||||
};
|
||||
|
||||
|
||||
static const Uchar32 NSMShap[][4] = {
|
||||
{0xFE70, 0xFE71, 0xFE70, 0xFE71,},
|
||||
{0xFE72, 0xFE72, 0xFE72, 0xFE72,},
|
||||
{0xFE74, 0xFE74, 0xFE74, 0xFE74,},
|
||||
{0xFE76, 0xFE77, 0xFE76, 0xFE77,},
|
||||
{0xFE78, 0xFE79, 0xFE78, 0xFE79,},
|
||||
{0xFE7A, 0xFE7B, 0xFE7A, 0xFE7B,},
|
||||
{0xFE7C, 0xFE7D, 0xFE7C, 0xFE7D,},
|
||||
{0xFE7E, 0xFE7F, 0xFE7E, 0xFE7F,},
|
||||
};
|
||||
|
||||
#ifndef UNIBIDI_ACCESS_SHAPE_TABLE
|
||||
# define UNIBIDI_ACCESS_SHAPE_TABLE(table,min,max,x,shape) \
|
||||
(((x)<(min)||(x)>(max))?(x):(table)[(x)-(min)][(shape)])
|
||||
#endif
|
||||
|
||||
#define UNIBIDI_GET_ARABIC_SHAPE_NSM(x,shape) \
|
||||
UNIBIDI_ACCESS_SHAPE_TABLE(NSMShap, 0x064B, 0x0652, (x), (shape))
|
||||
|
||||
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
+1696
-390
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* 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~2019, 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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
** mgbidi-bidi-types-list.inc:
|
||||
**
|
||||
** The list of BIDI types
|
||||
**
|
||||
** Created by WEI Yongming at 2019/03/08
|
||||
**
|
||||
** This implementation is based on LGPL'd FriBidi:
|
||||
**
|
||||
** https://github.com/fribidi/fribidi
|
||||
*/
|
||||
|
||||
#ifndef _UNIBIDI_ADD_TYPE
|
||||
# define _UNIBIDI_ADD_TYPE(x,y)
|
||||
#endif
|
||||
#ifndef _UNIBIDI_ADD_ALIAS
|
||||
# define _UNIBIDI_ADD_ALIAS(x1,x2)
|
||||
#endif
|
||||
|
||||
#if !defined(_UNIBIDI_PAR_TYPES) || defined(_UNIBIDI_ALL_TYPES)
|
||||
|
||||
_UNIBIDI_ADD_TYPE (LTR, 'L') /* Left-To-Right letter */
|
||||
_UNIBIDI_ADD_TYPE (RTL, 'R') /* Right-To-Left letter */
|
||||
_UNIBIDI_ADD_TYPE (AL, 'A') /* Arabic Letter */
|
||||
_UNIBIDI_ADD_TYPE (EN, '1') /* European Numeral */
|
||||
_UNIBIDI_ADD_TYPE (AN, '9') /* Arabic Numeral */
|
||||
_UNIBIDI_ADD_TYPE (ES, 'w') /* European number Separator */
|
||||
_UNIBIDI_ADD_TYPE (ET, 'w') /* European number Terminator */
|
||||
_UNIBIDI_ADD_TYPE (CS, 'w') /* Common Separator */
|
||||
_UNIBIDI_ADD_TYPE (NSM, '`') /* Non Spacing Mark */
|
||||
_UNIBIDI_ADD_TYPE (BN, 'b') /* Boundary Neutral */
|
||||
_UNIBIDI_ADD_TYPE (BS, 'B') /* Block Separator */
|
||||
_UNIBIDI_ADD_TYPE (SS, 'S') /* Segment Separator */
|
||||
_UNIBIDI_ADD_TYPE (WS, '_') /* WhiteSpace */
|
||||
_UNIBIDI_ADD_TYPE (ON, 'n') /* Other Neutral */
|
||||
_UNIBIDI_ADD_TYPE (LRE, '+') /* Left-to-Right Embedding */
|
||||
_UNIBIDI_ADD_TYPE (RLE, '+') /* Right-to-Left Embedding */
|
||||
_UNIBIDI_ADD_TYPE (LRO, '+') /* Left-to-Right Override */
|
||||
_UNIBIDI_ADD_TYPE (RLO, '+') /* Right-to-Left Override */
|
||||
_UNIBIDI_ADD_TYPE (PDF, '-') /* Pop Directional Flag */
|
||||
_UNIBIDI_ADD_TYPE (LRI, '+') /* Left-to-Right Isolate */
|
||||
_UNIBIDI_ADD_TYPE (RLI, '+') /* Right-to-Left Isolate */
|
||||
_UNIBIDI_ADD_TYPE (FSI, '+') /* First-Strong Isolate */
|
||||
_UNIBIDI_ADD_TYPE (PDI, '-') /* Pop Directional Isolate */
|
||||
|
||||
#if defined(_UNIBIDI_ADD_ALIAS)
|
||||
_UNIBIDI_ADD_ALIAS (L, LTR)
|
||||
_UNIBIDI_ADD_ALIAS (R, RTL)
|
||||
_UNIBIDI_ADD_ALIAS (B, BS)
|
||||
_UNIBIDI_ADD_ALIAS (S, SS)
|
||||
#endif /* _UNIBIDI_ADD_ALIAS */
|
||||
|
||||
#if defined(_UNIBIDI_SENTINEL_TYPE) || defined(_UNIBIDI_ALL_TYPES)
|
||||
_UNIBIDI_ADD_TYPE (SENTINEL, '$') /* SENTINEL */
|
||||
#endif /* _UNIBIDI_SENTINEL_TYPES || _UNIBIDI_ALL_TYPES*/
|
||||
#endif /* !_UNIBIDI_PAR_TYPES || _UNIBIDI_ALL_TYPES */
|
||||
|
||||
#if defined(_UNIBIDI_PAR_TYPES) || defined(_UNIBIDI_ALL_TYPES)
|
||||
# if !defined(_UNIBIDI_ALL_TYPES)
|
||||
_UNIBIDI_ADD_TYPE (LTR, 'L') /* Left-To-Right paragraph */
|
||||
_UNIBIDI_ADD_TYPE (RTL, 'R') /* Right-To-Left paragraph */
|
||||
_UNIBIDI_ADD_TYPE (ON, 'n') /* directiOn-Neutral paragraph */
|
||||
# endif /* !_UNIBIDI_ALL_TYPES */
|
||||
_UNIBIDI_ADD_TYPE (WLTR, 'l') /* Weak Left To Right paragraph */
|
||||
_UNIBIDI_ADD_TYPE (WRTL, 'r') /* Weak Right To Left paragraph */
|
||||
#endif /* _UNIBIDI_PAR_TYPES || _UNIBIDI_ALL_TYPES*/
|
||||
|
||||
#if defined(_UNIBIDI_ENUM_TYPES)
|
||||
typedef enum {
|
||||
# define _UNIBIDI_ADD_TYPE _UNIBIDI_ENUM_ADD_TYPE
|
||||
# include "mgbidi-bidi-types-list.h"
|
||||
# undef _UNIBIDI_ADD_TYPE
|
||||
_UNIBIDI_TYPES_MAX
|
||||
} _UNIBIDI_ENUM_TYPES
|
||||
#endif /* _UNIBIDI_ENUM_TYPES */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,197 @@
|
||||
/*
|
||||
* 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~2019, 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-bidi.h:
|
||||
**
|
||||
** A general implementation of UNICODE BIDIRECTIONAL ALGORITHM for MiniGUI
|
||||
**
|
||||
** https://www.unicode.org/reports/tr9/
|
||||
**
|
||||
** Created by WEI Yongming at 2019/03/08
|
||||
**
|
||||
** This implementation is based on LGPL'd FriBidi:
|
||||
**
|
||||
** https://github.com/fribidi/fribidi
|
||||
*/
|
||||
|
||||
#ifndef _MGFONT_UNICODE_BIDI_H
|
||||
#define _MGFONT_UNICODE_BIDI_H
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE_FULL
|
||||
#define UNIBIDI_UNICODE_CHARS 0x110000
|
||||
#else
|
||||
#define UNIBIDI_UNICODE_CHARS 0xFFFE
|
||||
#endif
|
||||
|
||||
/* Some special Unicode characters */
|
||||
|
||||
/* Bidirectional marks */
|
||||
#define BIDI_CHAR_LRM 0x200E
|
||||
#define BIDI_CHAR_RLM 0x200F
|
||||
#define BIDI_CHAR_LRE 0x202A
|
||||
#define BIDI_CHAR_RLE 0x202B
|
||||
#define BIDI_CHAR_PDF 0x202C
|
||||
#define BIDI_CHAR_LRO 0x202D
|
||||
#define BIDI_CHAR_RLO 0x202E
|
||||
#define BIDI_CHAR_LRI 0x2066
|
||||
#define BIDI_CHAR_RLI 0x2067
|
||||
#define BIDI_CHAR_FSI 0x2068
|
||||
#define BIDI_CHAR_PDI 0x2069
|
||||
|
||||
/* Line and Paragraph Separators */
|
||||
#define BIDI_CHAR_LS 0x2028
|
||||
#define BIDI_CHAR_PS 0x2029
|
||||
|
||||
/* Arabic Joining marks */
|
||||
#define BIDI_CHAR_ZWNJ 0x200C
|
||||
#define BIDI_CHAR_ZWJ 0x200D
|
||||
|
||||
/* Hebrew and Arabic */
|
||||
#define BIDI_CHAR_HEBREW_ALEF 0x05D0
|
||||
#define BIDI_CHAR_ARABIC_ALEF 0x0627
|
||||
#define BIDI_CHAR_ARABIC_ZERO 0x0660
|
||||
#define BIDI_CHAR_PERSIAN_ZERO 0x06F0
|
||||
|
||||
/* Misc */
|
||||
#define BIDI_CHAR_ZWNBSP 0xFEFF
|
||||
|
||||
/* Char we place for a deleted slot, to delete later */
|
||||
#define BIDI_CHAR_FILL BIDI_CHAR_ZWNBSP
|
||||
|
||||
/* some general macros */
|
||||
#define STRINGIZE(symbol) #symbol
|
||||
|
||||
/* A few macros for working with bits */
|
||||
#define BIDI_TEST_BITS(x, mask) (((x) & (mask)) ? 1 : 0)
|
||||
|
||||
#define BIDI_INCLUDE_BITS(x, mask) ((x) | (mask))
|
||||
|
||||
#define BIDI_EXCLUDE_BITS(x, mask) ((x) & ~(mask))
|
||||
|
||||
#define BIDI_SET_BITS(x, mask) ((x) |= (mask))
|
||||
|
||||
#define BIDI_UNSET_BITS(x, mask) ((x) &= ~(mask))
|
||||
|
||||
#define BIDI_ADJUST_BITS(x, mask, cond) \
|
||||
((x) = ((x) & ~(mask)) | ((cond) ? (mask) : 0))
|
||||
|
||||
#define BIDI_ADJUST_AND_TEST_BITS(x, mask, cond) \
|
||||
BIDI_TEST_BITS(BIDI_ADJUST_BITS((x), (mask), (cond)), (mask))
|
||||
|
||||
/* The maximum embedding level value assigned by explicit marks */
|
||||
#define BIDI_MAX_EXPLICIT_LEVEL 125
|
||||
|
||||
/* The maximum *number* of different resolved embedding levels: 0-126 */
|
||||
#define BIDI_MAX_RESOLVED_LEVELS 127
|
||||
|
||||
/* The maximum *number* of nested brackets: 0-63 */
|
||||
#define BIDI_MAX_NESTED_BRACKET_PAIRS 63
|
||||
|
||||
#define BIDI_SENTINEL -1
|
||||
|
||||
enum _BidiJoiningTypeEnum {
|
||||
# define _UNIBIDI_ADD_TYPE(TYPE,SYMBOL) \
|
||||
BIDI_JOINING_TYPE_##TYPE = BIDI_JOINING_TYPE_##TYPE##_VAL,
|
||||
# include "unicode-joining-types-list.inc"
|
||||
# undef _UNIBIDI_ADD_TYPE
|
||||
_UNIBIDI_JOINING_TYPE_JUNK /* Don't use this */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct _BidiRun BidiRun;
|
||||
|
||||
struct _BidiRun {
|
||||
BidiRun *prev;
|
||||
BidiRun *next;
|
||||
|
||||
/* Additional links for connecting the isolate tree */
|
||||
BidiRun *prev_isolate;
|
||||
BidiRun *next_isolate;
|
||||
|
||||
int pos, len;
|
||||
BidiBracketType bracket_type;
|
||||
BidiType type;
|
||||
BidiLevel level;
|
||||
BidiLevel isolate_level;
|
||||
};
|
||||
|
||||
#define swap(a,b) \
|
||||
do { \
|
||||
void *t; \
|
||||
(t) = (a); \
|
||||
(a) = (b); \
|
||||
(b) = (t); \
|
||||
} while(0)
|
||||
|
||||
#define merge_lists(a,b) \
|
||||
do { \
|
||||
swap((a)->prev->next, (b)->prev->next); \
|
||||
swap((a)->prev, (b)->prev); \
|
||||
} while(0)
|
||||
|
||||
#define delete_node(x) \
|
||||
do { \
|
||||
(x)->prev->next = (x)->next; \
|
||||
(x)->next->prev = (x)->prev; \
|
||||
} while(0)
|
||||
|
||||
#define insert_node_before(x, list) \
|
||||
do { \
|
||||
(x)->prev = (list)->prev; \
|
||||
(list)->prev->next = (x); \
|
||||
(x)->next = (list); \
|
||||
(list)->prev = (x); \
|
||||
} while(0)
|
||||
|
||||
#define move_node_before(x, list) \
|
||||
do { \
|
||||
if ((x)->prev) { \
|
||||
delete_node(x); \
|
||||
} \
|
||||
insert_node_before((x), (list)); \
|
||||
} while(0)
|
||||
|
||||
#define for_run_list(x, list) \
|
||||
for ((x) = (list)->next; (x)->type != BIDI_TYPE_SENTINEL; (x) = (x)->next)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* !_MGFONT_UNICODE_BIDI_H */
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* 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-break-arabic.c:
|
||||
** The implementation to tailor Arabic breaks
|
||||
**
|
||||
** Created by WEI Yongming at 2019/03/27
|
||||
**
|
||||
** This implementation is derived from LGPL'd Pango.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
#include "unicode-ops.h"
|
||||
|
||||
#define ALEF_WITH_MADDA_ABOVE 0x0622
|
||||
#define YEH_WITH_HAMZA_ABOVE 0x0626
|
||||
#define ALEF 0x0627
|
||||
#define WAW 0x0648
|
||||
#define YEH 0x064A
|
||||
|
||||
#define MADDAH_ABOVE 0x0653
|
||||
#define HAMZA_ABOVE 0x0654
|
||||
#define HAMZA_BELOW 0x0655
|
||||
|
||||
/*
|
||||
* Arabic characters with canonical decompositions that are not just
|
||||
* ligatures. The characters U+06C0, U+06C2, and U+06D3 are intentionally
|
||||
* excluded as they are marked as "not an independent letter" in Unicode
|
||||
* Character Database's NamesList.txt
|
||||
*/
|
||||
#define IS_COMPOSITE(c) (ALEF_WITH_MADDA_ABOVE <= (c) && (c) <= YEH_WITH_HAMZA_ABOVE)
|
||||
|
||||
/* If a character is the second part of a composite Arabic character with an Alef */
|
||||
#define IS_COMPOSITE_WITH_ALEF(c) (MADDAH_ABOVE <= (c) && (c) <= HAMZA_BELOW)
|
||||
|
||||
void __mg_unicode_break_arabic(const Uchar32* ucs, int nr_ucs,
|
||||
BreakOppo* break_oppos)
|
||||
{
|
||||
int i;
|
||||
Uchar32 prev_wc, this_wc;
|
||||
|
||||
for (i = 0, prev_wc = 0; i < nr_ucs; i++, prev_wc = this_wc) {
|
||||
this_wc = ucs[i];
|
||||
|
||||
/*
|
||||
* Unset backspace_deletes_character for various combinations.
|
||||
*
|
||||
* A few more combinations may need to be handled here, but are not
|
||||
* handled yet, as expectations of users is not known or may differ
|
||||
* among different languages or users:
|
||||
* some letters combined with U+0658 ARABIC MARK NOON GHUNNA;
|
||||
* combinations considered one letter in Azerbaijani (WAW+SUKUN and
|
||||
* FARSI_YEH+HAMZA_ABOVE); combinations of YEH and ALEF_MAKSURA with
|
||||
* HAMZA_BELOW (Qur'anic); TATWEEL+HAMZA_ABOVE (Qur'anic).
|
||||
*
|
||||
* FIXME: Ordering these in some other way may lower the time spent here, or not.
|
||||
*/
|
||||
if (IS_COMPOSITE (this_wc) ||
|
||||
(prev_wc == ALEF && IS_COMPOSITE_WITH_ALEF (this_wc)) ||
|
||||
(this_wc == HAMZA_ABOVE && (prev_wc == WAW || prev_wc == YEH)))
|
||||
break_oppos[i + 1] &= ~BOV_GB_BACKSPACE_DEL_CH;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _MGCHARSET_UNICODE */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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-break-thai.c:
|
||||
** The implementation to tailor Thai breaks
|
||||
**
|
||||
** Created by WEI Yongming at 2019/03/27
|
||||
**
|
||||
** This implementation is derived from LGPL'd Pango.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
#include "unicode-ops.h"
|
||||
|
||||
void __mg_unicode_break_thai(const Uchar32* ucs, int nr_ucs,
|
||||
BreakOppo* break_oppos)
|
||||
{
|
||||
_WRN_PRINTF("NOT IMPLEMENTED");
|
||||
}
|
||||
|
||||
#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
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,57 @@
|
||||
/*
|
||||
* 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~2019, 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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
** mgbidi-joining-types-list.h:
|
||||
**
|
||||
** The list of joining types
|
||||
**
|
||||
** Created by WEI Yongming at 2019/03/08
|
||||
**
|
||||
** This implementation is based on LGPL'd FriBidi:
|
||||
**
|
||||
** https://github.com/fribidi/fribidi
|
||||
*/
|
||||
|
||||
#ifndef _UNIBIDI_ADD_TYPE
|
||||
# define _UNIBIDI_ADD_TYPE(x,y)
|
||||
#endif
|
||||
|
||||
_UNIBIDI_ADD_TYPE (U, '|') /* nUn-joining, e.g. Full Stop */
|
||||
_UNIBIDI_ADD_TYPE (R, '<') /* Right-joining, e.g. Arabic Letter Dal */
|
||||
_UNIBIDI_ADD_TYPE (D, '+') /* Dual-joining, e.g. Arabic Letter Ain */
|
||||
_UNIBIDI_ADD_TYPE (C, '-') /* join-Causing, e.g. Tatweel, ZWJ */
|
||||
_UNIBIDI_ADD_TYPE (T, '^') /* Transparent, e.g. Arabic Fatha */
|
||||
_UNIBIDI_ADD_TYPE (L, '>') /* Left-joining, i.e. fictional */
|
||||
_UNIBIDI_ADD_TYPE (G, '~') /* iGnored, e.g. LRE, RLE, ZWNBSP */
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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-joining-types.c: character joining types
|
||||
**
|
||||
** Created by WEI Yongming at 2019/03/11
|
||||
**
|
||||
** This implementation is based on LGPL'd FriBidi:
|
||||
**
|
||||
** https://github.com/fribidi/fribidi
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
|
||||
#include "unicode-bidi.h"
|
||||
|
||||
enum _BidiJoiningTypeShortEnum {
|
||||
#define _UNIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE = BIDI_JOINING_TYPE_##TYPE,
|
||||
#include "unicode-joining-types-list.inc"
|
||||
#undef _UNIBIDI_ADD_TYPE
|
||||
_UNIBIDI_NUM_TYPES
|
||||
};
|
||||
|
||||
#include "unicode-joining-type-table.inc"
|
||||
|
||||
BidiJoiningType GUIAPI UCharGetJoiningType(Uchar32 ch)
|
||||
{
|
||||
return UNIBIDI_GET_JOINING_TYPE (ch);
|
||||
}
|
||||
|
||||
void GUIAPI UStrGetJoiningTypes (const Uchar32 *ucs, int len,
|
||||
BidiJoiningType *joining_types)
|
||||
{
|
||||
register int i = len;
|
||||
for (; i; i--) {
|
||||
*joining_types++ = UNIBIDI_GET_JOINING_TYPE (*ucs);
|
||||
ucs++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _MGCHARSET_UNICODE */
|
||||
@@ -0,0 +1,196 @@
|
||||
/*
|
||||
* 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-joining.c:
|
||||
** The implementation of Arabic joining algorithm
|
||||
**
|
||||
** Created by WEI Yongming at 2019/03/11
|
||||
**
|
||||
** This implementation is based on LGPL'd FriBidi:
|
||||
**
|
||||
** https://github.com/fribidi/fribidi
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
|
||||
#include "unicode-bidi.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
/*======================================================================
|
||||
* For debugging, define some functions for printing joining types and
|
||||
* properties.
|
||||
*----------------------------------------------------------------------*/
|
||||
|
||||
static char get_char_from_joining_type(BidiJoiningType j, BOOL visual)
|
||||
{
|
||||
/* switch left and right if on visual run */
|
||||
if (visual & ((BIDI_JOINS_RIGHT (j) && !BIDI_JOINS_LEFT (j)) |
|
||||
(!BIDI_JOINS_RIGHT (j) && BIDI_JOINS_LEFT (j))))
|
||||
j ^= BIDI_MASK_JOINS_RIGHT | BIDI_MASK_JOINS_LEFT;
|
||||
|
||||
#define _UNIBIDI_ADD_TYPE(TYPE,SYMBOL) \
|
||||
if (BIDI_IS_JOINING_TYPE_##TYPE(j)) return SYMBOL;
|
||||
#include "unicode-joining-types-list.inc"
|
||||
#undef _UNIBIDI_ADD_TYPE
|
||||
|
||||
return '?';
|
||||
}
|
||||
|
||||
static void print_joining_types(const BidiLevel *embedding_levels,
|
||||
int len, const BidiJoiningType *jtypes)
|
||||
{
|
||||
register int i;
|
||||
|
||||
_DBG_PRINTF (" Join. types: ");
|
||||
for (i = 0; i < len; i++)
|
||||
_DBG_PRINTF ("%c", get_char_from_joining_type (jtypes[i],
|
||||
!BIDI_LEVEL_IS_RTL(embedding_levels[i])));
|
||||
_DBG_PRINTF ("\n");
|
||||
}
|
||||
|
||||
#endif /* _DEBUG */
|
||||
|
||||
#define UNIBIDI_CONSISTENT_LEVEL(i) \
|
||||
(BIDI_IS_EXPLICIT_OR_BN (bidi_types[(i)]) \
|
||||
? BIDI_SENTINEL \
|
||||
: embedding_levels[(i)])
|
||||
|
||||
#define BIDI_LEVELS_MATCH(i, j) \
|
||||
((i) == (j) || (i) == BIDI_SENTINEL || (j) == BIDI_SENTINEL)
|
||||
|
||||
void GUIAPI UBidiJoinArabic(const BidiType *bidi_types,
|
||||
const BidiLevel *embedding_levels, int len,
|
||||
BidiArabicProp *ar_props)
|
||||
{
|
||||
if (len == 0) return;
|
||||
|
||||
#ifdef _DEBUG
|
||||
print_joining_types (embedding_levels, len, ar_props);
|
||||
#endif /* _DEBUG */
|
||||
|
||||
/* The joining algorithm turned out very very dirty :(. That's what happens
|
||||
* when you follow the standard which has never been implemented closely
|
||||
* before.
|
||||
*/
|
||||
|
||||
/* 8.2 Arabic - Cursive Joining */
|
||||
_DBG_PRINTF ("Arabic cursive joining");
|
||||
{
|
||||
/* The following do not need to be initialized as long as joins is
|
||||
* initialized to FALSE. We just do to turn off compiler warnings. */
|
||||
register int saved = 0;
|
||||
register BidiLevel saved_level = BIDI_SENTINEL;
|
||||
register BOOL saved_shapes = FALSE;
|
||||
register BidiArabicProp saved_joins_following_mask = 0;
|
||||
|
||||
register BOOL joins = FALSE;
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
if (!BIDI_IS_JOINING_TYPE_G (ar_props[i]))
|
||||
{
|
||||
register BOOL disjoin = FALSE;
|
||||
register BOOL shapes = BIDI_ARAB_SHAPES (ar_props[i]);
|
||||
register BidiLevel level = UNIBIDI_CONSISTENT_LEVEL (i);
|
||||
|
||||
if (joins && !BIDI_LEVELS_MATCH (saved_level, level))
|
||||
{
|
||||
disjoin = TRUE;
|
||||
joins = FALSE;
|
||||
}
|
||||
|
||||
if (!BIDI_IS_JOIN_SKIPPED (ar_props[i]))
|
||||
{
|
||||
register const BidiArabicProp joins_preceding_mask =
|
||||
BIDI_JOINS_PRECEDING_MASK (level);
|
||||
|
||||
if (!joins)
|
||||
{
|
||||
if (shapes)
|
||||
BIDI_UNSET_BITS (ar_props[i], joins_preceding_mask);
|
||||
}
|
||||
else if (!BIDI_TEST_BITS (ar_props[i], joins_preceding_mask))
|
||||
{
|
||||
disjoin = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
register int j;
|
||||
/* This is a FriBidi extension: we set joining properties
|
||||
* for skipped characters in between, so we can put NSMs on tatweel
|
||||
* later if we want. Useful on console for example.
|
||||
*/
|
||||
for (j = saved + 1; j < i; j++)
|
||||
BIDI_SET_BITS (ar_props[j], joins_preceding_mask | saved_joins_following_mask);
|
||||
}
|
||||
}
|
||||
|
||||
if (disjoin && saved_shapes)
|
||||
BIDI_UNSET_BITS (ar_props[saved], saved_joins_following_mask);
|
||||
|
||||
if (!BIDI_IS_JOIN_SKIPPED (ar_props[i]))
|
||||
{
|
||||
saved = i;
|
||||
saved_level = level;
|
||||
saved_shapes = shapes;
|
||||
saved_joins_following_mask =
|
||||
BIDI_JOINS_FOLLOWING_MASK (level);
|
||||
joins =
|
||||
BIDI_TEST_BITS (ar_props[i], saved_joins_following_mask);
|
||||
}
|
||||
}
|
||||
if ((joins) && saved_shapes)
|
||||
BIDI_UNSET_BITS (ar_props[saved], saved_joins_following_mask);
|
||||
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
print_joining_types (embedding_levels, len, ar_props);
|
||||
#endif /* _DEBUG */
|
||||
}
|
||||
|
||||
#endif /* _MGCHARSET_UNICODE */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
* 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-shape-arabic.c:
|
||||
** The implementation of Arabic joining algorithm
|
||||
**
|
||||
** Created by WEI Yongming at 2019/03/11
|
||||
**
|
||||
** This implementation is based on LGPL'd FriBidi:
|
||||
**
|
||||
** https://github.com/fribidi/fribidi
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
|
||||
#include "unicode-bidi.h"
|
||||
|
||||
typedef struct _PairMap {
|
||||
Uchar32 pair[2], to;
|
||||
} PairMap;
|
||||
|
||||
#define UNIBIDI_ACCESS_SHAPE_TABLE(table,min,max,x,shape) (table), (min), (max)
|
||||
# define UNIBIDI_ACCESS_SHAPE_TABLE_REAL(table,min,max,x,shape) \
|
||||
(((x)<(min)||(x)>(max))?(x):(table)[(x)-(min)][(shape)])
|
||||
|
||||
#include "unicode-arabic-shaping-table.inc"
|
||||
#include "unicode-arabic-misc-table.inc"
|
||||
|
||||
static void unibidi_shape_arabic_joining (const Uchar32 table[][4],
|
||||
Uchar32 min, Uchar32 max, const int len,
|
||||
const BidiArabicProp *ar_props,
|
||||
Uchar32 *str)
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
if (BIDI_ARAB_SHAPES(ar_props[i]))
|
||||
str[i] = UNIBIDI_ACCESS_SHAPE_TABLE_REAL(table, min, max, str[i],
|
||||
BIDI_JOIN_SHAPE (ar_props[i]));
|
||||
}
|
||||
}
|
||||
|
||||
static int comp_PairMap (const void *pa, const void *pb)
|
||||
{
|
||||
PairMap *a = (PairMap *)pa;
|
||||
PairMap *b = (PairMap *)pb;
|
||||
|
||||
if (a->pair[0] != b->pair[0])
|
||||
return a->pair[0] < b->pair[0] ? -1 : +1;
|
||||
else
|
||||
return a->pair[1] < b->pair[1] ? -1 :
|
||||
a->pair[1] > b->pair[1] ? +1 : 0;
|
||||
}
|
||||
|
||||
|
||||
static Uchar32 find_pair_match (const PairMap *table, int size,
|
||||
Uchar32 first, Uchar32 second)
|
||||
{
|
||||
PairMap *match;
|
||||
PairMap x;
|
||||
x.pair[0] = first;
|
||||
x.pair[1] = second;
|
||||
x.to = 0;
|
||||
match = bsearch (&x, table, size, sizeof (table[0]), comp_PairMap);
|
||||
return match ? match->to : 0;
|
||||
}
|
||||
|
||||
#define PAIR_MATCH(table,len,first,second) \
|
||||
((first)<(table[0].pair[0])||(first)>(table[len-1].pair[0])?0: \
|
||||
find_pair_match(table, len, first, second))
|
||||
|
||||
static void unibidi_shape_arabic_ligature(const PairMap *table,
|
||||
int size, const BidiLevel *embedding_levels, int len,
|
||||
BidiArabicProp *ar_props, Uchar32 *str)
|
||||
{
|
||||
/* TODO: This doesn't form ligatures for even-level Arabic text.
|
||||
* no big problem though. */
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < len - 1; i++) {
|
||||
register Uchar32 c;
|
||||
if (BIDI_LEVEL_IS_RTL(embedding_levels[i]) &&
|
||||
embedding_levels[i] == embedding_levels[i+1] &&
|
||||
(c = PAIR_MATCH(table, size, str[i], str[i+1])))
|
||||
{
|
||||
str[i] = BIDI_CHAR_FILL;
|
||||
BIDI_SET_BITS(ar_props[i], BIDI_MASK_LIGATURED);
|
||||
str[i+1] = c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define DO_LIGATURING(table, levels, len, ar_props, str) \
|
||||
unibidi_shape_arabic_ligature ((table), \
|
||||
sizeof(table)/sizeof((table)[0]), levels, len, ar_props, str)
|
||||
|
||||
#define DO_SHAPING(tablemacro, len, ar_props, str) \
|
||||
unibidi_shape_arabic_joining (tablemacro(,), len, ar_props, str)
|
||||
|
||||
void UBidiShapeArabic(Uint32 flags, const BidiLevel *embedding_levels, int len,
|
||||
BidiArabicProp *ar_props, Uchar32 *str)
|
||||
{
|
||||
if (len == 0 || !str) return;
|
||||
|
||||
if (BIDI_TEST_BITS (flags, BIDI_FLAG_SHAPE_ARAB_PRES)) {
|
||||
DO_SHAPING (UNIBIDI_GET_ARABIC_SHAPE_PRES, len, ar_props, str);
|
||||
}
|
||||
|
||||
if (BIDI_TEST_BITS (flags, BIDI_FLAG_SHAPE_ARAB_LIGA)) {
|
||||
DO_LIGATURING (mandatory_liga_table, embedding_levels, len,
|
||||
ar_props, str);
|
||||
}
|
||||
|
||||
if (BIDI_TEST_BITS (flags, BIDI_FLAG_SHAPE_ARAB_CONSOLE)) {
|
||||
DO_LIGATURING (console_liga_table, embedding_levels, len,
|
||||
ar_props, str);
|
||||
DO_SHAPING (UNIBIDI_GET_ARABIC_SHAPE_NSM, len, ar_props, str);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _MGCHARSET_UNICODE */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* 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-shape.c:
|
||||
** The implementation of Arabic joining algorithm
|
||||
**
|
||||
** Created by WEI Yongming at 2019/03/11
|
||||
**
|
||||
** This implementation is based on LGPL'd FriBidi:
|
||||
**
|
||||
** https://github.com/fribidi/fribidi
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
|
||||
#include "unicode-bidi.h"
|
||||
|
||||
void GUIAPI UBidiShapeMirroring(const BidiLevel *embedding_levels, int len,
|
||||
Uchar32* str)
|
||||
{
|
||||
register int i;
|
||||
|
||||
if (len == 0 || !str) return;
|
||||
|
||||
/* L4. Mirror all characters that are in odd levels and have mirrors. */
|
||||
for (i = len - 1; i >= 0; i--) {
|
||||
if (BIDI_LEVEL_IS_RTL(embedding_levels[i])) {
|
||||
Uchar32 mirrored_ch;
|
||||
|
||||
if (UCharGetMirror(str[i], &mirrored_ch)) {
|
||||
str[i] = mirrored_ch;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GUIAPI UBidiShape(Uint32 flags,
|
||||
const BidiLevel *embedding_levels, int len,
|
||||
BidiArabicProp *ar_props, Uchar32 *str)
|
||||
{
|
||||
if (len == 0 || !str)
|
||||
return;
|
||||
|
||||
if (ar_props)
|
||||
UBidiShapeArabic(flags, embedding_levels, len, ar_props, str);
|
||||
|
||||
if (BIDI_TEST_BITS (flags, BIDI_FLAG_SHAPE_MIRRORING))
|
||||
UBidiShapeMirroring (embedding_levels, len, str);
|
||||
}
|
||||
|
||||
#endif /* _MGCHARSET_UNICODE */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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~2019, 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-vop.c: The implementation of UCharGetVerticalOrientation
|
||||
**
|
||||
** Reference:
|
||||
**
|
||||
** https://www.unicode.org/reports/tr50/
|
||||
**
|
||||
** Create by WEI Yongming at 2019/03/18
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "minigui.h"
|
||||
#include "gdi.h"
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
#define U UCHAR_VOP_U
|
||||
#define R UCHAR_VOP_R
|
||||
#define Tu UCHAR_VOP_TU
|
||||
#define Tr UCHAR_VOP_TR
|
||||
|
||||
#include "unicode-vop-table.inc"
|
||||
|
||||
UVerticalOrient GUIAPI UCharGetVerticalOrientation(Uchar32 uc)
|
||||
{
|
||||
return UCHAR_GET_VOP(uc);
|
||||
}
|
||||
|
||||
#undef U
|
||||
#undef R
|
||||
#undef Tu
|
||||
#undef Tr
|
||||
|
||||
#endif /* _MGCHARSET_UNICODE */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user