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:
Kevin Barabash
2015-09-29 22:16:03 -07:00
parent fdbdb28617
commit 6a10237017
3 changed files with 1742 additions and 1728 deletions

View File

@@ -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