snowie2000 / mactype

Better font rendering for Windows.
https://mactype.net
GNU General Public License v3.0
9.82k stars 439 forks source link

DirectWrite only possible #605

Open sammilucia opened 5 years ago

sammilucia commented 5 years ago

Is it possible to enable MacType for DirectWrite only? Would using FontLoader=1 do this?

snowie2000 commented 5 years ago

There is no designed way to do it, but it's possible to walkaround it with MacType's special treatment to the Directwrite: most of its options don't apply to the DW.

  1. Exclude all the fonts by adding them to the new exclude section. It's the most efficient way to accomplish it because MacType simply bypasses the rendering when it sees the font.
  2. set AntiAliasMode=-1. This makes mactype refuse to draw all the texts and fall back to GDI to draw everything. It's much simpler to do but the downside is that mactype is still involved in the rendering process and it costs some time to load and process font, although everything it does is discarded eventually.
sammilucia commented 5 years ago

Okay great! Thank you.

Could we add a DW only mode for those who want it?

My thinking is GDI will slowly be phased out .... and I'm assuming that DW simply tweaks Windows existing rendering, it doesn't use a different engine - therefore there is no performance hit - is this right?

That would mean for those who want the fastest speed possible, they could just enable MacType for DW only?

What should the exclude section look like, like this?

[Exclude]
Arial
Segoe UI
Segoe UI Semilight
Segoe UI Semibold
Tahoma
Verdana

Will it still modify DW for these fonts if they're excluded?

snowie2000 commented 5 years ago

@sammilucia If it is indeed required by many users, sure.

The format of the sample config you provided is correct. The exclusion feature doesn't work for DW, so they are still working as they should be.

sammilucia commented 5 years ago

@snowie2000 okay, thank you.

Would instead doing like this work?

[Include]
Null
snowie2000 commented 5 years ago

@snowie2000 okay, thank you.

Would instead doing like this work?

[Include]
Null

What would happen if there is a font named null🤣

sammilucia commented 5 years ago

😂

But it works the same as excluding all the fonts?

snowie2000 commented 5 years ago

If we provided a separate option to disable GDI rendering, all the GDI related hooks wouldn't be loaded at all resulting in the best possible performance.