Improved font rendering with Direct2D

Changes made during the Rainmeter 3.0 beta cycle.
User avatar

Re: Important changes to Direct2D (D2D)

August 4th, 2013, 3:53 pm
moshi
   [1851 posts]

there still is a height for an empty string meter when using AccurateText=1 and UseD2D=1



Code: Select all

[Rainmeter]
AccurateText=1

[M1]
Meter=Image
X=0
Y=0
W=200
H=100
SolidColor=ffffff

[T1]
Meter=String
Text=""
X=10
Y=10
SolidColor=ff00ff

[T2]
Meter=String
DynamicVariables=1
X=10
Y=30
Text="[T1:W]x[T1:H]"


edit
and what is worse, there is a height and a width for an empty string meter when using AccurateText=0 and UseD2D=1
User avatar

Re: Important changes to Direct2D (D2D)

August 4th, 2013, 4:56 pm
moshi
   [1851 posts]

another thing i noticed is that ClipString=1 clips letters when using GDI+, but (often) words when using D2D (it sometimes clips letters as well, i think it does that when the last displayed word would fit, but the last displayed word+ellipsis wouldn't).



personally i think clipping letters makes more sense as space when using ClipString=1 is limited. that's my personal preference though.

but if you clip words, the ellipsis should not be directly after the last letter of the word, that's just wrong. there should be a space before the ellipsis.

Re: Important changes to Direct2D (D2D)

August 4th, 2013, 6:50 pm
poiru
Developer   [2876 posts]

moshi wrote:there still is a height for an empty string meter when using AccurateText=1 and UseD2D=1
...
edit
and what is worse, there is a height and a width for an empty string meter when using AccurateText=0 and UseD2D=1

Thanks, these have been fixed. We're going to shortly release a new beta (r2050) that will include the fix.
User avatar

Re: Important changes to Direct2D (D2D)

August 4th, 2013, 11:17 pm
moshi
   [1851 posts]

i really do not like the hard contrast when using D2D. so i tried to make some adjustments using MSs tweaking applet (cttune.exe). while this does work for every other application on my OS (Windows 7), it has no effect on Rainmeter skins.
i kinda expected this on Windows 7, is the same true for Windows 8?

so if we can't change the rendering on an OS level, could there be some user defined settings? (of course general, not skin-specific)


what i also noticed, while compatibility has been tremendously improved, even with AccurateText=1 it is not pixel-perfect.

have a look at the red indicator badge.
i think for folks like me (and i am aware that's a tiny minority) some #UseD2D# variable that can be used in conditional operations would be nice to have.
(it's not only about the metrics, but also color if the rendering can not be adjusted)
User avatar

Re: Important changes to Direct2D (D2D)

August 5th, 2013, 10:27 am
moshi
   [1851 posts]

here's another incompatibility.

have a look at the text near the image of Bart (left is GDI+, right is D2D):


this string meter uses ClipString=2 with no height defined. that doesn't work when using D2D.
i think this happens because the width is dependent of the width of a downloaded image.
W=(230-([MeterDuckImage:W]))
so while everything works fine with GDI+ i think in with D2D Rainmeter recalculates the width of the string meter when the image is downloaded (width seems to be even wrong), but not the height.

if you need an example skin, please use this one: http://moshiab.deviantart.com/art/Sphynx-367551856
and type some commands like !dictionary beer or !d Bart Simpson in the Evi command prompt.
User avatar

Re: Important changes to Direct2D (D2D)

August 5th, 2013, 2:24 pm
moshi
   [1851 posts]

something positive: flipped ʇxǝʇ ʇɐɥʇ text works much better with D2D.
User avatar

Re: Important changes to Direct2D (D2D)

August 6th, 2013, 5:19 am
iNjUST
   [118 posts]

I'm loving the progress and the potential for better quality Rainmeter-ing.

But this has some minor to devastating effects on some of my skins, especially those that are primarily text-based.

    A skin that uses ClipString with a Bottom-aligned string goes FUBAR.
    A skin that uses a fixed-width font with dynamic leading spaces to position the text also fails.
    Some angled text gets completely offset.
    Text with Center-alignment gets pushed over.

Before:


After:


I also run into issues with symbolic characters such as the degree sign creating line-spacing issues. Bolded and anti-aliased text seems to become distorted as well.
User avatar

Fixes and improvements in r2076 beta

August 12th, 2013, 4:06 pm
jsmorley
Developer   [16427 posts]

We have made quite a number of improvements to Direct2D in the latest r2076 beta. Below is a list of fixes and improvements.

  • Fixed incorrect width and/or height of the text in String meters whose height changes while the text stays the same. Reported by moshi.

  • Fixed wrong X position of the text in String meters using horizontal Center alignment. Reported by iNjUST.

  • Fixed wrong Y position of the text in String meters using horizontal Center/Bottom alignment. Reported by iNjUST.

  • Fixed that trailing no-break spaces (NBSP) or medium mathematical spaces (MMSP) are ignored by D2D. Trailing whitespace followed by either of those spaces will also now work similarly to GDI+. If you use something other than NBSP or MMSP, please let us know and we'll extend the fix to include them. Reported by iNjUST, Virginityrocks, and others.

  • Fixed greediness of ClipString=1. D2D now attempts to show as much text as possible before clipping when one line is visible. If there is more than one line visible, this issue unfortunately remains unfixed. Reported by moshi.

  • Fixed wrong start position of the text in String meters using fonts with noticeable line gaps (e.g. Gabriola). D2D now places the line gap below each line (rather than above each line) like GDI+.

  • Improved AccurateTexet=0: The height of String meters should be exactly equal between UseD2D=0 and UseD2D=1. The padding should also be equal on the left and right sides now. There may be some discrepancies in overall width, but it should always be reasonably to close to GDI+.

  • Improved consistency between GDI+ and D2D when the last characters of the text are one or more newline characters.

  • Improved text clipping with and without a TransformationMatrix (or Angle).

Re: Important changes to Direct2D (D2D)

August 12th, 2013, 4:28 pm
poiru
Developer   [2876 posts]

iNjUST wrote:But this has some minor to devastating effects on some of my skins, especially those that are primarily text-based.

Much thanks for these skins! We were able to identify and fix a number of issues thanks to them. There are still a few minor differences with some of your skins, but most of them now work just fine.

Thanks to moshi and the lot as well. Keep those reports coming! :)

iNjUST wrote:I also run into issues with symbolic characters such as the degree sign creating line-spacing issues. Bolded and anti-aliased text seems to become distorted as well.

Do you have a testcase for these?

moshi wrote:i think for folks like me (and i am aware that's a tiny minority) some #UseD2D# variable that can be used in conditional operations would be nice to have.
(it's not only about the metrics, but also color if the rendering can not be adjusted)

I think a #UseD2D# variable would cause more problems than it solves. We worked very hard this week and we are already much closer to 100% correctness. Granted, we'll never be able to actually achieve 100% due to inherent differences in GDI+ and D2D, but we're trying our best to get as close as possible.

And FWIW, I do plan to add support for customizable settings for D2D at some point.
User avatar

Re: Important changes to Direct2D (D2D)

August 12th, 2013, 6:14 pm
iNjUST
   [118 posts]

poiru wrote:
iNjUST wrote:I also run into issues with symbolic characters such as the degree sign creating line-spacing issues. Bolded and anti-aliased text seems to become distorted as well.

Do you have a testcase for these?


This is one example, a skin I'm working on. The mono-spaced text is Monkey and the thin, wide text is Walkway UltraExpand Bold.

The Core information is two strings, one is white and shows the core temperatures, the other is adjacent to it and light grey and shows the usage. Both strings are the same font using #CRLF# between lines.

These fonts are also set to BOLD and they get these weird distorted edges and artifacts.

The wider text just doesn't smooth very well under D2D as it does with GDI. It looks aliased, even though Antialias=1.
Attachments
Capture2.PNG
Capture.PNG

Return to “Rainmeter 3.0”



Who is online

Users browsing this forum: No registered users and 0 guests