[C] 为矢量字体改变字符宽度和高度 →→→→→进入此内容的聊天室

来自 , 2020-04-25, 写在 C, 查看 127 次.
URL http://www.code666.cn/view/619205da
  1. #include <graphics.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <conio.h>
  5.  
  6. int main(void)
  7. {
  8.    /* request autodetection */
  9.    int gdriver = DETECT, gmode, errorcode;
  10.  
  11.    /* initialize graphics and local variables */
  12.    initgraph(&gdriver, &gmode, "");
  13.  
  14.    /* read result of initialization */
  15.    errorcode = graphresult();
  16.    if (errorcode != grOk)      /* an error occurred */
  17.    {
  18.       printf("Graphics error: %s\n", grapherrormsg(errorcode));
  19.       printf("Press any key to halt:");
  20.       getch();
  21.       exit(1);                 /* terminate with an error code */
  22.    }
  23.  
  24.    /* select a text style */
  25.    settextstyle(TRIPLEX_FONT, HORIZ_DIR, 4);
  26.  
  27.    /* move to the text starting position */
  28.    moveto(0, getmaxy() / 2);
  29.  
  30.    /* output some normal text */
  31.    outtext("Norm ");
  32.  
  33.    /* make the text 1/3 the normal width */
  34.    setusercharsize(1, 3, 1, 1);
  35.    outtext("Short ");
  36.  
  37.    /* make the text 3 times normal width */
  38.    setusercharsize(3, 1, 1, 1);
  39.    outtext("Wide");
  40.  
  41.    /* clean up */
  42.    getch();
  43.    closegraph();
  44.    return 0;
  45. }

回复 "为矢量字体改变字符宽度和高度"

这儿你可以回复上面这条便签

captcha