It is currently February 16th, 2019, 2:14 am

[Bug]Ellipsis/Fontsize wrong when using InlineSetting

Report bugs with the Rainmeter application and suggest features.
User avatar
ikarus1969
Posts: 318
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

[Bug]Ellipsis/Fontsize wrong when using InlineSetting

ikarus1969 » January 18th, 2019, 7:55 am

Hi!

In case a string get's clipped (ClipString=1), then, when using InlineSetting for the font-size of the meter, the size of the ellipsis is much too small.
When using FontSize, the ellipsis get's the correct font-size (that of the rest of the string):
above: font-size with FontSize, below: font-size with InlineSetting
Screenshot Rainmeter Ellipsis.jpg

Code: Select all

[Rainmeter]
DynamicWindowSize=1
AccurateText=1

[MT_Info]
Meter=STRING
Text="The quick brown fox jumps over the lazy dog"
W=300
ClipString=1
; FontSize=32
InlineSetting=Size | 32
FontColor=0,0,0,255
SolidColor=255,255,255,255
AntiAlias=1
You do not have the required permissions to view the files attached to this post.
Last edited by ikarus1969 on January 20th, 2019, 11:11 am, edited 1 time in total.
Yincognito
Posts: 409
Joined: February 27th, 2015, 2:38 pm

Re: [Bug]Ellipsis/Fontsize wrong when using InlineSetting

Yincognito » January 18th, 2019, 3:43 pm

Indeed, this is happening. I tried to "workaround" the thing by also setting InlineSetting=Face | [name of the font here], thinking that way it would include the whole thing in the resizing, but it appears that in the case of InlineSetting, the ellipsis is treated as a different entity compared to the actual string (that might very well be the case in general, by the way).

Maybe the devs will include a correction for this when they take care of the other font/string/AccurateText/padding related issues that Brian was aware of. So, in a sense, this is a good moment to "discover" these issues, as the stuff might be treated as an "all in one" fix for everything related, when the devs will eventually tackle the whole "package".
User avatar
Brian
Developer
Posts: 1844
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [Bug]Ellipsis/Fontsize wrong when using InlineSetting

Brian » January 19th, 2019, 8:26 am

Unfortunately we cannot fix this at this time due to limitations with D2D (DirectWrite).

The reason is because the regular string meter options (like FontSize, FontFace, etc.) are used to create what DirectWrite calls a text format. This format applies to the entire string meter BEFORE any inner adjustments are made via Inline Settings. Inline settings are made with what DirectWrite calls a text layout. This allows for any adjustments on a "range" of text within the text format. Unfortunately, DirectWrite use the "format" to make the ellipsis, and not the layout, so it uses all the properties from the format, and ignores the layout. Unfortunately there is no workaround here since the text range (InlinePattern) can change the size of any given character in the string.

If D2D/DirectWrite will allow the "layout" to be used instead of the "format", we will look into this.

-Brian
User avatar
jsmorley
Developer
Posts: 18819
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Bug]Ellipsis/Fontsize wrong when using InlineSetting

jsmorley » January 19th, 2019, 2:48 pm

I think the only workaround is to use both FontSize and InlineSetting. Then FontSize will control the ellipse's, and InlineSetting will control the rest of the text.

Code: Select all

[Rainmeter]
DynamicWindowSize=1
AccurateText=1

[MT_Info]
Meter=STRING
Text="The quick brown fox jumps over the lazy dog"
W=300
ClipString=1
FontSize=32
InlineSetting=Size | 32
FontColor=0,0,0,255
SolidColor=255,255,255,255
AntiAlias=1
2.jpg

In this example, where the entire string is being set with InlineSetting, that won't make a lot of sense. Might as well just use FontSize and be done with it. There is no particular advantage to InlineSetting=Size over FontSize when the entire string is being set. In fact, I think it is marginally less efficient. However, it might be useful when inlineSetting is being used to alter just a portion of the text.

Code: Select all

[Rainmeter]
DynamicWindowSize=1
AccurateText=1

[MT_Info]
Meter=STRING
Text="The quick brown fox jumps over the lazy dog"
W=300
ClipString=1
FontSize=22
InlineSetting=Size | 42
InlinePattern=quick
FontColor=0,0,0,255
SolidColor=255,255,255,255
AntiAlias=1
1.jpg

I don't particularly recommend using InlineSetting to control the entire text, unless there is a specific text effect that is only supported by InlineSetting, like shadows or gradients. InlineSetting does a fraction more "work" to draw the string than the core FontSize/FontColor/FontFace etc. settings. I would be tempted to reserve InlineSetting for when I want portions of the string altered, or as I said, when InlineSetting is the only way to get a particular effect.
You do not have the required permissions to view the files attached to this post.
Yincognito
Posts: 409
Joined: February 27th, 2015, 2:38 pm

Re: [Bug]Ellipsis/Fontsize wrong when using InlineSetting

Yincognito » January 19th, 2019, 2:58 pm

jsmorley wrote:
January 19th, 2019, 2:48 pm
I think the only workaround is to use both FontSize and InlineSetting. Then FontSize will control the ellipse's, and InlineSetting will control the rest of the text.
That's a perfect solution, in my view. I wouldn't call it a workaround, but a direct solution, or better said, the way things should be done in this case from the start.
User avatar
jsmorley
Developer
Posts: 18819
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Bug]Ellipsis/Fontsize wrong when using InlineSetting

jsmorley » January 19th, 2019, 3:01 pm

Yincognito wrote:
January 19th, 2019, 2:58 pm
That's a perfect solution, in my view. I wouldn't call it a workaround, but a direct solution, or better said, the way things should be done in this case from the start.
My overarching point though, is that in his example, that makes the InlineSetting really redundant.
Yincognito
Posts: 409
Joined: February 27th, 2015, 2:38 pm

Re: [Bug]Ellipsis/Fontsize wrong when using InlineSetting

Yincognito » January 19th, 2019, 3:12 pm

jsmorley wrote:
January 19th, 2019, 3:01 pm
My overarching point though, is that in his example, that makes the InlineSetting really redundant.
Indeed, as InlineSetting is, after all, supposed to work with parts of the string, not the whole string (since other options take care of the latter anyway). But maybe he left only the InlineSetting option just for demonstration purposes (of the issue).
User avatar
jsmorley
Developer
Posts: 18819
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Bug]Ellipsis/Fontsize wrong when using InlineSetting

jsmorley » January 19th, 2019, 3:15 pm

Yincognito wrote:
January 19th, 2019, 3:12 pm
Indeed, as InlineSetting is, after all, supposed to work with parts of the string, not the whole string (since other options take care of the latter anyway). But maybe he left only the InlineSetting option just for demonstration purposes (of the issue).
I would be careful not to overstate the case, as InlineSetting is certainly useful for the entire string when an effect that isn't supported otherwise is wanted, like shadows or gradients. I would argue that it probably isn't the best choice for setting the entire string with an option that is supported by a normal string option, like FontSize and FontFace and such.
Yincognito
Posts: 409
Joined: February 27th, 2015, 2:38 pm

Re: [Bug]Ellipsis/Fontsize wrong when using InlineSetting

Yincognito » January 19th, 2019, 3:26 pm

jsmorley wrote:
January 19th, 2019, 3:15 pm
I would be careful not to overstate the case, as InlineSetting is certainly useful for the entire string when an effect that isn't supported otherwise is wanted, like shadows or gradients. I would argue that it probably isn't the best choice for setting the entire string with an option that is supported by a normal string option, like FontSize and FontFace and such.
Oh, ok - my bad, you're right.
User avatar
ikarus1969
Posts: 318
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: [Bug]Ellipsis/Fontsize wrong when using InlineSetting

ikarus1969 » January 20th, 2019, 11:11 am

Thanks for all this clarification!

I consider this as solved for now and set the topic-icon accordingly.