| 36 | { |
| 37 | |
| 38 | bool GetMetrics( |
| 39 | vtkRenderWindow* renwin, vtkTextProperty* tprop, const char* str, vtkTextRenderer::Metrics& m) |
| 40 | { |
| 41 | int dpi = renwin->GetDPI(); |
| 42 | vtkTextRenderer* tren = vtkTextRenderer::GetInstance(); |
| 43 | if (!tren) |
| 44 | { |
| 45 | return false; |
| 46 | } |
| 47 | vtkNew<vtkTextProperty> tpropTmp; |
| 48 | tpropTmp->ShallowCopy(tprop); |
| 49 | tpropTmp->SetOrientation(0.); |
| 50 | return tren->GetMetrics(tpropTmp, str, m, dpi); |
| 51 | } |
| 52 | |
| 53 | // replace \n with space as PS treats it as a space but PDF just removes them. |
| 54 | // we also need this so that we get the correct bounding box for PDFs |
no test coverage detected