#include <dk.h>
#include <dktypes.h>
#include <dkfont.h>
Go to the source code of this file.
Defines | |
#define | DK_FONT_FEATURE_RM 1 |
Font feature: roman font. | |
#define | DK_FONT_FEATURE_SF 2 |
Font feature: sans-serif font. | |
#define | DK_FONT_FEATURE_TT 3 |
Font feature: typewriter font. | |
#define | DK_FONT_FEATURE_FAMILY 3 |
Font feature mask: Font family. | |
#define | DK_FONT_FEATURE_BD 4 |
Font feature: bold. | |
#define | DK_FONT_FEATURE_IT 8 |
Font feature: italic. | |
#define | DK_FONT_RP_TYPE_SYTEM 0 |
Font replacement type: System. | |
#define | DK_FONT_RP_TYPE_DOWNLOAD 1 |
Font replacement type: Download. | |
Functions | |
char * | dkfont_get_tex_name (size_t number) |
Find TeX name of a font. | |
char * | dkfont_get_ps_name (size_t number) |
Find PS name of a font. | |
char * | dkfont_get_svg_font_id (size_t number) |
Get SVG ID for font. | |
char * | dkfont_get_svg_family_name (size_t number) |
Get SVG font family name. | |
char * | dkfont_get_gs_alias_name (size_t number) |
Get GhostScript alias name for font. | |
char * | dkfont_get_gs_file_name (size_t number) |
Get GhostScript font file name. | |
int | dkfont_get_features (size_t number) |
Get font features. | |
dk_font_t * | dkfont_get_ps_fonts (void) |
Get all PS font descriptions. | |
dk_font_mapping_t * | dkfont_mapping_open (void) |
Create a new font mapping structure. | |
void | dkfont_mapping_close (dk_font_mapping_t *f) |
Destroy font mapping structure and release memory. | |
int | dkfont_mapping_add_stream (dk_font_mapping_t *f, dk_stream_t *s) |
Add information from an input stream to the font mapping structure. | |
int | dkfont_get_error_code (dk_font_mapping_t *f) |
Retrieve last error code. | |
unsigned long | dkfont_get_error_lineno (dk_font_mapping_t *f) |
Retrieve line number of input in which the last error occured. | |
dk_one_font_mapping_t * | dkfont_get_one_font (dk_font_mapping_t *f, size_t s) |
Retrieve font substitution data for one font. | |
void | dkfont_set_used (dk_font_mapping_t *fm, size_t sz, int fl) |
Mark one font in the font mapping structure as used. | |
int | dkfont_get_used (dk_font_mapping_t *f, size_t s) |
Chech whether or not a font is marked as used. | |
void | dkfont_one_font_reset (dk_one_font_mapping_t *s) |
Reset a font substution structure (the internal pointer is set to point to the first substitution candidate structure). | |
dk_font_replacement_t * | dkfont_one_font_get (dk_one_font_mapping_t *s) |
Get next font substitution candidate structure in font substitution structure. | |
char * | dkfont_rep_get_name (dk_font_replacement_t *r) |
Get font name of font substitution candidate structure. | |
char * | dkfont_rep_get_family (dk_font_replacement_t *r) |
Get font family name of font substitution candidate structure. | |
char * | dkfont_rep_get_location (dk_font_replacement_t *r) |
Get location (directory part of download URL or directory name) of font file for a font substitution candidate structure. | |
char * | dkfont_rep_get_source_name (dk_font_replacement_t *r) |
Get file name of font file for a font substitution candidate structure. | |
char * | dkfont_rep_get_font_type (dk_font_replacement_t *r) |
Get font type. | |
char * | dkfont_rep_get_tex_name (dk_font_replacement_t *r) |
Get TeX name for substitution candidate. | |
int | dkfont_rep_get_features (dk_font_replacement_t *r) |
Get features of substitution candidate. | |
int | dkfont_rep_get_source_type (dk_font_replacement_t *r) |
Get source type for font substitution candidate. | |
int | dkfont_rep_check_driver (dk_font_replacement_t *r, char *d) |
Check whether a font substitution candidate can be used with a driver. |
This module provides information about the 35 well-known PS fonts. For each font we can retrieve LaTeX and PS font name and a list of features. use the functions dkfont_get_tex_name(), dkfont_get_ps_name(), dkfont_get_svg_font_id(), dkfont_get_svg_family_name(), dkfont_get_gs_alias_name(), dkfont_get_gs_file_name() and dkfont_get_features() for this purpose.
Since version 1.11.0 the module can read a font configuration file for more comfortable and flexible font substitutions.
See Font configuration details for details about font configuration files.
#define DK_FONT_FEATURE_BD 4 |
Font feature: bold.
#define DK_FONT_FEATURE_FAMILY 3 |
Font feature mask: Font family.
#define DK_FONT_FEATURE_IT 8 |
Font feature: italic.
#define DK_FONT_FEATURE_RM 1 |
Font feature: roman font.
#define DK_FONT_FEATURE_SF 2 |
Font feature: sans-serif font.
#define DK_FONT_FEATURE_TT 3 |
Font feature: typewriter font.
#define DK_FONT_RP_TYPE_DOWNLOAD 1 |
Font replacement type: Download.
#define DK_FONT_RP_TYPE_SYTEM 0 |
Font replacement type: System.
int dkfont_get_error_code | ( | dk_font_mapping_t * | f | ) |
Retrieve last error code.
f | Pointer to font mapping structure |
unsigned long dkfont_get_error_lineno | ( | dk_font_mapping_t * | f | ) |
Retrieve line number of input in which the last error occured.
f | Pointer to font mapping structure. |
int dkfont_get_features | ( | size_t | number | ) |
Get font features.
number | Index of the font (0-34). |
char* dkfont_get_gs_alias_name | ( | size_t | number | ) |
Get GhostScript alias name for font.
number | Index of the font (0-34). |
char* dkfont_get_gs_file_name | ( | size_t | number | ) |
Get GhostScript font file name.
number | Index of the font (0-34). |
dk_one_font_mapping_t* dkfont_get_one_font | ( | dk_font_mapping_t * | f, | |
size_t | s | |||
) |
Retrieve font substitution data for one font.
f | Pointer to font mapping structure. | |
s | Index of the font (0-34). |
dk_font_t* dkfont_get_ps_fonts | ( | void | ) |
Get all PS font descriptions.
char* dkfont_get_ps_name | ( | size_t | number | ) |
Find PS name of a font.
number | Index of the font (0-35). |
char* dkfont_get_svg_family_name | ( | size_t | number | ) |
Get SVG font family name.
number | Index of the font (0-35). |
char* dkfont_get_svg_font_id | ( | size_t | number | ) |
Get SVG ID for font.
number | Index of the font (0-35). |
char* dkfont_get_tex_name | ( | size_t | number | ) |
Find TeX name of a font.
number | Index of the font (0-34). |
int dkfont_get_used | ( | dk_font_mapping_t * | f, | |
size_t | s | |||
) |
Chech whether or not a font is marked as used.
f | Pointer to font mapping structure. | |
s | Index of the font (0-34). |
int dkfont_mapping_add_stream | ( | dk_font_mapping_t * | f, | |
dk_stream_t * | s | |||
) |
Add information from an input stream to the font mapping structure.
f | Pointer to font mapping structure. | |
s | Pointer to stream. |
void dkfont_mapping_close | ( | dk_font_mapping_t * | f | ) |
Destroy font mapping structure and release memory.
f | Pointer to font mapping structure to destroy. |
dk_font_mapping_t* dkfont_mapping_open | ( | void | ) |
Create a new font mapping structure.
The font mapping structure is created in dynamically allocated memory, use dkfont_mapping_close() to destroy the structure and release the memory if the structure is no longer needed.
dk_font_replacement_t* dkfont_one_font_get | ( | dk_one_font_mapping_t * | s | ) |
Get next font substitution candidate structure in font substitution structure.
s | Pointer to font substitution structure. |
void dkfont_one_font_reset | ( | dk_one_font_mapping_t * | s | ) |
Reset a font substution structure (the internal pointer is set to point to the first substitution candidate structure).
s | Pointer to font substution structure. |
int dkfont_rep_check_driver | ( | dk_font_replacement_t * | r, | |
char * | d | |||
) |
Check whether a font substitution candidate can be used with a driver.
r | Font substitution candidate structure. | |
d | Driver name. |
char* dkfont_rep_get_family | ( | dk_font_replacement_t * | r | ) |
Get font family name of font substitution candidate structure.
r | Font substitution candidate structure. |
int dkfont_rep_get_features | ( | dk_font_replacement_t * | r | ) |
Get features of substitution candidate.
r | Font substitution candidate structure. |
char* dkfont_rep_get_font_type | ( | dk_font_replacement_t * | r | ) |
Get font type.
r | Font substitution candidate structure. |
char* dkfont_rep_get_location | ( | dk_font_replacement_t * | r | ) |
Get location (directory part of download URL or directory name) of font file for a font substitution candidate structure.
r | Font substitution candidate structure. |
char* dkfont_rep_get_name | ( | dk_font_replacement_t * | r | ) |
Get font name of font substitution candidate structure.
r | Font substitution candidate structure. |
char* dkfont_rep_get_source_name | ( | dk_font_replacement_t * | r | ) |
Get file name of font file for a font substitution candidate structure.
r | Font substitution candidate structure. |
int dkfont_rep_get_source_type | ( | dk_font_replacement_t * | r | ) |
Get source type for font substitution candidate.
r | Font substitution candidate structure. |
char* dkfont_rep_get_tex_name | ( | dk_font_replacement_t * | r | ) |
Get TeX name for substitution candidate.
r | Font substitution candidate structure. |
void dkfont_set_used | ( | dk_font_mapping_t * | fm, | |
size_t | sz, | |||
int | fl | |||
) |
Mark one font in the font mapping structure as used.
fm | Pointer to font mapping structure. | |
sz | Index of the font (0-34). | |
fl | Flag (1=font used, 0=font not used). |