SelTextSize fractionnal

I just found out that Windows TextArea reports fractional text size, instead of Integer (says the LR).

Sub SelChange() Label3.Text = str(me.SelTextSize) End Sub

On the second paragraph of the SyledTextExample, I get 6.75. Since I was saving with an Integer, it got truncated to 6, and when reloading the paragraph was smaller.

If you move the mouse over the word SelTextSize and look at the bottom of the IDE you see:

So indeed the LR is wrong.

<https://xojo.com/issue/44873>

Another problem : SelTextSize is single only in get, and Integer in set.

I really wish font sizes were all single.

I think with all the discussions about Fonts (in PDF and RTF etc), I think the XOJO really needs to step back, and insure that regardless of how OSX, WIN or Linux may handle font sized INTERNALLY, that the values facing the developer are normalized and consistent

[quote]
FONTUNIT
An appropriate cross-platform selection. On Macintosh, font units is in points, on Windows it is in pixel size, and on Linux it is a scale Point size. This is a legacy carry-over from the days where the TextSize of 12 was the default and 12 was assumed to be the standard font size on each platform.[/quote]

This is no longer a valid assumption, ALL Platforms should be using POINTS as the default

I believe the framework text size is a Single. Fractional point size is common in modern applications. Keeping Integer is staying stuck in the past IMO.

It is also Single for the setter (at least on OS X).

TextField, TextArea and Label related properties are singles (TextSize, …) or doubles (LineHeight, LineSpacing, …). Unfortunately the Graphics class has all text related properties still being integer-based.

Check here for the latest changes in the documentation.

Interesting. On Windows it is integer :confused:

StyleRuns still reports font size as Integer.

Or not.

Not on OS X.

Forgive me, but that is very little relief :confused:

I don’t know what your comment means. I stated a fact.

It does not help to know it works in OS X when the problem manifests in Windows, and the thread has been explicitly posted in the Windows channel. But thanks anyway.

Nope. It is a Single in Windows too.

Well, I had enough bugs for today. Nevertheless, how is it when I check the size in SelTextSize I get a fraction, for instance 6.75, and the very same portion of text I get 6 in sr.size ?

It looks very much like in Windows, the value has been truncated by an integer.

Now, sorry, I am not amused anymore by bug chasing, and will get back to productive work with 2015R4.1.

I think I now understand you. With your sentence “… on Windows it is integer” I didn’t get that you meant the value returned – I thought you meant the method/property signature.