diff --git a/doc/dox/whatsnew.dox b/doc/dox/whatsnew.dox index 68b19c3566..75ce7912c5 100644 --- a/doc/dox/whatsnew.dox +++ b/doc/dox/whatsnew.dox @@ -64,6 +64,8 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
  • NEW: added top-corner (\c \\ulcorner/\c \\urcorner ) and bottom-corner brackets (\c \\llcorner/\c \\lrcorner )
  • NEW: added \c \\overbracket and \c \\underbracket
  • NEW: added \c \\shaded{color}{...}
  • +
  • NEW: added \c \\dashbox{...}
  • +
  • NEW: added \c \\dottedbox{...}
  • NEW: added \c \\acute{X}, \c \\grave{X}, \c \\acute{X}
  • NEW: added functions to set the font-size in pixels (as alternative to the existing functions that set them in points), implements request #76 from user:igormironchik
  • NEW: added \c \\userfont{SystemFontName}{Text} instruction
  • diff --git a/doc/images/jkqtmathtext/jkqtmathtext_dashbox.png b/doc/images/jkqtmathtext/jkqtmathtext_dashbox.png new file mode 100644 index 0000000000..cba434387e Binary files /dev/null and b/doc/images/jkqtmathtext/jkqtmathtext_dashbox.png differ diff --git a/doc/images/jkqtmathtext/jkqtmathtext_dottedbox.png b/doc/images/jkqtmathtext/jkqtmathtext_dottedbox.png new file mode 100644 index 0000000000..e5e4334940 Binary files /dev/null and b/doc/images/jkqtmathtext/jkqtmathtext_dottedbox.png differ diff --git a/examples/jkqtmathtext_test/testform.cpp b/examples/jkqtmathtext_test/testform.cpp index 3cd5dc6838..453ba473ef 100644 --- a/examples/jkqtmathtext_test/testform.cpp +++ b/examples/jkqtmathtext_test/testform.cpp @@ -207,7 +207,7 @@ TestForm::TestForm(QWidget *parent) : ui->cmbTestset->addItem("math: operator test (textmode)", "x=0\\ \\ y>0\\ \\ x+y\\ \\ -1\\ \\ x-2\\ \\ x\\cdot y\\ \\ x\\geq 4\\ \\ x~4"); ui->cmbTestset->addItem("math: operator test (mathmode)", "$x=0\\ \\ y>0\\ \\ x+y\\ \\ -1\\ \\ x-2\\ \\ x\\cdot y\\ \\ x\\geq 4\\ \\ x~4$"); ui->cmbTestset->addItem("text: color test", "\\textcolor{red}{RED}\\textcolor{blue}{BLUE}"); - ui->cmbTestset->addItem("text: boxed test", "test: {\\backslash}boxed: \\boxed{boxed text} {\\backslash}doublebox: \\doublebox{boxed text} {\\backslash}ovalbox: \\ovalbox{boxed text} {\\backslash}Ovalbox: \\Ovalbox{boxed text} {\\backslash}ovaldoublebox: \\ovaldoublebox{boxed text} {\\backslash}colorbox\\{red\\}: \\colorbox{red}{boxed text} {\\backslash}shaded\\{AliceBlue\\}: \\shaded{AliceBlue}{boxed text} {\\backslash}fcolorbox\\{red\\}\\{AliceBlue\\}: \\fcolorbox{red}{AliceBlue}{boxed text} in the middle"); + ui->cmbTestset->addItem("text: boxed test", "test: {\\backslash}boxed: \\boxed{boxed text} {\\backslash}doublebox: \\doublebox{boxed text} {\\backslash}ovalbox: \\ovalbox{boxed text} {\\backslash}Ovalbox: \\Ovalbox{boxed text} {\\backslash}ovaldoublebox: \\ovaldoublebox{boxed text} {\\backslash}dashbox\\{...\\}: \\dashbox{boxed text} {\\backslash}dottedbox\\{...\\}: \\dottedbox{boxed text} {\\backslash}colorbox\\{red\\}: \\colorbox{red}{boxed text} {\\backslash}shaded\\{AliceBlue\\}: \\shaded{AliceBlue}{boxed text} {\\backslash}fcolorbox\\{red\\}\\{AliceBlue\\}: \\fcolorbox{red}{AliceBlue}{boxed text} in the middle"); ui->cmbTestset->addItem("mathboxed test", "$\\fbox{2^{2^{\\colorbox{red}{2^{x}}}}}$"); ui->cmbTestset->addItem("axiom of power test", "$\\forall A \\, \\exists P \\, \\forall B \\, [B \\in P \\iff \\forall C \\, (C \\in B \\Rightarrow C \\in A)]$"); ui->cmbTestset->addItem("math: De Morgan's law", "$\\neg(P\\land Q)\\iff(\\neg P)\\lor(\\neg Q)$ or $\\overline{\\bigcap_{i \\in I} A_{i}}\\equiv\\bigcup_{i \\in I} \\overline{A_{i}}$ or $\\overline{A \\cup B}\\equiv\\overline{A} \\cap \\overline{B}$"); diff --git a/lib/jkqtmathtext/jkqtmathtext.h b/lib/jkqtmathtext/jkqtmathtext.h index 30efdf5052..1e409dc73e 100644 --- a/lib/jkqtmathtext/jkqtmathtext.h +++ b/lib/jkqtmathtext/jkqtmathtext.h @@ -127,6 +127,8 @@ class JKQTMathTextNode; // forward - \c \\doublebox{...} : draw text with a rounded box around it \image html jkqtmathtext/jkqtmathtext_doublebox.png - \c \\ovalbox{...} : draw text with a rounded box around it \image html jkqtmathtext/jkqtmathtext_ovalboxed.png - \c \\Ovalbox{...} : draw a thick oval box \image html jkqtmathtext/jkqtmathtext_oovalbox.png + - \c \\dashbox{...} , \c \\dbox{...} : draw a dashed box \image html jkqtmathtext/jkqtmathtext_dashbox.png + - \c \\dottedbox{...} : draw a dottted box \image html jkqtmathtext/jkqtmathtext_dottedbox.png - \c \\ovaldoublebox{...} : draw a double oval box \image html jkqtmathtext/jkqtmathtext_doubleovalbox.png - \c \\colorbox{bordercolor}{...} : draw a colored box \image html jkqtmathtext/jkqtmathtext_colorbox.png - \c \\shaded{backgroundcolor}{...} : draw a filled box \image html jkqtmathtext/jkqtmathtext_shaded.png diff --git a/lib/jkqtmathtext/nodes/jkqtmathtextinstructionnode.cpp b/lib/jkqtmathtext/nodes/jkqtmathtextinstructionnode.cpp index 62fe27060a..51bf8dd183 100644 --- a/lib/jkqtmathtext/nodes/jkqtmathtextinstructionnode.cpp +++ b/lib/jkqtmathtext/nodes/jkqtmathtextinstructionnode.cpp @@ -788,6 +788,33 @@ void JKQTMathTextBoxInstructionNode::fillInstructions() /*Nparams=*/1); instructions["colorbox"] = i; } + { + InstructionProperties i(InstructionProperties::NoModification, + [](JKQTMathTextEnvironment& ev, const QStringList& parameters, JKQTMathText* parent){ + QPen p=InstructionProperties::DefaultPen(ev, parameters, parent); + p.setStyle(Qt::DashLine); + return p; + }, + InstructionProperties::NoBrush, + InstructionProperties::DefaultPadding, + /*Nparams=*/0); + instructions["dashbox"] = i; + instructions["dashedbox"] = i; + instructions["dbox"] = i; + } + { + InstructionProperties i(InstructionProperties::NoModification, + [](JKQTMathTextEnvironment& ev, const QStringList& parameters, JKQTMathText* parent){ + QPen p=InstructionProperties::DefaultPen(ev, parameters, parent); + p.setStyle(Qt::DotLine); + return p; + }, + InstructionProperties::NoBrush, + InstructionProperties::DefaultPadding, + /*Nparams=*/0); + instructions["dottedbox"] = i; + instructions["dotbox"] = i; + } { InstructionProperties i(InstructionProperties::NoModification, InstructionProperties::NoPen,