| 20280 | this.addDetectors(fontFace); |
| 20281 | } |
| 20282 | addDetectors(input) { |
| 20283 | const regex = /font-family:\s*'(.+?)';.+?unicode-range:\s*(.+?);/gms; |
| 20284 | const matches = input.matchAll(regex); |
| 20285 | for (const [, _lang, range] of matches) { |
| 20286 | const lang = _lang.replaceAll(" ", "+"); |
| 20287 | if (!this.rangesByLang[lang]) { |
| 20288 | this.rangesByLang[lang] = []; |
| 20289 | } |
| 20290 | this.rangesByLang[lang].push(...convert(range)); |
| 20291 | } |
| 20292 | } |
| 20293 | }; |
| 20294 | function convert(input) { |
| 20295 | return input.split(", ").map((range) => { |