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