Welcome to %s forums

BrainModular Users Forum

Login Register

sdkFillText text string size

Tell us what you'd like Usine to do
Post Reply
sm_jamieson
Member
Posts: 559
Contact:

Unread post by sm_jamieson » 22 Aug 2016, 02:47

Could there please be a way of determining the display size of a text string (in pixels or percent) ?
If you want to center a text string or create a box just large enough to contain a text string, these dimensions are vital.

Take the sdkFillText function:

sdkFillText (TRectF rect, AnsiCharPtr text, TColorUsine textColor, float fontSize, LongBool isBold=FALSE, LongBool isWordWrap=FALSE, TTextAlign alignHorizontal=taCenter, TTextAlign alignVertical=taCenter, LongBool isVertical=FALSE)

You can specify the font size, but there is no way to know how long the entire string will be when it is rendered.

What is needed is something like:

sdkTextDisplayWIdth(text, fontSize, isBold)
and
sdkTextDisplayHeight(text, fontSize, isBold)


A bit like what you can do with java and fontMetrics, etc.

Thanks,
Simon.

User avatar
senso
Site Admin
Posts: 4425
Location: France
Contact:

Unread post by senso » 14 Sep 2016, 08:13

I'll try to implement it in the HH3 sdk

Post Reply

Who is online

Users browsing this forum: No registered users and 49 guests