pike.git / src / modules / Image / font.c

version» Context lines:

pike.git/src/modules/Image/font.c:1: - /* $Id: font.c,v 1.20 1997/11/05 03:41:34 mirar Exp $ */ + /* $Id: font.c,v 1.21 1997/11/11 22:17:48 mirar Exp $ */   #include <config.h>      #define SPACE_CHAR 'i'      /*   **! module Image   **! note - **! $Id: font.c,v 1.20 1997/11/05 03:41:34 mirar Exp $ + **! $Id: font.c,v 1.21 1997/11/11 22:17:48 mirar Exp $   **! class font   **!   **! note   **! Short technical documentation on a font file:   **! This object adds the text-drawing and -creation   **! capabilities of the <ref>Image</ref> module.   **!   **! For simple usage, see   **! <ref>write</ref> and <ref>load</ref>.   **!
pike.git/src/modules/Image/font.c:196:    return (this->height*this->xspacing_scale)/18;    return this->charinfo[c].spacing*this->xspacing_scale;   }      static INLINE int char_width(struct font *this, unsigned char c)   {    if(c==0x20 || c==0x20+128) return 0;    return this->charinfo[c].width;   }    -  + #ifndef HAVE_MMAP   static INLINE int my_read(int from, char *buf, int towrite)   {    int res;    while((res = read(from, buf, towrite)) < 0)    {    switch(errno)    {    case EAGAIN: case EINTR:    continue;       default:    res = 0;    return 0;    }    }    return res;   } -  + #endif      static INLINE long file_size(int fd)   {    struct stat tmp;    int res;    if((!fstat(fd, &tmp)) &&    (tmp.st_mode & S_IFREG)) {    return res = tmp.st_size;    }    return -1;
pike.git/src/modules/Image/font.c:313:    new->mem = malloc(size);    if ((new->mem) && (!my_read(fd,new->mem,size))) {    free(new->mem);    new->mem = NULL;    }   #endif    THREADS_DISALLOW();       if (THIS->mem)    { -  int i; -  +     struct file_head    {    unsigned INT32 cookie;    unsigned INT32 version;    unsigned INT32 chars;    unsigned INT32 height;    unsigned INT32 baseline;    unsigned INT32 o[1];    } *fh;    struct char_head
pike.git/src/modules/Image/font.c:553:   **! that would be created by calling <ref>write</ref>   **! with the same arguments.   **! returns an array of width and height   **! arg string text, ...   **! One or more lines of text.   **! see also: write, height, baseline   */      void font_text_extents(INT32 args)   { -  INT32 xsize,i,c,maxwidth2,j; +  INT32 xsize,i,maxwidth2,j;       if (!THIS) error("font->text_extents: no font loaded\n");       maxwidth2=0;       for (j=0; j<args; j++)    {    if (sp[j-args].type!=T_STRING) error("font->text_extents: illegal argument(s)\n");    xsize = 0;    for (i = 0; i < sp[j-args].u.string->len; i++)