Skip to content

Fix bug, add webp conversion script#54

Merged
joe-sharp merged 3 commits intomainfrom
joe-sharp/italicize_flavor_text
Aug 2, 2025
Merged

Fix bug, add webp conversion script#54
joe-sharp merged 3 commits intomainfrom
joe-sharp/italicize_flavor_text

Conversation

@joe-sharp
Copy link
Owner

@joe-sharp joe-sharp commented Aug 2, 2025

This pull request introduces new features, updates to the documentation, and enhancements to the CSS styling and testing for the mtg_card_maker project. The most notable changes include the addition of an experimental WebP conversion feature, updates to the CSS for card elements, and comprehensive tests for the CSS service.

New Features:

  • Experimental WebP Conversion: Added support for converting SVG cards to WebP format using Chrome's headless mode. This feature is currently Mac-only and includes usage instructions, prerequisites, and caveats.

Documentation Updates:

  • README.md:
    • Documented the new WebP conversion feature, including its purpose, usage, and future plans.
    • Updated the generate_card example to include an --art option for specifying artwork in .webp format.

CSS Enhancements:

  • CSS Updates: Updated the .card-flavor-text class to use italic font styling for better visual distinction.

Testing Improvements:

  • CSS Service Tests: Added comprehensive RSpec tests for MtgCardMaker::CssService, covering CSS generation, font embedding, and styling behavior.
  • Text Box Layer Tests: Added tests to verify that the correct CSS classes are applied to flavor text and rules text elements in the SVG output.

- Updated the CSS for the `.card-flavor-text` class to include `font-style: italic` in various SVG files and the CSS service.
- Ensured consistency in styling for flavor text elements in card designs.
- Added spec coverage to catch this issue in the future
- Introduced a new Ruby script to convert SVG files to WebP format using Chrome in headless mode.
- Implemented functionality for error handling, cropping, and cleanup after conversion.
- The script outputs the converted WebP file and provides feedback on the conversion process.
- Introduced a new section detailing the experimental feature for converting SVG cards to WebP format, specifically for macOS users.
- Included prerequisites, usage instructions, and features of the WebP conversion tool.
- Highlighted caveats and future plans for cross-platform support.
@joe-sharp joe-sharp requested a review from Copilot August 2, 2025 23:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug related to CSS styling for flavor text and adds an experimental WebP conversion feature for MTG cards. The changes improve the text rendering system and provide a new tool for converting SVG cards to WebP format.

  • Added italic font styling for flavor text elements to distinguish them from rules text
  • Introduced comprehensive test coverage for the CSS service functionality
  • Added experimental WebP conversion script with macOS Chrome support

Reviewed Changes

Copilot reviewed 4 out of 21 changed files in this pull request and generated no comments.

File Description
lib/mtg_card_maker/css_service.rb Adds italic font styling to flavor text CSS class
spec/mtg_card_maker/css_service_spec.rb Comprehensive test suite for CSS service methods and font styling
spec/mtg_card_maker/text_box_layer_spec.rb Test for CSS class application to flavor and rules text elements
README.md Documentation for new experimental WebP conversion feature and usage examples
Comments suppressed due to low confidence (1)

README.md:327

  • Missing closing backslash for line continuation. The line should end with a backslash to properly continue the command on the next line.
  --color=blue \

@joe-sharp joe-sharp merged commit 1c4bbb3 into main Aug 2, 2025
4 checks passed
@joe-sharp joe-sharp deleted the joe-sharp/italicize_flavor_text branch August 2, 2025 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant