Fix ForkAwesome load detection

Fixes #98.
This commit is contained in:
Florine W. Dekker 2024-04-30 18:24:06 +02:00
parent fc959d9619
commit 3eae6ae635
Signed by: FWDekker
GPG Key ID: D3DCFAA8A4560BE0
4 changed files with 7 additions and 7 deletions

BIN
package-lock.json generated

Binary file not shown.

View File

@ -1,6 +1,6 @@
{
"name": "minesweeper",
"version": "0.85.4",
"version": "0.85.5",
"description": "Just Minesweeper!",
"author": "Florine W. Dekker",
"browser": "dist/bundle.js",
@ -29,9 +29,9 @@
"grunt-text-replace": "^0.4.0",
"grunt-webpack": "^6.0.0",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.1",
"typescript": "^5.3.2",
"webpack": "^5.89.0",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
}
}

View File

@ -102,7 +102,7 @@ export function waitForForkAwesome(onSuccess: () => void, onFailure: () => void,
const ctx = canvas.getContext("2d")!;
const fontSize = 36;
const testCharacter = "\uF047";
const targetPixelCount = 528; // Found by doing lots of trials
const targetPixelCount = 500; // 316 is failure, 528 is success, so use 500 for margin
const ccw = canvas.width = fontSize * 1.5;
const cch = canvas.height = fontSize * 1.5;

View File

@ -14,10 +14,10 @@ doAfterLoad(() => {
new Game(preferences);
},
() => {
alert("External font could not be loaded. Using fallback font. Is a browser extension blocking fonts?");
alert("Icon font could not be loaded. Using fallback font. Is a browser extension blocking fonts?");
preferences.font = new BasicIconFont();
new Game(preferences);
},
3000
2500
);
});