File Coverage

blib/lib/PDF/Builder/Resource/Font/BdFont.pm
Criterion Covered Total %
statement 15 226 6.6
branch 0 80 0.0
condition 0 57 0.0
subroutine 5 8 62.5
pod 1 3 33.3
total 21 374 5.6


line stmt bran cond sub pod time code
1             package PDF::Builder::Resource::Font::BdFont;
2              
3 1     1   909 use base 'PDF::Builder::Resource::Font';
  1         2  
  1         88  
4              
5 1     1   6 use strict;
  1         2  
  1         19  
6 1     1   4 use warnings;
  1         2  
  1         46  
7              
8             our $VERSION = '3.024'; # VERSION
9             our $LAST_UPDATE = '3.024'; # manually update whenever code is changed
10              
11 1     1   5 use PDF::Builder::Util;
  1         2  
  1         128  
12 1     1   7 use PDF::Builder::Basic::PDF::Utils;
  1         1  
  1         2790  
13              
14             our $BmpNum = 0;
15              
16             =head1 NAME
17              
18             PDF::Builder::Resource::Font::BdFont - Module for using bitmapped Fonts.
19              
20             =head1 SYNOPSIS
21              
22             #
23             use PDF::Builder;
24             #
25             $pdf = PDF::Builder->new();
26             $sft = $pdf->bdfont($file);
27             #
28              
29             This creates a bitmapped font from a .bdf (bitmap distribution font) file.
30             The default is to use square elements, and the style can be changed to use
31             filled dots (looking more like a dot-matrix printer). The font will be
32             embedded in the PDF file.
33              
34             Bitmapped fonts are quite rough, low resolution, and difficult to read, so
35             unless you're a sadist who wants to force readers back to the good old days of
36             dot-matrix printers and bitmapped X terminals, try to limit the use of such a
37             font to decorative or novelty effects, such as chapter titles and major
38             headings. Have mercy on your readers and use a real font (TrueType, etc.)
39             for body text!
40              
41             =head1 METHODS
42              
43             =over 4
44              
45             =cut
46              
47             =item $font = PDF::Builder::Resource::Font::BdFont->new($pdf, $font, %options)
48              
49             Returns a BmpFont object.
50              
51             =cut
52              
53             #I
54             #... changes the encoding of the font from its default.
55             #See I for the supported values.
56             #
57             #I ... changes the reference-name of the font from its default.
58             #The reference-name is normally generated automatically and can be
59             #retrieved via C<$pdfname=$font->name()>.
60              
61             =pod
62              
63             Valid %options are:
64              
65             =over
66              
67             =item I