Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DirectWrite support with selection of hinting mode #430

Closed
GoogleCodeExporter opened this issue Jun 4, 2015 · 38 comments
Closed

DirectWrite support with selection of hinting mode #430

GoogleCodeExporter opened this issue Jun 4, 2015 · 38 comments

Comments

@GoogleCodeExporter
Copy link

Will be nice to have DirectWrite support, whiche give possibilty to select font 
hinting. This give fonts (mostly non-windows native) better feel.

Original issue reported on code.google.com by nsho...@gmail.com on 11 Jun 2014 at 9:38

@GoogleCodeExporter
Copy link
Author

This is something that would really improve the feel of the terminal. 
DirectWrite is a freaking miracle! Just check out this comparison I threw 
together:

DirectWrite off:
http://i.imgur.com/gWrhB1Z.png

DirectWrite on:
http://i.imgur.com/eZefJJh.png

Original comment by xxCoolOp...@gmail.com on 3 Aug 2014 at 10:16

@gcollombet
Copy link

I'll try to do it!

@mintty
Copy link
Owner

mintty commented Aug 4, 2015

Great proposal! I had checked myself and found the API to be so specific that someone enthusiastic about this issue is needed to do it...
How does this actually relate to #438? Is that part of DirectWrite or something different; could it be combined or is it an alternative?

@gcollombet
Copy link

Ok, I'll take a look too

@mintty
Copy link
Owner

mintty commented Jul 14, 2016

I'd rather use Uniscribe which does not seem to have an API as insane as DirectWrite and may be supporting sufficient rendering features.

@mintty
Copy link
Owner

mintty commented Dec 4, 2016

Released Uniscribe support in 2.7.1.
I don't think DirectWrite would now still bring much value-add, so I'm closing this issue.

@mintty mintty closed this as completed Dec 4, 2016
@fcharlie
Copy link

fcharlie commented Jun 10, 2017

@mintty is Uniscribe Support more Emoji or Color Font ?

On Windows 10 1607 ,DirectWrite Support color fonts and more font set
https://msdn.microsoft.com/en-us/library/windows/desktop/hh802480(v=vs.85).aspx

emoji

@mintty
Copy link
Owner

mintty commented Jun 10, 2017

Not sure what you mean. Emojis are displayed if they are included in your font, or in a fallback font that Windows finds via Uniscribe. I don't think Uniscribe supports colour fonts.

@fcharlie
Copy link

@mintty I suggest mintty use DirectWrite.
Windows console is planning to use Directwrite to render its font

microsoft/WSL#75 (comment)

@mintty
Copy link
Owner

mintty commented Jun 10, 2017

Which benefit would DirectWrite have that Uniscribe cannot offer (other than fancy colour icons which are not really a traditional terminal feature)?

@nelix
Copy link

nelix commented Sep 5, 2017

Ligatures and a more user friendly experience when trying to do things like powerline...
Windows is always a huge edge case for people who make fonts or terminal apps/themes, most editors and browsers are using directwrite, there is no terminal on windows besides those based on Electron (... lots of memory) that support these things...

@mintty
Copy link
Owner

mintty commented Sep 5, 2017

@nelix, you are addressing quite different issues; for DirectWrite, my previous question still remains unanswered; ligature support could be added without it if only I knew how to get at the font ligature information; and powerline is a completely different thing, it's about character width handling and has been discussed elsewhere.

@mintty
Copy link
Owner

mintty commented Jan 23, 2018

@fcharlie: The current repository upload provides full emoji support.

@fcharlie
Copy link

@mintty Good news, once I have the time, I'll test it.

@fcharlie
Copy link

fcharlie commented Jan 23, 2018

No matter what font I use, the four-byte Emoji display is not normal.

image

Update I checked the wiki, and when I had time I would test it again.

Can you add emoji support to wsltty without downloading emoji fonts ? Thanks.

@mintty
Copy link
Owner

mintty commented Jan 24, 2018

Please check the wiki/Tips.md file from the repository for advice how to deploy actual emoji data.
It's not yet online (because it describes unreleased features). I could place it online with a note if needed.
The screenshot does not exhibit the new emoji feature, it just displays emoji symbols from the font.

@mintty
Copy link
Owner

mintty commented Jan 24, 2018

mintty-emojis

@fcharlie
Copy link

@mintty Good. That little flag looks wider than the others?

@mintty
Copy link
Owner

mintty commented Jan 24, 2018

The width of an emoji is determined by the defined widths of its component characters, so it may actually have any width between 1 and 8 character cells. Also depends on option Charwidth=unicode.

@mintty
Copy link
Owner

mintty commented Jan 24, 2018

To tweak the resulting stretching effect, there is also option EmojiPlacement.

@fcharlie
Copy link

@mintty Thanks.

@mintty
Copy link
Owner

mintty commented Jan 24, 2018

@fcharlie, do you have an idea where the actual emoji data are stored in Windows?
If they are available as a resource, mintty could support at least Windows-style emojis out-of-the-box, without any additional deployment.

@fcharlie
Copy link

fcharlie commented Jan 24, 2018

@mintty Sorry, I don't known. But You can set the Emoji font to Segoe UI. But the GDI rendering Emoji has no Direct2D effect. Direct2D support D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT (Windows 10 Creators Update or Later).

Right Direct2D:

image

That's why I suggest you use direct2d rendering.

Krycekium VS DiegoInstaller

@fcharlie
Copy link

fcharlie commented Jan 24, 2018

It looks blurry when the font size is small, and it has a bit of delay (or Resize) (emojione 128x128 px)
capture20180124221857838

capture20180124221907842

35336625-f3869912-0153-11e8-8ca5-50b07382b248

@mintty
Copy link
Owner

mintty commented Jan 24, 2018

At small sizes, everything will eventually look blurry...
Emoji display is delayed and slow, I don't know why...

@mintty
Copy link
Owner

mintty commented Jan 24, 2018

How about echo -e '\U1F604' for a more intuitive test case?

@fcharlie
Copy link

The same echo -e '\U1F604' display is delayed. PNG emoji scaling without SVG or font effect。

@mintty
Copy link
Owner

mintty commented Jan 25, 2018

The echo format was just about the test case to write the same output.
Yes, emoji graphics are used in pixel format (png, jpg or gif would work too);
the MS API does not support loading SVG. Also most actual emoji data repositories provide PNG, not SVG.

@fcharlie
Copy link

SVG Support Windows 10 Creators Update or Later and Direct2D only

@mintty
Copy link
Owner

mintty commented Jan 25, 2018

Mintty currently displays emojis using image functions, not via a font.
See GdipLoadImageFromStream and GdipLoadImageFromFile in winimg.c.
I can check again whether those accept SVG now, so it could be used.

@mintty
Copy link
Owner

mintty commented Feb 6, 2018

Released 2.8.4 with full emoji support.

@pandasauce
Copy link

As I switched from Ubuntu/Terminator to Windows/ConEmu to Windows/mintty I kept wondering why the rendering looked off in mintty. Then I discovered that mintty supports both GDI and Uniscribe, but not DirectWrite, which would explain why it renders text so differently compared to other software. Same font sizes are rendered differently and letter spacing in particular looks odd.

@mintty
Copy link
Owner

mintty commented Nov 25, 2019

Fixed-width display of characters is even by the nature of a cell-based terminal, not odd :)
No idea how to interpret this fuzzy comment.

@pandasauce
Copy link

Actually, this might have something to do with size calculation. It's almost as if mintty uses smaller cells than glyph size from the settings and it squishes the characters together a bit to compensate - does this make any sense?

I will have to play around with this a bit once I have the time. ConEmu calculates sizes differently (try setting 18 there and in mintty) so it might just be that the equivalent of 18 in ConEmu is something like 13.4 in mintty, which can't be set anywhere outside of Sublime Text as far as I know.

@mintty
Copy link
Owner

mintty commented Nov 26, 2019

Mintty does not "squish" characters. Unless you use option ColSpacing, the font is configured to use the full cell width. Row width may be adjusted according to font information ("internal leading") which is a typographic advice that mintty properly follows.
The size comparison sounds like ConEmu uses pixel size while mintty uses point size (or "logical coordinate units" in Windows terms). Point size makes more sense as it scales with DPI.

@mintty
Copy link
Owner

mintty commented Sep 21, 2021

Missing the point of your comment (please clarify your intent), let me note this:
Noto Color Emoji cannot be installed in Windows as a font, so how is its usage supposed to work?
DirectWrite is an utterly complex API (as is Uniscribe already). If you can demonstrate easy-to-use functions to render emojis from Emoji fonts, I'll gladly integrate them into mintty.

@mintty
Copy link
Owner

mintty commented Sep 22, 2021

... which failed to install for me too, a while ago; and I'm certainly not going to open something as suspicicious as a "Telegram link".

@mintty
Copy link
Owner

mintty commented Sep 23, 2021

OK, that font is installed already (had forgotten); the problem is a failed Windows design decision, at the cost of developers. When they introduced color fonts, they should have been made available for all font APIs but rather they are only available with the by far most complex of those APIs, which does not foster the usage of color fonts.

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

No branches or pull requests

6 participants