DirectWrite Font Rendering #74

Open
CoolOppo opened this Issue Mar 17, 2015 · 32 comments

Comments

Projects
9 participants
@CoolOppo

The DirectWrite API allows for stellar font rendering. For starters, Sublime Text and Google Chrome fully support it, and Chrome actually uses it by default now!

If ConEmu implements it, the font quality will be far better than what is provided right now for all fonts.

Out of all of the (few) things that have annoyed me over the years of using ConEmu, the only feature I wanted enough to beg for request is this. Please actually consider adding it, and making it the default for ConEmu.

Thanks for everything. ConEmu is pretty great.

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Mar 19, 2015

Owner

Actually no one has yet convinced me that DirectWrite rendering is better that ClearType. There was no screenshots with comparison of drawing methods.
At the moment I think this is only prejudice.

Owner

Maximus5 commented Mar 19, 2015

Actually no one has yet convinced me that DirectWrite rendering is better that ClearType. There was no screenshots with comparison of drawing methods.
At the moment I think this is only prejudice.

@CoolOppo

This comment has been minimized.

Show comment
Hide comment
@CoolOppo

CoolOppo Mar 19, 2015

No, I've actually done comparisons. I'll make an unbiased comparison actually since there is a need for one for sure. Any requests of specific fonts or texts I should sample?

No, I've actually done comparisons. I'll make an unbiased comparison actually since there is a need for one for sure. Any requests of specific fonts or texts I should sample?

@CoolOppo

This comment has been minimized.

Show comment
Hide comment
@CoolOppo

CoolOppo Mar 19, 2015

Alright, just to kick it off, here's a comparison of GDI and DirectWrite font rendering using the font Helvetica Monospaced:

GDI

DirectWrite

Note for morons:

View the images at 100% size. I recommend opening them both, zooming to 100% (actual size), and switching back and forth between the two tabs.


Edit: here are a couple more!

GDI

DirectWrite

Alright, just to kick it off, here's a comparison of GDI and DirectWrite font rendering using the font Helvetica Monospaced:

GDI

DirectWrite

Note for morons:

View the images at 100% size. I recommend opening them both, zooming to 100% (actual size), and switching back and forth between the two tabs.


Edit: here are a couple more!

GDI

DirectWrite

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Mar 20, 2015

Owner

That is not proper comparison. I suppose these are screenshots of Sublime?
You need to compare with ConEmu. Well, I do not have "Helvetica Monospaced" files, so here is "Liberation Mono" 18. Drawbacks? Do not see them.
2015-03-20_03-10-04

Owner

Maximus5 commented Mar 20, 2015

That is not proper comparison. I suppose these are screenshots of Sublime?
You need to compare with ConEmu. Well, I do not have "Helvetica Monospaced" files, so here is "Liberation Mono" 18. Drawbacks? Do not see them.
2015-03-20_03-10-04

@CoolOppo

This comment has been minimized.

Show comment
Hide comment
@CoolOppo

CoolOppo Mar 20, 2015

Alright, I'll download that font and give it a try. I'm pretty sure that the font rendering in Sublime Text and Google Chrome are the same as ConEmu when everything has DirectWrite disabled.

Alright, I'll download that font and give it a try. I'm pretty sure that the font rendering in Sublime Text and Google Chrome are the same as ConEmu when everything has DirectWrite disabled.

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Mar 20, 2015

Owner

That is only your supposition. As I've said, proper comparison will be between DirectWrite in Sublime and ClearType in ConEmu.

Owner

Maximus5 commented Mar 20, 2015

That is only your supposition. As I've said, proper comparison will be between DirectWrite in Sublime and ClearType in ConEmu.

@CoolOppo

This comment has been minimized.

Show comment
Hide comment
@CoolOppo

CoolOppo Mar 20, 2015

Here it is:

DirectWrite (Sublime Text)

"Clear Type" Option in ConEmu Settings

Here it is:

DirectWrite (Sublime Text)

"Clear Type" Option in ConEmu Settings

@isochronous

This comment has been minimized.

Show comment
Hide comment
@isochronous

isochronous Jun 18, 2015

I'd agree from that last comparison that DirectWrite looks better than Cleartype. Didn't really have a preference for any of the other comparisons. How difficult would this be to simply add as an option, so those who prefer DirectWrite can use it, while those who don't (or just don't care) can continue using the default ClearType implementation?

I'd agree from that last comparison that DirectWrite looks better than Cleartype. Didn't really have a preference for any of the other comparisons. How difficult would this be to simply add as an option, so those who prefer DirectWrite can use it, while those who don't (or just don't care) can continue using the default ClearType implementation?

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Jun 18, 2015

Owner

Large amount of code have to be refactored. I've already done part of the job but there is much to do yet.
http://conemu.github.io/en/RoadMap.html#direct-write

Owner

Maximus5 commented Jun 18, 2015

Large amount of code have to be refactored. I've already done part of the job but there is much to do yet.
http://conemu.github.io/en/RoadMap.html#direct-write

@m0n

This comment has been minimized.

Show comment
Hide comment
@m0n

m0n Jun 26, 2015

@CoolOppo: please change/delete Your 2nd screenshot posted on Mar 20 ASAP!

It is obviously a DirectWrite rendering which is impossible to being a screenshot of ConEmu (!!!). Take a closer look (*) and You will notice that image is all grayscale - ClearType is definitely colorful, it is it's most important property (DirectWrite CAN render grayscale).

Also, no ClearType or GrayScale anti-aliasing works vertically - Your screenshot does (check '-' glyph for
example: it's consists of a brighter and a darker line)

...also replace JPGs with PNGs and delete GIFs as 256 colors can't represents today's 24-bits color depth...

I will make an app to compare different renderings/settings in a few weeks later to show You all: DirectWrite rendering's pro's is almost invisible in the usual cases we using with ConEmu (we not using extra-small fonts or 3D-transforming and we take shit on sub-pixel alignment because we using monospaced fonts).

(*) To examine pixels on Your monitor, use a magnifier app - I using SysInternal's ZoomIt: https://technet.microsoft.com/en-us/sysinternals/bb897434

m0n commented Jun 26, 2015

@CoolOppo: please change/delete Your 2nd screenshot posted on Mar 20 ASAP!

It is obviously a DirectWrite rendering which is impossible to being a screenshot of ConEmu (!!!). Take a closer look (*) and You will notice that image is all grayscale - ClearType is definitely colorful, it is it's most important property (DirectWrite CAN render grayscale).

Also, no ClearType or GrayScale anti-aliasing works vertically - Your screenshot does (check '-' glyph for
example: it's consists of a brighter and a darker line)

...also replace JPGs with PNGs and delete GIFs as 256 colors can't represents today's 24-bits color depth...

I will make an app to compare different renderings/settings in a few weeks later to show You all: DirectWrite rendering's pro's is almost invisible in the usual cases we using with ConEmu (we not using extra-small fonts or 3D-transforming and we take shit on sub-pixel alignment because we using monospaced fonts).

(*) To examine pixels on Your monitor, use a magnifier app - I using SysInternal's ZoomIt: https://technet.microsoft.com/en-us/sysinternals/bb897434

@CoolOppo

This comment has been minimized.

Show comment
Hide comment
@CoolOppo

CoolOppo Jun 26, 2015

@m0n I never posted a screenshot in this thread on Mar. 20, so I am unsure what one you're referring to. I will do my best to delete anything erroneous. Just put a link straight to the image you're asking to be deleted for me to be sure I know which one is wrong.

Additionally, I'm fairly sure that I haven't used a jpg file. If the URL links to one, it's because imgur sometimes just puts .jpg at the end of the URL that is easily copyable to the clipboard in order to ensure a direct link, but that doesn't necessarily mean that the actual file is a JPEG. Also, a GIF could very well represent these images if the color count is below 256, which is certainly possible, but I would just use a PNG anyways and optimize it losslessly anyways to be sure since that would both ensure it was unmodified and even if the bit depth only needed to be set at 8, an optimized PNG is still smaller than a GIF anyways, and I'm not doing any animation.

@m0n I never posted a screenshot in this thread on Mar. 20, so I am unsure what one you're referring to. I will do my best to delete anything erroneous. Just put a link straight to the image you're asking to be deleted for me to be sure I know which one is wrong.

Additionally, I'm fairly sure that I haven't used a jpg file. If the URL links to one, it's because imgur sometimes just puts .jpg at the end of the URL that is easily copyable to the clipboard in order to ensure a direct link, but that doesn't necessarily mean that the actual file is a JPEG. Also, a GIF could very well represent these images if the color count is below 256, which is certainly possible, but I would just use a PNG anyways and optimize it losslessly anyways to be sure since that would both ensure it was unmodified and even if the bit depth only needed to be set at 8, an optimized PNG is still smaller than a GIF anyways, and I'm not doing any animation.

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Jun 26, 2015

Owner

Trolling?

Owner

Maximus5 commented Jun 26, 2015

Trolling?

@CoolOppo

This comment has been minimized.

Show comment
Hide comment
@CoolOppo

CoolOppo Jun 27, 2015

Trolling?

Who, @m0n?

Trolling?

Who, @m0n?

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Jun 27, 2015

Owner

Yep, may be...

Owner

Maximus5 commented Jun 27, 2015

Yep, may be...

@m0n

This comment has been minimized.

Show comment
Hide comment
@m0n

m0n Jun 30, 2015

@CoolOppo: "@m0n: I never posted a screenshot in this thread on Mar. 20".

So, on my system seems like You did - here is a screenshot with my red comments to identify incorrect screenshot (I understand that You made this screenshot from Your ConEmu but facts are facts, a ClearType rendering is not gray and not works vertically):

mar20

I not trolling: I like to make things better and fix incorrect information and sometimes share my knowledge...

m0n commented Jun 30, 2015

@CoolOppo: "@m0n: I never posted a screenshot in this thread on Mar. 20".

So, on my system seems like You did - here is a screenshot with my red comments to identify incorrect screenshot (I understand that You made this screenshot from Your ConEmu but facts are facts, a ClearType rendering is not gray and not works vertically):

mar20

I not trolling: I like to make things better and fix incorrect information and sometimes share my knowledge...

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Jun 30, 2015

Owner

Second screenshot is clear-type one. From ConEmu.
BTW, clear-type have many user chosen options and obviously depends on your computer configuration. So it may differ from PC to PC...

Owner

Maximus5 commented Jun 30, 2015

Second screenshot is clear-type one. From ConEmu.
BTW, clear-type have many user chosen options and obviously depends on your computer configuration. So it may differ from PC to PC...

@isochronous

This comment has been minimized.

Show comment
Hide comment
@isochronous

isochronous Jun 30, 2015

Hahahaha whoops

On Tue, Jun 30, 2015 at 7:48 AM Maximus5 notifications@github.com wrote:

Second screenshot is clear-type one. From ConEmu.


Reply to this email directly or view it on GitHub
#74 (comment).

Hahahaha whoops

On Tue, Jun 30, 2015 at 7:48 AM Maximus5 notifications@github.com wrote:

Second screenshot is clear-type one. From ConEmu.


Reply to this email directly or view it on GitHub
#74 (comment).

@CoolOppo

This comment has been minimized.

Show comment
Hide comment
@CoolOppo

CoolOppo Jul 1, 2015

I guess that timezones are coming into play or something:

CoolOppo commented Jul 1, 2015

I guess that timezones are coming into play or something:

@mnaoumov

This comment has been minimized.

Show comment
Hide comment
@mnaoumov

mnaoumov Dec 22, 2015

I recently discovered http://www.slant.co/topics/67/~programming-fonts where http://adobe-fonts.github.io/source-code-pro/ is the winner.

I am trying to get use to it and having some issues to configure it with ConEmu. I believe it's DirectWrite issue so let's try to convince @Maximus5

Visual Studio 2015 with default settings

vs2015

Sublime Text 3 with default settings

st3

Sublime Text 3 with directwrite setting. Note it is not blurry anymore

st3-directwrite

And then ConEmu. It looks like its font sizes calculated differently. Probably it counts size in px rather than in pt. So I use size 13, as 10pt = 13px (roughly)

conemu

Note that ConEmu has the same blurry look as Sublime without DirectWrite. And ClearType settings is enabled.

Is that enough to convince @Maximus5 ? :)

I recently discovered http://www.slant.co/topics/67/~programming-fonts where http://adobe-fonts.github.io/source-code-pro/ is the winner.

I am trying to get use to it and having some issues to configure it with ConEmu. I believe it's DirectWrite issue so let's try to convince @Maximus5

Visual Studio 2015 with default settings

vs2015

Sublime Text 3 with default settings

st3

Sublime Text 3 with directwrite setting. Note it is not blurry anymore

st3-directwrite

And then ConEmu. It looks like its font sizes calculated differently. Probably it counts size in px rather than in pt. So I use size 13, as 10pt = 13px (roughly)

conemu

Note that ConEmu has the same blurry look as Sublime without DirectWrite. And ClearType settings is enabled.

Is that enough to convince @Maximus5 ? :)

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 22, 2015

Owner

I've already agreed that DirectWrite may be nice.
But! It support requires a lot of coding, especially to be able to use both techniques. Of course I will not break GDI support.
Well, I have internal branch were the work was started, but there are other urgent issues.

Owner

Maximus5 commented Dec 22, 2015

I've already agreed that DirectWrite may be nice.
But! It support requires a lot of coding, especially to be able to use both techniques. Of course I will not break GDI support.
Well, I have internal branch were the work was started, but there are other urgent issues.

@mnaoumov

This comment has been minimized.

Show comment
Hide comment
@mnaoumov

mnaoumov Dec 22, 2015

@Maximus5 can you also comment on the font sizes discrepancy?

@Maximus5 can you also comment on the font sizes discrepancy?

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 22, 2015

Owner

"Threat font height as device units". Checked - pt, unchecked - px. Complains? Perhaps to font authors or Microsoft.

Owner

Maximus5 commented Dec 22, 2015

"Threat font height as device units". Checked - pt, unchecked - px. Complains? Perhaps to font authors or Microsoft.

@mnaoumov

This comment has been minimized.

Show comment
Hide comment
@mnaoumov

mnaoumov Dec 22, 2015

@Maximus5 , sorry if it sounded like a complain. I am just curios.

For both checked and unchecked they look significantly smaller than in Visual Studio or Sublime, which makes me think that your way to calculate size is not consistent with them

conemu-px

conemu-pt

@Maximus5 , sorry if it sounded like a complain. I am just curios.

For both checked and unchecked they look significantly smaller than in Visual Studio or Sublime, which makes me think that your way to calculate size is not consistent with them

conemu-px

conemu-pt

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 22, 2015

Owner

There is also "dpi" checkbox.

Owner

Maximus5 commented Dec 22, 2015

There is also "dpi" checkbox.

@mnaoumov

This comment has been minimized.

Show comment
Hide comment
@mnaoumov

mnaoumov Dec 22, 2015

P.S. And Admit monitor dpi with font size makes no difference

P.S. And Admit monitor dpi with font size makes no difference

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 22, 2015

Owner

OK, these are not "pt", but "device units" as described in CreateFont function.

Owner

Maximus5 commented Dec 22, 2015

OK, these are not "pt", but "device units" as described in CreateFont function.

@mnaoumov

This comment has been minimized.

Show comment
Hide comment
@mnaoumov

mnaoumov Dec 22, 2015

Lodged a separate feature request #481 to address font size selector

Lodged a separate feature request #481 to address font size selector

@mnaoumov

This comment has been minimized.

Show comment
Hide comment
@mnaoumov

mnaoumov Dec 22, 2015

BTW, I raised a question for DirectWrite on Source Code Pro repo adobe-fonts/source-code-pro#116 and they advised to use TTF font instead of OTF. Now ConEmu looks great without DirectWrite

BTW, I raised a question for DirectWrite on Source Code Pro repo adobe-fonts/source-code-pro#116 and they advised to use TTF font instead of OTF. Now ConEmu looks great without DirectWrite

@JoeUX

This comment has been minimized.

Show comment
Hide comment
@JoeUX

JoeUX May 17, 2016

Hi all, I just saw this and wanted to note that DirectWrite and ClearType are not alternatives to each other. DirectWrite uses ClearType, and includes a lot of other features like OpenType typography, so it would never be one vs. the other. The choice is DirectWrite vs. GDI. This article is decent.

I'd love to see DirectWrite in ConEmu. Note that it's a bit of a moving target, as more features, APIs, and performance boosts are implemented with every major Windows release. I remember that Windows 8 saw a big bump in font rendering performance. DirectWrite is part of Direct2D, and new versions of 2D sometimes get backported to Windows 7.

JoeUX commented May 17, 2016

Hi all, I just saw this and wanted to note that DirectWrite and ClearType are not alternatives to each other. DirectWrite uses ClearType, and includes a lot of other features like OpenType typography, so it would never be one vs. the other. The choice is DirectWrite vs. GDI. This article is decent.

I'd love to see DirectWrite in ConEmu. Note that it's a bit of a moving target, as more features, APIs, and performance boosts are implemented with every major Windows release. I remember that Windows 8 saw a big bump in font rendering performance. DirectWrite is part of Direct2D, and new versions of 2D sometimes get backported to Windows 7.

@awson

This comment has been minimized.

Show comment
Hide comment
@awson

awson May 29, 2017

The greatest advantage of DirectWrite is that its high-level APIs perform automatic high-quality font fallback.

Standard Far:
plain_far
We can see that native console rendering is great, but automatic font fallback is not supported.

Far on ConEmu:
conemu_far
More glyphs are rendered but still not all of them and rendering is very poor.

DirectWrite (scite):
dwrite
All glyphs are here and the rendering is excellent (on par with native console).

I'm very interested in putting DirectWrite support in and could volunteer a bit, but I need some guidance on the ConEmu source code organization.

awson commented May 29, 2017

The greatest advantage of DirectWrite is that its high-level APIs perform automatic high-quality font fallback.

Standard Far:
plain_far
We can see that native console rendering is great, but automatic font fallback is not supported.

Far on ConEmu:
conemu_far
More glyphs are rendered but still not all of them and rendering is very poor.

DirectWrite (scite):
dwrite
All glyphs are here and the rendering is excellent (on par with native console).

I'm very interested in putting DirectWrite support in and could volunteer a bit, but I need some guidance on the ConEmu source code organization.

@mqudsi

This comment has been minimized.

Show comment
Hide comment
@mqudsi

mqudsi Sep 23, 2017

Please note that sharing screenshots is useless for clarity comparisons, and only indicative of font kerning and glyph support.

ClearType/Direct2D/DirectWrite optimize the placement of pixels for your display so naturally it makes no sense to expect output that's been customized for your display to accurately represent what you see when a screenshot of that is viewed on another person's system.

mqudsi commented Sep 23, 2017

Please note that sharing screenshots is useless for clarity comparisons, and only indicative of font kerning and glyph support.

ClearType/Direct2D/DirectWrite optimize the placement of pixels for your display so naturally it makes no sense to expect output that's been customized for your display to accurately represent what you see when a screenshot of that is viewed on another person's system.

@Maximus5 Maximus5 added this to To Do in Drawing via automation Jan 18, 2018

@BYK

This comment has been minimized.

Show comment
Hide comment
@BYK

BYK Feb 21, 2018

@Maximus5 do you have a few pointers for people who are willing to give this a shot?

BYK commented Feb 21, 2018

@Maximus5 do you have a few pointers for people who are willing to give this a shot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment