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