White-Tiger / T-Clock

Highly configurable Windows taskbar clock
1.73k stars 169 forks source link

Use tabular figures of the font #20

Open ygoe opened 8 years ago

ygoe commented 8 years ago

Starting with Windows 8, the Segoe UI system default font has updated figures with non-fixed width. The glyph "1" is narrower than most digits, others have varying widths as well. This is especially annoying with center alignment. For this, the font includes tabular figures with fixed width. This is an OpenType feature. I don't know how this should be used from T-Clock (it's possible in MS Word, HTML and Adobe products) but I consider it necessary.

White-Tiger commented 8 years ago

well... no issues here and I'm on Win8 using Segoe UI

ygoe commented 8 years ago

Tested on a current end-user Windows 10. I could try to create a video of it.

White-Tiger commented 8 years ago

No need for a video I guess.. when I've got time, I might take a look at my Win10 (though I don't remember an issue there). I know that some fonts have this issue... eg. "Candara" has it on Win8. But as long as the default font works, I see no real need to slow down the drawing by over 100%^^ (not until T-Clock got a drawing method selection)

ygoe commented 8 years ago

Additional information: The problem does not appear with "Segoe UI" (Regular) but with "Segoe UI Semibold". I chose this font weight (of the same font family) for its increased visibility in that corner of the screen.

ygoe commented 8 years ago

This is becoming more relevant for me now because the font rendering of this version is lighter than in a previous version. Segoe UI Regular looks like Segoe UI Light now, and Semibold is more like Regular. Unfortunately, Segoe UI Bold still looks the same, which is too thick. I'm using Semibold in the old build (of the previous maintainer) and find it perfect. I may consider keeping the old build until this is fixed, even on new installations.

White-Tiger commented 8 years ago

I thought "Semibold" has this non-fixed width issue?

ygoe commented 8 years ago

Yes, and I use it with the older build. It looks thicker than the Regulat font weight which is okay because it's so small (10 pt) in the very corner of the screen. But the time and date is information I look at quite often so it should be more visible than the default font.

Now the current build* draws text lighter than before and lighter than usual so the Regular weight (which would show tabular figures) is not an option for me. Semibold is not as good as before but compared to Regular much better. Where I might have accepted 10pt Regular before, now I really need Semibold. And this has proportional figures which is distracting every few seconds.

I've done a quick test in WordPad which is relatively dumb concerning fonts. The Segoe UI font from Windows 8 has the same text width for the characters 1 and 8 repeated many times. The Semibold weight shows a clear difference. I believe that the default figures are different in both fonts. That could be the reason for this observation. A possible workaround is to copy the Semibold font and modify its default figures then save it under a different name and only use it in T-Clock. Since T-Clock mainly displays numbers anyway, always using tabular figures if the font has that option would be acceptable IMO. But please don't ask me how to do that in code. I could tell you for CSS and WPF but not GDI.

*) I can only compare build "2010" with 2.4.0 b3 because I have no closer experience with other of your versions. In the process of upgrading several computers from Windows 7 to 10 I am currently evaluating updates for all kinds of software.