LibGlabels 3.0 Reference Manual | ||||
---|---|---|---|---|
Top | Description |
#include <libglabels/lgl-units.h> enum lglUnits; const gchar * lgl_units_get_id (lglUnits units
); lglUnits lgl_units_from_id (const gchar *id
); const gchar * lgl_units_get_name (lglUnits units
); lglUnits lgl_units_from_name (const gchar *name
); gdouble lgl_units_get_points_per_unit (lglUnits units
); gdouble lgl_units_get_units_per_point (lglUnits units
);
This section defines a type to represent the various units of distance supported by libglabels. It also defines a set of related functions.
typedef enum { LGL_UNITS_POINT, /* encoded as "pt" */ LGL_UNITS_INCH, /* encoded as "in" */ LGL_UNITS_MM, /* encoded as "mm" */ LGL_UNITS_CM, /* encoded as "cm" */ LGL_UNITS_PICA, /* encoded as "pc" */ LGL_UNITS_FIRST = LGL_UNITS_POINT, LGL_UNITS_LAST = LGL_UNITS_PICA, LGL_UNITS_INVALID = -1 } lglUnits;
This enumeration defines supported units of distance.
Points. | |
Inches. | |
Millimeters | |
Centimeters | |
Picas | |
First supported unit. (Used for bounds checking and iteration through supported units.) | |
Last supported unit. (Used for bounds checking and iteration through supported units.) | |
Invalid unit. (Returned by libglabels units functions when a supported unit cannot be determined.) |
const gchar * lgl_units_get_id (lglUnits units
);
Return a unique ID string for the given units. This ID is how units are encoded in libglabels XML files and will remain constant across all locales. IDs are identical to the absolute length units supported in the CSS2 Specification (Section 4.3.2).
|
Units (lglUnits) |
Returns : |
ID string. |
lglUnits lgl_units_from_id (const gchar *id
);
Return the unique lglUnits for the given ID string. This ID is how units are encoded in libglabels XML files and will remain constant across all locales. IDs are identical to the absolute length units supported in the CSS2 Specification (Section 4.3.2).
|
ID string |
Returns : |
units (lglUnits). |
const gchar * lgl_units_get_name (lglUnits units
);
Return a unique name string for the given units. This name is human readable and will be translated to the current locale.
|
Units (lglUnits) |
Returns : |
name string. |
lglUnits lgl_units_from_name (const gchar *name
);
Return the unique lglUnits for the given name string. This name is human readable and is expected to be translated to the current locale.
|
NAME string |
Returns : |
units (lglUnits). |
gdouble lgl_units_get_points_per_unit (lglUnits units
);
Return a scale factor for the given units in points/unit.
|
Units (lglUnits) |
Returns : |
scale factor. |