Shayton Equilibrium Kitchen Utensil 2003 User Manual

Page of 194
MediaScript Objects and Methods 109 
• 
• 
• 
m e a s u r e T e x t ( )
Returns an array of offsets where each character would be drawn for a single line of text. 
If more that one line of text is specified (by including “\n”) then only the first line of text 
is measured. This method is available for Windows only.
Syntax
measureText(
[text @ <"string">], 
[font @ <"font family">], 
[size @ <value 1..4095>], 
[style@ <"modifier">], 
[spacing @ <"spacing">], 
[smooth @ <true, false>], 
[ClearType @ <"cleartype">], //Windows only
[kern @ <true, false>]
);
Parameters
Font
 - 
specifies the TrueType or PostScript font family name to be used, for example, 
“Arial”. MediaRich supports Type 1 (.pfa and .pfb) PostScript fonts only.
NOTE: 
The size of the font in pixels is dependent on the resolution of the resulting image. If the 
resolution of the image is not set (zero), the function uses a default value of 72 dpi.
The default location for fonts specified in a MediaScript is the fonts file system. Which 
includes both the MediaRich Shared\Originals\Fonts folder and the default system 
fonts folder. If a MediaScript specifies an unavailable font, MediaRich generates an error.
NOTE: 
You can modify the MediaRich server’s local.properties file to change the default fonts 
directory. See Installing and Managing MediaRich for more information.
Style
 - specifies the font style. You can use any combination of modifiers. Each modifier 
should be separated by a space character. 
NOTE: 
The Style parameter is not available if MediaRich is running on Mac, Linux, or Solaris.
Weight modifiers modify the weight (thickness) of the font. Valid weight values, in order 
of increasing thickness, are: 
“thin”
“extralight” or “ultralight”
“light”
“normal” or “regular”
“medium”
“semibold” or “demibold” (“semi” or “demi” are also acceptable) 
“bold” 
“extrabold” or “ultrabold” (“extra” or “ultra” are also acceptable) 
“heavy” or “black”