Borland C++ reference

setusercharsize

raw OCR

Varies character width and height for stroked fonts.

Defined in header <graphics.h>

Syntax

#include <graphics.h>
void far setusercharsize(int  multx, int divx, int multy, int divy);

Portability

DOSUNIXWindowsANSI CC++ only
■

Remarks

setusercharsize gives you finer control over the size of text from stroked fonts used with graphics functions. The values set by setuserctiarsize are active only if charsize equals 0, as set by a previous call to settextstyle.

With setusercharsize, you specify factors by which the width and height are scaled. The default width is scaled by multx : divx, and the default height is scaled by multy : divy. For example, to make text twice as wide and 50% taller than the default, set

multx2; divx = 1;
multy3; divy = 2;

Return value

None.

See also

Example

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
   /* request autodetection */
   int gdriver = DETECT, gmode, errorcode;

   /* initialize graphics and local variables */
   initgraph(&gdriver, &gmode, "");

   /* read result of initialization */
   errorcode = graphresult();
   if (errorcode != grOk) {  /* an error occurred  */
      printf("Graphics error: %s\n", grapherrormsg(errorcode)
      printf("Press any key to halt:");
      getchO ;
      exit(l);               /* terminate with an error code  */.
/* select a text style */
settextstyle(TRIPLEX_FONT, HORIZ_DIR,  4);
/* move to the text starting position  */
moveto(0, getmaxyO  12);

I* output some normal text */
outtext ("Norm ");
/* make the text 1/3 the normal width  */
setusercharsize(l, 3, 1, 1);
outtext ("Short ");
/* make the text 3 times normal width  */
setusercharsize (3, 1, 1, 1);
outtext ("Wide");

/* clean up */
getchO ;
closegraphO ;
return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.