I've found that a combination of scaling font size based on the default font 
size (font.pixelSize of an empty Text item, for example, or the new 
Font/TextMetrics types) and Text.Fit handles stuff pretty well. I'd be 
interested to see your case where it's not working, just because I'm curious. :)

The patch to expose it shouldn't be that hard, and I don't see a reason why 
it'd be rejected. Still, I wonder if there's a better way to solve your problem.

________________________________________
From: Harri Pasanen <ha...@mpaja.com>
Sent: Wednesday, 28 January 2015 15:48
To: Curtis Mitch; interest@qt-project.org
Subject: Re: [Interest] QML Text.Fit question

On 28/01/2015 13:25, Curtis Mitch wrote:
> Why do you need to know the size of the text?

I work mostly in mobile space where the size, resolution and pixel
densities vary greatly between displays.

If one wants to automate layout so that it remains usable (even if not
"artful" in all cases), one needs to settle on a font size where all the
text fits.   So it is convenient to be able to ask for a font size that
fits in a given rectangle and then standardize on that.

I think it would be useful to expose that property in Text element.

Just my 2 cents,

Harri

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to