home *** CD-ROM | disk | FTP | other *** search
/ gondwana.ecr.mu.oz.au/pub/ / Graphics.tar / Graphics / VOGLE.ZIP / VOGLE / SRC / SUNFORT / FTEXT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  2.2 KB  |  249 lines

  1. #include <stdio.h>
  2. #include "vogle.h"
  3.  
  4. /*
  5.  * font_
  6.  */
  7. void
  8. font_(fontfile, len)
  9.     char    *fontfile;
  10.     int    len;
  11. {
  12.     char        buf[BUFSIZ];
  13.     register char    *p;
  14.  
  15.     strncpy(buf, fontfile, len);
  16.     buf[len] = 0;
  17.  
  18.     for (p = &buf[len - 1]; *p == ' '; p--)
  19.         ;
  20.  
  21.     *++p = 0;
  22.  
  23.     font(buf);
  24. }
  25.  
  26. /*
  27.  * textsize_
  28.  */
  29. void
  30. textsize_(width, height)
  31.     float    *width, *height;
  32. {
  33.     textsize(*width, *height);
  34. }
  35.  
  36. /*
  37.  * boxtext_
  38.  */
  39. void
  40. boxtext_(x, y, l, h, s, len)
  41.     float    *x, *y, *l, *h;
  42.     char    *s;
  43.     int    len;
  44. {
  45.     char        buf[BUFSIZ];
  46.     register char   *p;
  47.  
  48.     strncpy(buf, s, len);
  49.     buf[len] = 0;
  50.  
  51.     for (p = &buf[len - 1]; *p == ' '; p--)
  52.         ;
  53.  
  54.     *++p = 0;
  55.  
  56.     boxtext(*x, *y, *l, *h, buf);
  57. }
  58.  
  59. /*
  60.  * boxfit_
  61.  */
  62. void
  63. boxfit_(l, h, nchars)
  64.     float    *l, *h;
  65.     int    *nchars;
  66. {
  67.     boxfit(*l, *h, *nchars);
  68. }
  69.  
  70. /*
  71.  * textang_
  72.  */
  73. void
  74. textang_(ang)
  75.     float    *ang;
  76. {
  77.     textang(*ang);
  78. }
  79.  
  80. /*
  81.  * drawchar_
  82.  */
  83. void
  84. drawchar_(s)
  85.     char    *s;
  86. {
  87.     drawchar(*s);
  88. }
  89.  
  90. /*
  91.  * drawstr_
  92.  */
  93. void
  94. drawstr_(s, len)
  95.     char    *s;
  96.     int    len;
  97. {
  98.         char            buf[BUFSIZ];
  99.     register char   *p;
  100.  
  101.     strncpy(buf, s, len);
  102.     buf[len] = 0;
  103.  
  104.     for (p = &buf[len - 1]; *p == ' '; p--)
  105.         ;
  106.  
  107.     *++p = 0;
  108.  
  109.     drawstr(buf);
  110. }
  111.  
  112. /*
  113.  * getfontsize_
  114.  */
  115. void
  116. getfontsize_(cw, ch)
  117.     float     *cw, *ch;
  118. {
  119.     getfontsize(cw, ch);
  120. }
  121.  
  122. /*
  123.  * getcharsize_
  124.  */
  125. void
  126. getcharsize_(c, cw, ch)
  127.     char    *c;
  128.     float     *cw, *ch;
  129. {
  130.     getcharsize(*c, cw, ch);
  131. }
  132.  
  133. /*
  134.  * fixedwidth
  135.  */
  136. void
  137. fixedwidth_(i)
  138.     int    *i;
  139. {
  140.     fixedwidth(*i);
  141. }
  142.  
  143. /*
  144.  * centertext
  145.  */
  146. void
  147. centertext_(i)
  148.     int    *i;
  149. {
  150.     int    j;
  151.     j = (*i ? 1 : 0);
  152.     centertext(j);
  153. }
  154.  
  155. /*
  156.  * textjustify
  157.  */
  158. void
  159. textjustify_(i)
  160.     int *i;
  161. {
  162.     textjustify((unsigned)*i);
  163. }
  164.  
  165. /*
  166.  * leftjustify
  167.  */
  168. void
  169. leftjustify_()
  170. {
  171.     leftjustify();
  172. }
  173.  
  174. /*
  175.  * rightjustify
  176.  */
  177. void
  178. rightjustify_()
  179. {
  180.     rightjustify();
  181. }
  182.  
  183. /*
  184.  * topjustify
  185.  */
  186. void
  187. topjustify_()
  188. {
  189.     topjustify();
  190. }
  191.  
  192. /*
  193.  * bottomjustify
  194.  */
  195. void
  196. bottomjustify_()
  197. {
  198.     bottomjustify();
  199. }
  200.  
  201. /*
  202.  * xcentertext
  203.  */
  204. void
  205. xcentertext_()
  206. {
  207.     xcentertext();
  208. }
  209.  
  210. /*
  211.  * ycentertext
  212.  */
  213. void
  214. ycentertext_()
  215. {
  216.     ycentertext();
  217. }
  218.  
  219. /*
  220.  * numchars_
  221.  */
  222. int
  223. numchars_()
  224. {
  225.     return(numchars());
  226. }
  227.  
  228. /*
  229.  * strlength_
  230.  */
  231. float
  232. strlength_(str, len)
  233.     char    *str;
  234.     int    len;
  235. {
  236.         char            buf[BUFSIZ];
  237.     register char   *p;
  238.  
  239.     strncpy(buf, str, len);
  240.     buf[len] = 0;
  241.  
  242.     for (p = &buf[len - 1]; *p == ' '; p--)
  243.         ;
  244.  
  245.     *++p = 0;
  246.  
  247.     return(strlength(buf));
  248. }
  249.