Bugzilla – Attachment 30217 Details for
Bug 12194
Some fonts don't work on printing label
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12194 - add more tests for pdf creation
Bug-12194---add-more-tests-for-pdf-creation.patch (text/plain), 2.21 KB, created by
Dobrica Pavlinusic
on 2014-07-28 15:40:25 UTC
(
hide
)
Description:
Bug 12194 - add more tests for pdf creation
Filename:
MIME Type:
Creator:
Dobrica Pavlinusic
Created:
2014-07-28 15:40:25 UTC
Size:
2.21 KB
patch
obsolete
>From ee929b3c22ca085edb05a114d32b45cb17358680 Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Mon, 28 Jul 2014 17:38:00 +0200 >Subject: [PATCH] Bug 12194 - add more tests for pdf creation > >When run with KEEP_PDF enviroment variable it will keep >test.pdf for manual inspection. This can be used to verify >that ttf font configuration is complete like: > >KEEP_PDF=1 KOHA_CONF=/etc/koha/sites/srvgit/koha-conf.xml prove t/Creators.t > >sample of utf-8 text, font name and type will be on bottom of second page >--- > t/Creators.t | 25 +++++++++++++++++++++---- > 1 files changed, 21 insertions(+), 4 deletions(-) > >diff --git a/t/Creators.t b/t/Creators.t >index 646aef5..2b41146 100755 >--- a/t/Creators.t >+++ b/t/Creators.t >@@ -1,12 +1,19 @@ > #!/usr/bin/perl > # >-# This Koha test module is a stub! >-# Add more tests here!!! >+# This module will excercise pdf creation routines >+# >+# When run with KEEP_PDF enviroment variable it will keep >+# test.pdf for manual inspection. This can be used to verify >+# that ttf font configuration is complete like: >+# >+# KEEP_PDF=1 KOHA_CONF=/etc/koha/sites/srvgit/koha-conf.xml prove t/Creators.t >+# >+# sample of utf-8 text, font name and type will be on bottom of second page > > use strict; > use warnings; > >-use Test::More tests => 16; >+use Test::More tests => 41; > > BEGIN { > use_ok('C4::Creators'); >@@ -50,6 +57,16 @@ is($pdf_creator->StrWidth("test", "H", 12), $expected_width, "testing StrWidth() > is($result[0], '10', "testing Text() writes from a given x-value"); > is($result[1], $expected_offset, "testing Text() writes to the correct x-value"); > >+my $font_types = C4::Creators::Lib::get_font_types(); >+isa_ok( $font_types, 'ARRAY', 'get_font_types' ); >+ >+my $y = 50; >+foreach my $font ( @$font_types ) { >+ ok( $pdf_creator->Font( $font->{type} ), 'Font ' . $font->{type} ); >+ ok( $pdf_creator->Text(10, $y, "\x{10C}evap\x{10D}i\x{107} " . $font->{name} . ' - ' . $font->{type} ), 'Text ' . $font->{name}); >+ $y += $pdf_creator->FontSize() * 1.2; >+} >+ > open(my $fh, '>', 'test.pdf'); > select $fh; > >@@ -58,4 +75,4 @@ ok($pdf_creator->End(), "testing End() works"); > close($fh); > ok( -s 'test.pdf', 'test.pdf created' ); > >-unlink 'test.pdf'; >+unlink 'test.pdf' unless $ENV{KEEP_PDF}; >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12194
:
30217
|
40702
|
43697
|
43698
|
43699
|
43700
|
43737
|
43738
|
43739
|
43740
|
43778
|
43801