JKQTMathText: added \c \\dashuline{X}, \c \\dotuline{X}, \c \\underleftarrow{X}, \c \\underrightarrow{X}, \c \\underleftrightarrow{X}, \c \\overleftarrow{X}, \c \\overrightarrow{X}, \c \\overleftrightarrow{X}
JKQTMathText: corrected linewidths for decorations
@ -42,8 +42,10 @@
|
|||||||
.
|
.
|
||||||
- \c \\script{...} \c \\textscript{...} \c \\mathscript{...} : draw the contained text in a script font face \image html jkqtmathtext/jkqtmathtext_fonts.png
|
- \c \\script{...} \c \\textscript{...} \c \\mathscript{...} : draw the contained text in a script font face \image html jkqtmathtext/jkqtmathtext_fonts.png
|
||||||
- \c \\sc{...} : draw the text in small caps \image html jkqtmathtext/jkqtmathtext_sc.png
|
- \c \\sc{...} : draw the text in small caps \image html jkqtmathtext/jkqtmathtext_sc.png
|
||||||
- \c \\ul{...} \c \\underline{...} \c \\underlined{...} : draw the text with underlining \image html jkqtmathtext/jkqtmathtext_ul.png
|
- \c \\ul{...} , \c \\underline{...} , \c \\uline{...} \c \\underlined{...} : draw the text with underlining \image html jkqtmathtext/jkqtmathtext_ul.png
|
||||||
- \c \\uul{...} : draw the text with double-underlining \image html jkqtmathtext/jkqtmathtext_uul.png
|
- \c \\uul{...} : draw the text with double-underlining \image html jkqtmathtext/jkqtmathtext_uul.png
|
||||||
|
- \c \\dashuline{...} : draw the text with dashed underlining \image html jkqtmathtext/jkqtmathtext_dashuline.png
|
||||||
|
- \c \\dotuline{...} : draw the text with dotted underlining \image html jkqtmathtext/jkqtmathtext_dotuline.png
|
||||||
- \c \\ol{...} \c \\overline{...} \c \\overlined{...} : draw the text with overlining \image html jkqtmathtext/jkqtmathtext_ol.png
|
- \c \\ol{...} \c \\overline{...} \c \\overlined{...} : draw the text with overlining \image html jkqtmathtext/jkqtmathtext_ol.png
|
||||||
- \c \\ool{...} : draw the text with double-overlining \image html jkqtmathtext/jkqtmathtext_ool.png
|
- \c \\ool{...} : draw the text with double-overlining \image html jkqtmathtext/jkqtmathtext_ool.png
|
||||||
- \c \\tt{...} \c \\texttt{...} \c \\mathtt{...} : draw text in typewriter font \image html jkqtmathtext/jkqtmathtext_fonts.png
|
- \c \\tt{...} \c \\texttt{...} \c \\mathtt{...} : draw text in typewriter font \image html jkqtmathtext/jkqtmathtext_fonts.png
|
||||||
|
@ -72,6 +72,8 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
|
|||||||
<li>NEW: added \c \\snugshade{...} </li>
|
<li>NEW: added \c \\snugshade{...} </li>
|
||||||
<li>NEW: added \c \\snugbox{...} </li>
|
<li>NEW: added \c \\snugbox{...} </li>
|
||||||
<li>NEW: added \c \\acute{X}, \c \\grave{X}, \c \\acute{X}</li>
|
<li>NEW: added \c \\acute{X}, \c \\grave{X}, \c \\acute{X}</li>
|
||||||
|
<li>NEW: added \c \\dashuline{X}, \c \\dotuline{X}</li>
|
||||||
|
<li>NEW: added \c \\underleftarrow{X}, \c \\underrightarrow{X}, \c \\underleftrightarrow{X}, \c \\overleftarrow{X}, \c \\overrightarrow{X}, \c \\overleftrightarrow{X}</li>
|
||||||
<li>NEW: added functions to set the font-size in pixels (as alternative to the existing functions that set them in points), implements request <a href="https://github.com/jkriege2/JKQtPlotter/issues/76">#76</a> from <a href="https://github.com/igormironchik">user:igormironchik</a> </li>
|
<li>NEW: added functions to set the font-size in pixels (as alternative to the existing functions that set them in points), implements request <a href="https://github.com/jkriege2/JKQtPlotter/issues/76">#76</a> from <a href="https://github.com/igormironchik">user:igormironchik</a> </li>
|
||||||
<li>NEW: added \c \\userfont{SystemFontName}{Text} instruction</li>
|
<li>NEW: added \c \\userfont{SystemFontName}{Text} instruction</li>
|
||||||
<li>NEW: added \c \\unicode{HEX} and \c \\utfeight{HEX} instruction to draw unicide characters by code</li>
|
<li>NEW: added \c \\unicode{HEX} and \c \\utfeight{HEX} instruction to draw unicide characters by code</li>
|
||||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
doc/images/jkqtmathtext/MTDoverleftarrow.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
doc/images/jkqtmathtext/MTDoverleftrightarrow.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
doc/images/jkqtmathtext/MTDoverrightarrow.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
doc/images/jkqtmathtext/MTDunderleftarrow.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
doc/images/jkqtmathtext/MTDunderleftrightarrow.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
BIN
doc/images/jkqtmathtext/MTDunderlineDashed.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
doc/images/jkqtmathtext/MTDunderlineDotted.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
doc/images/jkqtmathtext/MTDunderrightarrow.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.0 KiB |
BIN
doc/images/jkqtmathtext/jkqtmathtext_dashuline.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
doc/images/jkqtmathtext/jkqtmathtext_dotuline.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.5 KiB |
@ -56,6 +56,30 @@ $\widehat{x}\widehat{i}\widehat{X}\widehat{\psi}\widehat{abc}$
|
|||||||
MTDwidetilde.png
|
MTDwidetilde.png
|
||||||
$\widetilde{x}\widetilde{i}\widetilde{X}\widetilde{\psi}\widetilde{abc}$
|
$\widetilde{x}\widetilde{i}\widetilde{X}\widetilde{\psi}\widetilde{abc}$
|
||||||
---
|
---
|
||||||
|
MTDoverleftarrow.png
|
||||||
|
$\overleftarrow{x}\overleftarrow{i}\overleftarrow{X}\overleftarrow{\psi}\overleftarrow{abc}$
|
||||||
|
---
|
||||||
|
MTDoverrightarrow.png
|
||||||
|
$\overrightarrow{x}\overrightarrow{i}\overrightarrow{X}\overrightarrow{\psi}\overrightarrow{abc}$
|
||||||
|
---
|
||||||
|
MTDoverleftrightarrow.png
|
||||||
|
$\overleftrightarrow{x}\overleftrightarrow{i}\overleftrightarrow{X}\overleftrightarrow{\psi}\overleftrightarrow{abc}$
|
||||||
|
---
|
||||||
|
MTDunderleftarrow.png
|
||||||
|
$\underleftarrow{x}\underleftarrow{i}\underleftarrow{X}\underleftarrow{\psi}\underleftarrow{abc}$
|
||||||
|
---
|
||||||
|
MTDunderrightarrow.png
|
||||||
|
$\underrightarrow{x}\underrightarrow{i}\underrightarrow{X}\underrightarrow{\psi}\underrightarrow{abc}$
|
||||||
|
---
|
||||||
|
MTDunderleftrightarrow.png
|
||||||
|
$\underleftrightarrow{x}\underleftrightarrow{i}\underleftrightarrow{X}\underleftrightarrow{\psi}\underleftrightarrow{abc}$
|
||||||
|
---
|
||||||
|
MTDunderlineDashed.png
|
||||||
|
\dashuline{dashed underlined}, math: $\dashuline{abc}$
|
||||||
|
---
|
||||||
|
MTDunderlineDotted.png
|
||||||
|
\dotuline{dotted underlined}, math: $\dotuline{abc}$
|
||||||
|
---
|
||||||
jkqtmathtext_mathdeco.png
|
jkqtmathtext_mathdeco.png
|
||||||
$\vec{x}\ \dot{x}\ \ddot{x}\ \overline{x}\ \underline{x}\ \hat{x}\ \tilde{x}\ \uul{x}\ \ool{x}\ \bar{x}\ \arrow{x}\ \widehat{x}\ \widetilde{x}\ ...$
|
$\vec{x}\ \dot{x}\ \ddot{x}\ \overline{x}\ \underline{x}\ \hat{x}\ \tilde{x}\ \uul{x}\ \ool{x}\ \bar{x}\ \arrow{x}\ \widehat{x}\ \widetilde{x}\ ...$
|
||||||
---
|
---
|
||||||
@ -83,4 +107,8 @@ jkqtmathtext_mathaccents.png
|
|||||||
{\backslash}uul\{A\}: & $\uul{A}\uul{a}$ & {\backslash}ool\{A\}: & $\ool{A}\ool{a}$ \\
|
{\backslash}uul\{A\}: & $\uul{A}\uul{a}$ & {\backslash}ool\{A\}: & $\ool{A}\ool{a}$ \\
|
||||||
{\backslash}ocirc\{A\}: & $\ocirc{A}\ocirc{a}$ & {\backslash}breve\{A\}: & $\breve{A}\breve{a}$ \\
|
{\backslash}ocirc\{A\}: & $\ocirc{A}\ocirc{a}$ & {\backslash}breve\{A\}: & $\breve{A}\breve{a}$ \\
|
||||||
{\backslash}arrow\{A\}: & $\arrow{A}\arrow{a} & & \\
|
{\backslash}arrow\{A\}: & $\arrow{A}\arrow{a} & & \\
|
||||||
|
{\backslash}overleftarrow\{A\}: & $\overleftarrow{A}\overleftarrow{a} & {\backslash}overrightarrow\{A\}: & $\overrightarrow{A}\overrightarrow{a} \\
|
||||||
|
{\backslash}overleftrightarrow\{A\}: & $\overleftrightarrow{A}\overleftrightarrow{a} & &\\
|
||||||
|
{\backslash}underleftarrow\{A\}: & $\underleftarrow{A}\underleftarrow{a} & {\backslash}underrightarrow\{A\}: & $\underrightarrow{A}\underrightarrow{a} \\
|
||||||
|
{\backslash}underleftrightarrow\{A\}: & $\underleftrightarrow{A}\underleftrightarrow{a} & &\\
|
||||||
\end{array}
|
\end{array}
|
||||||
|
@ -43,6 +43,12 @@ jkqtmathtext_bb_unicode_or_simulate.png
|
|||||||
jkqtmathtext_ol.png
|
jkqtmathtext_ol.png
|
||||||
{\backslash}ol: \ol{overlined text}
|
{\backslash}ol: \ol{overlined text}
|
||||||
---
|
---
|
||||||
|
jkqtmathtext_dashuline.png
|
||||||
|
{\backslash}dashuline: \dashuline{underlined text}
|
||||||
|
---
|
||||||
|
jkqtmathtext_dotuline.png
|
||||||
|
{\backslash}dotuline: \dotuline{underlined text}
|
||||||
|
---
|
||||||
jkqtmathtext_ool.png
|
jkqtmathtext_ool.png
|
||||||
{\backslash}ool: \ool{double-overlined text}
|
{\backslash}ool: \ool{double-overlined text}
|
||||||
---
|
---
|
||||||
|
@ -86,6 +86,22 @@ QString JKQTMathTextDecoratedNode::DecorationType2String(JKQTMathTextDecoratedNo
|
|||||||
return "xcancel";
|
return "xcancel";
|
||||||
case MTDstrike:
|
case MTDstrike:
|
||||||
return "strike";
|
return "strike";
|
||||||
|
case MTDoverleftarrow:
|
||||||
|
return "overleftarrow";
|
||||||
|
case MTDoverrightarrow:
|
||||||
|
return "overrightarrow";
|
||||||
|
case MTDoverleftrightarrow:
|
||||||
|
return "overleftrightarrow";
|
||||||
|
case MTDunderleftarrow:
|
||||||
|
return "underleftarrow";
|
||||||
|
case MTDunderrightarrow:
|
||||||
|
return "underrightarrow";
|
||||||
|
case MTDunderleftrightarrow:
|
||||||
|
return "underleftrightarrow";
|
||||||
|
case MTDunderlineDashed:
|
||||||
|
return "underlineDashed";
|
||||||
|
case MTDunderlineDotted:
|
||||||
|
return "MTDunderlineDotted";
|
||||||
}
|
}
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
@ -135,10 +151,12 @@ void JKQTMathTextDecoratedNode::getSizeInternal(QPainter& painter, JKQTMathTextE
|
|||||||
double ascent=cbaselineHeight;
|
double ascent=cbaselineHeight;
|
||||||
if (decoration==MTDbar) {
|
if (decoration==MTDbar) {
|
||||||
ascent=std::max<double>(baselineHeight+decoSeparation, decoAboveAscent_ypos)+linewidth/2.0;
|
ascent=std::max<double>(baselineHeight+decoSeparation, decoAboveAscent_ypos)+linewidth/2.0;
|
||||||
} else if (decoration==MTDunderline) {
|
} else if (decoration==MTDunderline || decoration==MTDunderlineDashed || decoration==MTDunderlineDotted) {
|
||||||
descent=std::max<double>(decobelow_ypos, cDescent)+linewidth/2.0;
|
descent=std::max<double>(decobelow_ypos, cDescent)+linewidth/2.0;
|
||||||
} else if (decoration==MTDdoubleunderline) {
|
} else if (decoration==MTDdoubleunderline) {
|
||||||
descent=std::max<double>(decobelow_ypos, cDescent)+2.5*linewidth;
|
descent=std::max<double>(decobelow_ypos, cDescent)+3.5*linewidth;
|
||||||
|
} else if (decoration==MTDunderleftarrow || decoration==MTDunderrightarrow || decoration==MTDunderleftrightarrow) {
|
||||||
|
descent=std::max<double>(decobelow_ypos, cDescent)+0.5*linewidth+deco_height;
|
||||||
} else {
|
} else {
|
||||||
ascent=deco_ypos+deco_height;
|
ascent=deco_ypos+deco_height;
|
||||||
}
|
}
|
||||||
@ -161,6 +179,8 @@ void JKQTMathTextDecoratedNode::fillInstructions()
|
|||||||
instructions["underline"]=MTDunderline;
|
instructions["underline"]=MTDunderline;
|
||||||
instructions["uline"]=MTDunderline;
|
instructions["uline"]=MTDunderline;
|
||||||
instructions["ul"]=MTDunderline;
|
instructions["ul"]=MTDunderline;
|
||||||
|
instructions["dashuline"]=MTDunderlineDashed;
|
||||||
|
instructions["dotuline"]=MTDunderlineDotted;
|
||||||
instructions["uuline"]=MTDdoubleunderline;
|
instructions["uuline"]=MTDdoubleunderline;
|
||||||
instructions["uul"]=MTDdoubleunderline;
|
instructions["uul"]=MTDdoubleunderline;
|
||||||
instructions["ooline"]=MTDdoubleoverline;
|
instructions["ooline"]=MTDdoubleoverline;
|
||||||
@ -195,6 +215,13 @@ void JKQTMathTextDecoratedNode::fillInstructions()
|
|||||||
instructions["strike"]=MTDstrike;
|
instructions["strike"]=MTDstrike;
|
||||||
instructions["st"]=MTDstrike;
|
instructions["st"]=MTDstrike;
|
||||||
instructions["sout"]=MTDstrike;
|
instructions["sout"]=MTDstrike;
|
||||||
|
instructions["overleftarrow"]=MTDoverleftarrow;
|
||||||
|
instructions["overrightarrow"]=MTDoverrightarrow;
|
||||||
|
instructions["overleftrightarrow"]=MTDoverleftrightarrow;
|
||||||
|
instructions["underleftarrow"]=MTDunderleftarrow;
|
||||||
|
instructions["underrightarrow"]=MTDunderrightarrow;
|
||||||
|
instructions["underleftrightarrow"]=MTDunderleftrightarrow;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double JKQTMathTextDecoratedNode::draw(QPainter& painter, double x, double y, JKQTMathTextEnvironment currentEv, const JKQTMathTextNodeSize* /*prevNodeSize*/) {
|
double JKQTMathTextDecoratedNode::draw(QPainter& painter, double x, double y, JKQTMathTextEnvironment currentEv, const JKQTMathTextNodeSize* /*prevNodeSize*/) {
|
||||||
@ -210,6 +237,7 @@ double JKQTMathTextDecoratedNode::draw(QPainter& painter, double x, double y, JK
|
|||||||
const double width_dot=fm.boundingRect(".").width()/2.0;
|
const double width_dot=fm.boundingRect(".").width()/2.0;
|
||||||
const double decoSeparation=parentMathText->getDecorationSeparationFactor()*fm.ascent();
|
const double decoSeparation=parentMathText->getDecorationSeparationFactor()*fm.ascent();
|
||||||
const double linewidth=qMax(parentMathText->ABS_MIN_LINEWIDTH, fm.lineWidth());
|
const double linewidth=qMax(parentMathText->ABS_MIN_LINEWIDTH, fm.lineWidth());
|
||||||
|
const double linewidthArrow=linewidth*0.65;
|
||||||
const double deco_height=parentMathText->getDecorationHeightFactor()*fm.ascent();
|
const double deco_height=parentMathText->getDecorationHeightFactor()*fm.ascent();
|
||||||
const double decoAboveAscent_ypos=y-fm.ascent()-decoSeparation;
|
const double decoAboveAscent_ypos=y-fm.ascent()-decoSeparation;
|
||||||
const double strike_ypos=y-cbaselineHeight/2.0;
|
const double strike_ypos=y-cbaselineHeight/2.0;
|
||||||
@ -236,10 +264,16 @@ double JKQTMathTextDecoratedNode::draw(QPainter& painter, double x, double y, JK
|
|||||||
QPen pold=painter.pen();
|
QPen pold=painter.pen();
|
||||||
QPen p=pold;
|
QPen p=pold;
|
||||||
p.setColor(ev.color);
|
p.setColor(ev.color);
|
||||||
p.setWidthF(linewidth*0.75);
|
p.setWidthF(linewidthArrow);
|
||||||
p.setCapStyle(Qt::RoundCap);
|
p.setCapStyle(Qt::SquareCap);
|
||||||
p.setJoinStyle(Qt::RoundJoin);
|
p.setJoinStyle(Qt::RoundJoin);
|
||||||
|
|
||||||
|
QPen pul=p;
|
||||||
|
pul.setWidthF(linewidth);
|
||||||
|
pul.setCapStyle(Qt::SquareCap);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
double xnew=getChild()->draw(painter, x, y, ev);
|
double xnew=getChild()->draw(painter, x, y, ev);
|
||||||
|
|
||||||
auto fDrawFontAccent=[&](QChar aDirect=QChar(), QChar aFallback=QChar()) -> bool {
|
auto fDrawFontAccent=[&](QChar aDirect=QChar(), QChar aFallback=QChar()) -> bool {
|
||||||
@ -289,32 +323,34 @@ double JKQTMathTextDecoratedNode::draw(QPainter& painter, double x, double y, JK
|
|||||||
painter.drawPolyline(poly);
|
painter.drawPolyline(poly);
|
||||||
painter.setPen(pold);
|
painter.setPen(pold);
|
||||||
} else if (decoration==MTDoverline) {
|
} else if (decoration==MTDoverline) {
|
||||||
painter.setPen(p);
|
painter.setPen(pul);
|
||||||
const QLineF l(decotop_xstart, deco_ytopbot, decotop_xend, deco_ytopbot);
|
const QLineF l(decotop_xstart, deco_ytopbot, decotop_xend, deco_ytopbot);
|
||||||
if (l.length()>0) painter.drawLine(l);
|
if (l.length()>0) painter.drawLine(l);
|
||||||
painter.setPen(pold);
|
painter.setPen(pold);
|
||||||
} else if (decoration==MTDbar) {
|
} else if (decoration==MTDbar) {
|
||||||
painter.setPen(p);
|
painter.setPen(pul);
|
||||||
const QLineF l(decotop_xstart, decoAboveAscent_ypos, decotop_xend, decoAboveAscent_ypos);
|
const QLineF l(decotop_xstart, decoAboveAscent_ypos, decotop_xend, decoAboveAscent_ypos);
|
||||||
if (l.length()>0) painter.drawLine(l);
|
if (l.length()>0) painter.drawLine(l);
|
||||||
painter.setPen(pold);
|
painter.setPen(pold);
|
||||||
} else if (decoration==MTDdoubleoverline) {
|
} else if (decoration==MTDdoubleoverline) {
|
||||||
painter.setPen(p);
|
painter.setPen(pul);
|
||||||
const QLineF l(decotop_xstart, deco_ytopbot, decotop_xend, deco_ytopbot);
|
const QLineF l(decotop_xstart, deco_ytopbot, decotop_xend, deco_ytopbot);
|
||||||
if (l.length()>0) painter.drawLine(l);
|
if (l.length()>0) painter.drawLine(l);
|
||||||
const QLineF l2(decotop_xstart, deco_ytopbot-3.0*p.widthF(), decotop_xend, deco_ytopbot-3.0*p.widthF());
|
const QLineF l2(decotop_xstart, deco_ytopbot-2.5*pul.widthF(), decotop_xend, deco_ytopbot-2.5*pul.widthF());
|
||||||
if (l2.length()>0) painter.drawLine(l2);
|
if (l2.length()>0) painter.drawLine(l2);
|
||||||
painter.setPen(pold);
|
painter.setPen(pold);
|
||||||
} else if (decoration==MTDunderline) {
|
} else if (decoration==MTDunderline || decoration==MTDunderlineDashed || decoration==MTDunderlineDotted) {
|
||||||
painter.setPen(p);
|
if (decoration==MTDunderlineDashed) pul.setStyle(Qt::DashLine);
|
||||||
|
if (decoration==MTDunderlineDotted) pul.setStyle(Qt::DotLine);
|
||||||
|
painter.setPen(pul);
|
||||||
const QLineF l(decobot_xstart, decobelow_ypos, decobot_xend, decobelow_ypos);
|
const QLineF l(decobot_xstart, decobelow_ypos, decobot_xend, decobelow_ypos);
|
||||||
if (l.length()>0) painter.drawLine(l);
|
if (l.length()>0) painter.drawLine(l);
|
||||||
painter.setPen(pold);
|
painter.setPen(pold);
|
||||||
} else if (decoration==MTDdoubleunderline) {
|
} else if (decoration==MTDdoubleunderline) {
|
||||||
painter.setPen(p);
|
painter.setPen(pul);
|
||||||
const QLineF l(decobot_xstart, decobelow_ypos, decobot_xend, decobelow_ypos);
|
const QLineF l(decobot_xstart, decobelow_ypos, decobot_xend, decobelow_ypos);
|
||||||
if (l.length()>0) painter.drawLine(l);
|
if (l.length()>0) painter.drawLine(l);
|
||||||
QLineF l2(decobot_xstart, decobelow_ypos+3.0*p.widthF(), decobot_xend, decobelow_ypos+3.0*p.widthF());
|
QLineF l2(decobot_xstart, decobelow_ypos+2.5*pul.widthF(), decobot_xend, decobelow_ypos+2.5*pul.widthF());
|
||||||
if (l2.length()>0) painter.drawLine(l2);
|
if (l2.length()>0) painter.drawLine(l2);
|
||||||
painter.setPen(pold);
|
painter.setPen(pold);
|
||||||
} else if (decoration==MTDarrow) {
|
} else if (decoration==MTDarrow) {
|
||||||
@ -325,6 +361,36 @@ double JKQTMathTextDecoratedNode::draw(QPainter& painter, double x, double y, JK
|
|||||||
poly<<QPointF(decotop_xend-deco_vecwidth, deco_ytopbot)<<QPointF(decotop_xend, deco_ytopcenter)<<QPointF(decotop_xend-deco_vecwidth, deco_ytoptop);
|
poly<<QPointF(decotop_xend-deco_vecwidth, deco_ytopbot)<<QPointF(decotop_xend, deco_ytopcenter)<<QPointF(decotop_xend-deco_vecwidth, deco_ytoptop);
|
||||||
painter.drawPolyline(poly);
|
painter.drawPolyline(poly);
|
||||||
painter.setPen(pold);
|
painter.setPen(pold);
|
||||||
|
} else if (decoration==MTDoverrightarrow) {
|
||||||
|
painter.setPen(p);
|
||||||
|
const QPainterPath path=JKQTMathTextMakeArrow(decotop_xstart, deco_ytopcenter, deco_width, deco_height, false, true);
|
||||||
|
painter.drawPath(path);
|
||||||
|
painter.setPen(pold);
|
||||||
|
} else if (decoration==MTDoverleftarrow) {
|
||||||
|
painter.setPen(p);
|
||||||
|
const QPainterPath path=JKQTMathTextMakeArrow(decotop_xstart, deco_ytopcenter, deco_width, deco_height, true, false);
|
||||||
|
painter.drawPath(path);
|
||||||
|
painter.setPen(pold);
|
||||||
|
} else if (decoration==MTDoverleftrightarrow) {
|
||||||
|
painter.setPen(p);
|
||||||
|
const QPainterPath path=JKQTMathTextMakeArrow(decotop_xstart, deco_ytopcenter, deco_width, deco_height, true, true);
|
||||||
|
painter.drawPath(path);
|
||||||
|
painter.setPen(pold);
|
||||||
|
} else if (decoration==MTDunderrightarrow) {
|
||||||
|
painter.setPen(p);
|
||||||
|
const QPainterPath path=JKQTMathTextMakeArrow(decobot_xstart, decobelow_ypos+deco_height/2.0, decobot_xend-decobot_xstart, deco_height, false, true);
|
||||||
|
painter.drawPath(path);
|
||||||
|
painter.setPen(pold);
|
||||||
|
} else if (decoration==MTDunderleftarrow) {
|
||||||
|
painter.setPen(p);
|
||||||
|
const QPainterPath path=JKQTMathTextMakeArrow(decobot_xstart, decobelow_ypos+deco_height/2.0, decobot_xend-decobot_xstart, deco_height, true, false);
|
||||||
|
painter.drawPath(path);
|
||||||
|
painter.setPen(pold);
|
||||||
|
} else if (decoration==MTDunderleftrightarrow) {
|
||||||
|
painter.setPen(p);
|
||||||
|
const QPainterPath path=JKQTMathTextMakeArrow(decobot_xstart, decobelow_ypos+deco_height/2.0, decobot_xend-decobot_xstart, deco_height, true, true);
|
||||||
|
painter.drawPath(path);
|
||||||
|
painter.setPen(pold);
|
||||||
} else if (decoration==MTDhat) {
|
} else if (decoration==MTDhat) {
|
||||||
if (!fDrawFontAccent(QChar(0x302), QChar(0x2c6))) {
|
if (!fDrawFontAccent(QChar(0x302), QChar(0x2c6))) {
|
||||||
painter.setPen(p);
|
painter.setPen(p);
|
||||||
@ -378,13 +444,13 @@ double JKQTMathTextDecoratedNode::draw(QPainter& painter, double x, double y, JK
|
|||||||
}
|
}
|
||||||
} else if (decoration==MTDacute) {
|
} else if (decoration==MTDacute) {
|
||||||
if (!fDrawFontAccent(QChar(0x301), QChar(0x2CA))) {
|
if (!fDrawFontAccent(QChar(0x301), QChar(0x2CA))) {
|
||||||
painter.setPen(p);
|
painter.setPen(pul);
|
||||||
painter.drawLine(QLineF(decotop_xcenter, deco_ytopbot, decotop_xcenter-deco_accentwidth, deco_ytopcenter));
|
painter.drawLine(QLineF(decotop_xcenter, deco_ytopbot, decotop_xcenter-deco_accentwidth, deco_ytopcenter));
|
||||||
painter.setPen(pold);
|
painter.setPen(pold);
|
||||||
}
|
}
|
||||||
} else if (decoration==MTDgrave) {
|
} else if (decoration==MTDgrave) {
|
||||||
if (!fDrawFontAccent(QChar(0x300), QChar(0x2CB))) {
|
if (!fDrawFontAccent(QChar(0x300), QChar(0x2CB))) {
|
||||||
painter.setPen(p);
|
painter.setPen(pul);
|
||||||
painter.drawLine(QLineF(decotop_xcenter, deco_ytopbot, decotop_xcenter+deco_accentwidth, deco_ytopcenter));
|
painter.drawLine(QLineF(decotop_xcenter, deco_ytopbot, decotop_xcenter+deco_accentwidth, deco_ytopcenter));
|
||||||
painter.setPen(pold);
|
painter.setPen(pold);
|
||||||
}
|
}
|
||||||
@ -438,22 +504,22 @@ double JKQTMathTextDecoratedNode::draw(QPainter& painter, double x, double y, JK
|
|||||||
painter.setBrush(bold);
|
painter.setBrush(bold);
|
||||||
}
|
}
|
||||||
} else if (decoration==MTDstrike) {
|
} else if (decoration==MTDstrike) {
|
||||||
painter.setPen(p);
|
painter.setPen(pul);
|
||||||
const QLineF l((decotop_xstart+decobot_xstart)/2.0, strike_ypos, (decotop_xend+decobot_xend)/2.0, strike_ypos);
|
const QLineF l((decotop_xstart+decobot_xstart)/2.0, strike_ypos, (decotop_xend+decobot_xend)/2.0, strike_ypos);
|
||||||
if (l.length()>0) painter.drawLine(l);
|
if (l.length()>0) painter.drawLine(l);
|
||||||
painter.setPen(pold);
|
painter.setPen(pold);
|
||||||
} else if (decoration==MTDcancel) {
|
} else if (decoration==MTDcancel) {
|
||||||
painter.setPen(p);
|
painter.setPen(pul);
|
||||||
const QLineF l(decobot_xstart, decobelow_ypos, decotop_xend, deco_ytopbot);
|
const QLineF l(decobot_xstart, decobelow_ypos, decotop_xend, deco_ytopbot);
|
||||||
if (l.length()>0) painter.drawLine(l);
|
if (l.length()>0) painter.drawLine(l);
|
||||||
painter.setPen(pold);
|
painter.setPen(pold);
|
||||||
} else if (decoration==MTDbcancel) {
|
} else if (decoration==MTDbcancel) {
|
||||||
painter.setPen(p);
|
painter.setPen(pul);
|
||||||
const QLineF l(decobot_xstart, deco_ytopbot, decotop_xend, decobelow_ypos);
|
const QLineF l(decobot_xstart, deco_ytopbot, decotop_xend, decobelow_ypos);
|
||||||
if (l.length()>0) painter.drawLine(l);
|
if (l.length()>0) painter.drawLine(l);
|
||||||
painter.setPen(pold);
|
painter.setPen(pold);
|
||||||
} else if (decoration==MTDxcancel) {
|
} else if (decoration==MTDxcancel) {
|
||||||
painter.setPen(p);
|
painter.setPen(pul);
|
||||||
const QLineF l(decobot_xstart, deco_ytopbot, decotop_xend, decobelow_ypos);
|
const QLineF l(decobot_xstart, deco_ytopbot, decotop_xend, decobelow_ypos);
|
||||||
if (l.length()>0) painter.drawLine(l);
|
if (l.length()>0) painter.drawLine(l);
|
||||||
const QLineF l1(decobot_xstart, decobelow_ypos, decotop_xend, deco_ytopbot);
|
const QLineF l1(decobot_xstart, decobelow_ypos, decotop_xend, deco_ytopbot);
|
||||||
|
@ -57,7 +57,9 @@ class JKQTMATHTEXT_LIB_EXPORT JKQTMathTextDecoratedNode: public JKQTMathTextSing
|
|||||||
MTDoverline, /*!< \brief overline over block \image html jkqtmathtext/MTDoverline.png */
|
MTDoverline, /*!< \brief overline over block \image html jkqtmathtext/MTDoverline.png */
|
||||||
MTDdoubleoverline, /*!< \brief double overline over block \image html jkqtmathtext/MTDdoubleoverline.png */
|
MTDdoubleoverline, /*!< \brief double overline over block \image html jkqtmathtext/MTDdoubleoverline.png */
|
||||||
MTDunderline, /*!< \brief underline under block \image html jkqtmathtext/MTDunderline.png */
|
MTDunderline, /*!< \brief underline under block \image html jkqtmathtext/MTDunderline.png */
|
||||||
MTDdoubleunderline, /*!< \brief double underline under block \image html jkqtmathtext/MTDdoubleunderline.png */
|
MTDunderlineDashed, /*!< \brief dashed line under block \image html jkqtmathtext/MTDunderlineDashed.png */
|
||||||
|
MTDunderlineDotted, /*!< \brief dotted line under block \image html jkqtmathtext/MTDunderlineDotted.png */
|
||||||
|
MTDdoubleunderline, /*!< \brief double line under block \image html jkqtmathtext/MTDdoubleunderline.png */
|
||||||
MTDtilde, /*!< \brief small tilde over block \image html jkqtmathtext/MTDtilde.png */
|
MTDtilde, /*!< \brief small tilde over block \image html jkqtmathtext/MTDtilde.png */
|
||||||
MTDwidetilde, /*!< \brief full width tilde over block \image html jkqtmathtext/MTDwidetilde.png */
|
MTDwidetilde, /*!< \brief full width tilde over block \image html jkqtmathtext/MTDwidetilde.png */
|
||||||
MTDacute, /*!< \brief small acute accent over block \image html jkqtmathtext/MTDacute.png */
|
MTDacute, /*!< \brief small acute accent over block \image html jkqtmathtext/MTDacute.png */
|
||||||
@ -65,7 +67,13 @@ class JKQTMATHTEXT_LIB_EXPORT JKQTMathTextDecoratedNode: public JKQTMathTextSing
|
|||||||
MTDcancel, /*!< \brief cancel text with sloped line \image html jkqtmathtext/MTDcancel.png */
|
MTDcancel, /*!< \brief cancel text with sloped line \image html jkqtmathtext/MTDcancel.png */
|
||||||
MTDbcancel, /*!< \brief cancel text with backward sloped line \image html jkqtmathtext/MTDbcancel.png */
|
MTDbcancel, /*!< \brief cancel text with backward sloped line \image html jkqtmathtext/MTDbcancel.png */
|
||||||
MTDxcancel, /*!< \brief cancel text with X \image html jkqtmathtext/MTDxcancel.png */
|
MTDxcancel, /*!< \brief cancel text with X \image html jkqtmathtext/MTDxcancel.png */
|
||||||
MTDstrike /*!< \brief strikethrough text \image html jkqtmathtext/MTDstrike.png */
|
MTDstrike, /*!< \brief strikethrough text \image html jkqtmathtext/MTDstrike.png */
|
||||||
|
MTDoverleftarrow, /*!< \brief left-pointing arrow over everything text \image html jkqtmathtext/MTDoverleftarrow.png */
|
||||||
|
MTDoverrightarrow, /*!< \brief right-pointing arrow over everything text \image html jkqtmathtext/MTDoverrightarrow.png */
|
||||||
|
MTDoverleftrightarrow, /*!< \brief left/right-pointing arrow over everything text \image html jkqtmathtext/MTDoverleftrightarrow.png */
|
||||||
|
MTDunderleftarrow, /*!< \brief left-pointing arrow under everything text \image html jkqtmathtext/MTDunderleftarrow.png */
|
||||||
|
MTDunderrightarrow, /*!< \brief right-pointing arrow under everything text \image html jkqtmathtext/MTDunderrightarrow.png */
|
||||||
|
MTDunderleftrightarrow, /*!< \brief left/right-pointing arrow under everything text \image html jkqtmathtext/MTDunderleftrightarrow.png */
|
||||||
};
|
};
|
||||||
/** \brief convert a DecorationType into a string
|
/** \brief convert a DecorationType into a string
|
||||||
*/
|
*/
|
||||||
|