cdCanvasVectorText
| Definition: |
include pGUI.e
cdCanvasVectorText(cdCanvas canvas, atom x, y, string text) -- or -- wdCanvasVectorText(cdCanvas canvas, atom x, y, string text) |
| Description: |
Display multiline vector text at the specified position.
cdCanvasMultiLineVectorText() is aliased/identical to cdCanvasVectorText(), however you may as well avoid the additional call/return in the C code, and the extra typing/reading/parsing of ten characters, and just use the latter directly. Ditto wdCanvasMultiLineVectorText(). |
| pwa/p2js: | Not supported. (but on my wishlist) |
| Attributes: |
cdCanvasVectorTextDirection(cdCanvas canvas, integer x1, y1, x2, y2)
-- or -- wdCanvasVectorTextDirection(cdCanvas canvas, atom x1, y1, x2, y2) Defines the text direction by means of two points, (x1,y1) and (x2,y2). The default direction is horizontal from left to right. It is independent from the transformation matrix. sequence matrix = cdCanvasVectorTextTransform(cdCanvas canvas, sequence matrix) Defines a transformation matrix with 6 elements. If the matrix is {}, no transformation is set. The default is no transformation. The origin is the left bottom corner of matrix. It returns the previous matrix. The matrix contains scale, rotation and translation elements. It is applied after computing the position and orientation normal to the vector text. We can describe the elements as follows:
|x'| | scl_x*cos(ang) -sin(ang) trans_x | |x| | 3 4 5|
|y'| = | sin(ang) scl_y*cos(ang) trans_y | * |y| with indices | 0 1 2|
|1|
It has the same effect of the cdCanvasTransform, but notice that the indices are different. cdCanvasVectorTextSize(cdCanvas canvas, integer width, height, string text) -- or -- wdCanvasVectorTextSize(cdCanvas canvas, atom width, height, string text) Modifies the font size of the vector text so that it fits the string in the box defined by width and height. atom prev = cdCanvasVectorCharSize(cdCanvas canvas, integer size) -- or -- atom prev = wdCanvasVectorCharSize(cdCanvas canvas, atom size) Modifies the font size by specifying the height of the characters. Returns the previous value. CD_QUERY returns the current value. cdCanvasVectorFontSize(cdCanvas canvas, atom size_x, size_y) Directly modifies the font size. Set size_x==size_y to maintain the original aspect ratio of the font. atom {size_x, size_y} = cdCanvasGetVectorFontSize(cdCanvas canvas) Returns the font size. nullable_string font = cdCanvasVectorFont(cdCanvas canvas, nullable_string filename) Replaces the current vector font with a font stored in a file with a given name. Returns the name of the font loaded or NULL, if it fails. If filename is NULL, it activates the default font "Simplex II" (There is no file associated to this font, it is an embedded font). The library will attempt to load a font from the current directory, if it fails then it will try the directory defined by the environment variable "CDDIR", if it fails, it will attempt to load it using the filename as a string containing the font as if the file was loaded into that string, if it fails again the font is reset to the default font and returns NULL. The file format is compatible with the GKS file format (text mode). |