From 312b19c3ef9cfdb5d87fcbb7248b17feccbc88c2 Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Fri, 30 Sep 2022 11:49:03 +0700 Subject: [PATCH] chore(web): drops testString, checkFont* funcs --- web/source/kmwbase.ts | 12 ----- web/source/kmwutils.ts | 113 ----------------------------------------- 2 files changed, 125 deletions(-) diff --git a/web/source/kmwbase.ts b/web/source/kmwbase.ts index 2898e6f501..3ef17d0946 100644 --- a/web/source/kmwbase.ts +++ b/web/source/kmwbase.ts @@ -56,7 +56,6 @@ namespace com.keyman { warned = false; // Warning flag (to prevent multiple warnings) baseFont = 'sans-serif'; // Default font for mapped input elements appliedFont = ''; // Chain of fonts to be applied to mapped input elements - fontCheckTimer = null; // Timer for testing loading of embedded fonts srcPath = ''; // Path to folder containing executing keymanweb script rootPath = ''; // Path to server root protocol = ''; // Protocol used for the KMW script. @@ -229,17 +228,6 @@ namespace com.keyman { return metadata; } - /** - * Expose font testing to allow checking that SpecialOSK or custom font has - * been correctly loaded by browser - * - * @param {string} fName font-family name - * @return {boolean} true if available - **/ - ['isFontAvailable'](fName: string): boolean { - return this.util.checkFont({'family':fName}); - } - /** * Function addEventListener * Scope Public diff --git a/web/source/kmwutils.ts b/web/source/kmwutils.ts index 020d309a5c..6b7f26f788 100644 --- a/web/source/kmwutils.ts +++ b/web/source/kmwutils.ts @@ -1021,119 +1021,6 @@ namespace com.keyman { return this.keyman.protocol+'//'+path; } } - - /** - * Return the appropriate test string for a given font - * - * TODO: Tidy up and remove arrays once 'sample' included in font metadata - * - * @param {Object} fd font meta-data object - * @return {string} string to compare width - * - */ - testString(fd): string { - var fontName=fd['family'], - i,s='BESbswy'; - - if('sample' in fd && typeof(fd['sample']) == 'string') { - return s+fd['sample']; - } - - var f=['TamilWeb','TibetanWeb','LatinWeb','CherokeeWeb', - 'EgyptianWeb','SinhalaWeb','KhmerWeb','ArabicWeb', - 'BurmeseWeb','LaoWeb','OriyaWeb','GeezWeb'], - t=['\u0BBE\u0BF5','\u0F7F\u0FD0','\u02B0\u02A4','\u13D0\u13C9', - '\uA723\uF7D3','\u0DD8\u0DA3','\u17D6\u178E','\u0639\u06B3', - '\u1038\u1024','\u0EC0\u0EDD','\u0B03\u0B06','\u1361\u132C']; - - for(i=0; i