#include <PkFont.h>
Public Member Functions | |
PkFont (double fontmag, unsigned int c, unsigned int s, unsigned int d, string name) | |
Represents a PK font. | |
~PkFont () | |
PkGlyph * | glyph (unsigned int i) const |
Returns the glyph at a given position in this font. | |
string | fontgenCommand () const |
Returns a command which can be used to generate fonts. | |
string | name () const |
Identifies the current font. | |
string | fontFilename () const |
Locates the current font's bitmap file. | |
double | magnification (bool includeDviMag=true) const |
Obtain the magnification of this font. | |
int | dpiScaled () const |
Obtains the resolution of the current font, taking magnification into account. | |
double | scale () const |
Obtains the font's scale. | |
bool | seenInDoc (void) const |
Has the current font been declared in the document so far, or just in the DVI file postamble. | |
void | setSeenInDoc (void) |
double | wordSpace () const |
Obtains the size of the word_space parameter for this font. | |
double | backSpace () const |
Obtains the size of the back_space parameter for this font. | |
double | quad () const |
Obtains the size of the quad parameter for this font. | |
double | designSize () const |
Obtains the design size of this font, as obtained from the PK file preamble. | |
double | hppp () const |
Obtains the number of horizontal pixels per point for this font, as obtained from the PK file preamble. | |
double | vppp () const |
Obtains the number of vertical pixels per point for this font, as obtained from the PK file preamble. | |
unsigned int | checksum () const |
Obtains the font checksum, as obtained from the PK file preamble. | |
bool | loaded () const |
Check if the font has actually been loaded. | |
Static Public Member Functions | |
verbosities | verbosity (const verbosities level) |
void | setFontSearchPath (string fp) |
Set the list of directories in which to look for fonts. | |
void | setFontSearchPath (char *fp) |
Set the list of directories in which to look for fonts. | |
void | setFontSearchPath (bool yesno) |
Enable or disable using the font-path when searching for fonts. | |
void | setFontSearchCommand (string cmd) |
Set the shell command which is used when searching for fonts. | |
void | setFontSearchCommand (char *cmd) |
Sets the shell command which is used when searching for fonts. | |
void | setFontSearchCommand (bool yesno) |
Enable or disable using a font-search command when searching for fonts. | |
void | setFontSearchKpse (bool yesno) |
Enable or disable using the kpathsea library when searching for fonts. | |
void | setResolution (int res) |
Sets the base font resolution. | |
void | setMissingFontMode (string mode) |
Sets the Metafont mode to be used when generating fonts. | |
void | setFontgen (bool doit) |
Enables or disables font generation. | |
void | setFontgenCommand (string command_template) |
Set the shell command which is used when generating fonts. | |
int | dpiBase () |
Obtains the base font resolution, in dots-per-inch. | |
string & | substitute_font_string (const string fmt, const string mode, const string fontname, const int dpi, const int basedpi, const double magnification) throw (PkError) |
Given a format string, return a reference to a string with format specifiers replaced by font information. |
|
Represents a PK font.
The constructor arguments are those read from the DVI file font declaration, after a
|
|
|
|
Obtains the size of the This does not include any overall DVI magnification.
|
|
Obtains the font checksum, as obtained from the PK file preamble.
|
|
Obtains the design size of this font, as obtained from the PK file preamble.
|
|
Obtains the base font resolution, in dots-per-inch. This is the base resolution corresponding to the Metafont mode set by setMissingFontMode, and the two must be consistent if font-generation is to work.
|
|
Obtains the resolution of the current font, taking magnification into account.
|
|
Locates the current font's bitmap file.
|
|
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. Note that if a font-generation command template is defined but automatic font generation is disabled, this still returns a font-generation command.
|
|
Returns the glyph at a given position in this font. If the font has not been loaded, it returns a dummy glyph.
|
|
Obtains the number of horizontal pixels per point for this font, as obtained from the PK file preamble.
|
|
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.
|
|
Obtain the magnification of this font. This includes both font scaling and overall DVI file magnification: this number is mag/1000 . s/d, where s and d are taken from the font definition in the DVI file, and mag is the total magnification taking into account DVI preamble magnification and any command-line overriding.
|
|
Identifies the current font.
|
|
Obtains the size of the This does not include any overall DVI magnification.
|
|
Obtains the font's scale. This is the factor s/d, where s and d 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 magnification/1000 . s/d times its design size. This is distinct from the return value of magnification, which takes DVI file magnification into account, and which is therefore more useful in general.
|
|
Has the current font been declared in the document so far, or just in the DVI file postamble.
|
|
Enables or disables font generation.
Font generation will only be enabled if there is a font-generation template command, either set through method
|
|
Set the shell command which is used when generating fonts. The specified string should be a template string with the formatting characters managed by substitute_font_string, and these will be substituted with the required values before the command is run.
This also enables font-generation, so that it has the effect of
|
|
Enable or disable using a font-search command when searching for fonts.
|
|
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 substitute_font_string, and these will be substituted with the required values before the command is run.
|
|
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 substitute_font_string, and these will be substituted with the required values before the command is run.
|
|
Enable or disable using the
|
|
Enable or disable using the font-path when searching for fonts.
|
|
Set the list of directories in which to look for fonts.
|
|
Set the list of directories in which to look for fonts.
|
|
Sets the Metafont mode to be used when generating fonts. This must be consistent with any base font resolution set in setResolution.
|
|
Sets the base font resolution. This must be consistent with the the Metafont mode set by setMissingFontMode, if font-generation is to work.
|
|
|
|
Given a format string, return a reference to a string with format specifiers replaced by font information. The format specifiers are:
|
|
|
|
Obtains the number of vertical pixels per point for this font, as obtained from the PK file preamble.
|
|
Obtains the size of the This does not include any overall DVI magnification.
|