.TH "PkFont" 3 "Mon Jan 12 2015" "Version dvi2bitmap1.0" "dvi2bitmap" \" -*- nroff -*- .ad l .nh .SH NAME PkFont \- .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBPkFont\fP (double fontmag, unsigned int \fBc\fP, unsigned int \fBs\fP, unsigned int \fBd\fP, string \fBname\fP)" .br .RI "\fIRepresents a PK font\&. \fP" .ti -1c .RI "\fB~PkFont\fP ()" .br .ti -1c .RI "\fBPkGlyph\fP * \fBglyph\fP (unsigned int i) const " .br .RI "\fIReturns the glyph at a given position in this font\&. \fP" .ti -1c .RI "string \fBfontgenCommand\fP () const " .br .RI "\fIReturns a command which can be used to generate fonts\&. \fP" .ti -1c .RI "string \fBname\fP () const " .br .RI "\fIIdentifies the current font\&. \fP" .ti -1c .RI "string \fBfontFilename\fP () const " .br .RI "\fILocates the current font's bitmap file\&. \fP" .ti -1c .RI "double \fBmagnification\fP (bool includeDviMag=true) const " .br .RI "\fIObtain the magnification of this font\&. \fP" .ti -1c .RI "int \fBdpiScaled\fP () const " .br .RI "\fIObtains the resolution of the current font, taking magnification into account\&. \fP" .ti -1c .RI "double \fBscale\fP () const " .br .RI "\fIObtains the font's scale\&. \fP" .ti -1c .RI "bool \fBseenInDoc\fP (void) const " .br .RI "\fIHas the current font been declared in the document so far, or just in the DVI file postamble\&. \fP" .ti -1c .RI "void \fBsetSeenInDoc\fP (void)" .br .ti -1c .RI "double \fBwordSpace\fP () const " .br .RI "\fIObtains the size of the \fCword_space\fP parameter for this font\&. \fP" .ti -1c .RI "double \fBbackSpace\fP () const " .br .RI "\fIObtains the size of the \fCback_space\fP parameter for this font\&. \fP" .ti -1c .RI "double \fBquad\fP () const " .br .RI "\fIObtains the size of the \fCquad\fP parameter for this font\&. \fP" .ti -1c .RI "double \fBdesignSize\fP () const " .br .RI "\fIObtains the design size of this font, as obtained from the PK file preamble\&. \fP" .ti -1c .RI "double \fBhppp\fP () const " .br .RI "\fIObtains the number of horizontal pixels per point for this font, as obtained from the PK file preamble\&. \fP" .ti -1c .RI "double \fBvppp\fP () const " .br .RI "\fIObtains the number of vertical pixels per point for this font, as obtained from the PK file preamble\&. \fP" .ti -1c .RI "unsigned int \fBchecksum\fP () const " .br .RI "\fIObtains the font checksum, as obtained from the PK file preamble\&. \fP" .ti -1c .RI "bool \fBloaded\fP () const " .br .RI "\fICheck if the font has actually been loaded\&. \fP" .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBverbosities\fP \fBverbosity\fP (const \fBverbosities\fP level)" .br .ti -1c .RI "static void \fBsetFontSearchPath\fP (string fp)" .br .RI "\fISet the list of directories in which to look for fonts\&. \fP" .ti -1c .RI "static void \fBsetFontSearchPath\fP (char *fp)" .br .RI "\fISet the list of directories in which to look for fonts\&. \fP" .ti -1c .RI "static void \fBsetFontSearchPath\fP (bool yesno)" .br .RI "\fIEnable or disable using the font-path when searching for fonts\&. \fP" .ti -1c .RI "static void \fBsetFontSearchCommand\fP (string cmd)" .br .RI "\fISet the shell command which is used when searching for fonts\&. \fP" .ti -1c .RI "static void \fBsetFontSearchCommand\fP (char *cmd)" .br .RI "\fISets the shell command which is used when searching for fonts\&. \fP" .ti -1c .RI "static void \fBsetFontSearchCommand\fP (bool yesno)" .br .RI "\fIEnable or disable using a font-search command when searching for fonts\&. \fP" .ti -1c .RI "static void \fBsetFontSearchKpse\fP (bool yesno)" .br .RI "\fIEnable or disable using the \fCkpathsea\fP library when searching for fonts\&. \fP" .ti -1c .RI "static void \fBsetResolution\fP (int res)" .br .RI "\fISets the base font resolution\&. \fP" .ti -1c .RI "static void \fBsetMissingFontMode\fP (string mode)" .br .RI "\fISets the Metafont mode to be used when generating fonts\&. \fP" .ti -1c .RI "static void \fBsetFontgen\fP (bool doit)" .br .RI "\fIEnables or disables font generation\&. \fP" .ti -1c .RI "static void \fBsetFontgenCommand\fP (string command_template)" .br .RI "\fISet the shell command which is used when generating fonts\&. \fP" .ti -1c .RI "static int \fBdpiBase\fP ()" .br .RI "\fIObtains the base font resolution, in dots-per-inch\&. \fP" .ti -1c .RI "static string & \fBsubstitute_font_string\fP (const string fmt, const string mode, const string fontname, const int dpi, const int basedpi, const double \fBmagnification\fP) throw (PkError)" .br .RI "\fIGiven a format string, return a reference to a string with format specifiers replaced by font information\&. \fP" .in -1c .SH "Constructor & Destructor Documentation" .PP .SS "PkFont::PkFont (doubledvimag, unsigned intc, unsigned ints, unsigned intd, stringname)" .PP Represents a PK font\&. The constructor arguments are those read from the DVI file font declaration, after a \fCfnt_def\fP opcode, except for \fCdvimag\fP, which is the overall DVI magnification factor, and includes the file and command-line magnification adjustments\&. For more details, see the definition of the font declaration in section `A\&.4 Font defintions' of the DVI standard, and the use of these factors in method \fBmagnification\fP\&. .PP \fBParameters:\fP .RS 4 \fIdvimag\fP the scale factor (1\&.0 = no magnification) by which the font is to be magnified as it is read from the PK file .br \fIc\fP the font checksum expected .br \fIs\fP fixed-point scale factor applied to the character widths in the font .br \fId\fP the fixed-point `design size' of the font .br \fIname\fP the name of the font .RE .PP .PP References c, d, dpiScaled(), fontgenCommand(), PipeStream::getResult(), PipeStream::getTerminationStatus(), magnification(), normal, DviError::problem(), quiet, and s\&. .SS "PkFont::~PkFont ()" .SH "Member Function Documentation" .PP .SS "double PkFont::backSpace () const\fC [inline]\fP" .PP Obtains the size of the \fCback_space\fP parameter for this font\&. This does \fInot\fP include any overall DVI magnification\&. .PP \fBReturns:\fP .RS 4 \fCback_space\fP in DVI units .RE .PP .SS "unsigned int PkFont::checksum () const\fC [inline]\fP" .PP Obtains the font checksum, as obtained from the PK file preamble\&. .PP \fBReturns:\fP .RS 4 checksum .RE .PP .SS "double PkFont::designSize () const\fC [inline]\fP" .PP Obtains the design size of this font, as obtained from the PK file preamble\&. .PP \fBReturns:\fP .RS 4 the design size in points .RE .PP .SS "static int PkFont::dpiBase ()\fC [inline]\fP, \fC [static]\fP" .PP Obtains the base font resolution, in dots-per-inch\&. This is the base resolution corresponding to the Metafont mode set by \fBsetMissingFontMode\fP, and the two must be consistent if font-generation is to work\&. .PP \fBReturns:\fP .RS 4 the font resolution, in dots-per-inch .RE .PP \fBSee Also:\fP .RS 4 \fBsetResolution\fP .RE .PP .PP Referenced by fontgenCommand(), KarlPathSearcher::getInstance(), and main()\&. .SS "int PkFont::dpiScaled () const\fC [inline]\fP" .PP Obtains the resolution of the current font, taking magnification into account\&. .PP \fBReturns:\fP .RS 4 the font's resolution, in dots-per-inch .RE .PP .PP References magnification()\&. .PP Referenced by fontgenCommand(), main(), and PkFont()\&. .SS "string PkFont::fontFilename () const\fC [inline]\fP" .PP Locates the current font's bitmap file\&. .PP \fBReturns:\fP .RS 4 theh path to the PK file which defines this font .RE .PP .PP Referenced by main()\&. .SS "string PkFont::fontgenCommand (void) const" .PP Returns a command which can be used to generate fonts\&. The command should return a single line containing the path to the generated font file\&. Return an empty string on errors, or if such a command is not supported on a particular platform\&. .PP Note that if a font-generation command template is defined but automatic font generation is disabled, this still returns a font-generation command\&. .PP \fBReturns:\fP .RS 4 a font generation command, suitable for passing to a shell .RE .PP .PP References dpiBase(), dpiScaled(), magnification(), normal, DviError::problem(), quiet, substitute_font_string(), and Util::verbosity_\&. .PP Referenced by main(), and PkFont()\&. .SS "\fBPkGlyph\fP* PkFont::glyph (unsigned inti) const\fC [inline]\fP" .PP Returns the glyph at a given position in this font\&. If the font has not been loaded, it returns a dummy glyph\&. .PP \fBReturns:\fP .RS 4 the numbered glyph from the font .RE .PP .PP Referenced by main()\&. .SS "double PkFont::hppp () const\fC [inline]\fP" .PP Obtains the number of horizontal pixels per point for this font, as obtained from the PK file preamble\&. .PP \fBReturns:\fP .RS 4 the hppp parameter in points .RE .PP .SS "bool PkFont::loaded () const\fC [inline]\fP" .PP Check if the font has actually been loaded\&. This is false if the font was declared in the DVI file, but its bitmaps were not or cound not be loaded from disk for some reason\&. .PP \fBReturns:\fP .RS 4 true if the font was successfully read from disk .RE .PP .PP Referenced by main()\&. .SS "double PkFont::magnification (boolincludeDviMag = \fCtrue\fP) const" .PP Obtain the magnification of this font\&. This includes both font scaling and overall DVI file magnification: this number is \fImag/1000 \&. s/d\fP, where \fIs\fP and \fId\fP are taken from the font definition in the DVI file, and \fImag\fP is the total magnification taking into account DVI preamble magnification and any command-line overriding\&. .PP \fBParameters:\fP .RS 4 \fIincludeDviMag\fP if true (the default), include the overall DVI file magnification \fCmag\fP (as set in the constructor); if false, do not .RE .PP \fBReturns:\fP .RS 4 the font magnification .RE .PP .PP References normal, and Util::verbosity_\&. .PP Referenced by dpiScaled(), fontgenCommand(), main(), and PkFont()\&. .SS "string PkFont::name () const\fC [inline]\fP" .PP Identifies the current font\&. .PP \fBReturns:\fP .RS 4 the font's name .RE .PP .PP Referenced by DviFileFontChange::debug(), and main()\&. .SS "double PkFont::quad () const\fC [inline]\fP" .PP Obtains the size of the \fCquad\fP parameter for this font\&. This does \fInot\fP include any overall DVI magnification\&. .PP \fBReturns:\fP .RS 4 \fCquad\fP in DVI units .RE .PP .SS "double PkFont::scale () const\fC [inline]\fP" .PP Obtains the font's scale\&. This is the factor \fIs/d\fP, where \fIs\fP and \fId\fP are the font scale and font design size as specified when the font was declared in the DVI file\&. Together, they specify that the font is to be used at \fImagnification/1000 \&. s/d\fP times its design size\&. This is distinct from the return value of \fBmagnification\fP, which takes DVI file magnification into account, and which is therefore more useful in general\&. .PP \fBReturns:\fP .RS 4 the font scale, s/d .RE .PP .SS "bool PkFont::seenInDoc (void) const\fC [inline]\fP" .PP Has the current font been declared in the document so far, or just in the DVI file postamble\&. .PP \fBReturns:\fP .RS 4 true if we have seen a fnt_def declaration for this font, in the DVI file body .RE .PP .SS "void PkFont::setFontgen (booldoit)\fC [static]\fP" .PP Enables or disables font generation\&. Font generation will only be enabled if there is a font-generation template command, either set through method \fCsetFontgenCommand\fP, or as a compiled-in default\&. If there is no such command, this method will have no effect\&. .PP \fBParameters:\fP .RS 4 \fIdoit\fP if true, font generation is enabled .RE .PP .PP Referenced by main()\&. .SS "void PkFont::setFontgenCommand (stringcmd)\fC [static]\fP" .PP Set the shell command which is used when generating fonts\&. The specified string should be a template string with the formatting characters managed by \fBsubstitute_font_string\fP, and these will be substituted with the required values before the command is run\&. .PP This also enables font-generation, so that it has the effect of \fCsetFontgen(true)\fP\&. .PP \fBParameters:\fP .RS 4 \fIcmd\fP a font-generation template .RE .PP .PP Referenced by main()\&. .SS "void PkFont::setFontSearchCommand (stringcmd)\fC [static]\fP" .PP Set the shell command which is used when searching for fonts\&. The specified string should be a template string with the formatting characters managed by \fBsubstitute_font_string\fP, and these will be substituted with the required values before the command is run\&. .PP \fBParameters:\fP .RS 4 \fIcmd\fP the shell command template .RE .PP .PP Referenced by main(), and setFontSearchCommand()\&. .SS "void PkFont::setFontSearchCommand (char *cmd)\fC [static]\fP" .PP Sets the shell command which is used when searching for fonts\&. The specified string should be a template string with the formatting characters managed by \fBsubstitute_font_string\fP, and these will be substituted with the required values before the command is run\&. .PP \fBParameters:\fP .RS 4 \fIcmd\fP the shell command template .RE .PP .PP References s, and setFontSearchCommand()\&. .SS "void PkFont::setFontSearchCommand (booluseCommand)\fC [static]\fP" .PP Enable or disable using a font-search command when searching for fonts\&. .PP \fBParameters:\fP .RS 4 \fIuseCommand\fP if true, use the command .RE .PP \fBSee Also:\fP .RS 4 \fBsetFontSearchCommand(string)\fP .RE .PP .SS "void PkFont::setFontSearchKpse (booluseKpse)\fC [static]\fP" .PP Enable or disable using the \fCkpathsea\fP library when searching for fonts\&. .PP \fBParameters:\fP .RS 4 \fIuseKpse\fP if true, use the library .RE .PP .PP Referenced by main()\&. .SS "void PkFont::setFontSearchPath (stringfp)\fC [static]\fP" .PP Set the list of directories in which to look for fonts\&. .PP \fBParameters:\fP .RS 4 \fIfp\fP the colon-separated font path .RE .PP .PP Referenced by main(), and setFontSearchPath()\&. .SS "void PkFont::setFontSearchPath (char *fp)\fC [static]\fP" .PP Set the list of directories in which to look for fonts\&. .PP \fBParameters:\fP .RS 4 \fIfp\fP the colon-separated font path .RE .PP .PP References s, and setFontSearchPath()\&. .SS "void PkFont::setFontSearchPath (boolusePath)\fC [static]\fP" .PP Enable or disable using the font-path when searching for fonts\&. .PP \fBParameters:\fP .RS 4 \fIusePath\fP if true, use the font path .RE .PP \fBSee Also:\fP .RS 4 \fBsetFontSearchPath(string)\fP .RE .PP .SS "static void PkFont::setMissingFontMode (stringmode)\fC [inline]\fP, \fC [static]\fP" .PP Sets the Metafont mode to be used when generating fonts\&. This must be consistent with any base font resolution set in \fBsetResolution\fP\&. .PP \fBParameters:\fP .RS 4 \fImode\fP a Metafont mode .RE .PP .PP Referenced by main()\&. .SS "static void PkFont::setResolution (intres)\fC [inline]\fP, \fC [static]\fP" .PP Sets the base font resolution\&. This must be consistent with the the Metafont mode set by \fBsetMissingFontMode\fP, if font-generation is to work\&. .PP \fBParameters:\fP .RS 4 \fIres\fP the new font resolution .RE .PP \fBSee Also:\fP .RS 4 \fBdpiBase\fP .RE .PP .PP Referenced by DviFile::DviFile(), and main()\&. .SS "void PkFont::setSeenInDoc (void)\fC [inline]\fP" .SS "string & PkFont::substitute_font_string (const stringfmt, const stringmode, const stringfontname, const intdpi, const intbasedpi, const doublemagnification)\fBPkError\fP\fC [static]\fP" .PP Given a format string, return a reference to a string with format specifiers replaced by font information\&. The format specifiers are: Mmodeibmvga ffont namecmr10 ddpi330 bbase dpi110 mmagnification3 %%literal %-character Any other format specifiers constitute an error\&. There is no support for any backslash escapes\&. .PP \fBParameters:\fP .RS 4 \fIfmt\fP the format string, with the format specifiers described above .br \fImode\fP a Metafont mode string, such as \fCibmvga\fP .br \fIfontname\fP the name of a font, such as \fCcmr10\fP .br \fIdpi\fP the requested size of a font in dots-per-inch .br \fIbasedpi\fP the design size of a font .br \fImagnification\fP of the font .RE .PP \fBReturns:\fP .RS 4 a reference to the formatted string; this is a static string, which is overwritten on each call .RE .PP \fBExceptions:\fP .RS 4 \fI\fBPkError\fP\fP if it encounters an illegal format element\&. .RE .PP .PP References normal, SS_C_STR, SS_STRING, SSTREAM, and Util::verbosity_\&. .PP Referenced by fontgenCommand()\&. .SS "\fBverbosities\fP PkFont::verbosity (const \fBverbosities\fPlevel)\fC [static]\fP" .PP References KarlPathSearcher::verbosity()\&. .PP Referenced by main()\&. .SS "double PkFont::vppp () const\fC [inline]\fP" .PP Obtains the number of vertical pixels per point for this font, as obtained from the PK file preamble\&. .PP \fBReturns:\fP .RS 4 the vppp parameter in points .RE .PP .SS "double PkFont::wordSpace () const\fC [inline]\fP" .PP Obtains the size of the \fCword_space\fP parameter for this font\&. This does \fInot\fP include any overall DVI magnification\&. .PP \fBReturns:\fP .RS 4 \fCword_space\fP in DVI units .RE .PP .SH "Member Data Documentation" .PP .SS "unsigned int PkFont::c" .PP Referenced by PkFont()\&. .SS "string PkFont::comment" .SS "unsigned int PkFont::cs" .SS "unsigned int PkFont::d" .PP Referenced by PkFont()\&. .SS "double PkFont::designSize" .PP Referenced by DviFile::getFallbackFont(), main(), and PkGlyph::PkGlyph()\&. .SS "double PkFont::hppp" .SS "unsigned int PkFont::id" .SS "unsigned int PkFont::s" .PP Referenced by PkFont(), setFontSearchCommand(), and setFontSearchPath()\&. .SS "double PkFont::vppp" .SH "Author" .PP Generated automatically by Doxygen for dvi2bitmap from the source code\&.