@@ -1644,6 +1644,7 @@ var theme = (function(){
16441644} ;
16451645
16461646mod . font = {
1647+ loaded : [ ] ,
16471648display : {
16481649light : function ( ) {
16491650helper . setObject ( {
@@ -1752,9 +1753,11 @@ var theme = (function(){
17521753var displayFont = arrayItem . font . display . name + ":" + arrayItem . font . display . weight ;
17531754var uiFont = arrayItem . font . ui . name + ":" + arrayItem . font . ui . weight ;
17541755if ( arrayItem . font . display . name != "" && ! allPresetFonts . includes ( displayFont ) ) {
1756+ mod . font . loaded . push ( arrayItem . font . display . name ) ;
17551757allPresetFonts . push ( displayFont ) ;
17561758} ;
17571759if ( arrayItem . font . ui . name != "" && ! allPresetFonts . includes ( uiFont ) ) {
1760+ mod . font . loaded . push ( arrayItem . font . ui . name ) ;
17581761allPresetFonts . push ( uiFont ) ;
17591762} ;
17601763} ) ;
@@ -1766,7 +1769,9 @@ var theme = (function(){
17661769} ,
17671770custom : {
17681771display : function ( ) {
1769- if ( state . get . current ( ) . theme . font . display . name . trim ( ) . replace ( / \s \s + / g, " " ) != "" ) {
1772+ var displayFont = state . get . current ( ) . theme . font . display . name . trim ( ) . replace ( / \s \s + / g, " " ) ;
1773+ if ( ! mod . font . loaded . includes ( displayFont ) && displayFont != "" ) {
1774+ mod . font . loaded . push ( displayFont ) ;
17701775WebFont . load ( {
17711776google : {
17721777families : [ state . get . current ( ) . theme . font . display . name . trim ( ) . replace ( / \s \s + / g, " " ) + ":100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" ]
@@ -1776,7 +1781,9 @@ var theme = (function(){
17761781render . font . display . name ( ) ;
17771782} ,
17781783ui : function ( ) {
1779- if ( state . get . current ( ) . theme . font . ui . name . trim ( ) . replace ( / \s \s + / g, " " ) != "" ) {
1784+ var uiFont = state . get . current ( ) . theme . font . ui . name . trim ( ) . replace ( / \s \s + / g, " " ) ;
1785+ if ( ! mod . font . loaded . includes ( uiFont ) && uiFont != "" ) {
1786+ mod . font . loaded . push ( uiFont ) ;
17801787WebFont . load ( {
17811788google : {
17821789families : [ state . get . current ( ) . theme . font . ui . name . trim ( ) . replace ( / \s \s + / g, " " ) + ":100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" ]
@@ -2012,6 +2019,8 @@ var theme = (function(){
20122019render . shadow ( ) ;
20132020render . shade . opacity ( ) ;
20142021render . themeMetaTag ( ) ;
2022+ render . font . load . custom . display ( ) ;
2023+ render . font . load . custom . ui ( ) ;
20152024style . check ( ) ;
20162025control . render . update . control . header ( ) ;
20172026control . render . update . control . menu ( ) ;
0 commit comments