- int const wid = font_metrics::width('n', pi.base.font);
- int const asc = font_metrics::maxAscent(pi.base.font);
-
- // hack, and highly dubious
- lyx::pos_type pos = ownerPar(*pi.base.bv->buffer(), this)
- .getPositionOfInset(this);
- bool const ltr_pos = (pi.base.bv->text->bidi.level(pos) % 2 == 0);
+ frontend::FontMetrics const & fm = theFontMetrics(pi.base.font);
+ int const wid = fm.width('n');
+ int const asc = fm.maxAscent();