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

version» Context lines:

pike.git/src/modules/Image/font.c:198:   {    free_font_struct(THIS);    THIS=NULL;   }      /***************** internals ***********************************/      static inline int char_space(struct font *this, INT32 c)   {    if(c==0x20) -  return DOUBLE_TO_INT((double)(this->height*this->xspacing_scale)/4.5); +  return (int)((double)(this->height*this->xspacing_scale)/4.5);    else if(c==0x20+128) -  return DOUBLE_TO_INT((this->height*this->xspacing_scale)/18); -  return DOUBLE_TO_INT(this->charinfo[c].spacing*this->xspacing_scale); +  return (int)((this->height*this->xspacing_scale)/18); +  return (int)(this->charinfo[c].spacing*this->xspacing_scale);   }      static inline int char_width(struct font *this, INT32 c)   {    if(c==0x20 || c==0x20+128) return 0;    return this->charinfo[c].width;   }      static inline ptrdiff_t my_read(int fd, void *t, size_t towrite)   {
pike.git/src/modules/Image/font.c:580:    break;    }    width_of[j]=max;    if (max>maxwidth2) maxwidth2=max;    }       o = clone_object(image_program,0);    img = ((struct image*)o->storage);    img->xsize = maxwidth2;    if(args>1) -  img->ysize = DOUBLE_TO_INT(this->height+ +  img->ysize = (int)(this->height+    ((double)this->height*(double)(args-1)*    (double)this->yspacing_scale)+1);    else    img->ysize = this->height;    img->rgb.r=img->rgb.g=img->rgb.b=255;    img->img=malloc(img->xsize*img->ysize*sizeof(rgb_group)+RGB_VEC_PAD);       if (!img->img) {    free_object(o);    SIMPLE_OUT_OF_MEMORY_ERROR("write",
pike.git/src/modules/Image/font.c:626:    * when we have Image.FreeType, I bluntly disable it instead.    * /mast */    for (i = 0; i < to_write_len; i++)    {    c=*(to_write0++);    if (c < (INT32)this->chars)    {    if(char_width(this,c))    write_char(this->charinfo+c,    (img->img+xsize)+ -  (img->xsize*DOUBLE_TO_INT(j*this->height* +  (img->xsize*(int)(j*this->height*    this->yspacing_scale)),    img->xsize,    this->height);    xsize += char_space(this, c);    }    }    /* THREADS_DISALLOW(); */    break;    case 1:    to_write1 = STR1(sp[j-args].u.string);    /* THREADS_ALLOW(); */    for (i = 0; i < to_write_len; i++)    {    c=*(to_write1++);    if (c < (INT32)this->chars)    {    if(char_width(this,c))    write_char(this->charinfo+c,    (img->img+xsize)+ -  (img->xsize*DOUBLE_TO_INT(j*this->height* +  (img->xsize*(int)(j*this->height*    this->yspacing_scale)),    img->xsize,    this->height);    xsize += char_space(this, c);    }    }    /* THREADS_DISALLOW(); */    break;    case 2:    to_write2 = STR2(sp[j-args].u.string);    /* THREADS_ALLOW(); */    for (i = 0; i < to_write_len; i++)    {    c=*(to_write2++);    if (c < (INT32)this->chars)    {    if(char_width(this,c))    write_char(this->charinfo+c,    (img->img+xsize)+ -  (img->xsize*DOUBLE_TO_INT(j*this->height* +  (img->xsize*(int)(j*this->height*    this->yspacing_scale)),    img->xsize,    this->height);    xsize += char_space(this, c);    }    }    /* THREADS_DISALLOW(); */    break;    }    }