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

Characters do not have the same width #19

Closed
eiszfuchs opened this issue Sep 17, 2015 · 16 comments
Closed

Characters do not have the same width #19

eiszfuchs opened this issue Sep 17, 2015 · 16 comments
Labels

Comments

@eiszfuchs
Copy link
Contributor

It might be intentional and I missed that completely, but I was trying out some colour schemes in my terminal and noticed that my text layout was off for some lines:

I noticed a similar effect with programs like top.
For comparison, this is what it looked like when I still used Input for my terminal font:

ConEmu has an option to "fix" that, actually, but this makes Iosevka look even more compressed.

This doesn't look quite nice.
Again, it might be intentional, I just wanted to be sure about that, because Iosevka was supposed to be a monospaced font, wasn't it?


PS Please don't ever change the ß character. I'm in love with it!

@be5invis
Copy link
Owner

Could you please tell me:

  • Version of Iosevka
  • Whether you are using IosevkaCC
  • The terminal application you are using
  • The text size (perhaps you are using an odd number in pixels)
  • The content in these screenshots.

It looks like that the spaces are slightly narrower than normal chracters (like m) by one pixel. I have to figure out which character is wrong, or missing, beacuse all ASCII glyphs in Iosevka are exactly 0.5em wide.

@be5invis
Copy link
Owner

@lemzwerg
Is it hinting related? Maybe ttfautohint can include a feature which preserves monospaceness.

@lemzwerg
Copy link

ttfautohint doesn't hint along the horizontal axis; it doesn't touch the horizontal metrics.

@be5invis
Copy link
Owner

@lemzwerg yeah, i know, therefore @eiszfuchs 's situation looks weird.

@lemzwerg
Copy link

Maybe a comparison of the hinted vs unhinted version using ttx gives more information. However, I don't have time to do that.

@be5invis
Copy link
Owner

@lemzwerg I need more information from @eiszfuchs .

@eiszfuchs
Copy link
Contributor Author

I'm on the go, sorry! Will provide you with more information as I sit in front of my desk again! 🙊
Am 19.09.2015 09:45 schrieb Belleve Invis notifications@github.com:@lemzwerg I need more information from @eiszfuchs .

—Reply to this email directly or view it on GitHub.

@be5invis
Copy link
Owner

@eiszfuchs Please provide me more information about the problem you encountered. It is important for me to fix Iosevka.

@eiszfuchs
Copy link
Contributor Author

Sorry it took so long!
I'm using cmder[1] v1.1.14, which is a package that includes ConEmu[2], the nicest terminal emulator you could possibly use in Windows 7 and 8.

I tried different font sizes this time, and as you can see, the problem actually does depend on it.

Font size "14"

Font size "16" (that's what I'm used to)

Font size "18"

All sizes larger than 18 seem to render just fine. 12 is an issue again, 11 renders fine (but is almost unreadable).

I've been using this script to generate the output: https://gist.github.com/eiszfuchs/587915d7d1a9372f625b
I'd post a .txt file, but GitHub replaces my escape characters.


[1] https://github.com/cmderdev/cmder/
[2] https://github.com/Maximus5/ConEmu

@be5invis
Copy link
Owner

@eiszfuchs Did you tried using the default Windows console instead of conemu? The method of adding new fonts is described here.

I think this problem may be conemu-specific because I cannot reproduce this in ConsoleZ. @Maximus5

@eiszfuchs
Copy link
Contributor Author

I'm not using the default cmd.exe for a reason. I'll check out ConsoleZ.

@be5invis
Copy link
Owner

@eiszfuchs I found what happened: The actual text size being displayed is actually 15ppem instead of 16 due to some weird unit conversion (maybe related to some metrics metadata in the OS/2 table). And Conemu miscalculated the width of spaces under 15ppem, makes it a bit shorter.

The newer version of Conemu (MUCH newer than the version included in Cmder v1.1.4) includes an option to use actual text size. You can check out the settings in the figure 3.


Figure 1. 15ppem display


Figure 2. 16ppem display


Figure 3. 16ppem settings

@Maximus5
Copy link

ConEmu creates fonts using CreateFont function.

Old versions were using only positive nHeight values which let users to specify cell height in pixels.

New versions have an option, and by default they pass negative nHeight to use "device units" and character heights.

ConEmu does not "calculate" cell widths, it queries widths from WinApi. And several fonts has problems with "positive" heights. Consolas is one of them. In fact, it's not a ConEmu problem, but the behavior of Windows fonts API.

@be5invis
Copy link
Owner

@Maximus5 The width of spaces under 15ppem is one pixel narrower than other glyphs under some odd ppems like 15ppem. Maybe related to rounding?

@Maximus5
Copy link

May be. But WinApi uses integer values for font dimensions. ConEmu do not do rounding at all.

@be5invis
Copy link
Owner

@Maximus5 Does GetTextExtendPoint returns different horizontal width for " " and "a" when the current font is Iosevka and the size is 15ppem (-15)?

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

No branches or pull requests

4 participants