Actual source code: dtextgs.c
1: #define PETSC_DLL
2: /*
3: Provides the calling sequences for all the basic PetscDraw routines.
4: */
5: #include src/sys/draw/drawimpl.h
9: /*@
10: PetscDrawStringGetSize - Gets the size for character text. The width is
11: relative to the user coordinates of the window.
13: Not Collective
15: Input Parameters:
16: + draw - the drawing context
17: . width - the width in user coordinates
18: - height - the character height
20: Level: advanced
22: Concepts: string^drawing size
24: .seealso: PetscDrawString(), PetscDrawStringVertical(), PetscDrawStringSetSize()
26: @*/
27: PetscErrorCode PetscDrawStringGetSize(PetscDraw draw,PetscReal *width,PetscReal *height)
28: {
30: PetscTruth isnull;
34: PetscTypeCompare((PetscObject)draw,PETSC_DRAW_NULL,&isnull);
35: if (isnull) return(0);
36: if (!draw->ops->stringgetsize) SETERRQ1(PETSC_ERR_SUP,"This draw object %s does not support getting string size",draw->type_name);
37: (*draw->ops->stringgetsize)(draw,width,height);
38: return(0);
39: }