{"action":"closed","issue":{"url":"https://api.github.com/repos/KyleAMathews/typefaces/issues/32","repository_url":"https://api.github.com/repos/KyleAMathews/typefaces","labels_url":"https://api.github.com/repos/KyleAMathews/typefaces/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/KyleAMathews/typefaces/issues/32/comments","events_url":"https://api.github.com/repos/KyleAMathews/typefaces/issues/32/events","html_url":"https://github.com/KyleAMathews/typefaces/issues/32","id":256330731,"number":32,"title":"how to avoid roundtrip to svr?","user":{"login":"brandonmp","id":14139991,"avatar_url":"https://avatars2.githubusercontent.com/u/14139991?v=4","gravatar_id":"","url":"https://api.github.com/users/brandonmp","html_url":"https://github.com/brandonmp","followers_url":"https://api.github.com/users/brandonmp/followers","following_url":"https://api.github.com/users/brandonmp/following{/other_user}","gists_url":"https://api.github.com/users/brandonmp/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonmp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonmp/subscriptions","organizations_url":"https://api.github.com/users/brandonmp/orgs","repos_url":"https://api.github.com/users/brandonmp/repos","events_url":"https://api.github.com/users/brandonmp/events{/privacy}","received_events_url":"https://api.github.com/users/brandonmp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-09-08T18:08:27Z","updated_at":"2017-09-11T07:42:10Z","closed_at":"2017-09-11T07:42:10Z","author_association":"NONE","body":"I was playing w/ the [Google Lighthouse extension](https://chrome.google.com/webstore/detail/lighthouse/blipmdconlkpinefehnmjammfjpmpbjk?hl=en) & I noticed the typefaces I'd added from this project were loaded in second trip to the server:\r\n\r\n![image](https://user-images.githubusercontent.com/14139991/30224993-d6da2fda-949e-11e7-97b2-4e5652448ab2.png)\r\n\r\n\r\nLooking @ [Gatsby's site ](https://www.gatsbyjs.org/) (below), it looks like fonts are loaded in the first trip.\r\n\r\n![image](https://user-images.githubusercontent.com/14139991/30225045-110e6c7a-949f-11e7-8ae6-1e94f8ccf55b.png)\r\n\r\n\r\nI'm assuming the Gatsby site uses typefaces project for fonts. Was there any special step you took to get the fonts on the first round trip?\r\n\r\n\r\n\r\nTo load the fonts, I'm simply calling them via requires in `layouts/index.js`:\r\n\r\n```\r\nrequire('typeface-lato');\r\nrequire('typeface-ubuntu');\r\n```\r\n\r\nThen, using the [gatsby-plugin-typograhy](https://www.npmjs.com/package/gatsby-plugin-typography), I just declare the fonts:\r\n\r\n```\r\nheaderFontFamily: ['Ubuntu', 'sans-serif'],\r\nbodyFontFamily: ['Lato', 'serif'],\r\n```"}}
{"actor":{"display_login":"KyleAMathews"}}