Technical mailing list archives

technical@mail.odoo.com

Browse archives

Avatar

Re: [11.0] Font-family does not work in Qweb reports

by
GLOBAL CREATIVE CONCEPTS TECH CO LTD (iWesabe)
- 08/10/2018 04:06:15

You can add font directly in qweb report without using css file.

For Example.

<template id="my_awesome_report">
    <t t-call="web.html_container">
        <t t-foreach="docs" t-as="o">
            <t t-call="web.external_layout">
                <div class="page">
                    <style>
                        @font-face {
                            font-family: TimesNewRomanNormal;
                            src: url('/my_awesome_app/static/src/fonts/Times_New_Roman_Normal.ttf') format('opentype');
                        }
                    </style>
                    
                    Blah Blah ...

                </div>
            </t>
        </t>
    </t>
</template>


Thanks & Regards

Shameem Babu P K
Odoo Technical Consultant
Global Creative Concepts Tech Co Ltd. | Kingdom of Saudi Arabia
Mail: shameem@iwesabe.com
Tel: +966 13 895 6600, Ext.222
Mob: +966 539 079 660
website | map | email
On 10/08/2018 10:42 AM, Bhavesh Selarka wrote:
I have already tried these solutions.

But not working.

On Mon, Oct 8, 2018 at 12:56 PM iWesabe <odoo@iwesabe.com> wrote:


You can follow these steps..

1) Download the ttf file of your favorite font.

2) Add font in the CSS file.

    /*For Example:*/

    @font-face {

            font-family: TimesNewRomanNormal;

            src: url('/my_awesome_app/static/src/fonts/Times_New_Roman_Normal.ttf') format('opentype');

     }

3) Add the CSS file in your report and enjoy qweb coding.

Thanks & Regards

Shameem Babu P K
Odoo Technical Consultant
Global Creative Concepts Tech Co Ltd. | Kingdom of Saudi Arabia
Mail: shameem@iwesabe.com
Tel: +966 13 895 6600, Ext.222
Mob: +966 539 079 660
website | map | email
On 10/08/2018 10:06 AM, Bhavesh Selarka wrote:
Hello,

Anyone have an idea, how to change font family in v11 community qweb reports.

I have already tried with below mention link solutions.

_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe



--
Bhavesh Selarka
skype: bhavesh.selarka
twitter: @BhaveshSelarka

_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


Reference