npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

bsc-plugin-auto-google-fonts

v1.0.12

Published

BrighterScript plugin to automatically download and use Google Fonts in Roku SceneGraph components

Readme

Auto Google Fonts

A BrighterScript plugin that makes it easy to use Google Fonts in your Roku SceneGraph applications. Simply reference any Google Font by name, and the plugin automatically downloads and bundles it with your app.

Features

  • Simple Syntax: Use googleFont:FontName to reference any Google Font
  • Automatic Downloads: Fonts are automatically downloaded from Google Fonts GitHub repository
  • Smart Selection: Automatically chooses the best font variant (prioritizes variable fonts, then regular weights)
  • Build-Time Processing: Fonts are downloaded and bundled during the build process
  • XML & BrightScript Support: Works in both SceneGraph XML components and BrightScript code
  • Caching: Downloaded fonts are cached to speed up subsequent builds

Installation

npm install bsc-plugin-auto-google-fonts

Usage

1. Configure BrighterScript

Add the plugin to your bsconfig.json:

{
  "plugins": [
    "google-fonts-roku"
  ]
}

2. Use Google Fonts in Your App

In XML Components

<Label 
  text="Hello, World!" 
  font="googleFont:Roboto" 
  fontSize="48" 
/>

In BrightScript Code

sub init()
    label = CreateObject("roSGNode", "Label")
    label.text = "Hello, World!"
    label.font = "googleFont:Roboto"
    label.fontSize = 48
    m.top.appendChild(label)
end sub

3. Build Your Project

When you build your project with BrighterScript, the plugin will:

  1. Scan your code for googleFont: references
  2. Download the specified fonts from the Google Fonts repository
  3. Replace googleFont:FontName with pkg:/fonts/FontName.ttf
  4. Copy the fonts to your staging directory

Supported Font Names

You can use any font from Google Fonts. Use the exact font family name as shown on the Google Fonts website.

Examples:

  • googleFont:Roboto
  • googleFont:Open Sans
  • googleFont:Lato
  • googleFont:Montserrat
  • googleFont:Playfair Display

How It Works

The plugin operates during the BrighterScript build process:

  1. Scanning Phase (beforePrepublish): Scans all .brs and .xml files for googleFont: references
  2. Download Phase: Downloads fonts from the Google Fonts GitHub repository to your project's fonts/ directory
  3. Transform Phase (beforeFileTranspile / afterFileTranspile): Replaces googleFont:FontName with pkg:/fonts/FontName.ttf in your code
  4. Copy Phase (afterPrepublish): Copies all downloaded fonts to the staging directory

Font Selection Logic

When multiple font files are available for a font family, the plugin automatically selects the best one using this priority:

  1. Variable fonts with [wght] axis (most flexible)
  2. Other variable fonts
  3. Regular static fonts
  4. Any available font file

Requirements

Project Structure

your-roku-project/
├── bsconfig.json        # BrighterScript configuration
├── source/              # Your BrightScript source files
├── components/          # Your SceneGraph XML components
├── fonts/               # Downloaded fonts (auto-generated)
└── out/
    └── staging/
        └── fonts/       # Fonts copied to staging (auto-generated)

Demo

A working demo is included in the demo/ directory. To run it:

npm run build
# Deploy the demo/ directory to your Roku device

The demo shows how to use both system fonts and Google Fonts side by side.

Configuration

The plugin uses these directories (relative to your rootDir in bsconfig.json):

  • Fonts Directory: fonts/ - where downloaded fonts are stored
  • Staging Directory: Specified by stagingDir in your BrighterScript config

Troubleshooting

Font Not Found

If a font fails to download, check:

  1. The font name matches exactly with Google Fonts
  2. The font is in the ofl/, apache/, or ufl/ directories of the Google Fonts repository
  3. Your internet connection is working
  4. curl is installed and available

Font Not Loading on Roku

Ensure:

  1. The font file was copied to pkg:/fonts/ in your deployed app
  2. The font format is .ttf (Roku supports TrueType fonts)
  3. The font file isn't corrupted (check file size)

Development

To work on this plugin:

# Install dependencies
npm install

# Build the plugin
npm run build

# Watch for changes
npm run watch

Credits

This plugin downloads fonts from the Google Fonts GitHub repository, which contains fonts licensed under open source licenses (OFL, Apache, UFL).