Compare commits

...
164 Commits
Author SHA1 Message Date
Vincent Wei 2b01f35cac rename: LayoutInfo -> Layout, TextRunsInfo -> TextRuns 2019-04-06 11:25:21 +08:00
Vincent Wei e0b6a64402 tune position for west gravity 2019-04-04 19:00:45 +08:00
Vincent Wei 084d7e58a2 tune indentation 2019-04-04 18:53:37 +08:00
Vincent Wei 88753a5fd0 cleanup 2019-04-04 17:02:06 +08:00
Vincent Wei b739daadba cleanup FreeType2 font engine, remove redundant code 2019-04-04 16:51:54 +08:00
Vincent Wei 5529ab1e10 use mg_slice for TEXTRUNS, TEXTLAYOUT, GlyphRun, TextRun, LayoutRun, and so on 2019-04-04 15:10:19 +08:00
Vincent Wei 032fdcc3bb mg_slice_free -> mg_slice_delete; mg_slice_free1 -> mg_slice_free 2019-04-04 14:46:05 +08:00
Vincent Wei 1cb9922dad Initialize mutex of mgslice 2019-04-04 12:27:05 +08:00
Vincent Wei 8ac0d539d0 implementation of mg_slice_xxx 2019-04-04 12:18:10 +08:00
Vincent Wei e3ae994212 debug: line->nr_runs should be re-caculate for ellipsized line 2019-04-04 08:39:09 +08:00
Vincent Wei b0145a15d2 CalcLayoutBoundingRect 2019-04-03 19:13:27 +08:00
Vincent Wei 9dab380f3e GetLayoutLineRect 2019-04-03 19:01:19 +08:00
Vincent Wei d1facd5468 No shaping arabic for vertical layout 2019-04-03 15:50:32 +08:00
Vincent Wei 5996ede23b cleanup 2019-04-03 15:26:50 +08:00
Vincent Wei 837cd49045 debug: uninitialized length 2019-04-03 15:16:07 +08:00
Vincent Wei dc4f54ffe4 debug: uninitialized length 2019-04-03 15:15:39 +08:00
Vincent Wei f611fe3859 normal, word break and alignment 2019-04-03 12:27:10 +08:00
Vincent Wei 4ff5097dfb check pointer for get_glyph_advance 2019-04-02 19:00:13 +08:00
Vincent Wei 49421e1f88 implementation of DrawLayoutLine 2019-04-02 18:46:34 +08:00
Vincent Wei 6e33602e7d debug for glyph orientation in vertical layout 2019-04-02 17:27:15 +08:00
Vincent Wei d13c31a08a add ta (text align) to RENDERDATA 2019-04-02 12:36:31 +08:00
Vincent Wei 704b6287ff debug for MIXED orientation 2019-04-02 10:12:31 +08:00
Vincent Wei 1df726dd10 tune gravity and orientation 2019-04-02 09:27:06 +08:00
Vincent Wei b2afe815b5 debug DrawShapedGlyph 2019-04-01 19:12:41 +08:00
Vincent Wei f648c1a8c7 tune api desc 2019-04-01 14:37:09 +08:00
Vincent Wei 4d2fe61e52 remove (x,y) from CB_GLYPH_LAID_OUT 2019-04-01 14:26:56 +08:00
Vincent Wei 9644964e9c tune api description 2019-03-31 15:31:49 +08:00
Vincent Wei 61b799af88 fix bug: not convert AChar to Glyph32 2019-03-29 20:18:26 +08:00
Vincent Wei 2f52006cde fix a bug: no MSG_IDLE when using dummy IAL engine 2019-03-29 19:22:31 +08:00
Vincent Wei cf063aad32 disable debug print 2019-03-29 18:31:23 +08:00
Vincent Wei 0855e8b972 add null fonts for korea and japanese charsets 2019-03-29 16:13:16 +08:00
Vincent Wei a501557532 Tune CB_GLYPH_LAID_OUT 2019-03-29 14:51:57 +08:00
Vincent Wei 820d6aeac4 fix a bug 2019-03-29 12:27:04 +08:00
Vincent Wei 215242e3e8 tune 2019-03-29 12:14:19 +08:00
Vincent Wei c79f09fe87 implementation of GetLayoutLineSize and CalcLayoutBoundingRect 2019-03-29 11:44:29 +08:00
Vincent Wei f68c26860a Implementation of CreateLogFontForMChar2UChar; FONT_MIN_SIZE -> 1 2019-03-29 10:40:35 +08:00
Vincent Wei 53f1a05526 Tune new APIs 2019-03-29 10:09:23 +08:00
Vincent Wei 6a5cfd1052 new APIs: SetFontNameInTextRuns, SetTextColorInTextRuns, SetBackgroundColorInTextRuns, and GetXXXX 2019-03-28 18:57:21 +08:00
Vincent Wei 1c79cf510f Tune the TextRunsInfo and LayoutInfo related APIs 2019-03-28 17:47:12 +08:00
Vincent Wei 86965a0e9c fixbug in layout-ellipsize.c 2019-03-28 11:40:58 +08:00
Vincent Wei 9cca87878c tune CB_GLYPH_LAID_OUT 2019-03-27 19:28:19 +08:00
Vincent Wei 2cffa1154c API description 2019-03-27 19:16:33 +08:00
Vincent Wei 9adea7df64 implementation of NULL font engine and incored NULL devfonts for every charset 2019-03-27 17:58:56 +08:00
Vincent Wei 8f70dfcf69 UStrTailorBreaks 2019-03-27 16:46:42 +08:00
Vincent Wei ccf1e6f7a5 cleanup 2019-03-27 15:52:43 +08:00
Vincent Wei 913ea4db23 CreateTextRunsInfo and CreateLayoutInfo passed test cases 2019-03-27 15:50:16 +08:00
Vincent Wei 55baa8c741 cleanup 2019-03-27 12:39:27 +08:00
Vincent Wei db63d8cad3 cleanup 2019-03-27 11:40:34 +08:00
Vincent Wei 338fb0276e use _DEBUG for real output of _DBG_PRINTF 2019-03-27 10:08:01 +08:00
Vincent Wei 8dd64e7f2d api description 2019-03-26 19:14:05 +08:00
Vincent Wei c1cbb8423e parameters of CB_GLYPH_LAID_OUT 2019-03-26 18:44:05 +08:00
Vincent Wei a95ee5b181 debug 2019-03-26 18:09:49 +08:00
Vincent Wei 9d9bf95c21 cleanup 2019-03-26 12:25:08 +08:00
Vincent Wei ed6ceaa49c fixbug of layout implementation 2019-03-26 12:22:26 +08:00
Vincent Wei f5e1144cbe debug LayoutInfo implementaion 2019-03-26 11:24:31 +08:00
Vincent Wei c890e4296a add list_concat, list_move, list_reverse 2019-03-26 11:24:06 +08:00
Vincent Wei d09313407e reorder glyph runs according to embedding levels 2019-03-25 15:31:03 +08:00
Vincent Wei 7dfe5954f5 go on 2019-03-25 12:15:23 +08:00
Vincent Wei 390c5de6ef go on 2019-03-24 19:14:46 +08:00
Vincent Wei 274fdaaa31 go on 2019-03-24 19:00:15 +08:00
Vincent Wei 04725fc892 cleanup 2019-03-24 15:46:40 +08:00
Vincent Wei 4da29f635d Use CamelCase for internal structures and types 2019-03-24 15:32:08 +08:00
Vincent Wei 3e5ff0af91 tune implementation 2019-03-24 12:35:31 +08:00
Vincent Wei 1820e74b77 empty implementation 2019-03-22 18:42:08 +08:00
Vincent Wei 2278c4975c new file for ellipsisi 2019-03-22 18:34:11 +08:00
Vincent Wei af8a04570d more code 2019-03-22 18:33:37 +08:00
Vincent Wei 452edfa831 more code for layout 2019-03-22 12:33:53 +08:00
Vincent Wei 4fba705082 cleanup 2019-03-22 10:53:50 +08:00
Vincent Wei a049e387e0 some code for layout 2019-03-22 09:40:05 +08:00
Vincent Wei c67a18536d some code for layout 2019-03-21 19:12:52 +08:00
Vincent Wei d9e09ac34f Intent to add new APIs: DrawShapedGlyph and DrawShapedGlyphLine 2019-03-21 15:28:30 +08:00
Vincent Wei 65972861a0 bugfixs 2019-03-21 15:03:04 +08:00
Vincent Wei 96b06544b3 Optimize FreeType2 engine for get_glyph_advance; add new devfont op: get_kerning 2019-03-21 11:01:37 +08:00
Vincent Wei 838530d6b1 add new internal header: glyph.h; _font_get_glyph_log_width 2019-03-21 09:46:20 +08:00
Vincent Wei c276122f60 Start to implement InitBasicShapingEngine 2019-03-20 18:53:06 +08:00
Vincent Wei 46a8b1768a cleanup 2019-03-20 17:08:43 +08:00
Vincent Wei d5b57e8200 cleanup and add _WRN_PRINTF for warning 2019-03-20 17:06:43 +08:00
Vincent Wei ee179e6995 API description related to LAYOUTINFO 2019-03-20 16:31:41 +08:00
Vincent Wei 3571d88f3d use LoadResource for LOGFONTs of text runs 2019-03-19 19:33:11 +08:00
Vincent Wei 8ba346eec5 use logfont name for CreateTextRunsInfo instead of logfont object 2019-03-19 18:43:04 +08:00
Vincent Wei e110cb61f4 fix bugs 2019-03-19 17:14:42 +08:00
Vincent Wei d29aa1d881 Tune name of structure and functions 2019-03-19 15:37:30 +08:00
Vincent Wei 6337f5d6fa cleanup 2019-03-19 11:49:34 +08:00
Vincent Wei 14bfe263a3 Use LanguageCode and ScriptType types for external APIs 2019-03-19 11:48:24 +08:00
Vincent Wei cbd54e0766 add new APIs: ScriptGetGlyphOrientation and ScriptGetWideGlyphOrientation 2019-03-19 10:45:26 +08:00
Vincent Wei ceaec7e3d3 new API: UBidiGetParagraphEmbeddingLevelsAlt, an optimized call 2019-03-18 19:07:53 +08:00
Vincent Wei aab8d6e2c6 Emoji, Script, and Width iterators for Unicode string 2019-03-18 17:32:27 +08:00
Vincent Wei 8a856e5b99 cleanup 2019-03-18 14:30:46 +08:00
Vincent Wei 46f48a0d6c UCharGetVerticalOrientation 2019-03-18 12:42:45 +08:00
Vincent Wei 40fc11f324 gen-vop-tab: tool to generate the vertical orientation property table 2019-03-18 12:32:47 +08:00
Vincent Wei d63fe9849b Tune GlyphRunInfo 2019-03-16 19:12:57 +08:00
Vincent Wei 349f310148 cleanup 2019-03-16 16:28:46 +08:00
Vincent Wei ac60980bc2 tune GlyphRunInfo APIs and cleanup 2019-03-16 16:21:49 +08:00
Vincent Wei e7002ad870 cleanup; new -> new_entry 2019-03-16 11:33:40 +08:00
Vincent Wei 6838a67e7d some minor changes 2019-03-15 18:24:37 +08:00
Vincent Wei 9a8d997f63 new files 2019-03-15 17:13:47 +08:00
Vincent Wei f8b0a89d90 add glyphruninfo.h 2019-03-15 14:47:41 +08:00
Vincent Wei 72f61f17be trim UCHAR prefix from UCharScriptType and UCHAR_SCRIPT_XXXX 2019-03-15 14:46:24 +08:00
Vincent Wei 676dd0e6da cleanup 2019-03-14 19:08:15 +08:00
Vincent Wei 02c7a6e07c add unicode funcs for HarzBuff 2019-03-14 18:36:21 +08:00
Vincent Wei 8f841a0bc0 split shaped-glyph.c into three files 2019-03-14 17:26:14 +08:00
Vincent Wei f218b7b892 add enable option for complex scripts and harzbuff; cleanup options for TTF support (onley FreeType2) 2019-03-14 17:17:09 +08:00
Vincent Wei 1e1dd76fb1 tune interfaces of GetShapedGlyphsXXX 2019-03-14 12:34:21 +08:00
Vincent Wei 4ba0bcd0fe cleanup 2019-03-13 19:05:15 +08:00
Vincent Wei cc9d9f6d42 basic implementation of GetLangScriptFromName and NormalizeScriptType 2019-03-13 18:57:39 +08:00
Vincent Wei 4c9e8138b1 table for lang name to scripts 2019-03-13 18:27:57 +08:00
Vincent Wei f79a1bd86a cleanup 2019-03-13 18:24:56 +08:00
Vincent Wei 211135fbc5 cleanup 2019-03-13 17:52:43 +08:00
Vincent Wei 537b659fc7 tune implementation of GetShapedGlyphsBasic 2019-03-13 17:25:48 +08:00
Vincent Wei 6b45b74e32 return length of break_oppos instead of the number of consumed uchars 2019-03-13 15:05:18 +08:00
Vincent Wei 0ceb5616bf fix memory usage bug of UStrGetBreaks; UStrGetBreaks does not return when it encounters a hard break 2019-03-13 14:33:48 +08:00
Vincent Wei 62f9cf9e48 tune API description 2019-03-13 12:29:01 +08:00
Vincent Wei 6842cd3933 Split GetUCharsAndBreaks into two APIs: GetUCharsUntilParagraphBoundary and UStrGetBreaks 2019-03-13 12:21:45 +08:00
Vincent Wei 2c5ddd93cb add internal api: _unicode_normalize_script 2019-03-12 19:00:30 +08:00
Vincent Wei 64ddca1e2f Add UCharIsArabicVowel 2019-03-12 18:34:47 +08:00
Vincent Wei 9dea317925 cleanup 2019-03-12 17:53:14 +08:00
Vincent Wei a4e8a42707 cleanup 2019-03-12 17:52:06 +08:00
Vincent Wei 005519e7cc Tuen API of GetShapedGlyphsBasic and GetShapedGlyphsComplex 2019-03-12 15:41:57 +08:00
Vincent Wei da7c2175dd cleanup 2019-03-12 12:29:13 +08:00
Vincent Wei c7e6a867f4 cleanup 2019-03-12 11:57:04 +08:00
Vincent Wei 30c6033e8c cleanup 2019-03-12 09:27:11 +08:00
Vincent Wei 5a5d5d3bbb Passed BidiCharacterTest 2019-03-12 09:03:32 +08:00
Vincent Wei bdd75353d2 cleanup 2019-03-11 19:14:35 +08:00
Vincent Wei ce7b9eccca debug 2019-03-11 18:45:46 +08:00
Vincent Wei c66f1a5fa3 cleanup 2019-03-11 16:08:52 +08:00
Vincent Wei ba240cd53b cleanup 2019-03-11 15:55:14 +08:00
Vincent Wei ca9d0200f3 Implementation of UBidiXXX functions 2019-03-11 15:47:48 +08:00
Vincent Wei 5dd2a21919 Description of Bidi APIs 2019-03-11 12:33:42 +08:00
Vincent Wei 11124ef8a0 rename internal apis and cleanup 2019-03-11 11:51:16 +08:00
Vincent Wei e8714be5ef rename macros 2019-03-11 11:33:02 +08:00
Vincent Wei 13341e864c rename files and internal apis 2019-03-11 09:36:36 +08:00
Vincent Wei e1a464b32f cleanup 2019-03-10 18:55:07 +08:00
Vincent Wei a7601d8cfe tune UCD url 2019-03-10 18:31:15 +08:00
Vincent Wei 98ae3a6b35 Restore BidiBracketType 2019-03-10 18:19:21 +08:00
Vincent Wei f82e15ed5e use iso8859-bidi-tables 2019-03-10 18:08:53 +08:00
Vincent Wei 690f5487ab BIDIType to BidiType 2019-03-10 17:31:36 +08:00
Vincent Wei 4e0a9a8d37 two implementations for biditype, bracket and mirror 2019-03-10 16:54:45 +08:00
Vincent Wei c6f1004ba6 cleanup 2019-03-10 14:47:02 +08:00
Vincent Wei a4e9f56c08 cleanup 2019-03-10 14:44:33 +08:00
Vincent Wei d84a7ffbbe Bidi tables 2019-03-10 14:42:36 +08:00
Vincent Wei 11865764da cleanup 2019-03-10 13:21:08 +08:00
Vincent Wei fdc449335d utilities for generating Bidi tables 2019-03-10 13:17:52 +08:00
Vincent Wei 27e508848d new implementation of UNICODE BIDIRECTIONAL ALGORITHM 2019-03-08 20:38:04 +08:00
Vincent Wei cc01ce0bbc new implementation of UNICODE BIDIRECTIONAL ALGORITHM 2019-03-08 20:37:44 +08:00
Vincent Wei 0093ac3edc New APIs: UCHAR2ACHAR, UChar2AChar, UChars2AChars 2019-03-08 14:39:48 +08:00
Vincent Wei 45db7410c0 Update Unicode tables to 12.0.0 2019-03-08 11:52:49 +08:00
Vincent Wei e6df345736 Update LB8a rule to conform Unicode 12.0.0 2019-03-08 11:52:36 +08:00
Vincent Wei e7b05090cd Rename MCHAR_TYPE_XXX to ACHAR_BASIC_XXX; Tune implementation of GetACharType and GetACharBIDIType 2019-03-08 10:17:18 +08:00
Vincent Wei b82128091e add const for keymap data 2019-03-07 19:09:34 +08:00
Vincent Wei adab30261c add const to incore-res data 2019-03-07 18:57:04 +08:00
Vincent Wei 7e0b378475 add const to _cos_tbl, _tag_tbl, and _acos_tbl; add prefix __mg to these global variables 2019-03-07 18:46:42 +08:00
Vincent Wei d1ef9e2598 rename _unicode_is_emoji_extended_pictographic to _unicode_is_extended_pictographic 2019-03-07 17:46:35 +08:00
Vincent Wei 5887668b17 add new API UCharGetBracketType 2019-03-07 17:42:47 +08:00
Vincent Wei e6cb8f272b update Unicode bidi tables 2019-03-07 17:31:15 +08:00
Vincent Wei 90e4ee91fe Tune BIDIType to Uint16 instead of unsigned int 2019-03-07 12:40:37 +08:00
Vincent Wei 83207ca329 Update Unicode data to 11.0.0 2019-03-07 11:46:17 +08:00
Vincent Wei dcd31bed7c Indic shaping table 2019-03-07 11:02:51 +08:00
Vincent Wei 76cf8a02af Arabic shaping tables 2019-03-07 10:20:41 +08:00
Vincent Wei 10d8b43c61 update emoji data tables 2019-03-07 09:55:23 +08:00
Vincent Wei 554b709890 Restore prototype of DrawGlyphStringEx and add DrawShapedGlyphString 2019-03-07 08:55:47 +08:00
Vincent Wei d877e86adc New API description for GetShapedGlyphsBasic, GetShapedGlyphsComplex, GetGlyphsExtentInfo, and GetGlyphsPositionInfo 2019-03-06 17:20:19 +08:00
Vincent Wei c5e5bd01e8 implement get_glyph_value for FreeType2 engine; the glyph value of this devfont is the glyph index of the default CMap 2019-03-06 16:03:00 +08:00
Vincent Wei e3760457c4 GetGlyphsExtentPointEx -> GetGlyphsExtentFromUChars 2019-03-06 14:42:16 +08:00
Vincent Wei c6ed1626f9 cleanup 2019-03-05 19:09:26 +08:00
250 changed files with 96569 additions and 53736 deletions
+1 -1
View File
@@ -161,7 +161,7 @@ Please report any bugs and incompatibilities in
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 API: `GetGlyphBidiType` to get the glyph type in BIDI.
* New DC attribute: BIDI flag.
1. Enhance commlcd engint to support more pixel type and synchronously update.
1. New USVFB IAL engine and NEWGAL engine for web display server.
+68 -55
View File
@@ -76,7 +76,8 @@ AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(time mktime localtime strdup strcasecmp strncasecmp strerror setlocale getpt)
AC_CHECK_FUNCS(time mktime localtime strdup strcasecmp strncasecmp strerror setlocale)
AC_CHECK_FUNCS(posix_memalign memalign valloc)
dnl ========================================================================
dnl User selectable options
@@ -164,7 +165,8 @@ build_incorefont_times="yes"
build_sef_support="no"
build_qpf_support="no"
use_ttf_lib="ft2"
build_ttf_support="yes"
build_complex_scripts="yes"
build_ttfcache_support="yes"
build_bmpf_support="yes"
@@ -193,6 +195,7 @@ build_eucjp_support="no"
build_shiftjis_support="no"
build_unicode_support="yes"
build_full_unicode="yes"
dnl Keyboard layout specific options
use_kbd_hebrewpc="no"
@@ -536,14 +539,18 @@ AC_ARG_ENABLE(sefsupport,
[ --enable-sefsupport build support for koxomo scripteasy (SEF) <default=no>],
build_sef_support=$enableval)
AC_ARG_WITH(ttfsupport,
[ --with-ttfsupport=ft2/none How to support TrueType font (FreeType 2 or None) <default=ft2>],
use_ttf_lib=$withval)
AC_ARG_ENABLE(ttfsupport,
[ --enable-ttfsupport build support for TrueType/OpenType (needs FreeType2 library) <default=yes>],
build_ttf_support=$enableval)
AC_ARG_ENABLE(ttfcache,
[ --enable-ttfcache include ttf cache support <default=no>],
[ --enable-ttfcache build ttf cache support <default=no>],
build_ttfcache_support=$enableval)
AC_ARG_ENABLE(complexscripts,
[ --enable-complexscripts build support for complex scripts (needs HarzBuff library) <default=yes>],
build_complex_scripts=$enableval)
AC_ARG_ENABLE(bmpfsupport,
[ --enable-bmpfsupport build support for Bitmap Font (bmpf) <default=yes>],
build_bmpf_support=$enableval)
@@ -636,6 +643,10 @@ AC_ARG_ENABLE(unicodesupport,
[ --enable-unicodesupport include UNICODE (ISO-10646-1 and UTF-8 encoding) support <default=yes>],
build_unicode_support=$enableval)
AC_ARG_ENABLE(fullunicode,
[ --enable-fullunicode include support for full UNICODE code points <default=yes>],
build_full_unicode=$enableval)
AC_ARG_ENABLE(kbdhebrewpc,
[ --enable-kbdhebrewpc include keyboard layout for Hebrew PC keyboard <default=no>],
use_kbd_hebrewpc=$enableval)
@@ -834,7 +845,7 @@ CheckFBCON()
AC_ARG_ENABLE(videofbcon,
[ --enable-videofbcon include FrameBuffer console NEWGAL engine <default=yes>],
enable_video_fbcon=$enableval)
if test x$enable_video_fbcon = xyes; then
if test "x$enable_video_fbcon" = "xyes"; then
AC_MSG_CHECKING(for FrameBuffer console support)
video_fbcon=no
AC_TRY_COMPILE([
@@ -846,7 +857,7 @@ CheckFBCON()
video_fbcon=yes
])
AC_MSG_RESULT($video_fbcon)
if test x$video_fbcon = xyes; then
if test "x$video_fbcon" = "xyes"; then
AC_DEFINE(_MGGAL_FBCON, 1,
[Define if include FrameBuffer console NEWGAL engine])
VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
@@ -856,7 +867,7 @@ CheckFBCON()
AC_CHECK_LIB(pciaccess, pci_system_init,
DEP_LIBS="$DEP_LIBS -lpciaccess", have_pciaccess="no")
if test x$have_pciaccess = xyes; then
if test "x$have_pciaccess" = "xyes"; then
AC_DEFINE(_MGHAVE_PCIACCESS, 1,
[Define if PCIAccess lib is available])
LDFLAGS="$LDFLAGS -lpciaccess"
@@ -1099,7 +1110,7 @@ CheckDirectFBVideo()
[ --enable-videodfb include NEWGAL engine for DirectFB <default=no>],
enable_video_dfb=$enableval)
if test x$enable_video_dfb = xyes; then
if test "x$enable_video_dfb" = "xyes"; then
AC_MSG_CHECKING(for DirectFB support)
video_dfb=no
AC_TRY_COMPILE([
@@ -1109,7 +1120,7 @@ CheckDirectFBVideo()
video_dfb=yes
])
AC_MSG_RESULT($video_dfb)
if test x$video_dfb = xyes; then
if test "x$video_dfb" = "xyes"; then
AC_DEFINE(_MGGAL_DFB, 1,
[Define if include NEWGAL engine for DirectFB])
VIDEO_SUBDIRS="$VIDEO_SUBDIRS dfb"
@@ -1121,7 +1132,7 @@ CheckDirectFBVideo()
[ --enable-videost7167 include NEWGAL engine for ST7167 on DirectFB <default=no>],
enable_video_dfb_st7167=$enableval)
if test x$enable_video_dfb_st7167 = xyes; then
if test "x$enable_video_dfb_st7167" = "xyes"; then
AC_DEFINE(_MGGAL_DFB_ST7167, 1,
[Define if include ST7167 subdriver for NEWGAL engine of DirectFB])
fi
@@ -1977,27 +1988,23 @@ if test "x$build_upf_support" = "xyes"; then
fi
dnl Check FreeType lib
case "$use_ttf_lib" in
ft2)
dnl Check for FreeType2 library
if test "x$build_ttf_support" = "xyes"; then
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")
;;
*)
use_ttf_lib="none"
;;
esac
build_ttf_support="no")
fi
dnl Dealing with TTF cache size
case "$use_ttf_lib" in
ft1|ft2)
if test "x$build_ttf_support" = "xyes"; then
if test "x$build_complex_scripts" = "xyes"; then
dnl Check for HarfBuzz library
AC_CHECK_LIB(harfbuzz, hb_version,
DEP_LIBS="$DEP_LIBS -lharfbuzzex",
build_complex_scripts="no")
fi
if test "x$build_ttfcache_support" = "xyes"; then
AC_DEFINE(_MGFONT_TTF_CACHE, 1,
[Define if include ttf cache])
@@ -2037,8 +2044,8 @@ case "$use_ttf_lib" in
esac
AC_ARG_WITH(ttfcachenum,
[ --with-mttfcachenum=[16/32/64/128]])
case "$with_mttfcachenum" in
[ --with-ttfcachenum=[16/32/64/128]])
case "$with_ttfcachenum" in
16)
AC_DEFINE(_MGMAX_TTF_CACHE, 16,
[Define if compile max ttf cahce number for 16])
@@ -2061,35 +2068,35 @@ case "$use_ttf_lib" in
;;
esac
fi
;;
esac
fi
dnl Dealing with CFLAGS and LDFLAGS
case "$use_ttf_lib" in
ft1)
build_unicode_support="yes"
if test "x$build_complex_scripts" = "xyes"; then
build_ttf_support="yes"
AC_DEFINE(_MGCOMPLEX_SCRIPTS, 1,
[Define if support complex scripts based on HarfBuzz])
AC_DEFINE(_MGFONT_TTF, 1,
[Define if support TrueType font])
AC_ARG_WITH(hb_includes,
[ --with-hb-includes=DIR where the HarfBuzz includes are])
AC_ARG_WITH(ft1_includes,
[ --with-ft1-includes=DIR where the FreeType1 includes are])
if test "x$with_ft1_includes" = "x"; then
FT1_INC_DIR="-I/usr/include/freetype1"
if test "x$with_hb_includes" = "x"; then
HB_INC_DIR="-I/usr/local/include/harfbuzz"
else
FT1_INC_DIR="-I$with_ft1_includes"
HB_INC_DIR="-I$with_hb_includes"
fi
AC_SUBST(FT1_INC_DIR)
;;
ft2)
AC_SUBST(HB_INC_DIR)
fi
if test "x$build_ttf_support" = "xyes"; then
build_unicode_support="yes"
AC_DEFINE(_MGFONT_FT2, 1,
[Define if support TrueType font based on FreeType2])
[Define if support TrueType/OpenType fonts based on FreeType2])
with_ft2_includes=""
AC_ARG_WITH(ft2_includes,
[ --with-ft2-includes=DIR where the FreeType2 includes are])
[ --with-ft2-includes=DIR where the FreeType2 includes are],
with_ft2_includes=$withval)
if test "x$with_ft2_includes" = "x"; then
FT2_INC_DIR="-I/usr/include/freetype2"
@@ -2098,15 +2105,13 @@ case "$use_ttf_lib" in
fi
AC_SUBST(FT2_INC_DIR)
;;
esac
fi
if test "x$build_bmpf_support" = "xyes"; then
AC_DEFINE(_MGFONT_BMPF, 1,
[Define if support Bitmap fonts])
fi
if test "x$build_latin2_support" = "xyes"; then
AC_DEFINE(_MGCHARSET_LATIN2, 1,
[Define if support Latin 2 charset])
@@ -2217,6 +2222,11 @@ if test "x$build_unicode_support" = "xyes"; then
[Define if support UNICODE])
fi
if test "x$build_full_unicode" = "xyes"; then
AC_DEFINE(_MGCHARSET_UNICODE_FULL, 1,
[Define if support full UNICODE code points])
fi
if test "x$use_kbd_hebrewpc" = "xyes"; then
AC_DEFINE(_MGKBDLAYOUT_HEBREWPC, 1,
[Define if use the Hebrew PC keyboard layout])
@@ -2470,20 +2480,23 @@ dnl define _GNU_SOURCE for pthread_rwlock_t
CFLAGS="$CFLAGS -D_GNU_SOURCE"
if test "x$devel_mode" = "xyes"; then
CPPFLAGS="$CPPFLAGS -D_DEBUG"
if test "x$detail_debug" = "xyes"; then
CPPFLAGS="$CPPFLAGS -DDEBUG"
if test "x$detail_debug" = "xyes"; then
CPPFLAGS="$CPPFLAGS -D_DEBUG"
fi
if test "$ac_cv_prog_gcc" = "yes"; then
CPPFLAGS="$CPPFLAGS -Wall -Werror"
fi
AC_DEFINE(_MGDEVEL_MODE, 1,
[Define if developer mode enabled])
else
CPPFLAGS="$CPPFLAGS -DNDEBUG"
fi
if test "$ac_cv_prog_gcc" = "yes"; then
CFLAGS="$CFLAGS -O2 -Wstrict-prototypes -pipe"
CFLAGS="$CFLAGS -O2 -fmax-errors=10 -Wstrict-prototypes -pipe"
fi
if test "x$runtime_mode" = "xths"; then
+62 -23
View File
@@ -221,6 +221,38 @@ MGUI_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
/** @} end of basic_types */
/* Here we provide MG_GNUC_EXTENSION as an alias for __extension__,
* where this is valid. This allows for warningless compilation of
* "long long" types even in the presence of '-ansi -pedantic'.
*/
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
#define MG_GNUC_EXTENSION __extension__
#else
#define MG_GNUC_EXTENSION
#endif
/*
* The MG_LIKELY and MG_UNLIKELY macros let the programmer give hints to
* the compiler about the expected result of an expression. Some compilers
* can use this information for optimizations.
*/
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
#define _MG_BOOLEAN_EXPR(expr) \
MG_GNUC_EXTENSION ({ \
int _g_boolean_var_; \
if (expr) \
_g_boolean_var_ = 1; \
else \
_g_boolean_var_ = 0; \
_g_boolean_var_; \
})
#define MG_LIKELY(expr) (__builtin_expect (_MG_BOOLEAN_EXPR(expr), 1))
#define MG_UNLIKELY(expr) (__builtin_expect (_MG_BOOLEAN_EXPR(expr), 0))
#else
#define MG_LIKELY(expr) (expr)
#define MG_UNLIKELY(expr) (expr)
#endif
/**
* \defgroup endian_info Endianness information
* @{
@@ -846,25 +878,28 @@ typedef DWORD32 RGBCOLOR;
* \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,
* and the returned value will be a double word.
* \note The red, green, blue, and alpha components are all ranged
* from 0 to 255, and the returned value will be a 32-bit double word.
*
* \sa GetRValue, GetGValue, GetBValue, GetAValue
*/
#define MakeRGBA(r, g, b, a) (((DWORD32)((BYTE)(r))) | ((DWORD32)((BYTE)(g)) << 8) \
| ((DWORD32)((BYTE)(b)) << 16) | ((DWORD32)((BYTE)(a)) << 24))
#define MakeRGBA(r, g, b, a) \
(((DWORD32)((BYTE)(r))) \
| ((DWORD32)((BYTE)(g)) << 8) \
| ((DWORD32)((BYTE)(b)) << 16) \
| ((DWORD32)((BYTE)(a)) << 24))
/**
* \def MakeRGB(r, g, b)
* \brief Makes a RGB triple value from red \a r, green \a g, and blue \a b components.
* \brief Makes a RGB triple value from red \a r, green \a g,
* and blue \a b components.
*
* \note The red, green, and blue components are all ranged from 0 to 255,
* and the returned value will be a double word.
* and the returned value will be a 32-bit double word.
*
* \sa GetRValue, GetGValue, GetBValue
* \sa GetRValue, GetGValue, GetBValue, GetAValue
*/
#define MakeRGB(r, g, b) (((DWORD32)((BYTE)(r))) | ((DWORD32)((BYTE)(g)) << 8) \
| ((DWORD32)((BYTE)(b)) << 16))
#define MakeRGB(r, g, b) MakeRGBA((r), (g), (b), 255)
/**
* A rectangle defined by coordinates of corners.
@@ -875,8 +910,7 @@ typedef DWORD32 RGBCOLOR;
*
* \sa PRECT, GAL_Rect
*/
typedef struct _RECT
{
typedef struct _RECT {
/**
* The x coordinate of the upper-left corner of the rectangle.
*/
@@ -2055,6 +2089,22 @@ int init_minigui_printf (int (*output_char) (int ch),
#define TCS_CLRLINE(fp)
#endif
#define _MG_PRINTF(fmt, ...) \
do { \
TCS_GREEN (stdout); \
fprintf (stdout, fmt, ##__VA_ARGS__); \
TCS_NONE (stdout); \
} while (0)
#define _WRN_PRINTF(fmt, ...) \
do { \
TCS_BROWN (stderr); \
fprintf (stderr, "%s: ", __FUNCTION__); \
fprintf (stderr, fmt, ##__VA_ARGS__); \
fprintf (stderr, "\n"); \
TCS_NONE (stderr); \
} while (0)
#define _ERR_PRINTF(fmt, ...) \
do { \
TCS_RED (stderr); \
@@ -2062,14 +2112,7 @@ int init_minigui_printf (int (*output_char) (int ch),
TCS_NONE (stderr); \
} while (0)
#ifdef _DEBUG
# define _MG_PRINTF(fmt, ...) \
do { \
TCS_GREEN (stdout); \
fprintf (stdout, fmt, ##__VA_ARGS__); \
TCS_NONE (stdout); \
} while (0)
# ifdef DEBUG
#if defined(_DEBUG)
# define _DBG_PRINTF(fmt, ...) \
do { \
TCS_YELLOW (stderr); \
@@ -2078,10 +2121,6 @@ int init_minigui_printf (int (*output_char) (int ch),
} while (0)
# else
# define _DBG_PRINTF(fmt, ...)
# endif
#else
# define _MG_PRINTF(fmt, ...)
# define _DBG_PRINTF(fmt, ...)
#endif
#ifdef _MGRM_THREADS
+8 -8
View File
@@ -151,9 +151,9 @@ MG_EXPORT fixed fixatan (fixed x);
*/
MG_EXPORT fixed fixatan2 (fixed y, fixed x);
extern MG_EXPORT fixed _cos_tbl[];
extern MG_EXPORT fixed _tan_tbl[];
extern MG_EXPORT fixed _acos_tbl[];
extern MG_EXPORT const fixed __mg_cos_tbl[];
extern MG_EXPORT const fixed __mg_tan_tbl[];
extern MG_EXPORT const fixed __mg_acos_tbl[];
/************************** inline fixed point math functions *****************/
/* ftofix and fixtof are used in generic C versions of fixmul and fixdiv */
@@ -364,7 +364,7 @@ static inline int fixtoi (fixed x)
*/
static inline fixed fixcos (fixed x)
{
return _cos_tbl[((x + 0x4000) >> 15) & 0x1FF];
return __mg_cos_tbl[((x + 0x4000) >> 15) & 0x1FF];
}
/**
@@ -378,7 +378,7 @@ static inline fixed fixcos (fixed x)
*/
static inline fixed fixsin (fixed x)
{
return _cos_tbl[((x - 0x400000 + 0x4000) >> 15) & 0x1FF];
return __mg_cos_tbl[((x - 0x400000 + 0x4000) >> 15) & 0x1FF];
}
/**
@@ -392,7 +392,7 @@ static inline fixed fixsin (fixed x)
*/
static inline fixed fixtan (fixed x)
{
return _tan_tbl[((x + 0x4000) >> 15) & 0xFF];
return __mg_tan_tbl[((x + 0x4000) >> 15) & 0xFF];
}
/**
@@ -415,7 +415,7 @@ static inline fixed fixacos (fixed x)
return 0;
}
return _acos_tbl[(x+65536+127)>>8];
return __mg_acos_tbl[(x+65536+127)>>8];
}
/**
@@ -438,7 +438,7 @@ static inline fixed fixasin (fixed x)
return 0;
}
return 0x00400000 - _acos_tbl[(x+65536+127)>>8];
return 0x00400000 - __mg_acos_tbl[(x+65536+127)>>8];
}
/** @} end of fixed_math_fns */
+2955 -1239
View File
File diff suppressed because it is too large Load Diff
+321
View File
@@ -3508,6 +3508,327 @@ MG_EXPORT char * strtrimall (char* src);
/** @} end of str_helpers */
/**
* \defgroup slices_allocator_fns Slice Memory Allocator
*
* An efficient way to allocate groups of equal-sized chunks of memory.
*
* Memory slices provide a space-efficient and multi-processing scalable
* way to allocate equal-sized pieces of memory, just like the
* MiniGUI's block data heap (\a block_heap_fns). Relative to the
* standard malloc function and block data heap, this allocator can
* avoid excessive memory-waste, scalability and performance problems.
*
* Note that this implementation is derived from LGPL'd glib.
*
* To achieve these goals, the slice allocator uses a sophisticated,
* layered design that has been inspired by Bonwick's slab allocator
* ([Bonwick94](http://citeseer.ist.psu.edu/bonwick94slab.html)
* Jeff Bonwick, The slab allocator: An object-caching kernel
* memory allocator. USENIX 1994, and
* [Bonwick01](http://citeseer.ist.psu.edu/bonwick01magazines.html)
* Bonwick and Jonathan Adams, Magazines and vmem: Extending the
* slab allocator to many cpu's and arbitrary resources. USENIX 2001)
*
* It uses posix_memalign() to optimize allocations of many equally-sized
* chunks, and has per-thread free lists (the so-called magazine layer)
* to quickly satisfy allocation requests of already known structure sizes.
* This is accompanied by extra caching logic to keep freed memory around
* for some time before returning it to the system. Memory that is unused
* due to alignment constraints is used for cache colorization (random
* distribution of chunk addresses) to improve CPU cache utilization. The
* caching layer of the slice allocator adapts itself to high lock
* contention to improve scalability.
*
* The slice allocator can allocate blocks as small as two pointers, and
* unlike malloc(), it does not reserve extra space per block. For large
* block sizes, mg_slice_new() and mg_slice_alloc() will automatically
* delegate to the system malloc() implementation. For newly written code
* it is recommended to use the new `mg_slice` API instead of malloc() and
* friends, as long as objects are not resized during their lifetime and
* the object size used at allocation time is still available when freeing.
*
* Here is an example for using the slice allocator:
*
* \code
* char *mem[10000];
* int i;
*
* // Allocate 10000 blocks.
* for (i = 0; i < 10000; i++)
* {
* mem[i] = mg_slice_alloc (50);
*
* // Fill in the memory with some junk.
* for (j = 0; j < 50; j++)
* mem[i][j] = i * j;
* }
*
* // Now free all of the blocks.
* for (i = 0; i < 10000; i++)
* mg_slice_free (50, mem[i]);
* \endcode
*
* And here is an example for using the slice allocator
* with data structures:
*
* \code
* MyStruct *array;
*
* // Allocate one block, using the mg_slice_new() macro.
* array = mg_slice_new (MyStruct);
*
* // We can now use array just like a normal pointer to a structure.
* array->data = NULL;
* array->len = 0;
* array->alloc = 0;
* array->zero_terminated = (zero_terminated ? 1 : 0);
* array->clear = (clear ? 1 : 0);
* array->elt_size = elt_size;
*
* // We can free the block, so it can be reused.
* mg_slice_delete (MyStruct, array);
* \endcode
*
* @{
*/
/**
* mg_slice_alloc:
* @block_size: the number of bytes to allocate
*
* Allocates a block of memory from the slice allocator.
* The block address handed out can be expected to be aligned
* to at least 1 * sizeof (void*),
* though in general slices are 2 * sizeof (void*) bytes aligned,
* if a malloc() fallback implementation is used instead,
* the alignment may be reduced in a libc dependent fashion.
* Note that the underlying slice allocation mechanism can
* be changed with the [`MG_SLICE=always-malloc`][MG_SLICE]
* environment variable.
*
* Returns: a pointer to the allocated memory block, which will be %NULL if and
* only if @mem_size is 0
*
* Since: 3.4.0
*/
MG_EXPORT void *mg_slice_alloc(size_t block_size);
/**
* mg_slice_alloc0:
* @block_size: the number of bytes to allocate
*
* Allocates a block of memory via mg_slice_alloc() and initializes
* the returned memory to 0. Note that the underlying slice allocation
* mechanism can be changed with the [`MG_SLICE=always-malloc`][MG_SLICE]
* environment variable.
*
* Returns: a pointer to the allocated block, which will be %NULL if and only
* if @mem_size is 0
*
* Since: 3.4.0
*/
MG_EXPORT void *mg_slice_alloc0(size_t block_size);
/**
* mg_slice_copy:
* @block_size: the number of bytes to allocate
* @mem_block: the memory to copy
*
* Allocates a block of memory from the slice allocator
* and copies @block_size bytes into it from @mem_block.
*
* @mem_block must be non-%NULL if @block_size is non-zero.
*
* Returns: a pointer to the allocated memory block, which will be %NULL if and
* only if @mem_size is 0
*
* Since: 3.4.0
*/
MG_EXPORT void *mg_slice_copy(size_t block_size, const void *mem_block);
/**
* mg_slice_free:
* @block_size: the size of the block
* @mem_block: a pointer to the block to free
*
* Frees a block of memory.
*
* The memory must have been allocated via mg_slice_alloc() or
* mg_slice_alloc0() and the @block_size has to match the size
* specified upon allocation. Note that the exact release behaviour
* can be changed with the [`MG_DEBUG=gc-friendly`][MG_DEBUG] environment
* variable, also see [`MG_SLICE`][MG_SLICE] for related debugging options.
*
* If @mem_block is %NULL, this function does nothing.
*
* Since: 3.4.0
*/
MG_EXPORT void mg_slice_free(size_t block_size, void *mem_block);
/**
* mg_slice_free_chain_with_offset:
* @block_size: the size of the blocks
* @mem_chain: a pointer to the first block of the chain
* @next_offset: the offset of the @next field in the blocks
*
* Frees a linked list of memory blocks of structure type @type.
*
* The memory blocks must be equal-sized, allocated via
* mg_slice_alloc() or mg_slice_alloc0() and linked together by a
* @next pointer (similar to #GSList). The offset of the @next
* field in each block is passed as third argument.
* Note that the exact release behaviour can be changed with the
* [`MG_DEBUG=gc-friendly`][MG_DEBUG] environment variable, also see
* [`MG_SLICE`][MG_SLICE] for related debugging options.
*
* If @mem_chain is %NULL, this function does nothing.
*
* Since: 3.4.0
*/
MG_EXPORT void mg_slice_free_chain_with_offset(size_t block_size,
void *mem_chain, size_t next_offset);
/**
* mg_slice_new:
* @type: the type to allocate, typically a structure name
*
* A convenience macro to allocate a block of memory from the
* slice allocator.
*
* It calls mg_slice_alloc() with `sizeof (@type)` and casts the
* returned pointer to a pointer of the given type, avoiding a type
* cast in the source code. Note that the underlying slice allocation
* mechanism can be changed with the [`MG_SLICE=always-malloc`][MG_SLICE]
* environment variable.
*
* This can never return %NULL as the minimum allocation size from
* `sizeof (@type)` is 1 byte.
*
* Returns: (not nullable): a pointer to the allocated block, cast to a pointer
* to @type
*
* Since: 3.4.0
*/
#define mg_slice_new(type) ((type*)mg_slice_alloc(sizeof (type)))
/**
* mg_slice_new0:
* @type: the type to allocate, typically a structure name
*
* A convenience macro to allocate a block of memory from the
* slice allocator and set the memory to 0.
*
* It calls mg_slice_alloc0() with `sizeof (@type)`
* and casts the returned pointer to a pointer of the given type,
* avoiding a type cast in the source code.
* Note that the underlying slice allocation mechanism can
* be changed with the [`MG_SLICE=always-malloc`][MG_SLICE]
* environment variable.
*
* This can never return %NULL as the minimum allocation size from
* `sizeof (@type)` is 1 byte.
*
* Returns: (not nullable): a pointer to the allocated block, cast to a pointer
* to @type
*
* Since: 3.4.0
*/
#define mg_slice_new0(type) ((type*)mg_slice_alloc0(sizeof (type)))
/* MemoryBlockType *
* mg_slice_dup (MemoryBlockType,
* MemoryBlockType *mem_block);
* mg_slice_delete (MemoryBlockType,
* MemoryBlockType *mem_block);
* mg_slice_delete_chain (MemoryBlockType,
* MemoryBlockType *first_chain_block,
* memory_block_next_field);
* pseudo prototypes for the macro definitions following below.
*/
/**
* mg_slice_dup:
* @type: the type to duplicate, typically a structure name
* @mem: (not nullable): the memory to copy into the allocated block
*
* A convenience macro to duplicate a block of memory using
* the slice allocator.
*
* It calls mg_slice_copy() with `sizeof (@type)`
* and casts the returned pointer to a pointer of the given type,
* avoiding a type cast in the source code.
* Note that the underlying slice allocation mechanism can
* be changed with the [`MG_SLICE=always-malloc`][MG_SLICE]
* environment variable.
*
* This can never return %NULL.
*
* Returns: (not nullable): a pointer to the allocated block, cast to a pointer
* to @type
*
* Since: 3.4.0
*/
#define mg_slice_dup(type, mem) \
(1 ? (type*) mg_slice_copy (sizeof (type), (mem)) \
: ((void) ((type*) 0 == (mem)), (type*) 0))
/**
* mg_slice_delete:
* @type: the type of the block to free, typically a structure name
* @mem: a pointer to the block to free
*
* A convenience macro to free a block of memory that has
* been allocated from the slice allocator.
*
* It calls mg_slice_free() using `sizeof (type)`
* as the block size.
* Note that the exact release behaviour can be changed with the
* [`MG_DEBUG=gc-friendly`][MG_DEBUG] environment variable, also see
* [`MG_SLICE`][MG_SLICE] for related debugging options.
*
* If @mem is %NULL, this macro does nothing.
*
* Since: 3.4.0
*/
#define mg_slice_delete(type, mem) \
do { \
if (1) mg_slice_free (sizeof (type), (mem)); \
else (void) ((type*) 0 == (mem)); \
} while(0)
/**
* mg_slice_delete_chain:
* @type: the type of the @mem_chain blocks
* @mem_chain: a pointer to the first block of the chain
* @next: the field name of the next pointer in @type
*
* Frees a linked list of memory blocks of structure type @type.
* The memory blocks must be equal-sized, allocated via
* mg_slice_alloc() or mg_slice_alloc0() and linked together by
* a @next pointer (similar to #GSList). The name of the
* @next field in @type is passed as third argument.
* Note that the exact release behaviour can be changed with the
* [`MG_DEBUG=gc-friendly`][MG_DEBUG] environment variable, also see
* [`MG_SLICE`][MG_SLICE] for related debugging options.
*
* If @mem_chain is %NULL, this function does nothing.
*
* Since: 3.4.0
*/
#define mg_slice_delete_chain(type, mem_chain, next) \
do { \
if (1) mg_slice_free_chain_with_offset (sizeof (type), \
(mem_chain), G_STRUCT_OFFSET (type, next)); \
else (void) ((type*) 0 == (mem_chain)); \
} while(0)
#ifdef _MGDEVEL_MODE
MG_EXPORT void mg_slice_debug_tree_statistics(void);
#endif
/** @} end of slices_allocator_fns */
/** @} end of global_fns */
/** @} end of fns */
+1 -1
View File
@@ -4865,7 +4865,7 @@ MG_EXPORT void* GetResource (RES_KEY key);
*
* When you get a resource, you should call this function to ensure that
* the resource can not be unloaded when you still use it.
* This function must be called after LoadResource.
* This function must be called after GetResource.
*
* \param key The key of resource (use Str2Key(res_name) to get the key).
*
+29 -29
View File
@@ -451,17 +451,17 @@ static void print_ranges(int* ranges, int nr_ranges, PBIDISLEDITDATA sled)
int start_byte_index = get_achar_text_index(sled, sled->selStart);
int end_byte_index = get_achar_text_index (sled, sled->selEnd);
if(ranges){
_MG_PRINTF("sel_achar-[%d,%d], sel_byte = [%d, %d]\n",
_DBG_PRINTF("sel_achar-[%d,%d], sel_byte = [%d, %d]\n",
sled->selStart, sled->selEnd,
start_byte_index, end_byte_index);
_MG_PRINTF("nr_ranges = %d.\n ranges = ", nr_ranges);
_DBG_PRINTF("nr_ranges = %d.\n ranges = ", nr_ranges);
for (i=0; i<nr_ranges; i++)
{
_MG_PRINTF ("[%d, %d)-",
_DBG_PRINTF ("[%d, %d)-",
ranges[i<<1], ranges[(i<<1)+1]);
}
_MG_PRINTF("\n");
_DBG_PRINTF("\n");
}
}
#endif
@@ -537,11 +537,11 @@ static void slePaint (HWND hWnd, HDC hdc, PBIDISLEDITDATA sled)
/* draw normal string. */
setup_dc (hWnd, sled, hdc, FALSE);
outw += DrawGlyphString (hdc, startx + outw, starty,
outw += DrawACharString (hdc, startx + outw, starty,
achar_string, len, NULL, NULL);
/* draw selected string.*/
setup_dc (hWnd, sled, hdc, TRUE);
outw += DrawGlyphString (hdc, startx + outw, starty,
outw += DrawACharString (hdc, startx + outw, starty,
achar_string + len, *(p + 1) - *p, NULL, NULL);
achar_string = ACHARS + *(p + 1);
@@ -553,28 +553,28 @@ static void slePaint (HWND hWnd, HDC hdc, PBIDISLEDITDATA sled)
/* draw the last rest normal string if necessary.*/
if (p && ACHARSLEN > *(p-1)) {
setup_dc (hWnd, sled, hdc, FALSE);
outw += DrawGlyphString (hdc, startx + outw, starty,
outw += DrawACharString (hdc, startx + outw, starty,
achar_string, ACHARSLEN - *(p - 1), NULL, NULL);
}
else if(!p || nr_ranges == 0){
/* draw first normal chars */
if (sled->selStart > 0) {
setup_dc (hWnd, sled, hdc, FALSE);
outw += DrawGlyphString (hdc, startx + outw, starty,
outw += DrawACharString (hdc, startx + outw, starty,
achar_string, sled->selStart, NULL, NULL);
achar_string += sled->selStart;
}
/* draw selected chars */
setup_dc (hWnd, sled, hdc, TRUE);
outw += DrawGlyphString (hdc, startx + outw, starty,
outw += DrawACharString (hdc, startx + outw, starty,
achar_string, sled->selEnd - sled->selStart, NULL, NULL);
achar_string += sled->selEnd - sled->selStart;
/* draw others */
if (sled->selEnd < ACHARSLEN) {
setup_dc (hWnd, sled, hdc, FALSE);
outw += DrawGlyphString (hdc, startx + outw, starty,
outw += DrawACharString (hdc, startx + outw, starty,
achar_string, ACHARSLEN - sled->selEnd, NULL, NULL);
}
@@ -587,7 +587,7 @@ static void slePaint (HWND hWnd, HDC hdc, PBIDISLEDITDATA sled)
setup_dc (hWnd, sled, hdc, FALSE);
startx = sled->startx;
sleContentToWindow (sled, &startx);
DrawGlyphString (hdc, startx, starty, achar_string, ACHARSLEN, NULL, NULL);
DrawACharString (hdc, startx, starty, achar_string, ACHARSLEN, NULL, NULL);
}
if (dwStyle & ES_PASSWORD)
@@ -638,14 +638,14 @@ static void set_caret_pos (HWND hWnd, PBIDISLEDITDATA sled, int x, BOOL bSel)
txtsize.cx = 0;
}
else {
out_achars = GetGlyphsExtentPoint (hdc, ACHARS, ACHARSLEN,
out_achars = GetACharsExtentPoint (hdc, ACHARS, ACHARSLEN,
x - sled->startx, &txtsize);
#ifdef _DEBUG
if(out_achars <= ACHARSLEN){
out_chars = get_achar_text_index(sled, out_achars);
}
_DBG_PRINTF ("editPos=%d,out_chars=%d\n", out_achars, out_chars);
#endif
_MG_PRINTF ("editPos=%d,out_chars=%d\n", out_achars, out_chars);
}
if (!bSel) {
sled->selStart = sled->selEnd = 0;
@@ -694,7 +694,7 @@ make_charpos_visible (HWND hWnd, PBIDISLEDITDATA sled, int achar_pos, int *cx)
achar_pos = ACHARSLEN;
hdc = GetClientDC (hWnd);
GetGlyphsExtent (hdc, ACHARS, achar_pos, &achars_size);
GetACharsExtent (hdc, ACHARS, achar_pos, &achars_size);
ReleaseDC (hdc);
}
if (cx)
@@ -799,7 +799,7 @@ static int sleMouseMove (HWND hWnd, PBIDISLEDITDATA sled, LPARAM lParam)
sled->selEnd = ACHARSLEN;
//sled->nContX = sled->nContW - (sled->rcVis.right - sled->rcVis.left);
hdc = GetClientDC (hWnd);
sled->nContX = GetGlyphsExtent (hdc, ACHARS, ACHARSLEN, &size) - (sled->rcVis.right - sled->rcVis.left);
sled->nContX = GetACharsExtent (hdc, ACHARS, ACHARSLEN, &size) - (sled->rcVis.right - sled->rcVis.left);
ReleaseDC (hdc);
printf ("nContX = %d. nContW = %d, rcVis.right = %d, rcVis.left = %d.\n",
sled->nContX, sled->nContW, sled->rcVis.right, sled->rcVis.left);
@@ -849,7 +849,7 @@ static void set_line_width (HWND hWnd, PBIDISLEDITDATA sled)
SelectFont (hdc, GetWindowFont(hWnd));
update_achar_info(hWnd, sled);
GetGlyphsExtent (hdc, ACHARS, ACHARSLEN, &achars_size);
GetACharsExtent (hdc, ACHARS, ACHARSLEN, &achars_size);
ReleaseDC (hdc);
if (achars_size.cx > sled->nVisW)
@@ -944,7 +944,7 @@ static void del_selected_text (HWND hWnd, PBIDISLEDITDATA sled)
end_byte_index = MAX (s, e);
_MG_PRINTF("delete: sel_achar-[%d,%d], sel_byte = [%d, %d]\n",
_DBG_PRINTF("delete: sel_achar-[%d,%d], sel_byte = [%d, %d]\n",
sled->selStart, sled->selEnd,
start_byte_index, end_byte_index);
@@ -1243,15 +1243,15 @@ get_insert_pos (PLOGFONT logfont, PBIDISLEDITDATA sled, char *newtext,
static void print_text(PBIDISLEDITDATA sled)
{
int i;
_MG_PRINTF("sled->text = [");
_DBG_PRINTF("sled->text = [");
for (i=0; i<TEXTLEN; i++)
_MG_PRINTF("%c", TEXT[i]);
_MG_PRINTF ("]\n");
_DBG_PRINTF("%c", TEXT[i]);
_DBG_PRINTF ("]\n");
/* output hexstring.*/
_MG_PRINTF("sled->text = [");
_DBG_PRINTF("sled->text = [");
for (i=0; i<TEXTLEN; i++)
_MG_PRINTF("%0x ", TEXT[i]);
_MG_PRINTF ("]\n");
_DBG_PRINTF("%0x ", TEXT[i]);
_DBG_PRINTF ("]\n");
}
#endif
@@ -1336,12 +1336,12 @@ sleInsertText (HWND hWnd, PBIDISLEDITDATA sled, char *newtext,
#ifdef _DEBUG
{
int i = 0;
_MG_PRINTF ("string = %s.\n", TEXT);
_MG_PRINTF ("editPos = %d.\n", sled->editPos);
_DBG_PRINTF ("string = %s.\n", TEXT);
_DBG_PRINTF ("editPos = %d.\n", sled->editPos);
for (i = 0; i < sled->achar_content.achars_len; i++) {
_MG_PRINTF ("map[%d] = %d,", i,
_DBG_PRINTF ("map[%d] = %d,", i,
sled->achar_content.achar_map[i].byte_index);
_MG_PRINTF ("\n");
_DBG_PRINTF ("\n");
}
}
#endif
@@ -2281,7 +2281,7 @@ static void sledit_refresh_caret (HWND hWnd, PBIDISLEDITDATA sled, BOOL bInited)
return;
hdc = GetClientDC (hWnd);
outchar = GetGlyphsExtentPoint (hdc, ACHARS, ACHARSLEN, 0, &achars_size);
outchar = GetACharsExtentPoint (hdc, ACHARS, ACHARSLEN, 0, &achars_size);
ReleaseDC (hdc);
if (bInited) {
@@ -2488,7 +2488,7 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
unsigned char charBuffer [4];
int chars;
_MG_PRINTF("get char-----------------char----%p\n", (PVOID)wParam);
_DBG_PRINTF("get char-----------------char----%p\n", (PVOID)wParam);
if (dwStyle & ES_READONLY)
return 0;
+1 -1
View File
@@ -352,7 +352,7 @@ static LRESULT ComboBoxCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
DWORD list_style, edit_style;
if (!(pData = calloc (1, sizeof (COMBOBOXDATA)))) {
_MG_PRINTF ("CONTROL>ComboBox: Create control failure!\n");
_WRN_PRINTF ("Create control failure!");
return -1;
}
+2 -2
View File
@@ -565,7 +565,7 @@ static void lstOnDrawSListBoxItems (HWND hWnd, HDC hdc,
if (!pWin->we_rdr)
{
_MG_PRINTF ("CONTROL>ListBox: NULL LFRDR.\n");
_WRN_PRINTF ("NULL LFRDR.");
return;
}
@@ -710,7 +710,7 @@ static int lstSelectItem (HWND hwnd, PLISTBOXDATA pData, int newSel)
#ifdef _DEBUG
if (!newItem)
_MG_PRINTF ("CONTROL>ListBox: return value of lstGetItem is NULL. \n");
_WRN_PRINTF ("return value of lstGetItem is NULL.");
#endif
if (GetWindowStyle (hwnd) & LBS_MULTIPLESEL) {
+1 -1
View File
@@ -104,7 +104,7 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
case MSG_CREATE:
if (!(pData = malloc (sizeof (PROGRESSDATA)))) {
_MG_PRINTF ("CONTROL>ProgressBar: Create control failure!\n");
_WRN_PRINTF ("Create control failure!");
return -1;
}
+12 -13
View File
@@ -172,15 +172,14 @@ static int init_sbdata (HWND hwnd, PSCROLLBARDATA pdata, RECT * scRect)
{
DWORD win_style = GetWindowStyle (hwnd);
if (!GetWindowRect (hwnd, scRect))
{
_MG_PRINTF ("ScrollBar Rect error!\n");
if (!GetWindowRect (hwnd, scRect)) {
_WRN_PRINTF ("ScrollBar Rect error!");
return -1;
}
if ((win_style & SBS_NOSHAFT) && (win_style & SBS_NOARROW))
{
_MG_PRINTF ("ScrollBar styles error!\n");
_WRN_PRINTF ("ScrollBar styles error!");
return -1;
}
if (!(win_style & SBS_HORZ))
@@ -285,7 +284,7 @@ int track_thumb (HWND hwnd, PSCROLLBARDATA data, int x, int y)
if (!data)
{
_MG_PRINTF ("addtional data2 is NULL\n");
_WRN_PRINTF ("addtional data2 is NULL");
return -1;
}
@@ -364,7 +363,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
/* create the main data construction for the control */
if (!(data = (PSCROLLBARDATA) malloc (sizeof (SCROLLBARDATA))))
{
_MG_PRINTF ("Create ScrollBar control failure!\n");
_WRN_PRINTF ("Create ScrollBar control failure!");
return -1;
}
memset (data, 0 , sizeof (SCROLLBARDATA));
@@ -373,7 +372,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if(0 != init_sbdata(hwnd, data, &rc))
{
free(data);
_MG_PRINTF ("Create ScrollBar control failure!\n");
_WRN_PRINTF ("Create ScrollBar control failure!");
return -1;
}
@@ -404,7 +403,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (!data)
{
_MG_PRINTF ("addition data2 is NULL \n");
_WRN_PRINTF ("addition data2 is NULL");
return 1;
}
@@ -1081,7 +1080,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
{
if (info->nMax < info->nMin)
{
_MG_PRINTF ( "Error range\n");
_WRN_PRINTF ( "Error range");
return -1;
}
new_nMin = info->nMin;
@@ -1093,7 +1092,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (info->nPage > new_nMax - new_nMin + 1
|| info->nPage <= 0)
{
_MG_PRINTF ( "Error page step\n");
_WRN_PRINTF ( "Error page step");
return -1;
}
new_nPage = info->nPage;
@@ -1112,7 +1111,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (info->nPos < new_nMin ||
info->nPos > new_nMax)
{
_MG_PRINTF ( "Error postion to set");
_WRN_PRINTF ( "Error postion to set");
return -1;
}
new_nPos = info->nPos;
@@ -1171,7 +1170,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if(max < data->curPos || min > data->curPos)
{
_MG_PRINTF ( "Error range to set\n");
_WRN_PRINTF ( "Error range to set");
return -1;
}
data->minPos = min;
@@ -1200,7 +1199,7 @@ static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if(max < data->curPos || min > data->curPos)
{
_MG_PRINTF ( "Error range to set\n");
_WRN_PRINTF ( "Error range to set");
return -1;
}
data->minPos = min;
+3 -3
View File
@@ -916,7 +916,7 @@ textdoc_insert_text (TextDoc *txtdoc, const char* newtext, int len)
/* insert last strings */
/* FIXME */
if (!nextnode) {
_MG_PRINTF ("CONTROL>TextEdit: (Warning) nextnode is NULL!\n");
_WRN_PRINTF ("nextnode is NULL!");
/* set_current_node (txtdoc, LASTNODE(txtdoc), FALSE, TRUE); */
}
else {
@@ -1446,7 +1446,7 @@ static int get_line_nr (HWND hWnd, PTEDATA ptedata, TextNode *node, int indent)
HDC hdc;
if (!node) {
_MG_PRINTF ("CONTROL>TextEdit: (Warning) pass NULL text node to get_line_nr\n");
_WRN_PRINTF ("pass NULL text node to get_line_nr");
return 0;
}
@@ -1571,7 +1571,7 @@ set_line_width (HWND hWnd, PTEDATA ptedata, TextNode *node, int indent)
HDC hdc;
if (!node) {
_MG_PRINTF ("CONTROL>TextEdit: (Warning) pass NULL text node to set_line_width\n");
_WRN_PRINTF ("pass NULL text node to set_line_width");
return -1;
}
+2 -2
View File
@@ -64,7 +64,7 @@ static void TrackBarOnDraw (HWND hwnd, HDC hdc, TRACKBARDATA* pData, DWORD dwSty
win_rdr = GetWindowInfo(hwnd)->we_rdr;
if (!win_rdr) {
_MG_PRINTF ("CONTROL>TrackBar: window renderer is NULL.\n");
_WRN_PRINTF ("window renderer is NULL");
return;
}
@@ -217,7 +217,7 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
{
case MSG_CREATE:
if (!(pData = malloc (sizeof (TRACKBARDATA)))) {
_MG_PRINTF ("CONTROL>TrackBar: Create control failure!\n");
_WRN_PRINTF ("Create control failure!");
return -1;
}
pData->nMax = 10;
+18 -18
View File
@@ -216,7 +216,7 @@ static int LWZReadByte (MG_RWops *area, int flag, int input_code_size)
while (code >= clear_code) {
*sp++ = table[1][code];
if (code == table[0][code]) {
_MG_PRINTF ("EX_CTRL>GIF89a: circular table entry\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: circular table entry\n");
return -1;
}
code = table[0][code];
@@ -259,7 +259,7 @@ static int GetCode(MG_RWops *area, int code_size, int flag)
if ((curbit + code_size) >= lastbit) {
if (done) {
if (curbit >= lastbit)
_MG_PRINTF ("EX_CTRL>GIF89a: bad decode\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad decode\n");
return -1;
}
buf[0] = buf[last_byte - 2];
@@ -362,7 +362,7 @@ static int ReadGIFGlobal (MG_RWops *area, GIFSCREEN* GifScreen)
version [3] = '\0';
if (strcmp ((const char*)version, "87a") != 0 && strcmp ((const char*)version, "89a") != 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: GIF version number not 87a or 89a.\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: GIF version number not 87a or 89a.\n");
return -1; /* image loading error*/
}
@@ -373,7 +373,7 @@ static int ReadGIFGlobal (MG_RWops *area, GIFSCREEN* GifScreen)
GifScreen->disposal = 0;
if (!ReadOK (area, buf, 7)) {
_MG_PRINTF ("EX_CTRL>GIF89a: bad screen descriptor\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad screen descriptor\n");
return -1; /* image loading error*/
}
GifScreen->Width = LM_to_uint (buf[0], buf[1]);
@@ -384,10 +384,10 @@ static int ReadGIFGlobal (MG_RWops *area, GIFSCREEN* GifScreen)
GifScreen->AspectRatio = buf[6];
if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */
_MG_PRINTF ("EX_CTRL>GIF89a: have global colormap: %d\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: have global colormap: %d\n",
GifScreen->Background);
if (ReadColorMap (area, GifScreen->BitPixel, GifScreen->ColorMap)) {
_MG_PRINTF ("EX_CTRL>GIF89a: bad global colormap\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad global colormap\n");
return -1; /* image loading error*/
}
}
@@ -399,7 +399,7 @@ static int ReadImageDesc (MG_RWops *area, IMAGEDESC* ImageDesc, GIFSCREEN* GifSc
{
unsigned char buf[16];
if (!ReadOK (area, buf, 9)) {
_MG_PRINTF ("EX_CTRL>GIF89a: bad image size\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad image size\n");
return -1;
}
@@ -414,9 +414,9 @@ static int ReadImageDesc (MG_RWops *area, IMAGEDESC* ImageDesc, GIFSCREEN* GifSc
ImageDesc->interlace = BitSet(buf[8], INTERLACE);
if (ImageDesc->haveColorMap) {
_MG_PRINTF ("EX_CTRL>GIF89a: have local colormap\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: have local colormap\n");
if (ReadColorMap (area, ImageDesc->bitPixel, ImageDesc->ColorMap) < 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: bad local colormap\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: bad local colormap\n");
return -1;
}
} else {
@@ -437,12 +437,12 @@ static int ReadImage (MG_RWops* area, MYBITMAP* bmp, IMAGEDESC* ImageDesc, GIFSC
* initialize the compression routines
*/
if (!ReadOK (area, &c, 1)) {
_MG_PRINTF ("EX_CTRL>GIF89a: eof on image data\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: eof on image data\n");
return -1;
}
if (LWZReadByte (area, TRUE, c) < 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: error reading image\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: error reading image\n");
return -1;
}
@@ -549,11 +549,11 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
anim->bk.a = 0;
}
_MG_PRINTF ("EX_CTRL>GIF89a: Background: %d, %d, %d.\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: Background: %d, %d, %d.\n",
anim->bk.r, anim->bk.g, anim->bk.b);
if ((ok = ReadOK (area, &c, 1)) == 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
goto error;
}
@@ -561,11 +561,11 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
switch (c) {
case '!':
if ( (ok = ReadOK (area, &c, 1)) == 0) {
_MG_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: EOF on image data\n");
goto error;
}
DoExtension (area, c, &GifScreen);
_MG_PRINTF ("EX_CTRL>GIF89a: Extension info: %d, %d, %d, %d, %d, %d\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: Extension info: %d, %d, %d, %d, %d, %d\n",
GifScreen.Width, GifScreen.Height,
GifScreen.AspectRatio, GifScreen.delayTime,
GifScreen.disposal, GifScreen.transparent);
@@ -579,7 +579,7 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
if (ReadImage (area, &mybmp, &ImageDesc, &GifScreen, 0) < 0)
goto error;
}
_MG_PRINTF ("EX_CTRL>GIF89a: Image Descriptor: %d, %d, %d, %d, %d\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: Image Descriptor: %d, %d, %d, %d, %d\n",
ImageDesc.Top, ImageDesc.Left,
ImageDesc.Width, ImageDesc.Height,
ImageDesc.haveColorMap);
@@ -595,14 +595,14 @@ ANIMATION* CreateAnimationFromGIF89a (HDC hdc, MG_RWops* area)
frame->width = mybmp.w;
frame->height = mybmp.h;
frame->delay_time = (GifScreen.delayTime>10)?GifScreen.delayTime:10;
_MG_PRINTF ("EX_CTRL>GIF89a: frame info: %d, %d, %d, %d\n",
_WRN_PRINTF ("EX_CTRL>GIF89a: frame info: %d, %d, %d, %d\n",
frame->off_x, frame->off_y, frame->delay_time,
GifScreen.transparent);
if ((frame->mem_dc = CreateMemDCFromMyBitmap (&mybmp, ImageDesc.ColorMap)) == 0) {
free (mybmp.bits);
free (frame);
_MG_PRINTF ("EX_CTRL>GIF89a: Error when expand frame bitmap.\n");
_WRN_PRINTF ("EX_CTRL>GIF89a: Error when expand frame bitmap.\n");
goto error;
}
frame->bits = mybmp.bits;
+1 -1
View File
@@ -1108,7 +1108,7 @@ void GridCellTypeNumber_set_text_value(gvGridCellData* cell, int row, int col, c
if (INF[0] != 'I' && INF[0] != 'i')
cell->data.number.num = number;
else
_MG_PRINTF ("EX_CTRL>Grid: The inputed number is too big!\n");
_WRN_PRINTF ("EX_CTRL>Grid: The inputed number is too big!\n");
}
double GridCellTypeNumber_get_double_value(gvGridCellData* cell, int row, int col)
+27 -7
View File
@@ -2,26 +2,46 @@ SUBDIRS = in-core
noinst_LTLIBRARIES = libfont.la
SRC_FILES = charset.c charset-arabic.c charset-bidi.c \
SRC_FILES = charset.c charset-arabic.c legacy-bidi.c charset-unicode.c \
unicode-comp.c unicode-script.c language-code.c \
sysfont.c logfont.c devfont.c fontname.c \
rawbitmap.c varbitmap.c qpf.c upf.c \
nullfont.c rawbitmap.c varbitmap.c qpf.c upf.c \
fontcache.c freetype2.c font-engines.c\
gbunimap.c gbkunimap.c gb18030unimap.c big5unimap.c \
ujisunimap.c sjisunimap.c euckrunimap.c \
textops.c mapunitogb.c mapunitogbk.c mapunitobig5.c mapunitogb18030.c \
textops.c \
mapunitogb.c mapunitogbk.c mapunitobig5.c mapunitogb18030.c \
bitmapfont.c scripteasy.c \
unicode-emoji.c
unicode-emoji.c unicode-vop.c \
unicode-bidi.c \
unicode-break.c unicode-break-arabic.c unicode-break-indic.c unicode-break-thai.c \
unicode-joining-types.c unicode-joining.c unicode-shape.c \
unicode-shape-arabic.c harzbuff-minigui-funcs.c \
unicode-iterators.c
HDR_FILES = charset.h rawbitmap.h varbitmap.h freetype2.h qpf.h 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
unicode-tables.h unicode-break-tables.h unicode-script-table.h \
unicode-decomp.h unicode-comp.h \
unicode-emoji-tables.h \
legacy-bidi-tables.inc \
unicode-bidi.h unicode-vop-table.inc \
unicode-joining-types-list.inc \
unicode-joining-type-table.inc \
unicode-arabic-shaping-table.inc \
unicode-arabic-misc-table.inc \
unicode-bidi-bidi-types-list.inc \
unicode-bidi-bidi-type-table.inc \
unicode-bidi-brackets-table.inc \
unicode-bidi-brackets-type-table.inc \
unicode-bidi-mirroring-table.inc \
script-language-table.inc \
emoji_presentation_scanner.inc
EXTRA_DIST = convgbmap.c jisunimap.c $(SRC_FILES) $(HDR_FILES) \
makefile.ng makefile.msvc
# AM_CPPFLAGS = $(FT1_INC_DIR) $(FT2_INC_DIR)
AM_CPPFLAGS = $(FT2_INC_DIR)
AM_CPPFLAGS = $(FT2_INC_DIR) $(HB_INC_DIR)
AM_CPPFLAGS += -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
libfont_la_SOURCES = $(SRC_FILES) $(HDR_FILES)
+1 -1
View File
@@ -274,7 +274,7 @@ get_glyph_prbitmap (LOGFONT* logfont, DEVFONT* devfont,
bmp->bmHeight = 0;
bmp->bmPitch = 0;
_MG_PRINTF ("FONT>Bitmap: "
_DBG_PRINTF ("FONT>Bitmap: "
"Glyph %d does not exist and is replaced with default glyph. \n",
glyph_value);
return 1;
+15 -6
View File
@@ -176,6 +176,8 @@ static unsigned short iso8859_68x_unicode_map [] =
static Uchar32 iso8859_6_conv_to_uc32 (Achar32 chv)
{
chv = REAL_ACHAR(chv);
if (chv < 0x81)
return (Achar32) (chv);
else if (chv <= MAX_GLYPH_VALUE )
@@ -456,10 +458,10 @@ static int iso8859_6_len_first_char (const unsigned char* mstr, int len)
static unsigned int iso8859_6_char_type (Achar32 chv)
{
unsigned int ch_type = MCHAR_TYPE_UNKNOWN;
unsigned int ch_type = ACHAR_BASIC_UNKNOWN;
if (is_arabic_char_vowel (chv)) { /* is vowel */
ch_type = MCHAR_TYPE_VOWEL;
ch_type = ACHAR_BASIC_VOWEL;
}
else{
ch_type = sb_char_type (chv);
@@ -468,7 +470,8 @@ static unsigned int iso8859_6_char_type (Achar32 chv)
return ch_type;
}
static Uint32 __mg_iso8859_68x_type[] = {
static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
#if 0
/*0x00~0x0f*/
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
@@ -504,6 +507,7 @@ static Uint32 __mg_iso8859_68x_type[] = {
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON,
/*0x60~0x6f*/
BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
@@ -515,6 +519,7 @@ static Uint32 __mg_iso8859_68x_type[] = {
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_BN,
#endif
/*0x80~0x8f*/
BIDI_TYPE_ON, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
@@ -586,9 +591,13 @@ static Uint32 __mg_iso8859_68x_type[] = {
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
};
static unsigned int iso8859_6_bidi_char_type (Achar32 chv)
static BidiType iso8859_6_bidi_char_type (Achar32 chv)
{
return __mg_iso8859_68x_type [chv];
chv = REAL_ACHAR(chv);
if (chv > 0x7F)
return (BidiType)__mg_iso8859_6_bidi_char_type_map[chv - 0x80];
else
return (BidiType)__mg_iso8859_1_bidi_char_type_map[chv];
}
static int get_table_index(Uint8 c)
@@ -847,7 +856,7 @@ static BOOL iso8859_6_bidi_mirror_char (Achar32 chv, Achar32* mirrored)
static CHARSETOPS CharsetOps_iso8859_6 = {
256,
1,
3,
FONT_CHARSET_ISO8859_6,
0,
iso8859_6_len_first_char,
File diff suppressed because it is too large Load Diff
+67 -1398
View File
File diff suppressed because it is too large Load Diff
+119 -20
View File
@@ -68,7 +68,6 @@ static DEVFONT* mb_dev_font_head = NULL;
static int nr_sb_dev_fonts;
static int nr_mb_dev_fonts;
#define ADD_DEVFONT_TO_LIST(head, new) \
{ \
if (head == NULL) \
@@ -521,7 +520,7 @@ static DEVFONT* find_devfont(const char* font_name, BOOL is_mbc_list)
return NULL;
}
static DEVFONT* make_devfont (const char* font_name, void* data, BOOL is_filename)
static DEVFONT* make_devfont (const char* font_name, const void* data, BOOL is_filename)
{
FONTOPS_INFO* fontops_info = __mg_fontops_infos;
DEVFONT* devfont;
@@ -536,24 +535,24 @@ static DEVFONT* make_devfont (const char* font_name, void* data, BOOL is_filenam
}
if (fontops_info->type == NULL) {
_MG_PRINTF ("FONT>DevFont: invalid font type: %s.\n", font_name);
_WRN_PRINTF ("invalid font type: %s", font_name);
return NULL;
}
/*find the first charset*/
if (!fontGetCharsetFromName (font_name, charset)) {
_MG_PRINTF ("FONT>DevFont: Invalid charset name: %s.\n", font_name);
_WRN_PRINTF ("Invalid charset name: %s", font_name);
return NULL;
}
if ((charset_ops = GetCharsetOpsEx (charset)) == NULL) {
_MG_PRINTF ("FONT>DevFont: Invalid charset name %s of font %s.\n",
_WRN_PRINTF ("Invalid charset name %s of font %s",
charset, font_name);
return NULL;
}
if (find_devfont(font_name, (charset_ops->bytes_maxlen_char > 1))) {
_MG_PRINTF ("FONT>DevFont: Duplicated devfont name (%s).\n",
_WRN_PRINTF ("Duplicated devfont name (%s)",
font_name);
return NULL;
}
@@ -569,7 +568,7 @@ static DEVFONT* make_devfont (const char* font_name, void* data, BOOL is_filenam
font_name, data);
if (devfont->data == NULL) {
_MG_PRINTF ("FONT>DevFont: error in loading font %s from %s file\n",
_WRN_PRINTF ("error when loading font %s from %s file",
font_name, (const char*) data);
free (devfont);
return NULL;
@@ -577,7 +576,7 @@ static DEVFONT* make_devfont (const char* font_name, void* data, BOOL is_filenam
devfont->need_unload = TRUE;
}
else {
devfont->data = data;
devfont->data = (void*)data;
devfont->need_unload = FALSE;
}
@@ -622,7 +621,7 @@ static void add_relating_devfonts_to_list (DEVFONT* related_devfont)
}
}
static BOOL add_dev_font (const char* font_name, void* data, BOOL is_filename)
static BOOL add_dev_font (const char* font_name, const void* data, BOOL is_filename)
{
DEVFONT* devfont = make_devfont (font_name, data, is_filename);
if (devfont == NULL) {
@@ -634,6 +633,82 @@ static BOOL add_dev_font (const char* font_name, void* data, BOOL is_filename)
return TRUE;
}
static const char* _null_font_names [] = {
"nuf-dummy-rrncnn-8-1-ISO8859-1",
#ifdef _MGCHARSET_LATIN2
"nuf-dummy-rrncnn-8-1-ISO8859-2",
#endif
#ifdef _MGCHARSET_LATIN3
"nuf-dummy-rrncnn-8-1-ISO8859-3",
#endif
#ifdef _MGCHARSET_LATIN4
"nuf-dummy-rrncnn-8-1-ISO8859-4",
#endif
#ifdef _MGCHARSET_CYRILLIC
"nuf-dummy-rrncnn-8-1-ISO8859-5",
#endif
#ifdef _MGCHARSET_ARABIC
"nuf-dummy-rrncnn-8-1-ISO8859-6",
#endif
#ifdef _MGCHARSET_GREEK
"nuf-dummy-rrncnn-8-1-ISO8859-7",
#endif
#ifdef _MGCHARSET_HEBREW
"nuf-dummy-rrncnn-8-1-ISO8859-8",
#endif
#ifdef _MGCHARSET_LATIN5
"nuf-dummy-rrncnn-8-1-ISO8859-9",
#endif
#ifdef _MGCHARSET_LATIN6
"nuf-dummy-rrncnn-8-1-ISO8859-10",
#endif
#ifdef _MGCHARSET_THAI
"nuf-dummy-rrncnn-8-1-ISO8859-11",
#endif
#ifdef _MGCHARSET_LATIN7
"nuf-dummy-rrncnn-8-1-ISO8859-13",
#endif
#ifdef _MGCHARSET_LATIN8
"nuf-dummy-rrncnn-8-1-ISO8859-14",
#endif
#ifdef _MGCHARSET_LATIN9
"nuf-dummy-rrncnn-8-1-ISO8859-15",
#endif
#ifdef _MGCHARSET_LATIN10
"nuf-dummy-rrncnn-8-1-ISO8859-16",
#endif
#ifdef _MGCHARSET_GB
"nuf-dummy-rrncnn-8-1-GB2312-0",
#endif
#ifdef _MGCHARSET_GBK
"nuf-dummy-rrncnn-8-1-GBK",
#endif
#ifdef _MGCHARSET_BIG5
"nuf-dummy-rrncnn-8-1-BIG5",
#endif
#ifdef _MGCHARSET_GB18030
"nuf-dummy-rrncnn-8-1-GB18030-0",
#endif
#ifdef _MGCHARSET_EUCKR
"nuf-dummy-rrncnn-8-1-EUC-KR",
#endif
#ifdef _MGCHARSET_EUCJP
"nuf-dummy-rrncnn-8-1-JISX0201-0",
"nuf-dummy-rrncnn-8-1-JISX0208-0",
#endif
#ifdef _MGCHARSET_SHIFTJIS
"nuf-dummy-rrncnn-8-1-JISX0201-1",
"nuf-dummy-rrncnn-8-1-JISX0208-1",
#endif
#ifdef _MGCHARSET_UNICODE
"nuf-dummy-rrncnn-8-1-UTF-8",
"nuf-dummy-rrncnn-8-1-UTF-16LE",
"nuf-dummy-rrncnn-8-1-UTF-16BE",
#endif
};
#define NR_NULL_FONTS TABLESIZE(_null_font_names)
#ifdef _MGFONT_RBF
#include "rawbitmap.h"
@@ -721,10 +796,17 @@ BOOL font_InitIncoreFonts (void)
{
int i;
for (i = 0; i < NR_NULL_FONTS; i++) {
if (!add_dev_font (_null_font_names[i], _null_font_names[i], FALSE)) {
_WRN_PRINTF ("can not init incore font: %s", _null_font_names[i]);
return FALSE;
}
}
#ifdef _MGFONT_RBF
for (i = 0; i < NR_RBFONTS; i++) {
if (!add_dev_font (incore_rbfonts [i]->name, incore_rbfonts [i]->data, FALSE)) {
_MG_PRINTF ("FONT>DevFont: can not init incore font: %s\n", incore_rbfonts [i]->name);
_WRN_PRINTF ("can not init incore font: %s", incore_rbfonts [i]->name);
return FALSE;
}
}
@@ -733,7 +815,7 @@ BOOL font_InitIncoreFonts (void)
#ifdef _MGFONT_VBF
for (i = 0; i < NR_VBFONTS && incore_vbfonts[i]; i++) {
if (!add_dev_font (incore_vbfonts [i]->name, incore_vbfonts [i], FALSE)) {
_MG_PRINTF ("FONT>DevFont: can not init incore font: %s\n", incore_vbfonts [i]->name);
_WRN_PRINTF ("can not init incore font: %s", incore_vbfonts [i]->name);
return FALSE;
}
}
@@ -743,7 +825,7 @@ BOOL font_InitIncoreFonts (void)
for (i = 0; i < NR_UPFONTS && incore_upfonts[i]; i++) {
const char* name = ((UPFV1_FILE_HEADER*)(incore_upfonts [i]->root_dir))->font_name;
if (!add_dev_font (name, incore_upfonts [i], FALSE)) {
_MG_PRINTF ("FONT>DevFont: can not init incore font: %s\n", name);
_WRN_PRINTF ("can not init incore font: %s", name);
return FALSE;
}
}
@@ -751,7 +833,7 @@ BOOL font_InitIncoreFonts (void)
#ifdef _MGFONT_SEF
if(!initialize_scripteasy()) {
_MG_PRINTF (stderr, "GDI: Can not initialize ScriptEasy fonts!\n");
_WRN_PRINTF ("Can not initialize ScriptEasy fonts!");
return FALSE;
}
#endif
@@ -885,10 +967,22 @@ static void font_DelDevFont (const char* font_name)
del_devfont_from_list(font_name, FALSE);
}
DEVFONT* GUIAPI LoadDevFontFromFile
(const char *devfont_name, const char *file_name)
DEVFONT* GUIAPI LoadDevFontFromIncoreData(const char *devfont_name,
const void *data)
{
DEVFONT* devfont = make_devfont (devfont_name, (char*)file_name, TRUE);
DEVFONT* devfont = make_devfont (devfont_name, data, FALSE);
if (devfont == NULL)
return NULL;
ADD_DEVFONT_TO_LINKLIST (devfont);
add_relating_devfonts_to_list (devfont);
return devfont;
}
DEVFONT* GUIAPI LoadDevFontFromFile(const char *devfont_name,
const char *file_name)
{
DEVFONT* devfont = make_devfont (devfont_name, file_name, TRUE);
if (devfont == NULL)
return NULL;
@@ -899,7 +993,12 @@ DEVFONT* GUIAPI LoadDevFontFromFile
void GUIAPI DestroyDynamicDevFont (DEVFONT** devfont)
{
font_DelDevFont ((*devfont)->name);
char font_name [LEN_UNIDEVFONT_NAME + 1];
memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
font_DelDevFont (font_name);
*devfont = NULL;
}
@@ -920,7 +1019,7 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
/*get font number in minigui etc*/
if (GetMgEtcIntValue (etc_section, "font_number", &font_num) < 0 ) {
_MG_PRINTF ("FONT>DevFont: can't find font_number in section %s.\n",
_WRN_PRINTF ("can't find font_number in section %s",
etc_section);
return FALSE;
}
@@ -929,14 +1028,14 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
for (i=0; i<font_num; i++) {
snprintf (key, sizeof(key)-1, "name%d", i);
if (GetMgEtcValue (etc_section, key, font_name, LEN_UNIDEVFONT_NAME) < 0) {
_MG_PRINTF ("FONT>DevFont: can't get name of key %s in section %s.\n",
_WRN_PRINTF ("can't get name of key %s in section %s",
key, etc_section);
continue;
}
snprintf (key, sizeof(key)-1, "fontfile%d", i);
if (GetMgEtcValue (etc_section, key, font_file_name, MAX_PATH) < 0) {
_MG_PRINTF ("FONT>DevFont: can't get font_file of key %s in section %s.\n",
_WRN_PRINTF ("can't get font_file of key %s in section %s",
key, etc_section);
continue;
}
+284
View File
@@ -0,0 +1,284 @@
#line 1 "emoji_presentation_scanner.rl"
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#line 9 "emoji_presentation_scanner.c"
static const char _emoji_presentation_actions[] = {
0, 1, 0, 1, 1, 1, 5, 1,
6, 1, 7, 1, 8, 1, 9, 1,
10, 1, 11, 2, 2, 3, 2, 2,
4
};
static const char _emoji_presentation_key_offsets[] = {
0, 5, 7, 14, 18, 20, 21, 24,
29, 30, 34, 36
};
static const unsigned char _emoji_presentation_trans_keys[] = {
3u, 7u, 13u, 0u, 2u, 14u, 15u, 2u,
3u, 6u, 7u, 13u, 0u, 1u, 9u, 10u,
11u, 12u, 10u, 12u, 10u, 4u, 10u, 12u,
4u, 9u, 10u, 11u, 12u, 6u, 9u, 10u,
11u, 12u, 8u, 10u, 9u, 10u, 11u, 12u,
14u, 0
};
static const char _emoji_presentation_single_lengths[] = {
3, 2, 5, 4, 2, 1, 3, 5,
1, 4, 2, 5
};
static const char _emoji_presentation_range_lengths[] = {
1, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0
};
static const char _emoji_presentation_index_offsets[] = {
0, 5, 8, 15, 20, 23, 25, 29,
35, 37, 42, 45
};
static const char _emoji_presentation_indicies[] = {
2, 1, 1, 1, 0, 4, 5, 3,
7, 8, 10, 11, 12, 6, 9, 5,
13, 14, 15, 0, 13, 15, 16, 13,
16, 15, 13, 15, 16, 15, 5, 13,
14, 15, 16, 5, 17, 5, 13, 14,
18, 17, 5, 13, 16, 5, 13, 14,
15, 4, 16, 0
};
static const char _emoji_presentation_trans_targs[] = {
2, 4, 6, 2, 1, 2, 3, 3,
7, 2, 8, 9, 11, 0, 2, 5,
2, 2, 10
};
static const char _emoji_presentation_trans_actions[] = {
17, 19, 19, 15, 0, 7, 22, 19,
19, 9, 0, 22, 19, 0, 5, 19,
11, 13, 19
};
static const char _emoji_presentation_to_state_actions[] = {
0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0
};
static const char _emoji_presentation_from_state_actions[] = {
0, 0, 3, 0, 0, 0, 0, 0,
0, 0, 0, 0
};
static const char _emoji_presentation_eof_trans[] = {
1, 4, 0, 1, 17, 17, 17, 17,
18, 18, 17, 17
};
static const int emoji_presentation_start = 2;
static const int emoji_presentation_en_text_and_emoji_run = 2;
#line 9 "emoji_presentation_scanner.rl"
#line 78 "emoji_presentation_scanner.rl"
static emoji_text_iter_t
scan_emoji_presentation (emoji_text_iter_t p,
const emoji_text_iter_t pe,
bool* is_emoji)
{
emoji_text_iter_t ts, te;
const emoji_text_iter_t eof = pe;
unsigned act;
int cs;
#line 107 "emoji_presentation_scanner.c"
{
cs = emoji_presentation_start;
ts = 0;
te = 0;
act = 0;
}
#line 115 "emoji_presentation_scanner.c"
{
int _klen;
unsigned int _trans;
const char *_acts;
unsigned int _nacts;
const unsigned char *_keys;
if ( p == pe )
goto _test_eof;
_resume:
_acts = _emoji_presentation_actions + _emoji_presentation_from_state_actions[cs];
_nacts = (unsigned int) *_acts++;
while ( _nacts-- > 0 ) {
switch ( *_acts++ ) {
case 1:
#line 1 "NONE"
{ts = p;}
break;
#line 134 "emoji_presentation_scanner.c"
}
}
_keys = _emoji_presentation_trans_keys + _emoji_presentation_key_offsets[cs];
_trans = _emoji_presentation_index_offsets[cs];
_klen = _emoji_presentation_single_lengths[cs];
if ( _klen > 0 ) {
const unsigned char *_lower = _keys;
const unsigned char *_mid;
const unsigned char *_upper = _keys + _klen - 1;
while (1) {
if ( _upper < _lower )
break;
_mid = _lower + ((_upper-_lower) >> 1);
if ( (*p) < *_mid )
_upper = _mid - 1;
else if ( (*p) > *_mid )
_lower = _mid + 1;
else {
_trans += (unsigned int)(_mid - _keys);
goto _match;
}
}
_keys += _klen;
_trans += _klen;
}
_klen = _emoji_presentation_range_lengths[cs];
if ( _klen > 0 ) {
const unsigned char *_lower = _keys;
const unsigned char *_mid;
const unsigned char *_upper = _keys + (_klen<<1) - 2;
while (1) {
if ( _upper < _lower )
break;
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
if ( (*p) < _mid[0] )
_upper = _mid - 2;
else if ( (*p) > _mid[1] )
_lower = _mid + 2;
else {
_trans += (unsigned int)((_mid - _keys)>>1);
goto _match;
}
}
_trans += _klen;
}
_match:
_trans = _emoji_presentation_indicies[_trans];
_eof_trans:
cs = _emoji_presentation_trans_targs[_trans];
if ( _emoji_presentation_trans_actions[_trans] == 0 )
goto _again;
_acts = _emoji_presentation_actions + _emoji_presentation_trans_actions[_trans];
_nacts = (unsigned int) *_acts++;
while ( _nacts-- > 0 )
{
switch ( *_acts++ )
{
case 2:
#line 1 "NONE"
{te = p+1;}
break;
case 3:
#line 74 "emoji_presentation_scanner.rl"
{act = 2;}
break;
case 4:
#line 75 "emoji_presentation_scanner.rl"
{act = 3;}
break;
case 5:
#line 73 "emoji_presentation_scanner.rl"
{te = p+1;{ *is_emoji = false; return te; }}
break;
case 6:
#line 74 "emoji_presentation_scanner.rl"
{te = p+1;{ *is_emoji = true; return te; }}
break;
case 7:
#line 75 "emoji_presentation_scanner.rl"
{te = p+1;{ *is_emoji = false; return te; }}
break;
case 8:
#line 74 "emoji_presentation_scanner.rl"
{te = p;p--;{ *is_emoji = true; return te; }}
break;
case 9:
#line 75 "emoji_presentation_scanner.rl"
{te = p;p--;{ *is_emoji = false; return te; }}
break;
case 10:
#line 74 "emoji_presentation_scanner.rl"
{{p = ((te))-1;}{ *is_emoji = true; return te; }}
break;
case 11:
#line 1 "NONE"
{ switch( act ) {
case 2:
{{p = ((te))-1;} *is_emoji = true; return te; }
break;
case 3:
{{p = ((te))-1;} *is_emoji = false; return te; }
break;
}
}
break;
#line 248 "emoji_presentation_scanner.c"
}
}
_again:
_acts = _emoji_presentation_actions + _emoji_presentation_to_state_actions[cs];
_nacts = (unsigned int) *_acts++;
while ( _nacts-- > 0 ) {
switch ( *_acts++ ) {
case 0:
#line 1 "NONE"
{ts = 0;}
break;
#line 261 "emoji_presentation_scanner.c"
}
}
if ( ++p != pe )
goto _resume;
_test_eof: {}
if ( p == eof )
{
if ( _emoji_presentation_eof_trans[cs] > 0 ) {
_trans = _emoji_presentation_eof_trans[cs] - 1;
goto _eof_trans;
}
}
}
#line 94 "emoji_presentation_scanner.rl"
/* Should not be reached. */
ts = ts + 0; // suppress compilation warning.
*is_emoji = false;
return pe;
}
+4
View File
@@ -31,6 +31,7 @@
* For more information about the commercial license, please refer to
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
#include "common.h"
#include "minigui.h"
#include "gdi.h"
@@ -40,6 +41,8 @@ typedef struct {
FONTOPS* ops;
}FONTOPS_INFO;
extern FONTOPS __mg_null_font_ops;
#ifdef _MGFONT_RBF
extern FONTOPS __mg_rbf_ops;
#endif
@@ -61,6 +64,7 @@ extern FONTOPS __mg_ttf_ops;
#endif
FONTOPS_INFO __mg_fontops_infos[] = {
{FONT_TYPE_NAME_BITMAP_NUF, &__mg_null_font_ops},
#ifdef _MGFONT_RBF
{FONT_TYPE_NAME_BITMAP_RAW, &__mg_rbf_ops},
#endif
+7 -18
View File
@@ -43,20 +43,11 @@
#include "common.h"
#ifdef _MGFONT_TTF_CACHE
#if defined(_MGFONT_FT2) && defined(_MGFONT_TTF_CACHE)
#include "minigui.h"
#include "gdi.h"
#ifdef _MGFONT_TTF
#include <freetype/freetype.h>
#include <freetype/ftxkern.h>
#include <freetype/ftnameid.h>
#include <freetype/ftxcmap.h>
#include <freetype/ftxwidth.h>
#include "freetype.h"
#else
#include "freetype2.h"
#endif
typedef struct _MemBlk {
void *data;
@@ -378,7 +369,7 @@ AppendBlk(FontCache *cache, MemBlk *blk, int key)
*size : if found the data, how long is the data(return val)
reutrn = pointer to the data */
TTFCACHEINFO *
__mg_ttc_search(HCACHE hCache, Uchar32 unicode, int *size)
__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size)
{
int key;
CacheQueueNode *ca;
@@ -388,7 +379,7 @@ __mg_ttc_search(HCACHE hCache, Uchar32 unicode, int *size)
return NULL;
}
ca = (CacheQueueNode *)(hCache);
key = ca->cache.makeHashKeyFunc(unicode);
key = ca->cache.makeHashKeyFunc(gv);
if (key > (ca->cache.nDir - 1)) {
return NULL;
}
@@ -397,7 +388,7 @@ __mg_ttc_search(HCACHE hCache, Uchar32 unicode, int *size)
for ( ; blk != &(ca->cache.hashDir[key].hashHead);
blk = blk->hashNext) {
TTFCACHEINFO* tci = (TTFCACHEINFO*)blk->data;
if (tci->unicode == unicode) {
if (tci->glyph_code == gv) {
/* If found the blk, we should pick off it
and link it at the end of LRU-q */
*size = blk->len;
@@ -433,7 +424,7 @@ __mg_ttc_write(HCACHE hCache, TTFCACHEINFO *data, int size)
if (ca->cache.blkSize < size) {
return -1;
}
key = ca->cache.makeHashKeyFunc(data->unicode);
key = ca->cache.makeHashKeyFunc(data->glyph_code);
/* pick off a block from lru queue */
if ((blk = PickOffBlk(&ca->cache)) == NULL) {
@@ -695,7 +686,6 @@ void
__mg_ttc_dump_cacheinfo(TTFCACHEINFO *ca)
{
DP(("Dump TTFCACHEINFO %p...\n", ca));
DP(("cacheInfo->unicode = %d\n", ca->unicode));
DP(("cacheInfo->glyph_code = %d\n", ca->glyph_code));
DP(("cacheInfo->cur_xmin = %d, cacheInfo->cur_ymin = %d\n",
@@ -714,7 +704,6 @@ void
__mg_ttc_dump_instance(TTFINSTANCEINFO *in)
{
DP(("Dump TTFINSTANCEINFO %p...\n", in));
DP(("Instance->cur_unicode = %d\n", in->cur_unicode));
DP(("Instance->cur_glyph_code = %d\n", in->cur_glyph_code));
DP(("Instance->outline(addr) = %p\n", &in->cur_outline));
DP(("Instance->cur_xmin = %d, Instance->cur_ymin = %d\n",
@@ -731,5 +720,5 @@ __mg_ttc_dump_instance(TTFINSTANCEINFO *in)
#endif /* 0 */
#endif /* _MGFONT_TTF_CACHE */
#endif /* defined(_MGFONT_FT2) && defined(_MGFONT_TTF_CACHE) */
+50 -4
View File
@@ -44,8 +44,6 @@
#include <string.h>
#include <ctype.h>
#define DEBUG
#include "common.h"
#include "minigui.h"
#include "gdi.h"
@@ -117,7 +115,7 @@ BOOL fontGetFamilyFromName (const char* name, char* family)
if (*(++family_part) == '\0')
return FALSE;
while (family_part [i] && i <= LEN_LOGFONT_FAMILY_FILED) {
while (family_part [i] && i <= LEN_LOGFONT_FAMILY_FIELD) {
if (family_part [i] == '-'/* || family_part [i] == ',' */) {
family [i] = '\0';
break;
@@ -185,7 +183,7 @@ static const char *my_strstr(const char *haystack, const char *needle)
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_part[LEN_LOGFONT_FAMILY_FIELD + 3];
char family_request[LEN_LOGFONT_NAME_FIELD + 3];
int i;
size_t len;
@@ -474,6 +472,54 @@ int fontGetWidthFromName (const char* name)
return atoi (width);
}
/* Since 3.4.0; only for LOGFONT name */
char fontGetOrientFromName (const char* name)
{
int i;
const char* orient_part = name;
char orient [LEN_LOGFONT_NAME_FIELD + 1];
for (i = 0; i < NR_LOOP_FOR_ORIENT; i++) {
if ((orient_part = strchr (orient_part, '-')) == NULL)
return FONT_ORIENT_UPRIGHT;
if (*(++orient_part) == '\0')
return FONT_ORIENT_UPRIGHT;
}
i = 0;
while (orient_part [i]) {
if (orient_part [i] == '-') {
orient [i] = '\0';
break;
}
orient [i] = orient_part [i];
i++;
}
if (orient_part [i] == '\0')
return FONT_ORIENT_UPRIGHT;
return orient[0];
}
int fontGetOrientPosFromName (const char* name)
{
int i;
const char* orient_part = name;
for (i = 0; i < NR_LOOP_FOR_ORIENT; i++) {
if ((orient_part = strchr (orient_part, '-')) == NULL)
return -1;
if (*(++orient_part) == '\0')
return -1;
}
return orient_part - name;
}
int fontGetHeightFromName (const char* name)
{
int i;
+4 -4
View File
@@ -76,7 +76,7 @@ static void* load_font_data (DEVFONT* devfont, const char* font_name, const char
/* Load face */
if (TT_Open_Face (ttf_engine, file_name, &ttf_glyph_info->face) != TT_Err_Ok) {
_MG_PRINTF ("FONT>FT1: TT_Open_Face error.\n");
_WRN_PRINTF ("FONT>FT1: TT_Open_Face error.\n");
goto error_after_create_info;
}
@@ -119,7 +119,7 @@ static void* load_font_data (DEVFONT* devfont, const char* font_name, const char
}
if (i == n) {
_MG_PRINTF ("FONT>FT1: no unicode map table\n");
_WRN_PRINTF ("FONT>FT1: no unicode map table\n");
goto error_after_create_face;
}
@@ -129,7 +129,7 @@ static void* load_font_data (DEVFONT* devfont, const char* font_name, const char
= (properties.num_Glyphs > 255) ? 255 : properties.num_Glyphs - 1;
if (TT_New_Glyph (ttf_glyph_info->face, &ttf_glyph_info->glyph) != TT_Err_Ok) {
_MG_PRINTF ("FONT>FT1: TT_New_Glyph error.\n");
_WRN_PRINTF ("FONT>FT1: TT_New_Glyph error.\n");
goto error_after_create_face;
}
ttf_inst_info->ttf_glyph_info = ttf_glyph_info;
@@ -820,7 +820,7 @@ BOOL font_InitFreetypeLibrary (void)
#ifdef _MGFONT_TTF_CACHE
if (__mg_ttc_sys_init(_MGMAX_TTF_CACHE, _MGTTF_CACHE_SIZE * 1024)) {
_MG_PRINTF ("FONT>FT1: init ttf cache sys failed\n");
_WRN_PRINTF ("FONT>FT1: init ttf cache sys failed\n");
goto error_library;
}
#endif
+235 -196
View File
File diff suppressed because it is too large Load Diff
+23 -15
View File
@@ -40,8 +40,6 @@
#ifndef GUI_FREETYP2_H
#define GUI_FREETYP2_H
#undef TTF_DBG
#ifndef TTF_DBG
#define DP(x)
#else
@@ -72,7 +70,7 @@ extern "C" {
#ifdef _MGFONT_TTF_CACHE
typedef void* HCACHE;
typedef int (* MakeHashKeyFunc)(Uchar32 unicode);
typedef int (* MakeHashKeyFunc)(Glyph32 gv);
#endif
typedef struct tagFTFACEINFO {
@@ -80,9 +78,8 @@ typedef struct tagFTFACEINFO {
char* filepathname;
int face_index;
int cmap_index;
#else
FT_Face face;
#endif
FT_Face face;
BOOL valid;
} FTFACEINFO, *PFTFACEINFO;
@@ -92,9 +89,8 @@ typedef struct tagFTINSTANCEINFO {
FTC_ImageTypeRec image_type;
FT_Int glyph_done;
HCACHE cache;
#else
FT_Size size;
#endif
FT_Size size;
FT_Matrix matrix;
FT_Glyph glyph;
int rotation;
@@ -108,11 +104,12 @@ typedef struct tagFTINSTANCEINFO {
int ascent;
int descent;
FT_Bool use_kerning; /*FT_HAS_KERNING(face)*/
FT_Vector delta;
int is_index_old;
FT_Bool use_kerning;
FT_UInt cur_index;
#if 0
int is_index_old;
FT_UInt prev_index;
#endif
FT_LcdFilter ft_lcdfilter;
} FTINSTANCEINFO, *PFTINSTANCEINFO;
@@ -121,13 +118,20 @@ typedef struct tagFTINSTANCEINFO {
#define _TTF_HASH_NDIR 37
#define CACHE_VALID_ADVANCE 0x01
#define CACHE_VALID_BBOX 0x02
#define CACHE_VALID_BITMAP 0x04
typedef struct tagTTFCACHEINFO {
Uchar32 unicode;
FT_UInt glyph_code;
Uint32 valid_advance:1;
Uint32 valid_bbox:1;
Uint32 valid_bitmap:1;
Uint32 reserved_flags:28;
FT_Vector advance;
FT_BBox bbox;
FT_Vector delta;
int flag;
int pitch;
int width;
int height;
@@ -144,10 +148,14 @@ 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,
Uchar32 unicode, int *size);
extern TTFCACHEINFO *__mg_ttc_search(HCACHE hCache, Glyph32 gv, int *size);
extern void __mg_ttc_refer(HCACHE hCache);
#ifdef _MGCOMPLEX_SCRIPTS
extern void __mg_init_harzbuff_funcs(void);
extern void __mg_term_harzbuff_funcs(void);
#endif
#endif
#ifdef __cplusplus
+157
View File
@@ -0,0 +1,157 @@
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Or,
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
/*
** harzbuff-minigui-funcs.c:
**
** Functions for using HarfBuzz with the MiniGUI to provide Unicode data.
**
** Create by WEI Yongming at 2019/03/14
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
#if defined(_MGCHARSET_UNICODE) && defined(_MGCOMPLEX_SCRIPTS)
#include "minigui.h"
#include "gdi.h"
#include <hb.h>
static hb_unicode_combining_class_t
hb_minigui_unicode_combining_class (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode,
void *user_data)
{
return (hb_unicode_combining_class_t) UCharCombiningClass (unicode);
}
static hb_unicode_general_category_t
hb_minigui_unicode_general_category (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode,
void *user_data)
{
/* hb_unicode_general_category_t and GUnicodeType are identical */
return (hb_unicode_general_category_t) UCharGetCategory (unicode);
}
static hb_codepoint_t
hb_minigui_unicode_mirroring (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode,
void *user_data)
{
UCharGetMirror (unicode, &unicode);
return unicode;
}
static hb_script_t
hb_minigui_unicode_script (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode,
void *user_data)
{
return ScriptTypeToISO15924 (UCharGetScriptType(unicode));
}
static hb_bool_t
hb_minigui_unicode_compose (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t a,
hb_codepoint_t b,
hb_codepoint_t *ab,
void *user_data)
{
return UCharCompose (a, b, ab);
}
static hb_bool_t
hb_minigui_unicode_decompose (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t ab,
hb_codepoint_t *a,
hb_codepoint_t *b,
void *user_data)
{
return UCharDecompose(ab, a, b);
}
static hb_unicode_funcs_t *funcs;
static hb_unicode_funcs_t *get_unicode_funcs(void)
{
funcs = hb_unicode_funcs_create (NULL);
hb_unicode_funcs_set_combining_class_func (funcs,
hb_minigui_unicode_combining_class, NULL, NULL);
hb_unicode_funcs_set_general_category_func (funcs,
hb_minigui_unicode_general_category, NULL, NULL);
hb_unicode_funcs_set_mirroring_func (funcs,
hb_minigui_unicode_mirroring, NULL, NULL);
hb_unicode_funcs_set_script_func (funcs,
hb_minigui_unicode_script, NULL, NULL);
hb_unicode_funcs_set_compose_func (funcs,
hb_minigui_unicode_compose, NULL, NULL);
hb_unicode_funcs_set_decompose_func (funcs,
hb_minigui_unicode_decompose, NULL, NULL);
hb_unicode_funcs_make_immutable (funcs);
return funcs;
}
typedef hb_unicode_funcs_t *(*hb_get_unicode_funcs) (void);
extern hb_get_unicode_funcs __hb_extern_get_unicode_funcs;
void __mg_init_harzbuff_funcs(void)
{
_DBG_PRINTF("%s: called\n", __FUNCTION__);
__hb_extern_get_unicode_funcs = get_unicode_funcs;
}
void __mg_term_harzbuff_funcs(void)
{
_DBG_PRINTF("%s: called\n", __FUNCTION__);
if (funcs) {
hb_unicode_funcs_destroy(funcs);
}
else {
_ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n",
__FUNCTION__);
}
}
#endif /* defined(_MGCHARSET_UNICODE) && defined(_MGCOMPLEX_SCRIPTS) */
+338 -2
View File
@@ -67,6 +67,7 @@ static const Uint16 iso639_1_codes[] =
PACK('c', 'y'), // Welch
PACK('d', 'a'), // Danish
PACK('d', 'e'), // German
PACK('d', 'v'), // Divehi
PACK('d', 'z'), // Bhutani
PACK('e', 'l'), // Greek
PACK('e', 'n'), // English
@@ -190,7 +191,7 @@ static const Uint16 iso639_1_codes[] =
#undef PACK
};
int GUIAPI LanguageCodeFromISO639s1 (Uint16 iso639_1)
LanguageCode GUIAPI LanguageCodeFromISO639s1 (Uint16 iso639_1)
{
unsigned int lower = 0;
unsigned int upper = TABLESIZE (iso639_1_codes) - 1;
@@ -205,7 +206,7 @@ int GUIAPI LanguageCodeFromISO639s1 (Uint16 iso639_1)
else if (iso639_1 > iso639_1_codes[mid])
lower = mid + 1;
else
return (int)mid;
return (LanguageCode)mid;
mid = (lower + upper) / 2;
} while (lower <= upper);
@@ -213,5 +214,340 @@ int GUIAPI LanguageCodeFromISO639s1 (Uint16 iso639_1)
return LANGCODE_unknown;
}
static const char* iso639_1_codes_str[] =
{
"aa", // Afar
"ab", // Abkhazian
"af", // Afrikaans
"am", // Amharic
"ar", // Arabic
"as", // Assamese
"ay", // Aymara
"az", // Azerbaijani
"ba", // Bashkir
"be", // Byelorussian
"bg", // Bulgarian
"bh", // Bihari
"bi", // Bislama
"bn", // Bengali
"bo", // Tibetan
"br", // Breton
"ca", // Catalan
"co", // Corsican
"cs", // Czech
"cy", // Welch
"da", // Danish
"de", // German
"dv", // Divehi
"dz", // Bhutani
"el", // Greek
"en", // English
"eo", // Esperanto
"es", // Spanish
"et", // Estonian
"eu", // Basque
"fa", // Persian
"fi", // Finnish
"fj", // Fiji
"fo", // Faeroese
"fr", // French
"fy", // Frisian
"ga", // Irish
"gd", // Scots Gaelic
"gl", // Galician
"gn", // Guarani
"gu", // Gujarati
"ha", // Hausa
"hi", // Hindi
"he", // Hebrew
"hr", // Croatian
"hu", // Hungarian
"hy", // Armenian
"ia", // Interlingua
"id", // Indonesian
"ie", // Interlingue
"ik", // Inupiak
"in", // former Indonesian
"is", // Icelandic
"it", // Italian
"iu", // Inuktitut (Eskimo)
"iw", // former Hebrew
"ja", // Japanese
"ji", // former Yiddish
"jw", // Javanese
"ka", // Georgian
"kk", // Kazakh
"kl", // Greenlandic
"km", // Cambodian
"kn", // Kannada
"ko", // Korean
"ks", // Kashmiri
"ku", // Kurdish
"ky", // Kirghiz
"la", // Latin
"ln", // Lingala
"lo", // Laothian
"lt", // Lithuanian
"lv", // Latvian, Lettish
"mg", // Malagasy
"mi", // Maori
"mk", // Macedonian
"ml", // Malayalam
"mn", // Mongolian
"mo", // Moldavian
"mr", // Marathi
"ms", // Malay
"mt", // Maltese
"my", // Burmese
"na", // Nauru
"ne", // Nepali
"nl", // Dutch
"no", // Norwegian
"oc", // Occitan
"om", // (Afan) Oromo
"or", // Oriya
"pa", // Punjabi
"pl", // Polish
"ps", // Pashto, Pushto
"pt", // Portuguese
"qu", // Quechua
"rm", // Rhaeto-Romance
"rn", // Kirundi
"ro", // Romanian
"ru", // Russian
"rw", // Kinyarwanda
"sa", // Sanskrit
"sd", // Sindhi
"sg", // Sangro
"sh", // Serbo-Croatian
"si", // Singhalese
"sk", // Slovak
"sl", // Slovenian
"sm", // Samoan
"sn", // Shona
"so", // Somali
"sq", // Albanian
"sr", // Serbian
"ss", // Siswati
"st", // Sesotho
"su", // Sudanese
"sv", // Swedish
"sw", // Swahili
"ta", // Tamil
"te", // Tegulu
"tg", // Tajik
"th", // Thai
"ti", // Tigrinya
"tk", // Turkmen
"tl", // Tagalog
"tn", // Setswana
"to", // Tonga
"tr", // Turkish
"ts", // Tsonga
"tt", // Tatar
"tw", // Twi
"ug", // Uigur
"uk", // Ukrainian
"ur", // Urdu
"uz", // Uzbek
"vi", // Vietnamese
"vo", // Volapuk
"wo", // Wolof
"xh", // Xhosa
"yi", // Yiddish
"yo", // Yoruba
"za", // Zhuang
"zh", // Chinese
"zu", // Zulu
};
const char* GUIAPI LanguageCodeToISO639s1 (LanguageCode lc)
{
switch (lc) {
case LANGCODE_unknown:
return "";
default:
return iso639_1_codes_str[lc];
}
return "";
}
static const LanguageCode sample_language_of_script[] = {
LANGCODE_unknown, /* SCRIPT_COMMON */
LANGCODE_unknown, /* SCRIPT_INHERITED */
LANGCODE_ar, /* SCRIPT_ARABIC */
LANGCODE_hy, /* SCRIPT_ARMENIAN */
LANGCODE_bn, /* SCRIPT_BENGALI */
LANGCODE_zh, /* SCRIPT_BOPOMOFO: Used primarily in Taiwan, but not part of the standard zh-tw orthography */
LANGCODE_unknown, /* SCRIPT_CHEROKEE; no ISO639-1 code; ISO639-2 code: chr */
LANGCODE_unknown, /* SCRIPT_COPTIC; no ISO639-1 code; ISO639-2 code: cop */
LANGCODE_ru, /* SCRIPT_CYRILLIC */
LANGCODE_unknown, /* SCRIPT_DESERET: Deseret was used to write English */
LANGCODE_hi, /* SCRIPT_DEVANAGARI */
LANGCODE_am, /* SCRIPT_ETHIOPIC */
LANGCODE_ka, /* SCRIPT_GEORGIAN */
LANGCODE_unknown, /* SCRIPT_GOTHIC */
LANGCODE_el, /* SCRIPT_GREEK */
LANGCODE_gu, /* SCRIPT_GUJARATI */
LANGCODE_pa, /* SCRIPT_GURMUKHI */
LANGCODE_unknown, /* SCRIPT_HAN */
LANGCODE_ko, /* SCRIPT_HANGUL */
LANGCODE_he, /* SCRIPT_HEBREW */
LANGCODE_ja, /* SCRIPT_HIRAGANA */
LANGCODE_kn, /* SCRIPT_KANNADA */
LANGCODE_ja, /* SCRIPT_KATAKANA */
LANGCODE_km, /* SCRIPT_KHMER */
LANGCODE_lo, /* SCRIPT_LAO */
LANGCODE_en, /* SCRIPT_LATIN */
LANGCODE_ml, /* SCRIPT_MALAYALAM */
LANGCODE_mn, /* SCRIPT_MONGOLIAN */
LANGCODE_my, /* SCRIPT_MYANMAR */
LANGCODE_unknown, /* SCRIPT_OGHAM; Ogham was used to write old Irish */
LANGCODE_unknown, /* SCRIPT_OLD_ITALIC */
LANGCODE_or, /* SCRIPT_ORIYA */
LANGCODE_unknown, /* SCRIPT_RUNIC */
LANGCODE_si, /* SCRIPT_SINHALA */
LANGCODE_unknown, /* SCRIPT_SYRIAC; no ISO639-1 code; ISO639-2 code: syr */
LANGCODE_ta, /* SCRIPT_TAMIL */
LANGCODE_te, /* SCRIPT_TELUGU */
LANGCODE_dv, /* SCRIPT_THAANA */
LANGCODE_th, /* SCRIPT_THAI */
LANGCODE_bo, /* SCRIPT_TIBETAN */
LANGCODE_iu, /* SCRIPT_CANADIAN_ABORIGINAL */
LANGCODE_unknown, /* SCRIPT_YI */
LANGCODE_tl, /* SCRIPT_TAGALOG */
/* Phillipino languages/scripts */
LANGCODE_unknown, /* SCRIPT_HANUNOO; no ISO639-1 code and ISO639-2 code; hnn? */
LANGCODE_unknown, /* SCRIPT_BUHID; no ISO639-1 code and ISO639-2 code; bku? */
LANGCODE_unknown, /* SCRIPT_TAGBANWA; no ISO639-1 code and ISO639-2 code; tbw? */
LANGCODE_unknown, /* SCRIPT_BRAILLE */
LANGCODE_unknown, /* SCRIPT_CYPRIOT */
LANGCODE_unknown, /* SCRIPT_LIMBU */
LANGCODE_unknown, /* SCRIPT_OSMANYA; Used for Somali (so) in the past */
LANGCODE_unknown, /* SCRIPT_SHAVIAN; The Shavian alphabet was designed for English */
LANGCODE_unknown, /* SCRIPT_LINEAR_B */
LANGCODE_unknown, /* SCRIPT_TAI_LE */
LANGCODE_unknown, /* SCRIPT_UGARITIC; no ISO639-1 code; ISO639-2 code: uga */
LANGCODE_unknown, /* SCRIPT_NEW_TAI_LUE */
LANGCODE_unknown, /* SCRIPT_BUGINESE; no ISO639-1 code; ISO639-2 code: bug */
LANGCODE_unknown, /* SCRIPT_GLAGOLITIC: The original script for Old Church Slavonic (chu), later written with Cyrillic */
LANGCODE_unknown, /* SCRIPT_TIFINAGH: Used for for Berber (ber), but Arabic script is more common */
LANGCODE_unknown, /* SCRIPT_SYLOTI_NAGRI; no ISO639-1 code and ISO639-2 code; syl? */
LANGCODE_unknown, /* SCRIPT_OLD_PERSIAN; no ISO639-1 code; ISO639-2 code: peo */
LANGCODE_unknown, /* SCRIPT_KHAROSHTHI */
LANGCODE_unknown, /* SCRIPT_UNKNOWN */
LANGCODE_unknown, /* SCRIPT_BALINESE */
LANGCODE_unknown, /* SCRIPT_CUNEIFORM */
LANGCODE_unknown, /* SCRIPT_PHOENICIAN */
LANGCODE_unknown, /* SCRIPT_PHAGS_PA */
LANGCODE_unknown, /* SCRIPT_NKO; no ISO639-1 code; ISO639-2 code: nqo */
/* Unicode-5.1 additions */
LANGCODE_unknown, /* SCRIPT_KAYAH_LI */
LANGCODE_unknown, /* SCRIPT_LEPCHA */
LANGCODE_unknown, /* SCRIPT_REJANG */
LANGCODE_unknown, /* SCRIPT_SUNDANESE */
LANGCODE_unknown, /* SCRIPT_SAURASHTRA */
LANGCODE_unknown, /* SCRIPT_CHAM */
LANGCODE_unknown, /* SCRIPT_OL_CHIKI */
LANGCODE_unknown, /* SCRIPT_VAI */
LANGCODE_unknown, /* SCRIPT_CARIAN */
LANGCODE_unknown, /* SCRIPT_LYCIAN */
LANGCODE_unknown, /* SCRIPT_LYDIAN */
/* Unicode-6.0 additions */
LANGCODE_unknown, /* SCRIPT_BATAK */
LANGCODE_unknown, /* SCRIPT_BRAHMI */
LANGCODE_unknown, /* SCRIPT_MANDAIC */
/* Unicode-6.1 additions */
LANGCODE_unknown, /* SCRIPT_CHAKMA */
LANGCODE_unknown, /* SCRIPT_MEROITIC_CURSIVE */
LANGCODE_unknown, /* SCRIPT_MEROITIC_HIEROGLYPHS */
LANGCODE_unknown, /* SCRIPT_MIAO */
LANGCODE_unknown, /* SCRIPT_SHARADA */
LANGCODE_unknown, /* SCRIPT_SORA_SOMPENG */
LANGCODE_unknown, /* SCRIPT_TAKRI */
/* Unicode 7.0 additions */
LANGCODE_unknown, /* SCRIPT_BASSA_VAH, Bass */
LANGCODE_unknown, /* SCRIPT_CAUCASIAN_ALBANIAN, Aghb */
LANGCODE_unknown, /* SCRIPT_DUPLOYAN, Dupl */
LANGCODE_unknown, /* SCRIPT_ELBASAN, Elba */
LANGCODE_unknown, /* SCRIPT_GRANTHA, Gran */
LANGCODE_unknown, /* SCRIPT_KHOJKI, Khoj */
LANGCODE_unknown, /* SCRIPT_KHUDAWADI, Sind */
LANGCODE_unknown, /* SCRIPT_LINEAR_A, Lina */
LANGCODE_unknown, /* SCRIPT_MAHAJANI, Mahj */
LANGCODE_unknown, /* SCRIPT_MANICHAEAN, Manu */
LANGCODE_unknown, /* SCRIPT_MENDE_KIKAKUI, Mend */
LANGCODE_unknown, /* SCRIPT_MODI, Modi */
LANGCODE_unknown, /* SCRIPT_MRO, Mroo */
LANGCODE_unknown, /* SCRIPT_NABATAEAN, Nbat */
LANGCODE_unknown, /* SCRIPT_OLD_NORTH_ARABIAN, Narb */
LANGCODE_unknown, /* SCRIPT_OLD_PERMIC, Perm */
LANGCODE_unknown, /* SCRIPT_PAHAWH_HMONG, Hmng */
LANGCODE_unknown, /* SCRIPT_PALMYRENE, Palm */
LANGCODE_unknown, /* SCRIPT_PAU_CIN_HAU, Pauc */
LANGCODE_unknown, /* SCRIPT_PSALTER_PAHLAVI, Phlp */
LANGCODE_unknown, /* SCRIPT_SIDDHAM, Sidd */
LANGCODE_unknown, /* SCRIPT_TIRHUTA, Tirh */
LANGCODE_unknown, /* SCRIPT_WARANG_CITI, Wara */
/* Unicode 8.0 additions */
LANGCODE_unknown, /* SCRIPT_AHOM, Ahom */
LANGCODE_unknown, /* SCRIPT_ANATOLIAN_HIEROGLYPHS, Hluw */
LANGCODE_unknown, /* SCRIPT_HATRAN, Hatr */
LANGCODE_unknown, /* SCRIPT_MULTANI, Mult */
LANGCODE_unknown, /* SCRIPT_OLD_HUNGARIAN, Hung */
LANGCODE_unknown, /* SCRIPT_SIGNWRITING, Sgnw */
/* Unicode 9.0 additions */
LANGCODE_unknown, /* SCRIPT_ADLAM, Adlm */
LANGCODE_unknown, /* SCRIPT_BHAIKSUKI, Bhks */
LANGCODE_unknown, /* SCRIPT_MARCHEN, Marc */
LANGCODE_unknown, /* SCRIPT_NEWA, Newa */
LANGCODE_unknown, /* SCRIPT_OSAGE, Osge */
LANGCODE_unknown, /* SCRIPT_TANGUT, Tang */
/* Unicode 10.0 additions */
LANGCODE_unknown, /* SCRIPT_MASARAM_GONDI, Gonm */
LANGCODE_unknown, /* SCRIPT_NUSHU, Nshu */
LANGCODE_unknown, /* SCRIPT_SOYOMBO, Soyo */
LANGCODE_unknown, /* SCRIPT_ZANABAZAR_SQUARE, Zanb */
/* Unicode 11.0 additions */
LANGCODE_unknown, /* SCRIPT_DOGRA, Dogr */
LANGCODE_unknown, /* SCRIPT_GUNJALA_GONDI, Gong */
LANGCODE_unknown, /* SCRIPT_HANIFI_ROHINGYA, Rohg */
LANGCODE_unknown, /* SCRIPT_MAKASAR, Maka */
LANGCODE_unknown, /* SCRIPT_MEDEFAIDRIN, Medf */
LANGCODE_unknown, /* SCRIPT_OLD_SOGDIAN, Sogo */
LANGCODE_unknown, /* SCRIPT_SOGDIAN, Sogd */
/* Unicode 12.0 additions */
LANGCODE_unknown, /* SCRIPT_ELYMAIC, Elymaic */
LANGCODE_unknown, /* SCRIPT_NANDINAGARI, Nandinagari */
LANGCODE_unknown, /* SCRIPT_NYIAKENG_PUACHUE_HMONG, Nyiakeng Puachue Hmong */
LANGCODE_unknown, /* SCRIPT_WANCHO, Wancho */
};
LanguageCode GetSampleLanguageForScript(ScriptType st)
{
switch (st) {
case SCRIPT_INVALID_CODE:
return LANGCODE_unknown;
default:
return sample_language_of_script[st];
}
return LANGCODE_unknown;
}
#endif /* _MGCHARSET_UNICODE */
+85
View File
@@ -0,0 +1,85 @@
/* == Start of generated table == */
/*
* The following table is generated by running:
*
* ./gen-ascii-bidi-tables.py
*
* on ucd/UnicodeData.txt files with these headers:
*
* UnicodeData.txt does not have a header.
*/
#ifndef _MGFONT_ISO8859_BIDI_TABLES_H
#define _MGFONT_ISO8859_BIDI_TABLES_H
static const BidiType __mg_iso8859_1_bidi_char_type_map[] =
{
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_SS, BIDI_TYPE_BS, BIDI_TYPE_SS,
BIDI_TYPE_WS, BIDI_TYPE_BS, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BS, BIDI_TYPE_BS, BIDI_TYPE_BS, BIDI_TYPE_SS,
BIDI_TYPE_WS, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ET,
BIDI_TYPE_ET, BIDI_TYPE_ET, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ES,
BIDI_TYPE_CS, BIDI_TYPE_ES, BIDI_TYPE_CS, BIDI_TYPE_CS,
BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_EN,
BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_EN,
BIDI_TYPE_EN, BIDI_TYPE_EN, BIDI_TYPE_CS, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BS, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_CS, BIDI_TYPE_ON, BIDI_TYPE_ET, BIDI_TYPE_ET,
BIDI_TYPE_ET, BIDI_TYPE_ET, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_BN, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_ET, BIDI_TYPE_ET, BIDI_TYPE_EN, BIDI_TYPE_EN,
BIDI_TYPE_ON, BIDI_TYPE_LTR, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_EN, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON, BIDI_TYPE_ON,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_ON,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR, BIDI_TYPE_LTR,
};
#endif /* !_MGFONT_ISO8859_BIDI_TABLES_H */
/* == End of generated table == */
@@ -47,6 +47,9 @@
#include "gdi.h"
#include "devfont.h"
#undef BIDI_DEBUG
#include "bidi.h"
#define BIDI_MAX(a,b) ((a) > (b) ? (a) : (b))
@@ -63,32 +66,72 @@ struct _TYPERUN
struct _TYPERUN *prev;
struct _TYPERUN *next;
Uint32 type; /* char type. */
int pos, len; /* run start position、run len.*/
BYTE level; /* Embedding level. */
int pos, len; /* run start position, run len.*/
Uint16 type; /* char type. */
Sint16 level; /* embedding level. */
};
#ifdef BIDI_DEBUG
static char bidi_type_name(Uint32 c)
static const char bidi_level[] = {
/* -1 == BIDI_TYPE_SENTINEL, indicating start or end of string. */
'$',
/* 0-61 == 0-9,a-z,A-Z are the the only valid levels before resolving
* implicits. after that the level @ may be appear too.
*/
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D',
'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z',
/* TBD - insert another 125-64 levels */
/* 62 == only must appear after resolving implicits. */
'@',
/* 63 == BIDI_LEVEL_INVALID, internal error, this level shouldn't be seen.*/
'!',
/* >= 64 == overflows, this levels and higher levels show a real bug!. */
'*', '*', '*', '*', '*'
};
static char bidi_type_name(Uint16 c)
{
switch (c){
case BIDI_TYPE_LTR: return 'L';
case BIDI_TYPE_RTL: return 'R';
case BIDI_TYPE_AL: return 'A';
case BIDI_TYPE_LRE: return '<';
case BIDI_TYPE_RLE: return '>';
case BIDI_TYPE_LRO: return '(';
case BIDI_TYPE_RLO: return ')';
case BIDI_TYPE_PDF: return 'P';
case BIDI_TYPE_EN: return '1';
case BIDI_TYPE_AN: return '9';
case BIDI_TYPE_ES: return 'w';
case BIDI_TYPE_ET: return 'w';
case BIDI_TYPE_CS: return 'w';
case BIDI_TYPE_ES: return 's';
case BIDI_TYPE_ET: return 't';
case BIDI_TYPE_CS: return 'c';
case BIDI_TYPE_NSM: return '`';
case BIDI_TYPE_BN: return 'b';
case BIDI_TYPE_BS: return 'B';
case BIDI_TYPE_SS: return 'S';
case BIDI_TYPE_WS: return '_';
case BIDI_TYPE_ON: return 'n';
case BIDI_TYPE_LRI: return '[';
case BIDI_TYPE_RLI: return ']';
case BIDI_TYPE_FSI: return '@';
case BIDI_TYPE_PDI: return '#';
case BIDI_TYPE_SOT: return '^';
case BIDI_TYPE_EOT: return '$';
}
return 'n';
fprintf(stderr, "Unknown bidi type: %02x\n", c);
return '*';
}
static void print_resolved_levels(TYPERUN *pp)
@@ -97,7 +140,7 @@ static void print_resolved_levels(TYPERUN *pp)
while(pp){
int i;
for(i = 0; i < LEN (pp); i++)
fprintf(stderr, "%c", bidi_level[(int)LEVEL(pp)]);
fprintf(stderr, "%c", bidi_level[(int)LEVEL(pp) + 1]);
pp = pp->next;
}
fprintf(stderr, "\n");
@@ -124,7 +167,7 @@ static void print_run_types(TYPERUN *pp)
if(pp->level == -1){
sprintf(level_str, "%s", "-1");
}
else sprintf(level_str, "%c", bidi_level[(int)pp->level]);
else sprintf(level_str, "%c(%d)", bidi_level[(int)pp->level + 1], (int)pp->level);
fprintf(stderr, "pos:%d:len:%d(%c)[level:%s] || ", pp->pos, pp->len,
bidi_type_name(pp->type), level_str);
@@ -146,10 +189,9 @@ static void print_hexstr(Achar32* str, int len, BOOL reorder_state)
DBGLOG(" ");
for(m = 0; m < len; m++){
if(m && !(m%16)) DBGLOG("\n ");
DBGLOG2("0x%02x ", (unsigned char)str[m]);
DBGLOG2("0x%04X ", REAL_ACHAR(str[m]));
}
DBGLOG("\n====================================================\n");
}
#else /* BIDI_DEBUG */
@@ -175,6 +217,7 @@ static void free_typerun_list (TYPERUN *type_rl_list)
free(p);
};
}
static TYPERUN* merge_with_prev(TYPERUN *second)
{
TYPERUN *first = second->prev;
@@ -254,7 +297,7 @@ static TYPERUN* get_runtype_link (const CHARSETOPS* charset_ops, Achar32* achars
static void bidi_resolveParagraphs(TYPERUN **ptype_rl_list, Uint32* pbase_dir, BYTE* pbase_level)
{
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
DBGLOG("\n1:Finding the base level\n");
DBGLOG("\n1.Finding the base level\n");
*pbase_dir = BIDI_TYPE_ON;
for (pp = type_rl_list; pp; pp = pp->next){
@@ -266,9 +309,9 @@ static void bidi_resolveParagraphs(TYPERUN **ptype_rl_list, Uint32* pbase_dir, B
}
*pbase_dir = BIDI_LEVEL_TO_DIR (*pbase_level);
DBGLOG2(" Base level: %c\n", bidi_level[(int)*pbase_level]);
DBGLOG2(" Base level: %c\n", bidi_level[(int)*pbase_level + 1]);
DBGLOG2(" Base dir: %c\n", bidi_type_name(*pbase_dir));
DBGLOG("Finding the base level, Done\n");
DBGLOG(" Finding the base level, Done\n");
}
/* 2.Resolving Explicit levels.
@@ -276,12 +319,18 @@ static void bidi_resolveParagraphs(TYPERUN **ptype_rl_list, Uint32* pbase_dir, B
static void bidi_resolveExplicit (TYPERUN **ptype_rl_list, Uint32 base_dir)
{
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
DBGLOG("\n2:Resolving weak types\n");
DBGLOG("\n2.Resolving explicit types\n");
for (pp = type_rl_list->next; pp->next; pp = pp->next)
{
LEVEL(pp) = BIDI_DIR_TO_LEVEL(base_dir);
}
#ifdef BIDI_DEBUG
print_run_types(type_rl_list);
print_resolved_levels(type_rl_list);
print_resolved_types(type_rl_list);
#endif
return;
}
@@ -292,7 +341,7 @@ static void bidi_resolveWeak(TYPERUN **ptype_rl_list, Uint32 base_dir)
Uint32 last_strong, prev_type_org;
BOOL w4;
DBGLOG("\n3:Resolving weak types\n");
DBGLOG("\n3.Resolving weak types\n");
last_strong = base_dir;
for (pp = type_rl_list->next; pp->next; pp = pp->next)
@@ -402,7 +451,6 @@ static void bidi_resolveWeak(TYPERUN **ptype_rl_list, Uint32 base_dir)
print_resolved_levels (type_rl_list);
print_resolved_types (type_rl_list);
#endif
}
/* Return the embedding direction of a link. */
@@ -412,7 +460,9 @@ static void bidi_resolveWeak(TYPERUN **ptype_rl_list, Uint32 base_dir)
static void bidi_resolveNeutrals(TYPERUN **ptype_rl_list, Uint32 base_bir)
{
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
DBGLOG ("\n4:Resolving neutral types\n");
DBGLOG ("\n4.Resolving neutral types\n");
for (pp = type_rl_list->next; pp->next; pp = pp->next)
{
Uint32 prev_type, this_type, next_type;
@@ -443,7 +493,8 @@ static int bidi_resolveImplicit(TYPERUN **ptype_rl_list, int base_level)
{
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
int max_level = base_level;
DBGLOG ("\n5:Resolving implicit levels\n");
DBGLOG ("\n5.Resolving implicit levels\n");
for (pp = type_rl_list->next; pp->next; pp = pp->next){
Uint32 this_type;
@@ -479,7 +530,7 @@ bidi_resolveMirrorChar (const CHARSETOPS* charset_ops, Achar32* achars, int len,
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
/* L4. Mirror all characters that are in odd levels and have mirrors. */
DBGLOG ("6.Mirroring\n");
DBGLOG ("\n6.Mirroring\n");
for (pp = type_rl_list->next; pp->next; pp = pp->next) {
if (pp->level & 1)
{
@@ -487,7 +538,8 @@ bidi_resolveMirrorChar (const CHARSETOPS* charset_ops, Achar32* achars, int len,
for (i = POS (pp); i < POS (pp) + LEN (pp); i++)
{
Achar32 mirrored_ch;
if (charset_ops->bidi_mirror_char && charset_ops->bidi_mirror_char (achars[i], &mirrored_ch))
if (charset_ops->bidi_mirror_char &&
charset_ops->bidi_mirror_char (achars[i], &mirrored_ch))
achars[i] = mirrored_ch;
}
}
@@ -501,7 +553,7 @@ static void bidi_resolve_string (const CHARSETOPS* charset_ops,
TYPERUN **ptype_rl_list, BYTE *pmax_level)
{
BYTE base_level = 0;
Uint32 base_dir = BIDI_TYPE_L;
Uint32 base_dir = BIDI_TYPE_LTR;
TYPERUN *type_rl_list = NULL;
/* split the text to some runs. */
@@ -512,8 +564,14 @@ static void bidi_resolve_string (const CHARSETOPS* charset_ops,
bidi_resolveParagraphs(&type_rl_list, &base_dir, &base_level);
}
else {
DBGLOG("\n1.Initializing the base level\n");
base_level = pel;
base_dir = BIDI_LEVEL_TO_DIR (base_level);
DBGLOG2(" Base level: %c\n", bidi_level[base_level + 1]);
DBGLOG2(" Base dir: %c\n", bidi_type_name(base_dir));
DBGLOG(" Initializing the base level, Done\n");
}
/* 2.Resolving Explicit levels.*/
@@ -537,7 +595,7 @@ static void bidi_resolve_string (const CHARSETOPS* charset_ops,
typedef struct _REORDER_CONTEXT {
Achar32* achars;
void* extra;
CB_REVERSE_EXTRA cb;
CB_REVERSE_ARRAY cb;
} REORDER_CONTEXT;
static void bidi_reverse_achars (Achar32* achars, int len, int pos)
@@ -559,7 +617,7 @@ static void bidi_reorder (REORDER_CONTEXT* context, int len,
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
/* L2. Reorder. */
DBGLOG("\n6:Reordering\n");
DBGLOG("\n7.Reordering\n");
for(i = max_level; i > 0; i--){
for (pp = type_rl_list->next; pp->next; pp = pp->next){
@@ -583,7 +641,7 @@ static void bidi_reorder (REORDER_CONTEXT* context, int len,
}
}
}
DBGLOG("\nReordering, Done\n");
DBGLOG(" Reordering, Done\n");
}
static void bidi_reverse_chars (void* context, int len, int pos)
@@ -598,7 +656,7 @@ static void bidi_reverse_chars (void* context, int len, int pos)
}
}
void __mg_charset_bidi_get_embeddlevels (const CHARSETOPS* charset_ops,
void __mg_legacy_bidi_get_embeddlevels (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int pel, Uint8* embedding_levels, Uint8 type)
{
int i = 0;
@@ -646,7 +704,7 @@ static void bidi_map_reverse (void* context, int len, int pos)
}
}
Achar32* __mg_charset_bidi_map_reorder (const CHARSETOPS* charset_ops,
Achar32* __mg_legacy_bidi_map_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, GLYPHMAPINFO* map, int pel)
{
BYTE max_level = 1;
@@ -682,7 +740,7 @@ Achar32* __mg_charset_bidi_map_reorder (const CHARSETOPS* charset_ops,
return achars;
}
Achar32* __mg_charset_bidi_index_reorder (const CHARSETOPS* charset_ops,
Achar32* __mg_legacy_bidi_index_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int* index_map, int pel)
{
BYTE max_level = 1;
@@ -705,9 +763,9 @@ Achar32* __mg_charset_bidi_index_reorder (const CHARSETOPS* charset_ops,
}
#endif
Achar32* __mg_charset_bidi_achars_reorder (const CHARSETOPS* charset_ops,
Achar32* __mg_legacy_bidi_achars_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int pel,
void* extra, CB_REVERSE_EXTRA cb_reverse_extra)
void* extra, CB_REVERSE_ARRAY cb_reverse_extra)
{
BYTE max_level = 1;
TYPERUN *type_rl_list = NULL;
@@ -716,27 +774,27 @@ Achar32* __mg_charset_bidi_achars_reorder (const CHARSETOPS* charset_ops,
print_hexstr(achars, len, FALSE);
/* W1~W7, N1~N2, I1~I2, Get the Embedding Level. */
bidi_resolve_string (charset_ops, achars, len, pel, &type_rl_list,
bidi_resolve_string(charset_ops, achars, len, pel, &type_rl_list,
&max_level);
rc.achars = achars;
rc.extra = extra;
rc.cb = cb_reverse_extra;
bidi_reorder (&rc, len, &type_rl_list, max_level);
bidi_reorder(&rc, len, &type_rl_list, max_level);
/* free typerun list.*/
free_typerun_list (type_rl_list);
free_typerun_list(type_rl_list);
print_hexstr (achars, len, TRUE);
print_hexstr(achars, len, TRUE);
return achars;
}
Uint32 __mg_charset_bidi_str_base_dir (const CHARSETOPS* charset_ops,
Uint32 __mg_legacy_bidi_str_base_dir (const CHARSETOPS* charset_ops,
Achar32* achars, int len)
{
BYTE base_level = 0;
Uint32 base_dir = BIDI_TYPE_L;
Uint32 base_dir = BIDI_TYPE_LTR;
TYPERUN *type_rl_list = NULL;
/* split the text to some runs. */
+34 -4
View File
@@ -41,8 +41,6 @@
#include <stdlib.h>
#include <string.h>
#define DEBUG
#include "common.h"
#include "minigui.h"
#include "gdi.h"
@@ -125,6 +123,7 @@ static PLOGFONT gdiCreateLogFont (const char* type, const char* family,
if ((newlf = (PLOGFONT)calloc(sizeof (FONT_RES), 1)) == NULL)
return INV_LOGFONT;
((FONT_RES *)newlf)->key = -1;
newlf->style = style;
@@ -454,10 +453,11 @@ PLOGFONT GUIAPI CreateLogFontEx (const char* type, const char* family,
PLOGFONT GUIAPI CreateLogFontByName (const char* font_name)
{
char type[LEN_LOGFONT_NAME_FIELD + 1];
char family[LEN_LOGFONT_FAMILY_FILED + 1];
char family[LEN_LOGFONT_FAMILY_FIELD + 1];
char charset[LEN_LOGFONT_NAME_FIELD + 1];
DWORD style;
int height;
int rotation;
if (!fontGetTypeNameFromName (font_name, type) ||
!fontGetFamilyFromName (font_name, family) ||
@@ -466,7 +466,37 @@ PLOGFONT GUIAPI CreateLogFontByName (const char* font_name)
((style = fontGetStyleFromName (font_name)) == 0xFFFFFFFF))
return NULL;
return gdiCreateLogFont (type, family, charset, style, height, 0);
switch (fontGetOrientFromName (font_name)) {
case FONT_ORIENT_SIDEWAYS:
rotation = -900;
break;
case FONT_ORIENT_UPSIDE_DOWN:
rotation = 1800;
break;
case FONT_ORIENT_SIDEWAYS_LEFT:
rotation = 900;
break;
case FONT_ORIENT_UPRIGHT:
default:
rotation = 0;
break;
}
return gdiCreateLogFont (type, family, charset, style, height, rotation);
}
PLOGFONT GUIAPI CreateLogFontForMChar2UChar(const char* charset)
{
char my_fontname[LEN_LOGFONT_NAME_FULL + 1];
memset(my_fontname, 0, LEN_LOGFONT_NAME_FULL + 1);
strncpy(my_fontname, "nuf-dummy-rrncnn-U-1-", LEN_LOGFONT_NAME_FULL);
strncat(my_fontname, charset, LEN_LOGFONT_NAME_FIELD);
return CreateLogFontByName(my_fontname);
}
void GUIAPI DestroyLogFont (PLOGFONT logfont)
+185
View File
@@ -0,0 +1,185 @@
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Or,
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
/*
** nullfont.c: The Null Font operation set.
**
** Created by WEI Yongming at 2019/03/27
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "common.h"
#include "minigui.h"
#include "gdi.h"
#include "devfont.h"
#include "charset.h"
#include "fontname.h"
#define NUF_WIDTH 8
#define NUF_HEIGHT 1
static DWORD get_glyph_bmptype (LOGFONT* logfont, DEVFONT* devfont)
{
return DEVFONTGLYPHTYPE_MONOBMP;
}
static int get_max_width (LOGFONT* logfont, DEVFONT* devfont)
{
return NUF_WIDTH;
}
static int get_ave_width (LOGFONT* logfont, DEVFONT* devfont)
{
return NUF_WIDTH;
}
static int get_font_height (LOGFONT* logfont, DEVFONT* devfont)
{
return GET_DEVFONT_SCALE (logfont, devfont);
}
static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df_slot)
{
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
SET_DEVFONT_SCALE(logfont, df_slot, expect);
return expect;
}
static int get_font_ascent (LOGFONT* logfont, DEVFONT* devfont)
{
return GET_DEVFONT_SCALE (logfont, devfont);
}
static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
{
return 0;
}
static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
Glyph32 glyph_value,
int* px, int* py, int* pwidth, int* pheight)
{
int scale = GET_DEVFONT_SCALE (logfont, devfont);
if (pwidth)
*pwidth = NUF_WIDTH;
if (pheight)
*pheight = NUF_HEIGHT;
if (py)
*py -= scale;
return NUF_WIDTH;
}
static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
Glyph32 glyph_value, int* px, int* py)
{
if (px)
*px += NUF_WIDTH;
return NUF_WIDTH;
}
static unsigned char null_bitmap = 0x18;
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale)
{
if (sz) {
sz->cx = 8;
sz->cy = 1;
}
if (pitch)
*pitch = 1;
if (scale)
*scale = GET_DEVFONT_SCALE (logfont, devfont);
return &null_bitmap;
}
static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 gv)
{
return TRUE;
}
static int is_rotatable (LOGFONT* logfont, DEVFONT* devfont, int rot_desired)
{
return 0;
}
static void* load_font_data (DEVFONT* devfont, const char* fontname,
const char* filename)
{
return &null_bitmap;
}
static void unload_font_data (DEVFONT* devfont, void* data)
{
if (data != &null_bitmap) {
_WRN_PRINTF("data is not null_bitmap");
}
}
FONTOPS __mg_null_font_ops = {
get_glyph_bmptype,
get_ave_width,
get_max_width,
get_font_height,
get_font_size,
get_font_ascent,
get_font_descent,
is_glyph_existed,
get_glyph_advance,
get_glyph_bbox,
get_glyph_monobitmap,
NULL,
NULL,
NULL,
NULL,
NULL,
is_rotatable,
load_font_data,
unload_font_data
};
+5 -4
View File
@@ -164,14 +164,14 @@ static void* load_font_data (DEVFONT* devfont, const char* font_name, const char
qpf_info = (QPFINFO*) calloc (1, sizeof(QPFINFO));
if (!(fp = fopen (file_name, "rb"))) {
_MG_PRINTF ("FONT>QPF: open file error: %s.\n",
_WRN_PRINTF ("FONT>QPF: open file error: %s.\n",
file_name);
goto error;
}
file_size = get_opened_file_size (fp);
if (file_size == 0) {
_MG_PRINTF ("FONT>QPF: empty font file: %s.\n",
_WRN_PRINTF ("FONT>QPF: empty font file: %s.\n",
file_name);
goto error;
}
@@ -180,14 +180,14 @@ static void* load_font_data (DEVFONT* devfont, const char* font_name, const char
if ((qpf_info->height
= fontGetHeightFromName (font_name)) == -1) {
_MG_PRINTF ("FONT>QPF: Invalid font name (height): %s.\n",
_WRN_PRINTF ("FONT>QPF: Invalid font name (height): %s.\n",
font_name);
goto error;
}
if ((qpf_info->width
= fontGetWidthFromName (font_name)) == -1) {
_MG_PRINTF ("FONT>QPF: Invalid font name (width): %s.\n",
_WRN_PRINTF ("FONT>QPF: Invalid font name (width): %s.\n",
font_name);
goto error;
}
@@ -478,6 +478,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
}
advance = glyph->metrics->advance * GET_DEVFONT_SCALE (logfont, devfont);
if (px)
*px += advance;
return advance;
+3 -1
View File
@@ -162,8 +162,9 @@ static int get_font_size (LOGFONT* logfont, DEVFONT* devfont, int expect, int df
if (logfont->style & FS_OTHER_AUTOSCALE)
scale = font_GetBestScaleFactor (height, expect);
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS)
if (df_slot >= 0 && df_slot < MAXNR_DEVFONTS) {
SET_DEVFONT_SCALE (logfont, df_slot, scale);
}
return height * scale;
}
@@ -239,6 +240,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
{
int advance = RBFONT_INFO_P (devfont)->width *
GET_DEVFONT_SCALE (logfont, devfont);
if (px)
*px += advance;
return advance;
}
+255
View File
@@ -0,0 +1,255 @@
/*
* script-language-table.inc:
* copied from LGPL'd Pango
*/
typedef struct _ScriptTypeForLang {
const char lang[7];
ScriptType scripts[3];
} ScriptTypeForLang;
static const ScriptTypeForLang _script_for_lang[] = {
{ "aa", { SCRIPT_LATIN/*62*/ } },
{ "ab", { SCRIPT_CYRILLIC/*90*/ } },
{ "af", { SCRIPT_LATIN/*69*/ } },
{ "ak", { SCRIPT_LATIN/*70*/ } },
{ "am", { SCRIPT_ETHIOPIC/*264*/ } },
{ "an", { SCRIPT_LATIN/*66*/ } },
{ "ar", { SCRIPT_ARABIC/*36*/ } },
{ "as", { SCRIPT_BENGALI/*64*/ } },
{ "ast", { SCRIPT_LATIN/*70*/ } },
{ "av", { SCRIPT_CYRILLIC/*67*/ } },
{ "ay", { SCRIPT_LATIN/*60*/ } },
{ "az-az", { SCRIPT_LATIN/*66*/ } },
{ "az-ir", { SCRIPT_ARABIC/*38*/ } },
{ "ba", { SCRIPT_CYRILLIC/*82*/ } },
{ "be", { SCRIPT_CYRILLIC/*68*/ } },
{ "ber-dz", { SCRIPT_LATIN/*70*/ } },
{ "ber-ma", { SCRIPT_TIFINAGH/*32*/ } },
{ "bg", { SCRIPT_CYRILLIC/*60*/ } },
{ "bh", { SCRIPT_DEVANAGARI/*68*/ } },
{ "bho", { SCRIPT_DEVANAGARI/*68*/ } },
{ "bi", { SCRIPT_LATIN/*58*/ } },
{ "bin", { SCRIPT_LATIN/*76*/ } },
{ "bm", { SCRIPT_LATIN/*60*/ } },
{ "bn", { SCRIPT_BENGALI/*63*/ } },
{ "bo", { SCRIPT_TIBETAN/*95*/ } },
{ "br", { SCRIPT_LATIN/*64*/ } },
{ "brx", { SCRIPT_DEVANAGARI/*78*/ } },
{ "bs", { SCRIPT_LATIN/*62*/ } },
{ "bua", { SCRIPT_CYRILLIC/*70*/ } },
{ "byn", { SCRIPT_ETHIOPIC/*255*/ } },
{ "ca", { SCRIPT_LATIN/*74*/ } },
{ "ce", { SCRIPT_CYRILLIC/*67*/ } },
{ "ch", { SCRIPT_LATIN/*58*/ } },
{ "chm", { SCRIPT_CYRILLIC/*76*/ } },
{ "chr", { SCRIPT_CHEROKEE/*85*/ } },
{ "co", { SCRIPT_LATIN/*84*/ } },
{ "crh", { SCRIPT_LATIN/*68*/ } },
{ "cs", { SCRIPT_LATIN/*82*/ } },
{ "csb", { SCRIPT_LATIN/*74*/ } },
{ "cu", { SCRIPT_CYRILLIC/*103*/ } },
{ "cv", { SCRIPT_CYRILLIC/*72*/, SCRIPT_LATIN/*2*/ } },
{ "cy", { SCRIPT_LATIN/*78*/ } },
{ "da", { SCRIPT_LATIN/*70*/ } },
{ "de", { SCRIPT_LATIN/*59*/ } },
{ "doi", { SCRIPT_DEVANAGARI/*81*/ } },
{ "dv", { SCRIPT_THAANA/*49*/ } },
{ "dz", { SCRIPT_TIBETAN/*95*/ } },
{ "ee", { SCRIPT_LATIN/*96*/ } },
{ "el", { SCRIPT_GREEK/*69*/ } },
{ "en", { SCRIPT_LATIN/*72*/ } },
{ "eo", { SCRIPT_LATIN/*64*/ } },
{ "es", { SCRIPT_LATIN/*66*/ } },
{ "et", { SCRIPT_LATIN/*64*/ } },
{ "eu", { SCRIPT_LATIN/*56*/ } },
{ "fa", { SCRIPT_ARABIC/*38*/ } },
{ "fat", { SCRIPT_LATIN/*70*/ } },
{ "ff", { SCRIPT_LATIN/*62*/ } },
{ "fi", { SCRIPT_LATIN/*62*/ } },
{ "fil", { SCRIPT_LATIN/*84*/ } },
{ "fj", { SCRIPT_LATIN/*52*/ } },
{ "fo", { SCRIPT_LATIN/*68*/ } },
{ "fr", { SCRIPT_LATIN/*84*/ } },
{ "fur", { SCRIPT_LATIN/*66*/ } },
{ "fy", { SCRIPT_LATIN/*75*/ } },
{ "ga", { SCRIPT_LATIN/*80*/ } },
{ "gd", { SCRIPT_LATIN/*70*/ } },
{ "gez", { SCRIPT_ETHIOPIC/*218*/ } },
{ "gl", { SCRIPT_LATIN/*66*/ } },
{ "gn", { SCRIPT_LATIN/*70*/ } },
{ "gu", { SCRIPT_GUJARATI/*68*/ } },
{ "gv", { SCRIPT_LATIN/*54*/ } },
{ "ha", { SCRIPT_LATIN/*60*/ } },
{ "haw", { SCRIPT_LATIN/*62*/ } },
{ "he", { SCRIPT_HEBREW/*27*/ } },
{ "hi", { SCRIPT_DEVANAGARI/*68*/ } },
{ "hne", { SCRIPT_DEVANAGARI/*68*/ } },
{ "ho", { SCRIPT_LATIN/*52*/ } },
{ "hr", { SCRIPT_LATIN/*62*/ } },
{ "hsb", { SCRIPT_LATIN/*72*/ } },
{ "ht", { SCRIPT_LATIN/*56*/ } },
{ "hu", { SCRIPT_LATIN/*70*/ } },
{ "hy", { SCRIPT_ARMENIAN/*77*/ } },
{ "hz", { SCRIPT_LATIN/*56*/ } },
{ "ia", { SCRIPT_LATIN/*52*/ } },
{ "id", { SCRIPT_LATIN/*54*/ } },
{ "ie", { SCRIPT_LATIN/*52*/ } },
{ "ig", { SCRIPT_LATIN/*58*/ } },
{ "ii", { SCRIPT_YI/*1165*/ } },
{ "ik", { SCRIPT_CYRILLIC/*68*/ } },
{ "io", { SCRIPT_LATIN/*52*/ } },
{ "is", { SCRIPT_LATIN/*70*/ } },
{ "it", { SCRIPT_LATIN/*72*/ } },
{ "iu", { SCRIPT_CANADIAN_ABORIGINAL/*161*/ } },
{ "ja", { SCRIPT_HAN/*2134*/, SCRIPT_KATAKANA/*88*/, SCRIPT_HIRAGANA/*85*/ } },
{ "jv", { SCRIPT_LATIN/*56*/ } },
{ "ka", { SCRIPT_GEORGIAN/*33*/ } },
{ "kaa", { SCRIPT_CYRILLIC/*78*/ } },
{ "kab", { SCRIPT_LATIN/*70*/ } },
{ "ki", { SCRIPT_LATIN/*56*/ } },
{ "kj", { SCRIPT_LATIN/*52*/ } },
{ "kk", { SCRIPT_CYRILLIC/*77*/ } },
{ "kl", { SCRIPT_LATIN/*81*/ } },
{ "km", { SCRIPT_KHMER/*63*/ } },
{ "kn", { SCRIPT_KANNADA/*70*/ } },
{ "ko", { SCRIPT_HANGUL/*2442*/ } },
{ "kok", { SCRIPT_DEVANAGARI/*68*/ } },
{ "kr", { SCRIPT_LATIN/*56*/ } },
{ "ks", { SCRIPT_ARABIC/*33*/ } },
{ "ku-am", { SCRIPT_CYRILLIC/*64*/ } },
{ "ku-iq", { SCRIPT_ARABIC/*32*/ } },
{ "ku-ir", { SCRIPT_ARABIC/*32*/ } },
{ "ku-tr", { SCRIPT_LATIN/*62*/ } },
{ "kum", { SCRIPT_CYRILLIC/*66*/ } },
{ "kv", { SCRIPT_CYRILLIC/*70*/ } },
{ "kw", { SCRIPT_LATIN/*64*/ } },
{ "kwm", { SCRIPT_LATIN/*52*/ } },
{ "ky", { SCRIPT_CYRILLIC/*70*/ } },
{ "la", { SCRIPT_LATIN/*68*/ } },
{ "lah", { SCRIPT_ARABIC/*27*/ } },
{ "lb", { SCRIPT_LATIN/*75*/ } },
{ "lez", { SCRIPT_CYRILLIC/*67*/ } },
{ "lg", { SCRIPT_LATIN/*54*/ } },
{ "li", { SCRIPT_LATIN/*62*/ } },
{ "ln", { SCRIPT_LATIN/*78*/ } },
{ "lo", { SCRIPT_LAO/*55*/ } },
{ "lt", { SCRIPT_LATIN/*70*/ } },
{ "lv", { SCRIPT_LATIN/*78*/ } },
{ "mai", { SCRIPT_DEVANAGARI/*68*/ } },
{ "mg", { SCRIPT_LATIN/*56*/ } },
{ "mh", { SCRIPT_LATIN/*62*/ } },
{ "mi", { SCRIPT_LATIN/*64*/ } },
{ "mk", { SCRIPT_CYRILLIC/*42*/ } },
{ "ml", { SCRIPT_MALAYALAM/*68*/ } },
{ "mn-cn", { SCRIPT_MONGOLIAN/*130*/ } },
{ "mn-mn", { SCRIPT_CYRILLIC/*70*/ } },
{ "mni", { SCRIPT_BENGALI/*75*/ } },
{ "mo", { SCRIPT_CYRILLIC/*66*/, SCRIPT_LATIN/*62*/ } },
{ "mr", { SCRIPT_DEVANAGARI/*68*/ } },
{ "ms", { SCRIPT_LATIN/*52*/ } },
{ "mt", { SCRIPT_LATIN/*72*/ } },
{ "my", { SCRIPT_MYANMAR/*48*/ } },
{ "na", { SCRIPT_LATIN/*60*/ } },
{ "nb", { SCRIPT_LATIN/*70*/ } },
{ "nds", { SCRIPT_LATIN/*59*/ } },
{ "ne", { SCRIPT_DEVANAGARI/*70*/ } },
{ "ng", { SCRIPT_LATIN/*52*/ } },
{ "nl", { SCRIPT_LATIN/*82*/ } },
{ "nn", { SCRIPT_LATIN/*76*/ } },
{ "no", { SCRIPT_LATIN/*70*/ } },
{ "nqo", { SCRIPT_NKO/*59*/ } },
{ "nr", { SCRIPT_LATIN/*52*/ } },
{ "nso", { SCRIPT_LATIN/*58*/ } },
{ "nv", { SCRIPT_LATIN/*70*/ } },
{ "ny", { SCRIPT_LATIN/*54*/ } },
{ "oc", { SCRIPT_LATIN/*70*/ } },
{ "om", { SCRIPT_LATIN/*52*/ } },
{ "or", { SCRIPT_ORIYA/*68*/ } },
{ "os", { SCRIPT_CYRILLIC/*66*/ } },
{ "ota", { SCRIPT_ARABIC/*37*/ } },
{ "pa", { SCRIPT_GURMUKHI/*63*/ } },
{ "pa-pk", { SCRIPT_ARABIC/*27*/ } },
{ "pap-an", { SCRIPT_LATIN/*72*/ } },
{ "pap-aw", { SCRIPT_LATIN/*54*/ } },
{ "pl", { SCRIPT_LATIN/*70*/ } },
{ "ps-af", { SCRIPT_ARABIC/*49*/ } },
{ "ps-pk", { SCRIPT_ARABIC/*49*/ } },
{ "pt", { SCRIPT_LATIN/*82*/ } },
{ "qu", { SCRIPT_LATIN/*54*/ } },
{ "quz", { SCRIPT_LATIN/*54*/ } },
{ "rm", { SCRIPT_LATIN/*66*/ } },
{ "rn", { SCRIPT_LATIN/*52*/ } },
{ "ro", { SCRIPT_LATIN/*62*/ } },
{ "ru", { SCRIPT_CYRILLIC/*66*/ } },
{ "rw", { SCRIPT_LATIN/*52*/ } },
{ "sa", { SCRIPT_DEVANAGARI/*68*/ } },
{ "sah", { SCRIPT_CYRILLIC/*76*/ } },
{ "sat", { SCRIPT_DEVANAGARI/*68*/ } },
{ "sc", { SCRIPT_LATIN/*62*/ } },
{ "sco", { SCRIPT_LATIN/*56*/ } },
{ "sd", { SCRIPT_ARABIC/*54*/ } },
{ "se", { SCRIPT_LATIN/*66*/ } },
{ "sel", { SCRIPT_CYRILLIC/*66*/ } },
{ "sg", { SCRIPT_LATIN/*72*/ } },
{ "sh", { SCRIPT_CYRILLIC/*94*/, SCRIPT_LATIN/*62*/ } },
{ "shs", { SCRIPT_LATIN/*46*/ } },
{ "si", { SCRIPT_SINHALA/*73*/ } },
{ "sid", { SCRIPT_ETHIOPIC/*281*/ } },
{ "sk", { SCRIPT_LATIN/*86*/ } },
{ "sl", { SCRIPT_LATIN/*62*/ } },
{ "sm", { SCRIPT_LATIN/*52*/ } },
{ "sma", { SCRIPT_LATIN/*60*/ } },
{ "smj", { SCRIPT_LATIN/*60*/ } },
{ "smn", { SCRIPT_LATIN/*68*/ } },
{ "sms", { SCRIPT_LATIN/*80*/ } },
{ "sn", { SCRIPT_LATIN/*52*/ } },
{ "so", { SCRIPT_LATIN/*52*/ } },
{ "sq", { SCRIPT_LATIN/*56*/ } },
{ "sr", { SCRIPT_CYRILLIC/*60*/ } },
{ "ss", { SCRIPT_LATIN/*52*/ } },
{ "st", { SCRIPT_LATIN/*52*/ } },
{ "su", { SCRIPT_LATIN/*54*/ } },
{ "sv", { SCRIPT_LATIN/*68*/ } },
{ "sw", { SCRIPT_LATIN/*52*/ } },
{ "syr", { SCRIPT_SYRIAC/*45*/ } },
{ "ta", { SCRIPT_TAMIL/*48*/ } },
{ "te", { SCRIPT_TELUGU/*70*/ } },
{ "tg", { SCRIPT_CYRILLIC/*78*/ } },
{ "th", { SCRIPT_THAI/*73*/ } },
{ "ti-er", { SCRIPT_ETHIOPIC/*255*/ } },
{ "ti-et", { SCRIPT_ETHIOPIC/*281*/ } },
{ "tig", { SCRIPT_ETHIOPIC/*221*/ } },
{ "tk", { SCRIPT_LATIN/*68*/ } },
{ "tl", { SCRIPT_LATIN/*84*/ } },
{ "tn", { SCRIPT_LATIN/*58*/ } },
{ "to", { SCRIPT_LATIN/*52*/ } },
{ "tr", { SCRIPT_LATIN/*70*/ } },
{ "ts", { SCRIPT_LATIN/*52*/ } },
{ "tt", { SCRIPT_CYRILLIC/*76*/ } },
{ "tw", { SCRIPT_LATIN/*70*/ } },
{ "ty", { SCRIPT_LATIN/*64*/ } },
{ "tyv", { SCRIPT_CYRILLIC/*70*/ } },
{ "ug", { SCRIPT_ARABIC/*33*/ } },
{ "uk", { SCRIPT_CYRILLIC/*72*/ } },
{ "ur", { SCRIPT_ARABIC/*27*/ } },
{ "uz", { SCRIPT_LATIN/*52*/ } },
{ "ve", { SCRIPT_LATIN/*62*/ } },
{ "vi", { SCRIPT_LATIN/*186*/ } },
{ "vo", { SCRIPT_LATIN/*54*/ } },
{ "vot", { SCRIPT_LATIN/*62*/ } },
{ "wa", { SCRIPT_LATIN/*70*/ } },
{ "wal", { SCRIPT_ETHIOPIC/*281*/ } },
{ "wen", { SCRIPT_LATIN/*76*/ } },
{ "wo", { SCRIPT_LATIN/*66*/ } },
{ "xh", { SCRIPT_LATIN/*52*/ } },
{ "yap", { SCRIPT_LATIN/*58*/ } },
{ "yi", { SCRIPT_HEBREW/*27*/ } },
{ "yo", { SCRIPT_LATIN/*114*/ } },
{ "za", { SCRIPT_LATIN/*52*/ } },
{ "zh-cn", { SCRIPT_HAN/*6763*/ } },
{ "zh-hk", { SCRIPT_HAN/*1083*/ } },
{ "zh-mo", { SCRIPT_HAN/*1083*/ } },
{ "zh-sg", { SCRIPT_HAN/*6763*/ } },
{ "zh-tw", { SCRIPT_HAN/*13063*/ } },
{ "zu", { SCRIPT_LATIN/*52*/ } }
};
+7 -4
View File
@@ -536,7 +536,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
{
seunichar16 wc;
SeLogFont selogfont;
int x = *px;
int x = 0, y = 0;
glyph_value = REAL_GLYPH(glyph_value);
if (devfont->charset_ops->conv_to_uc32)
@@ -548,14 +548,17 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
lock();
se_minigui_get_char_advance(&selogfont, wc, px, py);
se_minigui_get_char_advance(&selogfont, wc, &x, &y);
unlock();
#if SE_MINIGUI_TRACE
printf("get_glyph_advance result. wc: 0x%04X x: %d y: %d\n", wc, px ? *px : 0, py ? *py : 0);
printf("get_glyph_advance result. wc: 0x%04X x: %d y: %d\n", wc, x, y);
#endif
return *px - x;
if (px)
*px += x;
return x;
}
static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_value)
+1 -1
View File
@@ -103,7 +103,7 @@ BOOL mg_InitSysFont (void)
for (i = 0; i < nr_fonts; i++) {
char key [11];
char type [LEN_LOGFONT_NAME_FIELD + 1];
char family [LEN_LOGFONT_FAMILY_FILED + 1];
char family [LEN_LOGFONT_FAMILY_FIELD + 1];
char style [LEN_LOGFONT_NAME_FIELD + 1];
char charset [LEN_LOGFONT_NAME_FIELD + 1];
char font_name [LEN_DEVFONT_NAME + 1];
+2 -1
View File
@@ -460,9 +460,10 @@ static void get_char_advance (LOGFONT* logfont, DEVFONT* devfont,
int* px, int* py)
{
TYPE1INSTANCEINFO* type1_inst_info = TYPE1_INST_INFO_P (devfont);
if (px)
*px += type1_inst_info->last_advanceX;
if (py)
*py -= type1_inst_info->last_advanceY;
}
static DEVFONT* new_instance (LOGFONT* logfont, DEVFONT* devfont, BOOL need_sbc_font)
+92
View File
@@ -0,0 +1,92 @@
/* The tables in this file should all be sorted on their first item. */
const PairMap mandatory_liga_table[] = {
{{0xFEDF, 0xFE82}, 0xFEF5},
{{0xFEDF, 0xFE84}, 0xFEF7},
{{0xFEDF, 0xFE88}, 0xFEF9},
{{0xFEDF, 0xFE8E}, 0xFEFB},
{{0xFEE0, 0xFE82}, 0xFEF6},
{{0xFEE0, 0xFE84}, 0xFEF8},
{{0xFEE0, 0xFE88}, 0xFEFA},
{{0xFEE0, 0xFE8E}, 0xFEFC},
};
const PairMap console_liga_table[] = {
{{0x0640, 0xFC60}, 0xFCF2},
{{0x0640, 0xFC61}, 0xFCF3},
{{0x0640, 0xFC62}, 0xFCF4},
{{0x0640, 0xFE70}, 0xFE71},
{{0x0640, 0xFE76}, 0xFE77},
{{0x0640, 0xFE78}, 0xFE79},
{{0x0640, 0xFE7A}, 0xFE7B},
{{0x0640, 0xFE7C}, 0xFE7D},
{{0x0640, 0xFE7E}, 0xFE7F},
{{0xFBE8, 0x0654}, 0xFE8B},
{{0xFBE9, 0x0654}, 0xFE8C},
{{0xFBFC, 0x0654}, 0xFE89},
{{0xFBFC, 0x0670}, 0xFC5D},
{{0xFBFD, 0x0654}, 0xFE8A},
{{0xFBFD, 0x0670}, 0xFC90},
{{0xFE7C, 0x0670}, 0xFC63},
{{0xFE7C, 0xFE72}, 0xFC5E},
{{0xFE7C, 0xFE74}, 0xFC5F},
{{0xFE7C, 0xFE76}, 0xFC60},
{{0xFE7C, 0xFE78}, 0xFC61},
{{0xFE7C, 0xFE7A}, 0xFC62},
{{0xFE7D, 0xFE76}, 0xFCF2},
{{0xFE7D, 0xFE77}, 0xFCF2},
{{0xFE7D, 0xFE78}, 0xFCF3},
{{0xFE7D, 0xFE79}, 0xFCF3},
{{0xFE7D, 0xFE7A}, 0xFCF4},
{{0xFE7D, 0xFE7B}, 0xFCF4},
{{0xFE8D, 0x0653}, 0xFE81},
{{0xFE8D, 0x0654}, 0xFE83},
{{0xFE8D, 0x0655}, 0xFE87},
{{0xFE8D, 0xFE70}, 0xFD3D},
{{0xFE8E, 0x0653}, 0xFE82},
{{0xFE8E, 0x0654}, 0xFE84},
{{0xFE8E, 0x0655}, 0xFE88},
{{0xFE8E, 0xFE70}, 0xFD3C},
{{0xFEE9, 0x0654}, 0xFBA4},
{{0xFEEA, 0x0654}, 0xFBA5},
{{0xFEED, 0x0654}, 0xFE85},
{{0xFEEE, 0x0654}, 0xFE86},
{{0xFEEF, 0x0654}, 0xFE89},
{{0xFEEF, 0x0670}, 0xFC5D},
{{0xFEF0, 0x0654}, 0xFE8A},
{{0xFEF0, 0x0670}, 0xFC90},
{{0xFEF1, 0x0654}, 0xFE89},
{{0xFEF1, 0x0670}, 0xFC5D},
{{0xFEF2, 0x0654}, 0xFE8A},
{{0xFEF2, 0x0670}, 0xFC90},
{{0xFEF3, 0x0654}, 0xFE8B},
{{0xFEF4, 0x0654}, 0xFE8C},
{{0xFEFB, 0x0653}, 0xFEF5},
{{0xFEFB, 0x0654}, 0xFEF7},
{{0xFEFB, 0x0655}, 0xFEF9},
{{0xFEFC, 0x0653}, 0xFEF6},
{{0xFEFC, 0x0654}, 0xFEF8},
{{0xFEFC, 0x0655}, 0xFEFA},
};
static const Uchar32 NSMShap[][4] = {
{0xFE70, 0xFE71, 0xFE70, 0xFE71,},
{0xFE72, 0xFE72, 0xFE72, 0xFE72,},
{0xFE74, 0xFE74, 0xFE74, 0xFE74,},
{0xFE76, 0xFE77, 0xFE76, 0xFE77,},
{0xFE78, 0xFE79, 0xFE78, 0xFE79,},
{0xFE7A, 0xFE7B, 0xFE7A, 0xFE7B,},
{0xFE7C, 0xFE7D, 0xFE7C, 0xFE7D,},
{0xFE7E, 0xFE7F, 0xFE7E, 0xFE7F,},
};
#ifndef UNIBIDI_ACCESS_SHAPE_TABLE
# define UNIBIDI_ACCESS_SHAPE_TABLE(table,min,max,x,shape) \
(((x)<(min)||(x)>(max))?(x):(table)[(x)-(min)][(shape)])
#endif
#define UNIBIDI_GET_ARABIC_SHAPE_NSM(x,shape) \
UNIBIDI_ACCESS_SHAPE_TABLE(NSMShap, 0x064B, 0x0652, (x), (shape))
+205
View File
@@ -0,0 +1,205 @@
/* unicode-arabic-shaping-table.inc
* generated by gen-arabic-shaping-tab
* from the files UnicodeData.txt, (null) of Unicode version 12.0.0. */
/*
use UNIBIDI_GET_ARABIC_SHAPE_PRES(key,shape) to access your table
required memory: 2864
*/
/* *INDENT-OFF* */
static const Uchar32 ArShap[179][4] = {
{0xfe80,0x0621,0x0621,0x0621,},
{0xfe81,0xfe82,0x0622,0x0622,},
{0xfe83,0xfe84,0x0623,0x0623,},
{0xfe85,0xfe86,0x0624,0x0624,},
{0xfe87,0xfe88,0x0625,0x0625,},
{0xfe89,0xfe8a,0xfe8b,0xfe8c,},
{0xfe8d,0xfe8e,0x0627,0x0627,},
{0xfe8f,0xfe90,0xfe91,0xfe92,},
{0xfe93,0xfe94,0x0629,0x0629,},
{0xfe95,0xfe96,0xfe97,0xfe98,},
{0xfe99,0xfe9a,0xfe9b,0xfe9c,},
{0xfe9d,0xfe9e,0xfe9f,0xfea0,},
{0xfea1,0xfea2,0xfea3,0xfea4,},
{0xfea5,0xfea6,0xfea7,0xfea8,},
{0xfea9,0xfeaa,0x062f,0x062f,},
{0xfeab,0xfeac,0x0630,0x0630,},
{0xfead,0xfeae,0x0631,0x0631,},
{0xfeaf,0xfeb0,0x0632,0x0632,},
{0xfeb1,0xfeb2,0xfeb3,0xfeb4,},
{0xfeb5,0xfeb6,0xfeb7,0xfeb8,},
{0xfeb9,0xfeba,0xfebb,0xfebc,},
{0xfebd,0xfebe,0xfebf,0xfec0,},
{0xfec1,0xfec2,0xfec3,0xfec4,},
{0xfec5,0xfec6,0xfec7,0xfec8,},
{0xfec9,0xfeca,0xfecb,0xfecc,},
{0xfecd,0xfece,0xfecf,0xfed0,},
{0x063b,0x063b,0x063b,0x063b,},
{0x063c,0x063c,0x063c,0x063c,},
{0x063d,0x063d,0x063d,0x063d,},
{0x063e,0x063e,0x063e,0x063e,},
{0x063f,0x063f,0x063f,0x063f,},
{0x0640,0x0640,0x0640,0x0640,},
{0xfed1,0xfed2,0xfed3,0xfed4,},
{0xfed5,0xfed6,0xfed7,0xfed8,},
{0xfed9,0xfeda,0xfedb,0xfedc,},
{0xfedd,0xfede,0xfedf,0xfee0,},
{0xfee1,0xfee2,0xfee3,0xfee4,},
{0xfee5,0xfee6,0xfee7,0xfee8,},
{0xfee9,0xfeea,0xfeeb,0xfeec,},
{0xfeed,0xfeee,0x0648,0x0648,},
{0xfeef,0xfef0,0xfbe8,0xfbe9,},
{0xfef1,0xfef2,0xfef3,0xfef4,},
{0x064b,0x064b,0x064b,0x064b,},
{0x064c,0x064c,0x064c,0x064c,},
{0x064d,0x064d,0x064d,0x064d,},
{0x064e,0x064e,0x064e,0x064e,},
{0x064f,0x064f,0x064f,0x064f,},
{0x0650,0x0650,0x0650,0x0650,},
{0x0651,0x0651,0x0651,0x0651,},
{0x0652,0x0652,0x0652,0x0652,},
{0x0653,0x0653,0x0653,0x0653,},
{0x0654,0x0654,0x0654,0x0654,},
{0x0655,0x0655,0x0655,0x0655,},
{0x0656,0x0656,0x0656,0x0656,},
{0x0657,0x0657,0x0657,0x0657,},
{0x0658,0x0658,0x0658,0x0658,},
{0x0659,0x0659,0x0659,0x0659,},
{0x065a,0x065a,0x065a,0x065a,},
{0x065b,0x065b,0x065b,0x065b,},
{0x065c,0x065c,0x065c,0x065c,},
{0x065d,0x065d,0x065d,0x065d,},
{0x065e,0x065e,0x065e,0x065e,},
{0x065f,0x065f,0x065f,0x065f,},
{0x0660,0x0660,0x0660,0x0660,},
{0x0661,0x0661,0x0661,0x0661,},
{0x0662,0x0662,0x0662,0x0662,},
{0x0663,0x0663,0x0663,0x0663,},
{0x0664,0x0664,0x0664,0x0664,},
{0x0665,0x0665,0x0665,0x0665,},
{0x0666,0x0666,0x0666,0x0666,},
{0x0667,0x0667,0x0667,0x0667,},
{0x0668,0x0668,0x0668,0x0668,},
{0x0669,0x0669,0x0669,0x0669,},
{0x066a,0x066a,0x066a,0x066a,},
{0x066b,0x066b,0x066b,0x066b,},
{0x066c,0x066c,0x066c,0x066c,},
{0x066d,0x066d,0x066d,0x066d,},
{0x066e,0x066e,0x066e,0x066e,},
{0x066f,0x066f,0x066f,0x066f,},
{0x0670,0x0670,0x0670,0x0670,},
{0xfb50,0xfb51,0x0671,0x0671,},
{0x0672,0x0672,0x0672,0x0672,},
{0x0673,0x0673,0x0673,0x0673,},
{0x0674,0x0674,0x0674,0x0674,},
{0x0675,0x0675,0x0675,0x0675,},
{0x0676,0x0676,0x0676,0x0676,},
{0xfbdd,0x0677,0x0677,0x0677,},
{0x0678,0x0678,0x0678,0x0678,},
{0xfb66,0xfb67,0xfb68,0xfb69,},
{0xfb5e,0xfb5f,0xfb60,0xfb61,},
{0xfb52,0xfb53,0xfb54,0xfb55,},
{0x067c,0x067c,0x067c,0x067c,},
{0x067d,0x067d,0x067d,0x067d,},
{0xfb56,0xfb57,0xfb58,0xfb59,},
{0xfb62,0xfb63,0xfb64,0xfb65,},
{0xfb5a,0xfb5b,0xfb5c,0xfb5d,},
{0x0681,0x0681,0x0681,0x0681,},
{0x0682,0x0682,0x0682,0x0682,},
{0xfb76,0xfb77,0xfb78,0xfb79,},
{0xfb72,0xfb73,0xfb74,0xfb75,},
{0x0685,0x0685,0x0685,0x0685,},
{0xfb7a,0xfb7b,0xfb7c,0xfb7d,},
{0xfb7e,0xfb7f,0xfb80,0xfb81,},
{0xfb88,0xfb89,0x0688,0x0688,},
{0x0689,0x0689,0x0689,0x0689,},
{0x068a,0x068a,0x068a,0x068a,},
{0x068b,0x068b,0x068b,0x068b,},
{0xfb84,0xfb85,0x068c,0x068c,},
{0xfb82,0xfb83,0x068d,0x068d,},
{0xfb86,0xfb87,0x068e,0x068e,},
{0x068f,0x068f,0x068f,0x068f,},
{0x0690,0x0690,0x0690,0x0690,},
{0xfb8c,0xfb8d,0x0691,0x0691,},
{0x0692,0x0692,0x0692,0x0692,},
{0x0693,0x0693,0x0693,0x0693,},
{0x0694,0x0694,0x0694,0x0694,},
{0x0695,0x0695,0x0695,0x0695,},
{0x0696,0x0696,0x0696,0x0696,},
{0x0697,0x0697,0x0697,0x0697,},
{0xfb8a,0xfb8b,0x0698,0x0698,},
{0x0699,0x0699,0x0699,0x0699,},
{0x069a,0x069a,0x069a,0x069a,},
{0x069b,0x069b,0x069b,0x069b,},
{0x069c,0x069c,0x069c,0x069c,},
{0x069d,0x069d,0x069d,0x069d,},
{0x069e,0x069e,0x069e,0x069e,},
{0x069f,0x069f,0x069f,0x069f,},
{0x06a0,0x06a0,0x06a0,0x06a0,},
{0x06a1,0x06a1,0x06a1,0x06a1,},
{0x06a2,0x06a2,0x06a2,0x06a2,},
{0x06a3,0x06a3,0x06a3,0x06a3,},
{0xfb6a,0xfb6b,0xfb6c,0xfb6d,},
{0x06a5,0x06a5,0x06a5,0x06a5,},
{0xfb6e,0xfb6f,0xfb70,0xfb71,},
{0x06a7,0x06a7,0x06a7,0x06a7,},
{0x06a8,0x06a8,0x06a8,0x06a8,},
{0xfb8e,0xfb8f,0xfb90,0xfb91,},
{0x06aa,0x06aa,0x06aa,0x06aa,},
{0x06ab,0x06ab,0x06ab,0x06ab,},
{0x06ac,0x06ac,0x06ac,0x06ac,},
{0xfbd3,0xfbd4,0xfbd5,0xfbd6,},
{0x06ae,0x06ae,0x06ae,0x06ae,},
{0xfb92,0xfb93,0xfb94,0xfb95,},
{0x06b0,0x06b0,0x06b0,0x06b0,},
{0xfb9a,0xfb9b,0xfb9c,0xfb9d,},
{0x06b2,0x06b2,0x06b2,0x06b2,},
{0xfb96,0xfb97,0xfb98,0xfb99,},
{0x06b4,0x06b4,0x06b4,0x06b4,},
{0x06b5,0x06b5,0x06b5,0x06b5,},
{0x06b6,0x06b6,0x06b6,0x06b6,},
{0x06b7,0x06b7,0x06b7,0x06b7,},
{0x06b8,0x06b8,0x06b8,0x06b8,},
{0x06b9,0x06b9,0x06b9,0x06b9,},
{0xfb9e,0xfb9f,0x06ba,0x06ba,},
{0xfba0,0xfba1,0xfba2,0xfba3,},
{0x06bc,0x06bc,0x06bc,0x06bc,},
{0x06bd,0x06bd,0x06bd,0x06bd,},
{0xfbaa,0xfbab,0xfbac,0xfbad,},
{0x06bf,0x06bf,0x06bf,0x06bf,},
{0xfba4,0xfba5,0x06c0,0x06c0,},
{0xfba6,0xfba7,0xfba8,0xfba9,},
{0x06c2,0x06c2,0x06c2,0x06c2,},
{0x06c3,0x06c3,0x06c3,0x06c3,},
{0x06c4,0x06c4,0x06c4,0x06c4,},
{0xfbe0,0xfbe1,0x06c5,0x06c5,},
{0xfbd9,0xfbda,0x06c6,0x06c6,},
{0xfbd7,0xfbd8,0x06c7,0x06c7,},
{0xfbdb,0xfbdc,0x06c8,0x06c8,},
{0xfbe2,0xfbe3,0x06c9,0x06c9,},
{0x06ca,0x06ca,0x06ca,0x06ca,},
{0xfbde,0xfbdf,0x06cb,0x06cb,},
{0xfbfc,0xfbfd,0xfbfe,0xfbff,},
{0x06cd,0x06cd,0x06cd,0x06cd,},
{0x06ce,0x06ce,0x06ce,0x06ce,},
{0x06cf,0x06cf,0x06cf,0x06cf,},
{0xfbe4,0xfbe5,0xfbe6,0xfbe7,},
{0x06d1,0x06d1,0x06d1,0x06d1,},
{0xfbae,0xfbaf,0x06d2,0x06d2,},
{0xfbb0,0xfbb1,0x06d3,0x06d3,},
};
/* *INDENT-ON* */
#ifndef UNIBIDI_ACCESS_SHAPE_TABLE
# define UNIBIDI_ACCESS_SHAPE_TABLE(table,min,max,x,shape) \
(((x)<(min)||(x)>(max))?(x):(table)[(x)-(min)][(shape)])
#endif
#define UNIBIDI_GET_ARABIC_SHAPE_PRES(x,shape) UNIBIDI_ACCESS_SHAPE_TABLE(ArShap, 0x0621, 0x06d3, (x), (shape))
/* End of generated unicode-arabic-shaping-table.inc */
+433
View File
@@ -0,0 +1,433 @@
/* == Start of generated table == */
/*
* The following table is generated by running:
*
* ./gen-arabic-table.py
*
* on ucd/ArabicShaping.txt ucd/UnicodeData.txt ucd/Blocks.txt files with these headers:
*
* # ArabicShaping-12.0.0.txt
* # Date: 2018-09-22, 23:54:00 GMT [KW, RP]
* # Blocks-12.0.0.txt
* # Date: 2018-07-30, 19:40:00 GMT [KW]
* UnicodeData.txt does not have a header.
*/
#ifndef _MGFONT_UNICODE_ARABIC_SHAPING_TABLES_H
#define _MGFONT_UNICODE_ARABIC_SHAPING_TABLES_H
#define X JOINING_TYPE_X
#define R JOINING_TYPE_R
#define T JOINING_TYPE_T
#define U JOINING_TYPE_U
#define A JOINING_GROUP_ALAPH
#define DR JOINING_GROUP_DALATH_RISH
#define L JOINING_TYPE_L
#define C JOINING_TYPE_C
#define D JOINING_TYPE_D
static const Uint8 joining_table[] =
{
#define joining_offset_0x0600u 0
/* Arabic */
/* 0600 */ U,U,U,U,U,U,X,X,U,X,X,U,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 0620 */ D,U,R,R,R,R,D,R,D,R,D,D,D,D,D,R,R,R,R,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 0640 */ C,D,D,D,D,D,D,D,R,D,D,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 0660 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,D,D,X,R,R,R,U,R,R,R,D,D,D,D,D,D,D,D,
/* 0680 */ D,D,D,D,D,D,D,D,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,D,D,D,D,D,D,
/* 06A0 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 06C0 */ R,D,D,R,R,R,R,R,R,R,R,R,D,R,D,R,D,D,R,R,X,R,X,X,X,X,X,X,X,U,X,X,
/* 06E0 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,R,R,X,X,X,X,X,X,X,X,X,X,D,D,D,X,X,D,
/* Syriac */
/* 0700 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,T,A,X,D,D,D,DR,DR,R,R,R,D,D,D,D,R,D,
/* 0720 */ D,D,D,D,D,D,D,D,R,D,DR,D,R,D,D,DR,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 0740 */ X,X,X,X,X,X,X,X,X,X,X,X,X,R,D,D,
/* Arabic Supplement */
/* 0740 */ D,D,D,D,D,D,D,D,D,R,R,R,D,D,D,D,
/* 0760 */ D,D,D,D,D,D,D,D,D,D,D,R,R,D,D,D,D,R,D,R,R,D,D,D,R,R,D,D,D,D,D,D,
/* FILLER */
/* 0780 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 07A0 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* NKo */
/* 07C0 */ X,X,X,X,X,X,X,X,X,X,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 07E0 */ D,D,D,D,D,D,D,D,D,D,D,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,C,X,X,X,X,X,
/* FILLER */
/* 0800 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 0820 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* Mandaic */
/* 0840 */ R,D,D,D,D,D,R,R,D,R,D,D,D,D,D,D,D,D,D,D,R,D,U,U,U,X,X,X,X,X,X,X,
/* Syriac Supplement */
/* 0860 */ D,U,D,D,D,D,U,R,D,R,R,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 0880 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* Arabic Extended-A */
/* 08A0 */ D,D,D,D,D,D,D,D,D,D,R,R,R,U,R,D,D,R,R,D,D,X,D,D,D,R,D,D,D,D,X,X,
/* 08C0 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 08E0 */ X,X,U,
#define joining_offset_0x1806u 739
/* Mongolian */
/* 1800 */ U,D,X,X,C,X,X,X,U,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 1820 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 1840 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 1860 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,X,X,X,X,X,X,X,
/* 1880 */ U,U,U,U,U,T,T,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 18A0 */ D,D,D,D,D,D,D,D,D,X,D,
#define joining_offset_0x200cu 904
/* General Punctuation */
/* 2000 */ U,C,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 2020 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,U,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 2040 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 2060 */ X,X,X,X,X,X,U,U,U,U,
#define joining_offset_0xa840u 998
/* Phags-pa */
/* A840 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* A860 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,L,U,
#define joining_offset_0x10ac0u 1050
/* Manichaean */
/* 10AC0 */ D,D,D,D,D,R,U,R,U,R,R,U,U,L,R,R,R,R,R,D,D,D,D,L,D,D,D,D,D,R,D,D,
/* 10AE0 */ D,R,U,U,R,X,X,X,X,X,X,D,D,D,D,R,
#define joining_offset_0x10b80u 1098
/* Psalter Pahlavi */
/* 10B80 */ D,R,D,R,R,R,D,D,D,R,D,D,R,D,R,R,D,R,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 10BA0 */ X,X,X,X,X,X,X,X,X,R,R,R,R,D,D,U,
#define joining_offset_0x10d00u 1146
/* Hanifi Rohingya */
/* 10D00 */ L,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 10D20 */ D,D,R,D,
#define joining_offset_0x10f30u 1182
/* Sogdian */
/* 10F20 */ D,D,D,R,D,D,D,D,D,D,D,D,D,D,D,D,
/* 10F40 */ D,D,D,D,D,U,X,X,X,X,X,X,X,X,X,X,X,D,D,D,R,
#define joining_offset_0x110bdu 1219
/* Kaithi */
/* 110A0 */ U,X,X,
/* 110C0 */ X,X,X,X,X,X,X,X,X,X,X,X,X,U,
#define joining_offset_0x1e900u 1236
/* Adlam */
/* 1E900 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 1E920 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 1E940 */ D,D,D,D,X,X,X,X,X,X,X,T,
}; /* Table items: 1312; occupancy: 56% */
static inline BOOL uc_in_range(Uchar32 uc, Uchar32 lo, Uchar32 hi)
{
/* The casts below are important as if T is smaller than int,
* the subtract results will become a signed int! */
return (Uchar32)(u - lo) <= (Uchar32)(hi - lo);
}
static unsigned int
joining_type (Uchar32 u)
{
switch (u >> 12)
{
case 0x0u:
if (uc_in_range(u, 0x0600u, 0x08E2u)) return joining_table[u - 0x0600u + joining_offset_0x0600u];
break;
case 0x1u:
if (uc_in_range(u, 0x1806u, 0x18AAu)) return joining_table[u - 0x1806u + joining_offset_0x1806u];
break;
case 0x2u:
if (uc_in_range(u, 0x200Cu, 0x2069u)) return joining_table[u - 0x200Cu + joining_offset_0x200cu];
break;
case 0xAu:
if (uc_in_range(u, 0xA840u, 0xA873u)) return joining_table[u - 0xA840u + joining_offset_0xa840u];
break;
case 0x10u:
if (uc_in_range(u, 0x10AC0u, 0x10AEFu)) return joining_table[u - 0x10AC0u + joining_offset_0x10ac0u];
if (uc_in_range(u, 0x10B80u, 0x10BAFu)) return joining_table[u - 0x10B80u + joining_offset_0x10b80u];
if (uc_in_range(u, 0x10D00u, 0x10D23u)) return joining_table[u - 0x10D00u + joining_offset_0x10d00u];
if (uc_in_range(u, 0x10F30u, 0x10F54u)) return joining_table[u - 0x10F30u + joining_offset_0x10f30u];
break;
case 0x11u:
if (uc_in_range(u, 0x110BDu, 0x110CDu)) return joining_table[u - 0x110BDu + joining_offset_0x110bdu];
break;
case 0x1Eu:
if (uc_in_range(u, 0x1E900u, 0x1E94Bu)) return joining_table[u - 0x1E900u + joining_offset_0x1e900u];
break;
default:
break;
}
return X;
}
#undef X
#undef R
#undef T
#undef U
#undef A
#undef DR
#undef L
#undef C
#undef D
static const Uint16 shaping_table[][4] =
{
{0x0000u, 0x0000u, 0x0000u, 0xFE80u}, /* U+0621 ARABIC LETTER HAMZA ISOLATED FORM */
{0x0000u, 0x0000u, 0xFE82u, 0xFE81u}, /* U+0622 ARABIC LETTER ALEF WITH MADDA ABOVE */
{0x0000u, 0x0000u, 0xFE84u, 0xFE83u}, /* U+0623 ARABIC LETTER ALEF WITH HAMZA ABOVE */
{0x0000u, 0x0000u, 0xFE86u, 0xFE85u}, /* U+0624 ARABIC LETTER WAW WITH HAMZA ABOVE */
{0x0000u, 0x0000u, 0xFE88u, 0xFE87u}, /* U+0625 ARABIC LETTER ALEF WITH HAMZA BELOW */
{0xFE8Bu, 0xFE8Cu, 0xFE8Au, 0xFE89u}, /* U+0626 ARABIC LETTER YEH WITH HAMZA ABOVE */
{0x0000u, 0x0000u, 0xFE8Eu, 0xFE8Du}, /* U+0627 ARABIC LETTER ALEF */
{0xFE91u, 0xFE92u, 0xFE90u, 0xFE8Fu}, /* U+0628 ARABIC LETTER BEH */
{0x0000u, 0x0000u, 0xFE94u, 0xFE93u}, /* U+0629 ARABIC LETTER TEH MARBUTA */
{0xFE97u, 0xFE98u, 0xFE96u, 0xFE95u}, /* U+062A ARABIC LETTER TEH */
{0xFE9Bu, 0xFE9Cu, 0xFE9Au, 0xFE99u}, /* U+062B ARABIC LETTER THEH */
{0xFE9Fu, 0xFEA0u, 0xFE9Eu, 0xFE9Du}, /* U+062C ARABIC LETTER JEEM */
{0xFEA3u, 0xFEA4u, 0xFEA2u, 0xFEA1u}, /* U+062D ARABIC LETTER HAH */
{0xFEA7u, 0xFEA8u, 0xFEA6u, 0xFEA5u}, /* U+062E ARABIC LETTER KHAH */
{0x0000u, 0x0000u, 0xFEAAu, 0xFEA9u}, /* U+062F ARABIC LETTER DAL */
{0x0000u, 0x0000u, 0xFEACu, 0xFEABu}, /* U+0630 ARABIC LETTER THAL */
{0x0000u, 0x0000u, 0xFEAEu, 0xFEADu}, /* U+0631 ARABIC LETTER REH */
{0x0000u, 0x0000u, 0xFEB0u, 0xFEAFu}, /* U+0632 ARABIC LETTER ZAIN */
{0xFEB3u, 0xFEB4u, 0xFEB2u, 0xFEB1u}, /* U+0633 ARABIC LETTER SEEN */
{0xFEB7u, 0xFEB8u, 0xFEB6u, 0xFEB5u}, /* U+0634 ARABIC LETTER SHEEN */
{0xFEBBu, 0xFEBCu, 0xFEBAu, 0xFEB9u}, /* U+0635 ARABIC LETTER SAD */
{0xFEBFu, 0xFEC0u, 0xFEBEu, 0xFEBDu}, /* U+0636 ARABIC LETTER DAD */
{0xFEC3u, 0xFEC4u, 0xFEC2u, 0xFEC1u}, /* U+0637 ARABIC LETTER TAH */
{0xFEC7u, 0xFEC8u, 0xFEC6u, 0xFEC5u}, /* U+0638 ARABIC LETTER ZAH */
{0xFECBu, 0xFECCu, 0xFECAu, 0xFEC9u}, /* U+0639 ARABIC LETTER AIN */
{0xFECFu, 0xFED0u, 0xFECEu, 0xFECDu}, /* U+063A ARABIC LETTER GHAIN */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+063B */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+063C */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+063D */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+063E */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+063F */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0640 */
{0xFED3u, 0xFED4u, 0xFED2u, 0xFED1u}, /* U+0641 ARABIC LETTER FEH */
{0xFED7u, 0xFED8u, 0xFED6u, 0xFED5u}, /* U+0642 ARABIC LETTER QAF */
{0xFEDBu, 0xFEDCu, 0xFEDAu, 0xFED9u}, /* U+0643 ARABIC LETTER KAF */
{0xFEDFu, 0xFEE0u, 0xFEDEu, 0xFEDDu}, /* U+0644 ARABIC LETTER LAM */
{0xFEE3u, 0xFEE4u, 0xFEE2u, 0xFEE1u}, /* U+0645 ARABIC LETTER MEEM */
{0xFEE7u, 0xFEE8u, 0xFEE6u, 0xFEE5u}, /* U+0646 ARABIC LETTER NOON */
{0xFEEBu, 0xFEECu, 0xFEEAu, 0xFEE9u}, /* U+0647 ARABIC LETTER HEH */
{0x0000u, 0x0000u, 0xFEEEu, 0xFEEDu}, /* U+0648 ARABIC LETTER WAW */
{0xFBE8u, 0xFBE9u, 0xFEF0u, 0xFEEFu}, /* U+0649 ARABIC LETTER */
{0xFEF3u, 0xFEF4u, 0xFEF2u, 0xFEF1u}, /* U+064A ARABIC LETTER YEH */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+064B */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+064C */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+064D */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+064E */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+064F */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0650 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0651 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0652 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0653 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0654 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0655 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0656 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0657 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0658 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0659 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+065A */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+065B */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+065C */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+065D */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+065E */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+065F */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0660 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0661 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0662 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0663 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0664 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0665 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0666 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0667 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0668 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0669 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+066A */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+066B */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+066C */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+066D */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+066E */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+066F */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0670 */
{0x0000u, 0x0000u, 0xFB51u, 0xFB50u}, /* U+0671 ARABIC LETTER ALEF WASLA */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0672 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0673 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0674 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0675 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0676 */
{0x0000u, 0x0000u, 0x0000u, 0xFBDDu}, /* U+0677 ARABIC LETTER U WITH HAMZA ABOVE ISOLATED FORM */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0678 */
{0xFB68u, 0xFB69u, 0xFB67u, 0xFB66u}, /* U+0679 ARABIC LETTER TTEH */
{0xFB60u, 0xFB61u, 0xFB5Fu, 0xFB5Eu}, /* U+067A ARABIC LETTER TTEHEH */
{0xFB54u, 0xFB55u, 0xFB53u, 0xFB52u}, /* U+067B ARABIC LETTER BEEH */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+067C */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+067D */
{0xFB58u, 0xFB59u, 0xFB57u, 0xFB56u}, /* U+067E ARABIC LETTER PEH */
{0xFB64u, 0xFB65u, 0xFB63u, 0xFB62u}, /* U+067F ARABIC LETTER TEHEH */
{0xFB5Cu, 0xFB5Du, 0xFB5Bu, 0xFB5Au}, /* U+0680 ARABIC LETTER BEHEH */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0681 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0682 */
{0xFB78u, 0xFB79u, 0xFB77u, 0xFB76u}, /* U+0683 ARABIC LETTER NYEH */
{0xFB74u, 0xFB75u, 0xFB73u, 0xFB72u}, /* U+0684 ARABIC LETTER DYEH */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0685 */
{0xFB7Cu, 0xFB7Du, 0xFB7Bu, 0xFB7Au}, /* U+0686 ARABIC LETTER TCHEH */
{0xFB80u, 0xFB81u, 0xFB7Fu, 0xFB7Eu}, /* U+0687 ARABIC LETTER TCHEHEH */
{0x0000u, 0x0000u, 0xFB89u, 0xFB88u}, /* U+0688 ARABIC LETTER DDAL */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0689 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+068A */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+068B */
{0x0000u, 0x0000u, 0xFB85u, 0xFB84u}, /* U+068C ARABIC LETTER DAHAL */
{0x0000u, 0x0000u, 0xFB83u, 0xFB82u}, /* U+068D ARABIC LETTER DDAHAL */
{0x0000u, 0x0000u, 0xFB87u, 0xFB86u}, /* U+068E ARABIC LETTER DUL */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+068F */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0690 */
{0x0000u, 0x0000u, 0xFB8Du, 0xFB8Cu}, /* U+0691 ARABIC LETTER RREH */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0692 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0693 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0694 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0695 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0696 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0697 */
{0x0000u, 0x0000u, 0xFB8Bu, 0xFB8Au}, /* U+0698 ARABIC LETTER JEH */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+0699 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+069A */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+069B */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+069C */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+069D */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+069E */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+069F */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06A0 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06A1 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06A2 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06A3 */
{0xFB6Cu, 0xFB6Du, 0xFB6Bu, 0xFB6Au}, /* U+06A4 ARABIC LETTER VEH */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06A5 */
{0xFB70u, 0xFB71u, 0xFB6Fu, 0xFB6Eu}, /* U+06A6 ARABIC LETTER PEHEH */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06A7 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06A8 */
{0xFB90u, 0xFB91u, 0xFB8Fu, 0xFB8Eu}, /* U+06A9 ARABIC LETTER KEHEH */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06AA */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06AB */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06AC */
{0xFBD5u, 0xFBD6u, 0xFBD4u, 0xFBD3u}, /* U+06AD ARABIC LETTER NG */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06AE */
{0xFB94u, 0xFB95u, 0xFB93u, 0xFB92u}, /* U+06AF ARABIC LETTER GAF */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06B0 */
{0xFB9Cu, 0xFB9Du, 0xFB9Bu, 0xFB9Au}, /* U+06B1 ARABIC LETTER NGOEH */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06B2 */
{0xFB98u, 0xFB99u, 0xFB97u, 0xFB96u}, /* U+06B3 ARABIC LETTER GUEH */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06B4 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06B5 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06B6 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06B7 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06B8 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06B9 */
{0x0000u, 0x0000u, 0xFB9Fu, 0xFB9Eu}, /* U+06BA ARABIC LETTER NOON GHUNNA */
{0xFBA2u, 0xFBA3u, 0xFBA1u, 0xFBA0u}, /* U+06BB ARABIC LETTER RNOON */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06BC */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06BD */
{0xFBACu, 0xFBADu, 0xFBABu, 0xFBAAu}, /* U+06BE ARABIC LETTER HEH DOACHASHMEE */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06BF */
{0x0000u, 0x0000u, 0xFBA5u, 0xFBA4u}, /* U+06C0 ARABIC LETTER HEH WITH YEH ABOVE */
{0xFBA8u, 0xFBA9u, 0xFBA7u, 0xFBA6u}, /* U+06C1 ARABIC LETTER HEH GOAL */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06C2 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06C3 */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06C4 */
{0x0000u, 0x0000u, 0xFBE1u, 0xFBE0u}, /* U+06C5 ARABIC LETTER KIRGHIZ OE */
{0x0000u, 0x0000u, 0xFBDAu, 0xFBD9u}, /* U+06C6 ARABIC LETTER OE */
{0x0000u, 0x0000u, 0xFBD8u, 0xFBD7u}, /* U+06C7 ARABIC LETTER U */
{0x0000u, 0x0000u, 0xFBDCu, 0xFBDBu}, /* U+06C8 ARABIC LETTER YU */
{0x0000u, 0x0000u, 0xFBE3u, 0xFBE2u}, /* U+06C9 ARABIC LETTER KIRGHIZ YU */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06CA */
{0x0000u, 0x0000u, 0xFBDFu, 0xFBDEu}, /* U+06CB ARABIC LETTER VE */
{0xFBFEu, 0xFBFFu, 0xFBFDu, 0xFBFCu}, /* U+06CC ARABIC LETTER FARSI YEH */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06CD */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06CE */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06CF */
{0xFBE6u, 0xFBE7u, 0xFBE5u, 0xFBE4u}, /* U+06D0 ARABIC LETTER E */
{0x0000u, 0x0000u, 0x0000u, 0x0000u}, /* U+06D1 */
{0x0000u, 0x0000u, 0xFBAFu, 0xFBAEu}, /* U+06D2 ARABIC LETTER YEH BARREE */
{0x0000u, 0x0000u, 0xFBB1u, 0xFBB0u}, /* U+06D3 ARABIC LETTER YEH BARREE WITH HAMZA ABOVE */
};
#define SHAPING_TABLE_FIRST 0x0621u
#define SHAPING_TABLE_LAST 0x06D3u
static const struct ligature_set_t {
Uint16 first;
struct ligature_pairs_t {
Uint16 second;
Uint16 ligature;
} ligatures[4];
} ligature_table[] =
{
{ 0xFEDFu, {
{ 0xFE88u, 0xFEF9u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM */
{ 0xFE82u, 0xFEF5u }, /* ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM */
{ 0xFE8Eu, 0xFEFBu }, /* ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM */
{ 0xFE84u, 0xFEF7u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM */
}},
{ 0xFEE0u, {
{ 0xFE88u, 0xFEFAu }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM */
{ 0xFE82u, 0xFEF6u }, /* ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM */
{ 0xFE8Eu, 0xFEFCu }, /* ARABIC LIGATURE LAM WITH ALEF FINAL FORM */
{ 0xFE84u, 0xFEF8u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM */
}},
};
#endif /* _MGFONT_UNICODE_ARABIC_SHAPING_TABLES_H */
/* == End of generated table == */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+110
View File
@@ -0,0 +1,110 @@
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2019, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Or,
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
/*
** mgbidi-bidi-types-list.inc:
**
** The list of BIDI types
**
** Created by WEI Yongming at 2019/03/08
**
** This implementation is based on LGPL'd FriBidi:
**
** https://github.com/fribidi/fribidi
*/
#ifndef _UNIBIDI_ADD_TYPE
# define _UNIBIDI_ADD_TYPE(x,y)
#endif
#ifndef _UNIBIDI_ADD_ALIAS
# define _UNIBIDI_ADD_ALIAS(x1,x2)
#endif
#if !defined(_UNIBIDI_PAR_TYPES) || defined(_UNIBIDI_ALL_TYPES)
_UNIBIDI_ADD_TYPE (LTR, 'L') /* Left-To-Right letter */
_UNIBIDI_ADD_TYPE (RTL, 'R') /* Right-To-Left letter */
_UNIBIDI_ADD_TYPE (AL, 'A') /* Arabic Letter */
_UNIBIDI_ADD_TYPE (EN, '1') /* European Numeral */
_UNIBIDI_ADD_TYPE (AN, '9') /* Arabic Numeral */
_UNIBIDI_ADD_TYPE (ES, 'w') /* European number Separator */
_UNIBIDI_ADD_TYPE (ET, 'w') /* European number Terminator */
_UNIBIDI_ADD_TYPE (CS, 'w') /* Common Separator */
_UNIBIDI_ADD_TYPE (NSM, '`') /* Non Spacing Mark */
_UNIBIDI_ADD_TYPE (BN, 'b') /* Boundary Neutral */
_UNIBIDI_ADD_TYPE (BS, 'B') /* Block Separator */
_UNIBIDI_ADD_TYPE (SS, 'S') /* Segment Separator */
_UNIBIDI_ADD_TYPE (WS, '_') /* WhiteSpace */
_UNIBIDI_ADD_TYPE (ON, 'n') /* Other Neutral */
_UNIBIDI_ADD_TYPE (LRE, '+') /* Left-to-Right Embedding */
_UNIBIDI_ADD_TYPE (RLE, '+') /* Right-to-Left Embedding */
_UNIBIDI_ADD_TYPE (LRO, '+') /* Left-to-Right Override */
_UNIBIDI_ADD_TYPE (RLO, '+') /* Right-to-Left Override */
_UNIBIDI_ADD_TYPE (PDF, '-') /* Pop Directional Flag */
_UNIBIDI_ADD_TYPE (LRI, '+') /* Left-to-Right Isolate */
_UNIBIDI_ADD_TYPE (RLI, '+') /* Right-to-Left Isolate */
_UNIBIDI_ADD_TYPE (FSI, '+') /* First-Strong Isolate */
_UNIBIDI_ADD_TYPE (PDI, '-') /* Pop Directional Isolate */
#if defined(_UNIBIDI_ADD_ALIAS)
_UNIBIDI_ADD_ALIAS (L, LTR)
_UNIBIDI_ADD_ALIAS (R, RTL)
_UNIBIDI_ADD_ALIAS (B, BS)
_UNIBIDI_ADD_ALIAS (S, SS)
#endif /* _UNIBIDI_ADD_ALIAS */
#if defined(_UNIBIDI_SENTINEL_TYPE) || defined(_UNIBIDI_ALL_TYPES)
_UNIBIDI_ADD_TYPE (SENTINEL, '$') /* SENTINEL */
#endif /* _UNIBIDI_SENTINEL_TYPES || _UNIBIDI_ALL_TYPES*/
#endif /* !_UNIBIDI_PAR_TYPES || _UNIBIDI_ALL_TYPES */
#if defined(_UNIBIDI_PAR_TYPES) || defined(_UNIBIDI_ALL_TYPES)
# if !defined(_UNIBIDI_ALL_TYPES)
_UNIBIDI_ADD_TYPE (LTR, 'L') /* Left-To-Right paragraph */
_UNIBIDI_ADD_TYPE (RTL, 'R') /* Right-To-Left paragraph */
_UNIBIDI_ADD_TYPE (ON, 'n') /* directiOn-Neutral paragraph */
# endif /* !_UNIBIDI_ALL_TYPES */
_UNIBIDI_ADD_TYPE (WLTR, 'l') /* Weak Left To Right paragraph */
_UNIBIDI_ADD_TYPE (WRTL, 'r') /* Weak Right To Left paragraph */
#endif /* _UNIBIDI_PAR_TYPES || _UNIBIDI_ALL_TYPES*/
#if defined(_UNIBIDI_ENUM_TYPES)
typedef enum {
# define _UNIBIDI_ADD_TYPE _UNIBIDI_ENUM_ADD_TYPE
# include "mgbidi-bidi-types-list.h"
# undef _UNIBIDI_ADD_TYPE
_UNIBIDI_TYPES_MAX
} _UNIBIDI_ENUM_TYPES
#endif /* _UNIBIDI_ENUM_TYPES */

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