JKQTMathtext: added several new symbols that were missing so far

This commit is contained in:
jkriege2 2022-08-11 11:33:29 +02:00
parent 84f02e3ab6
commit c7b0185735
69 changed files with 602 additions and 313 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

After

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 838 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 710 B

After

Width:  |  Height:  |  Size: 921 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 695 B

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 647 B

After

Width:  |  Height:  |  Size: 756 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 929 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 B

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 B

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 615 B

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 575 B

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1022 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 945 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

After

Width:  |  Height:  |  Size: 785 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 536 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 512 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 667 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 999 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 501 B

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 836 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 772 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 622 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

View File

@ -321,6 +321,24 @@ bool JKQTMathTextSymbolNode::isSubSuperscriptBelowAboveSymbol(const QString &sym
return false;
}
bool JKQTMathTextSymbolNode::isExtendedWidthSymbol(const QString &symbolName)
{
fillSymbolTables();
if (symbols.contains(symbolName)) {
return has(symbols[symbolName].globalFlags, ExtendWidthInMathmode) || has(symbols[symbolName].globalFlags, SmallExtendWidthInMathmode);
}
return false;
}
int JKQTMathTextSymbolNode::getSymbolLength(const QString &symbolName)
{
fillSymbolTables();
if (symbols.contains(symbolName)) {
return symbols[symbolName].props.value(MTFEStandard, symbols[symbolName].props.value(MTFEUnicode, SymbolProps())).symbol.size();
}
return 0;
}
JKQTMathTextSymbolNode::SymbolProps::SymbolProps():
@ -486,7 +504,7 @@ void JKQTMathTextSymbolNode::fillSymbolTables()
symbols["o"]=SimpleTextSymbol(QChar(0xF8)).addHtml("ø");
symbols["O"]=SimpleTextSymbol(QChar(0xD8)).addHtml("Ø");
{ auto s=UprightSymbolUnicode(QChar(0x212B)).addUprightStd(QChar(0xC5));
symbols["Angstrom"]=s; symbols["Angstroem"]=s; }
symbols["Angstrom"]=s; symbols["angstrom"]=s; }
{ auto s=UnicodeSymbol(QChar(0x2136)).addHtml("ℶ");
symbols["Beth"]=s; symbols["Bet"]=s; symbols["beth"]=s; symbols["bet"]=s; }
symbols["Box"]=UprightSymbolUnicode(QChar(0x25A1));
@ -516,7 +534,11 @@ void JKQTMathTextSymbolNode::fillSymbolTables()
symbols["bullet"]=s; symbols["textbullet"]=s; }
symbols["cdots"]=UnicodeSymbol(QChar(0x22EF)).addHtml("···").addStd(QString(3, QChar(0xB7)));
{ auto s=UnicodeSymbol(QChar(0x2103)).addUprightStd("°C").addUprightHtml("°C");
symbols["celsius"]=s; symbols["degC"]=s; }
symbols["celsius"]=s; symbols["degC"]=s; symbols["degreeCelsius"]=s; }
symbols["ell"]=UprightSymbolUnicode(QChar(0x2113), "ℓ");
symbols["wp"]=UprightSymbolUnicode(QChar(0x2118), "℘");
symbols["mho"]=UprightSymbolUnicode(QChar(0x2127), "℧");
symbols["lozenge"]=UprightSymbolUnicode(QChar(0x25CA), "◊");
symbols["cent"]=SimpleTextSymbol(QChar(0xA2), "¢");
symbols["checkmark"]=UprightSymbolStd(QChar(0x2713)).addUprightHtml("✓");
symbols["circ"]=UprightSymbolStd(QChar(0x2218)).addUprightHtml("∘").addStd("o", ItalicOff,0.7, -0.25);
@ -535,6 +557,7 @@ void JKQTMathTextSymbolNode::fillSymbolTables()
{ auto s=SimpleTextSymbol(QChar(0x24), "$");
symbols["dollar"]=s; symbols["$"]=s; }
symbols["dprime"]=UnicodeSymbol(QChar(0x2033)).addHtml("″").addStd("''");
symbols["complement"] = SymbolFullProps(SymbolProps("C", Upright|BoldOff), "C", Upright|BoldOff).addUnicode(QChar(0x2201), Upright|BoldOff);
symbols["ee"] = SymbolFullProps(SymbolProps("e", Upright|BoldOff), "e", Upright|BoldOff);
{ auto s=UnicodeSymbol(QChar(0x2026)).addHtml("…").addWinSymbol(QChar(0xBC)).addStd("...");
symbols["ellipsis"]=s; symbols["dots"]=s; symbols["ldots"]=s; }
@ -574,6 +597,8 @@ void JKQTMathTextSymbolNode::fillSymbolTables()
symbols["pound"]=SimpleTextSymbol(QChar(0xA3), "£");
symbols["pound"]=UnicodeSymbol(QChar(0x00A3));
symbols["prime"]=UnicodeSymbol(QChar(0x2032)).addHtml("′").addStd("'");
symbols["arcminute"]=UnicodeSymbol(QChar(0x2032)).addHtml("′").addStd("'");
symbols["arcsecond"]=UnicodeSymbol(QChar(0x2033)).addHtml("&dprime;").addStd("'");
symbols["rangle"]=UprightSymbolUnicode(QChar(0x232A)).addWinSymbol(QChar(0xF1));
symbols["rceil"]=UprightSymbolUnicode(QChar(0x2309)).addHtml("⌉").addWinSymbol(QChar(0xF9));
{ auto s=SimpleTextSymbol(QChar(0xAE), "®");
@ -618,45 +643,45 @@ void JKQTMathTextSymbolNode::fillSymbolTables()
* STANDARD MathOperator Strings
**************************************************************************************/
symbols["Pr"] = MathOperatorText("Pr");
symbols["acos"] = MathOperatorText("acos").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["arccos"] = MathOperatorText("arccos").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["arcsin"] = MathOperatorText("arcsin").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["arctan"] = MathOperatorText("arctan").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["acos"] = MathOperatorText("acos");
symbols["arccos"] = MathOperatorText("arccos");
symbols["arcsin"] = MathOperatorText("arcsin");
symbols["arctan"] = MathOperatorText("arctan");
symbols["arg"] = MathOperatorText("arg").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["argmax"] = MathOperatorText("arg max", "arg max").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["argmin"] = MathOperatorText("arg min", "arg min").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["asin"] = MathOperatorText("asin").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["atan"] = MathOperatorText("atan").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["cos"] = MathOperatorText("cos").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["cosh"] = MathOperatorText("cosh").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["cot"] = MathOperatorText("cot").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["coth"] = MathOperatorText("coth").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["coth"] = MathOperatorText("coth").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["deg"] = MathOperatorText("deg").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["det"] = MathOperatorText("det").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["dim"] = MathOperatorText("dim").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["exp"] = MathOperatorText("exp").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["gcd"] = MathOperatorText("gcd").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["hom"] = MathOperatorText("hom").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["ker"] = MathOperatorText("ker").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["lb"] = MathOperatorText("lb").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["ld"] = MathOperatorText("ld").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["asin"] = MathOperatorText("asin");
symbols["atan"] = MathOperatorText("atan");
symbols["cos"] = MathOperatorText("cos");
symbols["cosh"] = MathOperatorText("cosh");
symbols["cot"] = MathOperatorText("cot");
symbols["coth"] = MathOperatorText("coth");
symbols["coth"] = MathOperatorText("coth");
symbols["deg"] = MathOperatorText("deg");
symbols["det"] = MathOperatorText("det");
symbols["dim"] = MathOperatorText("dim");
symbols["exp"] = MathOperatorText("exp");
symbols["gcd"] = MathOperatorText("gcd");
symbols["hom"] = MathOperatorText("hom");
symbols["ker"] = MathOperatorText("ker");
symbols["lb"] = MathOperatorText("lb");
symbols["ld"] = MathOperatorText("ld");
symbols["lim"] = MathOperatorText("lim").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["liminf"] = MathOperatorText("lim inf", "lim inf").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["limsup"] = MathOperatorText("lim sup", "lim sup").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["ln"] = MathOperatorText("ln").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["log"] = MathOperatorText("log").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["ln"] = MathOperatorText("ln");
symbols["log"] = MathOperatorText("log");
symbols["max"] = MathOperatorText("max").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["median"] = MathOperatorText("median").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["median"] = MathOperatorText("median");
symbols["min"] = MathOperatorText("min").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["mod"] = MathOperatorText("mod").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["sec"] = MathOperatorText("sec").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["sgn"] = MathOperatorText("sgn").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["sign"] = MathOperatorText("sign").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["sin"] = MathOperatorText("sin").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["sinh"] = MathOperatorText("sinh").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["tan"] = MathOperatorText("tan").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["tanh"] = MathOperatorText("tanh").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["mod"] = MathOperatorText("mod");
symbols["sec"] = MathOperatorText("sec");
symbols["sgn"] = MathOperatorText("sgn");
symbols["sign"] = MathOperatorText("sign");
symbols["sin"] = MathOperatorText("sin");
symbols["sinh"] = MathOperatorText("sinh");
symbols["tan"] = MathOperatorText("tan");
symbols["tanh"] = MathOperatorText("tanh");
/**************************************************************************************
* STANDARD MathOperator Symbols
@ -683,10 +708,16 @@ void JKQTMathTextSymbolNode::fillSymbolTables()
symbols["bbR"]=MathOperatorSymbolUnicode(QChar(0x211D));
symbols["bbZ"]=MathOperatorSymbolUnicode(QChar(0x2124));
symbols["because"]=MathOperatorSymbolUnicode(QChar(0x2235)).addMathOperatorHtml("∵");
symbols["bigcap"]=NarrowMathOperatorSymbolUnicode(QChar(0x22C2)).addMathOperatorHtml("∫").addMathOperatorWinSymbol(QChar(0xC7), 1.8).addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["bigcup"]=NarrowMathOperatorSymbolUnicode(QChar(0x22C3)).addMathOperatorHtml("∫").addMathOperatorWinSymbol(QChar(0xC8), 1.8).addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["bighat"]=NarrowMathOperatorSymbolUnicode(QChar(0x22C0)).addMathOperatorHtml("∫").addMathOperatorWinSymbol(QChar(0xD9), 1.8).addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["bigvee"]=NarrowMathOperatorSymbolUnicode(QChar(0x22C1)).addMathOperatorHtml("∫").addMathOperatorWinSymbol(QChar(0xDA), 1.8).addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["bigcap"]=NarrowMathOperatorSymbolUnicode(QChar(0x22C2)).addMathOperatorHtml("⋂").addMathOperatorWinSymbol(QChar(0xC7), 1.8).addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["bigcup"]=NarrowMathOperatorSymbolUnicode(QChar(0x22C3)).addMathOperatorHtml("⋃").addMathOperatorWinSymbol(QChar(0xC8), 1.8).addGlobalFlags(SubSuperscriptBelowAboveSymbol);
{ auto s=NarrowMathOperatorSymbolUnicode(QChar(0x22C0)).addMathOperatorHtml("⋀").addMathOperatorWinSymbol(QChar(0xD9), 1.8).addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["bigwedge"]=s; symbols["bighat"]=s; }
symbols["bigvee"]=NarrowMathOperatorSymbolUnicode(QChar(0x22C1)).addMathOperatorHtml("⋁").addMathOperatorWinSymbol(QChar(0xDA), 1.8).addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["bigotimes"]=NarrowMathOperatorSymbolUnicode(QChar(0x2A02)).addMathOperatorHtml("⨂").addMathOperatorWinSymbol(QChar(0xC4), 1.8).addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["bigoplus"]=NarrowMathOperatorSymbolUnicode(QChar(0x2A01)).addMathOperatorHtml("⨁").addMathOperatorWinSymbol(QChar(0xC5), 1.8).addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["bigodot"]=NarrowMathOperatorSymbolUnicode(QChar(0x2A00)).addMathOperatorHtml("⨀").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["biguplus"]=NarrowMathOperatorSymbolUnicode(QChar(0x2A04)).addMathOperatorHtml("⨄").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
symbols["bigsqcup"]=NarrowMathOperatorSymbolUnicode(QChar(0x2A06)).addMathOperatorHtml("⨆").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
{ auto s=MathOperatorSymbolUnicode(QChar(0x22A5)).addMathOperatorHtml("⊥");
symbols["bot"]=s; symbols["perp"]=s; }
{ auto s=MathOperatorSymbolUnicode(QChar(0x2229)).addMathOperatorHtml("∩").addMathOperatorWinSymbol(QChar(0xC7));
@ -792,6 +823,12 @@ void JKQTMathTextSymbolNode::fillSymbolTables()
symbols["vartriangleleft"]=MathOperatorSymbolUnicode(QChar(0x22B2)).addMathOperatorHtml("⊲");
symbols["vdots"]=MathOperatorSymbolUnicode(QChar(0x22EE)).addMathOperatorHtml("⋮");
symbols["vee"]=MathOperatorSymbolUnicode(QChar(0x2228)).addMathOperatorHtml("∨").addMathOperatorWinSymbol(QChar(0xDA));
symbols["vdash"]=MathOperatorSymbolUnicode(QChar(0x22A2)).addMathOperatorHtml("⊢");
symbols["dashv"]=MathOperatorSymbolUnicode(QChar(0x22A3)).addMathOperatorHtml("⊣");
symbols["vDash"]=MathOperatorSymbolUnicode(QChar(0x22A8)).addMathOperatorHtml("⊨");
symbols["nvdash"]=MathOperatorSymbolUnicode(QChar(0x22AC)).addMathOperatorHtml("⊬");
symbols["Vdash"]=MathOperatorSymbolUnicode(QChar(0x22A9)).addMathOperatorHtml("⊩");
symbols["models"]=MathOperatorSymbolUnicode(QChar(0x22A7)).addMathOperatorHtml("⊧");
symbols["wedge"]=MathOperatorSymbolUnicode(QChar(0x2227)).addMathOperatorHtml("∧").addMathOperatorWinSymbol(QChar(0xD9));

View File

@ -85,8 +85,12 @@ class JKQTMATHTEXT_LIB_EXPORT JKQTMathTextSymbolNode: public JKQTMathTextNode {
static bool hasSymbol(const QString& symbolName);
/** \brief return a list of all defined symbols */
static QStringList getSymbols();
/** \brief checks whether the given symbol name can be prepresented by this type of node */
/** \brief checks whether the given symbol name codes for an instruction that has SymbolFullProps::SubSuperscriptBelowAboveSymbol , i.e. JKQTMathTextNode::isSubSuperscriptAboveBelowNode() \c ==true */
static bool isSubSuperscriptBelowAboveSymbol(const QString& symbolName);
/** \brief checks whether the given symbol has global flags SymbolFullProps::ExtendWidthInMathmode or SymbolFullProps::SmallExtendWidthInMathmode defined */
static bool isExtendedWidthSymbol(const QString& symbolName);
/** \brief returns the length of the symbol string for the given symbol */
static int getSymbolLength(const QString& symbolName);
protected:
/** \copydoc JKQTMathTextNode::getSizeInternal() */
virtual void getSizeInternal(QPainter& painter, JKQTMathTextEnvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos, const JKQTMathTextNodeSize* prevNodeSize=nullptr) override;

View File

@ -126,27 +126,37 @@ int main(int argc, char* argv[])
QFile fileListF(outputDir.absoluteFilePath(listsymbols));
if (fileListF.open(QFile::WriteOnly|QFile::Text)) {
QTextStream fileList(&fileListF);
QStringList symbols=JKQTMathTextSymbolNode::getSymbols();
std::sort(symbols.begin(), symbols.end(), [](const QString& a, const QString& b) { const QString al=a.toLower(); const QString bl=b.toLower(); if (al==bl) { return a<b; } else return al<bl; });
QStringList symbolsAll=JKQTMathTextSymbolNode::getSymbols();
QSet<QString> symbolsRemaining(symbolsAll.begin(), symbolsAll.end());
std::sort(symbolsAll.begin(), symbolsAll.end(), [](const QString& a, const QString& b) { const QString al=a.toLower(); const QString bl=b.toLower(); if (al==bl) { return a<b; } else return al<bl; });
static QStringList greekLetterNames=QStringList()<<"alpha"<<"beta"<<"gamma"<<"delta"<<"epsilon"<<"zeta"<<"eta"<<"theta"<<"iota"<<"kappa"<<"lambda"<<"mu"<<"nu"<<"xi"<<"pi"<<"rho"<<"sigma"<<"tau"<<"upsilon"<<"phi"<<"chi"<<"psi"<<"omega";
static QStringList arrowNames=QStringList()<<"arrow"<<"harpoon"<<"mapsto";
int i=1;
fileList<<"/*!\n"
" \\defgroup jkqtmathtext_supportedlatexsymbols Supported LaTeX-Symbols\n"
" \\ingroup jkqtmathtext_general\n\n";
" \\ingroup jkqtmathtext_general\n\n\\tableofcontents\n\n";
fileList<<" \\section jkqtmathtext_supportedlatexsymbols_greek Greek Letters\n";
fileList<<" The following table lists all greek letters and their variants available in JKQTMathParser. They are defined in the node-class JKQTMathTextSymbolNode:\n";
fileList<<" <table>\n";
fileList<<" <tr>\n";
for (const QString& gletter: greekLetterNames) {
QString code="";
for (const QString& symbol: symbols) {
for (const QString& symbol: symbolsAll) {
if (symbol.size()>0 && (symbol.toLower()==gletter || symbol.toLower()=="var"+gletter) && symbol[0].isLetter()) {
code+="\\"+symbol+"\\;";
symbolsRemaining.remove(symbol);
}
}
for (const QString& symbol: symbols) {
for (const QString& symbol: symbolsAll) {
if (symbol.size()>0 && (symbol.toLower()=="up"+gletter || symbol.toLower()=="upvar"+gletter) && symbol[0].isLetter()) {
code+="\\"+symbol+"\\;";
symbolsRemaining.remove(symbol);
}
}
for (const QString& symbol: symbolsAll) {
if (symbol.size()>0 && (symbol.toLower()=="text"+gletter || symbol.toLower()=="textvar"+gletter) && symbol[0].isLetter()) {
code+="\\"+symbol+"\\;";
symbolsRemaining.remove(symbol);
}
}
QString symbol_lower;
@ -161,22 +171,30 @@ int main(int argc, char* argv[])
code=code.replace("\\;", " ");
code=code.replace("\\", "\\\\");
fileList<<" <td><code>"<<code<<"</code>:\n <td> \\image html jkqtmathtext/symbols/"<<outputFilename.last()<<"\n";
if (i%2==0) {
//if (i%2==0) {
fileList<<" </tr>\n <tr>\n";
}
//}
i++;
}
fileList<<" </tr>";
fileList<<" </table>\n\n\n";
fileList<<" \\section jkqtmathtext_supportedlatexsymbols_arrows Arrows\n";
fileList<<" The following table lists all arrow-typed symbols available in JKQTMathParser. They are defined in the node-class JKQTMathTextSymbolNode:\n";
fileList<<" <table>\n";
fileList<<" <tr>\n";
i=1;
std::sort(symbolsAll.begin(), symbolsAll.end(), [](const QString& a, const QString& b) { if (a.contains("harpoon") && !b.contains("harpoon")) return false;
else if (a.isLower() && b.isUpper()) return true;
else if (a.isUpper() && b.isLower()) return false;
else return a<b;
});
for (const QString& arrow: arrowNames) {
QString code="";
for (const QString& symbol: symbols) {
for (const QString& symbol: symbolsAll) {
if (symbol.size()>0 && symbol.toLower().contains(arrow) && symbol[0].isLetter()) {
symbolsRemaining.remove(symbol);
QString symbol_lower;
for (const QChar& ch: symbol) {
if (ch.isUpper()) symbol_lower+=QString(2, ch).toLower();
@ -196,24 +214,85 @@ int main(int argc, char* argv[])
fileList<<" </tr>";
fileList<<" </table>\n\n\n";
std::sort(symbolsAll.begin(), symbolsAll.end(), [](const QString& a, const QString& b) { const QString al=a.toLower(); const QString bl=b.toLower(); if (al==bl) { return a<b; } else return al<bl; });
fileList<<" \\section jkqtmathtext_supportedlatexsymbols_bigmathop Big Math Operators\n";
fileList<<" The following table lists all math-operator symbols like \\c \\\\sum,\\\\int,\\\\lim... that allow to over/underset sub-/superscript using \\c \\\\limits (and \\c \\\\nolimits ) available in JKQTMathParser. They are defined in the node-class JKQTMathTextSymbolNode:\n";
fileList<<" <table>\n";
fileList<<" <tr>\n";
i=1;
{
QString code="";
for (const QString& symbol: symbolsAll) {
if (symbol.size()>0 && JKQTMathTextSymbolNode::isSubSuperscriptBelowAboveSymbol(symbol) && symbol[0].isLetter()) {
symbolsRemaining.remove(symbol);
QString symbol_lower;
for (const QChar& ch: symbol) {
if (ch.isUpper()) symbol_lower+=QString(2, ch).toLower();
else symbol_lower+=ch;
}
latex.append("$\\"+symbol+"\\limits_{x=0}^\\infty$\\vphantom{Iq}");
outputFilename.append("jkqtmathtext_symbols_"+symbol_lower+".png");
cmdoptions.append(QMap<QString,QString>());
fileList<<" <td><code>\\\\"<<symbol<<"</code>:\n <td> \\image html jkqtmathtext/symbols/"<<outputFilename.last()<<"\n";
if (i%3==0) {
fileList<<" </tr>\n <tr>\n";
}
i++;
}
}
}
fileList<<" </tr>";
fileList<<" </table>\n\n\n";
fileList<<" \\section jkqtmathtext_supportedlatexsymbols_mathop Other Math Operators\n";
fileList<<" The following table lists all remaining math-operator symbols like available in JKQTMathParser. They are defined in the node-class JKQTMathTextSymbolNode:\n";
fileList<<" <table>\n";
fileList<<" <tr>\n";
i=1;
{
QString code="";
for (const QString& symbol: symbolsAll) {
if (symbol.size()>0 && JKQTMathTextSymbolNode::isSubSuperscriptBelowAboveSymbol(symbol) && symbol[0].isLetter()) {
symbolsRemaining.remove(symbol);
QString symbol_lower;
for (const QChar& ch: symbol) {
if (ch.isUpper()) symbol_lower+=QString(2, ch).toLower();
else symbol_lower+=ch;
}
static QSet<QString> specialSymbols=QSet<QString>()<<"lim"<<"liminf"<<"limsup"<<"arg"<<"argmin"<<"argmax";
if (JKQTMathTextSymbolNode::getSymbolLength(symbol)>1 && !specialSymbols.contains(symbol)) {
latex.append("$\\"+symbol+"(\\cdot)$\\vphantom{Iq}");
} else {
if (JKQTMathTextSymbolNode::getSymbolLength(symbol)>1) {
latex.append("$\\"+symbol+"\\limits_{x\\rightarrow\\infty}f(x)$\\vphantom{Iq}");
} else {
latex.append("$\\"+symbol+"\\limits_{x=0}^\\infty$\\vphantom{Iq}f(x)");
}
}
outputFilename.append("jkqtmathtext_symbols_"+symbol_lower+".png");
cmdoptions.append(QMap<QString,QString>());
fileList<<" <td><code>\\\\"<<symbol<<"</code>:\n <td> \\image html jkqtmathtext/symbols/"<<outputFilename.last()<<"\n";
if (i%3==0) {
fileList<<" </tr>\n <tr>\n";
}
i++;
}
}
}
fileList<<" </tr>";
fileList<<" </table>\n\n\n";
fileList<<" \\section jkqtmathtext_supportedlatexsymbols_other Other Symbols\n";
fileList<<" The following table lists all other symbols that are available in JKQTMathParser. They are defined in the node-class JKQTMathTextSymbolNode:\n";
fileList<<" <table>\n";
fileList<<" <tr>\n";
i=1;
for (const QString& symbol: symbols) {
bool alreadythere=false;
for (const QString& gletter: greekLetterNames) {
if (symbol.toLower().endsWith(gletter)) {
alreadythere=true;
}
}
for (const QString& gletter: arrowNames) {
if (symbol.toLower().contains(gletter)) {
alreadythere=true;
}
}
if (!alreadythere && symbol.size()>0 && symbol[0].isLetter()) {
QStringList symbolsRemainingL=QStringList(symbolsRemaining.begin(), symbolsRemaining.end());
std::sort(symbolsRemainingL.begin(), symbolsRemainingL.end(), [](const QString& a, const QString& b) { const QString al=a.toLower(); const QString bl=b.toLower(); if (al==bl) { return a<b; } else return al<bl; });
for (const QString& symbol: symbolsRemainingL) {
if (symbol.size()>0 && symbol[0].isLetter()) {
QString symbol_lower;
for (const QChar& ch: symbol) {
if (ch.isUpper()) symbol_lower+=QString(2, ch).toLower();