summaryrefslogtreecommitdiffstats
path: root/src/kernel/tqtextengine_p.h
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2025-01-12 13:09:40 +0900
committerMichele Calgaro <[email protected]>2025-01-12 13:25:56 +0900
commite0a38072cf48a6819a5cd788588267f3441d9d6a (patch)
tree5875e89df7d84f3c72f19496961694ab6009e5a1 /src/kernel/tqtextengine_p.h
parentccd304b2a6415d8b747d04b3a47736d1e6f45717 (diff)
downloadtqt3-e0a38072cf48a6819a5cd788588267f3441d9d6a.tar.gz
tqt3-e0a38072cf48a6819a5cd788588267f3441d9d6a.zip
Add support for Unicode surrogate characters and planes above zero.HEADmaster
If the selected font supports the required characters, the text will be displayed correctly. If the selected font does not support such characters, empty boxes will be displayed in place of the expected text. Part of the code changes comes from Qt4 code. Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'src/kernel/tqtextengine_p.h')
-rw-r--r--src/kernel/tqtextengine_p.h60
1 files changed, 12 insertions, 48 deletions
diff --git a/src/kernel/tqtextengine_p.h b/src/kernel/tqtextengine_p.h
index d092a3e7d..d3e8ea3ee 100644
--- a/src/kernel/tqtextengine_p.h
+++ b/src/kernel/tqtextengine_p.h
@@ -86,57 +86,28 @@ struct glyph_metrics_t
int yoff;
};
-#if defined( TQ_WS_X11 )
-typedef unsigned short glyph_t;
-
-struct qoffset_t {
- short x;
- short y;
-};
-
+typedef unsigned int glyph_t;
typedef int advance_t;
-struct TQScriptAnalysis
-{
- unsigned short script : 7;
- unsigned short bidiLevel : 6; // Unicode Bidi algorithm embedding level (0-61)
- unsigned short override : 1; // Set when in LRO/RLO embedding
- unsigned short reserved : 2;
- bool operator == ( const TQScriptAnalysis &other ) {
- return
- script == other.script &&
- bidiLevel == other.bidiLevel;
- // ###
-// && override == other.override;
- }
+#if defined( TQ_WS_X11 ) || defined( TQ_WS_MAC )
-};
-
-#elif defined( TQ_WS_MAC )
-
-typedef unsigned short glyph_t;
-
-struct qoffset_t {
+struct qoffset_t
+{
short x;
short y;
};
-typedef int advance_t;
-
struct TQScriptAnalysis
{
unsigned short script : 7;
unsigned short bidiLevel : 6; // Unicode Bidi algorithm embedding level (0-61)
unsigned short override : 1; // Set when in LRO/RLO embedding
unsigned short reserved : 2;
- bool operator == ( const TQScriptAnalysis &other ) {
- return
- script == other.script &&
- bidiLevel == other.bidiLevel;
- // ###
-// && override == other.override;
- }
+ bool operator== ( const TQScriptAnalysis &other )
+ {
+ return script == other.script && bidiLevel == other.bidiLevel;
+ }
};
#elif defined( TQ_WS_WIN )
@@ -144,15 +115,12 @@ struct TQScriptAnalysis
// do not change the definitions below unless you know what you are doing!
// it is designed to be compatible with the types found in uniscribe.
-typedef unsigned short glyph_t;
-
-struct qoffset_t {
+struct qoffset_t
+{
int x;
int y;
};
-typedef int advance_t;
-
struct TQScriptAnalysis {
unsigned short script :10;
unsigned short rtl :1;
@@ -174,13 +142,9 @@ struct TQScriptAnalysis {
unsigned short engineReserved :2;
};
-inline bool operator == ( const TQScriptAnalysis &sa1, const TQScriptAnalysis &sa2 )
+inline bool operator== ( const TQScriptAnalysis &sa1, const TQScriptAnalysis &sa2 )
{
- return
- sa1.script == sa2.script &&
- sa1.bidiLevel == sa2.bidiLevel;
- // ###
-// && override == other.override;
+ return sa1.script == sa2.script && sa1.bidiLevel == sa2.bidiLevel;
}
#endif