Compare commits

...
155 Commits
Author SHA1 Message Date
Vincent Wei b4b18828b2 change GLYPHTYPE_ to CHARTYPE_ 2019-03-05 18:44:39 +08:00
Vincent Wei 36167be7e6 Tune APIs of Achar32 2019-03-05 18:18:54 +08:00
Vincent Wei 4b633c801d Introduce the Mchar32 type, and distinguish glyph and character 2019-03-05 12:27:35 +08:00
Vincent Wei 33fd8a8668 tune TTF cache arguments 2019-03-05 10:50:25 +08:00
Vincent Wei 94f44890a5 tune code to handle auto-italic correctly 2019-03-05 10:42:16 +08:00
Vincent Wei cc7441c4dd add df_slot to get_font_size of DEVFONT operators in order to set scale correctly 2019-03-05 09:16:36 +08:00
Vincent Wei 6fdc0281ba handle whitespace gracefully 2019-03-04 18:08:36 +08:00
Vincent Wei 136a51d9b8 cleanup 2019-03-04 16:47:19 +08:00
Vincent Wei 5e871c486b Tune FS_SLANT_XXX and tune auto bold implementation 2019-03-04 16:30:25 +08:00
Vincent Wei fdd69bf470 fix bug: do not override bitmap size for grey and subpixel glyph 2019-03-04 16:30:17 +08:00
Vincent Wei 10e55b0d4f restore style for TTF cache 2019-03-04 14:37:59 +08:00
Vincent Wei 682c81d636 tune 2019-03-04 11:52:47 +08:00
Vincent Wei 9eb4e54b75 cleanup 2019-03-04 11:39:32 +08:00
Vincent Wei e43bc07a63 tune fontcache functions: use devfont name instead of family and style 2019-03-04 11:37:50 +08:00
Vincent Wei 508130afdc tune 2019-03-03 20:06:07 +08:00
Vincent Wei d60c057dc4 tune load_flags 2019-03-03 20:00:54 +08:00
Vincent Wei 8f5a741af6 tune load_flags 2019-03-03 19:58:29 +08:00
Vincent Wei bee1bc87c4 tune code for size_request of LOGFONT 2019-03-03 19:14:18 +08:00
Vincent Wei 3a9274e9a0 add SIZE* sz for get_glyph_monobmp and get_glyph_graybmp 2019-03-03 18:54:39 +08:00
Vincent Wei 44ee735cd6 fix a bug of is_glyph_exsited (always returns FALSE) 2019-03-03 18:54:14 +08:00
Vincent Wei 2c010cdbeb fix a bug of fontDoesMatchFamily 2019-03-03 16:51:49 +08:00
Vincent Wei a04ae43bdb fix bug of gdiCreateLogFont 2019-03-03 16:43:40 +08:00
Vincent Wei 5c333445c5 tune font styles 2019-03-01 20:01:30 +08:00
Vincent Wei dd93e67a3d tune document 2019-03-01 14:38:48 +08:00
Vincent Wei d886268eee cleanup and check the duplicated fontname of a new devfont 2019-03-01 14:20:46 +08:00
Vincent Wei 090824cb91 bugfix 2019-02-28 19:08:05 +08:00
Vincent Wei 00eb4e363f Enhance LOGFONT to support multiple MBC devfonts (up to 7) 2019-02-28 18:47:44 +08:00
Vincent Wei f73f0786ee remove break_classes argument and add uchars argument for GetGlyphsAndBreaks 2019-02-28 11:50:00 +08:00
Vincent Wei dacc81cf2a Rename UCharGetBreak to UCharGetBreakType; Cleanup and optimization 2019-02-28 09:47:25 +08:00
Vincent Wei 97c6249af5 cleanup: remove definition of DEBUG 2019-02-27 18:47:25 +08:00
Vincent Wei 7ce1fe47ff implementation of character transformation of GetGlyphsAndBreaks; fix a bug of UCharToFullSizeKana 2019-02-27 18:33:32 +08:00
Vincent Wei 8e66bb366e tune word breaks and sentence breaks 2019-02-27 17:56:41 +08:00
Vincent Wei ce7fd6e776 passed all test cases for UAX#14 and UAX#29 2019-02-27 11:37:17 +08:00
Vincent Wei 957f9cbb47 remove break_classes argument from GetGlyphsExtentPointEx 2019-02-26 19:07:37 +08:00
Vincent Wei 2a7e3003bd Rename GetGlyphsByRules to GetGlyphsAndBreaks 2019-02-26 18:47:33 +08:00
Vincent Wei 19cd208a6e support for GB, WB, SB in break_oppos; add emoji tables 2019-02-26 17:59:50 +08:00
Vincent Wei 6a44111a35 cleanup 2019-02-25 17:09:37 +08:00
Vincent Wei fd5d55942b use Uint16 type for break_oppo instead of Uint8 type in order to contain GB, WB, SB flags 2019-02-25 16:42:49 +08:00
Vincent Wei d4e7f048f0 fixbug 2019-02-25 09:12:51 +08:00
Vincent Wei d90c4d5842 cleanup 2019-02-24 18:31:38 +08:00
Vincent Wei 0f562cd39f cleanup 2019-02-24 15:02:16 +08:00
Vincent Wei fb01003c45 use LEN_VBF_NAME instead of LEN_DEVFONT_NAME 2019-02-24 14:56:43 +08:00
Vincent Wei 9bcea02975 cleanup 2019-02-24 13:35:43 +08:00
Vincent Wei c51ae8d1c1 cleanup 2019-02-22 19:11:37 +08:00
Vincent Wei b8a5ad2d73 return NULL when not matched devfont 2019-02-22 19:11:26 +08:00
Vincent Wei 39b8c88d1b new DC attribute: DC_ATTR_WORD_EXTRA 2019-02-22 18:46:23 +08:00
Vincent Wei 1e73f6713a enable cache of freetype2 engine for rotated glyphs 2019-02-22 17:51:41 +08:00
Vincent Wei 97babaa4e2 add size_request in LOGFONT for original requested size 2019-02-22 17:46:13 +08:00
Vincent Wei c6c486f306 almost there 2019-02-22 15:47:20 +08:00
Vincent Wei 338f10b896 debug 2019-02-22 12:39:07 +08:00
Vincent Wei 2353a873a8 debug GetGlyphsExtentPointEx 2019-02-22 10:49:02 +08:00
Vincent Wei 52c539e870 debug 2019-02-21 20:21:02 +08:00
Vincent Wei 64d63a84c5 cleanup and bugfixs 2019-02-21 18:43:14 +08:00
Vincent Wei 3d80d73450 cleanup and bugfixs 2019-02-21 18:38:49 +08:00
Vincent Wei 2e04898fbe fix bugs 2019-02-21 15:56:51 +08:00
Vincent Wei f390e1a091 fix bugs 2019-02-21 15:51:11 +08:00
Vincent Wei 848c1d7ce1 tune 2019-02-21 12:07:02 +08:00
Vincent Wei 0c0becc780 tune 2019-02-21 10:32:16 +08:00
Vincent Wei 0e918da2a4 bugfix: get_ch_width does not check glyph value 2019-02-21 10:32:01 +08:00
Vincent Wei 7f36c339b7 tune 2019-02-20 18:21:17 +08:00
Vincent Wei 871486daab cleanup 2019-02-20 16:41:21 +08:00
Vincent Wei 0cffc8798f Suppress and/or hang spaces and punctations for GetGlyphsExtentPointEx 2019-02-20 16:00:16 +08:00
Vincent Wei 4d4a3901eb TODOs 2019-02-19 18:53:20 +08:00
Vincent Wei 50e95cb461 Initial implementation of GetGlyphsExtentPointEx and DrawGlyphStringEx 2019-02-19 18:38:57 +08:00
Vincent Wei d223edf0ba partial implementation of GetGlyphsExtentPointEx 2019-02-19 17:48:39 +08:00
Vincent Wei 8e88082f07 UCharGetType -> UCharGetCategory 2019-02-19 10:45:49 +08:00
Vincent Wei 5b1762b637 Enhance GetGlyphsByRules to return breaking classes 2019-02-19 09:41:22 +08:00
Vincent Wei 6c83ea4ceb implementation for LBP_NORMAL and LBP_STRICT; both passed all test cases 2019-02-18 18:24:59 +08:00
Vincent Wei 5aa5e75813 UCharBasicType -> UCharGeneralCategory 2019-02-18 12:16:49 +08:00
Vincent Wei 1ba35dcbf6 implementation of WBR_BREAK_ALL and WBR_KEEP_ALL 2019-02-18 11:44:54 +08:00
Vincent Wei 8828824b23 Add BOV_NOTALLOWED_DEFINITELY and BOV_NOTALLOWED_UNCERTAINLY 2019-02-18 09:25:18 +08:00
Vincent Wei e3f2cc22ec tune BIDILogGlyphs2VisGlyphsEx and BIDILogGlyphs2VisGlyphs 2019-02-17 12:56:35 +08:00
Vincent Wei 93aae6782e Tune GetGlyphsByRules and GetGlyphsExtentPointEx 2019-02-17 11:53:35 +08:00
Vincent Wei b746d2927e Partial implementation of GetGlyphsExtentPointEx 2019-02-15 18:07:03 +08:00
Vincent Wei 79e3be705c simplify the interfaces of GetGlyphsExtentPointEx and DrawGlyphStringEx 2019-02-15 11:07:54 +08:00
Vincent Wei a052b7bf55 cleanup BIDI APIs 2019-02-14 19:45:50 +08:00
Vincent Wei 74a84362ca correct some bad names of BIDI-related APIs 2019-02-14 17:27:11 +08:00
Vincent Wei d673008f5a tune API description 2019-02-14 11:52:59 +08:00
Vincent Wei 09c9438de8 tune api description 2019-01-29 17:02:48 +08:00
Vincent Wei 0734180d70 set user_comp_ctxt to be pixel format for default composition operators 2019-01-29 15:43:23 +08:00
Vincent Wei 8ca8deb02d list developers 2019-01-29 10:51:15 +08:00
Vincent Wei 9aa719aeb3 list developers 2019-01-29 10:42:43 +08:00
Vincent Wei 447eebbafc all UNICODE LINE BREAKING ALGORITHM test cases for GetGlyphsByRules passed 2019-01-27 12:45:20 +08:00
Vincent Wei 19f8689a20 almost passed the test cases for GetGlyphsByRules 2019-01-25 21:34:34 +08:00
Vincent Wei 60902f83d5 debug GetGlyphsByRules 2019-01-25 20:42:32 +08:00
Vincent Wei a725acfd5e debug GetGlyphsByRules 2019-01-25 16:14:42 +08:00
Vincent Wei 0191772111 Tune the implementation of UNICODE LINE BREAKING ALGORITHM 2019-01-24 20:17:27 +08:00
Vincent Wei a11cef5f2e push 2019-01-24 18:43:30 +08:00
Vincent Wei cf4c75bcbc almost finished GetGlyphsByRules 2019-01-24 11:31:54 +08:00
Vincent Wei f85801dcbe part implementation of GetGlyphsByRules 2019-01-23 17:08:03 +08:00
Vincent Wei 4e67f8c56b part implementation of GetGlyphsByRules 2019-01-23 14:36:56 +08:00
Vincent Wei 1cfd2fe324 part implementation of GetGlyphsByRules 2019-01-22 10:50:15 +08:00
Vincent Wei 5ef2e0fa42 temp 2019-01-21 17:14:59 +08:00
Vincent Wei 57b71e985c Add UCharGetType, UCharGetBreak, UCharGetBIDIType, and UCharGetMirror for completeness 2019-01-21 16:19:20 +08:00
Vincent Wei d9d76ec59b DrawGlyphStringEx returns BOOL 2019-01-19 18:29:09 +08:00
Vincent Wei 7935883267 GetGlyphsByRules returns line break opportunities 2019-01-19 18:20:55 +08:00
Vincent Wei 0385def7b2 tune 2019-01-19 15:05:53 +08:00
Vincent Wei 565f4b34e5 cleanup 2019-01-19 15:02:55 +08:00
Vincent Wei 70ba8a0420 cleanup 2019-01-19 14:59:12 +08:00
Vincent Wei 4bdbe4a002 tune 2019-01-19 14:53:35 +08:00
Vincent Wei 2c98ef96da tune release notes 2019-01-19 14:24:26 +08:00
Vincent Wei 6663c98787 add CreateLogFontIndirectEx function 2019-01-19 14:21:46 +08:00
Vincent Wei bbf2376f7a fix a potential bug: reserve key when creating logfont by calling CreateLogFontIndirect 2019-01-19 14:04:11 +08:00
Vincent Wei 21ac9f2def add content language and writing system parameters for rendering glyphs for CSS 2019-01-19 13:27:01 +08:00
Vincent Wei a10d28dd11 unicode script and language code 2019-01-19 12:57:34 +08:00
Vincent Wei 856126c72e make GRF_HANGING_PUNC_FIRST and GRF_HANGING_PUNC_LAST as flag bits 2019-01-18 18:07:44 +08:00
Vincent Wei 547fc0059c tune readme 2019-01-18 16:45:23 +08:00
Vincent Wei 195363dc82 use the same table for UCharToFullSizeKana and UCharToSmallKana 2019-01-18 16:24:56 +08:00
Vincent Wei 54288e5687 more API description 2019-01-18 16:15:14 +08:00
Vincent Wei 9d46406a95 some API description 2019-01-18 15:49:10 +08:00
Vincent Wei d365feca5d tune 2019-01-18 14:05:19 +08:00
Vincent Wei f34ac9d0fe UChar32 -> Uchar32; UChar16 -> Uchar16 2019-01-18 13:56:18 +08:00
Vincent Wei 3a02b056ca Tune format 2019-01-18 12:39:23 +08:00
Vincent Wei 1a1e8cf652 Add UCharToFullWidth and UCharToFullSizeKana 2019-01-18 12:37:53 +08:00
Vincent Wei 94feb0ae44 Tune Glyph32 and UChar32 to be unsigned 2019-01-18 11:43:42 +08:00
Vincent Wei 1e1a5edd13 tune 2019-01-18 11:29:35 +08:00
Vincent Wei ae9b14201b make sure the strings are null-terminated (fontDoesMatchFamily) 2019-01-18 09:29:39 +08:00
Vincent Wei 742150d4f1 restore LEN_FONT_NAME 2019-01-17 19:29:14 +08:00
Vincent Wei 03eac03c8c add UCharCanonicalOrdering and others for composition and decomposition 2019-01-17 18:45:22 +08:00
Vincent Wei 8cd6b037ec tuen release notes 2019-01-17 14:59:40 +08:00
Vincent Wei b35e38bdff tune length of devfont name fields; devfont now supports family aliases 2019-01-17 14:55:06 +08:00
Vincent Wei 58275c88e9 call REAL_GLYPH for devfont operators 2019-01-17 12:40:25 +08:00
Vincent Wei 31b43521d0 call REAL_GLYPH for charset operators 2019-01-17 12:14:02 +08:00
Vincent Wei e68ee00b85 rename glyph type macros and glyph type now includes MCHAR_TYPE_XXX for ASCII characters 2019-01-17 11:59:29 +08:00
Vincent Wei 6e54d4a7d7 add macro GLYPH2UCHAR 2019-01-16 20:43:01 +08:00
Vincent Wei 69b1d63569 Rename IsGlyphAlnum, GlyphToUpper to IsUCharAlnum, UCharToTitle and so on 2019-01-16 20:37:56 +08:00
Vincent Wei 817f4063a1 Add UNICODE utilities: IsGlyphAlnum, GlyphToUpper, ... 2019-01-16 20:34:51 +08:00
Vincent Wei c9ec23dc70 empty implementation of glyphs APIs for CSS 2019-01-16 19:27:41 +08:00
Vincent Wei 972085fa56 cleanup 2019-01-16 17:50:21 +08:00
Vincent Wei c2e24b61e3 cleanup 2019-01-16 17:44:48 +08:00
Vincent Wei bd1fb67930 retrive the break type of UNICODE char; upgrade UNICODE tables to 10.0.0 2019-01-16 17:10:50 +08:00
Vincent Wei 0fcedfca08 cleanup 2019-01-16 14:52:12 +08:00
Vincent Wei c39ce7c0b8 cleanup 2019-01-16 12:04:43 +08:00
Vincent Wei 97014ccdc8 cleanup 2019-01-16 12:02:58 +08:00
Vincent Wei 48e7f6e928 cleanup 2019-01-16 11:53:46 +08:00
Vincent Wei 473f9f98ff cleanup 2019-01-16 11:52:56 +08:00
Vincent Wei 95d09a7673 tune and cleanup 2019-01-16 11:43:27 +08:00
Vincent Wei 53253ed101 optimize the font matching algorithm 2019-01-16 10:18:26 +08:00
Vincent Wei 4bd7c0eef4 add mutex for freetype2 font engine (MGRM_THREADS) and remove lock/unlock of __mg_gdi_lock in _font_get_glyph_advance 2019-01-16 10:06:46 +08:00
Vincent Wei 9af71438dd cleanup 2019-01-15 17:02:11 +08:00
Vincent Wei 82033a44dd cleanup and fix the bug of wrong bboxing handling for SUBPIXEL rendering of glyph 2019-01-15 14:50:46 +08:00
Vincent Wei 1c9537fc63 BMP_TYPE_REPLACEKEY for BITMAP; Declaration of GetGlyphsExtentPointEx and DrawGlyphStringEx; cleanup of GLYPHINFO and GLYPHBITMAP 2019-01-15 10:17:25 +08:00
Vincent Wei 612c395c06 Backward compatiblity of CreateLogFont 2019-01-14 10:23:37 +08:00
Vincent Wei 8dc0ee2ade cleanup 2019-01-13 18:56:41 +08:00
Vincent Wei caefd7355a cleanup 2019-01-13 18:36:03 +08:00
Vincent Wei 9ea0e15dba try to match devfont without style 2019-01-13 17:42:27 +08:00
Vincent Wei 83c8984c74 support flipping glyph for subpixel rendering 2019-01-13 16:59:36 +08:00
Vincent Wei 4761333a1a skip null pixels for subpixel 2019-01-13 16:20:08 +08:00
Vincent Wei 8538f29f70 fixbug: No need to make the pitch of FT2 monobitmap is single-byte aligned 2019-01-13 14:21:18 +08:00
Vincent Wei b658413961 cleanup 2019-01-13 13:17:23 +08:00
Vincent Wei bb187f1ee3 cleanup font name and glyph renderer 2019-01-13 13:10:13 +08:00
Vincent Wei ea8ab93bad cleanup 2019-01-12 15:02:56 +08:00
Vincent Wei 9226fcff26 add examples/createlogfontex.c and cleanup examples/createlogfont.c 2019-01-12 14:03:52 +08:00
Vincent Wei 05cf370155 Cleanup LOGFONT styles 2019-01-12 13:55:51 +08:00
Vincent Wei 0d2352884a tune style for LOGFONT 2019-01-11 10:55:55 +08:00
102 changed files with 82465 additions and 19361 deletions
-2
View File
@@ -1,2 +0,0 @@
Beijing FMSoft Technologies Co., Ltd.. (http://www.fmsoft.cn)
+16
View File
@@ -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
+2 -2
View File
@@ -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
View File
@@ -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
+109 -98
View File
@@ -7,6 +7,7 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
1. Introduction
1. A brief building instruction
1. New features in version 3.4.x
1. New features in version 3.2.x
1. The runtime modes of MiniGUI
1. History
@@ -18,42 +19,42 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
## INTRODUCTION
MiniGUI is a mature cross-platform windowing system and a GUI (Graphics
MiniGUI is a mature cross-platform windowing system and a GUI (Graphics
User Interface) support system for embedded systems and smart IoT devices.
This is the version 3.2.x of MiniGUI maintained by WEI Yongming
This is the version 3.2.x of MiniGUI maintained by WEI Yongming
(Vincent Wei, https://github.com/VincentWei).
MiniGUI is released under GPLv3 and the dual-licensing applies to commercial
use.
MiniGUI aims to provide a fast, stable, full-featured, and cross-platform
windowing and GUI support system, which is especially fit for
embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
traditional RTOSes, such as VxWorks, ThreadX, Nucleus, pSOS, uC/OS-II,
windowing and GUI support system, which is especially fit for
embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
traditional RTOSes, such as VxWorks, ThreadX, Nucleus, pSOS, uC/OS-II,
and OSE.
This is the MiniGUI core source tree, which provides windowing
and graphics interfaces as well as a lot of standard controls (tookit).
This is the MiniGUI core source tree, which provides windowing
and graphics interfaces as well as a lot of standard controls (tookit).
Besides MiniGUI core, FMSoft also provides some components
for the developers to develop app much easier:
* mGUtils: A MiniGUI component which contains miscellaneous utilities
like ColorSelectionDialogBox, FileOpenDialogBox, and so on.
* mGUtils: A MiniGUI component which contains miscellaneous utilities
like ColorSelectionDialogBox, FileOpenDialogBox, and so on.
* mGPlus: A MiniGUI component which provides support for advanced graphics
* mGPlus: A MiniGUI component which provides support for advanced graphics
functions like path, gradient, anti-aliase stretch, and color combination.
* mGEff: mGEff provides an animation framework for MiniGUI app.
* mGEff: mGEff provides an animation framework for MiniGUI app.
It also provides some popular UI/UE special effects.
* mGNCS: This component provides a new control set for MiniGUI app.
By using mGNCS, you can use miniStudio to develop MiniGUI app in
WYSIWYG way.
* mGNCS: This component provides a new control set for MiniGUI app.
By using mGNCS, you can use miniStudio to develop MiniGUI app in
WYSIWYG way.
* mGNCS4Touch: This component provides some new controls, which are
compliant to the new control API spec of mGNCS, for devices with
* mGNCS4Touch: This component provides some new controls, which are
compliant to the new control API spec of mGNCS, for devices with
a touch screen.
There are also some legacy MiniGUI components. We will not maintain these
@@ -61,7 +62,7 @@ components for MiniGUI core v3.2:
* mGi: An input method component for MiniGUI. This component provides
some typical input methods (such as softkey, hand-writing, and predict
text input for mobile phone) for MiniGUI apps.
text input for mobile phone) for MiniGUI apps.
* mGp: A printing component for MiniGUI. By using mGp, you can print
out the graphics created by MiniGUI app to general-purpose printers.
@@ -70,11 +71,11 @@ components for MiniGUI core v3.2:
provides a simple 3D API for app. You can use mG3d to create simple
3D UI.
MiniGUI is a free software project. In December 1998, the initiator of
FMSoft, Wei Yongming, began to develop MiniGUI under the GNU General Public
License (GPL). In September 2002, the core developers of
MiniGUI founded FMSoft and started the commercial marketing with
the free software. By now, FMSoft still continues to release MiniGUI
MiniGUI is a free software project. In December 1998, the initiator of
FMSoft, Wei Yongming, began to develop MiniGUI under the GNU General Public
License (GPL). In September 2002, the core developers of
MiniGUI founded FMSoft and started the commercial marketing with
the free software. By now, FMSoft still continues to release MiniGUI
as a free software project.
You can download the source code tarball of MiniGUI and the dependent libraries
@@ -82,27 +83,27 @@ from the download zone of the site:
http://www.minigui.com
FMSoft also releases some open source apps for MiniGUI on the site above,
FMSoft also releases some open source apps for MiniGUI on the site above,
for examples:
* mDolphin, licensed under Apache 2.0, is a full-featured
WEB/WAP browser, which is developed based on the open source browser
* mDolphin, licensed under Apache 2.0, is a full-featured
WEB/WAP browser, which is developed based on the open source browser
core WebKit and uses MiniGUI as its underlying graphics support system.
* mGallery, licensed under Apache 2.0, intends to
provide a total solution for PMP (Portable Multimedia Player),
* mGallery, licensed under Apache 2.0, intends to
provide a total solution for PMP (Portable Multimedia Player),
which uses MiniGUI as the graphics platform.
* mSpider, licensed under GPL 3.0, intends to provide a
* mSpider, licensed under GPL 3.0, intends to provide a
light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
* mEagle, licensed under GPL 3.0, is an embedded GIS development platform
* mEagle, licensed under GPL 3.0, is an embedded GIS development platform
which addresses the needs of map browse, query, analysis, etc
FMSoft had created the public repositories for MiniGUI core, MiniGUI
FMSoft had created the public repositories for MiniGUI core, MiniGUI
components, and other open source apps on GitHub. You can visit them on:
https://github.com/VincentWei
https://github.com/VincentWei
FMSoft also releases miniStudio, which is a WYSIWYG IDE for MiniGUI, as a shareware.
You can also download it from the official site of MiniGUI.
@@ -146,6 +147,15 @@ For more information, please run
$ ./configure --help
## NEW FEATURES IN VERSION 3.4.x
We introduce some new features in MiniGUI Version 3.4.x:
* The font and UNICODE related APIs are tuned or enhanced,
in order to support HybridOS Foundation C++ Library.
For more information, please refer to RELEASENOTES.md file.
## NEW FEATURES IN VERSION 3.2.x
We introduce some new features in MiniGUI Version 3.2.x:
@@ -154,7 +164,7 @@ We introduce some new features in MiniGUI Version 3.2.x:
to support 64-bit platform. For more information, please refer to
RELEASE-NOTES.md file.
Because of the changes of some APIs, we recommended strongly that you
Because of the changes of some APIs, we recommended strongly that you
use this version for new projects.
## THE RUNTIME MODES OF MINIGUI
@@ -164,64 +174,64 @@ You can configure and compile MiniGUI as one of three runtime modes:
* 'MiniGUI-Threads': A program running on MiniGUI-Threads can create
multiple cascaded windows in different threads, and all the windows
belong to a single process. MiniGUI-Threads is fit for some real-time
systems on Linux/uClinux, eCos, uC/OS-II, VxWorks, pSOS, ThreadX,
systems on Linux/uClinux, eCos, uC/OS-II, VxWorks, pSOS, ThreadX,
and OSE.
* 'MiniGUI-Processes': A program running on MiniGUI-Processes is
an independent process, which can also create multiple windows.
MiniGUI-Processes is fit for some complex embedded systems, such as
PDAs, Thin-Clients or STBs. This mode is only useful for full-featured
* 'MiniGUI-Processes': A program running on MiniGUI-Processes is
an independent process, which can also create multiple windows.
MiniGUI-Processes is fit for some complex embedded systems, such as
PDAs, Thin-Clients or STBs. This mode is only useful for full-featured
UNIX-like operating systems, like Linux.
* 'MiniGUI-Standalone': A single process version of MiniGUI. This mode
is useful for some small systems, like uClinux or RTOSes.
The original MiniGUI (version 1.0) run in MiniGUI-Threads mode.
It is based on POSIX-compliant thread library. And this thread-based
architecture of MiniGUI is very fit for most traditional embedded
operating systems, such as eCos, uC/OS-II, and VxWorks. However,
if you use embedded Linux, the architecture like X Window will have
better stability and scalability, because of the independent memory
It is based on POSIX-compliant thread library. And this thread-based
architecture of MiniGUI is very fit for most traditional embedded
operating systems, such as eCos, uC/OS-II, and VxWorks. However,
if you use embedded Linux, the architecture like X Window will have
better stability and scalability, because of the independent memory
address space of every process.
Since version 2.0, we provides a new runtime mode called MiniGUI-Processes.
You can use MiniGUI-Processes to run more than one MiniGUI-based
program in the form of UNIX process at the same time. MiniGUI-Processes
is a full-featured multi-process version of original MiniGUI -- You
can run a program based on MiniGUI-Processes from a program called
'mginit'. Just like X Window, the former process is called a client,
and the latter the server.
You can use MiniGUI-Processes to run more than one MiniGUI-based
program in the form of UNIX process at the same time. MiniGUI-Processes
is a full-featured multi-process version of original MiniGUI -- You
can run a program based on MiniGUI-Processes from a program called
'mginit'. Just like X Window, the former process is called a client,
and the latter the server.
Clients connect to the server via UNIX domain socket, and the server
receives and responses requests from clients. The server provides shared
resources for clients, manage window objects, and sends mouse
(or touch screen) and keyboard events to the active top-most client.
If a client exits or dies for some reasons, it will not damage other
Clients connect to the server via UNIX domain socket, and the server
receives and responses requests from clients. The server provides shared
resources for clients, manage window objects, and sends mouse
(or touch screen) and keyboard events to the active top-most client.
If a client exits or dies for some reasons, it will not damage other
clients and the server.
## HISTORY
About ten years have pasted since MiniGUI was initially created at
the end of 1998, and now it becomes much reliable and stable.
During the past years, many remarkable changes have taken place in
21 years have pasted since MiniGUI was initially created at
the end of 1998, and now it becomes much reliable and stable.
During the past years, many remarkable changes have taken place in
the MiniGUI project.
At the original, the version 0.2.xx was based on SVGALib and PThread
(LinuxThreads). Then the version 0.3.xx had many enhanced features
including Graphics Abstract Layer (GAL), Input Abstract Layer (IAL),
and the support for multiple charsets and multiple fonts.
At the original, the version 0.2.xx was based on SVGALib and PThread
(LinuxThreads). Then the version 0.3.xx had many enhanced features
including Graphics Abstract Layer (GAL), Input Abstract Layer (IAL),
and the support for multiple charsets and multiple fonts.
In version 1.0.00, we designed MiniGUI-Lite, which was more fit for
some complex embedded systems, such as PDAs, Thin-Clients, or STBs.
MiniGUI-Lite made the embedded systems more stable and efficient.
The version 1.0.00 provided the native fbcon engine based on Linux
frame buffer device directly as well.
In version 1.0.00, we designed MiniGUI-Lite, which was more fit for
some complex embedded systems, such as PDAs, Thin-Clients, or STBs.
MiniGUI-Lite made the embedded systems more stable and efficient.
The version 1.0.00 provided the native fbcon engine based on Linux
frame buffer device directly as well.
In the development of version 1.1.00, we re-wrote the GAL and GDI
interfaces, and provided some advanced video features, such as raster
operation, transparent blitting, alpha blending, and video hardware
acceleration. We also provided some important GDI functions, such as
In the development of version 1.1.00, we re-wrote the GAL and GDI
interfaces, and provided some advanced video features, such as raster
operation, transparent blitting, alpha blending, and video hardware
acceleration. We also provided some important GDI functions, such as
Ellipse, Arc, Polygon, and FloodFill.
In the development of version 1.6.0, we added advanced 2D graphics
@@ -238,7 +248,7 @@ A brief history description of the development progress lay below:
0) 1994 ~ 1996: MiniGUI DOS version.
1) Dec, 1998: Began to write.
2) Apr, 1999: The skeleton of MiniGUI, windowing sub-system
2) Apr, 1999: The skeleton of MiniGUI, windowing sub-system
and basic graphics device interfaces.
3) May, 1999: Timer, menu, and the skeleton of control sub-system.
4) Jun, 1999: Chinese input method (by Kang Xiaoning).
@@ -247,29 +257,29 @@ A brief history description of the development progress lay below:
7) Sep, 1999: Dialog boxes and message boxes.
8) Sep, 1999: Snapshot of screen or window.
9) Jan., 2000: VCOnGUI (Virtual Console on MiniGUI) version 0.2.02.
10) Mar., 2000: Linux distribution installer based-on MiniGUI for
10) Mar., 2000: Linux distribution installer based-on MiniGUI for
HappyLinux 1.0.
11) Jun., 2000: Began to develop version 1.0.xx.
12) Sep., 2000: MiniGUI version 0.3.06 released.
13) Oct., 2000: MiniGUI version 0.9.00 released.
14) Nov., 2000: MiniGUI version 0.9.96 released.
15) Jan., 2001: MiniGUI version 0.9.98 released. You can build
13) Oct., 2000: MiniGUI version 0.9.00 released.
14) Nov., 2000: MiniGUI version 0.9.96 released.
15) Jan., 2001: MiniGUI version 0.9.98 released. You can build
MiniGUI-Lite from this version.
16) Jan., 2001: MiniGUI version 1.0.00Beta1 released.
17) Feb., 2001: MiniGUI version 1.0.00Pre1 released.
18) Apr., 2001: MiniGUI version 1.0.00 released (2001/04/16).
18) Sep., 2001: MiniGUI version 1.1.0Pre1 released (2001/09/12).
19) Sep., 2001: MiniGUI version 1.0.9 released (2001/09/17),
this will be the last version of source branch 1.0.x.
20) Oct., 2001: MiniGUI version 1.1.0Pre4 released (2001/10/22).
19) Sep., 2001: MiniGUI version 1.0.9 released (2001/09/17),
this will be the last version of source branch 1.0.x.
20) Oct., 2001: MiniGUI version 1.1.0Pre4 released (2001/10/22).
This version have new GAL and GDI interfaces.
21) Mar., 2002: MiniGUI official version 1.1.0 released (2002/03/08).
21) Mar., 2002: MiniGUI official version 1.1.0 released (2002/03/08).
MiniGUI API Reference documentation version 0.9 released.
22) Mar., 2002: MiniGUI API Reference documentation version 1.0 released.
23) Apr., 2002: MiniGUI the new stable version 1.2.0 released (2002/04/11).
24) Sep., 2002: The main developers of MiniGUI founded a
new software corporation: Beijing FMSoft Technology Co., Ltd..
And the development and maintenance of MiniGUI changes from
23) Apr., 2002: MiniGUI the new stable version 1.2.0 released (2002/04/11).
24) Sep., 2002: The main developers of MiniGUI founded a
new software corporation: Beijing FMSoft Technology Co., Ltd..
And the development and maintenance of MiniGUI changes from
loosely-knit team to business organization.
25) Mar., 2003: MiniGUI official version 1.2.5 released (2003/03/23).
25) May., 2003: MiniGUI official version 1.2.6 released (2003/05/18).
@@ -295,18 +305,19 @@ A brief history description of the development progress lay below:
45) Aug., 2017: FMSoft released the latest source code of mDolphin under Apache 2.0.
46) Dec., 2017: FMSoft updated MiniGUI and miniStudio for latest Linux distributions.
47) Feb., 2018: FMSoft released MiniGUI version 3.2.
47) Jun., 2019: FMSoft released MiniGUI version 3.4.
## ABOUT THE AUTHORS
The original author of MiniGUI is WEI Yongming, and now MiniGUI is
maintained by FMSoft. For more information, please browse
The original author of MiniGUI is WEI Yongming, and now MiniGUI is
maintained by FMSoft. For more information, please browse
our home page: http://www.fmsoft.cn.
## IF YOU HAVE A PROBLEM
If you have any technical problem, advice or comment, please send
If you have any technical problem, advice or comment, please send
messages to consult@minigui.com.
@@ -314,15 +325,15 @@ messages to consult@minigui.com.
Q: Is GPL'd MiniGUI free for commercial use?
A: Simply no. FMSoft releases MiniGUI under GPLv3 license.
It is free for those who are 100% GPL and those who never copy, modify
and distribute MiniGUI. But if you want to use these GPL'd versions
A: Simply no. FMSoft releases MiniGUI under GPLv3 license.
It is free for those who are 100% GPL and those who never copy, modify
and distribute MiniGUI. But if you want to use these GPL'd versions
for commerce, you should get the commercial license from FMSoft first.
Q: Which operating system does MiniGUI support?
A: MiniGUI can run on Linux/uClinux, uC/OS-II, eCos, ThreadX, pSOS,
VxWorks, ThreadX, OSE, and even Win32. Any other real-time OSes can
A: MiniGUI can run on Linux/uClinux, uC/OS-II, eCos, ThreadX, pSOS,
VxWorks, ThreadX, OSE, and even Win32. Any other real-time OSes can
be supported theoretically.
Q: Which architecture does MiniGUI support?
@@ -332,19 +343,19 @@ A: x86 32/64-bit, ARM 32/64-bit (e.g., ARMv7 and ARM Cortex-A7),
Q: Does MiniGUI offer the support for grey LCD with 4bpp (bits per pixel)?
A: Yes, it offers. It even offers the support for 1bpp and 2bpp LCD.
A: Yes, it offers. It even offers the support for 1bpp and 2bpp LCD.
## NOT FREE FOR COMMERCIAL USE
MiniGUI and its components are licensed under the GPL license.
So any links about MiniGUI must follow GPL. If you cannot accept GPL,
you need to be licensed from FMSoft. If you wonder that if you need
MiniGUI and its components are licensed under the GPL license.
So any links about MiniGUI must follow GPL. If you cannot accept GPL,
you need to be licensed from FMSoft. If you wonder that if you need
the commercial license of MiniGUI, please refer to the LICENSE-POLICY file.
We provide you the commercial license of MiniGUI according to the number
of the run-time binary copies of MiniGUI. If you are interested in
the commercial license of MiniGUI, please write to sales@minigui.com.
We provide you the commercial license of MiniGUI according to the number
of the run-time binary copies of MiniGUI. If you are interested in
the commercial license of MiniGUI, please write to sales@minigui.com.
## COPYING
+138 -4
View File
@@ -1,8 +1,142 @@
# Release Notes
## Version 3.2.2
## Version 3.4.0
The MiniGUI development team announces the availability of MiniGUI 3.2.2.
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
In this version, we mainly enhanced and tuned the APIs of font rendering.
#### 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_GREY`:
1. `FS_RENDER_SUBPIXEL`:
* Some old styles are deprecated:
1. `FS_WEIGHT_BOOK`; use `FS_RENDER_GREY` instead.
1. `FS_WEIGHT_SUBPIXEL`; use `FS_RENDER_SUBPIXEL` instead.
* Introduced or redefined the weight styles to follow OpenType specification:
1. `FONT_WEIGHT_ANY`: Not specified
1. `FONT_WEIGHT_THIN`: Thin.
1. `FONT_WEIGHT_EXTRA_LIGHT`: Extra light (Ultra Light).
1. `FONT_WEIGHT_LIGHT`: Light.
1. `FONT_WEIGHT_REGULAR`: Regular (Normal).
1. `FONT_WEIGHT_MEDIUM`: Medium.
1. `FONT_WEIGHT_DEMIBOLD`: Demi Bold (Semi Bold)
1. `FONT_WEIGHT_BOLD`: Bold.
1. `FONT_WEIGHT_EXTRA_BOLD`: Extra Bold (Ultra Bold).
1. `FONT_WEIGHT_BLACK`: Black (Heavy).
* Introduce the new decoration styles and replace
`FONT_UNDERLINE_LINE` and `FONT_STRUCKOUT_LINE` with them:
1. `FONT_DECORATE_ANY`: Not specified.
1. `FONT_DECORATE_NONE`: None.
1. `FONT_DECORATE_UNDERLINE`: glyphs are underscored.
1. `FONT_DECORATE_STRUCKOUT`: glyphs are overstruck.
1. `FONT_DECORATE_US`: Both `FONT_DECORATE_UNDERLINE` and `FONT_DECORATE_STRUCKOUT`.
1. `FONT_DECORATE_OUTLINE`: Outline (hollow) glyphs.
1. `FONT_DECORATE_REVERSE`: Reverved for future. Glyphs have their foreground and background reversed.
* The following style are deprecated:
1. `FONT_OTHER_LCDPORTRAIT`
1. `FONT_OTHER_LCDPORTRAITKERN`
For a new app, you should use the new function `CreateLogFontEx` to
create a LOGFONT, and specify the weight and rendering method of the glyph.
For the back-compatibility, you can still use `CreateLogFont` to create a new
LOGFONT. However, `FS_WEIGHT_BOOK` will be treated `FS_WEIGHT_REGULAR` and
`FS_RENDER_GREY`, while `FS_WEIGHT_SUBPIXEL` will be treated
`FS_WEIGHT_REGULAR` and `FS_RENDER_SUBPIXEL`.
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>
Note that `<underline>` and `<struckout>` are merged to `<decoration>`
in order to keep the style string is still 6-character long.
Consequently, if you want to use the rendering method SUPIXEL for a TTF font,
please define the logical font name in the following way:
ttf-Courier-rrncns-*-16-UTF-8
Moreover, the family name of a DEVFONT supports aliases since 3.4.0:
<fonttype>-<family[,aliase]*>-<styles>-<width>-<height>-<charset[,charset]*>
for example:
ttf-Arial,Sans Serif-rrncnn-8-16-ISO8859-1,UTF-8
ttf-courier,monospace,serif-rrncnn-8-16-ISO8859-1,UTF-8
Note that the length of one DEVFONT name can not exceed 255 bytes.
#### Changed APIs
* The fields `height` and `descent` have been removed from GLYPHINFO struct.
One should get the font metrics information by calling `GetFontMetrics` function
if you want to get the height and descent data of one font.
* More fields added for GLYPHBITMAP struct in order to return the completed
rasterized glyph bitmap information.
* `GetGlyphInfo` now can return the basic glyph type and break type of a
UNICODE character. If the glyph is an ASCII character, the old `MCHAR_TYPE`
can also be returned.
* Rename `mg_FT_LcdFilter` to `FT2LCDFilter` in order to follow MiniGUI naming
rules.
* Rename `UChar32` to `Uchar32` and `UChar16` to `Uchar16` in order to
avoid the conflict with typedef of UChar32 in 'unicode/umachine.h'.
* Redefine `Uchar32` and `Glyph32` as `Uint32` instead of `int`.
#### New APIs
* `GetGlyphsByRules` function calculates and allocates the glyph string from
a multi-byte string under the specified white space rule and transformation
rule.
* `GetGlyphsExtentPointEx` function gets the visual extent information
of a glyph string which can fit in a line with the specified maximal extent.
* `DrawGlyphStringEx` function draws a glyph string to the specific
positions of a DC.
* `CreateLogFontIndirectEx` creates a new LOGFONT by using the value of
an existed LOGFONT but with a new rotation value.
#### Others
* Support for FreeType1 removed.
You should always use FreeType2 to support vector fonts, such as TrueType
fonts (TTF), TrueType collections (TTC), OpenType fonts (OTF, both TrueType
and CFF variants), OpenType collections (OTC), and Type 1 fonts (PFA and PFB).
### Other Changes
* A new BITMAP type: `BMP_TYPE_REPLACEKEY`. When `bmType` of a BITMAP object
has this bit set, any pixel which is equal to `bmColorKey` will be replaced by
`bmColorRep`.
## 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
@@ -24,8 +158,8 @@ Please report any bugs and incompatibilities in
1. New API: `UpdateInvalidClient`. You can use this function to update
the invalid client region of a window instantly.
1. Use different colors for the output of `_DBG_PRINTF` and `_ERR_PRINTF`.
1. Add `__mg_save_jpg` function for storing MYBITMAP as JPEG file (10km).
1. Modified logic for checking JPEG format (10km).
1. Add `__mg_save_jpg` function for storing MYBITMAP as JPEG file (@10km).
1. Modified logic for checking JPEG format (@10km).
1. Support BIDI for UNICODE charsets and cleanup the implementation.
* New API: `GetGlyphBIDIType` to get the glyph type in BIDI.
* New DC attribute: BIDI flag.
+3 -3
View File
@@ -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
+36 -25
View File
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(libminigui, 3.2.2)
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=2
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
@@ -2000,7 +2003,7 @@ case "$use_ttf_lib" in
[Define if include ttf cache])
AC_ARG_WITH(ttfcachesize,
[ --with-ttfcachesize=[64/128/256/512/1024]])
[ --with-ttfcachesize=[64/128/256/512/1024/2048]])
case "$with_ttfcachesize" in
64)
@@ -2023,30 +2026,38 @@ case "$use_ttf_lib" in
AC_DEFINE(_MGTTF_CACHE_SIZE, 1024,
[Define if compile max ttf cahce size for 1024k])
;;
2048)
AC_DEFINE(_MGTTF_CACHE_SIZE, 2048,
[Define if compile max ttf cahce size for 2048k])
;;
*)
AC_DEFINE(_MGTTF_CACHE_SIZE, 256,
[Define if compile max ttf cahce size for 256k])
AC_DEFINE(_MGTTF_CACHE_SIZE, 1024,
[Define if compile max ttf cahce size for 1024k (default value)])
;;
esac
AC_ARG_WITH(ttfcachenum,
[ --with-mttfcachenum=[10/20/40]])
[ --with-mttfcachenum=[16/32/64/128]])
case "$with_mttfcachenum" in
10)
AC_DEFINE(_MGMAX_TTF_CACHE, 10,
[Define if compile max ttf cahce number for 10])
16)
AC_DEFINE(_MGMAX_TTF_CACHE, 16,
[Define if compile max ttf cahce number for 16])
;;
20)
AC_DEFINE(_MGMAX_TTF_CACHE, 20,
[Define if compile max ttf cahce number for 20])
32)
AC_DEFINE(_MGMAX_TTF_CACHE, 32,
[Define if compile max ttf cahce number for 32])
;;
40)
AC_DEFINE(_MGMAX_TTF_CACHE, 40,
[Define if compile max ttf cahce number for 40])
64)
AC_DEFINE(_MGMAX_TTF_CACHE, 64,
[Define if compile max ttf cahce number for 64])
;;
128)
AC_DEFINE(_MGMAX_TTF_CACHE, 128,
[Define if compile max ttf cahce number for 128])
;;
*)
AC_DEFINE(_MGMAX_TTF_CACHE, 10,
[Define if compile max ttf cahce number for 10 (default value)])
AC_DEFINE(_MGMAX_TTF_CACHE, 32,
[Define if compile max ttf cahce number for 32 (default value)])
;;
esac
fi
+5 -5
View File
@@ -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 &lt; LEN_FONT_NAME + 1; i++) {
501 for (i = 0; i &lt; 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;
+12 -12
View File
@@ -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);
+14
View File
@@ -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);
+81 -67
View File
@@ -2,13 +2,13 @@
* \file common.h
* \author Wei Yongming <vincent@minigui.org>
* \date 2002/01/06
*
* \brief This file includes macro definitions and typedefs that commonly used
*
* \brief This file includes macro definitions and typedefs that commonly used
* by 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.
@@ -46,10 +46,10 @@
/*
* $Id: common.h 13674 2010-12-06 06:45:01Z wanzheng $
*
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
* pSOS, ThreadX, NuCleus, OSE, and Win32.
*
* The definitions of some data types and byte order macros
* The definitions of some data types and byte order macros
* borrowed from LGPL'ed SDL by Sam Lantinga.
*
* Fix point math routines come from Allegro (a gift software)
@@ -109,11 +109,11 @@
/**
* \def _VERSION_CODE(major, minor, micro)
* \brief A macro that returns the version code from \a major, \a minor
* \brief A macro that returns the version code from \a major, \a minor
* and \a micro version number.
*
* MiniGUI uses this macro to evaluate the version code of current MiniGUI
* library installed in your system, and define it to _MINIGUI_VERSION_CODE.
* MiniGUI uses this macro to evaluate the version code of current MiniGUI
* library installed in your system, and define it to _MINIGUI_VERSION_CODE.
*
* \sa _MINIGUI_VERSION_CODE
*/
@@ -333,7 +333,7 @@ typedef int BOOL;
# if defined(__MINIGUI_LIB__)
# define MG_EXPORT __declspec(dllexport)
# else
# define MG_EXPORT __declspec(dllimport)
# define MG_EXPORT __declspec(dllimport)
# endif
#else
# define MG_EXPORT
@@ -463,7 +463,7 @@ typedef signed char SBYTE;
/**
* \var WORD_HPTR
* \brief An unsigned int (word) type in half pointer precision.
* \brief An unsigned int (word) type in half pointer precision.
*/
#if defined(_WIN64)
typedef unsigned int WORD_HPTR;
@@ -475,7 +475,7 @@ typedef unsigned short WORD_HPTR;
/**
* \var SWORD_HPTR
* \brief An signed int type in half pointer precision.
* \brief An signed int type in half pointer precision.
*/
#if defined(_WIN64)
typedef signed int SWORD_HPTR;
@@ -486,13 +486,13 @@ typedef signed short SWORD_HPTR;
#endif
/**
* \var WORD
* \var WORD
* \brief A type definition for an unsigned integer (word).
*/
typedef WORD_HPTR WORD;
/**
* \var SWORD
* \var SWORD
* \brief A type definition for a signed integer.
*/
typedef SWORD_HPTR SWORD;
@@ -511,7 +511,7 @@ typedef signed short SWORD16;
/**
* \var LONG_PTR
* \brief A signed long type for pointer precision.
* \brief A signed long type for pointer precision.
*/
#if defined(_WIN64)
typedef __int64 LONG_PTR;
@@ -535,9 +535,9 @@ typedef LONG_PTR LRESULT;
/**
* \var DWORD_PTR
* \brief An unsigned long type for pointer precision.
* \brief An unsigned long type for pointer precision.
*
* Commonly used for general 32-bit parameters that have been extended
* Commonly used for general 32-bit parameters that have been extended
* to 64 bits in 64-bit platform.
*/
#if defined(_WIN64)
@@ -562,9 +562,9 @@ typedef unsigned int DWORD32;
/**
* \var SDWORD_PTR
* \brief A signed long type for pointer precision.
* \brief A signed long type for pointer precision.
*
* Commonly used for general 32-bit parameters that have been extended
* Commonly used for general 32-bit parameters that have been extended
* to 64 bits in 64-bit platform.
*/
#if defined(_WIN64)
@@ -694,6 +694,20 @@ typedef UINT_PTR LPARAM;
*/
#define MAKEWORD16(low, high) ((WORD16)(((BYTE)(low)) | (((WORD16)((BYTE)(high))) << 8)))
/**
* \def MAKEWORD32(first, second, third, fourth)
* \brief Makes a WORD32 value with four bytes.
*
* \sa MAKEWORD16, FIRSTBYTE, SECONDBYTE, THIRDBYTE, FOURTHBYTE
*/
#define MAKEDWORD32(first, second, third, fourth) \
((DWORD32)( \
((BYTE)(first)) | \
(((DWORD32)((BYTE)(second))) << 8) | \
(((DWORD32)((BYTE)(third))) << 16) | \
(((DWORD32)((BYTE)(fourth))) << 24) \
))
/**
* \def MAKEWPARAM(first, second, third, fourth)
* \brief Makes a WPARAM value with four bytes.
@@ -829,7 +843,7 @@ typedef DWORD32 RGBCOLOR;
/**
* \def MakeRGBA(r, g, b, a)
* \brief Makes a RGBA triple value from red \a r, green \a g,
* \brief Makes a RGBA triple value from red \a r, green \a g,
* blue \a b and alpha \a components.
*
* \note The red, green, blue and alpha components are all ranged from 0 to 255,
@@ -953,7 +967,7 @@ typedef struct _RGB
*/
BYTE b;
/**
* Reserved for alignment, maybe used for the alpha component of a RGB triple.
* Reserved for alignment, maybe used for the alpha component of a RGB triple.
*/
BYTE a;
} RGB;
@@ -962,7 +976,7 @@ typedef struct _RGB
* \var typedef RGB* PRGB
* \brief Data type of the pointer to a RGB.
*
* \sa RGB
* \sa RGB
*/
typedef RGB* PRGB;
@@ -1029,7 +1043,7 @@ typedef signed int gal_sint;
typedef unsigned int gal_uint;
/**
* \var typedef Uint32 gal_pixel
* \var typedef Uint32 gal_pixel
* \brief Data type of pixel value
*/
typedef Uint32 gal_pixel;
@@ -1087,7 +1101,7 @@ typedef struct _GAL_Palette
/**
* A rectangle defined by upper-left coordinates and width/height.
* \sa RECT
* \sa RECT
*/
typedef struct _GAL_Rect {
/**
@@ -1113,11 +1127,11 @@ typedef struct _GAL_Rect {
*
* The number of MiniGUI keys is defined to 255 by default. This means that
* MiniGUI can destinguish 255 different keys with each has an unique scan code.
* The scan codes below 129 are defined for PC keyboard by default.
* If your system has a large amount of keys, you can define the scan code of
* keys ranged from 1 to 255 in your IAL engine. And your application will
* receive a MSG_KEYDOWN and MSG_KEYUP messages when a key pressed and
* released, and the wParam of the messages will be defined to be equal to
* The scan codes below 129 are defined for PC keyboard by default.
* If your system has a large amount of keys, you can define the scan code of
* keys ranged from 1 to 255 in your IAL engine. And your application will
* receive a MSG_KEYDOWN and MSG_KEYUP messages when a key pressed and
* released, and the wParam of the messages will be defined to be equal to
* the scan code of the key.
*
* \sa NR_KEYS, SCANCODE_USER
@@ -1126,11 +1140,11 @@ typedef struct _GAL_Rect {
/**
* \def NR_KEYS
* \brief The number of keys defined by Linux operating system.
* \brief The number of keys defined by Linux operating system.
*
* For a PC box, NR_KEYS is defined to 128 by default. You can define
* some input events from an input device other than keyboard, e.g.
* your remote controller, as key events with different scan codes from
* some input events from an input device other than keyboard, e.g.
* your remote controller, as key events with different scan codes from
* those of PC's. MiniGUI can support 255 keys, and the constant
* is defined by MGUI_NR_KEYS.
*
@@ -1305,7 +1319,7 @@ typedef struct _GAL_Rect {
/**
* \def KS_REPEATED
* \brief This status indicate that the key down message is an
* \brief This status indicate that the key down message is an
* auto-repeated one.
*
* You can test the status by AND'ed with lParam of the message, like below:
@@ -1327,7 +1341,7 @@ typedef struct _GAL_Rect {
/**
* \def KS_CAPTURED
* \brief This status indicate that the mouse is captured by a window when
* \brief This status indicate that the mouse is captured by a window when
* the mouse message posted.
*
* You can test the status by AND'ed with wParam of the message, like below:
@@ -1357,7 +1371,7 @@ typedef struct _GAL_Rect {
/**
* \def KS_CAPSLOCK
* \brief This status indicate that the CapsLock key was locked when
* \brief This status indicate that the CapsLock key was locked when
* the key or mouse message posted to the window.
*
* You can test the status by AND'ed with lParam of the message, like below
@@ -1379,7 +1393,7 @@ typedef struct _GAL_Rect {
/**
* \def KS_NUMLOCK
* \brief This status indicate that the NumLock key was locked when
* \brief This status indicate that the NumLock key was locked when
* the key or mouse message posted to the window.
*
* \sa key_msgs
@@ -1415,7 +1429,7 @@ typedef struct _GAL_Rect {
/**
* \def KS_CTRL
* \brief This status indicate that either the left-Ctrl key or the right-Ctrl key
* \brief This status indicate that either the left-Ctrl key or the right-Ctrl key
* was pressed when the key or mouse message posted to the window.
*
* \sa key_msgs
@@ -1442,7 +1456,7 @@ typedef struct _GAL_Rect {
/**
* \def KS_ALT
* \brief This status indicate that either the left-Alt key or the right-Alt key
* \brief This status indicate that either the left-Alt key or the right-Alt key
* was pressed when the key or mouse message posted to the window.
*
* \sa key_msgs
@@ -1469,7 +1483,7 @@ typedef struct _GAL_Rect {
/**
* \def KS_SHIFT
* \brief This status indicate that either the left-Shift key or the right-Shift key
* \brief This status indicate that either the left-Shift key or the right-Shift key
* was pressed when the key or mouse message posted to the window.
*
* \sa key_msgs
@@ -1484,7 +1498,7 @@ typedef struct _GAL_Rect {
/**
* \def KS_LEFTBUTTON
* \brief This status indicate that left button was pressed when
* \brief This status indicate that left button was pressed when
* the key or mouse message posted to the window.
*
* \sa key_msgs
@@ -1493,7 +1507,7 @@ typedef struct _GAL_Rect {
/**
* \def KS_RIGHTBUTTON
* \brief This status indicate that right button was pressed when
* \brief This status indicate that right button was pressed when
* the key or mouse message posted to the window.
*
* \sa key_msgs
@@ -1502,7 +1516,7 @@ typedef struct _GAL_Rect {
/**
* \def KS_MIDDLBUTTON
* \brief This status indicate that middle button was pressed when
* \brief This status indicate that middle button was pressed when
* the key or mouse message posted to the window.
*
* \sa key_msgs
@@ -1535,37 +1549,37 @@ typedef struct _GAL_Rect {
/**
* \def ERR_QUEUE_FULL
* \brief Return value queue is full error.
* \brief Return value queue is full error.
*/
#define ERR_QUEUE_FULL -2
/**
* \def ERR_INVALID_HANDLE
* \brief Return value invalid handle error.
* \brief Return value invalid handle error.
*/
#define ERR_INVALID_HANDLE -3
/**
* \def ERR_INVALID_HMENU
* \brief Return value invalid menu handle error.
* \brief Return value invalid menu handle error.
*/
#define ERR_INVALID_HMENU -4
/**
* \def ERR_INVALID_POS
* \brief Return value invalid postion error.
* \brief Return value invalid postion error.
*/
#define ERR_INVALID_POS -5
/**
* \def ERR_INVALID_ID
* \brief Return value invalid id error.
* \brief Return value invalid id error.
*/
#define ERR_INVALID_ID -6
/**
* \def ERR_RES_ALLOCATION
* \brief Return value allocation resource error .
* \brief Return value allocation resource error .
*/
#define ERR_RES_ALLOCATION -7
@@ -1589,7 +1603,7 @@ typedef struct _GAL_Rect {
/**
* \def ERR_CTRLCLASS_INUSE
* \brief Return value inuse control class error.
* \brief Return value inuse control class error.
*/
#define ERR_CTRLCLASS_INUSE -11
@@ -1649,7 +1663,7 @@ typedef struct _GAL_Rect {
/**
* \def ERR_INPUT_ENGINE
* \brief Return value input engine error.
* \brief Return value input engine error.
*/
#define ERR_INPUT_ENGINE -21
@@ -1769,12 +1783,12 @@ struct tm {
#define fseek tp_fseek
#define feof tp_feof
#undef assert
#define _HAVE_ASSERT 1
#undef assert
#define _HAVE_ASSERT 1
#define assert(e) do { \
e; \
} while (0)
} while (0)
#undef stdin
#undef stdout
@@ -1811,13 +1825,13 @@ MG_EXPORT int strncasecmp(const char *s1, const char *s2, unsigned int n);
#ifdef _MGUSE_OWN_MALLOC
/**
/**
* \fn int init_minigui_malloc (unsigned char* heap, unsigned int heap_size, \
int (*lock_heap) (void), int (*unlock_heap) (void))
* \brief Initialize MiniGUI's own heap system.
*
* MiniGUI implements a heap system which is compatbile with ANIS C. When you
* RTOS does not provide a re-entriable malloc implementation, you can use MiniGUI's
* RTOS does not provide a re-entriable malloc implementation, you can use MiniGUI's
* heap system.
*
* Before using MiniGUI's own heap system, you should provide a memory range to be
@@ -1830,7 +1844,7 @@ MG_EXPORT int strncasecmp(const char *s1, const char *s2, unsigned int n);
*
* \return Zero on success, non-zero on error.
*/
int init_minigui_malloc (unsigned char* heap, unsigned int heap_size,
int init_minigui_malloc (unsigned char* heap, unsigned int heap_size,
int (*lock_heap) (void), int (*unlock_heap) (void));
#define USE_DL_PREFIX
@@ -1876,7 +1890,7 @@ int init_minigui_malloc (unsigned char* heap, unsigned int heap_size,
*
* \return Zero no success, non-zero on error.
*/
int init_minigui_printf (int (*output_char) (int ch),
int init_minigui_printf (int (*output_char) (int ch),
int (*input_char) (void));
#if defined (__UCOSII__) || defined (__VXWORKS__) || defined (__NUCLEUS__) || defined (__PSOS__)
@@ -2085,7 +2099,7 @@ int init_minigui_printf (int (*output_char) (int ch),
*
* This function initializes MiniGUI's own POSIX Threads system.
* If pth_entry is not NULL, this function will create a detached pthread
* as the main pthread, and call pth_entry with the arguments passed to
* as the main pthread, and call pth_entry with the arguments passed to
* this function.
*
* Note for pSOS, this function will ignore the stack_base, cause pSOS kernel
@@ -2100,8 +2114,8 @@ int init_minigui_printf (int (*output_char) (int ch),
*
* \return Zero on success, non-zero on error.
*/
int start_minigui_pthread (int (* pth_entry) (int argc, const char* argv []),
int argc, const char* argv[],
int start_minigui_pthread (int (* pth_entry) (int argc, const char* argv []),
int argc, const char* argv[],
char* stack_base, unsigned int stack_size);
#ifndef ESRCH
@@ -2261,17 +2275,17 @@ int _sysvipc_mutex_sem_term (void);
#define pthread_mutex_t _sysvipc_pthread_mutex_t
#define pthread_mutexattr_t _sysvipc_pthread_mutexattr_t
#define pthread_mutexattr_init _sysvipc_pthread_mutexattr_init
#define pthread_mutexattr_destroy _sysvipc_pthread_mutexattr_destroy
#define pthread_mutexattr_settype _sysvipc_pthread_mutexattr_settype
#define pthread_mutexattr_init _sysvipc_pthread_mutexattr_init
#define pthread_mutexattr_destroy _sysvipc_pthread_mutexattr_destroy
#define pthread_mutexattr_settype _sysvipc_pthread_mutexattr_settype
#define pthread_mutexattr_gettype _sysvipc_pthread_mutexattr_gettype
#define pthread_init _sysvipc_pthread_init
#define pthread_mutex_init _sysvipc_pthread_mutex_init
#define pthread_init _sysvipc_pthread_init
#define pthread_mutex_init _sysvipc_pthread_mutex_init
#define pthread_mutex_destroy _sysvipc_pthread_mutex_destroy
#define pthread_mutex_lock _sysvipc_pthread_mutex_lock
#define pthread_mutex_trylock _sysvipc_pthread_mutex_trylock
#define pthread_mutex_unlock _sysvipc_pthread_mutex_unlock
#define pthread_mutex_lock _sysvipc_pthread_mutex_lock
#define pthread_mutex_trylock _sysvipc_pthread_mutex_trylock
#define pthread_mutex_unlock _sysvipc_pthread_mutex_unlock
typedef struct
{
+3 -3
View File
@@ -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.
*
*/
+3972 -1716
View File
File diff suppressed because it is too large Load Diff
+339 -339
View File
File diff suppressed because it is too large Load Diff
+1011 -1011
View File
File diff suppressed because it is too large Load Diff
+426 -428
View File
File diff suppressed because it is too large Load Diff
+37 -38
View File
@@ -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);
+9 -9
View File
@@ -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;
+13 -7
View File
@@ -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);
}
+10 -6
View File
@@ -3,21 +3,25 @@ SUBDIRS = in-core
noinst_LTLIBRARIES = libfont.la
SRC_FILES = charset.c charset-arabic.c charset-bidi.c \
unicode-comp.c unicode-script.c language-code.c \
sysfont.c logfont.c devfont.c fontname.c \
rawbitmap.c varbitmap.c qpf.c upf.c \
fontcache.c 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
bitmapfont.c scripteasy.c \
unicode-emoji.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 se_minigui.h \
upf.h bitmapfont.h unicode-bidi-tables.h \
unicode-tables.h unicode-break.h unicode-decomp.h unicode-comp.h unicode-emoji-table.h
EXTRA_DIST = convgbmap.c jisunimap.c $(SRC_FILES) $(HDR_FILES) \
makefile.ng makefile.msvc
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)
+95 -90
View File
File diff suppressed because it is too large Load Diff
+196 -192
View File
File diff suppressed because it is too large Load Diff
+117 -94
View File
@@ -133,7 +133,7 @@ static void print_run_types(TYPERUN *pp)
fprintf (stderr, "\n");
}
static void print_hexstr(Glyph32* str, int len, BOOL reorder_state)
static void print_hexstr(Achar32* str, int len, BOOL reorder_state)
{
int m = 0;
@@ -154,7 +154,7 @@ static void print_hexstr(Glyph32* str, int len, BOOL reorder_state)
#else /* BIDI_DEBUG */
inline static void print_hexstr(Glyph32* str, int len, BOOL reorder_state)
inline static void print_hexstr(Achar32* str, int len, BOOL reorder_state)
{
return;
}
@@ -218,7 +218,7 @@ static void compact_neutrals (TYPERUN *list)
(p) = (q); \
} while (0)
static TYPERUN* get_runtype_link (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len)
static TYPERUN* get_runtype_link (const CHARSETOPS* charset_ops, Achar32* achars, int len)
{
int type = 0;
TYPERUN *list, *last, *link;
@@ -231,7 +231,7 @@ static TYPERUN* get_runtype_link (const CHARSETOPS* charset_ops, Glyph32* glyphs
last = list;
for (i = 0; i < len; i++){
if ((type = charset_ops->bidi_glyph_type (glyphs[i])) != last->type){
if ((type = charset_ops->bidi_char_type (achars[i])) != last->type){
link = calloc(1, sizeof(TYPERUN));
link->type = type;
link->pos = i;
@@ -473,7 +473,7 @@ static int bidi_resolveImplicit(TYPERUN **ptype_rl_list, int base_level)
/* 6.Resolving Mirrored Char. */
static void
bidi_resolveMirrorChar (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len,
bidi_resolveMirrorChar (const CHARSETOPS* charset_ops, Achar32* achars, int len,
TYPERUN **ptype_rl_list, int base_level)
{
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
@@ -486,53 +486,18 @@ bidi_resolveMirrorChar (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len,
int i;
for (i = POS (pp); i < POS (pp) + LEN (pp); i++)
{
Glyph32 mirrored_ch;
if (charset_ops->bidi_mirror_glyph && charset_ops->bidi_mirror_glyph (glyphs[i], &mirrored_ch))
glyphs[i] = mirrored_ch;
Achar32 mirrored_ch;
if (charset_ops->bidi_mirror_char && charset_ops->bidi_mirror_char (achars[i], &mirrored_ch))
achars[i] = mirrored_ch;
}
}
}
}
DBGLOG (" Mirroring, Done\n");
}
static void bidi_map_reverse (void* context, int len, int pos)
{
GLYPHMAPINFO* str = (GLYPHMAPINFO*)context + pos;
int i;
for (i = 0; i < len / 2; i++)
{
GLYPHMAPINFO tmp = str[i];
str[i] = str[len - 1 - i];
str[len - 1 - i] = tmp;
}
}
static void bidi_index_reverse (void* context, int len, int pos)
{
char* str = (char*)context + pos;
int i;
for (i = 0; i < len / 2; i++)
{
char tmp = str[i];
str[i] = str[len - 1 - i];
str[len - 1 - i] = tmp;
}
}
static void bidi_string_reverse (void* context, int len, int pos)
{
Glyph32* str = (Glyph32*)context + pos;
int i;
for (i = 0; i < len / 2; i++)
{
Glyph32 tmp = str[i];
str[i] = str[len - 1 - i];
str[len - 1 - i] = tmp;
}
}
static void bidi_resolve_string (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len,
static void bidi_resolve_string (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int pel,
TYPERUN **ptype_rl_list, BYTE *pmax_level)
{
BYTE base_level = 0;
@@ -540,10 +505,16 @@ static void bidi_resolve_string (const CHARSETOPS* charset_ops, Glyph32* glyphs,
TYPERUN *type_rl_list = NULL;
/* split the text to some runs. */
type_rl_list = get_runtype_link (charset_ops, glyphs, len);
type_rl_list = get_runtype_link (charset_ops, achars, len);
/* 1.Find base level */
bidi_resolveParagraphs(&type_rl_list, &base_dir, &base_level);
if (pel != 0 && pel != 1) {
bidi_resolveParagraphs(&type_rl_list, &base_dir, &base_level);
}
else {
base_level = pel;
base_dir = BIDI_LEVEL_TO_DIR (base_level);
}
/* 2.Resolving Explicit levels.*/
bidi_resolveExplicit(&type_rl_list, base_dir);
@@ -558,13 +529,31 @@ static void bidi_resolve_string (const CHARSETOPS* charset_ops, Glyph32* glyphs,
*pmax_level = bidi_resolveImplicit(&type_rl_list, base_level);
/* 6.Resolving Mirrored Char. */
bidi_resolveMirrorChar (charset_ops, glyphs, len, &type_rl_list, base_level);
bidi_resolveMirrorChar (charset_ops, achars, len, &type_rl_list, base_level);
*ptype_rl_list = type_rl_list;
}
static void bidi_reorder_cb (void* context, int len,
TYPERUN **ptype_rl_list, BYTE max_level, CB_DO_REORDER cb)
typedef struct _REORDER_CONTEXT {
Achar32* achars;
void* extra;
CB_REVERSE_EXTRA cb;
} REORDER_CONTEXT;
static void bidi_reverse_achars (Achar32* achars, int len, int pos)
{
int i;
Achar32* gs = achars + pos;
for (i = 0; i < len / 2; i++) {
Achar32 tmp = gs[i];
gs[i] = gs[len - 1 - i];
gs[len - 1 - i] = tmp;
}
}
static void bidi_reorder (REORDER_CONTEXT* context, int len,
TYPERUN **ptype_rl_list, BYTE max_level)
{
int i = 0;
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
@@ -583,44 +572,82 @@ static void bidi_reorder_cb (void* context, int len,
pp1 = pp1->next;
}
pp = pp1->prev;
cb(context, len, pos);
if (context->achars) {
bidi_reverse_achars(context->achars, len, pos);
}
if (context->extra && context->cb) {
context->cb(context->extra, len, pos);
}
}
}
}
DBGLOG("\nReordering, Done\n");
}
void __mg_charset_bidi_get_embeddlevels (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len,
Uint8* embedding_level_list, Uint8 type)
static void bidi_reverse_chars (void* context, int len, int pos)
{
char* str = (char*)context + pos;
int i;
for (i = 0; i < len / 2; i++)
{
char tmp = str[i];
str[i] = str[len - 1 - i];
str[len - 1 - i] = tmp;
}
}
void __mg_charset_bidi_get_embeddlevels (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int pel, Uint8* embedding_levels, Uint8 type)
{
int i = 0;
BYTE max_level = 1;
TYPERUN *type_rl_list = NULL, *pp;
print_hexstr(glyphs, len, FALSE);
print_hexstr(achars, len, FALSE);
/* W1~W7, N1~N2, I1~I2, Get the Embedding Level. */
bidi_resolve_string (charset_ops, glyphs, len, &type_rl_list, &max_level);
bidi_resolve_string (charset_ops, achars, len, pel, &type_rl_list,
&max_level);
/* type = 0, get the logical embedding level; else visual level.*/
for (pp = type_rl_list->next; pp->next; pp = pp->next){
int pos = POS (pp), len = LEN (pp);
for(i = 0; i < len; i++)
embedding_level_list[pos + i] = LEVEL(pp);
embedding_levels[pos + i] = LEVEL(pp);
}
if (type) {
bidi_reorder_cb(embedding_level_list, len, &type_rl_list, max_level,
bidi_index_reverse);
REORDER_CONTEXT rc;
rc.achars = NULL;
rc.extra = embedding_levels;
rc.cb = bidi_reverse_chars;
bidi_reorder(&rc, len, &type_rl_list, max_level);
}
/* free typerun list.*/
free_typerun_list(type_rl_list);
print_hexstr(glyphs, len, TRUE);
print_hexstr(achars, len, TRUE);
}
Glyph32* __mg_charset_bidi_map_reorder (const CHARSETOPS* charset_ops, Glyph32* glyphs,
int len, GLYPHMAPINFO* map)
#if 0
static void bidi_map_reverse (void* context, int len, int pos)
{
GLYPHMAPINFO* str = (GLYPHMAPINFO*)context + pos;
int i;
for (i = 0; i < len / 2; i++)
{
GLYPHMAPINFO tmp = str[i];
str[i] = str[len - 1 - i];
str[len - 1 - i] = tmp;
}
}
Achar32* __mg_charset_bidi_map_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, GLYPHMAPINFO* map, int pel)
{
BYTE max_level = 1;
TYPERUN *type_rl_list = NULL;
@@ -629,14 +656,12 @@ Glyph32* __mg_charset_bidi_map_reorder (const CHARSETOPS* charset_ops, Glyph32*
int run_pos;
int run_len;
print_hexstr(glyphs, len, FALSE);
print_hexstr(achars, len, FALSE);
/* W1~W7, N1~N2, I1~I2, Get the Embedding Level. */
bidi_resolve_string (charset_ops, glyphs, len, &type_rl_list, &max_level);
bidi_resolve_string (charset_ops, achars, len, pel, &type_rl_list, &max_level);
for (node_p=type_rl_list->next; node_p->next;
node_p=node_p->next)
{
for (node_p=type_rl_list->next; node_p->next; node_p=node_p->next) {
run_pos = node_p->pos;
run_len = node_p->len;
@@ -652,21 +677,21 @@ Glyph32* __mg_charset_bidi_map_reorder (const CHARSETOPS* charset_ops, Glyph32*
/* free typerun list.*/
free_typerun_list(type_rl_list);
print_hexstr(glyphs, len, TRUE);
print_hexstr(achars, len, TRUE);
return glyphs;
return achars;
}
Glyph32* __mg_charset_bidi_index_reorder (const CHARSETOPS* charset_ops, Glyph32* glyphs,
int len, int* index_map)
Achar32* __mg_charset_bidi_index_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int* index_map, int pel)
{
BYTE max_level = 1;
TYPERUN *type_rl_list = NULL;
print_hexstr(glyphs, len, FALSE);
print_hexstr(achars, len, FALSE);
/* W1~W7, N1~N2, I1~I2, Get the Embedding Level. */
bidi_resolve_string (charset_ops, glyphs, len, &type_rl_list, &max_level);
bidi_resolve_string (charset_ops, achars, len, pel, &type_rl_list, &max_level);
bidi_reorder_cb(index_map, len, &type_rl_list, max_level,
bidi_string_reverse);
@@ -674,39 +699,48 @@ Glyph32* __mg_charset_bidi_index_reorder (const CHARSETOPS* charset_ops, Glyph32
/* free typerun list.*/
free_typerun_list(type_rl_list);
print_hexstr(glyphs, len, TRUE);
print_hexstr(achars, len, TRUE);
return glyphs;
return achars;
}
#endif
Glyph32* __mg_charset_bidi_glyphs_reorder (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len)
Achar32* __mg_charset_bidi_achars_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int pel,
void* extra, CB_REVERSE_EXTRA cb_reverse_extra)
{
BYTE max_level = 1;
TYPERUN *type_rl_list = NULL;
REORDER_CONTEXT rc;
print_hexstr(glyphs, len, FALSE);
print_hexstr(achars, len, FALSE);
/* W1~W7, N1~N2, I1~I2, Get the Embedding Level. */
bidi_resolve_string (charset_ops, glyphs, len, &type_rl_list, &max_level);
bidi_resolve_string (charset_ops, achars, len, pel, &type_rl_list,
&max_level);
bidi_reorder_cb (glyphs, len, &type_rl_list, max_level, bidi_string_reverse);
rc.achars = achars;
rc.extra = extra;
rc.cb = cb_reverse_extra;
bidi_reorder (&rc, len, &type_rl_list, max_level);
/* free typerun list.*/
free_typerun_list (type_rl_list);
print_hexstr (glyphs, len, TRUE);
print_hexstr (achars, len, TRUE);
return glyphs;
return achars;
}
Uint32 __mg_charset_bidi_str_base_dir (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len)
Uint32 __mg_charset_bidi_str_base_dir (const CHARSETOPS* charset_ops,
Achar32* achars, int len)
{
BYTE base_level = 0;
Uint32 base_dir = BIDI_TYPE_L;
TYPERUN *type_rl_list = NULL;
/* split the text to some runs. */
type_rl_list = get_runtype_link (charset_ops, glyphs, len);
type_rl_list = get_runtype_link (charset_ops, achars, len);
/* 1.Find base level */
bidi_resolveParagraphs(&type_rl_list, &base_dir, &base_level);
@@ -717,14 +751,3 @@ Uint32 __mg_charset_bidi_str_base_dir (const CHARSETOPS* charset_ops, Glyph32* g
return base_dir;
}
BOOL GetGlyphBIDIType (LOGFONT* log_font, Glyph32 glyph_value, Uint32 *bidi_type)
{
DEVFONT* mbc_devfont = log_font->mbc_devfont;
if (mbc_devfont == NULL || mbc_devfont->charset_ops->bidi_glyph_type == NULL)
return FALSE;
*bidi_type = mbc_devfont->charset_ops->bidi_glyph_type (glyph_value);
return TRUE;
}
+1001 -435
View File
File diff suppressed because it is too large Load Diff
+267 -120
View File
File diff suppressed because it is too large Load Diff
+157 -174
View File
File diff suppressed because it is too large Load Diff
+186 -30
View File
@@ -42,6 +42,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define DEBUG
#include "common.h"
#include "minigui.h"
@@ -70,7 +73,7 @@ int fontConvertFontType (const char* type)
if (strcasecmp (type, FONT_TYPE_NAME_SCALE_T1F) == 0)
return FONT_TYPE_SCALE_T1F;
if (strcasecmp (type, FONT_TYPE_NAME_ALL) == 0)
return FONT_TYPE_ALL;
return FONT_TYPE_ANY;
return -1;
}
@@ -96,7 +99,7 @@ BOOL fontGetTypeNameFromName (const char* name, char* type)
int fontGetFontTypeFromName (const char* name)
{
char type [LEN_FONT_NAME + 1];
char type [LEN_LOGFONT_NAME_FIELD + 1];
if (!fontGetTypeNameFromName (name, type))
return -1;
@@ -114,8 +117,8 @@ BOOL fontGetFamilyFromName (const char* name, char* family)
if (*(++family_part) == '\0')
return FALSE;
while (family_part [i] && i <= LEN_FONT_NAME) {
if (family_part [i] == '-') {
while (family_part [i] && i <= LEN_LOGFONT_FAMILY_FILED) {
if (family_part [i] == '-'/* || family_part [i] == ',' */) {
family [i] = '\0';
break;
}
@@ -127,42 +130,155 @@ BOOL fontGetFamilyFromName (const char* name, char* family)
return TRUE;
}
static BOOL get_family_part_lower (const char* name, char* family)
{
int i = 0;
const char* family_part;
if ((family_part = strchr (name, '-')) == NULL)
return FALSE;
if (*(++family_part) == '\0')
return FALSE;
while (family_part [i] && i <= LEN_UNIDEVFONT_NAME) {
if (family_part [i] == '-') {
family [i] = '\0';
break;
}
family [i] = tolower(family_part [i]);
i++;
}
return TRUE;
}
#if 0
static const char *my_strstr(const char *haystack, const char *needle)
{
int i = 0, j = 0;
int tmp = i;
int str_len = strlen(haystack);
int substr_len = strlen(needle);
for (i = 0; i < str_len - substr_len; i++) {
tmp = i;
for (j = 0; j < substr_len; j++) {
if (haystack[tmp] == needle[j]) {
if (j == substr_len - 1)
return haystack + i;
tmp++;
}
else
break;
}
}
return NULL;
}
#endif
/* devfont family specification:
* family[,alias]...
*/
BOOL fontDoesMatchFamily (const char* name, const char* family)
{
// make sure there is a redundant space for the head and tail characters.
char family_part[LEN_LOGFONT_FAMILY_FILED + 3];
char family_request[LEN_LOGFONT_NAME_FIELD + 3];
int i;
size_t len;
// add ',' to the head
family_part[0] = ',';
if (!get_family_part_lower(name, family_part + 1)) {
return FALSE;
}
// add ',' to the tail
len = strlen(family_part);
family_part[len] = ',';
family_part[len + 1] = '\0';
// make family (lowercase)
family_request[0] = ',';
i = 0;
while (family[i] && i < LEN_LOGFONT_NAME_FIELD) {
family_request[i + 1] = tolower(family[i]);
i++;
}
family_request[i + 1] = '\0';
// add ',' to the tail
len = strlen(family_request);
family_request[len] = ',';
family_request[len + 1] = '\0';
// try to match "<family_request>,"
if (strstr(family_part, family_request)) {
return TRUE;
}
return FALSE;
}
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.4.0
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_NORMAL:
style |= FS_WEIGHT_NORMAL;
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.4.0
case FONT_WEIGHT_SUBPIXEL:
style |= FS_WEIGHT_SUBPIXEL;
break;
case FONT_WEIGHT_ALL:
style |= FS_WEIGHT_MASK;
break;
break;
*/
case FONT_WEIGHT_ANY:
default:
return 0xFFFFFFFF;
style |= FS_WEIGHT_ANY;
break;
}
style &= ~FS_SLANT_MASK;
switch (style_part [1]) {
case FONT_SLANT_ITALIC:
style |= FS_SLANT_ITALIC;
@@ -173,13 +289,13 @@ DWORD fontConvertStyle (const char* style_part)
case FONT_SLANT_ROMAN:
style |= FS_SLANT_ROMAN;
break;
case FONT_SLANT_ALL:
style |= FS_SLANT_MASK;
break;
case FONT_SLANT_ANY:
default:
return 0xFFFFFFFF;
style |= FS_SLANT_ANY;
break;
}
style &= ~FS_FLIP_MASK;
switch (style_part [2]) {
case FONT_FLIP_HORZ:
style |= FS_FLIP_HORZ;
@@ -191,9 +307,11 @@ DWORD fontConvertStyle (const char* style_part)
style |= FS_FLIP_HORZVERT;
break;
default:
//style |= FS_FLIP_NONE;
break;
}
style &= ~FS_OTHER_MASK;
switch (style_part [3]) {
case FONT_OTHER_AUTOSCALE:
style |= FS_OTHER_AUTOSCALE;
@@ -207,16 +325,53 @@ DWORD fontConvertStyle (const char* style_part)
case FONT_OTHER_TTFNOCACHEKERN:
style |= FS_OTHER_TTFNOCACHEKERN;
break;
case FONT_OTHER_LCDPORTRAIT:
style |= FS_OTHER_LCDPORTRAIT;
break;
case FONT_OTHER_LCDPORTRAITKERN:
style |= FS_OTHER_LCDPORTRAITKERN;
break;
default:
//style |= FS_OTHER_NONE;
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_REVERSE:
style |= FS_DECORATE_REVERSE;
break;
case FONT_DECORATE_OUTLINE:
style |= FS_DECORATE_OUTLINE;
break;
case FONT_DECORATE_US:
style |= FS_DECORATE_UNDERLINE;
style |= FS_DECORATE_STRUCKOUT;
break;
default:
//style |= FS_DECORATE_NONE;
break;
}
style &= ~FS_RENDER_MASK;
switch (style_part [5]) {
case FONT_RENDER_MONO:
style |= FS_RENDER_MONO;
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 +399,7 @@ DWORD fontConvertStyle (const char* style_part)
default:
return 0xFFFFFFFF;
}
*/
return style;
}
@@ -291,7 +447,7 @@ int fontGetWidthFromName (const char* name)
{
int i;
const char* width_part = name;
char width [LEN_FONT_NAME + 1];
char width [LEN_LOGFONT_NAME_FIELD + 1];
for (i = 0; i < NR_LOOP_FOR_WIDTH; i++) {
if ((width_part = strchr (width_part, '-')) == NULL)
@@ -322,7 +478,7 @@ int fontGetHeightFromName (const char* name)
{
int i;
const char* height_part = name;
char height [LEN_FONT_NAME + 1];
char height [LEN_LOGFONT_NAME_FIELD + 1];
for (i = 0; i < NR_LOOP_FOR_HEIGHT; i++) {
if ((height_part = strchr (height_part, '-')) == NULL)
@@ -369,8 +525,8 @@ BOOL fontGetCharsetFromName (const char* name, char* charset)
return TRUE;
}
strncpy (charset, charset_part, LEN_FONT_NAME);
charset [LEN_FONT_NAME] = '\0';
strncpy (charset, charset_part, LEN_LOGFONT_NAME_FIELD);
charset [LEN_LOGFONT_NAME_FIELD] = '\0';
return TRUE;
}
@@ -392,8 +548,8 @@ BOOL fontGetCompatibleCharsetFromName (const char* name, char* charset)
if (*(++charset_part) == '\0')
return FALSE;
strncpy (charset, charset_part, LEN_FONT_NAME);
charset [LEN_FONT_NAME] = '\0';
strncpy (charset, charset_part, LEN_LOGFONT_NAME_FIELD);
charset [LEN_LOGFONT_NAME_FIELD] = '\0';
return TRUE;
}
@@ -451,8 +607,8 @@ BOOL charsetGetSpecificCharset (const char* charsets, int _index, char* charset)
return TRUE;
}
strncpy (charset, charsets, LEN_FONT_NAME);
charset [LEN_FONT_NAME] = '\0';
strncpy (charset, charsets, LEN_LOGFONT_NAME_FIELD);
charset [LEN_LOGFONT_NAME_FIELD] = '\0';
return TRUE;
}
+127 -118
View File
File diff suppressed because it is too large Load Diff
+429 -296
View File
File diff suppressed because it is too large Load Diff
+34 -30
View File
@@ -1,33 +1,33 @@
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Or,
*
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
@@ -40,6 +40,14 @@
#ifndef GUI_FREETYP2_H
#define GUI_FREETYP2_H
#undef TTF_DBG
#ifndef TTF_DBG
#define DP(x)
#else
#define DP(x) do { printf x; } while (0)
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -54,6 +62,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
@@ -62,14 +71,13 @@ extern "C" {
#endif
#ifdef _MGFONT_TTF_CACHE
typedef unsigned long HCACHE;
typedef int (* MakeHashKeyFunc)(unsigned short unicode);
#endif
typedef void* HCACHE;
typedef int (* MakeHashKeyFunc)(Uchar32 unicode);
#endif
typedef struct tagFTFACEINFO {
#ifdef _MGFONT_TTF_CACHE
/*should be MAX_PATH*/
char filepathname[256];
char* filepathname;
int face_index;
int cmap_index;
#else
@@ -114,36 +122,32 @@ typedef struct tagFTINSTANCEINFO {
#define _TTF_HASH_NDIR 37
typedef struct tagTTFCACHEINFO {
unsigned short unicode;
short glyph_code;
Uchar32 unicode;
FT_UInt glyph_code;
FT_Vector advance;
FT_BBox bbox;
FT_Vector delta;
int flag;
int pitch;
int width;
int height;
void *bitmap;
} TTFCACHEINFO, *PTTFCACHEINFO;
extern HCACHE __mg_ttc_create(char *family, char *charset, DWORD style, int size,
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey);
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);
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache,
Uchar32 unicode, int *size);
extern void __mg_ttc_refer(HCACHE hCache);
#endif
#undef TTF_DBG
#ifndef TTF_DBG
#define DP(x)
#else
#define DP(x) do { printf x; } while (0)
#endif
#ifdef __cplusplus
File diff suppressed because it is too large Load Diff
-201
View File
@@ -1,201 +0,0 @@
/*
* 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/>.
*/
#ifndef __G_UNICODE_H__
#define __G_UNICODE_H__
/* These are the possible character classifications.
* See http://www.unicode.org/Public/UNIDATA/UCD.html#General_Category_Values
*/
#if 0 /* VincentWei: Moved to gid.h */
typedef enum
{
G_UNICODE_CONTROL,
G_UNICODE_FORMAT,
G_UNICODE_UNASSIGNED,
G_UNICODE_PRIVATE_USE,
G_UNICODE_SURROGATE,
G_UNICODE_LOWERCASE_LETTER,
G_UNICODE_MODIFIER_LETTER,
G_UNICODE_OTHER_LETTER,
G_UNICODE_TITLECASE_LETTER,
G_UNICODE_UPPERCASE_LETTER,
G_UNICODE_COMBINING_MARK,
G_UNICODE_ENCLOSING_MARK,
G_UNICODE_NON_SPACING_MARK,
G_UNICODE_DECIMAL_NUMBER,
G_UNICODE_LETTER_NUMBER,
G_UNICODE_OTHER_NUMBER,
G_UNICODE_CONNECT_PUNCTUATION,
G_UNICODE_DASH_PUNCTUATION,
G_UNICODE_CLOSE_PUNCTUATION,
G_UNICODE_FINAL_PUNCTUATION,
G_UNICODE_INITIAL_PUNCTUATION,
G_UNICODE_OTHER_PUNCTUATION,
G_UNICODE_OPEN_PUNCTUATION,
G_UNICODE_CURRENCY_SYMBOL,
G_UNICODE_MODIFIER_SYMBOL,
G_UNICODE_MATH_SYMBOL,
G_UNICODE_OTHER_SYMBOL,
G_UNICODE_LINE_SEPARATOR,
G_UNICODE_PARAGRAPH_SEPARATOR,
G_UNICODE_SPACE_SEPARATOR
} GUnicodeType;
#endif /* VincentWei: Moved to gid.h */
/* These are the possible line break classifications.
* Note that new types may be added in the future.
* Implementations may regard unknown values like G_UNICODE_BREAK_UNKNOWN
* See http://www.unicode.org/unicode/reports/tr14/
*/
typedef enum
{
G_UNICODE_BREAK_MANDATORY,
G_UNICODE_BREAK_CARRIAGE_RETURN,
G_UNICODE_BREAK_LINE_FEED,
G_UNICODE_BREAK_COMBINING_MARK,
G_UNICODE_BREAK_SURROGATE,
G_UNICODE_BREAK_ZERO_WIDTH_SPACE,
G_UNICODE_BREAK_INSEPARABLE,
G_UNICODE_BREAK_NON_BREAKING_GLUE,
G_UNICODE_BREAK_CONTINGENT,
G_UNICODE_BREAK_SPACE,
G_UNICODE_BREAK_AFTER,
G_UNICODE_BREAK_BEFORE,
G_UNICODE_BREAK_BEFORE_AND_AFTER,
G_UNICODE_BREAK_HYPHEN,
G_UNICODE_BREAK_NON_STARTER,
G_UNICODE_BREAK_OPEN_PUNCTUATION,
G_UNICODE_BREAK_CLOSE_PUNCTUATION,
G_UNICODE_BREAK_QUOTATION,
G_UNICODE_BREAK_EXCLAMATION,
G_UNICODE_BREAK_IDEOGRAPHIC,
G_UNICODE_BREAK_NUMERIC,
G_UNICODE_BREAK_INFIX_SEPARATOR,
G_UNICODE_BREAK_SYMBOL,
G_UNICODE_BREAK_ALPHABETIC,
G_UNICODE_BREAK_PREFIX,
G_UNICODE_BREAK_POSTFIX,
G_UNICODE_BREAK_COMPLEX_CONTEXT,
G_UNICODE_BREAK_AMBIGUOUS,
G_UNICODE_BREAK_UNKNOWN,
G_UNICODE_BREAK_NEXT_LINE,
G_UNICODE_BREAK_WORD_JOINER,
G_UNICODE_BREAK_HANGUL_L_JAMO,
G_UNICODE_BREAK_HANGUL_V_JAMO,
G_UNICODE_BREAK_HANGUL_T_JAMO,
G_UNICODE_BREAK_HANGUL_LV_SYLLABLE,
G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE
} GUnicodeBreakType;
typedef enum
{ /* ISO 15924 code */
G_UNICODE_SCRIPT_INVALID_CODE = -1,
G_UNICODE_SCRIPT_COMMON = 0, /* Zyyy */
G_UNICODE_SCRIPT_INHERITED, /* Qaai */
G_UNICODE_SCRIPT_ARABIC, /* Arab */
G_UNICODE_SCRIPT_ARMENIAN, /* Armn */
G_UNICODE_SCRIPT_BENGALI, /* Beng */
G_UNICODE_SCRIPT_BOPOMOFO, /* Bopo */
G_UNICODE_SCRIPT_CHEROKEE, /* Cher */
G_UNICODE_SCRIPT_COPTIC, /* Qaac */
G_UNICODE_SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */
G_UNICODE_SCRIPT_DESERET, /* Dsrt */
G_UNICODE_SCRIPT_DEVANAGARI, /* Deva */
G_UNICODE_SCRIPT_ETHIOPIC, /* Ethi */
G_UNICODE_SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */
G_UNICODE_SCRIPT_GOTHIC, /* Goth */
G_UNICODE_SCRIPT_GREEK, /* Grek */
G_UNICODE_SCRIPT_GUJARATI, /* Gujr */
G_UNICODE_SCRIPT_GURMUKHI, /* Guru */
G_UNICODE_SCRIPT_HAN, /* Hani */
G_UNICODE_SCRIPT_HANGUL, /* Hang */
G_UNICODE_SCRIPT_HEBREW, /* Hebr */
G_UNICODE_SCRIPT_HIRAGANA, /* Hira */
G_UNICODE_SCRIPT_KANNADA, /* Knda */
G_UNICODE_SCRIPT_KATAKANA, /* Kana */
G_UNICODE_SCRIPT_KHMER, /* Khmr */
G_UNICODE_SCRIPT_LAO, /* Laoo */
G_UNICODE_SCRIPT_LATIN, /* Latn (Latf, Latg) */
G_UNICODE_SCRIPT_MALAYALAM, /* Mlym */
G_UNICODE_SCRIPT_MONGOLIAN, /* Mong */
G_UNICODE_SCRIPT_MYANMAR, /* Mymr */
G_UNICODE_SCRIPT_OGHAM, /* Ogam */
G_UNICODE_SCRIPT_OLD_ITALIC, /* Ital */
G_UNICODE_SCRIPT_ORIYA, /* Orya */
G_UNICODE_SCRIPT_RUNIC, /* Runr */
G_UNICODE_SCRIPT_SINHALA, /* Sinh */
G_UNICODE_SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */
G_UNICODE_SCRIPT_TAMIL, /* Taml */
G_UNICODE_SCRIPT_TELUGU, /* Telu */
G_UNICODE_SCRIPT_THAANA, /* Thaa */
G_UNICODE_SCRIPT_THAI, /* Thai */
G_UNICODE_SCRIPT_TIBETAN, /* Tibt */
G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL, /* Cans */
G_UNICODE_SCRIPT_YI, /* Yiii */
G_UNICODE_SCRIPT_TAGALOG, /* Tglg */
G_UNICODE_SCRIPT_HANUNOO, /* Hano */
G_UNICODE_SCRIPT_BUHID, /* Buhd */
G_UNICODE_SCRIPT_TAGBANWA, /* Tagb */
/* Unicode-4.0 additions */
G_UNICODE_SCRIPT_BRAILLE, /* Brai */
G_UNICODE_SCRIPT_CYPRIOT, /* Cprt */
G_UNICODE_SCRIPT_LIMBU, /* Limb */
G_UNICODE_SCRIPT_OSMANYA, /* Osma */
G_UNICODE_SCRIPT_SHAVIAN, /* Shaw */
G_UNICODE_SCRIPT_LINEAR_B, /* Linb */
G_UNICODE_SCRIPT_TAI_LE, /* Tale */
G_UNICODE_SCRIPT_UGARITIC, /* Ugar */
/* Unicode-4.1 additions */
G_UNICODE_SCRIPT_NEW_TAI_LUE, /* Talu */
G_UNICODE_SCRIPT_BUGINESE, /* Bugi */
G_UNICODE_SCRIPT_GLAGOLITIC, /* Glag */
G_UNICODE_SCRIPT_TIFINAGH, /* Tfng */
G_UNICODE_SCRIPT_SYLOTI_NAGRI, /* Sylo */
G_UNICODE_SCRIPT_OLD_PERSIAN, /* Xpeo */
G_UNICODE_SCRIPT_KHAROSHTHI, /* Khar */
/* Unicode-5.0 additions */
G_UNICODE_SCRIPT_UNKNOWN, /* Zzzz */
G_UNICODE_SCRIPT_BALINESE, /* Bali */
G_UNICODE_SCRIPT_CUNEIFORM, /* Xsux */
G_UNICODE_SCRIPT_PHOENICIAN, /* Phnx */
G_UNICODE_SCRIPT_PHAGS_PA, /* Phag */
G_UNICODE_SCRIPT_NKO /* Nkoo */
} GUnicodeScript;
#endif /* __G_UNICODE_H__ */
+217
View File
@@ -0,0 +1,217 @@
/*
* 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 <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "common.h"
#include "minigui.h"
#include "gdi.h"
#ifdef _MGCHARSET_UNICODE
static const Uint16 iso639_1_codes[] =
{
#define PACK(a,b) ((Uint16)((((Uint8)(a))<<8)|((Uint8)(b))))
PACK('a', 'a'), // Afar
PACK('a', 'b'), // Abkhazian
PACK('a', 'f'), // Afrikaans
PACK('a', 'm'), // Amharic
PACK('a', 'r'), // Arabic
PACK('a', 's'), // Assamese
PACK('a', 'y'), // Aymara
PACK('a', 'z'), // Azerbaijani
PACK('b', 'a'), // Bashkir
PACK('b', 'e'), // Byelorussian
PACK('b', 'g'), // Bulgarian
PACK('b', 'h'), // Bihari
PACK('b', 'i'), // Bislama
PACK('b', 'n'), // Bengali
PACK('b', 'o'), // Tibetan
PACK('b', 'r'), // Breton
PACK('c', 'a'), // Catalan
PACK('c', 'o'), // Corsican
PACK('c', 's'), // Czech
PACK('c', 'y'), // Welch
PACK('d', 'a'), // Danish
PACK('d', 'e'), // German
PACK('d', 'z'), // Bhutani
PACK('e', 'l'), // Greek
PACK('e', 'n'), // English
PACK('e', 'o'), // Esperanto
PACK('e', 's'), // Spanish
PACK('e', 't'), // Estonian
PACK('e', 'u'), // Basque
PACK('f', 'a'), // Persian
PACK('f', 'i'), // Finnish
PACK('f', 'j'), // Fiji
PACK('f', 'o'), // Faeroese
PACK('f', 'r'), // French
PACK('f', 'y'), // Frisian
PACK('g', 'a'), // Irish
PACK('g', 'd'), // Scots Gaelic
PACK('g', 'l'), // Galician
PACK('g', 'n'), // Guarani
PACK('g', 'u'), // Gujarati
PACK('h', 'a'), // Hausa
PACK('h', 'i'), // Hindi
PACK('h', 'e'), // Hebrew
PACK('h', 'r'), // Croatian
PACK('h', 'u'), // Hungarian
PACK('h', 'y'), // Armenian
PACK('i', 'a'), // Interlingua
PACK('i', 'd'), // Indonesian
PACK('i', 'e'), // Interlingue
PACK('i', 'k'), // Inupiak
PACK('i', 'n'), // former Indonesian
PACK('i', 's'), // Icelandic
PACK('i', 't'), // Italian
PACK('i', 'u'), // Inuktitut (Eskimo)
PACK('i', 'w'), // former Hebrew
PACK('j', 'a'), // Japanese
PACK('j', 'i'), // former Yiddish
PACK('j', 'w'), // Javanese
PACK('k', 'a'), // Georgian
PACK('k', 'k'), // Kazakh
PACK('k', 'l'), // Greenlandic
PACK('k', 'm'), // Cambodian
PACK('k', 'n'), // Kannada
PACK('k', 'o'), // Korean
PACK('k', 's'), // Kashmiri
PACK('k', 'u'), // Kurdish
PACK('k', 'y'), // Kirghiz
PACK('l', 'a'), // Latin
PACK('l', 'n'), // Lingala
PACK('l', 'o'), // Laothian
PACK('l', 't'), // Lithuanian
PACK('l', 'v'), // Latvian, Lettish
PACK('m', 'g'), // Malagasy
PACK('m', 'i'), // Maori
PACK('m', 'k'), // Macedonian
PACK('m', 'l'), // Malayalam
PACK('m', 'n'), // Mongolian
PACK('m', 'o'), // Moldavian
PACK('m', 'r'), // Marathi
PACK('m', 's'), // Malay
PACK('m', 't'), // Maltese
PACK('m', 'y'), // Burmese
PACK('n', 'a'), // Nauru
PACK('n', 'e'), // Nepali
PACK('n', 'l'), // Dutch
PACK('n', 'o'), // Norwegian
PACK('o', 'c'), // Occitan
PACK('o', 'm'), // (Afan) Oromo
PACK('o', 'r'), // Oriya
PACK('p', 'a'), // Punjabi
PACK('p', 'l'), // Polish
PACK('p', 's'), // Pashto, Pushto
PACK('p', 't'), // Portuguese
PACK('q', 'u'), // Quechua
PACK('r', 'm'), // Rhaeto-Romance
PACK('r', 'n'), // Kirundi
PACK('r', 'o'), // Romanian
PACK('r', 'u'), // Russian
PACK('r', 'w'), // Kinyarwanda
PACK('s', 'a'), // Sanskrit
PACK('s', 'd'), // Sindhi
PACK('s', 'g'), // Sangro
PACK('s', 'h'), // Serbo-Croatian
PACK('s', 'i'), // Singhalese
PACK('s', 'k'), // Slovak
PACK('s', 'l'), // Slovenian
PACK('s', 'm'), // Samoan
PACK('s', 'n'), // Shona
PACK('s', 'o'), // Somali
PACK('s', 'q'), // Albanian
PACK('s', 'r'), // Serbian
PACK('s', 's'), // Siswati
PACK('s', 't'), // Sesotho
PACK('s', 'u'), // Sudanese
PACK('s', 'v'), // Swedish
PACK('s', 'w'), // Swahili
PACK('t', 'a'), // Tamil
PACK('t', 'e'), // Tegulu
PACK('t', 'g'), // Tajik
PACK('t', 'h'), // Thai
PACK('t', 'i'), // Tigrinya
PACK('t', 'k'), // Turkmen
PACK('t', 'l'), // Tagalog
PACK('t', 'n'), // Setswana
PACK('t', 'o'), // Tonga
PACK('t', 'r'), // Turkish
PACK('t', 's'), // Tsonga
PACK('t', 't'), // Tatar
PACK('t', 'w'), // Twi
PACK('u', 'g'), // Uigur
PACK('u', 'k'), // Ukrainian
PACK('u', 'r'), // Urdu
PACK('u', 'z'), // Uzbek
PACK('v', 'i'), // Vietnamese
PACK('v', 'o'), // Volapuk
PACK('w', 'o'), // Wolof
PACK('x', 'h'), // Xhosa
PACK('y', 'i'), // Yiddish
PACK('y', 'o'), // Yoruba
PACK('z', 'a'), // Zhuang
PACK('z', 'h'), // Chinese
PACK('z', 'u'), // Zulu
#undef PACK
};
int GUIAPI LanguageCodeFromISO639s1 (Uint16 iso639_1)
{
unsigned int lower = 0;
unsigned int upper = TABLESIZE (iso639_1_codes) - 1;
unsigned int mid = TABLESIZE (iso639_1_codes) / 2;
if (!iso639_1)
return LANGCODE_unknown;
do {
if (iso639_1 < iso639_1_codes[mid])
upper = mid - 1;
else if (iso639_1 > iso639_1_codes[mid])
lower = mid + 1;
else
return (int)mid;
mid = (lower + upper) / 2;
} while (lower <= upper);
return LANGCODE_unknown;
}
#endif /* _MGCHARSET_UNICODE */
+388 -327
View File
File diff suppressed because it is too large Load Diff
+669 -669
View File
File diff suppressed because it is too large Load Diff
+43 -34
View File
@@ -154,7 +154,7 @@ static void clear_glyph_tree (QPF_GLYPHTREE* tree)
free (tree->more);
}
static void* load_font_data (const char* font_name, const char* file_name)
static void* load_font_data (DEVFONT* devfont, const char* font_name, const char* file_name)
{
FILE* fp = NULL;
uchar* data;
@@ -222,7 +222,7 @@ error:
return NULL;
}
static void unload_font_data (void* data)
static void unload_font_data (DEVFONT* devfont, void* data)
{
QPFINFO* qpf_info = (QPFINFO*)data;
@@ -275,7 +275,7 @@ static unsigned char def_smooth_bitmap [] =
static QPF_GLYPH def_glyph = {&def_metrics, def_bitmap};
static QPF_GLYPH def_smooth_glyph = {&def_smooth_metrics, def_smooth_bitmap};
static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{
if (QPFONT_INFO_P (devfont)->fm->flags & FLAG_MODE_SMOOTH)
return DEVFONTGLYPHTYPE_GREYBMP;
@@ -302,7 +302,7 @@ static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
* GET_DEVFONT_SCALE (logfont, devfont);
}
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
{
int height = QPFONT_INFO_P (devfont)->fm->ascent +
QPFONT_INFO_P (devfont)->fm->descent;
@@ -311,7 +311,8 @@ static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
if (logfont->style & FS_OTHER_AUTOSCALE)
scale = font_GetBestScaleFactor (height, expect);
SET_DEVFONT_SCALE (logfont, devfont, scale);
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
SET_DEVFONT_SCALE (logfont, df_slot, scale);
return height * scale;
}
@@ -329,23 +330,24 @@ static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
}
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
{
unsigned int uc16;
QPF_GLYPH* glyph;
if(devfont->charset_ops->conv_to_uc32)
glyph_value = REAL_GLYPH(glyph_value);
if (devfont->charset_ops->conv_to_uc32)
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
else
uc16 = glyph_value;
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
if (glyph == NULL) {
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) { /* ASCII */
unsigned char ascii_ch = uc16;
return logfont->sbc_devfont->font_ops->get_glyph_monobitmap (logfont,
logfont->sbc_devfont, ascii_ch, pitch, scale);
return logfont->devfonts[0]->font_ops->get_glyph_monobitmap (logfont,
logfont->devfonts[0], ascii_ch, sz, pitch, scale);
}
else
glyph = &def_glyph;
@@ -365,11 +367,12 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
}
static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
Glyph32 glyph_value, int* pitch, unsigned short* scale)
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
{
unsigned int uc16;
QPF_GLYPH* glyph;
glyph_value = REAL_GLYPH(glyph_value);
if (scale)
*scale = GET_DEVFONT_SCALE (logfont, devfont);
@@ -400,6 +403,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
QPF_GLYPH* glyph;
unsigned short scale = GET_DEVFONT_SCALE (logfont, devfont);
glyph_value = REAL_GLYPH(glyph_value);
if(devfont->charset_ops->conv_to_uc32)
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
else
@@ -408,21 +412,21 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
if (glyph == NULL) {
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) { /* ASCII */
unsigned char ascii_ch = uc16;
if (logfont->sbc_devfont->font_ops->get_glyph_bbox) {
return logfont->sbc_devfont->font_ops->get_glyph_bbox (logfont,
logfont->sbc_devfont, ascii_ch,
if (logfont->devfonts[0]->font_ops->get_glyph_bbox) {
return logfont->devfonts[0]->font_ops->get_glyph_bbox (logfont,
logfont->devfonts[0], ascii_ch,
px, py, pwidth, pheight);
}
else {
int width, height, ascent;
logfont->sbc_devfont->font_ops->get_glyph_advance
(logfont, logfont->sbc_devfont, glyph_value, &width, 0);
height = logfont->sbc_devfont->font_ops->get_font_height
(logfont, logfont->sbc_devfont);
ascent = logfont->sbc_devfont->font_ops->get_font_ascent
(logfont, logfont->sbc_devfont);
logfont->devfonts[0]->font_ops->get_glyph_advance
(logfont, logfont->devfonts[0], glyph_value, &width, 0);
height = logfont->devfonts[0]->font_ops->get_font_height
(logfont, logfont->devfonts[0]);
ascent = logfont->devfonts[0]->font_ops->get_font_ascent
(logfont, logfont->devfonts[0]);
if (pwidth) *pwidth = width;
if (pheight) *pheight = height;
@@ -452,6 +456,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
QPF_GLYPH* glyph;
int advance;
glyph_value = REAL_GLYPH(glyph_value);
if(devfont->charset_ops->conv_to_uc32)
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
else
@@ -460,11 +465,11 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
if (glyph == NULL) {
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) { /* ASCII */
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) { /* ASCII */
unsigned char ascii_ch = uc16;
if (logfont->sbc_devfont->font_ops->get_glyph_advance) {
return logfont->sbc_devfont->font_ops->
get_glyph_advance (logfont, logfont->sbc_devfont,
if (logfont->devfonts[0]->font_ops->get_glyph_advance) {
return logfont->devfonts[0]->font_ops->
get_glyph_advance (logfont, logfont->devfonts[0],
ascii_ch, px, py);
}
}
@@ -482,9 +487,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;
@@ -495,17 +503,18 @@ static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_
unsigned int uc16;
QPF_GLYPH* glyph;
glyph_value = REAL_GLYPH(glyph_value);
if(devfont->charset_ops->conv_to_uc32)
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
else
uc16 = glyph_value;
glyph = get_glyph (QPFONT_INFO_P (devfont)->tree, uc16);
if (glyph == NULL) {
if (uc16 < 0x80 && logfont->sbc_devfont != devfont) /* ASCII */
return logfont->sbc_devfont->font_ops->is_glyph_existed (logfont,
logfont->sbc_devfont, glyph_value);
if (uc16 < 0x80 && logfont->devfonts[0] != devfont) /* ASCII */
return logfont->devfonts[0]->font_ops->is_glyph_existed (logfont,
logfont->devfonts[0], glyph_value);
else
return FALSE;
}
@@ -519,7 +528,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
/**************************** Global data ************************************/
FONTOPS __mg_qpf_ops = {
get_glyph_type,
get_glyph_bmptype,
get_ave_width,
get_max_width,
get_font_height,
+14 -16
View File
@@ -65,11 +65,7 @@
#define RBFONT_INFO(devfont) ((RBFINFO*)(devfont.data))
/********************** Load/Unload of raw bitmap font ***********************/
#if 0
static void* load_font_data (char* font_name, char* file_name,
char* real_font_name)
#endif
static void* load_font_data (const char* font_name, const char* file_name)
static void* load_font_data (DEVFONT* devfont, const char* font_name, const char* file_name)
{
FILE* fp = NULL;
RBFINFO* rbf_info = calloc (1, sizeof(RBFINFO));
@@ -129,7 +125,7 @@ error_load:
/********************** Init/Term of raw bitmap font ***********************/
static void unload_font_data (void* data)
static void unload_font_data (DEVFONT* devfont, void* data)
{
RBFINFO* rbfinfo = (RBFINFO*)data;
#ifdef HAVE_MMAP
@@ -143,7 +139,7 @@ static void unload_font_data (void* data)
/*************** Raw bitmap font operations *********************************/
static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{
return DEVFONTGLYPHTYPE_MONOBMP;
}
@@ -158,7 +154,7 @@ static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
return RBFONT_INFO_P (devfont)->height * GET_DEVFONT_SCALE (logfont, devfont);
}
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
{
int height = RBFONT_INFO_P (devfont)->height;
unsigned short scale = 1;
@@ -166,7 +162,8 @@ static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect)
if (logfont->style & FS_OTHER_AUTOSCALE)
scale = font_GetBestScaleFactor (height, expect);
SET_DEVFONT_SCALE (logfont, devfont, scale);
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
SET_DEVFONT_SCALE (logfont, df_slot, scale);
return height * scale;
}
@@ -192,7 +189,7 @@ static int get_font_ascent (LOGFONT* logfont, DEVFONT* devfont)
static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
{
int height = RBFONT_INFO_P (devfont)->height;
height *= GET_DEVFONT_SCALE (logfont, devfont);
if (height >= 40)
@@ -208,13 +205,13 @@ static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
}
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
{
int bitmap_size;
Glyph32 glyph_tmp = glyph_value;
if (glyph_tmp >= RBFONT_INFO_P (devfont)->nr_glyphs)
glyph_tmp = devfont->charset_ops->def_glyph_value;
glyph_value = REAL_GLYPH(glyph_value);
if (glyph_value >= RBFONT_INFO_P (devfont)->nr_glyphs)
glyph_value = devfont->charset_ops->def_char_value;
bitmap_size = ((RBFONT_INFO_P (devfont)->width + 7) >> 3)
* RBFONT_INFO_P (devfont)->height;
@@ -224,12 +221,13 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
if (scale)
*scale = GET_DEVFONT_SCALE (logfont, devfont);
return RBFONT_INFO_P (devfont)->data + bitmap_size * glyph_tmp;
return RBFONT_INFO_P (devfont)->data + bitmap_size * glyph_value;
}
static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont,
Glyph32 glyph_value)
{
glyph_value = REAL_GLYPH(glyph_value);
if (glyph_value > RBFONT_INFO_P(devfont)->nr_glyphs)
return FALSE;
else
@@ -268,7 +266,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
/**************************** Global data ************************************/
FONTOPS __mg_rbf_ops = {
get_glyph_type,
get_glyph_bmptype,
get_ave_width,
get_ave_width, // max_width same as ave_width
get_font_height,
+12 -6
View File
@@ -103,7 +103,7 @@ static void unlock(void)
static BOOL load_fonts(void)
{
int i;
int font_table_size = se_font_desc.font_name_map_size;
int font_table_size = se_font_desc.font_name_map_size;
BOOL result = FALSE;
#if SE_MINIGUI_TRACE
@@ -113,7 +113,7 @@ static BOOL load_fonts(void)
se_dev_fonts = calloc (font_table_size, sizeof (DEVFONT));
for (i = 0; i < font_table_size; i++) {
char charset[LEN_FONT_NAME + 1];
char charset[LEN_LOGFONT_NAME_FIELD + 1];
CHARSETOPS *charset_ops;
const char *font_name;
int font_id;
@@ -158,7 +158,7 @@ static BOOL load_fonts(void)
if ((nr_charsets = charsetGetCharsetsNumber (charsets)) > 1) {
int j;
for (j = 1; j < nr_charsets; j++) {
char charset [LEN_FONT_NAME + 1];
char charset [LEN_LOGFONT_NAME_FIELD + 1];
CHARSETOPS* charset_ops;
DEVFONT* new_devfont;
@@ -334,6 +334,7 @@ static int get_glyph_width (LOGFONT* logfont, DEVFONT* devfont,
SeLogFont selogfont;
int width;
glyph_value = REAL_GLYPH(glyph_value);
if (devfont->charset_ops->conv_to_uc32)
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
else
@@ -364,7 +365,7 @@ static int get_max_width (LOGFONT* logfont, DEVFONT* devfont)
return logfont->size;
}
static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{
if (logfont->style & FS_WEIGHT_BOOK)
return DEVFONTGLYPHTYPE_GREYBMP;
@@ -440,6 +441,7 @@ static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
printf("in get_glyph_greybitmap....\n");
#endif
glyph_value = REAL_GLYPH(glyph_value);
if (devfont->charset_ops->conv_to_uc32)
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
else
@@ -466,7 +468,7 @@ static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
}
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
Glyph32 glyph_value, int* pitch, unsigned short* scale)
{
seunichar16 wc;
SeLogFont selogfont;
@@ -476,6 +478,7 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
printf("in get_char_bitmap....\n");
#endif
glyph_value = REAL_GLYPH(glyph_value);
if (devfont->charset_ops->conv_to_uc32)
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
else
@@ -505,6 +508,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
if(px == 0 && py == 0 && pwidth == 0 && pheight == 0)
return 1;
glyph_value = REAL_GLYPH(glyph_value);
if (devfont->charset_ops->conv_to_uc32)
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
else
@@ -534,6 +538,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
SeLogFont selogfont;
int x = *px;
glyph_value = REAL_GLYPH(glyph_value);
if (devfont->charset_ops->conv_to_uc32)
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
else
@@ -558,6 +563,7 @@ static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_
int uni_char;
int x, y, width, height;
glyph_value = REAL_GLYPH(glyph_value);
if(devfont->charset_ops->conv_to_uc32)
uni_char = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
else
@@ -577,7 +583,7 @@ static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
/**************************** Global data ************************************/
static FONTOPS scripteasy_font_ops = {
get_glyph_type,
get_glyph_bmptype,
get_ave_width,
get_max_width,
get_font_height,
+13 -13
View File
@@ -102,10 +102,10 @@ BOOL mg_InitSysFont (void)
for (i = 0; i < nr_fonts; i++) {
char key [11];
char type [LEN_FONT_NAME + 1];
char family [LEN_FONT_NAME + 1];
char style [LEN_FONT_NAME + 1];
char charset [LEN_FONT_NAME + 1];
char type [LEN_LOGFONT_NAME_FIELD + 1];
char family [LEN_LOGFONT_FAMILY_FILED + 1];
char style [LEN_LOGFONT_NAME_FIELD + 1];
char charset [LEN_LOGFONT_NAME_FIELD + 1];
char font_name [LEN_DEVFONT_NAME + 1];
int height;
int j = 0, need = 0;
@@ -205,28 +205,28 @@ void mg_TermSysFont (void)
const char* GUIAPI GetSysCharset (BOOL wchar)
{
if (wchar) {
if (g_SysLogFont[1]->mbc_devfont)
return MBC_DEVFONT_INFO_P (g_SysLogFont[1])->charset_ops->name;
if (g_SysLogFont[1]->devfonts[1])
return g_SysLogFont[1]->devfonts[1]->charset_ops->name;
else
return NULL;
}
else
return SBC_DEVFONT_INFO_P (g_SysLogFont[0])->charset_ops->name;
else
return g_SysLogFont[0]->devfonts[0]->charset_ops->name;
}
int GUIAPI GetSysCharWidth (void)
{
DEVFONT* sbc_devfont = g_SysLogFont[0]->sbc_devfont;
DEVFONT* sbc_devfont = g_SysLogFont[0]->devfonts[0];
return sbc_devfont->font_ops->get_ave_width (g_SysLogFont[0], sbc_devfont);
}
int GUIAPI GetSysCCharWidth (void)
{
DEVFONT* mbc_devfont = g_SysLogFont[1]->mbc_devfont;
DEVFONT* mbc_devfont = g_SysLogFont[1]->devfonts[1];
if (mbc_devfont)
return mbc_devfont->font_ops->get_ave_width (g_SysLogFont[1], mbc_devfont);
return mbc_devfont->font_ops->get_ave_width (g_SysLogFont[1], mbc_devfont);
else
return GetSysCharWidth () * 2;
}
@@ -238,14 +238,14 @@ int GUIAPI GetSysCharHeight (void)
int GUIAPI GetSysFontMaxWidth (int font_id)
{
DEVFONT* sbc_devfont = g_SysLogFont[font_id]->sbc_devfont;
DEVFONT* sbc_devfont = g_SysLogFont[font_id]->devfonts[0];
return sbc_devfont->font_ops->get_max_width (g_SysLogFont[font_id], sbc_devfont);
}
int GUIAPI GetSysFontAveWidth (int font_id)
{
DEVFONT* sbc_devfont = g_SysLogFont[font_id]->sbc_devfont;
DEVFONT* sbc_devfont = g_SysLogFont[font_id]->devfonts[0];
return sbc_devfont->font_ops->get_ave_width (g_SysLogFont[font_id], sbc_devfont);
}
+1 -1
View File
@@ -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);
+1 -2
View File
@@ -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)
+1 -1
View File
@@ -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) {
+2 -2
View File
@@ -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;
}
+3 -3
View File
@@ -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
+13 -13
View File
@@ -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
View File
View File
View File
View File

Some files were not shown because too many files have changed in this diff Show More