for ( i = 0; i < n; i++ ) {
TT_Get_CharMap_ID( handle->face, i, &platform, &encoding );
if ( (platform == 3 && encoding == 1 ) || (platform == 0 && encoding == 0 ) ) {
+ mm_log((2,"i_tt_new - found char map platform %u encoding %u\n", platform, encoding));
TT_Get_CharMap( handle->face, i, &(handle->char_map) );
break;
}
}
+ if (!USTRCT(handle->char_map) && n != 0) {
+ /* just use the first one */
+ TT_Get_CharMap( handle->face, 0, &(handle->char_map));
+ }
/* Zero the pointsizes - and ordering */
*/
x=-cords[0]; /* FIXME: If you font is antialiased this should be expanded by one to allow for aa expansion and the allocation too - do before passing here */
- y=-cords[1];
+ y=-cords[4];
for ( i = 0; i < len; i++ ) {
j = txt[i];
i_tt_bbox_inst( handle, inst, txt, len, cords );
width = cords[2]-cords[0];
- height = cords[3]-cords[1];
+ height = cords[5]-cords[4];
mm_log((1,"i_tt_rasterize: width=%d, height=%d\n",width, height ));
if (! i_tt_rasterize( handle, &bit, cords, points, txt, len, smooth ) ) return 0;
- ascent=cords[3];
+ ascent=cords[5];
st_offset=cords[0];
i_tt_dump_raster_map_channel( im, &bit, xb-st_offset , yb-ascent, channel, smooth );
if (! i_tt_rasterize( handle, &bit, cords, points, txt, len, smooth ) ) return 0;
- ascent=cords[3];
+ ascent=cords[5];
st_offset=cords[0];
i_tt_dump_raster_map2( im, &bit, xb+st_offset, yb-ascent, cl, smooth );
$loaded = 1;
print "ok 1\n";
-init_log("testout/t35ttfont.log",1);
+init_log("testout/t35ttfont.log",2);
sub skip {
print "ok 2 # skip\n";
# i_tt_set_aa(2);
-i_tt_text($ttraw,$backgr,100,100,$bgcolor,50.0,'test',4,1);
+i_tt_text($ttraw,$backgr,100,120,$bgcolor,50.0,'test',4,1);
my $ugly = Imager::i_tt_new("./fontfiles/ImUgly.ttf");
-i_tt_text($ugly, $backgr,100, 50, $bgcolor, 14, 'g%g', 3, 1);
-i_tt_text($ugly, $backgr,150, 50, $bgcolor, 14, 'delta', 5, 1);
-i_tt_text($ttraw, $backgr, 20, 10, $bgcolor, 14, 'abcdefghijklmnopqrstuvwxyz{|}', 29, 1);
-i_tt_text($ttraw, $backgr, 20, 30, $bgcolor, 14, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 26, 1);
+i_tt_text($ugly, $backgr,100, 80, $bgcolor, 14, 'g%g', 3, 1);
+i_tt_text($ugly, $backgr,150, 80, $bgcolor, 14, 'delta', 5, 1);
+i_draw($backgr,0,20,499,20,i_color_new(0,127,0,0));
+i_tt_text($ttraw, $backgr, 20, 20, $bgcolor, 14, 'abcdefghijklmnopqrstuvwxyz{|}', 29, 1);
+i_tt_text($ttraw, $backgr, 20, 50, $bgcolor, 14, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 26, 1);
open(FH,">testout/t35ttfont2.ppm") || die "cannot open testout/t35ttfont.ppm\n";