cic1988
2nd September 2014, 09:27
Hello,
i found the QTextLine::setLineWidth() gave me different results between normal english letter and german letter
e.g.
QString string = str;
QString result;
QTextLayout layout(str, font);
QTextOption opt = layout.textOption();
opt.setWrapMode(QTextOption::WrapAtWordBoundaryOrA nywhere);
layout.setTextOption(opt);
layout.beginLayout();
QTextLine line = layout.createLine();
line.setLineWidth(width);
line.textLength(); // <---- *
}
layout.endLayout();
i use my application font to get the line width with string length * font width.
let's assume that i set the line width with 5 characters width.
with english letter the result from * gave me 5, but with german letter gave me 2.
what's the problem?
i found the QTextLine::setLineWidth() gave me different results between normal english letter and german letter
e.g.
QString string = str;
QString result;
QTextLayout layout(str, font);
QTextOption opt = layout.textOption();
opt.setWrapMode(QTextOption::WrapAtWordBoundaryOrA nywhere);
layout.setTextOption(opt);
layout.beginLayout();
QTextLine line = layout.createLine();
line.setLineWidth(width);
line.textLength(); // <---- *
}
layout.endLayout();
i use my application font to get the line width with string length * font width.
let's assume that i set the line width with 5 characters width.
with english letter the result from * gave me 5, but with german letter gave me 2.
what's the problem?