Lines 260-265
sub draw_text {
Link Here
|
260 |
# my $string_width = ($font_units_width * $text_attribs->{'font_size'}) / $units_per_em; |
260 |
# my $string_width = ($font_units_width * $text_attribs->{'font_size'}) / $units_per_em; |
261 |
my $string_width = C4::Creators::PDF->StrWidth($line, $text_attribs->{'font'}, $text_attribs->{'font_size'}); |
261 |
my $string_width = C4::Creators::PDF->StrWidth($line, $text_attribs->{'font'}, $text_attribs->{'font_size'}); |
262 |
if (($string_width + $text_attribs->{'llx'}) > $self->{'width'}) { |
262 |
if (($string_width + $text_attribs->{'llx'}) > $self->{'width'}) { |
|
|
263 |
my $cur_line = ""; |
263 |
WRAP_LINES: |
264 |
WRAP_LINES: |
264 |
while (1) { |
265 |
while (1) { |
265 |
# $line =~ m/^.*(\s\b.*\b\s*|\s&|\<\b.*\b\>)$/; # original regexp... can be removed after dev stage is over |
266 |
# $line =~ m/^.*(\s\b.*\b\s*|\s&|\<\b.*\b\>)$/; # original regexp... can be removed after dev stage is over |
Lines 287-292
sub draw_text {
Link Here
|
287 |
push @lines, {line=> $line, Tx => $Tx, Ty => $Ty, Tw => $Tw}; |
288 |
push @lines, {line=> $line, Tx => $Tx, Ty => $Ty, Tw => $Tw}; |
288 |
last WRAP_LINES; |
289 |
last WRAP_LINES; |
289 |
} |
290 |
} |
|
|
291 |
} else { |
292 |
# We only split lines on spaces - it seems if we push a line too far, it can end |
293 |
# never getting short enough in which case we need to escape and the malformed PDF |
294 |
# will indicate the layout problem |
295 |
last WRAP_LINES if $cur_line eq $line; |
296 |
$cur_line = $line; |
290 |
} |
297 |
} |
291 |
} |
298 |
} |
292 |
} |
299 |
} |
293 |
- |
|
|