- //lyxerr << "metrics: symbol: '" << sym_->name
- // << "' in font: '" << sym_->inset
- // << "' drawn as: '" << sym_->draw
- // << "'" << std::endl;
-
- int const em = mathed_char_width(mi.base.font, 'M');
- FontSetChanger dummy(mi.base, sym_->inset);
- mathed_string_dim(mi.base.font, sym_->draw, dim);
- docstring::const_reverse_iterator rit = sym_->draw.rbegin();
- kerning_ = mathed_char_kerning(mi.base.font, *rit);
- // correct height for broken cmex and wasy font
- if (sym_->inset == "cmex" || sym_->inset == "wasy") {
- h_ = 4 * dim.des / 5;
+ if (allowsLimitsChange() && sym_->extra != "func" && display)
+ return LIMITS;
+ else
+ return NO_LIMITS;
+}
+
+
+void InsetMathSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+ // set dim
+ // FIXME: this should depend on BufferView
+ // set negative kerning_ so that a subscript is moved leftward
+ kerning_ = -mathedSymbolDim(mi.base, dim, sym_);
+ if (sym_->draw != sym_->name) {
+ // align character vertically
+ // FIXME: this should depend on BufferView
+ h_ = 0;
+ if (mathClass() == MC_OP) {
+ // center the symbol around the fraction axis
+ // See rule 13 of Appendix G of the TeXbook.
+ h_ = axis_height(mi.base) + (dim.des - dim.asc) / 2;
+ } else if (sym_->inset == "wasy") {
+ // correct height for broken wasy font
+ h_ = 4 * dim.des / 5;
+ }