adsausage Posted October 28 Share Posted October 28 (edited) I added a custom font ("FooDisplay-Medium") and applied it to "H1", and it worked. When I then added an additional custom font (FooDisplay-MediumItalic) and applied to "H2", it broke the previous style, and now the H1 is italic. Same font family ("foo"). Two files. Is there a workaround? Has anyone tried this? And I know I could simply add italic to the H2 custom style, but it's not really the same, as the italic font file would display correctly (not that anyone would notice). Thx! ---- // CUSTOM FONT for HEADING 1 @font-face { font-family: 'foo'; src: url(https://static1.squarespace.com/static/63fe423ae838510284cc600a/t/64e931aeb04dfe430c64ba41/1693004206450/FooDisplay-Medium.otf); } h1 { font-family: 'foo'; letter-spacing: normal;} // CUSTOM FONT for HEADING 2 @font-face { font-family: 'foo'; src: url(https://static1.squarespace.com/static/63fe423ae838510284cc600a/t/653d4ba84a828f0d57e00f5b/1698515880826/FooDisplay-MediumItalic.otf); } h2 { font-family: 'foo'; letter-spacing: normal;} Edited October 28 by adsausage Link to comment
melody495 Posted October 28 Share Posted October 28 Hi you need to name them different names. like below // CUSTOM FONT for HEADING 1 @font-face { font-family: 'fooMedium'; // This is the name you give for this custom font. Rename as necessary src: url(https://static1.squarespace.com/static/63fe423ae838510284cc600a/t/64e931aeb04dfe430c64ba41/1693004206450/FooDisplay-Medium.otf); } // CUSTOM FONT for HEADING 2 @font-face { font-family: 'fooMediumItalic'; // This is the name you give for this custom font. Rename as necessary src: url(https://static1.squarespace.com/static/63fe423ae838510284cc600a/t/653d4ba84a828f0d57e00f5b/1698515880826/FooDisplay-MediumItalic.otf); } Then to set your h1 and h2 to use your custom fonts, you call them like this h1 { font-family: 'fooMedium'; // put what font you want to use here letter-spacing: normal; } h2 { font-family: 'fooMediumItalic'; // put what font you want to use here letter-spacing: normal;} If this has helped you out, let me know by marking as solution, or choose a reaction ----> 👇 -------- > 👆 <---------- Please quote or @ me when replying, or I won't get a notification Melody 💁♀️ SquareSpace Developer You dream it, I'll make it happen. Contact me: 💻 melodylee.tech ✉️ my email 📍 UK based. The great thing about the internet, we can work together from anywhere. #neverstoplearning ☕ I like coffee 😊 Link to comment
adsausage Posted October 28 Author Share Posted October 28 Hmmm, unless I did something wrong, not sure that naming convention worked - H2 doesn't italicize. The font is Domaine (obviously!). Cheers though 🙂 // CUSTOM FONT H1 @font-face { font-family: 'DomaineDisplay-Medium'; src: url(https://static1.squarespace.com/static/63fe423ae838510284cc600a/t/64e931aeb04dfe430c64ba41/1693004206450/DomaineDisplay-Medium.otf); } h1 { font-family: 'DomaineDisplay-Medium'; letter-spacing: normal;} // CUSTOM FONT H2 @font-face { font-family: 'DomaineDisplay-MediumItalic'; src: url(https://static1.squarespace.com/static/63fe423ae838510284cc600a/t/64e931aeb04dfe430c64ba41/1693004206450/DomaineDisplay-MediumItalic.otf); } h2 { font-family: 'DomaineDisplay-MediumItalic'; letter-spacing: normal; } Link to comment
melody495 Posted October 28 Share Posted October 28 Hi please share a link to your website so I can check. And tell me which text you are expecting to change to italics but is not. -------- > 👆 <---------- Please quote or @ me when replying, or I won't get a notification Melody 💁♀️ SquareSpace Developer You dream it, I'll make it happen. Contact me: 💻 melodylee.tech ✉️ my email 📍 UK based. The great thing about the internet, we can work together from anywhere. #neverstoplearning ☕ I like coffee 😊 Link to comment
Solution adsausage Posted October 28 Author Solution Share Posted October 28 Actually, it suddenly worked. Cleared the cache to access another site, and it appears to have fixed itself! Much appreciated! // CUSTOM FONT H2 @font-face { font-family: 'DomaineDisplay-MediumItalic'; src: url(https://static1.squarespace.com/static/63fe423ae838510284cc600a/t/653d4ba84a828f0d57e00f5b/1698515880826/DomaineDisplay-MediumItalic.otf); } h2 { font-family: 'DomaineDisplay-MediumItalic'; letter-spacing: normal;} Link to comment
melody495 Posted October 28 Share Posted October 28 You're welcome -------- > 👆 <---------- Please quote or @ me when replying, or I won't get a notification Melody 💁♀️ SquareSpace Developer You dream it, I'll make it happen. Contact me: 💻 melodylee.tech ✉️ my email 📍 UK based. The great thing about the internet, we can work together from anywhere. #neverstoplearning ☕ I like coffee 😊 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment