Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Inter font #10

Merged
merged 5 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ jobs:
strategy:
matrix:
ruby:
- 2.5
- 2.6
- 2.7
- 3.0
- 3.3
- 3.4

steps:
- uses: actions/checkout@v2
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Discourse Fonts

This gem is used to distribute all fonts used for the [Discourse forum software](https://discourse.org/). The main repository for Discourse is [https://github.com/discourse/discourse](https://github.com/discourse/discourse).

This gem can be found on RubyGems at [https://rubygems.org/gems/discourse-fonts](https://rubygems.org/gems/discourse-fonts).

### Adding fonts

Most fonts in this gem are from Google Fonts. When adding a new font, this is the process:

1. Download the font from Google Fonts
2. Make sure the license is added to a text file in vendor/assets/fonts. Sometimes the license will already be present, e.g. OFL is a common license.
3. Copy the downloaded .ttf files to vendor/assets/fonts
4. Add the font name, stack, and variants for e.g. different weights to lib/discourse_fonts.rb following the existing examples
5. Bump the VERSION in this file

To test this gem out locally, you can change the discourse/discourse gemfile to point to your local copy of this gem using the `path` option:

```
gem 'discourse-fonts', path: '/path/to/discourse-fonts'
```

Discourse symlinks the fonts in vendor/assets/fonts to the public/fonts directory, and it should update this symlink when you install the gem from the local path.
32 changes: 20 additions & 12 deletions discourse-fonts.gemspec
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
# frozen_string_literal: true
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
$LOAD_PATH.unshift(lib) if !$LOAD_PATH.include?(lib)
require "discourse_fonts"

Gem::Specification.new do |s|
s.name = "discourse-fonts"
s.version = DiscourseFonts::VERSION
s.summary = "Bundle of customizable Discourse fonts"
s.description = "Bundle of fonts which can be used to customize the look of Discourse"
s.authors = ["Bianca Nenciu"]
s.email = "[email protected]"
s.files = Dir["lib/*.rb", "vendor/assets/fonts/*.ttf", "vendor/assets/fonts/*.woff", "vendor/assets/fonts/*.woff2", "vendor/assets/fonts/*.otf"]
s.homepage = "https://github.com/discourse/discourse-fonts"
s.license = "MIT"
s.name = "discourse-fonts"
s.version = DiscourseFonts::VERSION
s.summary = "Bundle of customizable Discourse fonts"
s.description =
"Bundle of fonts which can be used to customize the look of Discourse"
s.authors = ["Bianca Nenciu"]
s.email = "[email protected]"
s.files =
Dir[
"lib/*.rb",
"vendor/assets/fonts/*.ttf",
"vendor/assets/fonts/*.woff",
"vendor/assets/fonts/*.woff2",
"vendor/assets/fonts/*.otf"
]
s.homepage = "https://github.com/discourse/discourse-fonts"
s.license = "MIT"

s.required_ruby_version = ">= 2.5.0"
s.required_ruby_version = ">= 3.3.0"

s.add_development_dependency "rake", "~> 13.0"
s.add_development_dependency "rubocop-discourse", "~> 2.4.1"
s.add_development_dependency "rubocop-discourse", "~> 3.9"
end
Loading
Loading