comparison OrthancStone/Sources/Scene2D/OpenGLCompositor.cpp @ 1792:373d7f7e796e

ICompositor::ComputeTextBoundingBox()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 17 May 2021 16:59:03 +0200
parents 9ac2a65d4172
children c5e6379b9cd0
comparison
equal deleted inserted replaced
1791:9b650ab68d4c 1792:373d7f7e796e
251 unsigned int canvasHeight) 251 unsigned int canvasHeight)
252 { 252 {
253 canvasWidth_ = canvasWidth; 253 canvasWidth_ = canvasWidth;
254 canvasHeight_ = canvasHeight; 254 canvasHeight_ = canvasHeight;
255 } 255 }
256
257
258 #if ORTHANC_ENABLE_LOCALE == 1
259 TextBoundingBox* OpenGLCompositor::ComputeTextBoundingBox(size_t fontIndex,
260 const std::string& utf8)
261 {
262 Fonts::const_iterator found = fonts_.find(fontIndex);
263
264 if (found == fonts_.end())
265 {
266 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange,
267 "No such font: " + boost::lexical_cast<std::string>(fontIndex));
268 }
269 else
270 {
271 assert(found->second != NULL);
272 return new TextBoundingBox(found->second->GetAlphabet().GetAlphabet(), utf8);
273 }
274 }
275 #endif
256 } 276 }