Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Text height

STW(textString)/1000*GLOB_SCALE will give me the length of the TEXT2 box, I discovered after a bit of pain (as opposed to the the length taken by the characters).

Now in the vertical dimension,
(setFontSize*25.4/72)*GLOB_SCALE/1000
will give me the height of the character itself and I am trying to figure out what the height of the text box is.

Is there supposed to be any function, or constant (for every single font?), or is there some other GDL trick that will give me the height of the text box?
12 REPLIES 12
F. wrote:
You cann add a exta_accuracy_string to the STR{2} command, but it will round only in the metric. You will have to do math again. 😉

I am not understanding the explanation and use of 'precision' for feet and inches. In the examples in the manual, pasted below: how does 0.16 result in rounding to 5/8", 0.64 in rounding to 39/64"?




flags (for ffi, fdi, fi):
'0' display 0 inches

field_width: unsigned decimal integer, the minimum number of characters to generate
precision: unsigned decimal integer, the number of fraction digits to generate

conv_spec (conversion specifier):
ffi: feet & fractional inches
fi: fractional inches

Examples:
h = 23
nr = 0.345678
TEXT2 0, h-6, STR ("%ffi", nr) !1'-2"
TEXT2 0, h-7, STR ("%0.16ffi", nr) !1'-1 5/8"
TEXT2 0, h-10, STR ("%0.64fi", nr) !13 39/64"
Ignacio wrote:
I am not understanding the explanation and use of 'precision' for feet and inches. In the examples in the manual, pasted below: how does 0.16 result in rounding to 5/8", 0.64 in rounding to 39/64"?
For fractional formats, the number after the point represents the denominator. 4=quarters, 16=16ths, 64=64ths. In the example 10/16" gets reduced to 5/8".
James Murray

Archicad 27 • Rill Architects • macOS • OnLand.info
James wrote:
For fractional formats, the number after the point represents the denominator. 4=quarters, 16=16ths, 64=64ths. In the example 10/16" gets reduced to 5/8".
Great. Wonderful. Thanks very much to everybody. Phew.