4

This is related to the following:

  1. Hosting on google drive
  2. how to import webfonts in blogger from google drive?
  3. Can I use google fonts in Google Drive web hosting?

But 1 is about hosting a static web page; 2 is about Google Fonts, and the comment by @abhay9455 to Google’s documentation does not help; and 3 was about Google Fonts, which is already well covered by both Blogger and Google Web Font implementation. What I would like to do, is use a font I created on Calligraphr for a post I am working on; this is not a professional font, and thus is not hosted by anyone but me. My only source for hosting files online is Google Drive. How can I use this font in a Blogger post when I have hosted it publicly on Google Drive?

My code for fetching the font is this:

<style>
  @font-face {
    font-family: 'Tolvtalsystem';
    src: url('https://drive.google.com/file/d/163bhcNTENeBtF1wPhykqOTlKPZud7xAG')
         format('opentype');
}
</style>

The font does not load. (I uninstalled it locally to make sure I would know whether it loaded or not.) What do I need to do to be able to have it loaded from my Google Drive? As for now, I think the solution might be in getting a link that actually identifies it as a font (a link ending in .otf), but I have no idea how to get this.

6
  • 1
    Can you not upload any fonts to Blogger? How do you deal with other files like images? Mar 13, 2021 at 17:25
  • I just tested if I could cheat my way through it with the image upload function. It won’t upload none-image files (‘Upload failed. Server denied.’)
    – Canned Man
    Mar 14, 2021 at 16:48
  • 1
    "I think the solution might be in getting a link that actually identifies it as a font" - certainly the link you are using doesn't actually return a "font file" at all. It returns a 302 redirect response (since you appear to be missing a trailing slash), followed by another 302 to append edit, followed by a text/html response. "a link ending in .otf" - not only that, but Google Drive would need to also respond with the appropriate mime-type (it needs to "host" the file).
    – MrWhite
    Mar 18, 2021 at 16:08
  • 2
    I would be surprised if this is possible, since Google disabled web hosting support back in August 2016. And you'd need "web hosting support" in order to correctly serve a font-file. So, Q1 and Q3 you link to are no longer possible anyway. Q2 is actually about "web fonts", not "Google Fonts" (so it's really the same as what you are asking here), except the answer to that question would seem to be a bit wrong (and out of date)?
    – MrWhite
    Mar 18, 2021 at 16:20
  • See also: stackoverflow.com/questions/40478447/…
    – MrWhite
    Mar 18, 2021 at 16:21

1 Answer 1

3

You can grab the actual download link (see this reddit post) https://www.reddit.com/r/tabletopsimulator/comments/38h598/hosting_files_with_google_drive/

Basically, put the file id into the direct download link: https://drive.google.com/uc?export=download&id=FILE_ID

this is the direct download link for any file! I tested it out in carrd (using the embed feature) and this link used as the source worked, this is very very late but I thought id contribute. I'm not sure if it'll host on blogger properly but it's possible!

1
  • Excellent contribution. I will try it out today. Can you edit your answer so it is self-contained? Answers on SE should not require the reader to open a link to see the answer; using links to show sources, however, is of course good form. So in short: If you write the relevant information from the Reddit post into your answer, it is gold.
    – Canned Man
    Aug 20, 2022 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.