diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-02-19 19:14:16 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-02-19 19:14:16 +0100 |
| commit | 1cb3e7c52251679870c85fb2b4d16a02eddde6af (patch) | |
| tree | f24be681c26316fd76822f1796a9eee2f1d7742a /doc | |
| parent | bddd53881c6ea8d7870717e77961aff1f8920167 (diff) | |
| parent | c6c3d73391aedb494afd00ad8e30163038efac02 (diff) | |
[MERGE] forward port branch saas-15 up to c6c3d73391a
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/reference/reports.rst | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/doc/reference/reports.rst b/doc/reference/reports.rst index ed408a0d817..9b7d2e365e3 100644 --- a/doc/reference/reports.rst +++ b/doc/reference/reports.rst @@ -301,6 +301,38 @@ the function ``render_html`` and pass objects in the ``docargs`` dictionary: } return report_obj.render('module.report_name', docargs) +.. _reference/reports/custom_fonts: + +Custom fonts +============ +If you want to use custom fonts you will need to add your custom font and the related less/CSS to the ``web.reports_assets_common`` assets bundle. +Adding your custom font(s) to ``web.assets_common`` or ``web.assets_backend`` will not make your font available in QWeb reports. + +Example:: + + <template id="report_assets_common_custom_fonts" name="Custom QWeb fonts" inherit_id="web.report_assets_common"> + <xpath expr="." position="inside"> + <link href="/your_module/static/src/less/fonts.less" rel="stylesheet" type="text/less"/> + </xpath> + </template> + +You will need to define your ``@font-face`` within this less file, even if you've used in another assets bundle (other than ``web.reports_assets_common``). + +Example:: + + @font-face { + font-family: 'MonixBold'; + src: local('MonixBold'), local('MonixBold'), url(/your_module/static/src/fonts/MonixBold-Regular.otf) format('opentype'); + } + + .h1-title-big { + font-family: MonixBold; + font-size: 60px; + color: #3399cc; + } + +After you've added the less into your assets bundle you can use the classes - in this example ``h1-title-big`` - in your custom QWeb report. + Reports are web pages ===================== |
