0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

odoo - Fontの変更

Last updated at Posted at 2020-12-04

Custom font という仕組み。

自動生成される web.assets_backend.css の body { Font-Family } に IPAmjMincho を追加。
font-family: "Odoo Unicode Support Noto", "Lucida Grande", Helvetica, Verdana, Arial, sans-serif;

生成されたcss
http://localhost:8069/web/content/235-a50e7a9/web.assets_backend.css

"Odoo Unicode Support Noto"が出現する箇所。
/* /web/static/src/scss/import_bootstrap.scss defined in bundle 'web.assets_backend' /
/
/web/static/src/scss/webclient.scss defined in bundle 'web.assets_backend' */
.o_web_accesskey_overlay{font-family: "Odoo Unicode Support Noto", "Lucida Grande", Helvetica, Verdana, Arial, sans-serif;}

addons\web\static\src\scss\import_bootstrap.scss
???
addons\web\static\src\scss\webclient.scss
.o_web_accesskey_overlay {
    font-family: $font-family-sans-serif;
}
addons\web\static\src\scss\bootstrap_overridden.scss
// Fonts
//
// Font, line-height, and color for body text, headings, and more.

$font-family-sans-serif: o-add-unicode-support-font(("Lucida Grande", Helvetica, Verdana, Arial, sans-serif), 1) !default;

addons\web\static\src\scss\utils.scss

// Odoo defines a limited Noto font-family for a small variety of unicode
// characters that are not necessary defined in the user system or even defined
// but not properly readable. This function allows to add this font family in a
// given font list.
//
// @param {list} $font - a list of font names ending with the generic one.
// @param {integer} [$index] - the position where to add the support font, if
//        not given, it will be placed before the generic one.
@function o-add-unicode-support-font($font, $index: false) {
    @if $index == false {
        $index: length($font);
    }

    $-with-support-font: ();
    @for $i from 1 through length($font) {
        @if $i == $index {
            $-with-support-font: append($-with-support-font, 'Odoo Unicode Support Noto', $separator: comma);
        }
        $-with-support-font: append($-with-support-font, nth($font, $i), $separator: comma);
    }

    @return $-with-support-font;
}

ヒント (追記:2021/07/29)
デフォルトフォントをアラビア文字に変更するモジュール実装
https://apps.odoo.com/apps/modules/14.0/nati_arabic_font/

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?