fbpx

Trick or Treat - 30% OFF - Coupon Code: SCARY20 Download Now

Welcome, Guest
Username: Password: Remember me

TOPIC: Missing Google font - creating fonts folder doesn't help

Missing Google font - creating fonts folder doesn't help 3 months 4 weeks ago #23187

  • vespera
  • vespera's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
Since I couldn't find Google's Public Sans font in the Google fonts list (in Typography), I've searched the forum and found the tutorial "How to do Custom Fonts in Astroid".
So, I've downloaded the Public Sans font, created the "fonts" folder in ..templates/astroid_template_zero/, added the <folder>fonts</folder> in "templateDetails.xml", and uploaded the PublicSans ttf files. But the font doesn't show in the Typography fonts list...
Am I doing something wrong?
The administrator has disabled public write access.

Missing Google font - creating fonts folder doesn't help 3 months 3 weeks ago #23199

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 4151
  • Thank you received: 609
  • Karma: 108
Hi,

This documentation docs.joomdev.com/article/how-to-do-custom-fonts-in-astroid/ should work for any custom font. Be sure to upload ttf and otf file as well.

It may be missing in google fonts list since the google list may just be outdated and will be updated in the next release.

Thanks,
Chetan
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.
The administrator has disabled public write access.

Missing Google font - creating fonts folder doesn't help 3 months 3 weeks ago #23207

  • vespera
  • vespera's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
Downloading the Public Sans font from Google Fonts site provides just the ttf variant. I was able to find additional Public Sans otf, woff and woff2 variants on the GitHub, so I uploaded them to my template /fonts folder. I hoped this would help, but unfortunately, it doesn't - the Public Sans font just doesn't appear in the Astroid Typography font list.
Well, maybe I could import the font the "classic" way, via css @import, or embedding the link inside head, but I'd rather have the font in the Typography fonts list...
I was "digging" a bit through astroid files, and I found the file webfonts.json inside /media/astroid/assets/json/. I'm far from being an expert, but, looking at the content of the file, it seems that I could maybe add the Public Sans font there (if that's all there is), the same way other fonts are listed, but I'm missing some info. If what I'm thinking is at all possible, perhaps you can assist me in adding the appropriate code. (And, yes, I'm aware that this file will most probably be overwritten on an update, but it wouldn't be to hard to add the info again, if needed).
I was thinking about adding something like this:
{
   "kind": "webfonts#webfontList",
   "items": [
    {
     "kind": "webfonts#webfont",
     "family": "Public Sans",
     "category": "sans-serif",
     "variants": [
      "regular",
      "italic",
      "200",
      "300",
      "400",
      "500",
      "600",
      "700",
      "800",
      "900"
     ],
     "subsets": [
      "latin",
      "latin-ext"
     ],
     "version": "I'm missing the version info",
     "lastModified": "Don't know the last modified date",
     "files": {
      "regular": "http://fonts.gstatic.com/ missing the link name to the actual ttf files",
      "italic": "http://fonts.gstatic.com/ missing the link name to the actual ttf files"
     }
    },
Thank you very much for any advice.
Last Edit: 3 months 3 weeks ago by vespera. Reason: just a typo...
The administrator has disabled public write access.

Missing Google font - creating fonts folder doesn't help 3 months 3 weeks ago #23225

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 4151
  • Thank you received: 609
  • Karma: 108
vespera wrote:
Downloading the Public Sans font from Google Fonts site provides just the ttf variant. I was able to find additional Public Sans otf, woff and woff2 variants on the GitHub, so I uploaded them to my template /fonts folder. I hoped this would help, but unfortunately, it doesn't - the Public Sans font just doesn't appear in the Astroid Typography font list.
Well, maybe I could import the font the "classic" way, via css @import, or embedding the link inside head, but I'd rather have the font in the Typography fonts list...
I was "digging" a bit through astroid files, and I found the file webfonts.json inside /media/astroid/assets/json/. I'm far from being an expert, but, looking at the content of the file, it seems that I could maybe add the Public Sans font there (if that's all there is), the same way other fonts are listed, but I'm missing some info. If what I'm thinking is at all possible, perhaps you can assist me in adding the appropriate code. (And, yes, I'm aware that this file will most probably be overwritten on an update, but it wouldn't be to hard to add the info again, if needed).
I was thinking about adding something like this:
{
   "kind": "webfonts#webfontList",
   "items": [
    {
     "kind": "webfonts#webfont",
     "family": "Public Sans",
     "category": "sans-serif",
     "variants": [
      "regular",
      "italic",
      "200",
      "300",
      "400",
      "500",
      "600",
      "700",
      "800",
      "900"
     ],
     "subsets": [
      "latin",
      "latin-ext"
     ],
     "version": "I'm missing the version info",
     "lastModified": "Don't know the last modified date",
     "files": {
      "regular": "http://fonts.gstatic.com/ missing the link name to the actual ttf files",
      "italic": "http://fonts.gstatic.com/ missing the link name to the actual ttf files"
     }
    },
Thank you very much for any advice.

You can download a complete list of fonts JSON at developers.google.com/fonts/docs/developer_api and replace as is with the existing one.

Thanks,
Chetan
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.
The administrator has disabled public write access.

Missing Google font - creating fonts folder doesn't help 3 months 3 weeks ago #23224

  • vespera
  • vespera's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
After two days, out of the blue, my Public Sans fonts appeared in the Typography fonts list - guess it was some cache issue, or similar...So, now I can normally set the desired font in Typography.
Still, it would be nice to have an answer if editing the webfonts.json file inside /media/astroid/assets/json/ with appropriated font data would work (and where to find the actual font link, date and version that need to be provided).
The administrator has disabled public write access.
Moderators: chandandeep
Time to create page: 0.360 seconds