Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

glut_swidth.c

Go to the documentation of this file.
00001 
00002 /* Copyright (c) Mark J. Kilgard, 1995. */
00003 
00004 /* This program is freely distributable without licensing fees 
00005    and is provided without guarantee or warrantee expressed or 
00006    implied. This program is -not- in the public domain. */
00007 
00008 #include <GL/glut.h>
00009 #include "glutint.h"
00010 #include "glutstroke.h"
00011 
00012 int
00013 glutStrokeWidth(GLUTstrokeFont font, int c)
00014 {
00015   StrokeFontPtr fontinfo = (StrokeFontPtr) font;
00016   StrokeCharPtr ch;
00017 
00018   if (c < 0 || c >= fontinfo->num_chars)
00019     return 0;
00020   ch = &(fontinfo->ch[c]);
00021   if (ch)
00022     return ch->right;
00023   else
00024     return 0;
00025 }
00026 
00027 int
00028 glutStrokeLength(GLUTstrokeFont font, unsigned char *string)
00029 {
00030   int c, length;
00031   StrokeFontPtr fontinfo = (StrokeFontPtr) font;
00032   StrokeCharPtr ch;
00033 
00034   length = 0;
00035   for (; *string != '\0'; string++) {
00036     c = *string;
00037     if (c < 0 || c >= fontinfo->num_chars) {
00038       ch = &(fontinfo->ch[c]);
00039       if (ch)
00040         length += ch->right;
00041     }
00042   }
00043   return length;
00044 }
00045 
 

Powered by Plone

This site conforms to the following standards: