MathUnknown insets.
* src/mathed/InsetMathUnknown.C
(InsetMathUnknown::metrics): Cache kerning of last char.
* src/mathed/InsetMathUnknown.h
* src/mathed/InsetMathFontOld.h
(InsetMathUnknown::kerning): New. Return cached kerning value.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17528
a592a061-630c-0410-9148-
cb99ea01b6c8
void normalize(NormalStream &) const;
///
void infoize(odocstream & os) const;
+ ///
+ int kerning() const { return cell(0).kerning(); }
private:
virtual std::auto_ptr<InsetBase> doClone() const;
bool InsetMathUnknown::metrics(MetricsInfo & mi, Dimension & dim) const
{
mathed_string_dim(mi.base.font, name_, dim);
+ docstring::const_reverse_iterator rit = name_.rbegin();
+ kerning_ = mathed_char_kerning(mi.base.font, *rit);
if (dim_ == dim)
return false;
dim_ = dim;
void finalize();
///
bool final() const;
+ ///
+ int kerning() const { return kerning_; }
private:
virtual std::auto_ptr<InsetBase> doClone() const;
///
bool final_;
///
bool black_;
+ ///
+ mutable int kerning_;
};