From 44d164b423f1e525976897ad4a845834ceae1bea Mon Sep 17 00:00:00 2001 From: Amio Date: Wed, 11 Jul 2018 01:51:32 +0800 Subject: [PATCH] Font size 12px => 11px --- lib/calc-text-width.js | 4 ++-- lib/index.js | 12 ++++++------ test/calc-text-width.spec.js | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/calc-text-width.js b/lib/calc-text-width.js index 0612b04..4fd6681 100644 --- a/lib/calc-text-width.js +++ b/lib/calc-text-width.js @@ -1,7 +1,7 @@ // Generate on https://codesandbox.io/s/lr4ynm652m /* eslint-disable comma-spacing */ const Arial12Widths = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.33,3.33,4.26,6.67,6.67,10.7,8,2.29,4,4,4.67,7.01,3.33,4,3.33,3.33,6.67,6.67,6.67,6.67,6.67,6.67,6.67,6.67,6.67,6.67,3.33,3.33,7.01,7.01,7.01,6.67,12.2,8,8,8.67,8.67,8,7.33,9.33,8.67,3.33,6,8,6.67,10,8.67,9.33,8,9.33,8.67,8,7.33,8.67,8,11.3,8,8,7.33,3.33,3.33,3.33,5.63,6.67,4,6.67,6.67,6,6.67,6.67,3.33,6.67,6.67,2.67,2.67,6,2.67,10,6.67,6.67,6.67,6.67,4,6,3.33,6.67,6,8.67,6,6,6,4.01,3.12,4.01,7.01] -const Verdana12Widths = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.22,4.72,5.51,9.82,7.63,12.9,8.72,3.22,5.45,5.45,7.63,9.82,4.37,5.45,4.37,5.45,7.63,7.63,7.63,7.63,7.63,7.63,7.63,7.63,7.63,7.63,5.45,5.45,9.82,9.82,9.82,6.54,12,8.2,8.23,8.38,9.25,7.59,6.9,9.3,9.02,5.05,5.46,8.31,6.68,10.1,8.98,9.45,7.24,9.45,8.34,8.2,7.39,8.78,8.2,11.9,8.22,7.38,8.22,5.45,5.45,5.45,9.82,7.63,7.63,7.21,7.48,6.25,7.48,7.15,4.22,7.48,7.59,3.29,4.13,7.1,3.29,11.7,7.59,7.28,7.48,7.48,5.12,6.25,4.73,7.59,7.1,9.82,7.1,7.1,6.3,7.62,5.45,7.62,9.82] +const Verdana11Widths = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.87,4.33,5.05,9,6.99,11.8,7.99,2.95,5,5,6.99,9,4,5,4,5,6.99,6.99,6.99,6.99,6.99,6.99,6.99,6.99,6.99,6.99,5,5,9,9,9,6,11,7.52,7.54,7.68,8.48,6.96,6.32,8.53,8.27,4.63,5,7.62,6.12,9.27,8.23,8.66,6.63,8.66,7.65,7.52,6.78,8.05,7.52,10.9,7.54,6.77,7.54,5,5,5,9,6.99,6.99,6.61,6.85,5.73,6.85,6.55,3.87,6.85,6.96,3.02,3.79,6.51,3.02,10.7,6.96,6.68,6.85,6.85,4.69,5.73,4.33,6.96,6.51,9,6.51,6.51,5.78,6.98,5,6.98,9] function calcWidth (charWidthTable) { const SCALE = 100 @@ -24,5 +24,5 @@ function calcWidth (charWidthTable) { module.exports = { Arial12: calcWidth(Arial12Widths), - Verdana12: calcWidth(Verdana12Widths) + Verdana11: calcWidth(Verdana11Widths) } diff --git a/lib/index.js b/lib/index.js index c81bc3e..7a08f72 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,4 +1,4 @@ -const calcWidth = require('./calc-text-width.js').Verdana12 +const calcWidth = require('./calc-text-width.js').Verdana11 const colorPresets = require('./color-presets.js') module.exports = function ({subject, status, color}) { @@ -20,11 +20,11 @@ module.exports = function ({subject, status, color}) { - - ${subject} - ${subject} - ${status} - ${status} + + ${subject} + ${subject} + ${status} + ${status}