MCPcopy Create free account
hub / github.com/Kitware/VTK / StringToPathInternal

Method StringToPathInternal

Rendering/FreeType/vtkMathTextFreeTypeTextRenderer.cxx:272–319  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

270
271//------------------------------------------------------------------------------
272bool vtkMathTextFreeTypeTextRenderer::StringToPathInternal(
273 vtkTextProperty* tprop, const vtkStdString& str, vtkPath* path, int dpi, int backend)
274{
275 if (!path || !tprop)
276 {
277 vtkErrorMacro("No path container and/or text property supplied!");
278 return false;
279 }
280
281 if (static_cast<Backend>(backend) == Default)
282 {
283 backend = this->DefaultBackend;
284 }
285
286 if (static_cast<Backend>(backend) == Detect)
287 {
288 backend = this->DetectBackend(str);
289 }
290
291 switch (static_cast<Backend>(backend))
292 {
293 case MathText:
294 if (this->MathTextIsSupported())
295 {
296 if (this->MathTextUtilities->StringToPath(str.c_str(), path, tprop, dpi))
297 {
298 return true;
299 }
300 }
301 vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
302 [[fallthrough]];
303 case FreeType:
304 {
305 vtkStdString cleanString(str);
306 this->CleanUpFreeTypeEscapes(cleanString);
307 return this->FreeTypeTools->StringToPath(tprop, str, dpi, path);
308 }
309 case Default:
310 case UserBackend:
311 default:
312 vtkDebugMacro("Unrecognized backend requested: " << backend);
313 break;
314 case Detect:
315 vtkDebugMacro("Unhandled 'Detect' backend requested!");
316 break;
317 }
318 return false;
319}
320
321//------------------------------------------------------------------------------
322void vtkMathTextFreeTypeTextRenderer::SetScaleToPowerOfTwoInternal(bool scale)

Callers

nothing calls this directly

Calls 5

MathTextIsSupportedMethod · 0.95
DetectBackendMethod · 0.80
StringToPathMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected