mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-28 16:17:09 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8538f29f70 | ||
|
|
b658413961 | ||
|
|
bb187f1ee3 | ||
|
|
ea8ab93bad | ||
|
|
9226fcff26 | ||
|
|
05cf370155 | ||
|
|
0d2352884a |
+74
-1
@@ -1,12 +1,85 @@
|
||||
# Release Notes
|
||||
|
||||
## Version 3.4.0
|
||||
|
||||
The MiniGUI development team announces the availability of MiniGUI 3.4.0.
|
||||
All users of MiniGUI are recommended strongly to use this version.
|
||||
Please report any bugs and incompatibilities in
|
||||
|
||||
https://github.com/VincentWei/minigui
|
||||
|
||||
### What's new in this version
|
||||
|
||||
#### Tunning the logical font APIs
|
||||
|
||||
The styles of LOGFONT changed.
|
||||
|
||||
* Add new rendering style:
|
||||
1. `FS_RENDER_ANY`: Not specified
|
||||
1. `FS_RENDER_MONO`:
|
||||
1. `FS_RENDER_OUTLINE`:
|
||||
1. `FS_RENDER_GREY`:
|
||||
1. `FS_RENDER_SUBPIXEL`:
|
||||
* Remove some bad style definitions:
|
||||
1. `FS_WEIGHT_BOOK`, use `FS_RENDER_GREY` instead.
|
||||
1. `FS_WEIGHT_LIGHT`, use `FS_RENDER_OUTLINE` instead.
|
||||
* Introduced the new weight styles:
|
||||
1. `FONT_WEIGHT_ANY`: Not specified
|
||||
1. `FONT_WEIGHT_THIN`:
|
||||
1. `FONT_WEIGHT_EXTRA_LIGHT`:
|
||||
1. `FONT_WEIGHT_LIGHT`:
|
||||
1. `FONT_WEIGHT_REGULAR`:
|
||||
1. `FONT_WEIGHT_MEDIUM`:
|
||||
1. `FONT_WEIGHT_DEMIBOLD`:
|
||||
1. `FONT_WEIGHT_BOLD`:
|
||||
1. `FONT_WEIGHT_EXTRA_BOLD`:
|
||||
1. `FONT_WEIGHT_BLACK`:
|
||||
* Introduce the new decoration styles and replace
|
||||
`FONT_UNDERLINE_LINE` and `FONT_STRUCKOUT_LINE` with them:
|
||||
1. `FONT_DECORATE_ANY`:
|
||||
1. `FONT_DECORATE_NONE`:
|
||||
1. `FONT_DECORATE_UNDERLINE`:
|
||||
1. `FONT_DECORATE_STRUCKOUT`:
|
||||
1. `FONT_DECORATE_BOTH`:
|
||||
|
||||
For the back-compatibility, you can still use `CreateLogFont` to
|
||||
create a new LOGFONT. However, the `FS_WEIGHT_BOOK` and `FS_WEIGHT_LIGHT`
|
||||
will be ignored, and the rendering type will be set as `FS_RENDER_ANY`.
|
||||
|
||||
For new app, you should use the new function `CreateLogFontEx` to
|
||||
create a LOGFONT.
|
||||
|
||||
You can still use `CreateLogFontByName` to create a new LOGFONT.
|
||||
But the style string in the font name changed from
|
||||
|
||||
<weight><slant><flipping><other><underline><struckout>
|
||||
|
||||
to
|
||||
|
||||
<weight><slant><flipping><other><decoration><rendering>
|
||||
|
||||
Obviously, `<underline>` and `<struckout>` are merged to `<decoration>`
|
||||
in order to keep the style string is still 6-character long.
|
||||
|
||||
Now, if you want to use the rendering style SUPIXEL for a TTF font,
|
||||
please define the font name in the following way:
|
||||
|
||||
ttf-Courier-rrncns-*-16-UTF-8
|
||||
|
||||
#### Changes of font rendering manners
|
||||
|
||||
|
||||
#### Others
|
||||
|
||||
* Support for FreeType1 removed.
|
||||
|
||||
## Version 3.2.1
|
||||
|
||||
The MiniGUI development team announces the availability of MiniGUI 3.2.1.
|
||||
All users of MiniGUI are recommended strongly to use this version.
|
||||
Please report any bugs and incompatibilities in
|
||||
|
||||
https://github.com/VincentWei/minigui.
|
||||
https://github.com/VincentWei/minigui
|
||||
|
||||
### What's new in this version
|
||||
|
||||
|
||||
+13
-10
@@ -1,6 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ(2.60)
|
||||
AC_INIT(libminigui, 3.2.0)
|
||||
AC_INIT(libminigui, 3.4.0)
|
||||
AC_CONFIG_SRCDIR(src/main/main.c)
|
||||
|
||||
dnl Set various version strings - taken gratefully from the SDL sources
|
||||
@@ -15,10 +15,10 @@ dnl Set various version strings - taken gratefully from the SDL sources
|
||||
# set MINIGUI_BINARY_AGE and MINIGUI_INTERFACE_AGE to 0.
|
||||
#
|
||||
MINIGUI_MAJOR_VERSION=3
|
||||
MINIGUI_MINOR_VERSION=2
|
||||
MINIGUI_MICRO_VERSION=1
|
||||
MINIGUI_MINOR_VERSION=4
|
||||
MINIGUI_MICRO_VERSION=0
|
||||
MINIGUI_INTERFACE_AGE=0
|
||||
MINIGUI_BINARY_AGE=1
|
||||
MINIGUI_BINARY_AGE=0
|
||||
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
||||
|
||||
AC_SUBST(MINIGUI_MAJOR_VERSION)
|
||||
@@ -537,7 +537,7 @@ AC_ARG_ENABLE(sefsupport,
|
||||
build_sef_support=$enableval)
|
||||
|
||||
AC_ARG_WITH(ttfsupport,
|
||||
[ --with-ttfsupport=ft1/ft2/none How to support TrueType font (FreeType 1/FreeType 2/None) <default=none>],
|
||||
[ --with-ttfsupport=ft2/none How to support TrueType font (FreeType 2 or None) <default=ft2>],
|
||||
use_ttf_lib=$withval)
|
||||
|
||||
AC_ARG_ENABLE(ttfcache,
|
||||
@@ -1978,17 +1978,20 @@ fi
|
||||
|
||||
dnl Check FreeType lib
|
||||
case "$use_ttf_lib" in
|
||||
ft2)
|
||||
dnl Check for FreeType2 library
|
||||
AC_CHECK_LIB(freetype, FT_Library_Version,
|
||||
DEP_LIBS="$DEP_LIBS -lfreetype",
|
||||
use_ttf_lib="none")
|
||||
;;
|
||||
ft1)
|
||||
dnl Check for FreeType1 library
|
||||
AC_CHECK_LIB(ttf, TT_FreeType_Version,
|
||||
DEP_LIBS="$DEP_LIBS -lttf",
|
||||
use_ttf_lib="none")
|
||||
;;
|
||||
ft2)
|
||||
dnl Check for FreeType2 library
|
||||
AC_CHECK_LIB(freetype, FT_Library_Version,
|
||||
DEP_LIBS="$DEP_LIBS -lfreetype",
|
||||
use_ttf_lib="none")
|
||||
*)
|
||||
use_ttf_lib="none"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
+12
-12
@@ -1,14 +1,14 @@
|
||||
static LOGFONT *logfont, *logfontgb12, *logfontbig24;
|
||||
|
||||
logfont = CreateLogFont (NULL, "SansSerif", "ISO8859-1",
|
||||
FONT_WEIGHT_REGULAR, FONT_SLANT_ITALIC, FONT_SETWIDTH_NORMAL,
|
||||
FONT_SPACING_CHARCELL, FONT_UNDERLINE_NONE, FONT_STRUCKOUT_LINE,
|
||||
16, 0);
|
||||
logfontgb12 = CreateLogFont (NULL, "song", "GB2312",
|
||||
FONT_WEIGHT_REGULAR, FONT_SLANT_ROMAN, FONT_SETWIDTH_NORMAL,
|
||||
FONT_SPACING_CHARCELL, FONT_UNDERLINE_LINE, FONT_STRUCKOUT_LINE,
|
||||
12, 0);
|
||||
logfontbig24 = CreateLogFont (NULL, "ming", "BIG5",
|
||||
FONT_WEIGHT_REGULAR, FONT_SLANT_ROMAN, FONT_SETWIDTH_NORMAL,
|
||||
FONT_SPACING_CHARCELL, FONT_UNDERLINE_LINE, FONT_STRUCKOUT_NONE,
|
||||
24, 0);
|
||||
logfont = CreateLogFont (NULL, "SansSerif", "ISO8859-1",
|
||||
FONT_WEIGHT_REGULAR, FONT_SLANT_ITALIC, FONT_FLIP_NONE,
|
||||
FONT_OTHER_NIL, FONT_UNDERLINE_NONE, FONT_STRUCKOUT_LINE,
|
||||
16, 0);
|
||||
logfontgb12 = CreateLogFont (NULL, "song", "GB2312",
|
||||
FONT_WEIGHT_REGULAR, FONT_SLANT_ROMAN, FONT_FLIP_NONE,
|
||||
FONT_OTHER_NIL, FONT_UNDERLINE_LINE, FONT_STRUCKOUT_LINE,
|
||||
12, 0);
|
||||
logfontbig24 = CreateLogFont (NULL, "ming", "BIG5",
|
||||
FONT_WEIGHT_REGULAR, FONT_SLANT_ROMAN, FONT_FLIP_NONE,
|
||||
FONT_OTHER_NIL, FONT_UNDERLINE_LINE, FONT_STRUCKOUT_NONE,
|
||||
24, 0);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
static LOGFONT *logfont, *logfontgb12, *logfontttf;
|
||||
|
||||
logfont = CreateLogFontEx (NULL, "SansSerif", "ISO8859-1",
|
||||
FONT_WEIGHT_REGULAR, FONT_SLANT_ITALIC, FONT_FLIP_NONE,
|
||||
FONT_OTHER_NIL, FONT_DECORATE_NONE, FONT_RENDER_MONO,
|
||||
16, 0);
|
||||
logfontgb12 = CreateLogFontEx (NULL, "song", "GB2312",
|
||||
FONT_WEIGHT_REGULAR, FONT_SLANT_ROMAN, FONT_FLIP_NONE,
|
||||
FONT_OTHER_NIL, FONT_DECORATE_NONE, FONT_RENDER_MONO,
|
||||
12, 0);
|
||||
logfontttf = CreateLogFontEx ("ttf", "Courier", "UTF-8",
|
||||
FONT_WEIGHT_BLACK, FONT_SLANT_ROMAN, FONT_FLIP_NONE,
|
||||
FS_OTHER_LCDPORTRAIT, FONT_DECORATE_NONE, FONT_RENDER_SUBPIXEL,
|
||||
24, 0);
|
||||
+229
-54
File diff suppressed because it is too large
Load Diff
+13
-7
@@ -1458,7 +1458,6 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||
rctop = rc.top;
|
||||
|
||||
if (mouseX <= right && mouseX >= left && (p != pData->pItemSelected) ) {
|
||||
PLOGFONT logfont;
|
||||
c = getCountFromItem (pData, pData->pItemSelected);
|
||||
c = c - pData->nItemTop - 1;
|
||||
if (c < 0)
|
||||
@@ -1471,12 +1470,15 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||
rc.top += TV_BORDER;
|
||||
rc.bottom = rc.top + pData->nItemHeight;
|
||||
|
||||
/*bugfix: 4864, zhaochengzhang*/
|
||||
/* VincentWei: do not depend on logfont style
|
||||
PLOGFONT logfont;
|
||||
//bugfix: 4864, zhaochengzhang
|
||||
logfont = GetWindowFont(hwnd);
|
||||
if (logfont->style & (FS_WEIGHT_BOOK | FS_WEIGHT_LIGHT)) {
|
||||
rc.left--; rc.top--;
|
||||
rc.right++; rc.bottom++;
|
||||
}
|
||||
*/
|
||||
InvalidateRect (hwnd, &rc, TRUE);
|
||||
|
||||
rc.top = rctop + (count - pData->nItemTop - 1) * pData->nItemHeight;
|
||||
@@ -1484,17 +1486,18 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||
rc.top += TV_BORDER;
|
||||
rc.bottom = rc.top + pData->nItemHeight;
|
||||
|
||||
/*bugfix: 4864 zhaochengzhang*/
|
||||
/* VincentWei: do not depend on logfont style
|
||||
//bugfix: 4864 zhaochengzhang
|
||||
if (logfont->style & (FS_WEIGHT_BOOK | FS_WEIGHT_LIGHT)) {
|
||||
rc.left--; rc.top--;
|
||||
rc.right++; rc.bottom++;
|
||||
}
|
||||
}
|
||||
*/
|
||||
InvalidateRect (hwnd, &rc, TRUE);
|
||||
NotifyParent (hwnd, pData->id, TVN_CLICKED);
|
||||
}
|
||||
|
||||
if (mouseX <= left + h && mouseX >= left) {
|
||||
PLOGFONT logfont;
|
||||
if (p->child == NULL)
|
||||
break;
|
||||
|
||||
@@ -1518,13 +1521,16 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||
tvSetVScrollInfo (hwnd, pData, TRUE);
|
||||
tvSetHScrollInfo (hwnd, pData, TRUE);
|
||||
rc.bottom = rcClient.bottom;
|
||||
|
||||
/*bugfix: 4864 zhaochengzhang*/
|
||||
|
||||
/* VincentWei: do not depend on the logfont style
|
||||
PLOGFONT logfont;
|
||||
//bugfix: 4864 zhaochengzhang
|
||||
logfont = GetWindowFont(hwnd);
|
||||
if (logfont->style & (FS_WEIGHT_BOOK | FS_WEIGHT_LIGHT)) {
|
||||
rc.left--; rc.top--;
|
||||
rc.right++; rc.bottom++;
|
||||
}
|
||||
*/
|
||||
InvalidateRect (hwnd, &rc, TRUE);
|
||||
NotifyParent (hwnd, pData->id, TVN_CLICKED);
|
||||
}
|
||||
|
||||
@@ -4,20 +4,21 @@ noinst_LTLIBRARIES = libfont.la
|
||||
|
||||
SRC_FILES = charset.c charset-arabic.c charset-bidi.c \
|
||||
sysfont.c logfont.c devfont.c fontname.c \
|
||||
rawbitmap.c varbitmap.c qpf.c upf.c \
|
||||
fontcache.c freetype1.c freetype2.c font-engines.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
|
||||
|
||||
HDR_FILES = charset.h rawbitmap.h varbitmap.h freetype1.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 \
|
||||
upf.h bitmapfont.h gunichartables.h se_minigui.h unicode-bidi-tables.h
|
||||
|
||||
EXTRA_DIST = convgbmap.c jisunimap.c $(SRC_FILES) $(HDR_FILES) \
|
||||
makefile.ng makefile.msvc
|
||||
|
||||
AM_CPPFLAGS = $(FT1_INC_DIR) $(FT2_INC_DIR)
|
||||
# AM_CPPFLAGS = $(FT1_INC_DIR) $(FT2_INC_DIR)
|
||||
AM_CPPFLAGS = $(FT2_INC_DIR)
|
||||
AM_CPPFLAGS += -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
|
||||
|
||||
libfont_la_SOURCES = $(SRC_FILES) $(HDR_FILES)
|
||||
|
||||
+85
-83
File diff suppressed because it is too large
Load Diff
+77
-59
File diff suppressed because it is too large
Load Diff
+160
-143
File diff suppressed because it is too large
Load Diff
+64
-8
@@ -131,38 +131,54 @@ DWORD fontConvertStyle (const char* style_part)
|
||||
{
|
||||
DWORD style = 0;
|
||||
|
||||
style &= ~FS_WEIGHT_MASK;
|
||||
switch (style_part [0]) {
|
||||
case FONT_WEIGHT_BLACK:
|
||||
style |= FS_WEIGHT_BLACK;
|
||||
break;
|
||||
case FONT_WEIGHT_EXTRA_BOLD:
|
||||
style |= FS_WEIGHT_EXTRA_BOLD;
|
||||
break;
|
||||
case FONT_WEIGHT_BOLD:
|
||||
style |= FS_WEIGHT_BOLD;
|
||||
break;
|
||||
/* deprecated since v3.2.1
|
||||
case FONT_WEIGHT_BOOK:
|
||||
style |= FS_WEIGHT_BOOK;
|
||||
break;
|
||||
*/
|
||||
case FONT_WEIGHT_DEMIBOLD:
|
||||
style |= FS_WEIGHT_DEMIBOLD;
|
||||
break;
|
||||
case FONT_WEIGHT_LIGHT:
|
||||
style |= FS_WEIGHT_LIGHT;
|
||||
break;
|
||||
case FONT_WEIGHT_MEDIUM:
|
||||
style |= FS_WEIGHT_MEDIUM;
|
||||
break;
|
||||
case FONT_WEIGHT_REGULAR:
|
||||
style |= FS_WEIGHT_REGULAR;
|
||||
break;
|
||||
case FONT_WEIGHT_SUBPIXEL:
|
||||
style |= FS_WEIGHT_SUBPIXEL;
|
||||
break;
|
||||
case FONT_WEIGHT_LIGHT:
|
||||
style |= FS_WEIGHT_LIGHT;
|
||||
break;
|
||||
case FONT_WEIGHT_EXTRA_LIGHT:
|
||||
style |= FS_WEIGHT_EXTRA_LIGHT;
|
||||
break;
|
||||
case FONT_WEIGHT_THIN:
|
||||
style |= FS_WEIGHT_THIN;
|
||||
break;
|
||||
/* deprecated since v3.2.1
|
||||
case FONT_WEIGHT_SUBPIXEL:
|
||||
style |= FS_WEIGHT_SUBPIXEL;
|
||||
break;
|
||||
case FONT_WEIGHT_ALL:
|
||||
style |= FS_WEIGHT_MASK;
|
||||
break;
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
return 0xFFFFFFFF;
|
||||
style |= FS_WEIGHT_ANY;
|
||||
break;
|
||||
}
|
||||
|
||||
style &= ~FS_SLANT_MASK;
|
||||
switch (style_part [1]) {
|
||||
case FONT_SLANT_ITALIC:
|
||||
style |= FS_SLANT_ITALIC;
|
||||
@@ -180,6 +196,7 @@ DWORD fontConvertStyle (const char* style_part)
|
||||
return 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
style &= ~FS_FLIP_MASK;
|
||||
switch (style_part [2]) {
|
||||
case FONT_FLIP_HORZ:
|
||||
style |= FS_FLIP_HORZ;
|
||||
@@ -194,6 +211,7 @@ DWORD fontConvertStyle (const char* style_part)
|
||||
break;
|
||||
}
|
||||
|
||||
style &= ~FS_OTHER_MASK;
|
||||
switch (style_part [3]) {
|
||||
case FONT_OTHER_AUTOSCALE:
|
||||
style |= FS_OTHER_AUTOSCALE;
|
||||
@@ -217,6 +235,43 @@ DWORD fontConvertStyle (const char* style_part)
|
||||
break;
|
||||
}
|
||||
|
||||
style &= ~FS_DECORATE_MASK;
|
||||
switch (style_part [4]) {
|
||||
case FONT_DECORATE_NONE:
|
||||
break;
|
||||
case FONT_DECORATE_UNDERLINE:
|
||||
style |= FS_DECORATE_UNDERLINE;
|
||||
break;
|
||||
case FONT_DECORATE_STRUCKOUT:
|
||||
style |= FS_DECORATE_STRUCKOUT;
|
||||
break;
|
||||
case FONT_DECORATE_BOTH:
|
||||
style |= FS_DECORATE_BOTH;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
style &= ~FS_RENDER_MASK;
|
||||
switch (style_part [5]) {
|
||||
case FONT_RENDER_MONO:
|
||||
style |= FS_RENDER_MONO;
|
||||
break;
|
||||
case FONT_RENDER_OUTLINE:
|
||||
style |= FS_RENDER_OUTLINE;
|
||||
break;
|
||||
case FONT_RENDER_GREY:
|
||||
style |= FS_RENDER_GREY;
|
||||
break;
|
||||
case FONT_RENDER_SUBPIXEL:
|
||||
style |= FS_RENDER_SUBPIXEL;
|
||||
break;
|
||||
default:
|
||||
style |= FS_RENDER_MONO;
|
||||
break;
|
||||
}
|
||||
|
||||
/* deprecated since v3.2.1
|
||||
switch (style_part [4]) {
|
||||
case FONT_UNDERLINE_LINE:
|
||||
style |= FS_UNDERLINE_LINE;
|
||||
@@ -244,6 +299,7 @@ DWORD fontConvertStyle (const char* style_part)
|
||||
default:
|
||||
return 0xFFFFFFFF;
|
||||
}
|
||||
*/
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
+171
-116
File diff suppressed because it is too large
Load Diff
@@ -54,6 +54,7 @@ extern "C" {
|
||||
#include FT_CACHE_MANAGER_H
|
||||
#include FT_TRIGONOMETRY_H
|
||||
#include FT_IMAGE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
|
||||
#if 0
|
||||
#define _MGFONT_TTF_CACHE 1
|
||||
@@ -124,19 +125,20 @@ typedef struct tagTTFCACHEINFO {
|
||||
void *bitmap;
|
||||
} TTFCACHEINFO, *PTTFCACHEINFO;
|
||||
|
||||
extern HCACHE __mg_ttc_create(char *family, char *charset, DWORD style, int size,
|
||||
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey);
|
||||
extern HCACHE __mg_ttc_create(char *family, char *charset,
|
||||
DWORD style, int size, int rotation,
|
||||
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey);
|
||||
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,
|
||||
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);
|
||||
extern HCACHE __mg_ttc_is_exist(char *family, char *charset,
|
||||
DWORD style, int size, int rotation);
|
||||
extern void __mg_ttc_refer(HCACHE hCache);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#undef TTF_DBG
|
||||
|
||||
|
||||
+71
-39
File diff suppressed because it is too large
Load Diff
+6
-3
@@ -482,9 +482,12 @@ static DEVFONT* new_instance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
BOOL need_sbc_font)
|
||||
{
|
||||
if (QPFONT_INFO_P (devfont)->fm->flags & FLAG_MODE_SMOOTH) {
|
||||
logfont->style &= ~FS_WEIGHT_SUBPIXEL;
|
||||
logfont->style |= FS_WEIGHT_BOOK;
|
||||
logfont->style &= ~FS_WEIGHT_LIGHT;
|
||||
logfont->style &= ~FS_RENDER_MASK;
|
||||
logfont->style |= FS_RENDER_GREY;
|
||||
}
|
||||
else {
|
||||
logfont->style &= ~FS_RENDER_MASK;
|
||||
logfont->style |= FS_RENDER_MONO;
|
||||
}
|
||||
|
||||
return devfont;
|
||||
|
||||
+6
-3
@@ -471,9 +471,12 @@ static DEVFONT* new_instance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
*set logfont to weight book;
|
||||
**/
|
||||
if (!((UPFV1_FILE_HEADER*)p_upf)->mono_bitmap) {
|
||||
logfont->style &= ~FS_WEIGHT_SUBPIXEL;
|
||||
logfont->style |= FS_WEIGHT_BOOK;
|
||||
logfont->style &= ~FS_WEIGHT_LIGHT;
|
||||
logfont->style &= ~FS_RENDER_MASK;
|
||||
logfont->style |= FS_RENDER_GREY;
|
||||
}
|
||||
else {
|
||||
logfont->style &= ~FS_RENDER_MASK;
|
||||
logfont->style |= FS_RENDER_MONO;
|
||||
}
|
||||
|
||||
return devfont;
|
||||
|
||||
+56
-17
@@ -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/>.
|
||||
*/
|
||||
@@ -117,12 +117,12 @@ static void make_gray_pixels (PDC pdc)
|
||||
|
||||
a = 0;
|
||||
for (i = 0; i < 16; i++) {
|
||||
pdc->gray_pixels [i] = GAL_MapRGBA (pdc->alpha_pixel_format,
|
||||
pdc->gray_pixels [i] = GAL_MapRGBA (pdc->alpha_pixel_format,
|
||||
r, g, b, a);
|
||||
a += 16;
|
||||
}
|
||||
|
||||
pdc->gray_pixels [16] = GAL_MapRGBA (pdc->alpha_pixel_format,
|
||||
pdc->gray_pixels [16] = GAL_MapRGBA (pdc->alpha_pixel_format,
|
||||
r, g, b, 255);
|
||||
}
|
||||
else {
|
||||
@@ -132,9 +132,9 @@ static void make_gray_pixels (PDC pdc)
|
||||
int delta_r, delta_g, delta_b;
|
||||
RGB pal [17];
|
||||
|
||||
GAL_GetRGB (pdc->bkcolor, pdc->surface->format,
|
||||
GAL_GetRGB (pdc->bkcolor, pdc->surface->format,
|
||||
&pal->r, &pal->g, &pal->b);
|
||||
GAL_GetRGB (pdc->textcolor, pdc->surface->format,
|
||||
GAL_GetRGB (pdc->textcolor, pdc->surface->format,
|
||||
&pal[16].r, &pal[16].g, &pal[16].b);
|
||||
|
||||
delta_r = ((int)pal[16].r - (int)pal[0].r) / 16;
|
||||
@@ -145,7 +145,7 @@ static void make_gray_pixels (PDC pdc)
|
||||
pal[i].r = pal[i - 1].r + delta_r;
|
||||
pal[i].g = pal[i - 1].g + delta_g;
|
||||
pal[i].b = pal[i - 1].b + delta_b;
|
||||
pdc->gray_pixels [i] = GAL_MapRGB (pdc->surface->format,
|
||||
pdc->gray_pixels [i] = GAL_MapRGB (pdc->surface->format,
|
||||
pal[i].r, pal[i].g, pal[i].b);
|
||||
}
|
||||
pdc->gray_pixels [0] = pdc->bkcolor;
|
||||
@@ -162,6 +162,7 @@ static void make_gray_pixels (PDC pdc)
|
||||
|
||||
static void make_filter_pixels (PDC pdc)
|
||||
{
|
||||
#if 0 // VincentWei: use FS_RENDER_MASK instead (3.4.0)
|
||||
if (pdc->pLogFont->style & FS_WEIGHT_BOOK) {
|
||||
int i;
|
||||
Uint8 r, g, b, a;
|
||||
@@ -173,12 +174,12 @@ static void make_filter_pixels (PDC pdc)
|
||||
|
||||
a = 0;
|
||||
for (i = 0; i < 16; i++) {
|
||||
pdc->filter_pixels [i] = GAL_MapRGBA (pdc->alpha_pixel_format,
|
||||
pdc->filter_pixels [i] = GAL_MapRGBA (pdc->alpha_pixel_format,
|
||||
r, g, b, a);
|
||||
a += 16;
|
||||
}
|
||||
|
||||
pdc->filter_pixels [16] = GAL_MapRGBA (pdc->alpha_pixel_format,
|
||||
pdc->filter_pixels [16] = GAL_MapRGBA (pdc->alpha_pixel_format,
|
||||
r, g, b, 255);
|
||||
|
||||
}
|
||||
@@ -191,6 +192,44 @@ static void make_filter_pixels (PDC pdc)
|
||||
pdc->filter_pixels [1] = pdc->bkcolor;
|
||||
pdc->filter_pixels [2] = pdc->textcolor;
|
||||
}
|
||||
#else
|
||||
switch (pdc->pLogFont->style & FS_RENDER_MASK) {
|
||||
case FS_RENDER_GREY: {
|
||||
int i;
|
||||
Uint8 r, g, b, a;
|
||||
|
||||
if (make_alpha_pixel_format (pdc))
|
||||
return;
|
||||
|
||||
GAL_GetRGB (pdc->textcolor, pdc->surface->format, &r, &g, &b);
|
||||
|
||||
a = 0;
|
||||
for (i = 0; i < 16; i++) {
|
||||
pdc->filter_pixels [i] = GAL_MapRGBA (pdc->alpha_pixel_format,
|
||||
r, g, b, a);
|
||||
a += 16;
|
||||
}
|
||||
|
||||
pdc->filter_pixels [16] = GAL_MapRGBA (pdc->alpha_pixel_format,
|
||||
r, g, b, 255);
|
||||
break;
|
||||
}
|
||||
|
||||
case FS_RENDER_OUTLINE: {
|
||||
gal_pixel trans = pdc->bkcolor ^ 1;
|
||||
if (trans == pdc->textcolor)
|
||||
trans = pdc->bkcolor ^ 3;
|
||||
|
||||
pdc->filter_pixels [0] = trans;
|
||||
pdc->filter_pixels [1] = pdc->bkcolor;
|
||||
pdc->filter_pixels [2] = pdc->textcolor;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Uint32 GUIAPI SetDCAttr (HDC hdc, int attr, Uint32 value)
|
||||
@@ -244,7 +283,7 @@ PLOGFONT GUIAPI SelectFont (HDC hdc, PLOGFONT log_font)
|
||||
pdc->pLogFont = g_SysLogFont [1] ? g_SysLogFont [1] : g_SysLogFont [0];
|
||||
else
|
||||
pdc->pLogFont = log_font;
|
||||
|
||||
|
||||
make_gray_pixels (pdc);
|
||||
make_filter_pixels (pdc);
|
||||
return old;
|
||||
|
||||
+14
-2
@@ -61,8 +61,20 @@ typedef struct _BBOX
|
||||
int w, h;
|
||||
} BBOX;
|
||||
|
||||
int _gdi_get_glyph_advance (PDC pdc, Glyph32 glyph_value,
|
||||
BOOL direction, int x, int y, int* adv_x, int* adv_y, BBOX* bbox);
|
||||
int _font_get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
Glyph32 glyph_value, BOOL direction, int ch_extra,
|
||||
int x, int y, int* adv_x, int* adv_y, BBOX* bbox);
|
||||
|
||||
static inline int _gdi_get_glyph_advance (PDC pdc, Glyph32 glyph_value,
|
||||
BOOL direction, int x, int y, int* adv_x, int* adv_y, BBOX* bbox)
|
||||
{
|
||||
LOGFONT* logfont = pdc->pLogFont;
|
||||
DEVFONT* devfont = SELECT_DEVFONT(logfont, glyph_value);
|
||||
glyph_value = REAL_GLYPH (glyph_value);
|
||||
|
||||
return _font_get_glyph_advance (logfont, devfont, glyph_value,
|
||||
direction, pdc->cExtra, x, y, adv_x, adv_y, bbox);
|
||||
}
|
||||
|
||||
int _gdi_draw_one_glyph (PDC pdc, Glyph32 glyph_value, BOOL direction,
|
||||
int x, int y, int* adv_x, int* adv_y);
|
||||
|
||||
+415
-352
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user