Welcome to mirror list, hosted at ThFree Co, Russian Federation.

text_element.hpp « graphics - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2271dd9b52f033cf51ee27d04c950c6233fe019b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma once

#include "../base/string_utils.hpp"

#include "../base/matrix.hpp"

#include "../geometry/any_rect2d.hpp"

#include "../std/shared_ptr.hpp"

#include "font_desc.hpp"
#include "glyph_layout.hpp"
#include "overlay_element.hpp"

namespace graphics
{
  class ResourceManager;
  class Skin;
  class ResourceCache;
  class OverlayRenderer;

  class TextElement : public OverlayElement
  {
  protected:

    /// text-element specific
    FontDesc m_fontDesc;
    FontDesc m_auxFontDesc;

    strings::UniString m_logText; //< logical string
    strings::UniString m_auxLogText;

    strings::UniString m_visText; //< visual string, BIDI processed
    strings::UniString m_auxVisText;

    bool m_log2vis;

    mutable vector<m2::AnyRectD> m_boundRects;

    bool isBidi() const;
    bool isAuxBidi() const;

  public:

    struct Params : OverlayElement::Params
    {
      FontDesc m_fontDesc;
      strings::UniString m_logText;

      FontDesc m_auxFontDesc;
      strings::UniString m_auxLogText;

      bool m_log2vis;
      GlyphCache * m_glyphCache;
    };

    TextElement(Params const & p);

    void drawTextImpl(GlyphLayout const & layout,
                      OverlayRenderer * r,
                      math::Matrix<double, 3, 3> const & m,
                      bool doTransformPivotOnly,
                      bool doAlignPivot,
                      FontDesc const & desc,
                      double depth) const;
    strings::UniString const & logText() const;
    strings::UniString const & auxLogText() const;
    strings::UniString const & visText() const;
    strings::UniString const & auxVisText() const;
    FontDesc const & fontDesc() const;
    FontDesc const & auxFontDesc() const;
  };
}