mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-13 06:58:40 +00:00
Approximate font metrics only when metrics don't exist (#1898)
Fix non-existent metrics error for \eth
This commit is contained in:
committed by
Kevin Barabash
parent
a3c95d8c13
commit
7d7c55c4c7
@@ -211,10 +211,11 @@ export function getCharacterMetrics(
|
||||
throw new Error(`Font metrics not found for font: ${font}.`);
|
||||
}
|
||||
let ch = character.charCodeAt(0);
|
||||
if (character[0] in extraCharacterMap) {
|
||||
ch = extraCharacterMap[character[0]].charCodeAt(0);
|
||||
}
|
||||
let metrics = metricMap[font][ch];
|
||||
if (!metrics && character[0] in extraCharacterMap) {
|
||||
ch = extraCharacterMap[character[0]].charCodeAt(0);
|
||||
metrics = metricMap[font][ch];
|
||||
}
|
||||
|
||||
if (!metrics && mode === 'text') {
|
||||
// We don't typically have font metrics for Asian scripts.
|
||||
|
Reference in New Issue
Block a user