Definition: |
include pGUI.e
cdCanvasSetNativeFont(cdCanvas hCdCanvas, string font) -- or -- string font = cdCanvasGetNativeFont(cdCanvas hCdCanvas) -- or -- cdSetNativeFont(string font) -- or -- string font = cdGetNativeFont() |
Description: |
Selects a font based on a string description. The description can depend on the driver and the platform, but a common definition is available for all drivers. It does not need to be stored by the application, as it is internally replicated by the library. The string is case sensitive. The string is parsed and the font typeface, style and size are set according to the parsed values, as if cdCanvasFont was called. The native font string is cleared when a font is set using cdCanvasFont. The common format definition is similar to the the Pango library Font Description, used by GTK+2. It is defined as having 3 parts: <font family>, <font styles> <font size>. For example: "Times, Bold 18", or "Arial,Helvetica, Italic Underline -24". The supported styles include: Bold, Italic, Underline and Strikeout. Underline, Strikeout, and negative pixel values are not supported by the standard Pango Font Description. The Pango format include many other definitions not supported by the CD format, they are just ignored. The IUP FONT attribute internal formats are also accepted in all drivers and platforms. cdSetNativeFont(f) is equivalent to cdCanvasSetNativeFont(cdActiveCanvas(),f), and cdGetNativeFont() is equivalent to cdCanvasGetNativeFont(cdActiveCanvas()). These functions wrap the C functions cdCanvasNativeFont and cdNativeFont, which are both Get/Set functions that can also accept either NULL or CD_QUERY to perform a Get-only function, whereas in pGUI, the Get/Set has been made part of the routine name, and NULL/CD_QUERY are not valid parameters to either of the Set procedures. |