Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | draw.ID.text.ex.getWidth SEARCH    

  Functions
draw.ID.brushFrom.ID
draw.ID.copyFrom.ID
draw.ID.copyMode
draw.ID.ellipse
draw.ID.getPixel
draw.ID.height
draw.ID.isEgual.ID
draw.ID.line
draw.ID.load
draw.ID.paint
draw.ID.pixelFormat
draw.ID.polygon
draw.ID.rect
draw.ID.rotate.sourceID
draw.ID.save
draw.ID.setPixel
draw.ID.size
draw.ID.text.ex
draw.ID.text.ex.getWidth
draw.ID.width
draw.isEgual.X
draw.isEgual.Y
draw.mem.create
draw.mem.createFromFile
draw.mem.delete
draw.mem.exists
draw.mx.deform
draw.mx.effects

  MioScript Reference
> Statements
app...
browser...
dialog...
disk...
draw...
extern...
filename...
keyboard...
menu...
mio...
mouse...
num...
path...
pushButton...
reg...
RS232...
sci...
screen...
shortcut...
sound...
str...
system...
time...
var...
window...

Function
draw.ID.text.ex.getWidth

Language: MioScript
Product: MioFactory


Syntax

draw.ID.text.ex.getWidth(NULL, NULL, Text, FontName, Size, NULL, Bold, FontWeight, Orientation, Italic)


Parameters

NULLNULL, NULLSet to NULL
STRINGTextText to render.
STRINGFontNameName of the font to be used.
INTSizeSize of the text.
NULLNULLSet to NULL.
BOOLBoldOptional.
Set to true for bold.
INTFontWeightOptional.
Weight of the font.
INTOrientationOptional.
Orientation of the text, in degres.
BOOLItalicOptional.
Set to true for italic.


Return value

Width of the text as it will be rendered with the function draw.ID.text.ex



Description

Returns the size of the text after rendering (text is not rendered).




MioScript Sample Code

&twidth=draw.main.text.ex.getWidth(
    NULL,NULL,
    "Hello, World",
    "Arial", 12,
    NULL,
    true
)

// Center the text in the main window

draw.main.text.ex(
    window.main.width()/2-&twidth/2,100,
    "Hello, World",
    "Arial", 12,
    num.rgb(255,0,0),
    true
)

draw.main.paint()