+sub DrawPatronCardText {
+
+ my ( $x_pos, $y_pos, $label_height, $label_width, $fontname, $fontsize, $left_text_margin,
+ $text_wrap_cols, $text, $printingtype )
+ = @_;
+
+ my $top_text_margin = 25; #FIXME: This should be a template parameter and passed in...
+
+ my $vPos = ( $y_pos + ( $label_height - $top_text_margin ) );
+ my $font = prFont($fontname);
+
+ my $hPos;
+
+ foreach my $line (keys %$text) {
+ warn "Current text is \"$line\" and font size for \"$line\" is $text->{$line} points";
+ # some code to try and center each line on the label based on font size and string point width...
+ my $stringwidth = prStrWidth($line, $fontname, $text->{$line});
+ my $whitespace = ( $label_width - ( $stringwidth + (2 * $left_text_margin) ) );
+ $hPos = ( ( $whitespace / 2 ) + $x_pos + $left_text_margin );
+
+ PrintText( $hPos, $vPos, $font, $text->{$line}, $line );
+ my $line_spacer = ( $text->{$line} * 1 ); # number of pixels between text rows (This is actually leading: baseline to baseline minus font size. Recommended starting point is 20% (0.20) of font size.).
+ $vPos = $vPos - ($line_spacer + $text->{$line}); # Linefeed equiv: leading + font size
+ }
+}
+
+# Not used anywhere.