Skip to content

Commit

Permalink
Fix file path issue in check_fonts_installed method (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
AliSoftware authored Nov 21, 2024
2 parents c84cf44 + 71a2785 commit 33a2ab5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ _None_

### Bug Fixes

- Fix `check_fonts_installed` step in `create_promo_screenshots` [#615]
- Fix broken `draw_text_to_canvas` method for `create_promo_screenshots` [#614]

### Internal Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def check_fonts_installed!(config:)
# Parse the first font in each `font-family` attribute found in all found CSS files.
# Only the first in each `font-family` font list matters, as others are fallbacks we don't want to use anyway.
font_families = all_stylesheets.flat_map do |s|
File.readlines(s).flat_map do |line|
stylesheet_path = resolve_path(s)
File.readlines(stylesheet_path).flat_map do |line|
attr = line.match(/font-family: (.*);/)&.captures&.first
attr.split(',').first.strip.gsub(/'(.*)'/, '\1').gsub(/"(.*)"/, '\1') unless attr.nil?
end
Expand Down

0 comments on commit 33a2ab5

Please sign in to comment.