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

version» Context lines:

pike.git/src/modules/Image/font.c:304:    unsigned INT32 height;    unsigned INT32 baseline;    unsigned INT32 o[1];    } *fh = NULL;   #ifdef HAVE_MMAP    size_t mmaped_size = 0;   #endif    size_t size = 0;    char *filename = NULL;    -  get_all_args("Image.Font->load()", args, ".%s", &filename); +  get_all_args("load", args, ".%s", &filename);       if (!filename)    {    fh = (struct file_head *)image_default_font;    size = IMAGE_DEFAULT_FONT_SIZE;    } else {    int fd = -1;       do    {
pike.git/src/modules/Image/font.c:532:       maxwidth2=1;       width_of=xalloc((args+1)*sizeof(int));    SET_ONERROR(err, free, width_of);       for (j=0; j<args; j++)    {    int max;    if (TYPEOF(sp[j-args]) != T_STRING) -  bad_arg_error("font->write",sp-args,args,0,"",sp-args, -  "Bad arguments to font->write()\n"); +  SIMPLE_BAD_ARG_ERROR("write",1,"string");       xsize = max = 1;    to_write_len = sp[j-args].u.string->len;    switch(sp[j-args].u.string->size_shift)    {    case 0:    to_write0 = STR0(sp[j-args].u.string);    for (i = 0; i < to_write_len; i++)    {    if (to_write0[i] < (INT32)this->chars)
pike.git/src/modules/Image/font.c:605:    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",    img->xsize*img->ysize*sizeof(rgb_group)+1);    }    -  MEMSET(img->img,0,img->xsize*img->ysize*sizeof(rgb_group)); +  memset(img->img,0,img->xsize*img->ysize*sizeof(rgb_group));       for (j=0; j<args; j++)    {    to_write_len = sp[j-args].u.string->len;    switch(this->justification)    {    case J_LEFT: xsize = 0; break;    case J_RIGHT: xsize = img->xsize-width_of[j]-1; break;    case J_CENTER: xsize = img->xsize/2-width_of[j]/2-1; break;    }
pike.git/src/modules/Image/font.c:754:    }       for (j=0; j<args; j++)    {    int max;    p_wchar0 *to_write0;    p_wchar1 *to_write1;    p_wchar2 *to_write2;    ptrdiff_t to_write_len;    if (TYPEOF(sp[j-args]) != T_STRING) -  bad_arg_error("font->text_extents",sp-args,args,0,"",sp-args, -  "Bad arguments to font->text_extents()\n"); +  SIMPLE_BAD_ARG_ERROR("text_extents",1,"string");       xsize = max = 1;    to_write_len = sp[j-args].u.string->len;    switch(sp[j-args].u.string->size_shift)    {    case 0:    to_write0 = STR0(sp[j-args].u.string);    for (i = 0; i < to_write_len; i++)    {    if (xsize+char_width(THIS,to_write0[i]) > max)