2022-06-08 21:38:26 +08:00
|
|
|
/*
|
|
|
|
Copyright (c) 2008-2022 Jan W. Krieger (<jan@jkrieger.de>)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This software is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License (LGPL) as published by
|
|
|
|
the Free Software Foundation, either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License (LGPL) for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License (LGPL)
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "jkqtmathtext/nodes/jkqtmathtextsymbolnode.h"
|
|
|
|
#include "jkqtmathtext/jkqtmathtexttools.h"
|
|
|
|
#include "jkqtmathtext/jkqtmathtext.h"
|
|
|
|
#include "jkqtcommon/jkqtpcodestructuring.h"
|
|
|
|
#include "jkqtcommon/jkqtpstringtools.h"
|
|
|
|
#include <cmath>
|
|
|
|
#include <QFontMetricsF>
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QFontDatabase>
|
|
|
|
#include <QFontInfo>
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QFont>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-06 04:03:08 +08:00
|
|
|
JKQTMathTextSymbolNode::JKQTMathTextSymbolNode(JKQTMathText* _parent, const QString& name):
|
|
|
|
JKQTMathTextNode(_parent), symbolName(name)
|
2022-06-08 21:38:26 +08:00
|
|
|
{
|
2022-07-04 02:30:12 +08:00
|
|
|
fillSymbolTables();
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::~JKQTMathTextSymbolNode() {
|
|
|
|
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
|
|
|
QString JKQTMathTextSymbolNode::getTypeName() const
|
|
|
|
{
|
|
|
|
return QLatin1String("JKQTMathTextSymbolNode(")+symbolName+QLatin1String(")");
|
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
|
|
|
|
void JKQTMathTextSymbolNode::getSizeInternal(QPainter& painter, JKQTMathTextEnvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos, const JKQTMathTextNodeSize* prevNodeSize) {
|
|
|
|
double dummy1, dummy2;
|
|
|
|
getSymbolSizeInternal(painter, currentEv, width, baselineHeight, overallHeight, strikeoutPos, dummy1, dummy2, prevNodeSize);
|
|
|
|
}
|
|
|
|
|
2022-07-22 04:17:37 +08:00
|
|
|
void JKQTMathTextSymbolNode::getSymbolSizeInternal(QPainter &painter, JKQTMathTextEnvironment currentEv, double &width, double &baselineHeight, double &overallHeight, double &strikeoutPos, double &subSuperXCorrection, double &subBesidesXCorrection, const JKQTMathTextNodeSize */*prevNodeSize*/)
|
2022-06-08 21:38:26 +08:00
|
|
|
{
|
2022-07-04 02:30:12 +08:00
|
|
|
const auto fullProps=symbols.value(symbolName, SymbolFullProps());
|
|
|
|
const GlobalSymbolFlags globalFlags=fullProps.globalFlags;
|
|
|
|
const auto drawProps=fullProps.getDrawingData(currentEv, parentMathText);
|
|
|
|
const QFont f=drawProps.first;
|
|
|
|
const QFontMetricsF fm(f);
|
|
|
|
const JKQTMathTextSymbolNode::SymbolProps symprops=drawProps.second;
|
|
|
|
const SymbolFlags symflags=symprops.flags;
|
|
|
|
const QString sym=symprops.symbol;
|
|
|
|
const QRectF tbr=getTightBoundingRect(fm, sym, globalFlags);
|
|
|
|
const QRectF br=getBoundingRect(fm, sym, globalFlags);
|
|
|
|
const QRectF tbrNoSymbol=JKQTMathTextGetTightBoundingRect(f, "X", painter.device());
|
|
|
|
const QRectF mintbr=JKQTMathTextGetTightBoundingRect(f, "(", painter.device());
|
2022-07-22 04:17:37 +08:00
|
|
|
//const double yShift=symprops.yShiftFactor*tbr.height();
|
2022-07-04 02:30:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
if (currentEv.insideMath) {
|
|
|
|
width=qMax(br.width(), mintbr.width());
|
2022-07-07 04:44:02 +08:00
|
|
|
if (has(globalFlags, SmallExtendWidthInMathmode)) {
|
|
|
|
if (!symprops.getSymbolSingleChar().isNull()) width=width*(1.0+(parentMathText->getMathoperatorWidthFactor()-1.0)/2.0);
|
|
|
|
else width=width+mintbr.width();
|
|
|
|
} else if (has(globalFlags, ExtendWidthInMathmode)) {
|
2022-07-04 02:30:12 +08:00
|
|
|
if (!symprops.getSymbolSingleChar().isNull()) width=width*parentMathText->getMathoperatorWidthFactor();
|
|
|
|
else width=width+mintbr.width();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
width=br.width();
|
|
|
|
}
|
|
|
|
if (!sym.isEmpty()) {
|
|
|
|
overallHeight=tbr.height();
|
|
|
|
baselineHeight=tbr.height()-tbr.bottom();
|
|
|
|
} else {
|
|
|
|
overallHeight=tbrNoSymbol.height();
|
|
|
|
baselineHeight=tbrNoSymbol.height()-tbrNoSymbol.bottom();
|
2022-07-06 04:03:08 +08:00
|
|
|
width=tbrNoSymbol.width();
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
2022-07-04 02:30:12 +08:00
|
|
|
const double oldDescent=overallHeight-baselineHeight;
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
if (has(symflags, HeightIsAscent)) {
|
|
|
|
baselineHeight=fm.ascent();
|
|
|
|
overallHeight=baselineHeight+oldDescent;
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
2022-07-06 04:03:08 +08:00
|
|
|
if (has(symflags, RotateSymbol90)) {
|
|
|
|
width=qMax(overallHeight, width);
|
|
|
|
}
|
2022-07-04 02:30:12 +08:00
|
|
|
strikeoutPos=fm.strikeOutPos();
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
if (has(globalFlags, IntLikeSymbolCorrection)) {
|
|
|
|
subSuperXCorrection=parentMathText->getIntSubSuperXCorrectionFactor()*tbr.width();
|
|
|
|
subBesidesXCorrection=parentMathText->getIntSubBesidesXCorrectionXFactor()*JKQTMathTextGetTightBoundingRect(f, "X", painter.device()).width();
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
QRectF JKQTMathTextSymbolNode::getBoundingRect(const QFontMetricsF &fm, const QString &text, GlobalSymbolFlags globalFlags)
|
2022-06-08 21:38:26 +08:00
|
|
|
{
|
2022-07-04 02:30:12 +08:00
|
|
|
if (has(globalFlags, MakeWhitespaceHalf) && text.contains(' ')) {
|
|
|
|
const QStringList str=text.simplified().trimmed().split(' ');
|
|
|
|
const QRectF brSp=fm.boundingRect("i");
|
|
|
|
QRectF br;
|
|
|
|
for (int i=0; i<str.size(); i++) {
|
|
|
|
const QRectF lbr=fm.boundingRect(str[i]);
|
|
|
|
if (i==0) br=lbr;
|
|
|
|
else {
|
|
|
|
br.setWidth(br.width()+brSp.width()/2.0+lbr.width());
|
|
|
|
if (lbr.top()>br.top()) {
|
|
|
|
br.setTop(lbr.top());
|
|
|
|
}
|
|
|
|
if (lbr.bottom()<br.bottom()) {
|
|
|
|
br.setBottom(lbr.bottom());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return br;
|
|
|
|
} else {
|
|
|
|
return fm.boundingRect(text);
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
2022-07-04 02:30:12 +08:00
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
QRectF JKQTMathTextSymbolNode::getTightBoundingRect(const QFontMetricsF &fm, const QString &text, GlobalSymbolFlags globalFlags)
|
|
|
|
{
|
|
|
|
if (has(globalFlags, MakeWhitespaceHalf) && text.contains(' ')) {
|
|
|
|
const QStringList str=text.simplified().trimmed().split(' ');
|
|
|
|
const QRectF brSp=fm.boundingRect("i");
|
|
|
|
QRectF br;
|
|
|
|
for (int i=0; i<str.size(); i++) {
|
|
|
|
const QRectF lbr=fm.tightBoundingRect(str[i]);
|
|
|
|
if (i==0) br=lbr;
|
|
|
|
else {
|
|
|
|
br.setWidth(br.width()+brSp.width()/2.0+lbr.width());
|
|
|
|
if (lbr.top()>br.top()) {
|
|
|
|
br.setTop(lbr.top());
|
|
|
|
}
|
|
|
|
if (lbr.bottom()<br.bottom()) {
|
|
|
|
br.setBottom(lbr.bottom());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return br;
|
|
|
|
} else {
|
|
|
|
return fm.tightBoundingRect(text);
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
2022-07-04 02:30:12 +08:00
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-06 04:03:08 +08:00
|
|
|
void JKQTMathTextSymbolNode::drawText(QPainter &p, const QString &text, GlobalSymbolFlags globalFlags, SymbolFlags symflags)
|
2022-07-04 02:30:12 +08:00
|
|
|
{
|
2022-07-06 04:03:08 +08:00
|
|
|
const QFontMetricsF fm(p.font());
|
2022-07-04 02:30:12 +08:00
|
|
|
if (has(globalFlags, MakeWhitespaceHalf) && text.contains(' ')) {
|
|
|
|
const QStringList str=text.simplified().trimmed().split(' ');
|
|
|
|
const QRectF brSp=fm.boundingRect("i");
|
|
|
|
double x=0;
|
|
|
|
for (int i=0; i<str.size(); i++) {
|
|
|
|
p.drawText(QPointF(x,0), str[i]);
|
|
|
|
x=x+fm.boundingRect(str[i]).width()+brSp.width()/2.0;
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
2022-07-04 02:30:12 +08:00
|
|
|
} else {
|
2022-07-06 04:03:08 +08:00
|
|
|
const QRectF tbr=fm.tightBoundingRect(text);
|
|
|
|
p.save(); auto __finalpaint=JKQTPFinally([&p]() {p.restore();});
|
|
|
|
p.translate(tbr.center());
|
|
|
|
if (has(symflags, RotateSymbol90)) {
|
|
|
|
//qDebug()<<" --> RotateSymbol90";
|
|
|
|
p.rotate(90);
|
|
|
|
}
|
|
|
|
if (has(symflags, FlipSymbolUpDown)) {
|
|
|
|
//qDebug()<<" --> FlipSymbolUpDown";
|
|
|
|
p.scale(1,-1);
|
|
|
|
}
|
|
|
|
if (has(symflags, FlipSymbolLeftRight)) {
|
|
|
|
//qDebug()<<" --> FlipSymbolLeftRight";
|
|
|
|
p.scale(-1,1);
|
|
|
|
}
|
|
|
|
p.translate(-tbr.center());
|
2022-07-04 02:30:12 +08:00
|
|
|
p.drawText(QPointF(0,0), text);
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
2022-07-04 02:30:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double JKQTMathTextSymbolNode::draw(QPainter& painter, double x, double y, JKQTMathTextEnvironment currentEv, const JKQTMathTextNodeSize* /*prevNodeSize*/) {
|
|
|
|
doDrawBoxes(painter, x, y, currentEv);
|
|
|
|
double width=0;
|
|
|
|
double baselineHeight=0;
|
|
|
|
double overallHeight=0, strikeoutPos=0;
|
|
|
|
getSize(painter, currentEv, width, baselineHeight, overallHeight, strikeoutPos);
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
const auto fullProps=symbols.value(symbolName, SymbolFullProps());
|
|
|
|
const GlobalSymbolFlags globalFlags=fullProps.globalFlags;
|
|
|
|
const auto drawProps=fullProps.getDrawingData(currentEv, parentMathText);
|
|
|
|
const QFont f=drawProps.first;
|
2022-07-06 04:03:08 +08:00
|
|
|
const QFont fnonItalic=JKQTMathTextGetNonItalic(drawProps.first);
|
2022-07-04 02:30:12 +08:00
|
|
|
const QFontMetricsF fm(f);
|
2022-07-06 04:03:08 +08:00
|
|
|
const QFontMetricsF fmNonItalic(fnonItalic);
|
2022-07-04 02:30:12 +08:00
|
|
|
const JKQTMathTextSymbolNode::SymbolProps symprops=drawProps.second;
|
|
|
|
const SymbolFlags symflags=symprops.flags;
|
|
|
|
const QString sym=symprops.symbol;
|
|
|
|
const QRectF tbr=getTightBoundingRect(fm, sym, globalFlags);
|
2022-07-06 04:03:08 +08:00
|
|
|
const QRectF tbrNonItalic=getTightBoundingRect(fmNonItalic, sym, globalFlags);
|
2022-07-22 04:17:37 +08:00
|
|
|
//const QRectF br=getBoundingRect(fm, sym, globalFlags);
|
2022-07-04 02:30:12 +08:00
|
|
|
const QRectF tbrNoSymbol=JKQTMathTextGetTightBoundingRect(f, "X", painter.device());
|
|
|
|
const double yShift=symprops.yShiftFactor*tbr.height();
|
|
|
|
const double xShift=(width-tbr.width())/2.0;
|
|
|
|
const QPointF x0(x+xShift-tbr.x(), y+yShift);
|
2022-08-07 23:49:46 +08:00
|
|
|
double italic_xcorrection=fabs(tbr.width()-tbrNonItalic.width());
|
|
|
|
if (fabs(italic_xcorrection)<1e-6) italic_xcorrection=double(fm.boundingRect(' ').width())*parentMathText->getItalicCorrectionFactor();
|
2022-07-04 02:30:12 +08:00
|
|
|
|
|
|
|
//qDebug()<<"SYMB::draw(): symbolName="<<symbolName<<" font="<<f<<" sym="<<sym<<" yShiftFactor="<<symprops.yShiftFactor;
|
|
|
|
|
|
|
|
if (!sym.isEmpty()) {
|
|
|
|
// if the symbol has been recognized in the constructor: draw the symbol
|
|
|
|
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
|
|
|
painter.setFont(f);
|
|
|
|
painter.setPen(currentEv.color);
|
|
|
|
painter.translate(x0);
|
2022-07-06 04:03:08 +08:00
|
|
|
drawText(painter, sym, globalFlags, symflags);
|
|
|
|
if (has(symflags, DrawLeftHBar) || has (symflags, DrawRightHBar)) {
|
|
|
|
//qDebug()<<" -> DrawLeftHBar or DrawRightHBar";
|
2022-07-04 02:30:12 +08:00
|
|
|
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
|
|
|
painter.setPen(QPen(currentEv.color, fm.lineWidth()));
|
2022-08-07 23:49:46 +08:00
|
|
|
const double ybar=-fm.xHeight()*1.1;
|
|
|
|
const double deltaybar=fm.xHeight()*0.2;
|
2022-07-06 04:03:08 +08:00
|
|
|
const double barwidth=tbrNonItalic.width()/2.0;
|
|
|
|
const double xbarstart=(has(symflags, DrawLeftHBar))?italic_xcorrection:(tbr.width()-barwidth);
|
|
|
|
painter.drawLine(xbarstart, ybar, xbarstart+barwidth, ybar-deltaybar);
|
|
|
|
}
|
|
|
|
if (has(symflags, DrawVertLine)) {
|
|
|
|
//qDebug()<<" -> DrawVertLine";
|
|
|
|
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
|
|
|
painter.setPen(QPen(currentEv.color, fm.lineWidth()));
|
|
|
|
const double ybar=tbr.top();
|
|
|
|
const double xbarstart=italic_xcorrection+tbrNonItalic.width()/2.0;
|
|
|
|
const double xbarend=tbrNonItalic.width()/2.0;
|
|
|
|
painter.drawLine(xbarstart, ybar, xbarend, ybar+tbr.height());
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
2022-07-04 02:30:12 +08:00
|
|
|
if (has(symflags, DrawSlash)) {
|
2022-07-06 04:03:08 +08:00
|
|
|
//qDebug()<<" -> DrawSlash";
|
|
|
|
painter.drawText(QPointF((width-fm.boundingRect('/').width())/2.0,0),"/");
|
|
|
|
}
|
|
|
|
if (has(symflags, DrawBackSlash)) {
|
|
|
|
//qDebug()<<" -> DrawBackSlash";
|
|
|
|
painter.drawText(QPointF((width-fm.boundingRect('\\').width())/2.0,0),"\\");
|
2022-07-04 02:30:12 +08:00
|
|
|
}
|
|
|
|
/*painter.save();
|
|
|
|
painter.setPen(QPen(QColor("red"), 0.5, Qt::DotLine));
|
|
|
|
painter.drawEllipse(0,0,5,5);
|
|
|
|
painter.drawRect(tbr);
|
|
|
|
painter.setPen(QPen(QColor("blue"), 0.5, Qt::DashLine));
|
|
|
|
painter.drawRect(br);
|
|
|
|
painter.restore();*/
|
|
|
|
} else { // draw a box to indicate an unavailable symbol
|
|
|
|
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
|
|
|
painter.setPen(QPen(currentEv.color, fm.lineWidth()));
|
|
|
|
painter.drawRect(QRectF(x0.x(), x0.y()-tbrNoSymbol.height(), tbrNoSymbol.width(), tbrNoSymbol.height()));
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
return x+width;
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
bool JKQTMathTextSymbolNode::toHtml(QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) {
|
|
|
|
bool ok=true;
|
|
|
|
const auto props=symbols.value(symbolName, SymbolFullProps());
|
|
|
|
QString s=props.html.symbol;
|
|
|
|
JKQTMathTextEnvironment ev=currentEv;
|
|
|
|
ev.fontSize=ev.fontSize*props.html.fontScalingFactor;
|
|
|
|
if (has(props.globalFlags, ExtendWidthInMathmode)) s=" "+s+" ";
|
|
|
|
if (has(props.globalFlags, MakeWhitespaceHalf)) s.replace(" ", " ");
|
2022-08-02 17:38:40 +08:00
|
|
|
if (ok) html=html+ev.toHtmlStart(defaultEv, parentMathText)+s+ev.toHtmlAfter(defaultEv, parentMathText);
|
2022-07-04 02:30:12 +08:00
|
|
|
return ok;
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
QString JKQTMathTextSymbolNode::getSymbolName() const {
|
|
|
|
return this->symbolName;
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
void JKQTMathTextSymbolNode::getSymbolSize(QPainter &painter, JKQTMathTextEnvironment currentEv, double &width, double &baselineHeight, double &overallHeight, double &strikeoutPos, double &subSuperXCorrection, double &subBesidesXCorrection, const JKQTMathTextNodeSize *prevNodeSize)
|
2022-06-08 21:38:26 +08:00
|
|
|
{
|
2022-07-04 02:30:12 +08:00
|
|
|
double w=width, b=baselineHeight, o=overallHeight, s=strikeoutPos;
|
|
|
|
getSymbolSizeInternal(painter, currentEv, w, b, o, s, subSuperXCorrection, subBesidesXCorrection, prevNodeSize);
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
if (w<1e5) width=w;
|
|
|
|
if (b<1e5) baselineHeight=b;
|
|
|
|
if (o<1e5) overallHeight=o;
|
|
|
|
if (s<1e5) strikeoutPos=s;
|
2022-06-08 21:38:26 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
bool JKQTMathTextSymbolNode::hasSymbol(const QString &symbolName)
|
2022-06-08 21:38:26 +08:00
|
|
|
{
|
2022-07-04 02:30:12 +08:00
|
|
|
fillSymbolTables();
|
|
|
|
return symbols.contains(symbolName);
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-07 04:44:02 +08:00
|
|
|
bool JKQTMathTextSymbolNode::isSubSuperscriptBelowAboveSymbol(const QString &symbolName)
|
|
|
|
{
|
|
|
|
fillSymbolTables();
|
|
|
|
if (symbols.contains(symbolName)) {
|
|
|
|
return has(symbols[symbolName].globalFlags, SubSuperscriptBelowAboveSymbol);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-06-08 21:38:26 +08:00
|
|
|
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolProps::SymbolProps():
|
|
|
|
SymbolProps(QString())
|
|
|
|
{
|
|
|
|
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolProps::SymbolProps(const QString &_symbol, SymbolFlags _flags, double _fontScalingFactor, double _yShiftFactor):
|
|
|
|
symbol(_symbol),
|
|
|
|
flags(_flags),
|
|
|
|
fontScalingFactor(_fontScalingFactor),
|
|
|
|
yShiftFactor(_yShiftFactor)
|
2022-06-08 21:38:26 +08:00
|
|
|
{
|
2022-07-04 02:30:12 +08:00
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::MathOperatorSymbol(const QString &op)
|
|
|
|
{
|
|
|
|
return MathOperatorSymbol(op, op);
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::MathOperatorSymbol(const QString &op, const QString &ophtml)
|
|
|
|
{
|
2022-07-07 04:44:02 +08:00
|
|
|
return SymbolFullProps(SymbolProps(op, ItalicOff|BoldOff, 1.0, 0.0)).addGlobalFlags(ExtendWidthInMathmode).addHtml(ophtml, ItalicOff|BoldOff, 1.0, 0.0);
|
2022-07-04 02:30:12 +08:00
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::MathOperatorText(const QString &op)
|
|
|
|
{
|
|
|
|
return MathOperatorText(op, op);
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::MathOperatorText(const QString &op, const QString &ophtml)
|
|
|
|
{
|
2022-07-07 04:44:02 +08:00
|
|
|
return SymbolFullProps(SymbolProps(op, ItalicOff|BoldOff|HeightIsAscent, 1.0, 0.0)).addGlobalFlags(ExtendWidthInMathmode|MakeWhitespaceHalf).addHtml(ophtml, ItalicOff|BoldOff|HeightIsAscent, 1.0, 0.0);
|
2022-07-04 02:30:12 +08:00
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::MathOperatorSymbolUnicode(const QString &unicode)
|
|
|
|
{
|
2022-07-07 04:44:02 +08:00
|
|
|
return SymbolFullProps(MTFEUnicode, SymbolProps(unicode, ItalicOff|BoldOff, 1.0, 0.0)).addGlobalFlags(ExtendWidthInMathmode|MakeWhitespaceHalf);
|
|
|
|
}
|
|
|
|
|
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::NarrowMathOperatorSymbolUnicode(const QString &unicode)
|
|
|
|
{
|
|
|
|
return SymbolFullProps(MTFEUnicode, SymbolProps(unicode, ItalicOff|BoldOff, 1.0, 0.0)).addGlobalFlags(SmallExtendWidthInMathmode|MakeWhitespaceHalf);
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
|
|
|
|
2022-08-02 17:38:40 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::NarrowMathOperatorSymbolStd(const QString &symbol)
|
|
|
|
{
|
|
|
|
return NarrowMathOperatorSymbolStd(symbol,symbol);
|
|
|
|
}
|
|
|
|
|
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::NarrowMathOperatorSymbolStd(const QString &symbol, const QString &symbolHTML)
|
|
|
|
{
|
|
|
|
return SymbolFullProps(MTFEStandard, SymbolProps(symbol, ItalicOff|BoldOff, 1.0, 0.0)).addHtml(symbol, ItalicOff|BoldOff, 1.0, 0.0).addGlobalFlags(SmallExtendWidthInMathmode|MakeWhitespaceHalf);
|
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::GreekLetter_WinSymbol_Unicode_Html(const QString &letterWinSymbol, const QString &letterUnicode, const QString &html)
|
2022-06-08 21:38:26 +08:00
|
|
|
{
|
2022-07-06 04:03:08 +08:00
|
|
|
return SymbolFullProps(MTFEUnicode, SymbolProps(letterUnicode), MTFEWinSymbol, SymbolProps(letterWinSymbol), html);
|
|
|
|
}
|
|
|
|
|
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::UprightGreekLetter_WinSymbol_Unicode_Html(const QString &letterWinSymbol, const QString &letterUnicode, const QString &html)
|
|
|
|
{
|
|
|
|
return SymbolFullProps(MTFEUnicode, SymbolProps(letterUnicode, ItalicOff), MTFEWinSymbol, SymbolProps(letterWinSymbol, ItalicOff), html, ItalicOff);
|
|
|
|
}
|
|
|
|
|
|
|
|
void JKQTMathTextSymbolNode::addGreekLetterVariants_WinSymbol_Unicode_Html(const QString &baseInstructionName, const QString &letterWinSymbol, const QString &letterUnicode, const QString &html)
|
|
|
|
{
|
|
|
|
symbols[baseInstructionName]=GreekLetter_WinSymbol_Unicode_Html(letterWinSymbol, letterUnicode, html);
|
|
|
|
symbols["text"+baseInstructionName]=GreekLetter_WinSymbol_Unicode_Html(letterWinSymbol, letterUnicode, html);
|
|
|
|
symbols["up"+baseInstructionName]=UprightGreekLetter_WinSymbol_Unicode_Html(letterWinSymbol, letterUnicode, html);
|
2022-07-04 02:30:12 +08:00
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-11 04:01:11 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::StdSymbol(const QString &symbol, const QString &html)
|
2022-07-04 02:30:12 +08:00
|
|
|
{
|
|
|
|
return SymbolFullProps(MTFEStandard, SymbolProps(symbol), html);
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-11 04:01:11 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::UnicodeSymbol(const QString &symbol, SymbolFlags _flags, double _fontScalingFactor, double _yShiftFactor)
|
2022-07-06 04:03:08 +08:00
|
|
|
{
|
|
|
|
return SymbolFullProps(MTFEUnicode, SymbolProps(symbol, _flags, _fontScalingFactor, _yShiftFactor));
|
|
|
|
}
|
|
|
|
|
2022-07-11 04:01:11 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::UnicodeSymbol(const QString &symbol, const QString &html)
|
2022-07-04 02:30:12 +08:00
|
|
|
{
|
|
|
|
return SymbolFullProps(MTFEUnicode, SymbolProps(symbol), html);
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-11 04:01:11 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::StdSymbol(const QString &symbol, SymbolFlags _flags, double _fontScalingFactor, double _yShiftFactor)
|
2022-07-06 04:03:08 +08:00
|
|
|
{
|
|
|
|
return SymbolFullProps(MTFEStandard, SymbolProps(symbol, _flags, _fontScalingFactor, _yShiftFactor), symbol);
|
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::UprightSymbolStd(const QString &symbol, const QString &html)
|
|
|
|
{
|
|
|
|
return SymbolFullProps(MTFEStandard, SymbolProps(symbol, ItalicOff), html, ItalicOff);
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::UprightSymbolUnicode(const QString &symbol, const QString &html)
|
|
|
|
{
|
|
|
|
return SymbolFullProps(MTFEUnicode, SymbolProps(symbol, ItalicOff), html, ItalicOff);
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::SimpleTextSymbol(const QString &symbol, const QString &html)
|
|
|
|
{
|
|
|
|
return SymbolFullProps(MTFEStandard, SymbolProps(symbol), html);
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-06 04:03:08 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::SimpleTextSymbol(const QString &symbol, SymbolFlags _flags, double _fontScalingFactor, double _yShiftFactor)
|
2022-07-04 02:30:12 +08:00
|
|
|
{
|
2022-07-06 04:03:08 +08:00
|
|
|
return SymbolFullProps(MTFEStandard, SymbolProps(symbol, _flags, _fontScalingFactor, _yShiftFactor), symbol);
|
2022-07-04 02:30:12 +08:00
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::SimpleUprightTextSymbol(const QString &symbol, const QString &html)
|
|
|
|
{
|
|
|
|
return SymbolFullProps(MTFEStandard, SymbolProps(symbol, ItalicOff), html, ItalicOff);
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::SimpleUprightTextSymbol(const QString &symbol)
|
|
|
|
{
|
|
|
|
return SymbolFullProps(MTFEStandard, SymbolProps(symbol, ItalicOff), symbol, ItalicOff);
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
QHash<QString, JKQTMathTextSymbolNode::SymbolFullProps> JKQTMathTextSymbolNode::symbols=QHash<QString, JKQTMathTextSymbolNode::SymbolFullProps>();
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
void JKQTMathTextSymbolNode::fillSymbolTables()
|
|
|
|
{
|
|
|
|
if (symbols.size()>0) return; // tables have already been filled! So nothing to do here
|
|
|
|
|
|
|
|
/**************************************************************************************
|
|
|
|
* STANDARD Symbols available in all standard fonts
|
|
|
|
**************************************************************************************/
|
|
|
|
symbols["#"]=SimpleTextSymbol("#", "#");
|
|
|
|
symbols["%"]=SimpleTextSymbol("%", "≫");
|
|
|
|
symbols["&"]=SimpleTextSymbol("&", "&");
|
|
|
|
symbols["("]=SimpleUprightTextSymbol("(");
|
|
|
|
symbols[")"]=SimpleUprightTextSymbol(")");
|
|
|
|
symbols["["]=SimpleUprightTextSymbol("[");
|
|
|
|
symbols["]"]=SimpleUprightTextSymbol("]");
|
|
|
|
symbols["_"]=SimpleTextSymbol("_");
|
|
|
|
symbols["{"]=SimpleUprightTextSymbol("{");
|
|
|
|
symbols["|"]=SimpleUprightTextSymbol("||", "‖").addUprightUnicode(QChar(0x2016));
|
|
|
|
symbols["}"]=SimpleUprightTextSymbol("}");
|
|
|
|
symbols["AC"]=UprightSymbolUnicode(QChar(0x223F)).addUprightHtml("∿").addUprightStd("~");
|
2022-07-07 03:00:03 +08:00
|
|
|
symbols["aa"]=SimpleTextSymbol(QChar(0xE5));
|
|
|
|
symbols["ae"]=SimpleTextSymbol(QChar(0xE6));
|
|
|
|
symbols["AE"]=SimpleTextSymbol(QChar(0xC6));
|
|
|
|
symbols["AA"]=SimpleTextSymbol(QChar(0xC5));
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["oe"]=UnicodeSymbol(QChar(0x153)).addStd("oe").addHtml("œ");
|
|
|
|
symbols["OE"]=UnicodeSymbol(QChar(0x152)).addStd("OE").addHtml("Œ");
|
2022-07-07 03:00:03 +08:00
|
|
|
symbols["ss"]=SimpleTextSymbol(QChar(0xDF)).addHtml("ß");
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["l"]=UnicodeSymbol(QChar(0x141)).addHtml("ł");
|
|
|
|
symbols["L"]=UnicodeSymbol(QChar(0x142)).addHtml("Ł");
|
|
|
|
symbols["o"]=SimpleTextSymbol(QChar(0xF8)).addHtml("ø");
|
|
|
|
symbols["O"]=SimpleTextSymbol(QChar(0xD8)).addHtml("Ø");
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=UprightSymbolUnicode(QChar(0x212B)).addUprightStd(QChar(0xC5));
|
|
|
|
symbols["Angstrom"]=s; symbols["Angstroem"]=s; }
|
2022-07-11 04:01:11 +08:00
|
|
|
{ auto s=UnicodeSymbol(QChar(0x2136)).addHtml("ℶ");
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["Beth"]=s; symbols["Bet"]=s; symbols["beth"]=s; symbols["bet"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["Box"]=UprightSymbolUnicode(QChar(0x25A1));
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["DC"]=UnicodeSymbol(QChar(0x2393)).addWinSymbol(QChar(0xBB)).addStd("=");
|
|
|
|
symbols["EUR"]=UnicodeSymbol(QChar(0x20AC));
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["Im"]=UprightSymbolUnicode(QChar(0x2111)).addHtml("ℑ").addWinSymbol(QChar(0xC1));
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["No"]=UnicodeSymbol(QChar(0x2116));
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=UprightSymbolUnicode(QChar(0x2126)).addUprightWinSymbol("W").addUprightHtml("Ω");
|
|
|
|
symbols["Ohm"]=s; symbols["ohm"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["P"]=SimpleTextSymbol(QChar(0xB6)).addHtml("¶");
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["Re"]=UnicodeSymbol(QChar(0x211C)).addHtml("ℜ").addWinSymbol(QChar(0xC2));
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=SimpleTextSymbol(QChar(0xA7)).addHtml("§");
|
|
|
|
symbols["S"]=s; symbols["§"]=s;}
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["accurrent"]=UnicodeSymbol(QChar(0x23E6));
|
|
|
|
{ auto s=UnicodeSymbol(QChar(0x2135)).addHtml("ℵ").addWinSymbol(QChar(0xC0));
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["alef"]=s; symbols["aleph"]=s; symbols["Aleph"]=s; symbols["Alef"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["angle"]=UprightSymbolUnicode(QChar(0x2220)).addHtml("∠").addWinSymbol(QChar(0xD0));
|
|
|
|
symbols["backslash"]=SimpleTextSymbol("\\");
|
|
|
|
symbols["benzene"]=UprightSymbolUnicode(QChar(0x232C));
|
|
|
|
symbols["benzenr"]=UprightSymbolUnicode(QChar(0x23E3));
|
|
|
|
symbols["blacksquare"]=UprightSymbolUnicode(QChar(0x220E)).addHtml("□");
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=UprightSymbolUnicode(QChar(0x231E));
|
|
|
|
symbols["blcorner"]=s; symbols["llcorner"]=s; }
|
|
|
|
{ auto s=UprightSymbolUnicode(QChar(0x231F));
|
|
|
|
symbols["brcorner"]=s; symbols["lrcorner"]=s; }
|
2022-08-01 17:44:38 +08:00
|
|
|
{ auto s=UprightSymbolUnicode(QChar(0x2022)).addUprightHtml("•").addUprightWinSymbol(QChar(0xB7));
|
|
|
|
symbols["bullet"]=s; symbols["textbullet"]=s; }
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["cdots"]=UnicodeSymbol(QChar(0x22EF)).addHtml("···").addStd(QString(3, QChar(0xB7)));
|
|
|
|
{ auto s=UnicodeSymbol(QChar(0x2103)).addUprightStd("°C").addUprightHtml("°C");
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["celsius"]=s; symbols["degC"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["cent"]=SimpleTextSymbol(QChar(0xA2), "¢");
|
2022-07-07 03:00:03 +08:00
|
|
|
symbols["checkmark"]=UprightSymbolStd(QChar(0x2713)).addUprightHtml("✓");
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["circ"]=UprightSymbolStd(QChar(0x2218)).addUprightHtml("∘").addStd("o", ItalicOff,0.7, -0.25);
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["co"]=UprightSymbolUnicode(QChar(0x2105));
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=SimpleTextSymbol(QChar(0xA5), "©");
|
|
|
|
symbols["copyright"]=s; symbols["textcopyright"]=s; }
|
2022-07-07 03:00:03 +08:00
|
|
|
{ auto s=UprightSymbolUnicode(QChar(0x2020)).addUprightHtml("†");
|
|
|
|
symbols["dagger"]=s; symbols["dag"]=s; symbols["textdagger"]=s; }
|
|
|
|
{ auto s=UprightSymbolUnicode(QChar(0x2021)).addUprightHtml("‡");
|
|
|
|
symbols["ddagger"]=s; symbols["ddag"]=s; symbols["textdaggerdbl"]=s; }
|
2022-07-11 04:01:11 +08:00
|
|
|
{ auto s=UnicodeSymbol(QChar(0x2138)).addHtml("ℸ");
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["dalet"]=s; symbols["Dalet"]=s; symbols["daleth"]=s; symbols["Daleth"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["dd"] = SymbolFullProps(SymbolProps("d", Upright|BoldOff), "d", Upright|BoldOff);
|
|
|
|
symbols["diamond"]=UprightSymbolUnicode(QChar(0x22C4)).addHtml("⋄").addWinSymbol(QChar(0xE0));
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["dollar"]=UnicodeSymbol(QChar(0x0024));
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=SimpleTextSymbol(QChar(0x24), "$");
|
|
|
|
symbols["dollar"]=s; symbols["$"]=s; }
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["dprime"]=UnicodeSymbol(QChar(0x2033)).addHtml("″").addStd("''");
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["ee"] = SymbolFullProps(SymbolProps("e", Upright|BoldOff), "e", Upright|BoldOff);
|
2022-07-11 04:01:11 +08:00
|
|
|
{ auto s=UnicodeSymbol(QChar(0x2026)).addHtml("…").addWinSymbol(QChar(0xBC)).addStd("...");
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["ellipsis"]=s; symbols["dots"]=s; symbols["ldots"]=s; }
|
|
|
|
{ auto s=SimpleTextSymbol(QChar(0x20AC), "€");
|
|
|
|
symbols["euro"]=s; symbols["EUR"]=s; }
|
2022-07-11 04:01:11 +08:00
|
|
|
{ auto s=UnicodeSymbol(QChar(0x2109));
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["fahrenheit"]=s; symbols["degF"]=s; }
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["female"]=UnicodeSymbol(QChar(0x2640)).addHtml("♀");
|
|
|
|
symbols["flq"]=UnicodeSymbol(QChar(0x2039)).addHtml("‹").addStd("<");
|
|
|
|
symbols["flqq"]=UnicodeSymbol(QChar(0x00AB)).addHtml("«").addStd(QChar(0xAB));
|
|
|
|
symbols["frown"]=UnicodeSymbol(QChar(0x2322)).addHtml("⌢");
|
|
|
|
symbols["frq"]=UnicodeSymbol(QChar(0x203A)).addHtml("›").addStd(">");
|
|
|
|
symbols["frqq"]=UnicodeSymbol(QChar(0x00BB)).addHtml("»").addStd(QChar(0xBB));
|
|
|
|
{ auto s=UnicodeSymbol(QChar(0x2137)).addHtml("ℷ");
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["gimel"]=s; symbols["Gimel"]=s; }
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["glq"]=UnicodeSymbol(QChar(0x2018)).addHtml("‘").addStd("'");
|
|
|
|
symbols["glqq"]=UnicodeSymbol(QChar(0x201C)).addHtml("“").addStd("\"");
|
|
|
|
symbols["grq"]=UnicodeSymbol(QChar(0x2019)).addHtml("’").addStd("'");
|
|
|
|
symbols["grqq"]=UnicodeSymbol(QChar(0x201D)).addHtml("”").addStd("\"");
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["hbar"]=UprightSymbolUnicode(QChar(0x210F)).addUprightHtml("ℏ").addStd("h", ItalicOn|DrawLeftHBar);
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["hexagon"]=UprightSymbolUnicode(QChar(0x2394));
|
|
|
|
symbols["ii"] = SymbolFullProps(SymbolProps("i", Upright|BoldOff), "i", Upright|BoldOff);
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["infty"]=UnicodeSymbol(QChar(0x221E)).addHtml("∞").addWinSymbol(QChar(0xA5)).addStd("8", RotateSymbol90);
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["langle"]=UprightSymbolUnicode(QChar(0x2329)).addWinSymbol(QChar(0xE1));
|
|
|
|
symbols["lceil"]=UprightSymbolUnicode(QChar(0x2308)).addHtml("⌈").addWinSymbol(QChar(0xE9));
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=SimpleTextSymbol("...").addUnicode(QChar(0x2026)).addWinSymbol(QChar(0xB6));
|
|
|
|
symbols["ldots"]=s; symbols["dots"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["lfloor"]=UprightSymbolUnicode(QChar(0x230A)).addHtml("⌊").addWinSymbol(QChar(0xEB));
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["lightning"]=UnicodeSymbol(QChar(0x21AF));
|
|
|
|
symbols["male"]=UnicodeSymbol(QChar(0x2642)).addHtml("♂");
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["measuredangle"]=UprightSymbolUnicode(QChar(0x2221)).addHtml("∡");
|
|
|
|
symbols["micro"] = SimpleTextSymbol(QChar(0xB5), "µ");
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["ohm"]=UprightSymbolUnicode(QChar(0x2126)).addUprightHtml("Ω").addUprightWinSymbol(QChar(0x57));
|
|
|
|
symbols["partial"]=UprightSymbolUnicode(QChar(0x2202)).addUprightHtml("∂").addUprightWinSymbol(QChar(0xB6));
|
2022-07-11 04:01:11 +08:00
|
|
|
{ auto s=UnicodeSymbol(QChar(0x2030)).addHtml("‰");
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["perthousand"]=s; symbols["permil"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["pound"]=SimpleTextSymbol(QChar(0xA3), "£");
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["pound"]=UnicodeSymbol(QChar(0x00A3));
|
|
|
|
symbols["prime"]=UnicodeSymbol(QChar(0x2032)).addHtml("′").addStd("'");
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["rangle"]=UprightSymbolUnicode(QChar(0x232A)).addWinSymbol(QChar(0xF1));
|
|
|
|
symbols["rceil"]=UprightSymbolUnicode(QChar(0x2309)).addHtml("⌉").addWinSymbol(QChar(0xF9));
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=SimpleTextSymbol(QChar(0xAA), "®");
|
|
|
|
symbols["registered"]=s; symbols["textregistered"]=s; symbols["circledR"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["rfloor"]=UprightSymbolUnicode(QChar(0x230B)).addHtml("⌋").addWinSymbol(QChar(0xFB));
|
|
|
|
symbols["rightangle"]=UprightSymbolUnicode(QChar(0x221F)).addHtml("∟");
|
|
|
|
symbols["smile"]=UprightSymbolUnicode(QChar(0x2323)).addHtml("⌣");
|
|
|
|
symbols["sphericalangle"]=UprightSymbolUnicode(QChar(0x2222)).addHtml("∢");
|
|
|
|
symbols["star"]=UprightSymbolUnicode(QChar(0x22C6));
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["tcohm"]=UnicodeSymbol(QChar(0x2126));
|
2022-08-01 17:44:38 +08:00
|
|
|
{ auto s=UnicodeSymbol(QChar(0x2014), "⹀");
|
|
|
|
symbols["dblhyphen"]=s; symbols["textdblhyphen"]=s; symbols["textdblhyphenchar"]=s; }
|
|
|
|
{ auto s=UnicodeSymbol(QChar(0x2014), "—");
|
|
|
|
symbols["---"]=s; symbols["textemdash"]=s; symbols["emdash"]=s; }
|
|
|
|
{ auto s=UnicodeSymbol(QChar(0x2013), "–");
|
|
|
|
symbols["--"]=s; symbols["textendash"]=s; symbols["endash"]=s; }
|
|
|
|
{ auto s=SimpleTextSymbol("-");
|
|
|
|
symbols["texthyphen"]=s; symbols["hyphen"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["textbar"]=SimpleTextSymbol("|", "|");
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=SimpleTextSymbol(QChar(0xB0), "°");
|
|
|
|
symbols["textdegree"]=s; symbols["degree"] = s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["textgreater"]=SimpleTextSymbol(">", ">");
|
|
|
|
symbols["textless"]=SimpleTextSymbol("<", "<");
|
2022-08-01 17:44:38 +08:00
|
|
|
symbols["textquestiondown"]=SimpleTextSymbol(QChar(0xBF), "¿");
|
|
|
|
symbols["textexclamdown"]=SimpleTextSymbol(QChar(0xA1), "¡");
|
2022-07-11 04:01:11 +08:00
|
|
|
{ auto s=UnicodeSymbol(QChar(0x231C));
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["tlcorner"]=s; symbols["ulcorner"]=s; }
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["trademark"]=UnicodeSymbol(QChar(0x2122)).addHtml("™").addWinSymbol(QChar(0xD4)).addStd("(TM)");
|
|
|
|
symbols["trapezium"]=UnicodeSymbol(QChar(0x23E2)).addHtml("⏢");
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=UprightSymbolUnicode(QChar(0x231D));
|
|
|
|
symbols["trcorner"]=s; symbols["urcorner"]=s; }
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["trprime"]=UnicodeSymbol(QChar(0x2034)).addHtml("‴").addStd("'''");
|
|
|
|
symbols["varcarriagereturn"]=UnicodeSymbol(QChar(0x23CE)).addWinSymbol(QChar(0xBF));
|
|
|
|
symbols["varhexagonlrbonds"]=UnicodeSymbol(QChar(0x232C));
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["yen"]=SimpleTextSymbol(QChar(0xA5), "¥");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************************
|
|
|
|
* STANDARD MathOperator Strings
|
|
|
|
**************************************************************************************/
|
|
|
|
symbols["Pr"] = MathOperatorText("Pr");
|
2022-07-07 04:44:02 +08:00
|
|
|
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["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["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["max"] = MathOperatorText("max").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
|
|
|
|
symbols["median"] = MathOperatorText("median").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
|
|
|
|
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);
|
2022-07-04 02:30:12 +08:00
|
|
|
|
|
|
|
/**************************************************************************************
|
|
|
|
* STANDARD MathOperator Symbols
|
|
|
|
**************************************************************************************/
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=MathOperatorSymbolUnicode(QChar(0x2217)).addMathOperatorStd("*").addMathOperatorHtml("*");
|
|
|
|
symbols["*"]=s; symbols["ast"]=s; symbols["asterisk"]=s; }
|
2022-08-02 17:38:40 +08:00
|
|
|
symbols["/"]=NarrowMathOperatorSymbolStd("/");
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["+"]=MathOperatorSymbolUnicode(QChar(0x2B)).addMathOperatorHtml("+").addMathOperatorStd("+");
|
|
|
|
symbols["-"]=MathOperatorSymbolUnicode(QChar(0x2212)).addMathOperatorHtml("-").addMathOperatorStd("-");
|
|
|
|
symbols["<"]=MathOperatorSymbol("<", "<");
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["="]=MathOperatorSymbol("=");
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols[">"]=MathOperatorSymbol(">", ">");
|
|
|
|
symbols["Downarrow"]=UprightSymbolUnicode(QChar(0x21D3)).addUprightHtml("⇓").addUprightWinSymbol(QChar(0xDF));
|
|
|
|
symbols["Leftarrow"]=UprightSymbolUnicode(QChar(0x21D0)).addUprightHtml("⇐").addUprightWinSymbol(QChar(0xDC));
|
|
|
|
symbols["Rightarrow"]=UprightSymbolUnicode(QChar(0x21D2)).addUprightHtml("⇒").addUprightWinSymbol(QChar(0xDE));
|
|
|
|
symbols["Uparrow"]=UprightSymbolUnicode(QChar(0x21D1)).addUprightHtml("⇑").addUprightWinSymbol(QChar(0xDD));
|
|
|
|
symbols["Updownarrow"]=UprightSymbolUnicode(QChar(0x21D5)).addUprightHtml("⇕");
|
|
|
|
symbols["approx"]=MathOperatorSymbolUnicode(QChar(0x2248)).addMathOperatorHtml("≈").addMathOperatorWinSymbol(QChar(0xBB));
|
2022-07-11 04:01:11 +08:00
|
|
|
symbols["bbC"]=UnicodeSymbol(QChar(0x2102));
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["bbH"]=MathOperatorSymbolUnicode(QChar(0x210D));
|
|
|
|
symbols["bbN"]=MathOperatorSymbolUnicode(QChar(0x2115));
|
|
|
|
symbols["bbP"]=MathOperatorSymbolUnicode(QChar(0x2119));
|
|
|
|
symbols["bbQ"]=MathOperatorSymbolUnicode(QChar(0x211A));
|
|
|
|
symbols["bbR"]=MathOperatorSymbolUnicode(QChar(0x211D));
|
|
|
|
symbols["bbZ"]=MathOperatorSymbolUnicode(QChar(0x2124));
|
|
|
|
symbols["because"]=MathOperatorSymbolUnicode(QChar(0x2235)).addMathOperatorHtml("∵");
|
2022-07-07 04:44:02 +08:00
|
|
|
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);
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=MathOperatorSymbolUnicode(QChar(0x22A5)).addMathOperatorHtml("⊥");
|
|
|
|
symbols["bot"]=s; symbols["perp"]=s; }
|
|
|
|
{ auto s=MathOperatorSymbolUnicode(QChar(0x2229)).addMathOperatorHtml("∩").addMathOperatorWinSymbol(QChar(0xC7));
|
|
|
|
symbols["cap"]=s; symbols["land"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["cdot"]=MathOperatorSymbol(QChar(0xB7)).addMathOperatorHtml("·").addMathOperatorWinSymbol(QChar(0xD7));
|
|
|
|
symbols["cong"]=MathOperatorSymbolUnicode(QChar(0x2245)).addMathOperatorHtml("≅");
|
2022-07-07 04:44:02 +08:00
|
|
|
symbols["coprod"]=NarrowMathOperatorSymbolUnicode(QChar(0x2210)).addMathOperatorHtml("∐").addWinSymbol(QChar(0xD5), ItalicOff|BoldOff|FlipSymbolUpDown, 1.8, 0.1).addGlobalFlags(SubSuperscriptBelowAboveSymbol);
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=MathOperatorSymbolUnicode(QChar(0x222A)).addMathOperatorHtml("∪").addMathOperatorWinSymbol(QChar(0xC8));
|
|
|
|
symbols["cup"]=s; symbols["lor"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["ddots"]=MathOperatorSymbolUnicode(QChar(0x22F1)).addMathOperatorHtml("⋱");
|
|
|
|
symbols["div"]=MathOperatorSymbolUnicode(QChar(0x00F7)).addMathOperatorHtml("÷").addMathOperatorWinSymbol(QChar(0xB8));
|
|
|
|
symbols["downarrow"]=UprightSymbolUnicode(QChar(0x2193)).addUprightHtml("↓").addUprightWinSymbol(QChar(0xAF));
|
|
|
|
symbols["downharpoonleft"]=UprightSymbolUnicode(QChar(0x21C3)).addUprightHtml("⇃");
|
|
|
|
symbols["downharpoonright"]=UprightSymbolUnicode(QChar(0x21C2)).addUprightHtml("⇂");
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=MathOperatorSymbolUnicode(QChar(0x2205)).addMathOperatorHtml("∅").addMathOperatorWinSymbol(QChar(0xC6)).addStd("0", BoldOff|ItalicOff|DrawSlash);
|
|
|
|
symbols["emptyset"]=s; symbols["varnothing"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["equiv"]=MathOperatorSymbolUnicode(QChar(0x2261)).addMathOperatorHtml("≡").addMathOperatorWinSymbol(QChar(0xBA));
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["exists"]=MathOperatorSymbolUnicode(QChar(0x2203)).addMathOperatorHtml("∃").addMathOperatorWinSymbol(QChar(0x24)).addStd("E", ItalicOff|BoldOff|FlipSymbolLeftRight);
|
|
|
|
symbols["forall"]=MathOperatorSymbolUnicode(QChar(0x2200)).addMathOperatorHtml("∀").addMathOperatorWinSymbol(QChar(0x22)).addStd("A", ItalicOff|BoldOff|FlipSymbolUpDown);
|
|
|
|
{ auto s=MathOperatorSymbolUnicode(QChar(0x2265)).addMathOperatorHtml("≥").addMathOperatorWinSymbol(QChar(0xB3));
|
|
|
|
symbols["geq"]=s; symbols["ge"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["geqq"]=MathOperatorSymbolUnicode(QChar(0x2267)).addMathOperatorHtml("≧");
|
|
|
|
symbols["gg"]=MathOperatorSymbolUnicode(QChar(0x226B)).addMathOperatorHtml("≫").addMathOperatorStd(">>");
|
|
|
|
symbols["iddots"]=MathOperatorSymbolUnicode(QChar(0x22F0)).addMathOperatorHtml("⋰");
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=UprightSymbolUnicode(QChar(0x21D4)).addUprightHtml("⇔").addUprightWinSymbol(QChar(0xDB));
|
|
|
|
symbols["iff"]=s; symbols["Leftrightarrow"]=s; }
|
2022-07-07 04:44:02 +08:00
|
|
|
symbols["iiint"]=NarrowMathOperatorSymbolUnicode(QChar(0x222D)).addGlobalFlags(IntLikeSymbolCorrection | SubSuperscriptBelowAboveSymbol).addMathOperatorHtml("∭").addMathOperatorWinSymbol(QString(3, QChar(0xF2)), 1.8, 0.1);
|
|
|
|
symbols["iint"]=NarrowMathOperatorSymbolUnicode(QChar(0x222C)).addGlobalFlags(IntLikeSymbolCorrection | SubSuperscriptBelowAboveSymbol).addMathOperatorHtml("∬").addMathOperatorWinSymbol(QString(2, QChar(0xF2)), 1.8, 0.1);
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["in"]=MathOperatorSymbolUnicode(QChar(0x2208)).addMathOperatorHtml("∈").addMathOperatorWinSymbol(QChar(0xCE));
|
2022-07-07 04:44:02 +08:00
|
|
|
symbols["int"]=NarrowMathOperatorSymbolUnicode(QChar(0x222B)).addGlobalFlags(IntLikeSymbolCorrection | SubSuperscriptBelowAboveSymbol).addMathOperatorHtml("∫").addMathOperatorWinSymbol(QChar(0xF2), 1.8, 0.1);
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["leftarrow"]=UprightSymbolUnicode(QChar(0x2190)).addUprightHtml("←").addUprightWinSymbol(QChar(0xAC));
|
|
|
|
symbols["leftharpoondown"]=UprightSymbolUnicode(QChar(0x21BD)).addUprightHtml("↽");
|
|
|
|
symbols["leftharpoonup"]=UprightSymbolUnicode(QChar(0x21BC)).addUprightHtml("↼");
|
|
|
|
symbols["leftrightarrow"]=UprightSymbolUnicode(QChar(0x2194)).addUprightHtml("↔").addUprightWinSymbol(QChar(0xAB));
|
|
|
|
symbols["leftrightharpoon"]=UprightSymbolUnicode(QChar(0x21CB)).addUprightHtml("⇋");
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=MathOperatorSymbolUnicode(QChar(0x2264)).addMathOperatorHtml("≤").addMathOperatorWinSymbol(QChar(0xA3));
|
|
|
|
symbols["leq"]=s; symbols["le"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["leqq"]=MathOperatorSymbolUnicode(QChar(0x2266)).addMathOperatorHtml("≦");
|
|
|
|
symbols["ll"]=MathOperatorSymbolUnicode(QChar(0x226A)).addMathOperatorHtml("≪").addMathOperatorStd("<<");
|
|
|
|
symbols["lnot"]=MathOperatorSymbolUnicode(QChar(0xAC)).addMathOperatorWinSymbol(QChar(0xD8)).addMathOperatorHtml("¬");
|
|
|
|
symbols["mapimage"]=MathOperatorSymbolUnicode(QChar(0x22B7)).addMathOperatorHtml("⊷");
|
|
|
|
symbols["maporiginal"]=MathOperatorSymbolUnicode(QChar(0x22B6)).addMathOperatorHtml("⊶");
|
|
|
|
symbols["mapsto"]=MathOperatorSymbolUnicode(QChar(0x21A6)).addMathOperatorHtml("↦");
|
|
|
|
symbols["mid"]=MathOperatorSymbolUnicode(QChar(0x2223)).addMathOperatorHtml("∣").addMathOperatorWinSymbol(QChar(0xBD)).addMathOperatorStd("|");
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["mp"]=MathOperatorSymbolUnicode(QChar(0x2213)).addMathOperatorHtml("∓").addWinSymbol(QChar(0xB1),ItalicOff|BoldOff|FlipSymbolUpDown).addStd(QChar(0xB1),ItalicOff|BoldOff|FlipSymbolUpDown);
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["multimap"]=MathOperatorSymbolUnicode(QChar(0x22B8)).addMathOperatorHtml("⊸");
|
|
|
|
symbols["nabla"]=MathOperatorSymbolUnicode(QChar(0x2207)).addMathOperatorHtml("∇").addMathOperatorWinSymbol(QChar(0xD1));
|
|
|
|
symbols["ne"]=MathOperatorSymbolUnicode(QChar(0x2260)).addMathOperatorHtml("≠").addMathOperatorWinSymbol(QChar(0xB9));
|
|
|
|
symbols["nearrow"]=UprightSymbolUnicode(QChar(0x2197)).addUprightHtml("↗");
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=MathOperatorSymbolUnicode(QChar(0x00AC)).addMathOperatorHtml("¬").addMathOperatorWinSymbol(QChar(0xD8));
|
|
|
|
symbols["neg"]=s; symbols["lnot"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["neq"]=MathOperatorSymbolUnicode(QChar(0x2260)).addMathOperatorHtml("≠").addMathOperatorWinSymbol(QChar(0xB9)).addStd("=", ItalicOff|BoldOff|DrawSlash);
|
2022-07-06 04:03:08 +08:00
|
|
|
symbols["nexists"]=MathOperatorSymbolUnicode(QChar(0x2204)).addMathOperatorHtml("∄").addStd("E", ItalicOff|BoldOff|FlipSymbolLeftRight|DrawSlash).addMathOperatorWinSymbol(QChar(0x24), ItalicOff|BoldOff|DrawSlash);
|
|
|
|
symbols["ni"]=MathOperatorSymbolUnicode(QChar(0x220B)).addMathOperatorHtml("∋").addMathOperatorWinSymbol(QChar(0xCE), ItalicOff|BoldOff|FlipSymbolLeftRight);
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["nmid"]=MathOperatorSymbolUnicode(QChar(0x2224)).addMathOperatorHtml("∤");
|
|
|
|
symbols["notin"]=MathOperatorSymbolUnicode(QChar(0x2209)).addMathOperatorHtml("∉").addMathOperatorWinSymbol(QChar(0xCF));
|
|
|
|
symbols["notni"]=MathOperatorSymbolUnicode(QChar(0x220C)).addMathOperatorHtml("∌");
|
|
|
|
symbols["nparallel"]=MathOperatorSymbolUnicode(QChar(0x2226)).addMathOperatorHtml("∦");
|
|
|
|
symbols["nwarrow"]=UprightSymbolUnicode(QChar(0x2196)).addUprightHtml("↖");
|
|
|
|
symbols["odot"]=MathOperatorSymbolUnicode(QChar(0x2299)).addMathOperatorHtml("⊙");
|
2022-07-07 04:44:02 +08:00
|
|
|
symbols["oiiint"]=NarrowMathOperatorSymbolUnicode(QChar(0x2230)).addGlobalFlags(IntLikeSymbolCorrection | SubSuperscriptBelowAboveSymbol).addMathOperatorHtml("∰");
|
|
|
|
symbols["oiint"]=NarrowMathOperatorSymbolUnicode(QChar(0x222F)).addGlobalFlags(IntLikeSymbolCorrection | SubSuperscriptBelowAboveSymbol).addMathOperatorHtml("∯");
|
|
|
|
symbols["oint"]=NarrowMathOperatorSymbolUnicode(QChar(0x222E)).addGlobalFlags(IntLikeSymbolCorrection | SubSuperscriptBelowAboveSymbol).addMathOperatorHtml("∮");
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["ominus"]=MathOperatorSymbolUnicode(QChar(0x2296)).addMathOperatorHtml("⊖");
|
|
|
|
symbols["oplus"]=MathOperatorSymbolUnicode(QChar(0x2295)).addMathOperatorHtml("⊕").addMathOperatorWinSymbol(QChar(0xC5));
|
|
|
|
symbols["oslash"]=MathOperatorSymbolUnicode(QChar(0x2298)).addMathOperatorHtml("⊘");
|
|
|
|
symbols["otimes"]=MathOperatorSymbolUnicode(QChar(0x2297)).addMathOperatorHtml("⊗").addMathOperatorWinSymbol(QChar(0xC4));
|
|
|
|
symbols["parallel"]=MathOperatorSymbolUnicode(QChar(0x2225)).addMathOperatorHtml("∥").addMathOperatorStd("||");
|
|
|
|
symbols["pm"] = MathOperatorSymbol(QChar(0xB1), "±").addMathOperatorWinSymbol(QChar(0xB1));
|
|
|
|
symbols["prec"]=MathOperatorSymbolUnicode(QChar(0x227A)).addMathOperatorHtml("≺");
|
2022-07-07 04:44:02 +08:00
|
|
|
symbols["prod"]=NarrowMathOperatorSymbolUnicode(QChar(0x220F)).addMathOperatorWinSymbol(QChar(0xD5), 1.8, 0.1).addMathOperatorHtml("∏").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["propto"]=MathOperatorSymbolUnicode(QChar(0x221D)).addMathOperatorWinSymbol(QChar(0xB5)).addMathOperatorHtml("∝");
|
|
|
|
symbols["rightharpoondown"]=UprightSymbolUnicode(QChar(0x21C1)).addUprightHtml("⇁");
|
|
|
|
symbols["rightharpoonup"]=UprightSymbolUnicode(QChar(0x21C0)).addUprightHtml("⇀");
|
|
|
|
symbols["rightleftharpoon"]=UprightSymbolUnicode(QChar(0x21CC)).addUprightHtml("⇌");
|
|
|
|
symbols["searrow"]=UprightSymbolUnicode(QChar(0x2198)).addUprightHtml("↘");
|
|
|
|
symbols["setminus"]=MathOperatorSymbolUnicode(QChar(0x2216)).addMathOperatorHtml("∖");
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=MathOperatorSymbolUnicode(QChar(0x223C)).addMathOperatorHtml("˜").addMathOperatorStd("~");
|
2022-07-09 05:15:42 +08:00
|
|
|
symbols["~"]=s; symbols["sim"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["simeq"]=MathOperatorSymbolUnicode(QChar(0x2243)).addMathOperatorHtml("≃");
|
|
|
|
symbols["sqcap"]=MathOperatorSymbolUnicode(QChar(0x2293)).addMathOperatorHtml("⊓");
|
|
|
|
symbols["sqcup"]=MathOperatorSymbolUnicode(QChar(0x2294)).addMathOperatorHtml("⊔");
|
|
|
|
symbols["square"]=MathOperatorSymbolUnicode(QChar(0x25A1));
|
|
|
|
symbols["subset"]=MathOperatorSymbolUnicode(QChar(0x2282)).addMathOperatorHtml("⊂").addMathOperatorWinSymbol(QChar(0xCC));
|
|
|
|
symbols["subseteq"]=MathOperatorSymbolUnicode(QChar(0x2286)).addMathOperatorHtml("⊆").addMathOperatorWinSymbol(QChar(0xCD));
|
|
|
|
symbols["subsetnot"]=MathOperatorSymbolUnicode(QChar(0x2284)).addMathOperatorHtml("⊄").addMathOperatorWinSymbol(QChar(0xCB));
|
|
|
|
symbols["succ"]=MathOperatorSymbolUnicode(QChar(0x227B)).addMathOperatorHtml("≻");
|
2022-07-07 04:44:02 +08:00
|
|
|
symbols["sum"]=NarrowMathOperatorSymbolUnicode(QChar(0x2211)).addMathOperatorWinSymbol(QChar(0xE5), 1.8, 0.1).addMathOperatorHtml("∑").addGlobalFlags(SubSuperscriptBelowAboveSymbol);
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["supset"]=MathOperatorSymbolUnicode(QChar(0x2283)).addMathOperatorHtml("⊃").addMathOperatorWinSymbol(QChar(0xC9));
|
|
|
|
symbols["supseteq"]=MathOperatorSymbolUnicode(QChar(0x2287)).addMathOperatorHtml("⊇").addMathOperatorWinSymbol(QChar(0xCA));
|
|
|
|
symbols["supsetnot"]=MathOperatorSymbolUnicode(QChar(0x2285)).addMathOperatorHtml("⊅");
|
|
|
|
symbols["swarrow"]=UprightSymbolUnicode(QChar(0x2199)).addUprightHtml("↙");
|
|
|
|
symbols["therefore"]=MathOperatorSymbolUnicode(QChar(0x2234)).addMathOperatorHtml("∴").addMathOperatorWinSymbol(QChar(0x5C));
|
|
|
|
symbols["times"] = MathOperatorSymbol(QChar(0xD7), "×").addMathOperatorWinSymbol(QChar(0xB4));
|
2022-07-06 04:03:08 +08:00
|
|
|
{ auto s=UprightSymbolUnicode(QChar(0x2192)).addUprightHtml("→").addUprightWinSymbol(QChar(0xAE));
|
|
|
|
symbols["to"]=s; symbols["rightarrow"]=s; }
|
2022-07-04 02:30:12 +08:00
|
|
|
symbols["top"]=MathOperatorSymbolUnicode(QChar(0x22A4)).addMathOperatorHtml("⊤").addMathOperatorWinSymbol(QChar(0x5E));
|
|
|
|
symbols["triangle"]=MathOperatorSymbolUnicode(QChar(0x2206));
|
|
|
|
symbols["uparrow"]=UprightSymbolUnicode(QChar(0x2191)).addUprightHtml("↑").addUprightWinSymbol(QChar(0xAD));
|
|
|
|
symbols["updownarrow"]=UprightSymbolUnicode(QChar(0x2195)).addUprightHtml("↕");
|
|
|
|
symbols["upharpoonleft"]=UprightSymbolUnicode(QChar(0x21BF)).addUprightHtml("↿");
|
|
|
|
symbols["upharpoonright"]=UprightSymbolUnicode(QChar(0x21BE)).addUprightHtml("↾");
|
|
|
|
symbols["vartriangleleft"]=MathOperatorSymbolUnicode(QChar(0x22B2)).addMathOperatorHtml("⊲");
|
|
|
|
symbols["vdots"]=MathOperatorSymbolUnicode(QChar(0x22EE)).addMathOperatorHtml("⋮");
|
|
|
|
symbols["vee"]=MathOperatorSymbolUnicode(QChar(0x2228)).addMathOperatorHtml("∨").addMathOperatorWinSymbol(QChar(0xDA));
|
|
|
|
symbols["wedge"]=MathOperatorSymbolUnicode(QChar(0x2227)).addMathOperatorHtml("∧").addMathOperatorWinSymbol(QChar(0xD9));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************************
|
|
|
|
* GREEK letters
|
|
|
|
**************************************************************************************/
|
2022-07-06 04:03:08 +08:00
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("alpha", "a", QChar(0x3B1), "α");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("beta", "b", QChar(0x3B2), "β");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("gamma", "g", QChar(0x3B3), "γ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("delta", "d", QChar(0x3B4), "δ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("epsilon", "e", QChar(0x3F5), "ϵ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("varepsilon", "e", QChar(0x3B5), "ε");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("zeta", "z", QChar(0x3B6),"ζ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("eta", "h", QChar(0x3B7),"η");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("theta", "q", QChar(0x3B8),"θ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("vartheta", "J", QChar(0x3D1),"ϑ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("iota", "i", QChar(0x3B9),"ι");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("kappa", "k", QChar(0x3BA),"κ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("lambda", "l", QChar(0x3BB),"λ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("mu", "m", QChar(0x3BC),"μ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("nu", "n", QChar(0x3BD),"ν");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("xi", "x", QChar(0x3BE),"ξ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("pi", "p", QChar(0x3C0),"π");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("varpi", "v", QChar(0x3D6),"ϖ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("rho", "r", QChar(0x3C1),"ρ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("varrho", "r", QChar(0x3F1),"ϱ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("sigma", "s", QChar(0x3C3),"σ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("varsigma", "V", QChar(0x3C2),"ς");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("tau", "t", QChar(0x3C4),"τ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("upsilon", "u", QChar(0x3C5),"υ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("phi", "f", QChar(0x3D5),"ϕ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("varphi", "j", QChar(0x3C6),"φ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("chi", "c", QChar(0x3C7),"χ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("psi", "y", QChar(0x3C8),"ψ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("omega", "w", QChar(0x3C9),"ω");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("Gamma", "G", QChar(0x3A9),"Γ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("Delta", "D", QChar(0x394),"Δ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("Theta", "Q", QChar(0x398),"Θ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("Lambda", "L", QChar(0x39B),"Λ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("Omega", "W", QChar(0x3A9),"Ω");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("Xi", "X", QChar(0x39E),"Ξ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("Pi", "P", QChar(0x3A0),"Π");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("Sigma", "S", QChar(0x3A3),"Σ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("Upsilon", "U", QChar(0x3C6),"Υ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("Phi", "F", QChar(0x3A6),"Φ");
|
|
|
|
addGreekLetterVariants_WinSymbol_Unicode_Html("Psi", "Y", QChar(0x3A8),"Ψ");
|
2022-06-08 21:38:26 +08:00
|
|
|
|
|
|
|
|
2022-07-07 03:00:03 +08:00
|
|
|
/**************************************************************************************
|
|
|
|
* SYMBOLS from special fonts
|
|
|
|
**************************************************************************************/
|
|
|
|
#if (QT_VERSION<QT_VERSION_CHECK(6, 0, 0))
|
|
|
|
QFontDatabase fdb;
|
|
|
|
const auto fonts=fdb.families();
|
|
|
|
#else
|
|
|
|
const auto fonts=QFontDatabase::families();
|
|
|
|
#endif
|
|
|
|
if (fonts.contains("Wingdings")) {
|
|
|
|
{ auto s=SymbolFullProps("Wingdings", QChar(0x46));
|
|
|
|
symbols["lefthand"]=s; symbols["HandRight"]=s;}
|
|
|
|
{ auto s=SymbolFullProps("Wingdings", QChar(0x45));
|
|
|
|
symbols["righthand"]=s; symbols["HandLeft"]=s;}
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
|
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps::SymbolFullProps():
|
2022-07-22 04:17:37 +08:00
|
|
|
fontType(MTECurrentFont),
|
2022-07-04 02:30:12 +08:00
|
|
|
customFontFamily(),
|
|
|
|
html(),
|
|
|
|
globalFlags(NoGLobalSymbolFlags)
|
|
|
|
{
|
2022-06-08 21:38:26 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps::SymbolFullProps(const QString &_font, const SymbolProps &props, const QString &_html, SymbolFlags _htmlflags, double _htmlfontScalingFactor, double _htmlyShiftFactor):
|
2022-07-22 04:17:37 +08:00
|
|
|
fontType(MTECustomFont),
|
2022-07-04 02:30:12 +08:00
|
|
|
customFontFamily(_font),
|
|
|
|
html(_html, _htmlflags, _htmlfontScalingFactor, _htmlyShiftFactor),
|
|
|
|
globalFlags(NoGLobalSymbolFlags)
|
|
|
|
{
|
|
|
|
this->props[MTFEStandard]=props;
|
2022-06-28 04:57:49 +08:00
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps::SymbolFullProps(const QString &_font, const QString &symbol, const QString &_html, SymbolFlags _htmlflags, double _htmlfontScalingFactor, double _htmlyShiftFactor):
|
2022-07-22 04:17:37 +08:00
|
|
|
fontType(MTECustomFont),
|
2022-07-04 02:30:12 +08:00
|
|
|
customFontFamily(_font),
|
|
|
|
html(_html, _htmlflags, _htmlfontScalingFactor, _htmlyShiftFactor),
|
|
|
|
globalFlags(NoGLobalSymbolFlags)
|
2022-06-28 04:57:49 +08:00
|
|
|
{
|
2022-07-04 02:30:12 +08:00
|
|
|
this->props[MTFEStandard]=SymbolProps(symbol);
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps::SymbolFullProps(const SymbolProps &props, const QString &_html, SymbolFlags _htmlflags, double _htmlfontScalingFactor, double _htmlyShiftFactor):
|
2022-07-22 04:17:37 +08:00
|
|
|
fontType(MTECurrentFont),
|
2022-07-04 02:30:12 +08:00
|
|
|
customFontFamily(),
|
|
|
|
html(_html, _htmlflags, _htmlfontScalingFactor, _htmlyShiftFactor),
|
|
|
|
globalFlags(NoGLobalSymbolFlags)
|
|
|
|
{
|
|
|
|
this->props[MTFEStandard]=props;
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps::SymbolFullProps(JKQTMathTextEnvironmentFont _fontType, const SymbolProps &props, const QString &_html, SymbolFlags _htmlflags, double _htmlfontScalingFactor, double _htmlyShiftFactor):
|
2022-07-22 04:17:37 +08:00
|
|
|
fontType(_fontType),
|
2022-07-04 02:30:12 +08:00
|
|
|
customFontFamily(),
|
|
|
|
html(_html, _htmlflags, _htmlfontScalingFactor, _htmlyShiftFactor),
|
|
|
|
globalFlags(NoGLobalSymbolFlags)
|
|
|
|
{
|
|
|
|
this->props[MTFEStandard]=props;
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps::SymbolFullProps(JKQTMathTextEnvironmentFont _fontType, const QString &symbol, const QString &_html, SymbolFlags _htmlflags, double _htmlfontScalingFactor, double _htmlyShiftFactor):
|
2022-07-22 04:17:37 +08:00
|
|
|
fontType(_fontType),
|
2022-07-04 02:30:12 +08:00
|
|
|
customFontFamily(),
|
|
|
|
html(_html, _htmlflags, _htmlfontScalingFactor, _htmlyShiftFactor),
|
|
|
|
globalFlags(NoGLobalSymbolFlags)
|
|
|
|
{
|
|
|
|
this->props[MTFEStandard]=SymbolProps(symbol);
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps::SymbolFullProps(JKQTMathTextFontEncoding enc0, const SymbolProps &props0, const QString &_html, SymbolFlags _htmlflags, double _htmlfontScalingFactor, double _htmlyShiftFactor):
|
2022-07-22 04:17:37 +08:00
|
|
|
fontType(MTECurrentFont),
|
2022-07-04 02:30:12 +08:00
|
|
|
customFontFamily(),
|
|
|
|
html(_html, _htmlflags, _htmlfontScalingFactor, _htmlyShiftFactor),
|
|
|
|
globalFlags(NoGLobalSymbolFlags)
|
|
|
|
{
|
|
|
|
this->props[enc0]=props0;
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps::SymbolFullProps(JKQTMathTextEnvironmentFont _fontType, JKQTMathTextFontEncoding enc0, const SymbolProps &props0, const QString &_html, SymbolFlags _htmlflags, double _htmlfontScalingFactor, double _htmlyShiftFactor):
|
2022-07-22 04:17:37 +08:00
|
|
|
fontType(_fontType),
|
2022-07-04 02:30:12 +08:00
|
|
|
customFontFamily(),
|
|
|
|
html(_html, _htmlflags, _htmlfontScalingFactor, _htmlyShiftFactor),
|
|
|
|
globalFlags(NoGLobalSymbolFlags)
|
|
|
|
{
|
|
|
|
this->props[enc0]=props0;
|
|
|
|
}
|
2022-06-20 05:34:25 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps::SymbolFullProps(JKQTMathTextFontEncoding enc0, const SymbolProps &props0, JKQTMathTextFontEncoding enc1, const SymbolProps &props1, const QString &_html, SymbolFlags _htmlflags, double _htmlfontScalingFactor, double _htmlyShiftFactor):
|
2022-07-22 04:17:37 +08:00
|
|
|
fontType(MTECurrentFont),
|
2022-07-04 02:30:12 +08:00
|
|
|
customFontFamily(),
|
|
|
|
html(_html, _htmlflags, _htmlfontScalingFactor, _htmlyShiftFactor),
|
|
|
|
globalFlags(NoGLobalSymbolFlags)
|
|
|
|
{
|
|
|
|
this->props[enc0]=props0;
|
|
|
|
this->props[enc1]=props1;
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps::SymbolFullProps(JKQTMathTextEnvironmentFont _fontType, JKQTMathTextFontEncoding enc0, const SymbolProps &props0, JKQTMathTextFontEncoding enc1, const SymbolProps &props1, const QString &_html, SymbolFlags _htmlflags, double _htmlfontScalingFactor, double _htmlyShiftFactor):
|
2022-07-22 04:17:37 +08:00
|
|
|
fontType(_fontType),
|
2022-07-04 02:30:12 +08:00
|
|
|
customFontFamily(),
|
|
|
|
html(_html, _htmlflags, _htmlfontScalingFactor, _htmlyShiftFactor),
|
|
|
|
globalFlags(NoGLobalSymbolFlags)
|
|
|
|
{
|
|
|
|
this->props[enc0]=props0;
|
|
|
|
this->props[enc1]=props1;
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps::SymbolFullProps(JKQTMathTextFontEncoding enc0, const SymbolProps &props0, JKQTMathTextFontEncoding enc1, const SymbolProps &props1, JKQTMathTextFontEncoding enc2, const SymbolProps &props2, const QString &_html, SymbolFlags _htmlflags, double _htmlfontScalingFactor, double _htmlyShiftFactor):
|
2022-07-22 04:17:37 +08:00
|
|
|
fontType(MTECurrentFont),
|
2022-07-04 02:30:12 +08:00
|
|
|
customFontFamily(),
|
|
|
|
html(_html, _htmlflags, _htmlfontScalingFactor, _htmlyShiftFactor),
|
|
|
|
globalFlags(NoGLobalSymbolFlags)
|
|
|
|
{
|
|
|
|
this->props[enc0]=props0;
|
|
|
|
this->props[enc1]=props1;
|
|
|
|
this->props[enc2]=props2;
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps::SymbolFullProps(JKQTMathTextEnvironmentFont _fontType, JKQTMathTextFontEncoding enc0, const SymbolProps &props0, JKQTMathTextFontEncoding enc1, const SymbolProps &props1, JKQTMathTextFontEncoding enc2, const SymbolProps &props2, const QString &_html, SymbolFlags _htmlflags, double _htmlfontScalingFactor, double _htmlyShiftFactor):
|
2022-07-22 04:17:37 +08:00
|
|
|
fontType(_fontType),
|
2022-07-04 02:30:12 +08:00
|
|
|
customFontFamily(),
|
|
|
|
html(_html, _htmlflags, _htmlfontScalingFactor, _htmlyShiftFactor),
|
|
|
|
globalFlags(NoGLobalSymbolFlags)
|
|
|
|
{
|
|
|
|
this->props[enc0]=props0;
|
|
|
|
this->props[enc1]=props1;
|
|
|
|
this->props[enc2]=props2;
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-06 04:03:08 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolProps JKQTMathTextSymbolNode::SymbolFullProps::getProps(JKQTMathTextFontEncoding key, const SymbolProps &defaultValue, JKQTMathTextFontEncoding *foundEncodingOut) const
|
|
|
|
{
|
|
|
|
if (props.contains(key)) {
|
|
|
|
if (foundEncodingOut) *foundEncodingOut=key;
|
|
|
|
return props[key];
|
|
|
|
}
|
|
|
|
if (key==MTFEUnicode && props.contains(MTFEStandard)) {
|
|
|
|
if (foundEncodingOut) *foundEncodingOut=MTFEStandard;
|
|
|
|
return props[MTFEStandard];
|
|
|
|
}
|
|
|
|
if (foundEncodingOut) *foundEncodingOut=key;
|
|
|
|
return defaultValue;
|
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::add(JKQTMathTextFontEncoding enc, const SymbolProps &_props)
|
|
|
|
{
|
|
|
|
props[enc]=_props;
|
|
|
|
return *this;
|
|
|
|
}
|
2022-06-08 21:38:26 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::addWinSymbol(const QString &_symbol, SymbolFlags _flags, double _fontScalingFactor, double _yShiftFactor)
|
|
|
|
{
|
|
|
|
props[MTFEWinSymbol]=SymbolProps(_symbol, _flags, _fontScalingFactor, _yShiftFactor);
|
|
|
|
return *this;
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::addMathOperatorWinSymbol(const QString &_symbol, double _fontScalingFactor, double _yShiftFactor)
|
|
|
|
{
|
|
|
|
props[MTFEWinSymbol]=SymbolProps(_symbol, ItalicOff|BoldOff, _fontScalingFactor, _yShiftFactor);
|
|
|
|
return *this;
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::addUprightWinSymbol(const QString &_symbol, double _fontScalingFactor, double _yShiftFactor)
|
|
|
|
{
|
|
|
|
props[MTFEWinSymbol]=SymbolProps(_symbol, ItalicOff, _fontScalingFactor, _yShiftFactor);
|
|
|
|
return *this;
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
|
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::addUnicode(const QString &_symbol, SymbolFlags _flags, double _fontScalingFactor, double _yShiftFactor)
|
2022-06-08 21:38:26 +08:00
|
|
|
{
|
2022-07-04 02:30:12 +08:00
|
|
|
props[MTFEUnicode]=SymbolProps(_symbol, _flags, _fontScalingFactor, _yShiftFactor);
|
|
|
|
return *this;
|
2022-06-08 21:38:26 +08:00
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::addUprightUnicode(const QString &_symbol, double _fontScalingFactor, double _yShiftFactor)
|
2022-06-28 04:57:49 +08:00
|
|
|
{
|
2022-07-04 02:30:12 +08:00
|
|
|
props[MTFEUnicode]=SymbolProps(_symbol, ItalicOff, _fontScalingFactor, _yShiftFactor);
|
|
|
|
return *this;
|
|
|
|
}
|
2022-06-28 04:57:49 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::addMathOperatorUnicode(const QString &_symbol, double _fontScalingFactor, double _yShiftFactor)
|
|
|
|
{
|
|
|
|
props[MTFEUnicode]=SymbolProps(_symbol, ItalicOff|BoldOff, _fontScalingFactor, _yShiftFactor);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::addStd(const QString &_symbol, SymbolFlags _flags, double _fontScalingFactor, double _yShiftFactor)
|
|
|
|
{
|
|
|
|
props[MTFEStandard]=SymbolProps(_symbol, _flags, _fontScalingFactor, _yShiftFactor);
|
|
|
|
return *this;
|
|
|
|
}
|
2022-06-28 04:57:49 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::addMathOperatorStd(const QString &_symbol, double _fontScalingFactor, double _yShiftFactor)
|
|
|
|
{
|
|
|
|
props[MTFEStandard]=SymbolProps(_symbol, ItalicOff|BoldOff, _fontScalingFactor, _yShiftFactor);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::addUprightStd(const QString &_symbol, double _fontScalingFactor, double _yShiftFactor)
|
|
|
|
{
|
|
|
|
props[MTFEStandard]=SymbolProps(_symbol, ItalicOff, _fontScalingFactor, _yShiftFactor);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::addHtml(const QString &_symbol, SymbolFlags _flags, double _fontScalingFactor, double _yShiftFactor)
|
|
|
|
{
|
|
|
|
html=SymbolProps(_symbol, _flags, _fontScalingFactor, _yShiftFactor);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::addMathOperatorHtml(const QString &_symbol, double _fontScalingFactor, double _yShiftFactor)
|
|
|
|
{
|
|
|
|
html=SymbolProps(_symbol, ItalicOff|BoldOff, _fontScalingFactor, _yShiftFactor);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::addUprightHtml(const QString &_symbol, double _fontScalingFactor, double _yShiftFactor)
|
|
|
|
{
|
|
|
|
html=SymbolProps(_symbol, ItalicOff, _fontScalingFactor, _yShiftFactor);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::addGlobalFlags(GlobalSymbolFlags addglobalFlags)
|
|
|
|
{
|
|
|
|
globalFlags |= addglobalFlags;
|
|
|
|
return *this;
|
2022-06-28 04:57:49 +08:00
|
|
|
}
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
JKQTMathTextSymbolNode::SymbolFullProps &JKQTMathTextSymbolNode::SymbolFullProps::setGlobalFlags(GlobalSymbolFlags addglobalFlags)
|
|
|
|
{
|
|
|
|
globalFlags = addglobalFlags;
|
|
|
|
return *this;
|
|
|
|
}
|
2022-06-28 04:57:49 +08:00
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
QPair<QFont, JKQTMathTextSymbolNode::SymbolProps> JKQTMathTextSymbolNode::SymbolFullProps::getDrawingData(JKQTMathTextEnvironment currentEv, JKQTMathText* parent) const
|
|
|
|
{
|
2022-07-06 04:03:08 +08:00
|
|
|
//qDebug()<<" ---------------------";
|
2022-07-04 02:30:12 +08:00
|
|
|
SymbolProps outProps;
|
|
|
|
QFont outFont;
|
|
|
|
const JKQTMathTextFontEncoding currentEnc=currentEv.getFontEncoding(parent);
|
|
|
|
QFont currentFont=currentEv.getFont(parent);
|
|
|
|
currentFont.setStyleStrategy(QFont::NoFontMerging);
|
|
|
|
const QFontMetricsF currentFM(currentFont);
|
|
|
|
QFont fallbackSymbolsFont=parent->getFallbackFontSymbols();
|
2022-07-06 04:03:08 +08:00
|
|
|
const JKQTMathTextFontEncoding fallbackSymbolsFontEnc=parent->getFontEncodingFallbackFontSymbols();
|
2022-07-04 02:30:12 +08:00
|
|
|
fallbackSymbolsFont.setStyleStrategy(QFont::NoFontMerging);
|
|
|
|
const QFontMetricsF fallbackSymbolsFM(fallbackSymbolsFont);
|
2022-07-06 04:03:08 +08:00
|
|
|
const QChar chFallbackSym=props.value(fallbackSymbolsFontEnc, SymbolProps()).getSymbolSingleChar();
|
2022-07-04 02:30:12 +08:00
|
|
|
|
2022-07-06 04:03:08 +08:00
|
|
|
if (fontType==MTECustomFont) {
|
|
|
|
//qDebug()<<" ==>1 fontType==MTECustomFont";
|
|
|
|
currentEv.customFontName=customFontFamily;
|
|
|
|
currentEv.font=MTECustomFont;
|
|
|
|
outProps=getProps(MTFEUnicode, outProps);
|
2022-07-04 02:30:12 +08:00
|
|
|
} else if (fontType==MTEFallbackSymbols) {
|
2022-07-06 04:03:08 +08:00
|
|
|
//qDebug()<<" ==>2 fontType==MTEFallbackSymbols";
|
|
|
|
if (!chFallbackSym.isNull() && fallbackSymbolsFM.inFont(chFallbackSym)) {
|
|
|
|
//qDebug()<<" ==>2.1 !chFallbackSym.isNull() && fallbackSymbolsFM.inFont(chFallbackSym)";
|
|
|
|
currentEv.font=MTEFallbackSymbols;
|
|
|
|
outProps=getProps(fallbackSymbolsFontEnc, outProps);
|
2022-07-04 02:30:12 +08:00
|
|
|
} else {
|
2022-07-06 04:03:08 +08:00
|
|
|
//qDebug()<<" ==>2.2 else";
|
|
|
|
outProps=getProps(currentEnc, outProps);
|
2022-07-04 02:30:12 +08:00
|
|
|
}
|
2022-07-06 04:03:08 +08:00
|
|
|
} else if (fontType==MTECurrentFont) {
|
|
|
|
//qDebug()<<" ==>2 fontType==MTECurrentFont";
|
|
|
|
JKQTMathTextFontEncoding localEnc=currentEnc;
|
|
|
|
outProps=getProps(currentEnc, outProps, &localEnc);
|
2022-07-07 03:00:03 +08:00
|
|
|
|
|
|
|
const QChar chLocal=outProps.getSymbolSingleChar();
|
|
|
|
bool foundConfig=false;
|
|
|
|
if (outProps.symbol.size()>1 ||(!chLocal.isNull() && currentFM.inFont(chLocal))) {
|
|
|
|
foundConfig=true;
|
|
|
|
} else if (localEnc!=MTFEStandard && props.contains(MTFEStandard)) {
|
|
|
|
outProps=props[MTFEStandard];
|
|
|
|
const QChar chStd=outProps.getSymbolSingleChar();
|
|
|
|
if (outProps.symbol.size()>1 || (!chStd.isNull() && currentFM.inFont(chStd))) {
|
|
|
|
foundConfig=true;
|
2022-07-04 02:30:12 +08:00
|
|
|
}
|
|
|
|
}
|
2022-07-07 03:00:03 +08:00
|
|
|
if (!foundConfig && !chFallbackSym.isNull() && fallbackSymbolsFM.inFont(chFallbackSym)) {
|
|
|
|
//qDebug()<<" ==>2.1.1 !chFallbackSym.isNull() && fallbackSymbolsFM.inFont(chFallbackSym)";
|
|
|
|
outProps=props[fallbackSymbolsFontEnc];
|
|
|
|
currentEv.font=MTEFallbackSymbols;
|
|
|
|
foundConfig=true;
|
|
|
|
}
|
|
|
|
if (!foundConfig) {
|
|
|
|
currentEv.font=MTECurrentFont;
|
|
|
|
outProps=getProps(currentEnc, outProps, &localEnc);
|
|
|
|
}
|
2022-07-06 04:03:08 +08:00
|
|
|
} else {
|
|
|
|
//qDebug()<<" ==>3 else";
|
|
|
|
currentEv.font=fontType;
|
|
|
|
outProps=getProps(currentEv.getFontEncoding(parent), outProps);
|
|
|
|
QFont localFont=currentEv.getFont(parent);
|
|
|
|
localFont.setStyleStrategy(QFont::NoFontMerging);
|
|
|
|
const QFontMetricsF localFM(localFont);
|
|
|
|
const QChar chLocal=outProps.getSymbolSingleChar();
|
|
|
|
|
|
|
|
if (!chLocal.isNull() && !localFM.inFont(chLocal) && fallbackSymbolsFM.inFont(chFallbackSym)) {
|
|
|
|
//qDebug()<<" ==>3.1 !chLocal.isNull() && !localFM.inFont(chLocal) && fallbackSymbolsFM.inFont(chFallbackSym)";
|
|
|
|
currentEv.font=MTEFallbackSymbols;
|
|
|
|
outProps=getProps(fallbackSymbolsFontEnc, outProps);
|
|
|
|
}
|
2022-07-04 02:30:12 +08:00
|
|
|
}
|
2022-07-06 04:03:08 +08:00
|
|
|
|
|
|
|
|
2022-07-04 02:30:12 +08:00
|
|
|
outFont=currentEv.getFont(parent);
|
|
|
|
if (outProps.fontScalingFactor!=1) outFont.setPointSizeF(outFont.pointSizeF()*outProps.fontScalingFactor);
|
|
|
|
if (has(outProps.flags, ItalicOn)) outFont.setItalic(true);
|
|
|
|
if (has(outProps.flags, ItalicOff)) outFont.setItalic(false);
|
|
|
|
if (has(outProps.flags, BoldOn)) outFont.setBold(true);
|
|
|
|
if (has(outProps.flags, BoldOff)) outFont.setBold(false);
|
|
|
|
return QPair<QFont, SymbolProps>(outFont, outProps);
|
|
|
|
}
|