This commit is contained in:
Vincent Wei
2019-02-24 13:35:43 +08:00
parent c51ae8d1c1
commit 9bcea02975
14 changed files with 157 additions and 150 deletions
+130 -126
View File
@@ -1,39 +1,39 @@
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Or,
*
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
/*
** charset.c: The charset's arabic operation set.
**
**
** Created by houhuihua at 2008/01/23
*/
#ifdef _MGCHARSET_ARABIC
@@ -123,19 +123,19 @@ static unsigned short iso8859_68x_unicode_map [] =
0xFEEF, 0xFE94, 0xFEB2, 0xFEB6, /*0x8D~0x90*/
0xFEBA, 0xFEBE, 0xFEC2, 0xFEC8, /*0x93~0x94*/
0xFECC, 0xFECA, 0xFED0, 0xFECE,
0xFED4, 0xFED8, 0xFEDC, 0xFEEC,
0xFED4, 0xFED8, 0xFEDC, 0xFEEC,
0xFEEA, 0xFEF1, 0xFE89, 0x0020,
/*two cell ligature.*/
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, /*0xA1~0xA4*/
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, /*0xA1~0xA4*/
0xFFFF, 0xFFFF, 0xFFFF, /*0xA5~0xA7*/
0xFE70, 0xFE72, 0xFE74, 0xFE76, /*0xA8~0xAB*/
0xFE78, 0xFE7A, 0xFE7C, 0xFE7E, /*0xAC~0xAF*/
0x0660, 0x0661, 0x0662, 0x0663, /*0~9*/
0x0664, 0x0665, 0x0666, 0x0667,
0x0668, 0x0669, 0x060C, 0x061B,
0x0664, 0x0665, 0x0666, 0x0667,
0x0668, 0x0669, 0x060C, 0x061B,
0xFE71, 0xFE72, 0xFE74, 0x061F, /*0xBD~0xBF*/
0xFE8B, 0xFE80, /*0xC0,0xC1*/
0xFE81, 0xFE83, 0xFE85, 0xFE87, /*0xC2~0xC5*/
0xFE8A, 0xFE8D, 0xFE8F, 0xFE93, /*0xC6~0xC9*/
@@ -160,16 +160,16 @@ static unsigned short iso8859_68x_unicode_map [] =
0xFE86, 0xFE88, 0xFE8C, 0xFE8E, /*0x104~0x107*/
0xFE90, 0xFE96, 0xFE9A, 0xFE9E, /*0x108~0x10B*/
0xFEA2, 0xFEA6, 0xFEAA, 0xFEAC, /*0x10C~0x10F*/
0xFEAE, 0xFEB0, 0xFEC3, 0xFEC7, /*0x110~0x113*/
0xFED2, 0xFED6, 0xFEDA, 0xFEDE, /*0x114~0x117*/
0xFEE2, 0xFEE6, 0xFEEA, 0xFEEE, /*0x118~0x11B*/
0xFEF0, 0xFEF2, 0xFE92, 0xFE98, /*0x11C~0x11F*/
0xFE9C, 0xFEA0, 0xFEA4, 0xFEA8, /*0x120~0x123*/
0xFEB4, 0xFEB8, 0xFEBC, 0xFEC0, /*0x124~0x127*/
0xFEE0, 0xFEE4, 0xFEE8, 0xFEF4, /*0x128~0x12B*/
0xFEFB, 0xFEFC, 0xFEF5, 0xFEF6, /*0x12C~0x12F*/
0xFEF7, 0xFEF8, 0xFEF9, 0xFEFA, /*0x130~0x133*/
};
@@ -180,7 +180,7 @@ static Uchar32 iso8859_6_conv_to_uc32 (Glyph32 glyph_value)
return (Glyph32) (glyph_value);
else if (glyph_value <= MAX_GLYPH_VALUE )
return (Glyph32) iso8859_68x_unicode_map[glyph_value - 0x81];
else
else
return 0xFFFF;
}
@@ -359,7 +359,7 @@ static int fontset_68x_get_tadweel_glyph(unsigned char c, unsigned char next, in
{
int ligature = -1;
if(c == SHADDA){
/* TADWEEL combine with two vowel except SUKUN
/* TADWEEL combine with two vowel except SUKUN
* can not combine with SHADDA.*/
switch(next){
case FATHATAN: *ignore = 2; ligature = 0x87; break;
@@ -389,7 +389,7 @@ static int fontset_68x_get_tadweel_glyph(unsigned char c, unsigned char next, in
}
#ifndef _DEBUG
static
static
#endif
int get_ligature(const unsigned char* mchar, int len, BOOL prev_affects_joining, int* ignore)
{
@@ -399,10 +399,10 @@ int get_ligature(const unsigned char* mchar, int len, BOOL prev_affects_joining,
if(ignore) *ignore = 0;
cur_char = *mchar;
ligature = fontset_68x_get_punpoint_glyph(cur_char);
if(ligature > 0) return ligature;
if(len == 1){
if (ISARABIC_VOWEL(cur_char)){
ligature = fontset_68x_get_vowel_glyph(cur_char);
@@ -418,7 +418,7 @@ int get_ligature(const unsigned char* mchar, int len, BOOL prev_affects_joining,
}
else if (cur_char == LAM) { /* LAM+ALEF+HAMAZ+MADDA ligature. */
ligature = fontset_68x_get_ligature_glyph(next, prev_affects_joining, ignore);
}
}
else if(cur_char == TADWEEL){ /* TADWEEL combine with VOWEL*/
if(len > 2) next_next = *(mchar+2);
else next_next = 0;
@@ -447,7 +447,7 @@ static int iso8859_6_len_first_char (const unsigned char* mstr, int len)
return 2;
else if (ignore == 2)
return 3;
else
else
return 1;
}
@@ -469,121 +469,121 @@ static unsigned int iso8859_6_glyph_type (Glyph32 glyph_value)
}
static Uint32 __mg_iso8859_68x_type[] = {
/*0x00~0x0f*/
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_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YPE_AL, BIDI_TYPE_AL,
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
/*0x130~0x133*/
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
/*0x130~0x133*/
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
};
static unsigned int iso8859_6_bidi_glyph_type (Glyph32 glyph_value)
@@ -652,7 +652,11 @@ static int get_next_char(const unsigned char* mchar, int len)
return next_char;
}
Glyph32 iso8859_6_char_glyph_value (const unsigned char* prev_mchar, int prev_len, const unsigned char* mchar, int len)
#ifndef _DEBUG
static
#endif
Glyph32 iso8859_6_char_glyph_value (const unsigned char* prev_mchar,
int prev_len, const unsigned char* mchar, int len)
{
BOOL next_affects_joining = FALSE, prev_affects_joining = FALSE;
int char_index, prev_index;
@@ -666,27 +670,27 @@ Glyph32 iso8859_6_char_glyph_value (const unsigned char* prev_mchar, int prev_le
char_index = get_table_index(*mchar);
/*current glyph has no transfiguration and has no ligature*/
if (char_index < 0 && !ISARABIC_PUNC(*mchar)
if (char_index < 0 && !ISARABIC_PUNC(*mchar)
&& !ISARABIC_VOWEL(*mchar) && !(*mchar == TADWEEL)) {
return *mchar;
}
if(prev_mchar){
if (prev_mchar) {
prev_index = get_table_index(*prev_mchar);
prev_affects_joining = ( prev_index >= 0 || is_char_transparent(*prev_mchar)) && (shape_info[prev_index].medial);
prev_affects_joining = (prev_index >= 0 || is_char_transparent(*prev_mchar)) && (shape_info[prev_index].medial);
// NUV prev_char = *prev_mchar;
/*houhh 20080505, check if ligature. */
if(prev_affects_joining) {
ligature = get_ligature(prev_mchar, prev_len, 1, &ignore);
if(ligature > 0)
prev_affects_joining = 0;
if(ligature > 0)
prev_affects_joining = 0;
}
}
/* processing ligature first.*/
ligature = get_ligature(mchar, len, prev_affects_joining, &ignore);
if (ligature > 0)
if (ligature > 0)
return ligature;
/* if not ligature char, get it's relative shape from shape_info table.*/
@@ -698,27 +702,27 @@ Glyph32 iso8859_6_char_glyph_value (const unsigned char* prev_mchar, int prev_le
return shape_info[char_index].isolated;
}
/* 2.only next char affect,if has Initial,return Initial; else return Isolated */
else if ((!prev_affects_joining) && (next_affects_joining)) {
else if ((!prev_affects_joining) && (next_affects_joining)) {
initial = shape_info[char_index].initial;
if (initial)
if (initial)
return initial;
else
return shape_info[char_index].isolated;
}
/* 3.prev and next char affect all,if has Medial, return Medial; else Isolated */
else if ((prev_affects_joining) && (next_affects_joining)) {
medial = shape_info[char_index].medial;
if (medial)
return medial;
else
else
return shape_info[char_index].isolated;
}
}
/* 3.prev and next char affect all,if has Medial, return Medial; else Isolated */
else if ((prev_affects_joining) && (next_affects_joining)) {
medial = shape_info[char_index].medial;
if (medial)
return medial;
else
return shape_info[char_index].isolated;
}
/* 4.only prev char affect,if has Final, return Final; else Isolated */
else if ((prev_affects_joining) && (!next_affects_joining)) {
else if ((prev_affects_joining) && (!next_affects_joining)) {
final = shape_info[char_index].final;
if (final)
return final;
else
else
return shape_info[char_index].isolated;
}
@@ -760,15 +764,15 @@ static const unsigned char* iso8859_6_get_next_word (const unsigned char* mstr,
word_info->len++;
}
}
return mstr + word_info->len + word_info->nr_delimiters;
//return sb_get_next_word(mstr, mstrlen, word_info);
}
/*if cur_len>1, search ligature shape,
/*if cur_len>1, search ligature shape,
* else search letter or phonetic symbol shape*/
static Glyph32 iso8859_6_glyph_shape (const unsigned char* cur_mchar,
static Glyph32 iso8859_6_glyph_shape (const unsigned char* cur_mchar,
int cur_len, int shape_type)
{
Glyph32 glyph_value = -1;
@@ -815,7 +819,7 @@ static Glyph32 iso8859_6_glyph_shape (const unsigned char* cur_mchar,
}
}
if (glyph_value == 0)
if (glyph_value == 0)
glyph_value =-1;
return glyph_value;
@@ -864,7 +868,7 @@ static CHARSETOPS CharsetOps_iso8859_6 = {
};
#ifdef _DEBUG
int test_glyph_value (int char_index, Glyph32 glyph_value)
int iso8859_6_test_glyph_value (int char_index, Glyph32 glyph_value)
{
int i = 0;
for (i = 0; i<SHAPENUMBER; i++) {
+1 -1
View File
@@ -3464,7 +3464,7 @@ static int utf8_len_first_char (const unsigned char* mstr, int len)
}
static Glyph32 utf8_char_glyph_value (const unsigned char* pre_mchar, int pre_len,
const unsigned char* cur_mchar, int cur_len)
const unsigned char* cur_mchar, int cur_len)
{
Uchar32 wc = *((unsigned char *)(cur_mchar++));
int n, t;
+1 -2
View File
@@ -6,8 +6,7 @@ u:arabic_test_unicode
hex:arabic_test_hex
MINIGUI_COMMON = /usr/local/include/minigui
LIBS = -lminigui_ths -lm -ljpeg -lz -lpng -lpthread -lttf
#LIBS = -lminigui_ths -lm -ljpeg -lz -lpng -lpthread -lfreetype
LIBS = -lminigui_ths -lm -ljpeg -lz -lpng -lpthread -lfreetype
arabic_test:arabic_test.c $(MINIGUI_COMMON)
gcc arabic_test.c -Wall -g -o arabic_test $(LIBS)
+1 -1
View File
@@ -149,7 +149,7 @@ void read_total_file( void )
fclose (fp);
}
static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT HelloWinProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
switch (message) {
+1 -1
View File
@@ -104,7 +104,7 @@ static int test_correctness ()
glyph_value = iso8859_6_char_glyph_value (NULL, 0, c, 1);
fprintf (stderr, "%x 's glyph value = %x\n", *c, glyph_value);
if (!test_glyph_value (index, glyph_value)) {
if (!iso8859_6_test_glyph_value (index, glyph_value)) {
fprintf (stderr, "Shape error: %x\n", *c);
return 0;
}
+3 -3
View File
@@ -6,13 +6,13 @@ helloworld:helloworld.c
gcc helloworld.c -Wall -g -o helloworld -lminigui_ths -lm -ljpeg -lz -lfreetype -lpng -lpthread
hebrew_test:hebrew_test.c
gcc hebrew_test.c -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lttf -lpng -lpthread
gcc hebrew_test.c -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lfreetype -lpng -lpthread
hebrew_test_release:hebrew_test.c
gcc hebrew_test.c -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lttf -lpng -lpthread
gcc hebrew_test.c -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lfreetype -lpng -lpthread
hebrew_test_debug:hebrew_test.c
gcc hebrew_test.c -DARABIC_DEBUG -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lttf -lpng -lpthread
gcc hebrew_test.c -DARABIC_DEBUG -g -o hebrew_test -lminigui_ths -lm -ljpeg -lz -lfreetype -lpng -lpthread
hebrew_test_unicode:hebrew_test.c
gcc hebrew_test.c -DARABIC_UNICODE -DARABIC_DEBUG -g -o hebrew_test_u -lminigui_ths -lm -lfreetype -ljpeg -lz -lpng -lpthread
+13 -13
View File
@@ -59,23 +59,23 @@ char filename[256];
char fontname[50];
BOOL textout = TRUE;
RECT arabic_rc = {0, 0, 640, 480};
RECT hebrew_rc = {0, 0, 640, 480};
int line_num = 0;
static char msg_text [256] = "Show text with TextOut.";
static FILE *fp = NULL;
static PLOGFONT logfont_iso8859_8;
//static char arabic_text[] = {0xc7,0xe4,0xe1,0xd1,0xea,0xe2,0xa0,0xc7,0xe4,0xca,0xe2,0xe6,0xea,0x00};
//static char hebrew_text[] = {0xc7,0xe4,0xe1,0xd1,0xea,0xe2,0xa0,0xc7,0xe4,0xca,0xe2,0xe6,0xea,0x00};
static int reset_fp_pos()
{
arabic_rc.left = 0;
arabic_rc.top = 0;
arabic_rc.right = g_rcScr.right - 24;
arabic_rc.bottom = g_rcScr.bottom;
hebrew_rc.left = 0;
hebrew_rc.top = 0;
hebrew_rc.right = g_rcScr.right - 24;
hebrew_rc.bottom = g_rcScr.bottom;
if(!fp){
DBGLOG2("============================= arabic_test %s===============================\n", filename);
DBGLOG2("============================= hebrew_test %s===============================\n", filename);
fp = fopen(filename, "rb");
if (!fp) {
DBGLOG2("cannot open %s\n", filename);
@@ -140,7 +140,7 @@ void read_total_file( void )
fclose (fp);
}
static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT HelloWinProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
switch (message) {
@@ -196,13 +196,13 @@ static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
if(textout == TRUE) {
if(GetTextAlign(hdc) == TA_RIGHT)
TextOut(hdc, arabic_rc.right, i*line_height, pline);
TextOut(hdc, hebrew_rc.right, i*line_height, pline);
else
TextOut(hdc, arabic_rc.left, i*line_height, pline);
TextOut(hdc, hebrew_rc.left, i*line_height, pline);
}
else{
int height = DrawText(hdc, pline, -1, &arabic_rc, DT_RIGHT);
arabic_rc.top += height;
int height = DrawText(hdc, pline, -1, &hebrew_rc, DT_RIGHT);
hebrew_rc.top += height;
}
i++;
}
@@ -210,7 +210,7 @@ static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
/*
else{
read_total_file();
DrawText(hdc, filebuf, -1, &arabic_rc, DT_RIGHT);
DrawText(hdc, filebuf, -1, &hebrew_rc, DT_RIGHT);
}
*/
#endif
View File
View File
View File
View File
View File
+4
View File
@@ -42,6 +42,8 @@
#include <string.h>
#include <assert.h>
#define DEBUG
#include "common.h"
#ifdef _MGFONT_VBF
@@ -177,6 +179,8 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
int offset;
offset = glyph_value - vbf_info->first_glyph;
_DBG_PRINTF("%s: GV(%x) OFFSET(%d)\n",
__FUNCTION__, glyph_value, offset);
if (px) {
tempint = vbf_info->bbox[offset].x;
+3 -3
View File
@@ -496,7 +496,7 @@ int _gdi_reorder_text (PDC pdc, const unsigned char* text, int text_len,
i = _gdi_output_visual_glyphs (pdc, logical_glyphs, nr_glyphs,
direction, cb_one_glyph, context);
}
else if(!direction){
else if (!direction) {
/* not need reorder glyphs, right to left, should alloc
* glyphs range. */
logical_glyphs = _gdi_get_glyphs_string(pdc, text, text_len,
@@ -516,7 +516,7 @@ int _gdi_reorder_text (PDC pdc, const unsigned char* text, int text_len,
free(logical_glyphs);
}
}
else{
else {
if (!direction) { /* right to left, reverse text.*/
for (i = text_len - 1; i >= 0; i--) {
if (!(glyph_value = sbc_devfont->charset_ops->char_glyph_value
@@ -526,7 +526,7 @@ int _gdi_reorder_text (PDC pdc, const unsigned char* text, int text_len,
glyph_type = sbc_devfont->charset_ops->glyph_type
(glyph_value);
if(!cb_one_glyph (context, glyph_value, glyph_type))
if (!cb_one_glyph (context, glyph_value, glyph_type))
break;
}
}