(text, height, depth, italic, skew, width, classes, style)
| 1160 | |
| 1161 | class SymbolNode { |
| 1162 | constructor(text, height, depth, italic, skew, width, classes, style) { |
| 1163 | this.text = void 0; |
| 1164 | this.height = void 0; |
| 1165 | this.depth = void 0; |
| 1166 | this.italic = void 0; |
| 1167 | this.skew = void 0; |
| 1168 | this.width = void 0; |
| 1169 | this.maxFontSize = void 0; |
| 1170 | this.classes = void 0; |
| 1171 | this.style = void 0; |
| 1172 | this.text = text; |
| 1173 | this.height = height || 0; |
| 1174 | this.depth = depth || 0; |
| 1175 | this.italic = italic || 0; |
| 1176 | this.skew = skew || 0; |
| 1177 | this.width = width || 0; |
| 1178 | this.classes = classes || []; |
| 1179 | this.style = style || {}; |
| 1180 | this.maxFontSize = 0; // Mark text from non-Latin scripts with specific classes so that we |
| 1181 | // can specify which fonts to use. This allows us to render these |
| 1182 | // characters with a serif font in situations where the browser would |
| 1183 | // either default to a sans serif or render a placeholder character. |
| 1184 | // We use CSS class names like cjk_fallback, hangul_fallback and |
| 1185 | // brahmic_fallback. See ./unicodeScripts.js for the set of possible |
| 1186 | // script names |
| 1187 | |
| 1188 | const script = scriptFromCodepoint(this.text.charCodeAt(0)); |
| 1189 | |
| 1190 | if (script) { |
| 1191 | this.classes.push(script + "_fallback"); |
| 1192 | } |
| 1193 | |
| 1194 | if (/[îïíì]/.test(this.text)) { |
| 1195 | // add ī when we add Extended Latin |
| 1196 | this.text = iCombinations[this.text]; |
| 1197 | } |
| 1198 | } |
| 1199 | |
| 1200 | hasClass(className) { |
| 1201 | return utils.contains(this.classes, className); |
nothing calls this directly
no test coverage detected