It is currently March 28th, 2024, 7:06 pm

Improved font rendering with Direct2D

Changes made during the Rainmeter 3.0 beta cycle.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: Important changes to Direct2D (D2D)

Post by moshi »

poiru wrote: And FWIW, I do plan to add support for customizable settings for D2D at some point.
cool, i sure hope so. because i really dislike how it looks now.
Untitled-2.png
D2D (above) looks like it is demi-bold (it is normal) and look at the bottom curves (terminals) of t and l. or just look at all curves. the high contrast almost makes them squares.

Windows 8's default fonts sure are optimized for D2D. I wouldn't expect a type foundry to waste resources on that though. there aren't too many professionals (the people that pay for fonts) that use Windows or Windows 8 in particular.
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Improved font rendering with Direct2D

Post by jsmorley »

I think this may have something to do with your display, as I don't get the kind of results you do. While it is true that the fonts in D2D have a someone more "bold" look to them than in GDI+, that is mostly because the fonts in GDI+ are really washed out and terrible looking.

At normal zoom, FontSize=14, D2D at the top.
2.jpg
Zoomed in with PhotoShop to show the antialiasing that is done.
1.jpg
The antialias is not even consistent with two of the same letters next to each other. At least on my system, GDI+ has always just been terrible unless I added StringStyle=Bold to get rid of the artifacts and fuzziness that GDI+ caused.

It is even worse at smaller font sizes.

D2D:
3.jpg
GDI+
4.jpg
GDI+ is so washed out it is almost unreadable for me unless I bold the meters.

If you have a display that does a better job with GDI+, then more power to you for sure. However, I suspect that most folks have a standard computer monitor.

Too each his own of course. I'm all for giving as much flexibility as possible, but I won't ever agree with throwing out the baby with the bathwater here, given that we only have one person so far who has ever said anything but that D2D is of far superior quality on their system.
You do not have the required permissions to view the files attached to this post.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: Improved font rendering with Direct2D

Post by moshi »

i think it has more to do with fonts used and the operating system used.

of course if GDI+ looks that horrible on Windows 8 there had to be something done about that. and the job you guys did on compatibility is tremendous. you could just have made a clean cut and nobody would have had a right to complain about that.

but do me a favor:
the skin you use in your example seems to use normal as StringStyle. it does look like demi-bold though. can you compare that with typing the same text with the same font and size in Notepad or any other Windows application? does it still look right?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Improved font rendering with Direct2D

Post by jsmorley »

moshi wrote:i think it has more to do with fonts used and the operating system used.

of course if GDI+ looks that horrible on Windows 8 there had to be something done about that. and the job you guys did on compatibility is tremendous. you could just have made a clean cut and nobody would have had a right to complain about that.

but do me a favor:
the skin you use in your example seems to use normal as StringStyle. it does look like demi-bold though. can you compare that with typing the same text with the same font and size in Notepad or any other Windows application? does it still look right?
You are QUITE right that GDI+ looks orders of magnitude worse in Win8 than it did in Win7, and I should have kept that in mind when making comparisons. However, as much trouble as Win8 is having gaining traction right now, I think we have to use the most current version of Windows as the baseline.

As to D2D in Windows apps, it looks good to me on Win8.
11.jpg
12.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: Improved font rendering with Direct2D

Post by moshi »

what i meant (sorry for bad English) was: does Rainmeter's font rendering still look right when you compare it with the OS font rendering?

at least for me your Notepad example looks right (normal), while the Rainmeter one does not (demi-bold and much too high contrast). the only thing using D2D i can compare it here on Windows 7 is Internet Explorer 10, and i have too say there is room for improvement in how Rainmeter with D2D looks now.
you might also have noticed while zooming that Rainmeter's font smoothing seems to be monochrome. not so in your text editor.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Improved font rendering with Direct2D

Post by jsmorley »

moshi wrote:what i meant (sorry for bad English) was: does Rainmeter's font rendering still look right when you compare it with the OS font rendering?

at least for me your Notepad example looks right (normal), while the Rainmeter one does not (demi-bold and much too high contrast). the only thing using D2D i can compare it here on Windows 7 is Internet Explorer 10, and i have too say there is room for improvement in how Rainmeter with D2D looks now.
you might also have noticed while zooming that Rainmeter's font smoothing with D2D seems to be monochrome. not so in your text editor.
I'm not sure I can get to an apples and apples situation with Rainmeter and a word processing program like LibraOffice. You are right though that in the Windows app, the antialiasing takes advantage of color as a part of the effect. Not sure that it is something we can even do in an app like Rainmeter that does things a bit more as "graphics" (even strings) than a normal Windows app might... Worth looking into.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Improved font rendering with Direct2D

Post by jsmorley »

Rainmeter zoomed in:
2.jpg
You do not have the required permissions to view the files attached to this post.
prince1142003
Posts: 56
Joined: December 27th, 2011, 12:32 pm

Re: Improved font rendering with Direct2D

Post by prince1142003 »

Wasn't sure if this deserved a separate thread. Just noticed that with D2D rendering, AA on resized images is a lot poorer than with GDI+. Look at the antennae portion of the images.
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Improved font rendering with Direct2D

Post by jsmorley »

prince1142003 wrote:Wasn't sure if this deserved a separate thread. Just noticed that with D2D rendering, AA on resized images is a lot poorer than with GDI+. Look at the antennae portion of the images.
I don't see any such effect. Can you post the skin and the full image you used?
prince1142003
Posts: 56
Joined: December 27th, 2011, 12:32 pm

Re: Improved font rendering with Direct2D

Post by prince1142003 »

Ignore my last post. Something's wrong with my skin... I just copied over the single image meter to a blank skin and the issue doesn't appear.

Edit:
Was able to duplicate it. Seems the issue is due to the use of a string meter for a background behind the image meter. If meter BG is changed to an image meter instead of string, the AA works correctly.

Code: Select all

[Rainmeter]
Author=J. Guin
Blur=1
AccurateText=1
Update=10

[Metadata]
Author=J.Guin
License=Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
Version=1.0
Name=AA Test

[Variables]
PanelH=140
PanelW=232
ShadowSize=9

[mBingParser]
Measure=Plugin
Plugin=Webparser
Url=http://www.bing.com
RegExp="(?siU)class="hpcBkP".*<p>(.*)</p>.*g_img={url:'(.*)_1366.*'"
FinishAction=[!EnableMeasure mBingImage][!CommandMeasure mBingImage Update]
UpdateRate=1800
UpdateDivider=100

[mBingImageUrl]
Measure=Plugin
Plugin=Webparser
Url=[mBingParser]
StringIndex=2
Disabled=1
UpdateRate=-1

[mBingImage]
Measure=Plugin
Plugin=Webparser
Url=http://www.bing.com[&mBingImageUrl]_1366x768.jpg
Download=1
Disabled=1
UpdateRate=-1
DynamicVariables=1
FinishAction=[!UpdateMeter BingImage][!Redraw]

[BG_Shadow]
Meter=Image
H=(#PanelH#+2*#ShadowSize#)
W=(#PanelW#+2*#ShadowSize#)
ImageName=#@#Images\Layout\BG_Shadow.png
ScaleMargins=#ShadowSize#,#ShadowSize#,(#ShadowSize#+1),(#ShadowSize#+1)
ImageAlpha=110
SolidColor=255,0,0,128
DynamicVariables=1
UpdateDivider=100
Group=PanelBG

[BG]
Meter=String
H=#PanelH#
W=#PanelW#
X=#ShadowSize#
Y=#ShadowSize#
SolidColor=0,0,0,110
DynamicVariables=1
UpdateDivider=100
Group=PanelBG

[BingImage]
Meter=Image
MeasureName=mBingImage
X=#ShadowSize#
Y=#ShadowSize#
W=(#PanelW#)
H=(#PanelH#)
AntiAlias=1
PreserveAspectRatio=2
DynamicVariables=1
UpdateDivider=100