Skip to content

Custom fonts not working #130

Answered by fvlasie
fvlasie asked this question in 1. Help
Discussion options

You must be logged in to vote

OK I got it to work by making these changes:

In app/design/frontend/Local/breeze-custom/Magento_Theme/layout/breeze_default.xml:

       <link src_type="url" src="fonts/CormorantInfant-Regular.ttf" rel="preload" as="font" type="font/ttf" />

In app/design/frontend/Local/breeze-custom/web/css/_extend.less:

@import "_fonts";

In app/design/frontend/Local/breeze-custom/web/css/_fonts.less I changed each instance of format('ttf') to format('truetype').

And last but not least, the selinux context was wrong on my font files so I ran sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/pub/static(/.*)?' and sudo restorecon -Rv '/var/www/html/'

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fvlasie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant