Skip to content

Commit 33990b8

Browse files
committed
[bug] fix some custom fonts not loading
1 parent 0ea6147 commit 33990b8

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

‎package-lock.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nightTab",
3-
"version": "5.5.3",
3+
"version": "5.5.4",
44
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
55
"main": "index.js",
66
"scripts":{

‎src/js/theme.js‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,7 @@ var theme = (function(){
16441644
};
16451645

16461646
mod.font={
1647+
loaded: [],
16471648
display: {
16481649
light: function(){
16491650
helper.setObject({
@@ -1752,9 +1753,11 @@ var theme = (function(){
17521753
vardisplayFont=arrayItem.font.display.name+":"+arrayItem.font.display.weight;
17531754
varuiFont=arrayItem.font.ui.name+":"+arrayItem.font.ui.weight;
17541755
if(arrayItem.font.display.name!=""&&!allPresetFonts.includes(displayFont)){
1756+
mod.font.loaded.push(arrayItem.font.display.name);
17551757
allPresetFonts.push(displayFont);
17561758
};
17571759
if(arrayItem.font.ui.name!=""&&!allPresetFonts.includes(uiFont)){
1760+
mod.font.loaded.push(arrayItem.font.ui.name);
17581761
allPresetFonts.push(uiFont);
17591762
};
17601763
});
@@ -1766,7 +1769,9 @@ var theme = (function(){
17661769
},
17671770
custom: {
17681771
display: function(){
1769-
if(state.get.current().theme.font.display.name.trim().replace(/\s\s+/g," ")!=""){
1772+
vardisplayFont=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);
17701775
WebFont.load({
17711776
google: {
17721777
families: [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(){
17761781
render.font.display.name();
17771782
},
17781783
ui: function(){
1779-
if(state.get.current().theme.font.ui.name.trim().replace(/\s\s+/g," ")!=""){
1784+
varuiFont=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);
17801787
WebFont.load({
17811788
google: {
17821789
families: [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(){
20122019
render.shadow();
20132020
render.shade.opacity();
20142021
render.themeMetaTag();
2022+
render.font.load.custom.display();
2023+
render.font.load.custom.ui();
20152024
style.check();
20162025
control.render.update.control.header();
20172026
control.render.update.control.menu();

‎src/js/version.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
varversion=(function(){
22

3-
varcurrent="5.5.3";
3+
varcurrent="5.5.4";
44

55
varname="Zonked Tarsier";
66

‎src/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nightTab",
33
"short_name": "nightTab",
44
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
5-
"version": "5.5.3",
5+
"version": "5.5.4",
66
"manifest_version": 2,
77
"chrome_url_overrides":{
88
"newtab": "index.html"

0 commit comments

Comments
(0)