+2005-04-10 Martin Vermeer <martin.vermeer@hut.fi>
+
+ * rowpainter.C (RowPainter, getFont): fix font inside inset
+ (bugs 1766, 1809)
+
2005-04-06 Martin Vermeer <martin.vermeer@hut.fi>
* CutAndPaste.C (eraseSelection): more precise fix for bug 1654,
+2005-04-10 Martin Vermeer <martin.vermeer@hut.fi>
+
+ * insetcharstyle.C (metrics, draw):
+ * insetert.C (metrics, draw):
+ * insetfootlike.[Ch] (metrics, draw): fix font inside inset
+ (bugs 1766, 1809)
+
2005-04-05 Martin Vermeer <martin.vermeer@hut.fi>
* insetexternal.C (validate):
{
LyXFont tmpfont = mi.base.font;
getDrawFont(mi.base.font);
+ mi.base.font.reduce(LyXFont(LyXFont::ALL_SANE));
+ mi.base.font.realize(tmpfont);
mi.base.textwidth -= 2 * TEXT_TO_INSET_OFFSET;
InsetText::metrics(mi, dim);
mi.base.font = tmpfont;
LyXFont tmpfont = pi.base.font;
getDrawFont(pi.base.font);
+ // I don't understand why the above .reduce and .realize aren't
+ //needed, or even wanted, here. It just works. -- MV 10.04.2005
InsetText::draw(pi, x, y);
pi.base.font = tmpfont;
{
LyXFont tmpfont = mi.base.font;
getDrawFont(mi.base.font);
+ mi.base.font.realize(tmpfont);
InsetCollapsable::metrics(mi, dim);
mi.base.font = tmpfont;
dim_ = dim;
{
LyXFont tmpfont = pi.base.font;
getDrawFont(pi.base.font);
+ // I don't understand why the above .realize isn't needed, or
+ // even wanted, here. It just works. -- MV 10.04.2005
InsetCollapsable::draw(pi, x, y);
pi.base.font = tmpfont;
}
}
+void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+ LyXFont tmpfont = mi.base.font;
+ mi.base.font = LyXFont(LyXFont::ALL_SANE);
+ InsetCollapsable::metrics(mi, dim);
+ mi.base.font = tmpfont;
+ dim_ = dim;
+}
+
+
+void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
+{
+ LyXFont tmpfont = pi.base.font;
+ pi.base.font = LyXFont(LyXFont::ALL_SANE);
+ InsetCollapsable::draw(pi, x, y);
+ pi.base.font = tmpfont;
+}
+
+
void InsetFootlike::write(Buffer const & buf, ostream & os) const
{
os << getInsetName() << "\n";
///
InsetFootlike(InsetFootlike const &);
///
+ void metrics(MetricsInfo &, Dimension &) const;
+ ///
+ void draw(PainterInfo & pi, int x, int y) const;
+ ///
void write(Buffer const & buf, std::ostream & os) const;
///
bool insetAllowed(InsetBase::Code) const;
double separator_;
double hfill_;
double label_hfill_;
+
+ // Hack to get 1.4cvs working
+ LyXFont font_;
};
LyXText const & text, pit_type pit, Row const & row, int x, int y)
: bv_(*pi.base.bv), pain_(pi.pain), text_(text), pars_(text.paragraphs()),
row_(row), pit_(pit), par_(text.paragraphs()[pit]),
- xo_(x), yo_(y), width_(text_.width())
+ xo_(x), yo_(y), width_(text_.width()), font_(pi.base.font)
{
RowMetrics m = text_.computeRowMetrics(pit, row_);
x_ = m.x + xo_;
/// "temporary"
LyXFont const RowPainter::getFont(pos_type pos) const
{
- return text_.getFont(par_, pos);
+ LyXFont lf(font_);
+ lf.reduce(LyXFont(LyXFont::ALL_SANE));
+ lf.realize(text_.getFont(par_, pos));
+ return lf;
}