------------------------------------------------------------------------------
| 270 | |
| 271 | //------------------------------------------------------------------------------ |
| 272 | bool 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 | //------------------------------------------------------------------------------ |
| 322 | void vtkMathTextFreeTypeTextRenderer::SetScaleToPowerOfTwoInternal(bool scale) |
nothing calls this directly
no test coverage detected