aboutsummaryrefslogtreecommitdiff
path: root/Perl
diff options
context:
space:
mode:
Diffstat (limited to 'Perl')
-rw-r--r--Perl/t/text.t33
1 files changed, 31 insertions, 2 deletions
diff --git a/Perl/t/text.t b/Perl/t/text.t
index 99798a5..642c0df 100644
--- a/Perl/t/text.t
+++ b/Perl/t/text.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
#
-# $Id: text.t,v 1.3 2003-11-28 09:40:47 mertz Exp $
+# $Id: text.t,v 1.4 2003-12-11 16:44:31 mertz Exp $
# Author: Christophe Mertz
#
@@ -45,7 +45,7 @@ BEGIN {
use strict;
-my $zinc = $mw->Zinc(-render => 0,
+my $zinc = $mw->Zinc(-render => 1,
-width => 400, -height => 1200)->pack;
like ($zinc, qr/^Tk::Zinc=HASH/ , "zinc has been created");
@@ -69,12 +69,38 @@ if ( grep /^verdana$/i , @families) {
$family = "arial";
}
+
+my $topLevel = $mw->Toplevel();
+$topLevel->title("testing all ascii glyphs of $family");
+
+my $zinc0 = $topLevel->Zinc(-render => 1,
+ -width => 300,
+ -height => 400,)->pack;
+like ($zinc, qr/^Tk::Zinc=HASH/ , "zinc0 has been created");
+
+$zinc0->fontCreate("fonta", -family => $family, -size => -20, -weight => 'normal');
+
+
+foreach my $row (2..15) {
+ my $string = "";
+ foreach my $col (0..15) {
+ $string .= chr($row*16+$col);
+ }
+ $zinc0->add('text', 1, -position => [10,$row*20-40],
+ -text => $string, -font => 'fonta');
+ $zinc0->update;
+}
+
+
### creating text items with many different fonts:
my $size = 8;
my $y = 10 ;
$zinc->fontCreate("font$size", -family => $family, -size => -$size, -weight => 'normal');
+
+
+### creating text items with many different fonts:
$zinc->add('text', $g1, -position => [10,$y], -tags => ["txt$size"], -font => "font$size",
-text => "$size pixels $family");
$zinc->remove('txt8');
@@ -84,6 +110,9 @@ $zinc->add('text', $g1, -position => [10,$y], -tags => ["txt$size"], -font => "
-text => "$size pixels $family");
+
+
+
foreach my $size (9..60) {
$zinc->fontCreate("font$size", -family => $family, -size => -$size, -weight => 'normal');
$zinc->add('text', $g1, -position => [10,$y], -tags => ["txt$size"], -font => "font$size",