Put widths data to standalone json

pull/3/head
Amio 2018-07-15 02:14:24 +08:00
rodzic fd3a087d48
commit dc7f562a1c
3 zmienionych plików z 4 dodań i 6 usunięć

Wyświetl plik

@ -1,7 +1,4 @@
// Generate on https://codesandbox.io/s/lr4ynm652m
/* eslint-disable comma-spacing */
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.2,4.7,5.5,9.8,7.6,13,8.7,3.2,5.4,5.4,7.6,9.8,4.4,5.4,4.4,5.4,7.6,7.6,7.6,7.6,7.6,7.6,7.6,7.6,7.6,7.6,5.4,5.4,9.8,9.8,9.8,6.5,12,8.2,8.2,8.4,9.2,7.6,6.9,9.3,9,5.1,5.5,8.3,6.7,10,9,9.4,7.2,9.4,8.3,8.2,7.4,8.8,8.2,12,8.2,7.4,8.2,5.4,5.4,5.4,9.8,7.6,7.6,7.2,7.5,6.3,7.5,7.1,4.2,7.5,7.6,3.3,4.1,7.1,3.3,12,7.6,7.3,7.5,7.5,5.1,6.3,4.7,7.6,7.1,9.8,7.1,7.1,6.3,7.6,5.4,7.6,9.8]
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.9,4.3,5,9,7,12,8,3,5,5,7,9,4,5,4,5,7,7,7,7,7,7,7,7,7,7,5,5,9,9,9,6,11,7.5,7.5,7.7,8.5,7,6.3,8.5,8.3,4.6,5,7.6,6.1,9.3,8.2,8.7,6.6,8.7,7.6,7.5,6.8,8.1,7.5,11,7.5,6.8,7.5,5,5,5,9,7,7,6.6,6.9,5.7,6.9,6.6,3.9,6.9,7,3,3.8,6.5,3,11,7,6.7,6.9,6.9,4.7,5.7,4.3,7,6.5,9,6.5,6.5,5.8,7,5,7,9]
const widthsVerdana11 = require('./widths-verdana-11.json')
function calcWidth (charWidthTable) {
const SCALE = 10
@ -23,6 +20,5 @@ function calcWidth (charWidthTable) {
}
module.exports = {
Verdana12: calcWidth(Verdana12Widths),
Verdana11: calcWidth(Verdana11Widths)
Verdana11: calcWidth(widthsVerdana11)
}

Wyświetl plik

@ -0,0 +1 @@
[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.9,4.3,5,9,7,12,8,3,5,5,7,9,4,5,4,5,7,7,7,7,7,7,7,7,7,7,5,5,9,9,9,6,11,7.5,7.5,7.7,8.5,7,6.3,8.5,8.3,4.6,5,7.6,6.1,9.3,8.2,8.7,6.6,8.7,7.6,7.5,6.8,8.1,7.5,11,7.5,6.8,7.5,5,5,5,9,7,7,6.6,6.9,5.7,6.9,6.6,3.9,6.9,7,3,3.8,6.5,3,11,7,6.7,6.9,6.9,4.7,5.7,4.3,7,6.5,9,6.5,6.5,5.8,7,5,7,9]

Wyświetl plik

@ -0,0 +1 @@
[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.2,4.7,5.5,9.8,7.6,13,8.7,3.2,5.4,5.4,7.6,9.8,4.4,5.4,4.4,5.4,7.6,7.6,7.6,7.6,7.6,7.6,7.6,7.6,7.6,7.6,5.4,5.4,9.8,9.8,9.8,6.5,12,8.2,8.2,8.4,9.2,7.6,6.9,9.3,9,5.1,5.5,8.3,6.7,10,9,9.4,7.2,9.4,8.3,8.2,7.4,8.8,8.2,12,8.2,7.4,8.2,5.4,5.4,5.4,9.8,7.6,7.6,7.2,7.5,6.3,7.5,7.1,4.2,7.5,7.6,3.3,4.1,7.1,3.3,12,7.6,7.3,7.5,7.5,5.1,6.3,4.7,7.6,7.1,9.8,7.1,7.1,6.3,7.6,5.4,7.6,9.8]