Loading...

Top
PFQ Banner

This is PokéFarm Q, a free online Pokémon collectables game.

Already a user? New to PFQ?

Single post in Site Skins: How-To, and Helpful CSS

Forum Index > PokéFarm > Guides > Site Skins: How-To, and Helpful CSS >

Mirzam's AvatarMirzam
Mirzam's Avatar

QUOTE originally posted by Vaporeon26

[font=font here] Actual text here [/font] Make sure it's readable It'll look like this: Actual text here
This only works if the user has the font installed on their device, but for a web font like this that's meant to be linked most people will just see a default font instead. Now that I've imported the font for this page, the text above should load correctly, but before then for me it was my device's default serif font. This font looks... not that different from most sans-serif fonts to me, so tbh I'm not sure I really understand why you want to use it? But I'm pretty biased here so I'll try not to be all judgey, I just want anyone reading to remember not to use the fancy/cursive/artistic fonts for large amounts of text for accessibility reasons. I'm sorry if this method is a little complicated, I'm pretty sure we can't use the easy @import method because of how posts are sandboxed.

Instructions

1. On the font page, select the styles you need (ex: regular, italic, bold, bold italic) 2. Click the embed button on the right 3. Copy the URL in the href="" part of the embed, open a new tab, and go to the URL you copied 4. Copy the required character set definitions (at least Latin/normal/400) and add it to your post using a [style] tag 5. Apply the font as Vaporeon26 did above, or apply it using the font-family CSS in your [style] (you can use the demo CSS shown underneath the embed code on the Google fonts page - this is what I did - it defines a generic backup font for in case the webfont fails to load) In my tests I could get away with using bold/italic for most English characters while only explicitly importing the normal definition, so that may be all you need. But tbh it's been a while since I did much with web fonts so ymmv.
This is some text in the Raleway font - it should display regardless of your device/browser. I've only imported the latin character set in standard weight for this example.

Code

[sc=font]This is some text in the Raleway font - it should display regardless of your device/browser. I've only imported the Latin character set in standard weight for this example.[/sc] [style] /* latin */ @font-face { font-family: 'Raleway'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/raleway/v17/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrE.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } .font { font-family: 'Raleway', sans-serif; } [/style]
© PokéFarm 2009-2024 (Full details)Contact | Rules | Privacy | Reviews 4.6★Get shortlink for this page