Jump to content
Amantha Bill

Add custom font problem

Recommended Posts

Posted (edited)

Hello to all, I tried to install custom fonts to the prestashop, following this article. Link

My version of prestashop is 1.7.5.

According to this article, I am placing code I made below, maybe there is some problem with .css files or something.

P.S. Yes, I cleared cache and deleted shop.json file in config/theme/{theme_name}/shop.json

My code , fonts.css:

@font-face {
    font-family: 'Walkway';
    src: url('../fonts/walkway/Walkway-Black.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
},
@font-face {
	font-family: 'Acumin-Pro';
	src: url('../fonts/acumin-pro/Acumin-RPro.otf') format('otf');
	font-style: normal;
	font-weight: normal;
}

theme.yml code: 

assets:
  css:
    all:
      - id: fonts
        path: assets/css/fonts.css
        priority: 30

And in .tpl file:

<p style="font-family: Walkway !important; font-size: 35px">
  A B C D E F G test with lalalal
</p>

And all files of the fonts are placed with correct path : {theme}/assets/fonts/{font_name_folder}/font.ttf

 

Thanks for your help!

Edited by Amantha Bill (see edit history)

Share this post


Link to post
Share on other sites

You should probably search of syntax mistakes, such as spaces or misprints inside the code. This is the main reason for the codes failures on such sites. If this doesn't help, I advise you to contact the support.

Share this post


Link to post
Share on other sites

I didn't find the solution to this problem, but I made some changes to make it work:

-instead of declaring @font-face in the fonts.css file I declared it in the custom.css file. Then, it works!

P.S. some fonts cant be applied to Prestashop (because of files .ttf .woff I downloaded)

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More