------------------------------------------------------------------------------
| 1275 | |
| 1276 | //------------------------------------------------------------------------------ |
| 1277 | void vtkPDFContextDevice2D::ComputeStringBounds(const vtkStdString& string, float bounds[4]) |
| 1278 | { |
| 1279 | vtkNew<vtkMatrix3x3> mat; |
| 1280 | this->GetMatrix(mat); |
| 1281 | TextHelper helper(this->Impl->Document, this->Impl->Page, this->TextProp, string, mat); |
| 1282 | if (!helper.Valid) |
| 1283 | { |
| 1284 | vtkErrorMacro("Error determining bounding box for string '" << string << "'."); |
| 1285 | std::fill(bounds, bounds + 4, 0.f); |
| 1286 | return; |
| 1287 | } |
| 1288 | |
| 1289 | bounds[0] = 0.f; |
| 1290 | bounds[1] = 0.f; |
| 1291 | bounds[2] = helper.BBoxWidth; |
| 1292 | bounds[3] = helper.BBoxHeight; |
| 1293 | } |
| 1294 | |
| 1295 | //------------------------------------------------------------------------------ |
| 1296 | void vtkPDFContextDevice2D::ComputeJustifiedStringBounds(const char* string, float bounds[4]) |