Description
Preconditions:
Magento 2.4-develop
Default magento font import lib-font-face use type woff or woff2. In real case when user use another font type such as true type. Font import will work incorrect if add format truetype
Example in less define custom font
.lib-font-face( @family-name: 'Inter-Light', @font-path: '@{baseDir}fonts/Inter-Light', @font-format: 'ttf', @font-weight: normal, @font-style: normal, @font-display: auto );
will generate css font-face
@font-face { font-family: 'Inter-Light'; src: url('../fonts/Inter-Light.ttf') format('ttf'); font-weight: normal; font-style: normal; font-display: auto; }
format font src seem incorrect in the case truetype. Reference in this doc
https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face
src: url('../fonts/Inter-Light.ttf') format('ttf') should be
src: url('../fonts/Inter-Light.ttf') format('truetype');
Steps to Reproduce:
- Tested with font added with /web/css/source/_typography.less inside luma/blank theme or custom theme
- Use custom font non-default from magento (ttf, eot)
- use format specific while import font
- Also use type font specific too
- Make sure output css render and page load without problem. Font render correctly
Actual Result: ✖️
Expected Result: ✔️
import
render styles-m.css
web font request
Proposed solution
--- Update mixin font with new type font argument in order import correct type
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- Severity: S0 - Affects critical data or functionality and leaves users with no workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status