annotate OrthancStone/Sources/Fonts/GlyphAlphabet.cpp @ 1909:782ba9eb6f22

improved variable names
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 01 Feb 2022 08:56:36 +0100
parents 7053b8a0aaec
children 07964689cb0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1871
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
9 * modify it under the terms of the GNU Lesser General Public License
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
16 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
17 *
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
19 * License along with this program. If not, see
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
20 * <http://www.gnu.org/licenses/>.
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "GlyphAlphabet.h"
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1298
diff changeset
26 #include <OrthancException.h>
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1298
diff changeset
27 #include <Toolbox.h>
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 namespace OrthancStone
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 void GlyphAlphabet::Clear()
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 for (Content::const_iterator it = content_.begin(); it != content_.end(); ++it)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 assert(it->second != NULL);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 delete it->second;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 content_.clear();
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 lineHeight_ = 0;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 void GlyphAlphabet::Register(uint32_t unicode,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 const Glyph& glyph,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 Orthanc::IDynamicObject* payload)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 {
1298
8a0a62189f46 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
48 std::unique_ptr<Orthanc::IDynamicObject> protection(payload);
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 // Don't add twice the same character
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 if (content_.find(unicode) == content_.end())
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 {
1298
8a0a62189f46 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
53 std::unique_ptr<Glyph> raii(new Glyph(glyph));
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 if (payload != NULL)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 raii->SetPayload(protection.release());
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 content_[unicode] = raii.release();
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 lineHeight_ = std::max(lineHeight_, glyph.GetLineHeight());
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 void GlyphAlphabet::Register(FontRenderer& renderer,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 uint32_t unicode)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 {
1298
8a0a62189f46 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
70 std::unique_ptr<Glyph> glyph(renderer.Render(unicode));
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 if (glyph.get() != NULL)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 Register(unicode, *glyph, glyph->ReleasePayload());
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 #if ORTHANC_ENABLE_LOCALE == 1
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 bool GlyphAlphabet::GetUnicodeFromCodepage(uint32_t& unicode,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 unsigned int index,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 Orthanc::Encoding encoding)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 if (index > 255)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 std::string character;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 character.resize(1);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 character[0] = static_cast<unsigned char>(index);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 std::string utf8 = Orthanc::Toolbox::ConvertToUtf8(character, encoding, false /* no code extensions */);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 if (utf8.empty())
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 // This character is not available in this codepage
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 return false;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 else
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 size_t length;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 Orthanc::Toolbox::Utf8ToUnicodeCharacter(unicode, length, utf8, 0);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 assert(length != 0);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 return true;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 #endif
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 void GlyphAlphabet::Apply(IGlyphVisitor& visitor) const
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 for (Content::const_iterator it = content_.begin(); it != content_.end(); ++it)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 assert(it->second != NULL);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 visitor.Visit(it->first, *it->second);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 void GlyphAlphabet::Apply(ITextVisitor& visitor,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 const std::string& utf8) const
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 size_t pos = 0;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 int x = 0;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 int y = 0;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 while (pos < utf8.size())
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 if (utf8[pos] == '\r')
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 // Ignore carriage return
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 pos++;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 else if (utf8[pos] == '\n')
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 // This is a newline character
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 x = 0;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 y += static_cast<int>(lineHeight_);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 pos++;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 else
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 uint32_t unicode;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 size_t length;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 Orthanc::Toolbox::Utf8ToUnicodeCharacter(unicode, length, utf8, pos);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 Content::const_iterator glyph = content_.find(unicode);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 if (glyph != content_.end())
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 assert(glyph->second != NULL);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 const Orthanc::IDynamicObject* payload =
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 (glyph->second->HasPayload() ? &glyph->second->GetPayload() : NULL);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 visitor.Visit(unicode,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 x + glyph->second->GetOffsetLeft(),
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 y + glyph->second->GetOffsetTop(),
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 glyph->second->GetWidth(),
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 glyph->second->GetHeight(),
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 payload);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 x += glyph->second->GetAdvanceX();
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 assert(length != 0);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 pos += length;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 }