문자열의 크기를 주어진 폰트정보를 기준으로 계산하여 크기를 Size Class에 값을 담아 반환하는 API이다.
| Parameters | Type | Description |
|---|---|---|
| clsFont | class | 폰트 클래스 |
| strText | STRING | 사이즈를 구하고자 하는 문자열 |
| Type | Description |
|---|---|
| STRING | 값에 대한 대략 크기 문자열 |
** 파라미터 Font Class
classFont = function()
{
this.szfontname = "굴림체";
this.nfontsize = 9;
this.bfontbold = false;
this.bfontitalic = false;
this.bfontunderline = false;
this.bfontstrikeout = false;
}
** 반환되는 Size Class
classSize = function()
{
this.ncx = 0;
this.ncy = 0;
}
function bb_on_mouseup(objInst)
{
var strText = "1234567890";
var clsFont = new classFont;
clsFont.szfontname = "돋움체";
clsFont.nfontsize = 9;
var clsSize = factory.gettextdrawsize(clsFont, strText);
if(clsSize != null) {
screen.alert("width : " + clsSize.ncx + " height : " + clsSize.ncy);
}
}