mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-26 12:27:58 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef713488e3 | ||
|
|
60200cbbcd | ||
|
|
6dec838cd8 | ||
|
|
2ccb876134 | ||
|
|
d9da7747d0 | ||
|
|
e48af7072a | ||
|
|
210e996b56 | ||
|
|
0d0246adbe |
@@ -32,3 +32,5 @@ m4/*.m4
|
|||||||
/src/sysres/font_list
|
/src/sysres/font_list
|
||||||
/src/sysres/license/dat_files/
|
/src/sysres/license/dat_files/
|
||||||
/configure~
|
/configure~
|
||||||
|
.cache
|
||||||
|
compile_commands.json
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ static unsigned short iso8859_68x_unicode_map [] =
|
|||||||
0xFEB3, 0xFEB7, 0xFEBB, 0xFEBF, /*0xF1~0xF4*/
|
0xFEB3, 0xFEB7, 0xFEBB, 0xFEBF, /*0xF1~0xF4*/
|
||||||
0xFECB, 0xFECF, 0xFED3, 0xFED7, /*0xF5~0xF8*/
|
0xFECB, 0xFECF, 0xFED3, 0xFED7, /*0xF5~0xF8*/
|
||||||
0xFEDB, 0xFEDF, 0xFEE3, 0xFEE7, /*0xF9~0xFC*/
|
0xFEDB, 0xFEDF, 0xFEE3, 0xFEE7, /*0xF9~0xFC*/
|
||||||
0xFEEB, 0xFEF3, 0xFFFF, /*0xFD~0xFF*/
|
0xFEEB, 0xFEF4, 0xFFFF, /*0xFD~0xFF*/
|
||||||
|
|
||||||
0xFEC4, 0xFEC6, 0xFE82, 0xFE84, /*0x100~0x103*/
|
0xFEC4, 0xFEC6, 0xFE82, 0xFE84, /*0x100~0x103*/
|
||||||
0xFE86, 0xFE88, 0xFE8C, 0xFE8E, /*0x104~0x107*/
|
0xFE86, 0xFE88, 0xFE8C, 0xFE8E, /*0x104~0x107*/
|
||||||
@@ -576,7 +576,7 @@ static BidiType __mg_iso8859_6_bidi_char_type_map[] = {
|
|||||||
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, 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, BIDI_TYPE_AL, BIDI_TYPE_AL,
|
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_ON,
|
||||||
|
|
||||||
/*0xf0~0xff*/
|
/*0xf0~0xff*/
|
||||||
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
|
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
|
||||||
|
|||||||
+9
-110
@@ -286,7 +286,7 @@ static TYPERUN* get_runtype_link (const CHARSETOPS* charset_ops, Achar32* achars
|
|||||||
last = list;
|
last = list;
|
||||||
|
|
||||||
for (i = 0; i < len; i++){
|
for (i = 0; i < len; i++){
|
||||||
if ((type = charset_ops->bidi_char_type (REAL_ACHAR(achars[i]))) != last->type){
|
if ((type = charset_ops->bidi_char_type (achars[i])) != last->type){
|
||||||
link = calloc(1, sizeof(TYPERUN));
|
link = calloc(1, sizeof(TYPERUN));
|
||||||
link->type = type;
|
link->type = type;
|
||||||
link->pos = i;
|
link->pos = i;
|
||||||
@@ -456,7 +456,7 @@ static void bidi_resolveWeak(TYPERUN **ptype_rl_list, Uint32 base_dir)
|
|||||||
prev_type_org = TYPE(pp);
|
prev_type_org = TYPE(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
compact_list (type_rl_list);
|
compact_neutrals (type_rl_list);
|
||||||
|
|
||||||
#ifdef BIDI_DEBUG
|
#ifdef BIDI_DEBUG
|
||||||
print_run_types(type_rl_list);
|
print_run_types(type_rl_list);
|
||||||
@@ -469,115 +469,19 @@ static void bidi_resolveWeak(TYPERUN **ptype_rl_list, Uint32 base_dir)
|
|||||||
#define BIDI_EMBEDDING_DIR(list) BIDI_LEVEL_TO_DIR(LEVEL(list))
|
#define BIDI_EMBEDDING_DIR(list) BIDI_LEVEL_TO_DIR(LEVEL(list))
|
||||||
|
|
||||||
/* 4.Resolving Neutral Types */
|
/* 4.Resolving Neutral Types */
|
||||||
static void bidi_resolveNeutrals(const CHARSETOPS* charset_ops, Achar32* achars, int len,
|
static void bidi_resolveNeutrals(TYPERUN **ptype_rl_list, Uint32 base_bir)
|
||||||
TYPERUN **ptype_rl_list, Uint32 base_bir)
|
|
||||||
{
|
{
|
||||||
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
|
TYPERUN *type_rl_list = *ptype_rl_list, *pp = NULL;
|
||||||
Uint32* bracket_types = NULL;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (charset_ops->bidi_mirror_char && achars && len > 0) {
|
|
||||||
typedef struct {
|
|
||||||
int pos;
|
|
||||||
Achar32 mirror;
|
|
||||||
} BRSTACK;
|
|
||||||
|
|
||||||
BRSTACK* stack = NULL;
|
|
||||||
int top = 0;
|
|
||||||
|
|
||||||
bracket_types = calloc(len, sizeof(Uint32));
|
|
||||||
stack = calloc(len, sizeof(BRSTACK));
|
|
||||||
|
|
||||||
if (bracket_types && stack) {
|
|
||||||
for (i = 0; i < len; i++) {
|
|
||||||
Achar32 ch = REAL_ACHAR(achars[i]);
|
|
||||||
Achar32 mirrored;
|
|
||||||
if (!charset_ops->bidi_mirror_char(ch, &mirrored))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (ch < mirrored) {
|
|
||||||
stack[top].pos = i;
|
|
||||||
stack[top].mirror = mirrored;
|
|
||||||
top++;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (top > 0 && stack[top - 1].mirror == ch) {
|
|
||||||
int open_pos = stack[top - 1].pos;
|
|
||||||
int close_pos = i;
|
|
||||||
Uint32 found_dir = BIDI_TYPE_ON;
|
|
||||||
int k;
|
|
||||||
|
|
||||||
for (k = open_pos + 1; k < close_pos; k++) {
|
|
||||||
Uint32 t = charset_ops->bidi_char_type(REAL_ACHAR(achars[k]));
|
|
||||||
if (t == BIDI_TYPE_AL)
|
|
||||||
t = BIDI_TYPE_RTL;
|
|
||||||
if (BIDI_IS_LETTER(t)) {
|
|
||||||
found_dir = BIDI_IS_RTL(t) ? BIDI_TYPE_RTL : BIDI_TYPE_LTR;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (found_dir != BIDI_TYPE_ON) {
|
|
||||||
bracket_types[open_pos] = found_dir;
|
|
||||||
bracket_types[close_pos] = found_dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
top--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stack)
|
|
||||||
free(stack);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bracket_types) {
|
|
||||||
for (pp = type_rl_list->next; pp->next; pp = pp->next) {
|
|
||||||
if (BIDI_IS_NEUTRAL(TYPE(pp))) {
|
|
||||||
int start = POS(pp);
|
|
||||||
int end = start + LEN(pp);
|
|
||||||
Uint32 forced = BIDI_TYPE_ON;
|
|
||||||
|
|
||||||
if (end > len)
|
|
||||||
end = len;
|
|
||||||
|
|
||||||
for (i = start; i < end; i++) {
|
|
||||||
if (bracket_types[i] == BIDI_TYPE_RTL) {
|
|
||||||
forced = BIDI_TYPE_RTL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (bracket_types[i] == BIDI_TYPE_LTR) {
|
|
||||||
forced = BIDI_TYPE_LTR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (forced != BIDI_TYPE_ON) {
|
|
||||||
TYPE(pp) = forced;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
compact_list (type_rl_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
DBGLOG ("\n4.Resolving neutral types\n");
|
DBGLOG ("\n4.Resolving neutral types\n");
|
||||||
|
|
||||||
for (pp = type_rl_list->next; pp->next; pp = pp->next)
|
for (pp = type_rl_list->next; pp->next; pp = pp->next)
|
||||||
{
|
{
|
||||||
Uint32 prev_type, this_type, next_type;
|
Uint32 prev_type, this_type, next_type;
|
||||||
TYPERUN* prev = NULL;
|
|
||||||
TYPERUN* next = NULL;
|
|
||||||
|
|
||||||
prev = pp->prev;
|
|
||||||
while (prev && BIDI_IS_NEUTRAL(TYPE(prev)) && !BIDI_IS_SENTINEL(TYPE(prev)))
|
|
||||||
prev = prev->prev;
|
|
||||||
prev_type = (!prev || BIDI_IS_SENTINEL(TYPE(prev))) ? base_bir : TYPE(prev);
|
|
||||||
|
|
||||||
|
prev_type = TYPE(pp->prev);
|
||||||
this_type = TYPE(pp);
|
this_type = TYPE(pp);
|
||||||
next = pp->next;
|
next_type = (pp->next) ? TYPE(pp->next) : this_type;
|
||||||
while (next && BIDI_IS_NEUTRAL(TYPE(next)) && !BIDI_IS_SENTINEL(TYPE(next)))
|
|
||||||
next = next->next;
|
|
||||||
next_type = (!next || BIDI_IS_SENTINEL(TYPE(next))) ? base_bir : TYPE(next);
|
|
||||||
/* "European and arabic numbers are treated as though they were R, NUMBER_TO_RTL does this. */
|
/* "European and arabic numbers are treated as though they were R, NUMBER_TO_RTL does this. */
|
||||||
this_type = BIDI_NUMBER_TO_RTL(this_type);
|
this_type = BIDI_NUMBER_TO_RTL(this_type);
|
||||||
prev_type = BIDI_NUMBER_TO_RTL(prev_type);
|
prev_type = BIDI_NUMBER_TO_RTL(prev_type);
|
||||||
@@ -594,9 +498,6 @@ static void bidi_resolveNeutrals(const CHARSETOPS* charset_ops, Achar32* achars,
|
|||||||
print_resolved_levels (type_rl_list);
|
print_resolved_levels (type_rl_list);
|
||||||
print_resolved_types (type_rl_list);
|
print_resolved_types (type_rl_list);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (bracket_types)
|
|
||||||
free(bracket_types);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 5.Resolving implicit levels. */
|
/* 5.Resolving implicit levels. */
|
||||||
@@ -648,13 +549,10 @@ bidi_resolveMirrorChar (const CHARSETOPS* charset_ops, Achar32* achars, int len,
|
|||||||
int i;
|
int i;
|
||||||
for (i = POS (pp); i < POS (pp) + LEN (pp); i++)
|
for (i = POS (pp); i < POS (pp) + LEN (pp); i++)
|
||||||
{
|
{
|
||||||
Achar32 ch = achars[i];
|
|
||||||
Achar32 real_ch = REAL_ACHAR(ch);
|
|
||||||
Achar32 mirrored_ch;
|
Achar32 mirrored_ch;
|
||||||
if (charset_ops->bidi_mirror_char &&
|
if (charset_ops->bidi_mirror_char &&
|
||||||
charset_ops->bidi_mirror_char (real_ch, &mirrored_ch)) {
|
charset_ops->bidi_mirror_char (achars[i], &mirrored_ch))
|
||||||
achars[i] = IS_MBCHV(ch) ? SET_MBCHV(mirrored_ch) : mirrored_ch;
|
achars[i] = mirrored_ch;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -695,7 +593,7 @@ static void bidi_resolve_string (const CHARSETOPS* charset_ops,
|
|||||||
bidi_resolveWeak(&type_rl_list, base_dir);
|
bidi_resolveWeak(&type_rl_list, base_dir);
|
||||||
|
|
||||||
/* 4.Resolving Neutral Types */
|
/* 4.Resolving Neutral Types */
|
||||||
bidi_resolveNeutrals(charset_ops, achars, len, &type_rl_list, base_dir);
|
bidi_resolveNeutrals(&type_rl_list, base_dir);
|
||||||
|
|
||||||
/* 5.Resolving implicit levels. */
|
/* 5.Resolving implicit levels. */
|
||||||
*pmax_level = bidi_resolveImplicit(&type_rl_list, base_level);
|
*pmax_level = bidi_resolveImplicit(&type_rl_list, base_level);
|
||||||
@@ -928,3 +826,4 @@ Uint32 __mg_legacy_bidi_str_base_dir (const CHARSETOPS* charset_ops,
|
|||||||
|
|
||||||
return base_dir;
|
return base_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* and Graphics User Interface (GUI) support system for embedded systems
|
* and Graphics User Interface (GUI) support system for embedded systems
|
||||||
* and smart IoT devices.
|
* and smart IoT devices.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002~2026, Beijing FMSoft Technologies Co., Ltd.
|
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||||
* Copyright (C) 1998~2002, WEI Yongming
|
* Copyright (C) 1998~2002, WEI Yongming
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@@ -57,7 +57,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "minigui.h"
|
#include "minigui.h"
|
||||||
@@ -216,6 +215,8 @@ static unsigned char emojiSegmentationCategory (Uchar32 codepoint)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
typedef BOOL bool;
|
||||||
|
enum { false = FALSE, true = TRUE };
|
||||||
typedef unsigned char *emoji_text_iter_t;
|
typedef unsigned char *emoji_text_iter_t;
|
||||||
|
|
||||||
#include "emoji_presentation_scanner.inc"
|
#include "emoji_presentation_scanner.inc"
|
||||||
@@ -250,7 +251,7 @@ EmojiIterator * __mg_emoji_iterator_init (EmojiIterator *iter,
|
|||||||
BOOL __mg_emoji_iterator_next (EmojiIterator *iter)
|
BOOL __mg_emoji_iterator_next (EmojiIterator *iter)
|
||||||
{
|
{
|
||||||
unsigned int old_cursor, cursor;
|
unsigned int old_cursor, cursor;
|
||||||
bool is_emoji;
|
BOOL is_emoji;
|
||||||
|
|
||||||
if (iter->end >= iter->text_end)
|
if (iter->end >= iter->text_end)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
Reference in New Issue
Block a user