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.
sdkFillText text string size
- senso
- Site Admin
- Posts: 4427
- Location: France
- Contact:
I'll try to implement it in the HH3 sdk
Olivier Sens
www.brainmodular.com
www.brainmodular.com
