Re: [LyX/master] Implement variable size bigops

2020-07-24 Thread Enrico Forestieri
On Fri, Jul 24, 2020 at 11:51:40AM -0400, Richard Kimberly Heck wrote:
> On 7/24/20 7:02 AM, Enrico Forestieri wrote:
> >
> > Richard, I attach here the corresponding patch for stable.
> 
> OK!

Committed at 79998fdc.

-- 
Enrico
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Implement variable size bigops

2020-07-24 Thread Richard Kimberly Heck
On 7/24/20 7:02 AM, Enrico Forestieri wrote:
> On Thu, Jul 23, 2020 at 03:47:44PM +0200, Enrico Forestieri wrote:
>> On Thu, Jul 23, 2020 at 03:24:13PM +0200, Jean-Marc Lasgouttes wrote:
>>> Le 23/07/2020 à 15:13, Enrico Forestieri a écrit :
 On Thu, Jul 23, 2020 at 01:16:32PM +0200, Jean-Marc Lasgouttes wrote:

> Le 23/07/2020 à 12:22, Enrico Forestieri a écrit :
>> Here is an alternative patch. Please check whether the change in
>> InsetMathSymbol.cpp is compatible with the corresponding change
>> at e8ee0100.
> I think it is OK. What about the users of mathedSymbolDim in 
> InsetMathFrac?
> Is kerning irrelevant here?
>>> This looks good for master and probably branch as far as I am concerned.
>> I am not really satisfied when navigating a formula with the cursor.
>> The caret will be placed in the middle of a symbol instead of after it.
>> Taking away the change to GuiFontMetrics.cpp makes navigation more
>> pleasant but both scripts are placed far away the symbol.
>>
>> I propose the attached patch that leaves unchanged GuiFontMetrics::width()
>> and makes negative the kerning for a symbol, so that the subscript is
>> moved to the left instead of moving the superscript to the right.
> Patch pushed at 0b3e6916.
>
> Richard, I attach here the corresponding patch for stable.

OK!

Riki


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Implement variable size bigops

2020-07-24 Thread Enrico Forestieri
On Thu, Jul 23, 2020 at 03:47:44PM +0200, Enrico Forestieri wrote:
> On Thu, Jul 23, 2020 at 03:24:13PM +0200, Jean-Marc Lasgouttes wrote:
> > Le 23/07/2020 à 15:13, Enrico Forestieri a écrit :
> > > On Thu, Jul 23, 2020 at 01:16:32PM +0200, Jean-Marc Lasgouttes wrote:
> > > 
> > > > Le 23/07/2020 à 12:22, Enrico Forestieri a écrit :
> > > > > Here is an alternative patch. Please check whether the change in
> > > > > InsetMathSymbol.cpp is compatible with the corresponding change
> > > > > at e8ee0100.
> > > > 
> > > > I think it is OK. What about the users of mathedSymbolDim in 
> > > > InsetMathFrac?
> > > > Is kerning irrelevant here?
> > 
> > This looks good for master and probably branch as far as I am concerned.
> 
> I am not really satisfied when navigating a formula with the cursor.
> The caret will be placed in the middle of a symbol instead of after it.
> Taking away the change to GuiFontMetrics.cpp makes navigation more
> pleasant but both scripts are placed far away the symbol.
> 
> I propose the attached patch that leaves unchanged GuiFontMetrics::width()
> and makes negative the kerning for a symbol, so that the subscript is
> moved to the left instead of moving the superscript to the right.

Patch pushed at 0b3e6916.

Richard, I attach here the corresponding patch for stable.

-- 
Enrico
diff --git a/src/frontends/qt4/GuiFontMetrics.cpp 
b/src/frontends/qt4/GuiFontMetrics.cpp
index 67fcb2f0e4..02c5054094 100644
--- a/src/frontends/qt4/GuiFontMetrics.cpp
+++ b/src/frontends/qt4/GuiFontMetrics.cpp
@@ -212,16 +212,19 @@ int GuiFontMetrics::width(docstring const & s) const
/* For some reason QMetrics::width returns a wrong value with Qt5
 * with some arabic text. OTOH, QTextLayout is broken for single
 * characters with null width (like \not in mathed). Also, as a
-* safety measure, always use QMetrics::width with our math fonts.
+* safety measure, always use QMetrics::boundingRect().width()
+* with our math fonts.
*/
int w = 0;
if (s.length() == 1
 #if QT_VERSION >= 0x040800
|| font_.styleName() == "LyX"
 #endif
-   )
-   w = metrics_.width(toqstr(s));
-   else {
+   ) {
+   // keep value 0 for math chars with null width
+   if (metrics_.width(toqstr(s)) != 0)
+   w = metrics_.boundingRect(toqstr(s)).width();
+   } else {
QTextLayout tl;
tl.setText(toqstr(s));
tl.setFont(font_);
diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp
index 1137c95e75..3a9d18c5c2 100644
--- a/src/mathed/InsetMathChar.cpp
+++ b/src/mathed/InsetMathChar.cpp
@@ -113,9 +113,7 @@ void InsetMathChar::metrics(MetricsInfo & mi, Dimension & 
dim) const
if (isMathFont(f) && subst_) {
// If the char has a substitute, draw the replacement symbol
// instead, but only in math mode.
-   mathedSymbolDim(mi.base, dim, subst_);
-   kerning_ = mathed_char_kerning(mi.base.font, 
*subst_->draw.rbegin());
-   return;
+   kerning_ = mathedSymbolDim(mi.base, dim, subst_);
} else if (!slanted(char_) && f == "mathnormal") {
Changer dummy = mi.base.font.changeShape(UP_SHAPE);
dim = theFontMetrics(mi.base.font).dimension(char_);
diff --git a/src/mathed/InsetMathSymbol.cpp b/src/mathed/InsetMathSymbol.cpp
index 92d2573560..106780e578 100644
--- a/src/mathed/InsetMathSymbol.cpp
+++ b/src/mathed/InsetMathSymbol.cpp
@@ -60,10 +60,8 @@ docstring InsetMathSymbol::name() const
 
 void InsetMathSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-   // set dim
-   mathedSymbolDim(mi.base, dim, sym_);
-   // set kerning_
-   kerning_ = mathed_char_kerning(mi.base.font, *sym_->draw.rbegin());
+   // set dim and negative kerning_ to move a subscript leftward
+   kerning_ = -mathedSymbolDim(mi.base, dim, sym_);
// correct height for broken cmex and wasy font
if (sym_->inset == "cmex" || sym_->inset == "wasy") {
h_ = 4 * dim.des / 5;
diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp
index b9ea145c67..26d508f12c 100644
--- a/src/mathed/MathSupport.cpp
+++ b/src/mathed/MathSupport.cpp
@@ -673,9 +673,9 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int 
w, int h,
 }
 
 
-void mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
+int mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
 {
-   LASSERT((bool)sym, return);
+   LASSERT((bool)sym, return 0);
//lyxerr << "metrics: symbol: '" << sym->name
//  << "' in font: '" << sym->inset
//  << "' drawn as: '" << sym->draw
@@ -687,6 +687,7 @@ void mathedSymbolDim(MetricsBase & mb, Dimension & dim, 
latexkeys const * sym)
std::string const font = italic_upcase_greek ? "cmm" : 

Re: [LyX/master] Implement variable size bigops

2020-07-23 Thread Enrico Forestieri
On Thu, Jul 23, 2020 at 03:24:13PM +0200, Jean-Marc Lasgouttes wrote:
> Le 23/07/2020 à 15:13, Enrico Forestieri a écrit :
> > On Thu, Jul 23, 2020 at 01:16:32PM +0200, Jean-Marc Lasgouttes wrote:
> > 
> > > Le 23/07/2020 à 12:22, Enrico Forestieri a écrit :
> > > > Here is an alternative patch. Please check whether the change in
> > > > InsetMathSymbol.cpp is compatible with the corresponding change
> > > > at e8ee0100.
> > > 
> > > I think it is OK. What about the users of mathedSymbolDim in 
> > > InsetMathFrac?
> > > Is kerning irrelevant here?
> 
> This looks good for master and probably branch as far as I am concerned.

I am not really satisfied when navigating a formula with the cursor.
The caret will be placed in the middle of a symbol instead of after it.
Taking away the change to GuiFontMetrics.cpp makes navigation more
pleasant but both scripts are placed far away the symbol.

I propose the attached patch that leaves unchanged GuiFontMetrics::width()
and makes negative the kerning for a symbol, so that the subscript is
moved to the left instead of moving the superscript to the right.

-- 
Enrico
diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp
index 36bdeaa2ba..d5ef8dc1f5 100644
--- a/src/mathed/InsetMathChar.cpp
+++ b/src/mathed/InsetMathChar.cpp
@@ -113,9 +113,7 @@ void InsetMathChar::metrics(MetricsInfo & mi, Dimension & 
dim) const
if (isMathFont(f) && subst_) {
// If the char has a substitute, draw the replacement symbol
// instead, but only in math mode.
-   mathedSymbolDim(mi.base, dim, subst_);
-   kerning_ = mathed_char_kerning(mi.base.font, 
*subst_->draw.rbegin());
-   return;
+   kerning_ = mathedSymbolDim(mi.base, dim, subst_);
} else if (!slanted(char_) && f == "mathnormal") {
Changer dummy = mi.base.font.changeShape(UP_SHAPE);
dim = theFontMetrics(mi.base.font).dimension(char_);
diff --git a/src/mathed/InsetMathSymbol.cpp b/src/mathed/InsetMathSymbol.cpp
index 276fab9ddc..ef2a3e94ec 100644
--- a/src/mathed/InsetMathSymbol.cpp
+++ b/src/mathed/InsetMathSymbol.cpp
@@ -68,14 +68,11 @@ Limits InsetMathSymbol::defaultLimits() const
 
 void InsetMathSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-   mathedSymbolDim(mi.base, dim, sym_);
+   // set dim
+   // FIXME: this should depend on BufferView
+   // set kerning_
+   kerning_ = -mathedSymbolDim(mi.base, dim, sym_);
if (sym_->draw != sym_->name) {
-   // set dim
-   // FIXME: this should depend on BufferView
-   // set kerning_
-   kerning_ = mathed_char_kerning(mi.base.font,
-  mathedSymbol(mi.base, 
sym_).back());
-
// align character vertically
// FIXME: this should depend on BufferView
h_ = 0;
diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp
index 12f8a842f6..45ca429681 100644
--- a/src/mathed/MathSupport.cpp
+++ b/src/mathed/MathSupport.cpp
@@ -680,9 +680,9 @@ docstring const &  mathedSymbol(MetricsBase & mb, latexkeys 
const * sym)
 }
 
 
-void mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
+int mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
 {
-   LASSERT((bool)sym, return);
+   LASSERT((bool)sym, return 0);
//lyxerr << "metrics: symbol: '" << sym->name
//  << "' in font: '" << sym->inset
//  << "' drawn as: '" << sym->draw
@@ -694,6 +694,7 @@ void mathedSymbolDim(MetricsBase & mb, Dimension & dim, 
latexkeys const * sym)
std::string const font = italic_upcase_greek ? "cmm" : sym->inset;
Changer dummy = mb.changeFontSet(font);
mathed_string_dim(mb.font, mathedSymbol(mb, sym), dim);
+   return mathed_char_kerning(mb.font, mathedSymbol(mb, sym).back());
 }
 
 
diff --git a/src/mathed/MathSupport.h b/src/mathed/MathSupport.h
index fa7b2fe0ea..9fde420ce2 100644
--- a/src/mathed/MathSupport.h
+++ b/src/mathed/MathSupport.h
@@ -57,7 +57,7 @@ int mathed_string_width(FontInfo const &, docstring const & 
s);
 
 docstring const & mathedSymbol(MetricsBase & mb, latexkeys const * sym);
 
-void mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym);
+int mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym);
 
 void mathedSymbolDraw(PainterInfo & pi, int x, int y, latexkeys const * sym);
 
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Implement variable size bigops

2020-07-23 Thread Jean-Marc Lasgouttes

Le 23/07/2020 à 15:13, Enrico Forestieri a écrit :

On Thu, Jul 23, 2020 at 01:16:32PM +0200, Jean-Marc Lasgouttes wrote:


Le 23/07/2020 à 12:22, Enrico Forestieri a écrit :

Here is an alternative patch. Please check whether the change in
InsetMathSymbol.cpp is compatible with the corresponding change
at e8ee0100.


I think it is OK. What about the users of mathedSymbolDim in InsetMathFrac?
Is kerning irrelevant here?


This looks good for master and probably branch as far as I am concerned.

JMarc

PS: starting tonight I will be in vacation until end of August. I will 
answer e-mail, but no coding (and no LyX release, sorry).


JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Implement variable size bigops

2020-07-23 Thread Enrico Forestieri
On Thu, Jul 23, 2020 at 01:16:32PM +0200, Jean-Marc Lasgouttes wrote:

> Le 23/07/2020 à 12:22, Enrico Forestieri a écrit :
> > Here is an alternative patch. Please check whether the change in
> > InsetMathSymbol.cpp is compatible with the corresponding change
> > at e8ee0100.
> 
> I think it is OK. What about the users of mathedSymbolDim in InsetMathFrac?
> Is kerning irrelevant here?

I think so.

-- 
Enrico
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Implement variable size bigops

2020-07-23 Thread Jean-Marc Lasgouttes

Le 23/07/2020 à 12:22, Enrico Forestieri a écrit :

Here is an alternative patch. Please check whether the change in
InsetMathSymbol.cpp is compatible with the corresponding change
at e8ee0100.


I think it is OK. What about the users of mathedSymbolDim in 
InsetMathFrac? Is kerning irrelevant here?


JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Implement variable size bigops

2020-07-23 Thread Enrico Forestieri
On Thu, Jul 23, 2020 at 11:12:44AM +0200, Jean-Marc Lasgouttes wrote:
> Le 23/07/2020 à 00:26, Enrico Forestieri a écrit :
> > On Wed, Jul 22, 2020 at 11:14:05PM +0200, Enrico Forestieri wrote:
> > > 
> > > So, the question is why in current master the metrics of the wrong
> > > font are used? I don't have an answer.
> > 
> > The culprit turns out to be be836909c52 and the attached patch fixes
> > this issue for me.
> 
> So, you mean that the code should use the font of the symbol and not the
> font of the environment? That makes perfect sense...
> 
> Congrats, Enrico.
> 
> Instead of returning the font of the symbol (which is a weird side effect),
> it would be possible to introduce mathedSymbolFont(). Or to move this
> mathedSymbolXX stuff to members of latexkeys.

Here is an alternative patch. Please check whether the change in
InsetMathSymbol.cpp is compatible with the corresponding change
at e8ee0100.

-- 
Enrico
diff --git a/src/frontends/qt/GuiFontMetrics.cpp 
b/src/frontends/qt/GuiFontMetrics.cpp
index acc804460d..a9b23e9178 100644
--- a/src/frontends/qt/GuiFontMetrics.cpp
+++ b/src/frontends/qt/GuiFontMetrics.cpp
@@ -244,10 +244,7 @@ int GuiFontMetrics::width(docstring const & s) const
tl.beginLayout();
QTextLine line = tl.createLine();
tl.endLayout();
-   if (math_char)
-   w = iround(line.naturalTextWidth());
-   else
-   w = iround(line.horizontalAdvance());
+   w = iround(line.horizontalAdvance());
}
strwidth_cache_.insert(s, w, s.size() * sizeof(char_type));
return w;
diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp
index 36bdeaa2ba..d5ef8dc1f5 100644
--- a/src/mathed/InsetMathChar.cpp
+++ b/src/mathed/InsetMathChar.cpp
@@ -113,9 +113,7 @@ void InsetMathChar::metrics(MetricsInfo & mi, Dimension & 
dim) const
if (isMathFont(f) && subst_) {
// If the char has a substitute, draw the replacement symbol
// instead, but only in math mode.
-   mathedSymbolDim(mi.base, dim, subst_);
-   kerning_ = mathed_char_kerning(mi.base.font, 
*subst_->draw.rbegin());
-   return;
+   kerning_ = mathedSymbolDim(mi.base, dim, subst_);
} else if (!slanted(char_) && f == "mathnormal") {
Changer dummy = mi.base.font.changeShape(UP_SHAPE);
dim = theFontMetrics(mi.base.font).dimension(char_);
diff --git a/src/mathed/InsetMathSymbol.cpp b/src/mathed/InsetMathSymbol.cpp
index 276fab9ddc..f2e545434b 100644
--- a/src/mathed/InsetMathSymbol.cpp
+++ b/src/mathed/InsetMathSymbol.cpp
@@ -68,14 +68,11 @@ Limits InsetMathSymbol::defaultLimits() const
 
 void InsetMathSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-   mathedSymbolDim(mi.base, dim, sym_);
+   // set dim
+   // FIXME: this should depend on BufferView
+   // set kerning_
+   kerning_ = mathedSymbolDim(mi.base, dim, sym_);
if (sym_->draw != sym_->name) {
-   // set dim
-   // FIXME: this should depend on BufferView
-   // set kerning_
-   kerning_ = mathed_char_kerning(mi.base.font,
-  mathedSymbol(mi.base, 
sym_).back());
-
// align character vertically
// FIXME: this should depend on BufferView
h_ = 0;
diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp
index 12f8a842f6..45ca429681 100644
--- a/src/mathed/MathSupport.cpp
+++ b/src/mathed/MathSupport.cpp
@@ -680,9 +680,9 @@ docstring const &  mathedSymbol(MetricsBase & mb, latexkeys 
const * sym)
 }
 
 
-void mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
+int mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
 {
-   LASSERT((bool)sym, return);
+   LASSERT((bool)sym, return 0);
//lyxerr << "metrics: symbol: '" << sym->name
//  << "' in font: '" << sym->inset
//  << "' drawn as: '" << sym->draw
@@ -694,6 +694,7 @@ void mathedSymbolDim(MetricsBase & mb, Dimension & dim, 
latexkeys const * sym)
std::string const font = italic_upcase_greek ? "cmm" : sym->inset;
Changer dummy = mb.changeFontSet(font);
mathed_string_dim(mb.font, mathedSymbol(mb, sym), dim);
+   return mathed_char_kerning(mb.font, mathedSymbol(mb, sym).back());
 }
 
 
diff --git a/src/mathed/MathSupport.h b/src/mathed/MathSupport.h
index fa7b2fe0ea..9fde420ce2 100644
--- a/src/mathed/MathSupport.h
+++ b/src/mathed/MathSupport.h
@@ -57,7 +57,7 @@ int mathed_string_width(FontInfo const &, docstring const & 
s);
 
 docstring const & mathedSymbol(MetricsBase & mb, latexkeys const * sym);
 
-void mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym);
+int mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym);
 
 void 

Re: [LyX/master] Implement variable size bigops

2020-07-23 Thread Jean-Marc Lasgouttes

Le 23/07/2020 à 00:26, Enrico Forestieri a écrit :

On Wed, Jul 22, 2020 at 11:14:05PM +0200, Enrico Forestieri wrote:


So, the question is why in current master the metrics of the wrong
font are used? I don't have an answer.


The culprit turns out to be be836909c52 and the attached patch fixes
this issue for me.


So, you mean that the code should use the font of the symbol and not the 
font of the environment? That makes perfect sense...


Congrats, Enrico.

Instead of returning the font of the symbol (which is a weird side 
effect), it would be possible to introduce mathedSymbolFont(). Or to 
move this mathedSymbolXX stuff to members of latexkeys.


But the important part is done :)

JMarc



--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Implement variable size bigops

2020-07-22 Thread Enrico Forestieri
On Wed, Jul 22, 2020 at 11:14:05PM +0200, Enrico Forestieri wrote:
> 
> So, the question is why in current master the metrics of the wrong
> font are used? I don't have an answer.

The culprit turns out to be be836909c52 and the attached patch fixes
this issue for me.

-- 
Enrico
diff --git a/src/frontends/qt/GuiFontMetrics.cpp b/src/frontends/qt/GuiFontMetrics.cpp
index acc804460d..a9b23e9178 100644
--- a/src/frontends/qt/GuiFontMetrics.cpp
+++ b/src/frontends/qt/GuiFontMetrics.cpp
@@ -244,10 +244,7 @@ int GuiFontMetrics::width(docstring const & s) const
 		tl.beginLayout();
 		QTextLine line = tl.createLine();
 		tl.endLayout();
-		if (math_char)
-			w = iround(line.naturalTextWidth());
-		else
-			w = iround(line.horizontalAdvance());
+		w = iround(line.horizontalAdvance());
 	}
 	strwidth_cache_.insert(s, w, s.size() * sizeof(char_type));
 	return w;
diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp
index 36bdeaa2ba..96decb8fe5 100644
--- a/src/mathed/InsetMathChar.cpp
+++ b/src/mathed/InsetMathChar.cpp
@@ -113,7 +113,8 @@ void InsetMathChar::metrics(MetricsInfo & mi, Dimension & dim) const
 	if (isMathFont(f) && subst_) {
 		// If the char has a substitute, draw the replacement symbol
 		// instead, but only in math mode.
-		mathedSymbolDim(mi.base, dim, subst_);
+		string const & font = mathedSymbolDim(mi.base, dim, subst_);
+		Changer dummy = mi.base.changeFontSet(font);
 		kerning_ = mathed_char_kerning(mi.base.font, *subst_->draw.rbegin());
 		return;
 	} else if (!slanted(char_) && f == "mathnormal") {
diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp
index 90d507cfbe..f561be1c0b 100644
--- a/src/mathed/InsetMathFrac.cpp
+++ b/src/mathed/InsetMathFrac.cpp
@@ -219,7 +219,8 @@ void InsetMathFrac::metrics(MetricsInfo & mi, Dimension & dim) const
 		Changer dummy2 = mi.base.changeScript();
 		if (latexkeys const * slash = slash_symbol()) {
 			Dimension dimslash;
-			mathedSymbolDim(mi.base, dimslash, slash);
+			string const & font = mathedSymbolDim(mi.base, dimslash, slash);
+			Changer dummy = mi.base.changeFontSet(font);
 			dim.wid += dimslash.wid - mathed_mu(mi.base.font, 3.0);
 			dim.asc = max(dim.asc, dimslash.asc);
 			dim.des = max(dim.des, dimslash.des);
@@ -307,7 +308,8 @@ void InsetMathFrac::draw(PainterInfo & pi, int x, int y) const
 			int mkern = mathed_mu(pi.base.font, 2.0);
 			mathedSymbolDraw(pi, xx + 1 + dim0.wid - mkern, y, slash);
 			Dimension dimslash;
-			mathedSymbolDim(pi.base, dimslash, slash);
+			string const & font = mathedSymbolDim(pi.base, dimslash, slash);
+			Changer dummy = pi.base.changeFontSet(font);
 			xx += dimslash.wid - mathed_mu(pi.base.font, 3.0);
 		}
 		cell(1).draw(pi, xx + 1 + dim0.wid, y);
diff --git a/src/mathed/InsetMathSymbol.cpp b/src/mathed/InsetMathSymbol.cpp
index 276fab9ddc..54d3efcf6a 100644
--- a/src/mathed/InsetMathSymbol.cpp
+++ b/src/mathed/InsetMathSymbol.cpp
@@ -68,11 +68,12 @@ Limits InsetMathSymbol::defaultLimits() const
 
 void InsetMathSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-	mathedSymbolDim(mi.base, dim, sym_);
+	string const & font = mathedSymbolDim(mi.base, dim, sym_);
 	if (sym_->draw != sym_->name) {
 		// set dim
 		// FIXME: this should depend on BufferView
 		// set kerning_
+		Changer dummy = mi.base.changeFontSet(font);
 		kerning_ = mathed_char_kerning(mi.base.font,
 		   mathedSymbol(mi.base, sym_).back());
 
diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp
index 12f8a842f6..cd5a9414aa 100644
--- a/src/mathed/MathSupport.cpp
+++ b/src/mathed/MathSupport.cpp
@@ -680,9 +680,9 @@ docstring const &  mathedSymbol(MetricsBase & mb, latexkeys const * sym)
 }
 
 
-void mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
+string mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
 {
-	LASSERT((bool)sym, return);
+	LASSERT((bool)sym, return "cmm");
 	//lyxerr << "metrics: symbol: '" << sym->name
 	//	<< "' in font: '" << sym->inset
 	//	<< "' drawn as: '" << sym->draw
@@ -694,6 +694,7 @@ void mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
 	std::string const font = italic_upcase_greek ? "cmm" : sym->inset;
 	Changer dummy = mb.changeFontSet(font);
 	mathed_string_dim(mb.font, mathedSymbol(mb, sym), dim);
+	return font;
 }
 
 
diff --git a/src/mathed/MathSupport.h b/src/mathed/MathSupport.h
index fa7b2fe0ea..877c191efb 100644
--- a/src/mathed/MathSupport.h
+++ b/src/mathed/MathSupport.h
@@ -57,7 +57,7 @@ int mathed_string_width(FontInfo const &, docstring const & s);
 
 docstring const & mathedSymbol(MetricsBase & mb, latexkeys const * sym);
 
-void mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym);
+std::string mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym);
 
 void mathedSymbolDraw(PainterInfo & pi, int x, int y, latexkeys const * sym);
 
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org

Re: [LyX/master] Implement variable size bigops

2020-07-22 Thread Enrico Forestieri
On Tue, Jul 21, 2020 at 11:12:33PM +0200, Enrico Forestieri wrote:
> On Sat, Jul 18, 2020 at 12:01:16AM +0200, Jean-Marc Lasgouttes wrote:
> > Le 17/07/2020 à 23:40, Enrico Forestieri a écrit :
> > > On Fri, Jul 17, 2020 at 10:32:09PM +0200, Jean-Marc Lasgouttes wrote:
> > > > 
> > > > This is something that has been bugging me for some time. Look at the 
> > > > file
> > > > in attachment to see what the effect is.
> > > 
> > > Yes, it looks better. However, it also makes more evident that the
> > > lower limit of an integral is badly placed. In general, the limits
> > > of an integral were better placed until lyx 2.2 and somewhat broken
> > > starting from 2.3.
> > 
> > I will try to check older versions. I broke something, but what? Could it be
> > also a matter of Qt or freetype version?
> 
> I made the following experiment. After applying the attached patch to
> the lyx 2.2 sources, I compiled them using Qt 5.15.0. Then replaced
> the esint10.ttf font with the current one in master. Thus, I was using
> the same ttf font and Qt version. Then I loaded the attached document
> in lyx 2.2 and current master (compiled after applying the debugging patch
> to MathSupport.cpp). I got the following results.
> 
> lyx 2.2:
> code: 2, lbearing: 1, rbearing: 22, width: 13, kerning: 9
> 
> current master:
> code: 2, lbearing: 0, rbearing: 10, width: 10, kerning: 0

The above results were obtained on Windows. The following ones, which are
even more disconcerting, on linux.

lyx-2.2
code: 2, lbearing: 1, rbearing: 28, width: 16, kerning: 12

current master:
code: 2, lbearing: 0, rbearing: 0, width: 7, kerning: 0

> I wonder why the metrics are so different given that both Qt and
> the ttf font are the same. Needless to say that the limits are
> perfectly placed in lyx 2.2 and misplaced in current master.

I think the answer to the previous question is that the metrics on master
do not refer to the correct font.

After applying the attached patches to lyx 2.2 and current master, and
loading the document attached to the previous email, I get the following.

lyx-2.2:
caching width: 10, code: 73, family: TeX Gyre Termes
caching width: 13, code: 120, family: TeX Gyre Termes
caching width: 16, code: 2, family: esint10
caching width: 7, code: 73, family: TeX Gyre Termes
caching width: 9, code: 120, family: TeX Gyre Termes
caching width: 10, code: 49, family: TeX Gyre Termes
caching width: 10, code: 48, family: TeX Gyre Termes

current master:
caching width: 8, code: 73, family: TeX Gyre Termes
caching strwidth: 13, code: 2, family: esint10
caching width: 7, code: 2, family: TeX Gyre Termes
caching width: 6, code: 73, family: TeX Gyre Termes
caching width: 8, code: 49, family: TeX Gyre Termes
caching width: 8, code: 48, family: TeX Gyre Termes
caching strwidth: 8, code: 49, family: TeX Gyre Termes
caching strwidth: 8, code: 48, family: TeX Gyre Termes

As you can see, in the current master case, the width 7 comes from
the codepoint 2 of the "TeX Gyre Termes" font, not esint10.
It can also be seen that in 2.2 the strwidth cache never comes into
play, contrarily to the current master case.

So, the question is why in current master the metrics of the wrong
font are used? I don't have an answer.

-- 
Enrico
diff --git a/lib/symbols b/lib/symbols
index 277dd80cba..0542399f54 100644
--- a/lib/symbols
+++ b/lib/symbols
@@ -994,8 +994,8 @@ tbond  cmsy180 186 mathord  x  x
 # If the wasysym integrals are really wanted then one has to load the package
 # manually and disable automatic loading of amsmath and esint.
 iffont esint
-intesint0010  mathop   esint|amsmath
-intop  esint0010  mathop   esint
+intesint0020  mathop   esint|amsmath
+intop  esint0020  mathop   esint
 iint   esint0030  mathop   esint|amsmath
 iintop esint0030  mathop   esint
 iiint  esint0050  mathop  esint|amsmath
diff --git a/src/frontends/qt4/GuiFontMetrics.cpp b/src/frontends/qt4/GuiFontMetrics.cpp
index acc804460d..e277424658 100644
--- a/src/frontends/qt4/GuiFontMetrics.cpp
+++ b/src/frontends/qt4/GuiFontMetrics.cpp
@@ -22,6 +22,7 @@
 #include "insets/Inset.h"
 
 #include "support/convert.h"
+#include "support/debug.h"
 #include "support/lassert.h"
 #include "support/lyxlib.h"
 
@@ -204,6 +205,15 @@ int GuiFontMetrics::width(docstring const & s) const
 #else
 		w = iround(line.naturalTextWidth());
 #endif
+		lyxerr << "caching strwidth: " << w;
+		if (s.length() > 1) {
+			lyxerr << ", codes:";
+			for (int i = s.length() - 1; i >= 0; --i)
+lyxerr << " " << int(s[i]);
+		} else {
+			lyxerr << ", code: " << int(s[0]);
+		}
+		lyxerr << ", family: " << fromqstr(font_.family()) << endl;
 	}
 	strwidth_cache_.insert(s, w, s.size() * sizeof(char_type));
 	return w;
@@ -485,6 +495,9 @@ int 

Re: [LyX/master] Implement variable size bigops

2020-07-21 Thread Enrico Forestieri
On Sat, Jul 18, 2020 at 12:01:16AM +0200, Jean-Marc Lasgouttes wrote:
> Le 17/07/2020 à 23:40, Enrico Forestieri a écrit :
> > On Fri, Jul 17, 2020 at 10:32:09PM +0200, Jean-Marc Lasgouttes wrote:
> > > 
> > > This is something that has been bugging me for some time. Look at the file
> > > in attachment to see what the effect is.
> > 
> > Yes, it looks better. However, it also makes more evident that the
> > lower limit of an integral is badly placed. In general, the limits
> > of an integral were better placed until lyx 2.2 and somewhat broken
> > starting from 2.3.
> 
> I will try to check older versions. I broke something, but what? Could it be
> also a matter of Qt or freetype version?

I made the following experiment. After applying the attached patch to
the lyx 2.2 sources, I compiled them using Qt 5.15.0. Then replaced
the esint10.ttf font with the current one in master. Thus, I was using
the same ttf font and Qt version. Then I loaded the attached document
in lyx 2.2 and current master (compiled after applying the debugging patch
to MathSupport.cpp). I got the following results.

lyx 2.2:
code: 2, lbearing: 1, rbearing: 22, width: 13, kerning: 9

current master:
code: 2, lbearing: 0, rbearing: 10, width: 10, kerning: 0

I wonder why the metrics are so different given that both Qt and
the ttf font are the same. Needless to say that the limits are
perfectly placed in lyx 2.2 and misplaced in current master.

-- 
Enrico
--- a/lyx-2.2.4/lib/symbols 2018-03-17 19:02:27.0 +0100
+++ b/lyx-2.2.4/lib/symbols 2020-07-21 22:19:26.627347700 +0200
@@ -994,8 +994,8 @@ tbond  cmsy180 186 m
 # If the wasysym integrals are really wanted then one has to load the package
 # manually and disable automatic loading of amsmath and esint.
 iffont esint
-intesint0010  mathop   esint|amsmath
-intop  esint0010  mathop   esint
+intesint0020  mathop   esint|amsmath
+intop  esint0020  mathop   esint
 iint   esint0030  mathop   esint|amsmath
 iintop esint0030  mathop   esint
 iiint  esint0050  mathop  esint|amsmath
--- a/lyx-2.2.4/src/frontends/qt4/GuiDocument.cpp   2018-03-17 
19:02:27.0 +0100
+++ b/lyx-2.2.4/src/frontends/qt4/GuiDocument.cpp   2020-07-21 
22:06:22.510986600 +0200
@@ -67,6 +67,7 @@
 #include "frontends/alert.h"
 
 #include 
+#include 
 #include 
 #include 
 #include 
--- a/lyx-2.2.4/src/mathed/MathSupport.cpp  2018-03-17 19:02:27.0 
+0100
+++ b/lyx-2.2.4/src/mathed/MathSupport.cpp  2020-07-21 22:21:16.454006900 
+0200
@@ -516,6 +516,10 @@ int mathed_char_width(FontInfo const & f
 int mathed_char_kerning(FontInfo const & font, char_type c)
 {
frontend::FontMetrics const & fm = theFontMetrics(font);
+   lyxerr << "code: " << c << ", lbearing: " << fm.lbearing(c)
+  << ", rbearing: " << fm.rbearing(c) << ", width: " << fm.width(c)
+  << ", kerning: " << fm.rbearing(c) - fm.width(c)
+  << std::endl;
return fm.rbearing(c) - fm.width(c);
 }
 
#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\use_default_options false
\maintain_unincluded_children false
\language american
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 0
\use_package mathdots 0
\use_package mathtools 1
\use_package mhchem 0
\use_package stackrel 1
\use_package stmaryrd 2
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
\begin_inset Formula 
\[
\int_{0}^{1}
\]

\end_inset


\end_layout

\end_body
\end_document
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org

Re: [LyX/master] Implement variable size bigops

2020-07-18 Thread Jean-Marc Lasgouttes

Le 18/07/2020 à 18:47, Enrico Forestieri a écrit :

On Fri, Jul 17, 2020 at 09:30:32PM -0400, Scott Kostyshak wrote:

On Sat, Jul 18, 2020 at 12:01:16AM +0200, Jean-Marc Lasgouttes wrote:

Le 17/07/2020 à 23:40, Enrico Forestieri a écrit :

On Fri, Jul 17, 2020 at 10:32:09PM +0200, Jean-Marc Lasgouttes wrote:


This is something that has been bugging me for some time. Look at the file
in attachment to see what the effect is.


Yes, it looks better. However, it also makes more evident that the
lower limit of an integral is badly placed. In general, the limits
of an integral were better placed until lyx 2.2 and somewhat broken
starting from 2.3.


I will try to check older versions. I broke something, but what? Could it be
also a matter of Qt or freetype version?


Is this related to the following?

   
https://www.mail-archive.com/search?l=mid=20180131222631.xhlo3g4svsksfi5z%40steph


Yep, it's the same issue. I had forgot about it.
And also JMarc, seemingly ;-)



Yes and the details are interesting but depressing too. I'll have a 
fresh look at it.


JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Implement variable size bigops

2020-07-18 Thread Enrico Forestieri
On Fri, Jul 17, 2020 at 09:30:32PM -0400, Scott Kostyshak wrote:
> On Sat, Jul 18, 2020 at 12:01:16AM +0200, Jean-Marc Lasgouttes wrote:
> > Le 17/07/2020 à 23:40, Enrico Forestieri a écrit :
> > > On Fri, Jul 17, 2020 at 10:32:09PM +0200, Jean-Marc Lasgouttes wrote:
> > > > 
> > > > This is something that has been bugging me for some time. Look at the 
> > > > file
> > > > in attachment to see what the effect is.
> > > 
> > > Yes, it looks better. However, it also makes more evident that the
> > > lower limit of an integral is badly placed. In general, the limits
> > > of an integral were better placed until lyx 2.2 and somewhat broken
> > > starting from 2.3.
> > 
> > I will try to check older versions. I broke something, but what? Could it be
> > also a matter of Qt or freetype version?
> 
> Is this related to the following?
> 
>   
> https://www.mail-archive.com/search?l=mid=20180131222631.xhlo3g4svsksfi5z%40steph

Yep, it's the same issue. I had forgot about it.
And also JMarc, seemingly ;-)

-- 
Enrico
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Implement variable size bigops

2020-07-17 Thread Scott Kostyshak
On Sat, Jul 18, 2020 at 12:01:16AM +0200, Jean-Marc Lasgouttes wrote:
> Le 17/07/2020 à 23:40, Enrico Forestieri a écrit :
> > On Fri, Jul 17, 2020 at 10:32:09PM +0200, Jean-Marc Lasgouttes wrote:
> > > 
> > > This is something that has been bugging me for some time. Look at the file
> > > in attachment to see what the effect is.
> > 
> > Yes, it looks better. However, it also makes more evident that the
> > lower limit of an integral is badly placed. In general, the limits
> > of an integral were better placed until lyx 2.2 and somewhat broken
> > starting from 2.3.
> 
> I will try to check older versions. I broke something, but what? Could it be
> also a matter of Qt or freetype version?

Is this related to the following?

  
https://www.mail-archive.com/search?l=mid=20180131222631.xhlo3g4svsksfi5z%40steph

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Implement variable size bigops

2020-07-17 Thread Jean-Marc Lasgouttes

Le 17/07/2020 à 23:40, Enrico Forestieri a écrit :

On Fri, Jul 17, 2020 at 10:32:09PM +0200, Jean-Marc Lasgouttes wrote:


This is something that has been bugging me for some time. Look at the file
in attachment to see what the effect is.


Yes, it looks better. However, it also makes more evident that the
lower limit of an integral is badly placed. In general, the limits
of an integral were better placed until lyx 2.2 and somewhat broken
starting from 2.3.


I will try to check older versions. I broke something, but what? Could 
it be also a matter of Qt or freetype version?


JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Implement variable size bigops

2020-07-17 Thread Enrico Forestieri
On Fri, Jul 17, 2020 at 11:40:54PM +0200, Enrico Forestieri wrote:

> On Fri, Jul 17, 2020 at 10:32:09PM +0200, Jean-Marc Lasgouttes wrote:
> > 
> > This is something that has been bugging me for some time. Look at the file
> > in attachment to see what the effect is.
> 
> Yes, it looks better. However, it also makes more evident that the
> lower limit of an integral is badly placed. In general, the limits
> of an integral were better placed until lyx 2.2 and somewhat broken
> starting from 2.3.

See the attached screenshot. It was obtained with lyx 2.2 by tweaking
the symbols file such as to use the larger integral sign.

-- 
Enrico
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Implement variable size bigops

2020-07-17 Thread Enrico Forestieri
On Fri, Jul 17, 2020 at 10:32:09PM +0200, Jean-Marc Lasgouttes wrote:
> 
> This is something that has been bugging me for some time. Look at the file
> in attachment to see what the effect is.

Yes, it looks better. However, it also makes more evident that the
lower limit of an integral is badly placed. In general, the limits
of an integral were better placed until lyx 2.2 and somewhat broken
starting from 2.3.

-- 
Enrico
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Implement variable size bigops

2020-07-17 Thread Jean-Marc Lasgouttes

Le 17/07/2020 à 22:03, Jean-Marc Lasgouttes a écrit :

commit e8ee0100fcabad72b03cf0a17cccd589bd1cdd46
Author: Jean-Marc Lasgouttes 
Date:   Fri Jul 17 18:49:08 2020 +0200

 Implement variable size bigops
 
 The goal is to reproduce the change of size of operators like \sum wen they

 are in display style.
 
 The syntax of the symbols file has been extended to allow for two code

 points (like 80|88 for \sum). In this case, the second one will be
 used in display style.
 
 Update the symbols file to handle all bigops from cmex, esint, wasy and

 stmaryrd.
 
 Let the code for math symbol inset handle symbols which can change size,

 using the information from the symbols file.


This is something that has been bugging me for some time. Look at the 
file in attachment to see what the effect is.


Note that the syntax of the symbols file has changed. I guess there are 
some scripts that should be adapted. The only difference is that the 
code point for a symbol can be a pair (only the TeX fonts one, not the 
fallbacks, although it could be done if needed) in the form "80|88".


The code points have been obtained by visual inspection of the fonts. 
Normally the test file shows that they are OK.


JMarc


---
  lib/symbols|  135 ---
  src/mathed/InsetMathSymbol.cpp |   27 ++--
  src/mathed/MathFactory.cpp |   14 +++-
  src/mathed/MathParser.h|3 +
  src/mathed/MathSupport.cpp |   11 +++-
  src/mathed/MathSupport.h   |2 +
  6 files changed, 115 insertions(+), 77 deletions(-)

diff --git a/lib/symbols b/lib/symbols
index 277dd80..4da0aac 100644
--- a/lib/symbols
+++ b/lib/symbols
@@ -244,6 +244,9 @@ tag*  mboxforcetext
  # symbols generated from fontmath.ltx
  #
  
+# When two codes n1|n2 are specified for charid, the the second one will

+# be used in display mode. This is only useful for mathop symbold (e.g.\sum).
+
  #symbolfont   charid   charid-in-fallback-Xsymbol-font  
math-class  HTML-entity XML-entity
  alpha  cmm 174  97 mathord   
  beta   cmm 175  98 mathord
@@ -319,18 +322,18 @@ iffont cmsy
  else
  \def\not{\kern4mu\lyxnot\kern-19mu}
  endif
-coprod cmex 96   0 mathop
-bigvee cmex 87   0 mathop 
-bigwedge   cmex 86   0 mathop   
-biguplus   cmex 85   0 mathop   
-bigcap cmex 84   0 mathop 
-bigcup cmex 83   0 mathop 
-prod   cmex 81 213 mathop 
-sumcmex 80 229 mathop  
-bigotimes  cmex 78   0 mathop   
-bigoplus   cmex 76   0 mathop   
-bigodotcmex 74   0 mathop
-bigsqcup   cmex 70   0 mathop   
+coprod cmex  96|97   0 mathop
+bigvee cmex  87|95   0 mathop 
+bigwedge   cmex  86|94   0 mathop   
+biguplus   cmex  85|93   0 mathop   
+bigcap cmex  84|92   0 mathop 
+bigcup cmex  83|91   0 mathop 
+prod   cmex  81|89 213 mathop 
+sumcmex  80|88 229 mathop  
+bigotimes  cmex  78|79   0 mathop   
+bigoplus   cmex  76|77   0 mathop   
+bigodotcmex  74|75   0 mathop
+bigsqcup   cmex  70|71   0 mathop   
  smallint   cmsy115   0 mathop  
  triangleleft   cmm  47   0 mathbin
  triangleright  cmm  46   0 mathbin
@@ -854,8 +857,8 @@ wasypropto wasy  290  mathrel 

  invneg wasy  240  mathrel   
  ocirclewasy  350  mathbin   
  logof  wasy  220  mathrel x x
-varint wasy 1140  mathop   
-varointwasy 1170  mathop   
+varint wasy 114|1190  mathop   
+varointwasy 117|1220  mathop   
  
  # Generated from stmaryrd.sty
  
@@ -962,13 +965,13 @@ leftarrowtriangle  stmry  94   0 mathrelx  x  stmaryrd

  rightarrowtriangle stmry  95   0 mathrelx  x  stmaryrd
  #bigtriangledownstmry  96   0 mathop x  x  stmaryrd #already in cmsy
  #bigtriangleup  stmry  97   0 mathop x  x  stmaryrd #already in cmsy
-bigcurlyveestmry  98   0 mathop x  x  stmaryrd
-bigcurlywedge  stmry  99   0 mathop x  x  stmaryrd
-bigsqcap   stmry 100   0 mathop x  x  stmaryrd
-bigbox stmry 101   0 mathop x