From 3c4e5c1c40b2db2474c5f54e302c6dd26f8852dd Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 24 Sep 2003 10:26:02 +0000 Subject: [PATCH] LyX/Mac metrics fix git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7817 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 6 ++++++ src/mathed/math_symbolinset.C | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 957bbbe2ff..0c8542b967 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,9 @@ +2003-09-22 Jean-Marc Lasgouttes + + * 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 * formula.[Ch] (previewWanted, generatePreview): now passed a diff --git a/src/mathed/math_symbolinset.C b/src/mathed/math_symbolinset.C index 834905b726..70a8351481 100644 --- a/src/mathed/math_symbolinset.C +++ b/src/mathed/math_symbolinset.C @@ -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(0.5 * em + 0.5);