diff --git a/core/fonts/private/GetLocals.html b/core/fonts/private/GetLocals.html index 1a05c3a..cbb3679 100644 --- a/core/fonts/private/GetLocals.html +++ b/core/fonts/private/GetLocals.html @@ -12,18 +12,29 @@ */}} {{ $local := slice }} -{{ with .local }} - {{/* This safely append the value of .local (a string or a slice) to the $local slice */}} - {{ $local = $local | append . }} -{{ else }} - {{/* If local is not set, we'll build it ourselves based on the font family name */}} - {{ with .family }} +{{ $config := partialCached "huge/config/Get" "fonts" "fonts" }} + +{{/* We add local */}} +{{/* 1. Font local setting is ommited */}} +{{ $add_local := not (isset . "local") }} +{{/* 2. OR font local setting is not `false` */}} +{{ $add_local = $add_local | or (ne .local false) }} +{{/* 2. AND fonts global setting `disable_local` is not true */}} +{{ $add_local = $add_local | and (not $config.disable_local) }} + +{{ if $add_local }} + {{ with .local }} + {{/* This safely append the value of .local (a string or a slice) to the $local slice */}} {{ $local = $local | append . }} - {{/* If a whitespace is in the family name, we can add a local with dash in place of ws */}} - {{ if in . " " }} - {{ $local = $local | append (replace . " " "-") }} + {{ else }} + {{/* If local is not set, we'll build it ourselves based on the font family name */}} + {{ with .family }} + {{ $local = $local | append . }} + {{/* If a whitespace is in the family name, we can add a local with dash in place of ws */}} + {{ if in . " " }} + {{ $local = $local | append (replace . " " "-") }} + {{ end }} {{ end }} {{ end }} {{ end }} - {{ return $local }} \ No newline at end of file