LyX/Mac metrics fix

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7817 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2003-09-24 10:26:02 +00:00
parent e97d2770b3
commit 3c4e5c1c40
2 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2003-09-22 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* math_symbolinset.C (metrics): apply a different hack to metrics
when running under OSX. Hopefully this will not break the X11
version under darwin (or hopefully nobody cares :)
2003-09-19 Angus Leeming <leeming@lyx.org>
* formula.[Ch] (previewWanted, generatePreview): now passed a

View File

@ -61,11 +61,24 @@ void MathSymbolInset::metrics(MetricsInfo & mi, Dimension & dim) const
FontSetChanger dummy(mi.base, sym_->inset.c_str());
mathed_string_dim(mi.base.font, sym_->draw, dim);
// correct height for broken cmex and wasy font
#if defined(__APPLE__) && defined(__GNUC__)
if (sym_->inset == "cmex") {
h_ = 4 * dim_.des / 5;
dim_.asc += 0*h_;
dim_.des -= h_;
h_ = dim_.asc;
} else if (sym_->inset == "wasy") {
h_ = 4 * dim.des / 5;
dim.asc += h_;
dim.des -= h_;
}
#else
if (sym_->inset == "cmex" || sym_->inset == "wasy") {
h_ = 4 * dim.des / 5;
dim.asc += h_;
dim.des -= h_;
}
#endif
// seperate things a bit
if (isRelOp())
dim.wid += static_cast<int>(0.5 * em + 0.5);