pos_type pos = bidi_.vis2log(vpos);
pos_type start_pos = pos;
// first character
- char_type c = par_.getChar(pos);
docstring str;
str.reserve(100);
-
- // special case for arabic
- string const & lang = font.language()->lang();
- bool const swap_paren = lang == "arabic_arabtex"
- || lang == "arabic_arabi"
- || lang == "farsi";
-
- // FIXME: Why only round brackets and why the difference to
- // Hebrew? See also Paragraph::getUChar
- if (swap_paren) {
- if (c == '(')
- c = ')';
- else if (c == ')')
- c = '(';
- }
+ char_type const c = par_.getChar(pos);
str.push_back(c);
- pos_type const end = row_.endpos();
FontSpan const font_span = par_.fontSpan(pos);
// Track-change status.
Change const & change_running = par_.lookupChange(pos);
-
// spelling correct?
bool const spell_state =
lyxrc.spellcheck_continuously && par_.isMisspelled(pos);
// collect as much similar chars as we can
+ pos_type const end = row_.endpos();
for (++vpos ; vpos < end ; ++vpos) {
pos = bidi_.vis2log(vpos);
// Track change type or author has changed.
break;
- char_type c = par_.getChar(pos);
+ char_type const c = par_.getChar(pos);
if (c == '\t')
break;
- // When row_.separator == 0, it is possible to print a
- // string longer than a word in one fell swoop.
- // Therefore there is no need to break at spaces.
- if (!isPrintableNonspace(c)
- && (c != ' ' || row_.separator > 0))
+ if (!isPrintableNonspace(c))
break;
- // FIXME: Why only round brackets and why the difference to
- // Hebrew? See also Paragraph::getUChar
- if (swap_paren) {
- if (c == '(')
- c = ')';
- else if (c == ')')
- c = '(';
- }
-
str.push_back(c);
}
void RowPainter::paintText()
{
+ //LYXERR0("-------------------------------------------------------");
pos_type const end = row_.endpos();
// Spaces at logical line breaks in bidi text must be skipped during
// painting. However, they may appear visually in the middle
}
// Use font span to speed things up, see above
- if (vpos < font_span.first || vpos > font_span.last) {
- font_span = par_.fontSpan(vpos);
- font = text_metrics_.displayFont(pit_, vpos);
+ if (!font_span.inside(pos)) {
+ font_span = par_.fontSpan(pos);
+ font = text_metrics_.displayFont(pit_, pos);
// split font span if inline completion is inside
- if (font_span.first <= inlineCompletionVPos
- && font_span.last > inlineCompletionVPos)
- font_span.last = inlineCompletionVPos;
+ if (inlineCompletionVPos != -1
+ && font_span.inside(inlineCompletionPos.pos()))
+ font_span.last = inlineCompletionPos.pos();
}
+ // Note that this value will only be used in
+ // situations where no ligature of composition of
+ // characters is needed. (see comments in uses of width_pos).
const int width_pos = pm_.singleWidth(pos, font);
- if (x_ + width_pos < 0) {
- x_ += width_pos;
- ++vpos;
- continue;
- }
Change const & change = par_.lookupChange(pos);
if (change.changed() && !change_running.changed()) {
change_running = change;
int const lwidth = theFontMetrics(labelFont())
.width(layout.labelsep);
+ // width_pos is either the width of a space or an inset
x_ += row_.label_hfill + lwidth - width_pos;
}
if (par_.isSeparator(pos)) {
Font const orig_font = text_metrics_.displayFont(pit_, pos);
double const orig_x = x_;
+ // width_pos is the width of a space
double separator_width = width_pos;
if (pos >= body_pos)
separator_width += row_.separator;