// on space? Take the font before (only for RTL boundary stay)
if (pos > 0) {
+ TextMetrics const & tm = bv().textMetrics(&text);
if (pos == sl.lastpos()
- || (par.isSeparator(pos) &&
- !text.isRTLBoundary(buffer(), par, pos)))
+ || (par.isSeparator(pos)
+ && !tm.isRTLBoundary(sl.pit(), pos)))
--pos;
}
pos_type cpos = pos();
Paragraph & par = paragraph();
Text const & ctext = *text();
+ TextMetrics const & tm = bv().textMetrics(&ctext);
// are we behind previous char in fact? -> go to that char
if (cpos > 0 && boundary())
// abc| def -> font of c
// abc |[WERBEH], i.e. boundary==true -> font of c
// abc [WERBEH]| def, font of the space
- if (!ctext.isRTLBoundary(buffer(), par, cpos))
+ if (!tm.isRTLBoundary(pit(), cpos))
--cpos;
}
}
// get font
BufferParams const & bufparams = buffer().params();
current_font = par.getFontSettings(bufparams, cpos);
- real_current_font = ctext.getFont(buffer(), par, cpos);
+ real_current_font = tm.getDisplayFont(pit(), cpos);
// special case for paragraph end
if (pos() == lastpos()
- && ctext.isRTLBoundary(buffer(), par, pos())
+ && tm.isRTLBoundary(pit(), pos())
&& !boundary()) {
Language const * lang = par.getParLanguage(bufparams);
current_font.setLanguage(lang);