-
Notifications
You must be signed in to change notification settings - Fork 194
Customize fonts/change fonts. #120
Comments
For this theme, you will need to define your styles in |
Thanks a ton! I will try this.
And, great theme by the way!!
Samuel Workman, Ph.D.
Associate Professor
Department of Political Science
University of Oklahoma
…________________________________
From: Patrick Collins <notifications@github.com>
Sent: Tuesday, March 3, 2020 5:07:59 PM
To: pacollins/hugo-future-imperfect-slim <hugo-future-imperfect-slim@noreply.github.com>
Cc: Workman, Samuel G. <samuel.workman@ou.edu>; Author <author@noreply.github.com>
Subject: Re: [pacollins/hugo-future-imperfect-slim] Customize fonts/change fonts. (#120)
For this theme, you will need to define your styles in assets/css/add-on.css Then in the config for cssFiles you could use ["default","LINK-TO-CDN"] if you wanted CDN, or a direct link to the file in static/css - though I am not sure how font load order works. You might try flipping to `["LINK-TO-FONT", "default"]. This should put your font above the rest of the style files.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_pacollins_hugo-2Dfuture-2Dimperfect-2Dslim_issues_120-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAGLHCN6RJKUHSUI3PULUWW3RFWEU7A5CNFSM4LAPBT6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENVQY7Y-23issuecomment-2D594218111&d=DwMCaQ&c=qKdtBuuu6dQK9MsRUVJ2DPXW6oayO8fu4TfEHS8sGNk&r=5BzcMRzE9NzLnUcEC4czjuIjuNBmvrFf6Zhv29For-c&m=H_VuL6y1oBAMtBCfde-BzAKTzKGPE6RgTd_TSUWzHb0&s=I1eZlWFm8yNL2MYHWDi10yLW7B6beU6GSk2DldwJMIE&e=>, or unsubscribe<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AGLHCN3G4ZK4F5JJCLM2G23RFWEU7ANCNFSM4LAPBT6A&d=DwMCaQ&c=qKdtBuuu6dQK9MsRUVJ2DPXW6oayO8fu4TfEHS8sGNk&r=5BzcMRzE9NzLnUcEC4czjuIjuNBmvrFf6Zhv29For-c&m=H_VuL6y1oBAMtBCfde-BzAKTzKGPE6RgTd_TSUWzHb0&s=g8qQqiMkw7plFBF9EDDj6PJTH_8GWN_Dxg_pJ9oJUx4&e=>.
|
I have now tried these methods above with no success. I modified 'add-on.css' as follows: /* /* philosopher-regular - latin / body { The documentation for I then got rid of this code, and cleaned everything up and simply added `h1{ body { Which I think should have altered the colors of the h1 headings and the background (though css isn't my wheelhouse). And again, nothing changes. I'm wondering if the config, is actually referencing I also included multiple versions of the relative path, including placing the font files in I'll keep working on it. |
After a pretty long week, I have finally found the solution. The following worked for me:
This worked for me. I notice that the html points at I may do a bit more work to see if altering the partials to reflect this makes Sorry for the long post, but I'm particularly about fonts and others may be as well. |
@SamuelWorkman your instructions were indeed helpful. I'm trying to achieve exactly the same goal. Can you please post a snippet of your
on Firefox (>40):
|
The actual issue, now that I have had time to look, is that the directory of
Both of these lines are calling |
Hi Patrick, Thanks for finding the time to look into this. The work-around I described above worked for me. I'll give your fix a try in the next day or so. I had a hunch that the issue was something like that given all my trial-and-error. I just wasn't savvy enough in CSS/HTML to fix it (I modified those paths several times but pointed them at the wrong folder.) BTW, if you need examples of the site in operation, check out samuelworkman.org. Thanks again! Once I test your solution, I'll comment back and maybe we can close this issue. |
@rfc2119 try Patrick's solution first. Would rather have a solution for you that is "in-theme". I have a hunch that you may not have the appropriate webfont files - get the from google webfont helper, rather than the google fonts page. The helper provides files that are adapted to all platforms as best possible. You have to copy ALL of the files it gives you into the fonts directory you are using. You can see my css by going over to SamuelWorkman/samuelworkman and taking a look in
|
@rfc2119 and @SamuelWorkman - When you both have the chance, can you try my simple fix and ensure it is working, then comment on the PR? Thanks! |
Thanks, that fixed it! I left a comment on the PR. Kudos to @SamuelWorkman for opening the issue and persisting till the end 👍 One thing before we close this issue: I wanted to include some language-specific CSS or HTML, namely the direction property for CSS or the dir HTML attribute. This is because my language is written right to left (rtl). Within EDITED: if the PR isn't merged yet, @SamuelWorkman don't forget to checkout the fix branch first: |
Pull request #123 fixes this bug. Issue is now closed. |
@rfc2119 Go ahead and open another issue. I am wondering if we could do this with i18n for your particular language. |
I really love the revamp and am keen on building my site with the theme. I am a statistician, and so require a lot of different types of fonts for various things I'd like to post on my blog.
I have been unable to change the default fonts in any of the ways that seem prescribed for hugo themes generally or for the older hugo-future-imperfect theme. I was wondering if someone could provide me with a general course of action. No matter which approach I use, it seems the theme overrides my choices to return to the default fonts. Here is what I've tried so far:
/* fira-sans-regular - latin /
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 400;
src: url('../fonts/fira-sans-v10-latin-regular.eot'); / IE9 Compat Modes /
src: local('Fira Sans Regular'), local('FiraSans-Regular'),
url('../fonts/fira-sans-v10-latin-regular.eot?#iefix') format('embedded-opentype'), / IE6-IE8 /
url('../fonts/fira-sans-v10-latin-regular.woff2') format('woff2'), / Super Modern Browsers /
url('../fonts/fira-sans-v10-latin-regular.woff') format('woff'), / Modern Browsers /
url('../fonts/fira-sans-v10-latin-regular.ttf') format('truetype'), / Safari, Android, iOS /
url('../fonts/fira-sans-v10-latin-regular.svg#FiraSans') format('svg'); / Legacy iOS */
}
body {
font-family: 'Fira Sans', sans-serif;
}
I have also tried change the font specifications in main.scss in the theme.
I have NOT changed any of the html, if that matters - if so, would I need to adjust in-theme or only at my project root?
Neither seem to alter the fonts. I am on a Windows 10 machine, if that matters. No error messages or anything associated with the code, it just doesn't change anything. Sorry if I am missing something, but would really love to use the theme and this is the only hangup.
The text was updated successfully, but these errors were encountered: