|
14 | 14 | .visual {
|
15 | 15 | font-size: 96px !important;
|
16 | 16 | font-style: normal !important;
|
17 |
| - font-weight: normal !important; |
18 | 17 | letter-spacing: normal !important;
|
19 | 18 | line-break: auto !important;
|
20 | 19 | line-height: 50% !important;
|
|
74 | 73 | let fntStrA = "mmmLLLmmmWWWwwwmmmllliii"
|
75 | 74 | let fntStrB = "ImLwWil"
|
76 | 75 | let isEverDetected = false // track across all four basefonts compares
|
| 76 | +let fntWeight = "normal" |
77 | 77 |
|
78 | 78 | let fntSystem = ["caption","icon","menu","message-box","small-caption","status-bar",
|
79 | 79 | "-moz-window", "-moz-desktop", "-moz-document", "-moz-workspace", "-moz-info",
|
|
131 | 131 | // only use the first one
|
132 | 132 | setTimeout(function() {
|
133 | 133 | let font = fntList[0].toLowerCase()
|
134 |
| - dom.visual = fntStrB |
| 134 | + dom.visual.innerHTML = "<span style ='font-weight:"+ fntWeight +"'>"+ fntStrB +"</span>" |
135 | 135 | if (fntSystem.includes(font)) {
|
136 | 136 | dom.visual.style.setProperty('--font', "")
|
137 | 137 | dom.visual.style.font = font
|
|
143 | 143 | fntList = [font]
|
144 | 144 | getFonts()
|
145 | 145 | let strDetected = (isEverDetected ? sg +" [" : sb +" [NOT ") + "DETECTED]" + sc
|
146 |
| - dom.font.innerHTML = "<br><hr><br>" + s12 + "FONT: " + sc + font + strDetected +"<br><br>" |
| 146 | + dom.font.innerHTML = "<br><hr><br>" + s12 + "FONT: " + sc + font +" [font-weight: "+ fntWeight +"] " + strDetected +"<br><br>" |
147 | 147 | }, 150)
|
148 | 148 | }
|
149 | 149 | } else {
|
|
154 | 154 |
|
155 | 155 | function getFonts() {
|
156 | 156 | try {
|
| 157 | + |
| 158 | + // check fntWeight |
| 159 | + fntWeight += "" |
| 160 | + let fntWeightValid = ["100","200","300","400","500","600","700","800","900","950"] |
| 161 | + if (!fntWeightValid.includes(fntWeight)) {fntWeight = "normal"} |
| 162 | + |
157 | 163 | const doc = document
|
158 | 164 | const id = `font-fingerprint`
|
159 | 165 | const div = doc.createElement('div')
|
|
167 | 173 | left: -9999px!important;
|
168 | 174 | font-size: 256px !important;
|
169 | 175 | font-style: normal !important;
|
170 |
| - font-weight: normal !important; |
| 176 | + font-weight: ` + fntWeight + ` !important; |
171 | 177 | letter-spacing: normal !important;
|
172 | 178 | line-break: auto !important;
|
173 | 179 | line-height: normal !important;
|
|
0 commit comments