# cdCanvasSetNativeFont

Definition: | include pGUI.e cdCanvasSetNativeFont(cdCanvas canvas, string font) -- or -- string font = cdCanvasGetNativeFont(cdCanvas canvas)
Description: | Selects a font based on a string description.
pwa/p2js: | Not supported.
Comments: | 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. The procedure cdSetNativeFont() and the function cdGetNativeFont() which did not require an explicit canvas to be specified ceased to be available in IUP version 3.25. These functions wrap the C function cdCanvasNativeFont which is a Get/Set function that can also accept either NULL or CD_QUERY to perform a Get-only function, whereas in pGUI.e, the Get/Set has been made part of the routine name, and NULL/CD_QUERY are not valid parameters to the Set procedure. Note that CD_QUERY is also used by the C functions cdCanvasGetLineStyle, cdCanvasGetLineWidth, cdCanvasSetForeground, cdCanvasSetTextAlignment, cdCanvasMarkSize, and cdCanvasMarkType - obviously use the search function to check for any more recent uses.