List Of Structures

   Print  Previous  Next

Complex data types, so-called structures, consist of different elements. The elements of a structure are accessed by their names in the following way: nameOfVariable.nameOfElement. For example, col.r, if col is a variable of data type color. The following table is an overview of the structures MADRIX Script provides.

Structure

Elements

Description

color

int r
int g
int b
int w
int a

color stores a color value.

There are 5 channels (red, green, blue, white, alpha) with values between 0 and 255.

 

Example: color c = {255, 255, 0, 0};

Members examples: c.r, c.g, c.b, c.w, c.a

 

»Script Example

date

int day
int weekday
int month
int year

date stores a date.

Values for day include 1 to 31 for a single day of the month.

Values for weekday include: 0 = Sunday, 1 = Monday, ..., 6 = Saturday.

Values for month include 1 to 12 for every single month of the year.

Vales for year include year dates.

 

Example: date d = {24, 11, 1980};

Members examples: d.day, d.weekday, d.month, d.year

 

»Script Example

time

int hour
int min
int sec

time stores a certain time.

Valid values are: hours: 0 .. 23, minutes: 0 .. 59, seconds: 0 .. 59.

 

Example: time t = {12, 05, 00};

Members examples: t.hour, t.min, t.sec

 

»Script Example

font

int height
int width
int escapement
int orientation
int weight
int italic
int underline
int strikeOut
int charset
int outprecision
int clipprecision
int quality
int pitch
int family
string fontname

 

height specifies the size of the font and requires an integer value.

width specifies the wideness of the font and requires an integer value.

escapement specifies the desired rotation angle in tenths of a degree and requires an integer value.

orientation should be set to the same value as escapement and requires an integer value.

 

weight specifies the weight of the font. valid values are
FONT_WEIGHT_DONTCARE, FONT_WEIGHT_THIN,
FONT_WEIGHT_EXTRALIGHT, FONT_WEIGHT_LIGHT,
FONT_WEIGHT_NORMAL, FONT_WEIGHT_MEDIUM,
FONT_WEIGHT_SEMIBOLD, FONT_WEIGHT_BOLD,
FONT_WEIGHT_EXTRABOLD, FONT_WEIGHT_HEAVY

 

italic specifies the sloping of the font and requires an integer value: 0 (off) or 1 (on).

 

underline draws a line under the font and requires an integer value: 0 (off) or 1 (on).

 

strikeOut draws a line through the middle of the font and requires an integer value: 0 (off) or 1 (on).

 

charset specifies the character set of the font. Valid values are
CHARSET_ANSI, CHARSET_DEFAULT,
CHARSET_SYMBOL, CHARSET_SHIFTJIS,
CHARSET_HANGEUL, CHARSET_HANGUL,
CHARSET_GB2312, CHARSET_CHINESEBIG5,
CHARSET_OEM, CHARSET_JOHAB,
CHARSET_HEBREW, CHARSET_ARABIC,
CHARSET_GREEK, CHARSET_TURKISH,
CHARSET_VIETNAMESE, CHARSET_THAI,
CHARSET_EASTEUROPE, CHARSET_RUSSIAN,
CHARSET_MAC, CHARSET_BALTIC

 

outprecision specifies how closely the output must match the requested height, weight, and other attributes of a font. Valid values are
PRECIS_OUT_DEFAULT, PRECIS_OUT_STRING,
PRECIS_OUT_CHARACTER, PRECIS_OUT_STROKE,
PRECIS_OUT_TT, PRECIS_OUT_DEVICE,
PRECIS_OUT_RASTER, PRECIS_OUT_TT_ONLY,
PRECIS_OUT_OUTLINE, PRECIS_OUT_SCREEN_OUTLINE,
PRECIS_OUT_PS_ONLY

 

clipprecision specifies how to clip characters that are partially outside the clipping region. Valid values are
PRECIS_CLIP_DEFAULT, PRECIS_CLIP_CHARACTER,
PRECIS_CLIP_STROKE, PRECIS_CLIP_MASK,
PRECIS_CLIP_LH_ANGLES, PRECIS_CLIP_TT_ALWAYS,
PRECIS_CLIP_DFA_DISABLE (Windows Vista and up),
PRECIS_CLIP_EMBEDDED

 

quality specifies the quality of the font. valid values are
QUALITY_DEFAULT, QUALITY_DRAFT,
QUALITY_PROOF, QUALITY_NONANTIALIASED,
QUALITY_ANTIALIASED,
QUALITY_CLEARTYPE (Windows XP and up),
QUALITY_CLEARTYPE_NATURAL (Windows XP and up)

 

pitch specifies the pitch of the font. Valid values for  are
PITCH_DEFAULT, PITCH_FIXED,
PITCH_VARIABLE, PITCH_MONO_FONT

 

family specifies the font family that describes the font in a general way. Valid values are
FONT_FAMILY_DONTCARE, FONT_FAMILY_ROMAN,
FONT_FAMILY_SWISS, FONT_FAMILY_MODERN,
FONT_FAMILY_SCRIPT, FONT_FAMILY_DECORATIVE

 

fontname requires a string. For example "Arial".

 

»Script Example