Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Code Cleanup: undo temporary hacks for SourceCodePro font #1637

Open
redmunds opened this issue Sep 12, 2012 · 10 comments
Open

Code Cleanup: undo temporary hacks for SourceCodePro font #1637

redmunds opened this issue Sep 12, 2012 · 10 comments

Comments

@redmunds
Copy link
Contributor

These were merged with: #1616, #1643

Once the issues get resolved in SourceCodePro font, the we want to back out this change(s):

  1. In src/styles/brackets_codemirror_override.less, remove rules following "Temporarily override bold and italic syntax highlighting" comment.
  2. Remove: letter-spacing: -1px; (removed in update code font #1657)
  3. Not sure if we want to restore "font-size: 0.9em;" to .CodeMirror-gutter-text
@redmunds
Copy link
Contributor Author

FYI @pauldhunt

We recently updated to a new Source Code Pro font. The new font seems to support rendering italic in fixed pitch, but bold is still not supported (it renders too wide).

@pauldhunt
Copy link

These issues will have nothing to do with the fonts AFAIK, as the italic fonts do not exist yet. So I cannot imagine what is causing this behavior.

@redmunds
Copy link
Contributor Author

Since the italic and bold fonts do not exist, then the browser generates faux italic and faux bold fonts. Unfortunately, the faux bold font is wider than the normal (fixed pitch) font, so we can't use it.

So, we could use the italic and bold fonts for Source Code Pro. Are there any plans to create these?

@pauldhunt
Copy link

The bold font does exisit, but again the bold italic will not. I have started development on the italic fonts, but without any formal request from an internal customer at Adobe, these are on my back, back burner.

@pauldhunt
Copy link

BTW, all the weights of the Source Code Pro family share the exact same letter widths, so I believe that it is highly unlikely that the behavior you are noticing with the Bold rendering wider would not be a font issue. Is it possible that some other variable (CSS tracking?) is causing this issue?

@redmunds
Copy link
Contributor Author

I put together some test pages and sent them to @pauldhunt directly. The SourceCodePro font delivered for Edge Web Fonts behaves correctly, but the SourceCodePro font we are currently shipping with Brackets shows the behavior that I described.

@pauldhunt
Copy link

My best guess is that the fonts you are getting from Edge Web Fonts are actually the Regular and Bold properly style linked. So, the document actually fetches the Regular, from which the italic style is fauxed, and the Bold is fetched, from which the bold italic style is fauxed. The simulated italic algorithm seems not to affect the glyph widths.

However, In your test file you sent me that refers to local fonts, only the Regular weight is being referenced, therefore all other styles are being fauxed from the Regular font. It seems that the emboldening algorithm distorts the widths of the glyphs, therefore the simulated bold and bold italic styles are both wider than the Regular and Italic.

You can observe these effects yourself if you enlarge the font size as far as possible for both test documents and then compare the resulting bolds. You will notice that the simulated bold and bold italic styles are not as heavy and do not feature as much contrast as the actual Bold style that gets fetched from Edge Web Fonts. To remedy this situation, you will need to ensure that your CSS refers to the existing Bold font so that a faux bold is not produced.

@redmunds
Copy link
Contributor Author

Thanks! The other font file is named SourceCodePro-Medium.ttf so I didn't realize that was the bold font.

@pauldhunt
Copy link

The Medium is not the Bold font, the Medium is meant to replace the Regular, AFAIK. The Bold will then have to be linked to the Medium via CSS.

@redmunds
Copy link
Contributor Author

Ah, we're using Regular for Windows and Medium for Mac. SourceCodePro-Regular.ttf and SourceCodePro-Medium.ttf are the only font files we have. Where can I find the bold font?

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

No branches or pull requests

2 participants