0.0
The project is in a healthy, maintained state
This gem provides a simple way to generate Google Fonts URLs with custom font names, weights, and variants. It supports embedding fonts into your web projects effortlessly by generating URLs or complete CSS links, ensuring compatibility with all font styles and weights available in the Google Fonts library.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 11.0
~> 3.11
~> 1.52

Runtime

~> 0.18
 Project Readme

Google Font Url Extractor

To make all available Google Fonts selectable in a Rails application and save their corresponding CSS links, follow these steps:

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file require 'google_font_url/generator'. To experiment with that code, run bin/console for an interactive prompt.

Installation

Use in class: require 'google_font_url/generator' and Restart server or Console .

Install the gem and add to the application's Gemfile by executing:

gem 'google_font_url'

If bundler is not being used to manage dependencies, install the gem by executing:

GoogleFontUrl::Generator.generate
[["ABeeZee", "https://fonts.googleapis.com/css2?family=ABeeZee:ital,wght@0,400;1,400&display=swap"],
 ["ADLaM Display", "https://fonts.googleapis.com/css2?family=ADLaM+Display:wght@400&display=swap"],.....
GoogleFontUrl::Generator.all
[{"family"=>"ABeeZee",
  "variants"=>["regular", "italic"],
  "subsets"=>["latin", "latin-ext"],
  "version"=>"v22",
  "lastModified"=>"2024-09-04",
  "files"=>{"regular"=>"https://fonts.gstatic.com/s/abeezee/v22/esDR31xSG-6AGleN6tKukbcHCpE.ttf", "italic"=>"https://fonts.gstatic.com/s/abeezee/v22/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf"},
  "category"=>"sans-serif",
  "kind"=>"webfonts#webfont",
  "menu"=>"https://fonts.gstatic.com/s/abeezee/v22/esDR31xSG-6AGleN2tOklQ.ttf",
  "css_style_link"=>"https://fonts.googleapis.com/css2?family=ABeeZee:ital,wght@0,400;1,400&display=swap"},.....

Usage

TODO: Write usage instructions here

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/google_font_url.