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

TTFs not recognized as monospace by mintty in Cygwin #474

Closed
markuspeloquin opened this issue Nov 30, 2016 · 5 comments
Closed

TTFs not recognized as monospace by mintty in Cygwin #474

markuspeloquin opened this issue Nov 30, 2016 · 5 comments
Assignees

Comments

@markuspeloquin
Copy link

I cannot select the Roboto font for Cygwin. I found this, indicating the problem is that mintty cannot detect it as monospace:
http://superuser.com/questions/887300/how-to-install-a-font-onto-cygwin-terminal#answer-1075786

I'm not sure how mintty decides a font is monospace. I noticed that fontconfig's fc-query -f '%{spacing}' is different for RobotoMono. All fonts with values for spacing:

% for i in /c/Windows/Fonts/*.ttf; do
  spacing=$(fc-query -f '%{spacing}' $i)
  [[ -n $spacing ]] && echo "$(basename $i): $spacing"
done
consola.ttf: 100
consolab.ttf: 100
consolai.ttf: 100
consolaz.ttf: 100
cour.ttf: 100
courbd.ttf: 100
courbi.ttf: 100
couri.ttf: 100
DejaVuSansMono.ttf: 100
DejaVuSansMono_0.ttf: 100
DejaVuSansMono-Bold.ttf: 100
DejaVuSansMono-Bold_0.ttf: 100
DejaVuSansMono-BoldOblique.ttf: 100
DejaVuSansMono-BoldOblique_0.ttf: 100
DejaVuSansMono-Oblique.ttf: 100
DejaVuSansMono-Oblique_0.ttf: 100
DroidSansMono.ttf: 100
LiberationMono-Bold.ttf: 100
LiberationMono-Bold_0.ttf: 100
LiberationMono-BoldItalic.ttf: 100
LiberationMono-BoldItalic_0.ttf: 100
LiberationMono-Italic.ttf: 100
LiberationMono-Italic_0.ttf: 100
LiberationMono-Regular.ttf: 100
LiberationMono-Regular_0.ttf: 100
lucon.ttf: 100
marlett.ttf: 100
simsunb.ttf: 90
SourceCodePro-Black.ttf: 100
SourceCodePro-BlackIt.ttf: 100
SourceCodePro-Bold.ttf: 100
SourceCodePro-BoldIt.ttf: 100
SourceCodePro-ExtraLight.ttf: 100
SourceCodePro-ExtraLightIt.ttf: 100
SourceCodePro-It.ttf: 100
SourceCodePro-Light.ttf: 100
SourceCodePro-LightIt.ttf: 100
SourceCodePro-Medium.ttf: 100
SourceCodePro-MediumIt.ttf: 100
SourceCodePro-Regular.ttf: 100
SourceCodePro-Semibold.ttf: 100
SourceCodePro-SemiboldIt.ttf: 100

My guess is that the TTF contains at least one character with different spacing, so the TTF didn't get the monospace metadata.

@codeman38
Copy link

codeman38 commented Nov 30, 2016

Yep, that's exactly the issue.

Looking at just RobotoMono-Regular.ttf:

  • 1006 glyphs have an advance width of 1229 (the expected width).
  • 7 glyphs have an advance width of 0 (this is also OK).
  • 28 glyphs have some other width:
Width Count Glyphs
1106 6 acutecomb dotbelow gravecomb hook tildecomb uni030F
1259 5 Dcroat Eth dcroat hbar uni20AB
1249 4 Omegatonos Omicrontonos uni049E uni049F
1329 4 Epsilontonos Etatonos Iotatonos Upsilontonos
1230 3 f hyphen uni00AD
1379 2 dcaron lcaron
1227 1 at.alt
1269 1 tcaron
1449 1 ldot
2458 1 exclamdbl

(The letter "f" is 1 unit wider than other letters! This is definitely a bug...)

@codeman38
Copy link

Here's a slightly cleaned-up version of the script that I used to generate the above table:
https://gist.github.com/codeman38/b2aaf94fb18d688483e7bf93e436cfab

@davelab6 davelab6 added this to the Bugs in Font Files - Requires Upstream Resolution milestone Dec 6, 2016
@davelab6
Copy link
Member

davelab6 commented Dec 6, 2016

@markuspeloquin and @codeman38 thanks for reporting and triaging this issue!

@davelab6 davelab6 modified the milestones: Bugs in Font Files Requiring Hotfix, Bugs in Font Files - Requires Upstream Resolution Dec 6, 2016
@laerm0
Copy link
Contributor

laerm0 commented Dec 14, 2017

@davelab6 I can hotfix this via ttx, but then I'll be doing unknown visual things to some of the glyphs. I opened it up in Glyphs to take a look, and a handful of glyphs – i.e. dcaron – are going to be outside the bounding box. I'm just going to fix them in Glyphs so I can nudge some outlines around if necessary.

@laerm0
Copy link
Contributor

laerm0 commented Feb 26, 2020

Discussion in #1832 suggests that fixing this will be a bad idea as it will likely break other sites using Roboto. Sorry for the slow response @markuspeloquin and @codeman38: best plan appears to be a fix/fork of your own.

@laerm0 laerm0 closed this as completed Feb 26, 2020
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

Successfully merging a pull request may close this issue.

4 participants