aboutsummaryrefslogtreecommitdiff
path: root/Perl/t
diff options
context:
space:
mode:
authormertz2003-12-11 16:44:31 +0000
committermertz2003-12-11 16:44:31 +0000
commit13a2db222501b86b24e1599ff9f2f8e84050c69a (patch)
treed1941169dbcb0fadca95b2dfe65064c65a6840aa /Perl/t
parenta4a85d2dff89341de79b0ed236268510245b2771 (diff)
downloadtkzinc-13a2db222501b86b24e1599ff9f2f8e84050c69a.zip
tkzinc-13a2db222501b86b24e1599ff9f2f8e84050c69a.tar.gz
tkzinc-13a2db222501b86b24e1599ff9f2f8e84050c69a.tar.bz2
tkzinc-13a2db222501b86b24e1599ff9f2f8e84050c69a.tar.xz
- adding the display of all glyphs in the extended ascii range
Diffstat (limited to 'Perl/t')
-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",