Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Scene2D/CairoCompositor.cpp @ 1792:373d7f7e796e
ICompositor::ComputeTextBoundingBox()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 17 May 2021 16:59:03 +0200 |
parents | 9ac2a65d4172 |
children | 3889ae96d2e9 |
comparison
equal
deleted
inserted
replaced
1791:9b650ab68d4c | 1792:373d7f7e796e |
---|---|
188 { | 188 { |
189 assert(found->second != NULL); | 189 assert(found->second != NULL); |
190 return found->second->RenderText(utf8); | 190 return found->second->RenderText(utf8); |
191 } | 191 } |
192 } | 192 } |
193 | |
194 | |
195 #if ORTHANC_ENABLE_LOCALE == 1 | |
196 TextBoundingBox* CairoCompositor::ComputeTextBoundingBox(size_t fontIndex, | |
197 const std::string& utf8) | |
198 { | |
199 Fonts::const_iterator found = fonts_.find(fontIndex); | |
200 | |
201 if (found == fonts_.end()) | |
202 { | |
203 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange, | |
204 "No such font: " + boost::lexical_cast<std::string>(fontIndex)); | |
205 } | |
206 else | |
207 { | |
208 assert(found->second != NULL); | |
209 return new TextBoundingBox(found->second->GetAlphabet(), utf8); | |
210 } | |
211 } | |
212 #endif | |
193 } | 213 } |