Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dtk_create_string(3) [debian man page]

DTK_CREATE_STRING(3)						Draw Toolkit manual					      DTK_CREATE_STRING(3)

NAME
dtk_create_string - Creates or modify a shape to display a string SYNOPSIS
#include <drawtk.h> dtk_hshape dtk_create_string(dtk_hshape shp, const char *text, float size, float x, float y, unsigned int alignment, const float *color, dtk_hfont font); DESCRIPTION
dtk_create_string() creates a text specified by text at location (x,y) with a font size of size using a previously loaded font referenced by font argument (see dtk_load_font(3)). The position (x,y) is interpreted according to the combination of flags controlling the vertical and horizontal alignment defined in the alignment argument: * DTK_BOTTOM, DTK_VMID and DTK_TOP make the value y to be interpreted as respectively the bottom, the middle and the top of the bounding box of the shape. * DTK_LEFT, DTK_HMID and DTK_RIGHT make the value x to be interpreted as respectively the left, the middle and the right of the bounding box of the shape. shp and color has the same usage and meaning than in other shape creation functions (see dtk_create_shape(3)): * shp can be used to modify a previously created shape. If it is non-null, the handle will be used to modify the shape referenced by shp: no new shape is created and the returned value is ensured to be shp in case of success, NULL otherwise. If shp is NULL, the function will attempt to create a new shape. * color should point to a 4 float array containing a normalized RGBA value (i.e. each component is between 0.0 and 1.0). RETURN VALUE
In case of success the function returns the handle to the newly created or modified shape. If the shp argument is non-null, the handle returned is the same value. In case of error, NULL is returned. SEE ALSO
dtk_load_font(3), dtk_create_shape(3) EPFL
2010 DTK_CREATE_STRING(3)

Check Out this Related 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)
Man Page