|
62 | 62 | fntBaseDimensions = "",
|
63 | 63 | fntPoison = "",
|
64 | 64 | baseFonts = ['monospace','sans-serif','serif'],
|
65 |
| - baseGeneric = baseFonts |
| 65 | + baseGeneric = baseFonts, |
| 66 | + fntWeight = "normal" |
| 67 | + |
66 | 68 |
|
67 | 69 | // remember results across the two tests
|
68 | 70 | let notFoundInMin = [],
|
|
112 | 114 | android: [],linux: [],
|
113 | 115 | mac: [
|
114 | 116 | // ESR102 whitelist minus bundled
|
115 |
| - // ToDo: mac: check PingFang + Songti variants from other: e.g. Songti SC Black","Songti SC Light","Songti TC Light" |
116 |
| - "AppleGothic","Apple Color Emoji","Arial","Arial Black","Arial Narrow","Courier","Geneva","Georgia","Heiti TC","Helvetica","Helvetica Neue",".Helvetica Neue DeskInterface","Hiragino Kaku Gothic ProN","Hiragino Kaku Gothic ProN W3","Hiragino Kaku Gothic ProN W6","Kailasa","Lucida Grande","Menlo","Monaco","PingFang HK","PingFang SC","PingFang TC","Songti SC","Songti TC","Tahoma","Thonburi","Times","Times New Roman","Verdana", |
| 117 | + "AppleGothic","Apple Color Emoji","Arial","Arial Black","Arial Narrow","Courier","Courier New","Geneva", |
| 118 | + "Georgia","Heiti TC","Helvetica","Helvetica Neue",".Helvetica Neue DeskInterface", |
| 119 | + "Hiragino Kaku Gothic ProN","Hiragino Kaku Gothic ProN W3","Hiragino Kaku Gothic ProN W6", |
| 120 | + "Kailasa","Lucida Grande","Menlo","Monaco","PingFang HK","PingFang SC","PingFang TC", |
| 121 | + "Songti SC","Songti TC","Tahoma","Thonburi","Times","Times New Roman","Verdana", |
117 | 122 | ],
|
118 | 123 | windows: [
|
119 | 124 | // ESR102 whitelist
|
|
486 | 491 |
|
487 | 492 | let foundhash = mini(data)
|
488 | 493 | dom.results.innerHTML = display.join("<br>")
|
489 |
| - +"<p><details><summary>"+ s12 +"ALL FOUND FONTS ["+ data.length +"] "+ sc + foundhash + allStr + poisonString + "</summary><p>" |
| 494 | + +"<p><details><summary>"+ s12 +"ALL FOUND FONTS ["+ data.length +"] "+ sc |
| 495 | + + foundhash + allStr + " [font-weight: "+ fntWeight +"]" + poisonString + "</summary><p>" |
490 | 496 | + dataString + "<br><br></p></details>"
|
491 | 497 | }
|
492 | 498 | }
|
|
612 | 618 | fntPoison = ""
|
613 | 619 | oBaseFonts = {}
|
614 | 620 |
|
| 621 | + // check fntWeight |
| 622 | + fntWeight += "" |
| 623 | + let fntWeightValid = ["100","200","300","400","500","600","700","800","900","950",] |
| 624 | + if (!fntWeightValid.includes(fntWeight)) {fntWeight = "normal"} |
| 625 | + |
615 | 626 | const doc = document // or iframe.contentWindow.document
|
616 | 627 | const id = `font-fingerprint`
|
617 | 628 | const div = doc.createElement('div')
|
|
625 | 636 | left: -9999px!important;
|
626 | 637 | font-size: 256px !important;
|
627 | 638 | font-style: normal !important;
|
628 |
| - font-weight: normal !important; |
| 639 | + font-weight: ` + fntWeight + ` !important; |
629 | 640 | letter-spacing: normal !important;
|
630 | 641 | line-break: auto !important;
|
631 | 642 | line-height: normal !important;
|
|
0 commit comments