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

[Bug] Unicode fonts don't draw in minihtml with GDI #1675

Closed
1 of 3 tasks
deathaxe opened this issue Apr 21, 2017 · 4 comments
Closed
1 of 3 tasks

[Bug] Unicode fonts don't draw in minihtml with GDI #1675

deathaxe opened this issue Apr 21, 2017 · 4 comments

Comments

@deathaxe
Copy link
Collaborator

Summary

During my experiments with different font options, I found GitGutter's diff popup not displaying some of the buttons anymore. After some research I found the "gdi" font option to be the reason.

Expected behavior

If GDI is still supported, it should render unicode fonts correctly.

screenshot
This screenshot was made with DirectWrite

Actual behavior

Related to jisaacks/GitGutter#313

screenshot
This screenshot was made with GDI

Steps to reproduce

  1. Set "font_options": ["gdi"],
  2. Install GitGutter
  3. Open a file within a git repository
  4. Do some modification to the file
  5. Hover the gutter area to display the diff popup

Environment

  • Operating system and version:
    • Windows 10 Pro x64 1703
    • Mac OS ...
    • Linux ...
  • Sublime Text:
    • Build 3130
@wbond
Copy link
Member

wbond commented Apr 21, 2017

This sounds like an issue with GDI and it's implementation of font fallback. I would probably suggest running direct write if you want modern font handling.

@deathaxe
Copy link
Collaborator Author

deathaxe commented Apr 21, 2017

DirectWrite is my default for months now, since it turned out to solve unicode font rendering in popups. I played with GDI last days and gave MacType a chance as it is supposed to improve font rendering on Windows.

From my point of view it doesn't at all. Fonts look horribly ugly using MacType on Windows 10 and thus quickly switched back to DirectWrite.

I only raised this issue as GDI was explicitly mentioned as font option for GUI in the changelogs of built 3130 and thus some people using it might struggle with font rendering in minihtml again.

I am totally fine with built 3130 👍

@wbond
Copy link
Member

wbond commented Apr 21, 2017

Right, I am saying that I don't believe this is a Sublime Text integration issue, but something that GDI itself can't handle. With DirectWrite we utilize Skia because it allows clipping, but in the process it doesn't deal with font fallback, so we had to implement that ourselves. GDI deals with font fallback itself, so we just use the standard public API.

If GDI is giving bad results, it is almost certainly a bug/limitation of GDI. I know lots of older GDI-related code doesn't deal well with surrogate pairs in UTF-16, and there isn't really a way around that.

In short: any limitations when running GDI are likely inherent to GDI and we probably won't be able to work around, and even if it was possible, it probably wouldn't be a good investment of time.

@deathaxe
Copy link
Collaborator Author

I recently had a look on Skia as you mentioned it in another post. It looks very interesting and seems to be a much better base for rendering GUI elements than GDI anyway. As GDI is quite old Windows stuff, whose origin reaches back to the middle of the 90's, I totally agree not to put any effort in workarounds for that old API.

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

No branches or pull requests

2 participants