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

Move away from Source Code Pro web fonts in favour of system fonts #78

Closed
humphd opened this issue Mar 4, 2015 · 3 comments
Closed
Milestone

Comments

@humphd
Copy link

humphd commented Mar 4, 2015

Brackets loads 300K+ of (gzipped) web fonts, and switching over to using system fonts is a pretty big saving. @peterflynn wisely suggested moving away from web fonts in adobe#10680 (comment), suggesting we use a font-family of "Menlo Regular", Consolas, Inconsolata, "Vera Sans", "Lucida Console", Courier, fixed;. I did a quick test of this, and with other size optimization things we're doing, it gets us down to ~600K (gzipped), which is pretty good for a complete desktop editor, filesystem, etc.

I'm trying to decide the best way to make this switch, specifically how to do it with the least disruption to Brackets' code. The bulk of the Brackets font stuff is in https://github.com/adobe/brackets/blob/ae17456a596965a1247b79ddb82c6e1518bc6e5e/src/styles/brackets_fonts.less. However, looking around, there are a bunch of places that assume that either SourceSansPro or SourceCodePro have been defined, and therefore downloaded:

@Pomax and/or @peterflynn, what's the best way to do this for the browser case? It's too bad that all the uses of font-family: SourceSansPro; and font-family: SourceCodePro; in the less files weren't being done with variables, font-family: @SourceSansPro; or the like.

@peterflynn
Copy link

I'd say references to "SourceSansPro" should be changed to the existing LESS var @sansFontFamily, and we should introduce a similar variable for the code font -- that's an easy change to take upstream. Then the only diff your fork would have is changing the definition of those two vars.

For cleanliness you could also comment out / remove the @font-face declarations, but I'm pretty sure browsers don't start loading those unless they're referenced somewhere -- so that's probably not strictly necessary.

@Pomax
Copy link

Pomax commented Mar 5, 2015

one thing that we could also do (specifically here) is check the subsetting bits for these fonts - I suspect they're set to allow subsetting, which would allow us to run a proxy for serving the webfonts with only—say—the Latin blocks, drastically bringing down the resource sizes - the client would request "SourceSansPro.woff", and would receive a subset version instead of the large-coverage full version.

@AJDBenner
Copy link

AJDBenner added a commit to AJDBenner/brackets that referenced this issue Mar 17, 2015
AJDBenner added a commit to AJDBenner/brackets that referenced this issue Mar 17, 2015
AJDBenner added a commit to AJDBenner/brackets that referenced this issue Mar 17, 2015
AJDBenner added a commit to AJDBenner/brackets that referenced this issue Mar 17, 2015
AJDBenner added a commit to AJDBenner/brackets that referenced this issue Mar 18, 2015
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

No branches or pull requests

4 participants