annotate OrthancStone/Sources/Fonts/GlyphAlphabet.cpp @ 1628:555870323ebc

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 07 Nov 2020 00:08:45 +0100
parents 8563ea5d8ae4
children 9ac2a65d4172
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
1270
2d8ab34c8c91 upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 947
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * 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
8 * modify it under the terms of the GNU Lesser General Public License
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * 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
14 * 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
15 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
16 *
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
17 * 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
18 * 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
19 * <http://www.gnu.org/licenses/>.
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
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 #include "GlyphAlphabet.h"
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1298
diff changeset
25 #include <OrthancException.h>
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1298
diff changeset
26 #include <Toolbox.h>
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 namespace OrthancStone
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 void GlyphAlphabet::Clear()
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 for (Content::const_iterator it = content_.begin(); it != content_.end(); ++it)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 assert(it->second != NULL);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 delete it->second;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 content_.clear();
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 lineHeight_ = 0;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 }
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 void GlyphAlphabet::Register(uint32_t unicode,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 const Glyph& glyph,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 Orthanc::IDynamicObject* payload)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 {
1298
8a0a62189f46 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
47 std::unique_ptr<Orthanc::IDynamicObject> protection(payload);
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 // Don't add twice the same character
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 if (content_.find(unicode) == content_.end())
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 {
1298
8a0a62189f46 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
52 std::unique_ptr<Glyph> raii(new Glyph(glyph));
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 if (payload != NULL)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 raii->SetPayload(protection.release());
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 content_[unicode] = raii.release();
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 lineHeight_ = std::max(lineHeight_, glyph.GetLineHeight());
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 }
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 void GlyphAlphabet::Register(FontRenderer& renderer,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 uint32_t unicode)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 {
1298
8a0a62189f46 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
69 std::unique_ptr<Glyph> glyph(renderer.Render(unicode));
576
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 if (glyph.get() != NULL)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 Register(unicode, *glyph, glyph->ReleasePayload());
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 }
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 #if ORTHANC_ENABLE_LOCALE == 1
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 bool GlyphAlphabet::GetUnicodeFromCodepage(uint32_t& unicode,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 unsigned int index,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 Orthanc::Encoding encoding)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 if (index > 255)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 std::string character;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 character.resize(1);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 character[0] = static_cast<unsigned char>(index);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 std::string utf8 = Orthanc::Toolbox::ConvertToUtf8(character, encoding, false /* no code extensions */);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 if (utf8.empty())
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 // This character is not available in this codepage
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 return false;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 else
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 size_t length;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 Orthanc::Toolbox::Utf8ToUnicodeCharacter(unicode, length, utf8, 0);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 assert(length != 0);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 return true;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 #endif
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 void GlyphAlphabet::Apply(IGlyphVisitor& visitor) const
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 for (Content::const_iterator it = content_.begin(); it != content_.end(); ++it)
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 assert(it->second != NULL);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 visitor.Visit(it->first, *it->second);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 }
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 void GlyphAlphabet::Apply(ITextVisitor& visitor,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 const std::string& utf8) const
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 size_t pos = 0;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 int x = 0;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 int y = 0;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 while (pos < utf8.size())
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 if (utf8[pos] == '\r')
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 // Ignore carriage return
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 pos++;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 else if (utf8[pos] == '\n')
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 // This is a newline character
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 x = 0;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 y += static_cast<int>(lineHeight_);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 pos++;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 else
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 uint32_t unicode;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 size_t length;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 Orthanc::Toolbox::Utf8ToUnicodeCharacter(unicode, length, utf8, pos);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 Content::const_iterator glyph = content_.find(unicode);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 if (glyph != content_.end())
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 {
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 assert(glyph->second != NULL);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 const Orthanc::IDynamicObject* payload =
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 (glyph->second->HasPayload() ? &glyph->second->GetPayload() : NULL);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 visitor.Visit(unicode,
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 x + glyph->second->GetOffsetLeft(),
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 y + glyph->second->GetOffsetTop(),
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 glyph->second->GetWidth(),
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 glyph->second->GetHeight(),
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 payload);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 x += glyph->second->GetAdvanceX();
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 }
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 assert(length != 0);
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 pos += length;
529c9617654b FontRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 }
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 }