summaryrefslogtreecommitdiff
path: root/lib/GridFiller/Types.pm
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2010-12-22 15:46:54 +0000
committerdakkar <dakkar@thenautilus.net>2010-12-22 15:47:12 +0000
commitb4c7485154f73a1cf6b1fc78013f481c5f790c2d (patch)
treeff5a8bd684e9d439a6d7d06e025486956bc46a81 /lib/GridFiller/Types.pm
parentdifferent "colours" (diff)
downloadqr-builder-b4c7485154f73a1cf6b1fc78013f481c5f790c2d.tar.gz
qr-builder-b4c7485154f73a1cf6b1fc78013f481c5f790c2d.tar.bz2
qr-builder-b4c7485154f73a1cf6b1fc78013f481c5f790c2d.zip
font choice, and proper vertical rendering
NOTE: hinting:none and antialias:full is needed to get Japanese displayed correctly… bug?
Diffstat (limited to 'lib/GridFiller/Types.pm')
-rw-r--r--lib/GridFiller/Types.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/GridFiller/Types.pm b/lib/GridFiller/Types.pm
index 92834ba..90e094f 100644
--- a/lib/GridFiller/Types.pm
+++ b/lib/GridFiller/Types.pm
@@ -1,9 +1,13 @@
package GridFiller::Types;
+use strict;
+use warnings;
+use namespace::autoclean;
use MooseX::Types -declare =>
[qw(
GridT GridStatusT
CharT LetterCellT TextResultT
WordListT
+ FontDescrT FontOptT
)];
use MooseX::Types::Moose qw(Str ArrayRef Int);
use MooseX::Types::Structured qw(Tuple);
@@ -23,4 +27,15 @@ subtype WordListT, as ArrayRef[Str];
subtype TextResultT, as ArrayRef[ArrayRef[LetterCellT]];
+class_type FontDescrT, { class => 'Pango::FontDescription' };
+
+coerce FontDescrT,
+ from Str,
+ via {
+ require Pango;
+ Pango::FontDescription->from_string($_);
+ };
+
+class_type FontOptT, { class => 'Cairo::FontOptions' };
+
1;