mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-10 21:48:41 +00:00
Use an array of values instead of object literals to save space in fontMetricsData.js
Test Plan: make test Reviewers: emily
This commit is contained in:
@@ -122,11 +122,19 @@ var metrics = {
|
||||
var metricMap = require("./fontMetricsData");
|
||||
|
||||
/**
|
||||
* This function is a convience function for looking up information in the
|
||||
* This function is a convenience function for looking up information in the
|
||||
* metricMap table. It takes a character as a string, and a style
|
||||
*/
|
||||
var getCharacterMetrics = function(character, style) {
|
||||
return metricMap[style][character.charCodeAt(0)];
|
||||
var metrics = metricMap[style][character.charCodeAt(0)];
|
||||
if (metrics) {
|
||||
return {
|
||||
depth: metrics[0],
|
||||
height: metrics[1],
|
||||
italic: metrics[2],
|
||||
skew: metrics[3]
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user