Skip to content

Conversation

@aragon999
Copy link
Contributor

@aragon999 aragon999 commented Jan 3, 2023

1. Why is this change necessary?

Currently the fonts are only shipped in a non-optimal way, as for each font weight a individual file is shipped.

2. What does this change do, exactly?

Add inter as variable font to the Shopware storefront. I have extracted the available font weights to 400..700.
I have written a little blog post about this: https://machs.space/posts/web-font-optimization-variable-font/

But it boils down to (TLDR):

$ fonttools varLib.instancer -o Inter-italic.reduced.ttf Inter-italic.ttf "wght=400:700"
$ fonttools varLib.instancer -o Inter-roman.reduced.ttf Inter-roman.ttf "wght=400:700"
$ woff2_compress Inter-roman.reduced.ttf
$ woff2_compress Inter-italic.reduced.ttf

Not sure if this should be documented somewhere.

Additionally I updated the existing font-files to version 3.19 for consistency.

3. Describe each step to reproduce the issue or behaviour.

Load the storefront.

4. Please link to the relevant issues (if any).

5. Checklist

  • I have rebased my changes to remove merge conflicts
  • I have written tests and verified that they fail without my change
  • I have created a changelog file with all necessary information about my changes
  • I have written or adjusted the documentation according to my changes
  • This change has comments for package types, values, functions, and non-obvious lines of code
  • I have read the contribution requirements and fulfil them.

@what-the-diff
Copy link

what-the-diff bot commented Jan 3, 2023

  • Added support for font-variation
  • Removed old fonts and added new ones with the same name but different content (woff, woff2)

@tobiasberge
Copy link
Contributor

Hi @aragon999,

thanks for your contribution! Wow, you really put a lot of effort into this. 😮

Overall it looks good to me and with using @supports I don't see a real concern here. Shipping less font files in the browser is highly appreciated.

@shopwareBot
Copy link

Hello,

thank you for creating this pull request.
I have opened an issue on our Issue Tracker for you. See the issue link: https://issues.shopware.com/issues/NEXT-24830

Please use this issue to track the state of your pull request.

@aragon999 aragon999 mentioned this pull request Jan 7, 2023
6 tasks
@aragon999 aragon999 deleted the feat/add-variable-font branch January 13, 2023 23:03
@tobiasberge
Copy link
Contributor

tobiasberge commented Jan 15, 2023

Hi @aragon999, your changes were merged to trunk: 84e6608

Thanks again for your effort. 🥳

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.

3 participants