Magento 2 how to add Fonts? The Next CEO of Stack OverflowMagento 2 - How to insert template block into page_topMagento 2: How to add multiple locally stored fonts?what is the factory for url rewrites?Magento 2: How to add a meta tag based on layoutOpen Sans overwriting Lato ~ Magento 2.1Magento 2 : How to Include New FontsMagento 2 - How to change fontsAdd Cross Sell Block to Checkout Step Magento 2How to override magento theme layout fileMagento 2.1.3 Build multiple store views with unique subdomains pull CSS and JS from parent website URL?

Whats the best way to handle refactoring a big file?

How to make a variable always equal to the result of some calculations?

How to make a software documentation "officially" citable?

Fastest way to shutdown Ubuntu Mate 18.10

How to be diplomatic in refusing to write code that breaches the privacy of our users

Increase performance creating Mandelbrot set in python

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

Can I equip Skullclamp on a creature I am sacrificing?

How to get regions to plot as graphics

Why did we only see the N-1 starfighters in one film?

% symbol leads to superlong (forever?) compilations

Apart from "berlinern", do any other German dialects have a corresponding verb?

Why do professional authors make "consistency" mistakes? And how to avoid them?

How long to clear the 'suck zone' of a turbofan after start is initiated?

Why doesn't a table tennis ball float on the surface? How do we calculate buoyancy here?

What does this shorthand mean?

Go Pregnant or Go Home

Why were Madagascar and New Zealand discovered so late?

How to safely derail a train during transit?

Science fiction (dystopian) short story set after WWIII

How to start emacs in "nothing" mode (`fundamental-mode`)

When did Lisp start using symbols for arithmetic?

Text adventure game code

Inappropriate reference requests from Journal reviewers



Magento 2 how to add Fonts?



The Next CEO of Stack OverflowMagento 2 - How to insert template block into page_topMagento 2: How to add multiple locally stored fonts?what is the factory for url rewrites?Magento 2: How to add a meta tag based on layoutOpen Sans overwriting Lato ~ Magento 2.1Magento 2 : How to Include New FontsMagento 2 - How to change fontsAdd Cross Sell Block to Checkout Step Magento 2How to override magento theme layout fileMagento 2.1.3 Build multiple store views with unique subdomains pull CSS and JS from parent website URL?










0















I tested my site speed on Gtmetrix and it showed fonts rendering through



https://fonts.googleapis.com/css?family=Montserrat:400,600,700|Roboto:400,400i,700 . 


And it is called in theme layout as -css src="https://fonts.googleapis.com/css?family=Montserrat:400,600,700|Roboto:400,400i,700" src_type="url" .
I want to download and store the fonts locally and render them .
How to do this ?










share|improve this question
























  • you can add font files to your local theme directory. app/design/frontend/<your_vendor_name>/<your_theme_name>/web/fonts

    – magefms
    yesterday











  • check from here devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/…

    – magefms
    yesterday















0















I tested my site speed on Gtmetrix and it showed fonts rendering through



https://fonts.googleapis.com/css?family=Montserrat:400,600,700|Roboto:400,400i,700 . 


And it is called in theme layout as -css src="https://fonts.googleapis.com/css?family=Montserrat:400,600,700|Roboto:400,400i,700" src_type="url" .
I want to download and store the fonts locally and render them .
How to do this ?










share|improve this question
























  • you can add font files to your local theme directory. app/design/frontend/<your_vendor_name>/<your_theme_name>/web/fonts

    – magefms
    yesterday











  • check from here devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/…

    – magefms
    yesterday













0












0








0








I tested my site speed on Gtmetrix and it showed fonts rendering through



https://fonts.googleapis.com/css?family=Montserrat:400,600,700|Roboto:400,400i,700 . 


And it is called in theme layout as -css src="https://fonts.googleapis.com/css?family=Montserrat:400,600,700|Roboto:400,400i,700" src_type="url" .
I want to download and store the fonts locally and render them .
How to do this ?










share|improve this question
















I tested my site speed on Gtmetrix and it showed fonts rendering through



https://fonts.googleapis.com/css?family=Montserrat:400,600,700|Roboto:400,400i,700 . 


And it is called in theme layout as -css src="https://fonts.googleapis.com/css?family=Montserrat:400,600,700|Roboto:400,400i,700" src_type="url" .
I want to download and store the fonts locally and render them .
How to do this ?







magento2 fonts






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Raj Mohan R

917




917










asked yesterday









chanchalchanchal

356




356












  • you can add font files to your local theme directory. app/design/frontend/<your_vendor_name>/<your_theme_name>/web/fonts

    – magefms
    yesterday











  • check from here devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/…

    – magefms
    yesterday

















  • you can add font files to your local theme directory. app/design/frontend/<your_vendor_name>/<your_theme_name>/web/fonts

    – magefms
    yesterday











  • check from here devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/…

    – magefms
    yesterday
















you can add font files to your local theme directory. app/design/frontend/<your_vendor_name>/<your_theme_name>/web/fonts

– magefms
yesterday





you can add font files to your local theme directory. app/design/frontend/<your_vendor_name>/<your_theme_name>/web/fonts

– magefms
yesterday













check from here devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/…

– magefms
yesterday





check from here devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/…

– magefms
yesterday










2 Answers
2






active

oldest

votes


















0














First you need to difine css in default_head_blocks.xml like this



<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
<css src="css/custome.css" />
</head>
</page>


and then put your font css file in this path



appdesignfrontendVendorCustomThemewebfontscustom.css





share|improve this answer






























    0















    1. Add font files to your local theme directory. For example,



    app/design/frontend/<your_vendor_name>/<your_theme_name>/web/fonts.



    1. If you build a theme using the Magento UI library, declare the font
      by adding the .lib-font-face mixin to the



    app/design/frontend/<your_vendor_name>/<your_theme_name>/web/css/source/_typography.less



    .lib-font-face(
    @family-name:'<any_font_name>',
    @font-path: '@baseDirfonts/<path_to_font_file>',
    @font-weight: <font_weight>,
    @font-style: <font_style>
    );


    After This Step Follow This Command :-



    php bin/magento setup:upgrade

    php bin/magento setup:static-content:deploy -f





    share|improve this answer

























    • And how to call these fonts in default_head_blocks.xml?

      – chanchal
      yesterday











    • check updated answer

      – Ronak Rathod
      yesterday











    • dont need to define less file

      – Ronak Rathod
      yesterday











    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267562%2fmagento-2-how-to-add-fonts%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    First you need to difine css in default_head_blocks.xml like this



    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
    <css src="css/custome.css" />
    </head>
    </page>


    and then put your font css file in this path



    appdesignfrontendVendorCustomThemewebfontscustom.css





    share|improve this answer



























      0














      First you need to difine css in default_head_blocks.xml like this



      <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <head>
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
      <css src="css/custome.css" />
      </head>
      </page>


      and then put your font css file in this path



      appdesignfrontendVendorCustomThemewebfontscustom.css





      share|improve this answer

























        0












        0








        0







        First you need to difine css in default_head_blocks.xml like this



        <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <head>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
        <css src="css/custome.css" />
        </head>
        </page>


        and then put your font css file in this path



        appdesignfrontendVendorCustomThemewebfontscustom.css





        share|improve this answer













        First you need to difine css in default_head_blocks.xml like this



        <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <head>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
        <css src="css/custome.css" />
        </head>
        </page>


        and then put your font css file in this path



        appdesignfrontendVendorCustomThemewebfontscustom.css






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        Magento_BhurioMagento_Bhurio

        1849




        1849























            0















            1. Add font files to your local theme directory. For example,



            app/design/frontend/<your_vendor_name>/<your_theme_name>/web/fonts.



            1. If you build a theme using the Magento UI library, declare the font
              by adding the .lib-font-face mixin to the



            app/design/frontend/<your_vendor_name>/<your_theme_name>/web/css/source/_typography.less



            .lib-font-face(
            @family-name:'<any_font_name>',
            @font-path: '@baseDirfonts/<path_to_font_file>',
            @font-weight: <font_weight>,
            @font-style: <font_style>
            );


            After This Step Follow This Command :-



            php bin/magento setup:upgrade

            php bin/magento setup:static-content:deploy -f





            share|improve this answer

























            • And how to call these fonts in default_head_blocks.xml?

              – chanchal
              yesterday











            • check updated answer

              – Ronak Rathod
              yesterday











            • dont need to define less file

              – Ronak Rathod
              yesterday















            0















            1. Add font files to your local theme directory. For example,



            app/design/frontend/<your_vendor_name>/<your_theme_name>/web/fonts.



            1. If you build a theme using the Magento UI library, declare the font
              by adding the .lib-font-face mixin to the



            app/design/frontend/<your_vendor_name>/<your_theme_name>/web/css/source/_typography.less



            .lib-font-face(
            @family-name:'<any_font_name>',
            @font-path: '@baseDirfonts/<path_to_font_file>',
            @font-weight: <font_weight>,
            @font-style: <font_style>
            );


            After This Step Follow This Command :-



            php bin/magento setup:upgrade

            php bin/magento setup:static-content:deploy -f





            share|improve this answer

























            • And how to call these fonts in default_head_blocks.xml?

              – chanchal
              yesterday











            • check updated answer

              – Ronak Rathod
              yesterday











            • dont need to define less file

              – Ronak Rathod
              yesterday













            0












            0








            0








            1. Add font files to your local theme directory. For example,



            app/design/frontend/<your_vendor_name>/<your_theme_name>/web/fonts.



            1. If you build a theme using the Magento UI library, declare the font
              by adding the .lib-font-face mixin to the



            app/design/frontend/<your_vendor_name>/<your_theme_name>/web/css/source/_typography.less



            .lib-font-face(
            @family-name:'<any_font_name>',
            @font-path: '@baseDirfonts/<path_to_font_file>',
            @font-weight: <font_weight>,
            @font-style: <font_style>
            );


            After This Step Follow This Command :-



            php bin/magento setup:upgrade

            php bin/magento setup:static-content:deploy -f





            share|improve this answer
















            1. Add font files to your local theme directory. For example,



            app/design/frontend/<your_vendor_name>/<your_theme_name>/web/fonts.



            1. If you build a theme using the Magento UI library, declare the font
              by adding the .lib-font-face mixin to the



            app/design/frontend/<your_vendor_name>/<your_theme_name>/web/css/source/_typography.less



            .lib-font-face(
            @family-name:'<any_font_name>',
            @font-path: '@baseDirfonts/<path_to_font_file>',
            @font-weight: <font_weight>,
            @font-style: <font_style>
            );


            After This Step Follow This Command :-



            php bin/magento setup:upgrade

            php bin/magento setup:static-content:deploy -f






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited yesterday

























            answered yesterday









            Ronak RathodRonak Rathod

            709112




            709112












            • And how to call these fonts in default_head_blocks.xml?

              – chanchal
              yesterday











            • check updated answer

              – Ronak Rathod
              yesterday











            • dont need to define less file

              – Ronak Rathod
              yesterday

















            • And how to call these fonts in default_head_blocks.xml?

              – chanchal
              yesterday











            • check updated answer

              – Ronak Rathod
              yesterday











            • dont need to define less file

              – Ronak Rathod
              yesterday
















            And how to call these fonts in default_head_blocks.xml?

            – chanchal
            yesterday





            And how to call these fonts in default_head_blocks.xml?

            – chanchal
            yesterday













            check updated answer

            – Ronak Rathod
            yesterday





            check updated answer

            – Ronak Rathod
            yesterday













            dont need to define less file

            – Ronak Rathod
            yesterday





            dont need to define less file

            – Ronak Rathod
            yesterday

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267562%2fmagento-2-how-to-add-fonts%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Sum ergo cogito? 1 nng

            419 nièngy_Soadمي 19bal1.5o_g

            Queiggey Chernihivv 9NnOo i Zw X QqKk LpB