Actual source code: dtextgs.c

petsc-3.5.2 2014-09-08
Report Typos and Errors
  2: /*
  3:        Provides the calling sequences for all the basic PetscDraw routines.
  4: */
  5: #include <petsc-private/drawimpl.h>  /*I "petscdraw.h" I*/

  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:   PetscBool      isnull;

 34:   PetscObjectTypeCompare((PetscObject)draw,PETSC_DRAW_NULL,&isnull);
 35:   if (isnull) return(0);
 36:   if (!draw->ops->stringgetsize) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_SUP,"This draw object %s does not support getting string size",((PetscObject)draw)->type_name);
 37:   (*draw->ops->stringgetsize)(draw,width,height);
 38:   return(0);
 39: }