2020-08-08 20:43:37 +00:00
|
|
|
sub init()
|
2021-07-09 20:08:32 +00:00
|
|
|
m.top.functionName = "getTextSize"
|
2020-08-08 20:43:37 +00:00
|
|
|
end sub
|
|
|
|
|
|
|
|
sub getTextSize()
|
|
|
|
|
|
|
|
reg = CreateObject("roFontRegistry")
|
|
|
|
font = reg.GetDefaultFont(m.top.fontsize, false, false)
|
|
|
|
|
|
|
|
res = []
|
|
|
|
|
|
|
|
for each line in m.top.text
|
2021-07-09 20:08:32 +00:00
|
|
|
res.push(font.GetOneLineWidth(line, m.top.maxWidth))
|
2020-08-08 20:43:37 +00:00
|
|
|
end for
|
|
|
|
|
|
|
|
m.top.height = font.GetOneLineHeight()
|
|
|
|
|
|
|
|
|
|
|
|
m.top.width = res
|
|
|
|
|
2022-05-30 12:57:40 +00:00
|
|
|
end sub
|