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

font size of 14px causes font descenders to be clipped #440

Closed
tvoliter opened this issue Mar 12, 2012 · 6 comments
Closed

font size of 14px causes font descenders to be clipped #440

tvoliter opened this issue Mar 12, 2012 · 6 comments

Comments

@tvoliter
Copy link
Contributor

The brackets editor font was recently changed from 15px to 14px. On Windows that causes certain characters (mostly characters with descenders like g, p, and curly braces) to be clipped.

Peter and I tested on 13px on Windows and the problem went away and the font appeared to be the same size as the 14px. We either need to conditionally set the font size on Windows to 13px with this font or change Mac and Win back to 15px.

@joelrbrandt
Copy link
Contributor

@tvoliter you might try increasing the line spacing by one pixel as well / instead. See this line:

https://github.com/adobe/brackets/blob/master/src/styles/brackets_theme_default.less#L72

J.

@peterflynn
Copy link
Member

@joelrbrandt: it's not a line-height/clipping issue. The font itself renders wrong. (I.e. at the same line-height but a bigger font, the descenders aren't cut off; and at the same size but a bigger line-height, the descenders still are cut off).

If we can change both Mac & Win to 13px I think that's the best thing to do. Since it's a fixed-pitch font, there seem to be certain size increments where the glyph width & height remain unchanged, but rendering within that box shifts slightly. Decreasing from 14px->13px -- on Win, anyway -- seems to be one of those cases where little is affected other than fixing this bug. If little changes on Mac too, that seems like the best fix.

If there's a more evident size change on Mac going to 13px, we could make the LESS OS-conditional somehow.

Another option is to add Consolas to the font-family chain, which will be present on most Windows machines and does not have this rendering issue. And since font fallback is automatic, we wouldn't have to deal with OS-conditional LESS code.

@joelrbrandt
Copy link
Contributor

@peterflynn @tvoliter Want to see if pull #443 works well in windows?

@peterflynn
Copy link
Member

@joelrbrandt: I think it looks pretty good -- a little less anti-aliased, and a little less rounded stylistically (closer to the classic Courier look, IMHO), but it definitely seems reasonable. One interesting thing is that on Mac, Ubuntu Mono looks heavier than Inconsolata, while on Win it doesn't look any heavier.

Ultimately, I still think the nicest-looking font I've tried on Windows is Consolas, though.

@joelrbrandt
Copy link
Contributor

@peterflynn please take a look at pull #457

peterflynn added a commit that referenced this issue Mar 21, 2012
Fix issue #440 (text clipping on Win); allow for platform-specific font sizes
@njx
Copy link

njx commented Mar 21, 2012

FBNC to @tvoliter

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

4 participants