summaryrefslogtreecommitdiffstats
path: root/src/kernel/qtextengine_p.h
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-01-12 13:09:40 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-01-12 23:34:08 +0900
commitb559abe7220b3d86edc427bcbf7db26f9f6f62d6 (patch)
tree83c6a8a483f629d23d12d93f210379f5c51281f4 /src/kernel/qtextengine_p.h
parent1c9111b3795a3b87254cbac172dcc565c7f76a57 (diff)
downloadtqt-b559abe7.tar.gz
tqt-b559abe7.zip
Add support for Unicode surrogate characters and planes above zero.
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 <michele.calgaro@yahoo.it> (cherry picked from commit e0a38072cf48a6819a5cd788588267f3441d9d6a)
Diffstat (limited to 'src/kernel/qtextengine_p.h')
-rw-r--r--src/kernel/qtextengine_p.h60
1 files changed, 12 insertions, 48 deletions
diff --git a/src/kernel/qtextengine_p.h b/src/kernel/qtextengine_p.h
index 751cdf043..6b1b6fbaf 100644
--- a/src/kernel/qtextengine_p.h
+++ b/src/kernel/qtextengine_p.h
@@ -86,57 +86,28 @@ struct glyph_metrics_t
int yoff;
};
-#if defined( TQ_WS_X11 ) || defined ( TQ_WS_QWS )
-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_QWS ) || 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