drawing multiline texts for non-bidi texts. closes #285

This commit is contained in:
rachytski 2011-09-19 23:37:18 +03:00 committed by Alex Zolotarev
parent 5113a86079
commit d20d470a2f
6 changed files with 14 additions and 3 deletions

View file

@ -264,6 +264,7 @@ void DrawerYG::drawText(m2::PointD const & pt, di::DrawInfo const * pInfo, rule_
pos,
pInfo->m_name,
depth,
true,
true);
}

View file

@ -99,7 +99,8 @@ namespace yg
yg::EPosition pos,
string const & utf8Text,
double depth,
bool log2vis)
bool log2vis,
bool doSplit)
{
if (!m_drawTexts)
return;
@ -112,6 +113,7 @@ namespace yg
params.m_position = pos;
params.m_glyphCache = glyphCache();
params.m_logText = strings::MakeUniString(utf8Text);
params.m_doSplit = doSplit;
shared_ptr<OverlayElement> oe(new StraightTextElement(params));

View file

@ -44,7 +44,8 @@ namespace yg
yg::EPosition pos,
string const & utf8Text,
double depth,
bool log2vis);
bool log2vis,
bool doSplit = false);
/// drawing text on the path
bool drawPathText(FontDesc const & fontDesc,

View file

@ -71,7 +71,7 @@ namespace yg
: TextElement(p)
{
buffer_vector<strings::UniString, 3> res;
if (p.m_doSplit)
if ((p.m_doSplit) && (!isBidi()))
{
res.clear();
visSplit(visText(), res);

View file

@ -39,6 +39,11 @@ namespace yg
return m_fontDesc;
}
bool TextElement::isBidi() const
{
return m_logText != m_visText;
}
void TextElement::drawTextImpl(GlyphLayout const & layout, gl::OverlayRenderer * screen, math::Matrix<double, 3, 3> const & m, FontDesc const & fontDesc, double depth) const
{
m2::PointD pv = layout.pivot() * m;

View file

@ -36,6 +36,8 @@ namespace yg
mutable vector<m2::AARectD> m_boundRects;
bool isBidi() const;
public:
struct Params : OverlayElement::Params