pike.git / src / modules / _Image_TTF / image_ttf.c

version» Context lines:

pike.git/src/modules/_Image_TTF/image_ttf.c:652:    my_tt_error("Image.TTF.FaceInstance()",    "TT_Set_Instance_Resolutions: ",res);       if ((res=TT_Get_Instance_Metrics(face_i->instance,&metr)))    my_tt_error(where,"TT_Get_Instance_Metrics",res);       if ((res=TT_Set_Instance_CharSize(face_i->instance,towhat)))    my_tt_error(where,"TT_Set_Instance_CharSize: ",res);       face_i->baseline= -  DOUBLE_TO_INT(((double)(towhat/64.0+towhat/640.0)* +  (int)(((double)(towhat/64.0+towhat/640.0)*    prop.horizontal->Ascender)/    (prop.horizontal->Ascender - prop.horizontal->Descender));       face_i->height= (towhat/64 + towhat/640);       face_i->trans = ~63 &    (32 + -  DOUBLE_TO_INT(64*((towhat/64.0+towhat/640.0)* +  (int)(64*((towhat/64.0+towhat/640.0)*    prop.horizontal->Ascender)/    (prop.horizontal->Ascender-prop.horizontal->Descender)));   }      static void image_ttf_faceinstance_create(INT32 args)   {    struct image_ttf_face_struct *face_s = NULL;    struct image_ttf_faceinstance_struct *face_i=THISi;    int res;   
pike.git/src/modules/_Image_TTF/image_ttf.c:699:    struct image_ttf_face_struct *face_s;    struct image_ttf_faceinstance_struct *face_i=THISi;    int h=0;       if (!args)    Pike_error("Image.TTF.FaceInstance->set_height(): missing arguments\n");       if (TYPEOF(sp[-args]) == T_INT)    h = sp[-args].u.integer*64;    else if (TYPEOF(sp[-args]) == T_FLOAT) -  h = DOUBLE_TO_INT(sp[-args].u.float_number*64); +  h = (int)(sp[-args].u.float_number*64);    else    Pike_error("Image.TTF.FaceInstance->set_height(): illegal argument 1\n");    if (h<1) h=1;       if (!(face_s=get_storage(THISi->faceobj,image_ttf_face_program)))    Pike_error("Image.TTF.FaceInstance->write(): lost Face\n");       ttf_instance_setc(face_s,face_i,h,"Image.TTF.FaceInstance->set_height()");       pop_n_elems(args);
pike.git/src/modules/_Image_TTF/image_ttf.c:1074:       if((metrics.bbox.xMax-(metrics.bbox.xMin<0?metrics.bbox.xMin:0))    >maxcharwidth)    maxcharwidth =    (metrics.bbox.xMax-(metrics.bbox.xMin<0?metrics.bbox.xMin:0));       pos+=metrics.advance;    if(has_kerning && i<slen[a]-1)    {    int kern = find_kerning( kerning, ind, sstr[a][i+1] ); -  pos += DOUBLE_TO_INT(kern * (scalefactor/65535.0)); +  pos += (int)(kern * (scalefactor/65535.0));    }    if ((res=TT_Done_Glyph(glyph)))    { errs="TT_Done_Glyph: "; break; }    }    pos -= metrics.advance;    pos += metrics.bbox.xMax-metrics.bbox.xMin;    if (pos>xmax)    xmax=pos;    if (errs)    {
pike.git/src/modules/_Image_TTF/image_ttf.c:1186:    else    dt->r=dt->g=dt->b=255;    }       pos+=metrics.advance;   /* if(metrics.bbox.xMin < 0) */   /* pos += metrics.bbox.xMin; */    if(has_kerning && i<slen[a]-1)    {    int kern = find_kerning( kerning, sstr[a][i], sstr[a][i+1] ); -  pos += DOUBLE_TO_INT(kern * (scalefactor/65535.0)); +  pos += (int)(kern * (scalefactor/65535.0));   /* fprintf(stderr, "Adjusted is %d\n", */   /* (int)(kern * (scalefactor/65535.0))); */    }       if ((res=TT_Done_Glyph(glyph)))    { errs="TT_Done_Glyph: "; break; }    }    if (errs)    {    for (a=0; a<args; a++) free(sstr[a]);