From edd7784d477456625cc175db22a856fffd30e027 Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Tue, 26 Jul 2022 22:27:16 +0200 Subject: [PATCH] JKQTMathText: \\unicode{} now always accepts a codepoint and \utfeight{} a UTF8-seuqnece --- .../jkqtmathtext/jkqtmathtext_unicode.png | Bin 3091 -> 3644 bytes doc/images/jkqtmathtext/jkqtmathtext_utf8.png | Bin 0 -> 2686 bytes examples/jkqtmathtext_test/testform.cpp | 3 +- lib/jkqtcommon/jkqtpstringtools.cpp | 27 ++++++++++++++++++ lib/jkqtcommon/jkqtpstringtools.h | 6 ++++ lib/jkqtmathtext/jkqtmathtext.h | 3 +- .../nodes/jkqtmathtextinstructionnode.cpp | 5 ++-- 7 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 doc/images/jkqtmathtext/jkqtmathtext_utf8.png diff --git a/doc/images/jkqtmathtext/jkqtmathtext_unicode.png b/doc/images/jkqtmathtext/jkqtmathtext_unicode.png index 5a8ecef507a19a408f4fe5d71eac4014e2c541e0..51d5ff903f7f48f5193b135299da06a11450e23f 100644 GIT binary patch delta 3598 zcmV+p4)O7m7`z-IiBL{Q4GJ0x0000DNk~Le0005+0000g2m$~A02R4JDUl&ke+{!q zL_t(|UhSRHi`_>R$Mb)PkD`6BU=?K_g8JY?thR#Cyjc3wt0L3~iy|$w3SwWHr3fN4 z!sca>1WbaPO_wgFHVa}%AZ=Kauxuc!ExU!r)$Wp#7`A6-&dhJ-%sKO$-@U(V@4b6I z4B_50=Xd7JnYrJc{Py0vhxQaje^HdlN7YBc=^~WI1qy=%0<(o8fqHp71sksqz zm2<@c|4%c!K{tf*kTLhZzx^sv=g=;G@fUaJzUI^%PUvt>Ck~;#{n)R|ch3)$nmaKc zlUFY$Gg!pulSm_o23J;Re;fa4`ORRN=v8Q88a7%F+`4t^^^~(`&)&Ot54$6-T)BcC z9ZE$i6WDB;d3u+&wj&6xoe>8pzp+uwDn^baDbG9q~^`*cMRk_Br~b6GBW{R z$5hn~<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@P)>-9+?8nHyP&MYhn)R^21Pmu}6OT_!(e+9p0jbt>*+>@&A;f3kQSp9V+d#^Tv2JJIl;aY25D z$2{v2JZ0`Ec|hP?y*i-eD{j~fBBXkO4wJpO>647$8T<7;;Xk7ztqsz;~p2>T`egtdF$6ukh6zcYh~-pZA?kXW!V* ziSM4}&3j7N>2x}`FMItQztib-_KH67JDpBvH(%%zztib-_Juz2JDpBvU+5FR)9G~f jg+B2+ola*z7>54?zqSFOy2p5t00000NkvXXu0mjf*gX)` diff --git a/doc/images/jkqtmathtext/jkqtmathtext_utf8.png b/doc/images/jkqtmathtext/jkqtmathtext_utf8.png new file mode 100644 index 0000000000000000000000000000000000000000..9bf0ff6b46f0678857752a2d104fed4d9ba055ab GIT binary patch literal 2686 zcmV-^3W4>BP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D01|XXSaefwW^{L9 za%BKVa%E+1b7*gLUR4MM000T~NklfeIhV9pb2s5WOT3^ec5G|U*6-EjRPx<;crtjd8ogC zh+hV@2nJr#8Ji(LJQGch@s3j-Su_STEt7|OtJU7X<5ofL4s4SK*_m@_3}{X!_t)Cm z0*_k*Kt+w5g#`BSI`RA0+!b8-VSG6HYFX^Ta$Cu#F`)UF9J4s^xD_BNRFBlTC*%8w z2a_d-K`i$aCmI8qi^+_|t;}P1sAz!%c%P+B@!m)QK;zw&XnQ5vSKJlj@E2Xt&Ppst zH*&oSR~iGFhslD)t;=K1;$}~P`c7->%AQ4Y=7K!hGxz6rx^WYei=T8oU5yPuURd5U z)`wbwOTZ{UFdA>GL~m50PZMvBOvW6B?rIH=yiq3Ky08lHqe>ueYBP|F2rQUVc5Wdy{vC3GzN@}jM|voU#s==%P9`b;6ZON3OgUM8XG%^K59$Jycz#NSXrHJ2m$c)AYhevnJ8@ze>uS*tV>%CgZpMUowD8pK_J zyC`&_y}j|%FNEB1Zw(u+Raq625D?ER9X9Ar+-e2WL4>++o5Jg8qa zl_q{~xde^b_A7}h<>d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uM6TpS%+a{H(vXo@vPn+H>;X-w>ypASCkU40&@qUya-nX> z(bvnOf1LkkSnKP(6$7YeFGKO?u^U<^&_ZOLGIQYl@?gahbk zq<3Z5L~Aj03B!GYNq60jnQ1=VVE%)|!TY1Xe&Ve*0M&u;xEF}`Rtx|d@4YKpJ44%z zGtT+?d7ho9;jcf90ebn>Ov{=w@Pv!LDWDfN6;4u}Ucdx7%?@x|2h7T63~l}#ny1u= zUgUPY9um4 ziD>=on8Uzi)h+C|hdN)=2+TxzwZ^2c5^b0fllj1I?is<2#u!vdQ$r=+sJqaMLb16f`g^)}pI4tGR+US)B>U>ij5YU+L{`cd0&e9Tj_YpWh z!zubmWfMFwYfZXX;t4bkXccmbTestset->addItem("text (bold)", "text \\mathbf{bold}"); ui->cmbTestset->addItem("textcolor", "text \\mathbf{bold}\\textcolor{red}{RED}"); ui->cmbTestset->addItem("userfont", "text, \\userfont{Arial}{Arial}, \\userfont{Comic Sans MS}{Comic Sans MS}"); - ui->cmbTestset->addItem("unicode", "star: \\unicode{2605}, circonflex: \\unicode{109} emoticons on UTF-8: \\utfeight{F09F9881} \\utfeight{f09f98bb}"); + ui->cmbTestset->addItem("unicode", "star: \\unicode{2605}, circonflex: \\unicode{109} emoticons: \\usym{1F440} \\usym{1F929}"); + ui->cmbTestset->addItem("UTF8", "star: \\utfeight{e29885} emoticons \\utfeight{F09F9881} \\utfeight{f09f98bb}"); const auto mathDecoExample=[](const QString& deco)->QString { return "\\"+deco+"{x}\\"+deco+"{i}\\"+deco+"{X}\\"+deco+"{\\psi}\\"+deco+"{abc}"; }; ui->cmbTestset->addItem("decoration: math", "$"+mathDecoExample("vec")+" -- "+mathDecoExample("grave")+" -- "+mathDecoExample("acute")+" -- "+mathDecoExample("dot")+" -- "+mathDecoExample("ddot")+" -- "+mathDecoExample("ocirc")+" -- "+mathDecoExample("overline")+" -- "+mathDecoExample("underline")+" -- "+mathDecoExample("hat")+" -- "+mathDecoExample("widehat")+" -- "+mathDecoExample("check")+" -- "+mathDecoExample("widecheck")+" -- "+mathDecoExample("breve")+" -- "+mathDecoExample("tilde")+" -- "+mathDecoExample("widetilde")+" -- "+mathDecoExample("uul")+" -- "+mathDecoExample("ool")+" -- "+mathDecoExample("bar")+" -- "+mathDecoExample("arrow")+" -- "+mathDecoExample("cancel")+" -- "+mathDecoExample("bcancel")+" -- "+mathDecoExample("xcancel")+" -- "+mathDecoExample("sout")+"$"); ui->cmbTestset->addItem("decoration: text", "Text \\ul{underlined Text Equator} -- \\ol{overlined Text Equator} -- \\sout{striked out Text Equator} -- \\cancel{canceled out Text Equator} -- \\bcancel{b-canceled out Text Equator} -- \\xcancel{x-canceled out Text Equator}"); diff --git a/lib/jkqtcommon/jkqtpstringtools.cpp b/lib/jkqtcommon/jkqtpstringtools.cpp index a502019e10..e63a8c9951 100644 --- a/lib/jkqtcommon/jkqtpstringtools.cpp +++ b/lib/jkqtcommon/jkqtpstringtools.cpp @@ -837,3 +837,30 @@ Qt::MouseButton jkqtp_String2MouseButton(const QString &button) if (but=="EXTRA24") return Qt::ExtraButton24; return Qt::NoButton; } + +std::string jkqtp_UnicodeToUTF8(uint32_t codepoint) +{ + std::string out; + + if (codepoint <= 0x7f) + out.append(1, static_cast(codepoint)); + else if (codepoint <= 0x7ff) + { + out.append(1, static_cast(0xc0 | ((codepoint >> 6) & 0x1f))); + out.append(1, static_cast(0x80 | (codepoint & 0x3f))); + } + else if (codepoint <= 0xffff) + { + out.append(1, static_cast(0xe0 | ((codepoint >> 12) & 0x0f))); + out.append(1, static_cast(0x80 | ((codepoint >> 6) & 0x3f))); + out.append(1, static_cast(0x80 | (codepoint & 0x3f))); + } + else + { + out.append(1, static_cast(0xf0 | ((codepoint >> 18) & 0x07))); + out.append(1, static_cast(0x80 | ((codepoint >> 12) & 0x3f))); + out.append(1, static_cast(0x80 | ((codepoint >> 6) & 0x3f))); + out.append(1, static_cast(0x80 | (codepoint & 0x3f))); + } + return out; +} diff --git a/lib/jkqtcommon/jkqtpstringtools.h b/lib/jkqtcommon/jkqtpstringtools.h index 69bba9b3c2..e4f0662970 100644 --- a/lib/jkqtcommon/jkqtpstringtools.h +++ b/lib/jkqtcommon/jkqtpstringtools.h @@ -48,6 +48,12 @@ JKQTCOMMON_LIB_EXPORT QString jkqtp_QBrushStyle2String(Qt::BrushStyle style); JKQTCOMMON_LIB_EXPORT Qt::BrushStyle jkqtp_String2QBrushStyle(const QString& style); +/** \brief converts a Unicode codepoint into a UTF8-sequence + * \ingroup jkqtptools_string + * + * \see https://stackoverflow.com/questions/19968705/unsigned-integer-as-utf-8-value + */ +JKQTCOMMON_LIB_EXPORT std::string jkqtp_UnicodeToUTF8(uint32_t codepoint); /** \brief convert a double to a string, using the loacle "C" * \ingroup jkqtptools_string diff --git a/lib/jkqtmathtext/jkqtmathtext.h b/lib/jkqtmathtext/jkqtmathtext.h index 550ce704dc..f1385ea770 100644 --- a/lib/jkqtmathtext/jkqtmathtext.h +++ b/lib/jkqtmathtext/jkqtmathtext.h @@ -133,7 +133,8 @@ class JKQTMathTextNode; // forward - \c \\fcolorbox{bordercolor}{backgroundcolor}{...} : draw a colored, filled box \image html jkqtmathtext/jkqtmathtext_fcolorbox.png - \c \\colorbox{color}{...} : draw a colored box around text \image html jkqtmathtext/jkqtmathtext_colorbox.png - \c \\alpha ... : display the according greek letter \image html jkqtmathtext/jkqtmathtext_greek.png - - \c \\unicode{HEX} and \\utfeight{HEX} : draws a unicode character \image html jkqtmathtext/jkqtmathtext_unicode.png (generated by star: \\unicode{2605}, circonflex: \\unicode{109} emoticons on UTF-8: \\utfeight{F09F9881} \\utfeight{f09f98bb}) + - \c \\unicode{HEX} and \c \\usym{HEX} : draws a unicode character from its 32-bit codepoint \image html jkqtmathtext/jkqtmathtext_unicode.png (generated by star: \\unicode{2605}, circonflex: \\unicode{109} emoticons: \\usym{1F440} \\usym{1F929}) + - \c \\utfeight{HEX} : draws a unicode character from its UTF-8 encoding \image html jkqtmathtext/jkqtmathtext_utf8.png (generated by star: \\utfeight{e29885} emoticons \\utfeight{F09F9881} \\utfeight{f09f98bb}) - \c ^{...} \c _{...} : display the contents of braces in superscript/subscript \image html jkqtmathtext/jkqtmathtext_supersub.png
Special subscript/superscript typesetting applies, when the sub/super follows \c \\sum \c \\Prod ...: \image html jkqtmathtext/jkqtmathtext_specialsubsuper.png - \c \\{ / \\} : display opening/closing brace diff --git a/lib/jkqtmathtext/nodes/jkqtmathtextinstructionnode.cpp b/lib/jkqtmathtext/nodes/jkqtmathtextinstructionnode.cpp index 9b28a9f623..412fdc55d7 100644 --- a/lib/jkqtmathtext/nodes/jkqtmathtextinstructionnode.cpp +++ b/lib/jkqtmathtext/nodes/jkqtmathtextinstructionnode.cpp @@ -147,10 +147,11 @@ void JKQTMathTextSimpleInstructionNode::fillInstructions() bool ok=false; qlonglong code=parameters.value(0, "0").toLongLong(&ok, 16); ok=ok&&(code>=0); - if (ok&&(code<=0xFFFF)) return QChar(static_cast(code)); - return QChar(0); + if (ok&&(code>=0)&&(code<=0xFFFFFFFF)) return QString::fromStdString(jkqtp_UnicodeToUTF8(static_cast(code))); + else return QString(); }, 1); instructions["unicode"]= i; + instructions["usym"]= i; } { InstructionProperties i([](const QStringList& parameters) -> QString {