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

195 added all Stanford approved fonts #248

Merged
merged 23 commits into from
Nov 2, 2018
Merged

195 added all Stanford approved fonts #248

merged 23 commits into from
Nov 2, 2018

Conversation

josephgknox
Copy link

@josephgknox josephgknox commented Oct 31, 2018

READY FOR REVIEW

Summary

  • Added all Stanford approved fonts (cleaned up files, etc. of existing fonts, too)

Needed By (Date)

  • End of week

Urgency

  • N/A

Steps to Test

  1. Pull this branch
  2. Compile styleguide (grunt styleguide)
  3. Verify that all fonts and style variations are rendering

Affected Projects or Products

  • Decanter

Associated Issues and/or People

See Also

@@ -300,139 +300,181 @@ template {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the fonts rendered for me in the compiled styleguide with no issues - looks great.

I was scrolling down the diff page on github and saw the file size differences below of fonts removed. For the same font variant, eg:
BIN -91.6 KB core/fonts/crimsontext-bold-webfont.ttf
BIN -41.3 KB core/fonts/crimsontext-bold-webfont.woff

Looks like the woff format in general is about half of that of ttf files. Would that be a reason to keep the woff files instead of the ttf ones?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find! This encouraged me to do a little more looking into the file extensions. WOFF is basically OTF or TTF with metadata and compression supported by all major browsers. Because the fonts are compressed, they load faster. This indeed is a reason to use WOFF over TTF. I'll compress the files and upload the new versions.

<h5>{{ heading }} 5</h5>
<h6>{{ heading }} 6</h6>
{{ paragraph }}
<p class="su-font-lead">Roboto Slab is a secondary font and should be used as a display font.</p>
<h3>Style Variations</h3>
<div style="font-weight: 100; font-style: normal;">Thin</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there are only 3 font-weights for Roboto Slab in Figma (no "thin" variant) so perhaps Figma needs to be updated or do we need the "thin" variant for Decanter?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've verified with the designers that they DO NOT want the thin variation to be included. Good eye! I'll remove this variation file and font call.

core/templates/core/fonts/fonts.twig Outdated Show resolved Hide resolved
core/templates/core/fonts/fonts.twig Outdated Show resolved Hide resolved
core/templates/core/fonts/fonts.twig Outdated Show resolved Hide resolved
@@ -300,139 +300,187 @@ template {

Copy link
Collaborator

@JBCSU JBCSU Oct 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scott and John would prefer to load all fonts that are available on Google from Google. We should only be hosting fonts that aren't available from Google.

An open question is where / how to host them. If we just bundle them into Decanter, then people building sites on Decanter will have to deploy them to every site. I think it would be better to host them on Stanford's homesite (more specifically, the S3 bucket that serves many of homesite's assets), and have all Decanter-based sites refer to a single source.

I've put Stanford's ligature font (for the wordmark) in https://www-media.stanford.edu/assets/fonts/Stanford.woff & https://www-media.stanford.edu/assets/fonts/Stanford.ttf . If you could tell me what fonts aren't available from Google, I'll put them in the same directory. Then you can update Decanter to load them from there.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the fonts pictured below are now available in https://www-media.stanford.edu/assets/fonts/ :

fonts available on homesite

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, JB!

@josephgknox josephgknox changed the title added all Stanford approved fonts 195 added all Stanford approved fonts Oct 31, 2018
core/css/decanter.css Outdated Show resolved Hide resolved
@JBCSU
Copy link
Collaborator

JBCSU commented Nov 2, 2018

When I pull this branch, do grunt styleguide, and load up the style guide, I get the following error in my console:

Access to Font at 'https://www-media.stanford.edu/assets/fonts/stanford.woff'
from origin 'http://decanter.local' has been blocked by CORS policy: No
'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://decanter.local' is therefore not allowed access.

I do not get that error for any of the other fonts hosted in https://www-media.stanford.edu/assets/fonts/ . I believe the stanford.woff is loading in the style guide in order to render the brand bar. Are any of the other fonts currently used in the styleguide? If not, I suspect we'll get this same error when we start documenting those.

@sherakama What do we do about this? It's possible that it won't be an issue for actual sites built with decanter, so long as their url is of the form subdomain.stanford.edu . Then they'll be the same domain and shouldn't be affected by CORS.

@sherakama
Copy link
Member

At first look, I am not sure why this is popping up. We are pulling font files from Google with the same Referrer policies. The heading I am seeing being sent is no-referrer-when-downgrade which is the default one when no policy is in place. I see that in Google's response of their font they sent back the header access-control-allow-origin: *. My guess is that the policy header needs to be set on www-media.stanford.edu

@sherakama
Copy link
Member

@sherakama
Copy link
Member

sherakama commented Nov 2, 2018

Also, is www-media.stanford.edu an AWS S3 Bucket?

@@ -87,6 +87,10 @@ dfn {
@include slab;
}

.su-script {
@include script;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a bit of checking and I cannot find anything that would say that script is a reserved language keyword. As this may be confused with scripting files perhaps we could come up with a slightly different name?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to handwriting.

@@ -26,6 +25,10 @@
font-family: $font-slab;
}

.su-script & {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this missing something after the &?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. It's in place so that it wraps the declaration before it.

border-bottom: none;
font-weight: $font-bold;
}
font-family: $font-sans;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooo thank you for cleaning this up. This was bugging me.

@sherakama sherakama merged commit fecbbe4 into master Nov 2, 2018
@sherakama sherakama deleted the 195-fonts branch November 2, 2018 18:21
JBCSU added a commit that referenced this pull request Nov 2, 2018
* master:
  122 hero (#259)
  195 added all Stanford approved fonts (#248)
  change class for logo to match new naming conventions. (#257)

# Conflicts:
#	core/css/decanter.css - regenerated using mine
#	core/scss/utilities/mixins/typography/_font-lead.scss - resolved using mine
#	core/scss/utilities/mixins/typography/_h6.scss - deleted
yvonnetangsu added a commit that referenced this pull request Nov 2, 2018
* master:
  reversed order of modular scale type mixin (#260)
  122 hero (#259)
  195 added all Stanford approved fonts (#248)
  change class for logo to match new naming conventions. (#257)
yvonnetangsu added a commit that referenced this pull request Nov 2, 2018
* master:
  reversed order of modular scale type mixin (#260)
  122 hero (#259)
  195 added all Stanford approved fonts (#248)
  change class for logo to match new naming conventions. (#257)
  px to rem (#256)
  219 Modular typography (#250)
  fixup! wip. (#255)
  79 card (#241)
  make color change on hover & focus less abrupt (#253)
yvonnetangsu added a commit that referenced this pull request Nov 7, 2018
* master:
  216 Create site search component (#262)
  266: Update scss file to reference logo.twig and update twig file to … (#267)
  246 homepage (#258)
  reversed order of modular scale type mixin (#260)
  122 hero (#259)
  195 added all Stanford approved fonts (#248)
  change class for logo to match new naming conventions. (#257)
  px to rem (#256)
  219 Modular typography (#250)
  fixup! wip. (#255)
  79 card (#241)
  make color change on hover & focus less abrupt (#253)
  249: Change CTA icon to a variable (#251)
  223 brand bar (#243)

# Conflicts:
#	core/css/decanter.css
#	core/scss/components/index.scss
#	core/templates/components/logo/logo.twig
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 this pull request may close these issues.

4 participants