- reading a multi-image GIF was leaking memory (a line buffer per file)
- maxcolors now must be at least 1 when creating a paletted image.
- converted t/t022double.t to use Test::More
+- t1 library re-initialization modified to support T1Lib 5.1.0
=================================================================
static void t1_push_error(void);
+static int t1_active_fonts = 0;
+static int t1_initialized = 0;
+
/*
=item i_init_t1(t1log)
i_init_t1(int t1log) {
int init_flags = IGNORE_CONFIGFILE|IGNORE_FONTDATABASE;
mm_log((1,"init_t1()\n"));
+
+ if (t1_active_fonts) {
+ mm_log((1, "Cannot re-initialize T1 - active fonts\n"));
+ return 1;
+ }
+
+ if (t1_initialized) {
+ T1_CloseLib();
+ }
if (t1log)
init_flags |= LOGFILE;
}
T1_SetLogLevel(T1LOG_DEBUG);
i_t1_set_aa(1); /* Default Antialias value */
+
+ ++t1_initialized;
+
return(0);
}
void
i_close_t1(void) {
T1_CloseLib();
+ t1_initialized = 0;
}
if (T1_SetAfmFileName(font_id,afm)<0) mm_log((1,"i_t1_new: afm loading of '%s' failed.\n",afm));
}
+ ++t1_active_fonts;
+
return font_id;
}
int
i_t1_destroy(int font_id) {
mm_log((1,"i_t1_destroy(font_id %d)\n",font_id));
+
+ --t1_active_fonts;
+
return T1_DeleteFont(font_id);
}
Imager::init(t1log=>1);
+This must be called before creating any fonts.
+
Currently specific to Imager::Font::Type1, you can use the following
flags when drawing text or calculating a bounding box:
i_t1_set_aa(1);
+ unlink "t1lib.log"; # lose it if it exists
+ init(t1log=>0);
+ ok(!-e("t1lib.log"), "disable t1log");
+ init(t1log=>1);
+ ok(-e("t1lib.log"), "enable t1log");
+ init(t1log=>0);
+ unlink "t1lib.log";
+
my $fnum=Imager::i_t1_new($fontname_pfb,$fontname_afm); # this will load the pfb font
unless (ok($fnum >= 0, "load font $fontname_pfb")) {
skip("without the font I can't do a thing", 48);
print "# debug: ",join(" x ",i_t1_bbox(0,50,"eses",4) ),"\n";
print "# debug: ",join(" x ",i_t1_bbox(0,50,"llll",4) ),"\n";
- unlink "t1lib.log"; # lose it if it exists
- init(t1log=>0);
- ok(!-e("t1lib.log"), "disable t1log");
- init(t1log=>1);
- ok(-e("t1lib.log"), "enable t1log");
- init(t1log=>0);
- unlink "t1lib.log";
-
# character existance tests - uses the special ExistenceTest font
my $exists_font = 'fontfiles/ExistenceTest.pfb';
my $exists_afm = 'fontfiles/ExistenceText.afm';