Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dtk_destroy_font(3) [debian man page]

DTK_LOAD_FONT(3)						Draw Toolkit manual						  DTK_LOAD_FONT(3)

NAME
dtk_load_font - Load an font SYNOPSIS
#include <drawtk.h> dtk_hfont dtk_load_font(const char *fontname); void dtk_destroy_font(dtk_hfont font); DESCRIPTION
dtk_load_font() loads the font specified by fontname argument. This should be the path of a file whose file format can be any of the file format supported by the freetype library (TrueType and Type 1 among many others) or a font description pattern understood by fontconfig (like "Times new roman:bold"). dtk_load_font() will first interpret fontname as a font filename and then, if this fail interpret as a font pattern and load the closest font available on the system. Upon creation, the font data is then tracked by an internal resource manager so that the next call using the same fontname argument will return the same font handle, thus sparing the resources of the system. There is no need for a valid window to create successfully a font, i.e. font loading is completely decoupled from the creation of others resources and can even be created in one thread to be used in another one. dtk_destroy_font() frees the resource referenced by font. If the font is used several times, i.e. several call to dtk_load_font() with the same file path, it decreases the number of uses by one. Calling dtk_destroy_texture() on each created font is currently not mandatory since all font remaining fonts are destroyed when the last window is closed. However, if no window can be closed (for example, no window has been created), dtk_destroy_font() should be called on each created font to avoid any memory leak. RETURN VALUE
In case of success, the dtk_load_font() returns the handle to the loaded font. In case of failure, NULL is returned. dtk_destroy_texture() does not return any value. THREAD SAFETY
dtk_load_font() and dtk_destroy_texture() are thread-safe. SEE ALSO
dtk_create_string(3) fc-list(1) FcPatternFormat(3) EPFL
2010 DTK_LOAD_FONT(3)

Check Out this Related Man Page

PS_FINDFONT(3)								 1							    PS_FINDFONT(3)

ps_findfont - Loads a font

SYNOPSIS
int ps_findfont (resource $psdoc, string $fontname, string $encoding, [bool $embed = false]) DESCRIPTION
Loads a font for later use. Before text is output with a loaded font it must be set with ps_setfont(3). This function needs the adobe font metric file in order to calculate the space used up by the characters. A font which is loaded within a page will only be available on that page. Fonts which are to be used in the complete document have to be loaded before the first call of ps_begin_page(3). Calling ps_find- font(3) between pages will make that font available for all following pages. The name of the afm file must be $fontname .afm. If the font shall be embedded the file $fontname .pfb containing the font outline must be present as well. Calling ps_findfont(3) before the first page requires to output the postscript header which includes the BoundingBox for the whole docu- ment. Usually the BoundingBox is set with the first call of ps_begin_page(3) which now comes after ps_findfont(3). Consequently the Bound- ingBox has not been set and a warning will be issued when ps_findfont(3) is called. In order to prevent this situation, one should call ps_set_parameter(3) to set the BoundingBox before ps_findfont(3) is called. PARAMETERS
o $psdoc - Resource identifier of the postscript file as returned by ps_new(3). o $fontname - The name of the font. o $encoding -ps_findfont(3) will try to load the file passed in the parameter $encoding. Encoding files are of the same syntax as those used by dvips(1). They contain a font encoding vector (which is currently not used but must be present) and a list of extra ligatures to extend the list of ligatures derived from the afm file. $encoding can be NULL or the empty string if the default encoding (TeXBase1) shall be used. If the encoding is set to builtin then there will be no reencoding and the font specific encoding will be used. This is very useful with symbol fonts. o $embed - If set to a value >0 the font will be embedded into the document. This requires the font outline (.pfb file) to be present. RETURN VALUES
Returns the identifier of the font or zero in case of an error. The identifier is a positive number. SEE ALSO
ps_begin_page(3), ps_setfont(3). PHP Documentation Group PS_FINDFONT(3)
Man Page