From 6fbfdf0323aca8cb40de26755597f7da45c7d5e5 Mon Sep 17 00:00:00 2001 From: cutls Date: Tue, 7 Apr 2020 13:20:50 +0900 Subject: [PATCH] Fix: cannot list fonts up --- app/js/ui/settings.js | 6 ++--- app/main/system.js | 9 ++++--- app/package.json | 2 +- app/yarn.lock | 56 +++++++++++++++++++++++++++++++++---------- 4 files changed, 52 insertions(+), 21 deletions(-) diff --git a/app/js/ui/settings.js b/app/js/ui/settings.js index b3f17063..92e91b86 100644 --- a/app/js/ui/settings.js +++ b/app/js/ui/settings.js @@ -507,11 +507,11 @@ function fontList(arg) { var font = arg[i] $('#fonts').append( '
' + - font.family + + font + '
' ) } diff --git a/app/main/system.js b/app/main/system.js index fa7f3556..7f5cedd8 100644 --- a/app/main/system.js +++ b/app/main/system.js @@ -242,11 +242,10 @@ function system(mainWindow, dir, lang, dirname) { fn(data); // ソート後の配列を返す } ipc.on("fonts", (e, arg) => { - const fm = require("font-manager"); - var fonts = fm.getAvailableFontsSync(); - object_array_sort(fonts, "family", "asc", function(fonts_sorted) { - e.sender.webContents.send("font-list", fonts_sorted); - }); + var SystemFonts = require('system-font-families').default; + var fm = new SystemFonts(); + const fontList = fm.getFontsSync(); + e.sender.webContents.send("font-list", fontList); }); //コピー ipc.on("copy", (e, arg) => { diff --git a/app/package.json b/app/package.json index 85cb3fb2..f2c24b1e 100644 --- a/app/package.json +++ b/app/package.json @@ -62,10 +62,10 @@ "materialize-css": "git://github.com/cutls/materialize#v1-dev", "sumchecker": "^3.0.1", "sweetalert2": "^9.10.3", + "system-font-families": "^0.4.1", "vue": "^2.6.11" }, "optionalDependencies": { - "font-manager": "0.3.0", "itunes-nowplaying-mac": "0.3.1" }, "devDependencies": { diff --git a/app/yarn.lock b/app/yarn.lock index 82fcd1d4..ac45b923 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -523,6 +523,23 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== +babel-polyfill@^6.23.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= + dependencies: + babel-runtime "^6.26.0" + core-js "^2.5.0" + regenerator-runtime "^0.10.5" + +babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -837,6 +854,11 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= +core-js@^2.4.0, core-js@^2.5.0: + version "2.6.11" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" + integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== + core-js@^3.4.0, core-js@^3.4.1: version "3.6.4" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.4.tgz#440a83536b458114b9cb2ac1580ba377dc470647" @@ -1240,13 +1262,6 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" -font-manager@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/font-manager/-/font-manager-0.3.0.tgz#9efdc13e521a3d8752e7ab56c3938818043a311f" - integrity sha512-6N3pzO+9kxE3yD9c4VN7reg5fqgFvjcUdxZmwauRzsExaeKRu0APfEi3DOISFakokybgKlZcLFQHawwc2TMpQQ== - dependencies: - nan ">=2.10.0" - for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -1965,11 +1980,6 @@ ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -nan@>=2.10.0: - version "2.14.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" - integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== - node-abi@^2.11.0: version "2.12.0" resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.12.0.tgz#40e9cfabdda1837863fa825e7dfa0b15686adf6f" @@ -2378,6 +2388,16 @@ readline-sync@1.4.10: resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.10.tgz#41df7fbb4b6312d673011594145705bf56d8873b" integrity sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw== +regenerator-runtime@^0.10.5: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.3: version "0.13.3" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5" @@ -2760,6 +2780,14 @@ sweetalert2@^9.10.3: resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-9.10.3.tgz#e2e420173b2dd4133a20023174ad6636a90b6061" integrity sha512-i/lDlar8sSH+/YEQ25NXcs0ASB8Upl4JJqKgFHcDtk62vts2hK6i+iOjyCw02s6feS3Qum+MrOHmZNJPFL/g2g== +system-font-families@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/system-font-families/-/system-font-families-0.4.1.tgz#ea35b06989629603010c0ed02d4ba264bfa3e374" + integrity sha512-XQK5qAYsbEI6SkCEwezRDsPV44T2G4NNQ/xcx7D/8XM3S+rqYlNxsGcLT7vO6vdT4hc/mlRef7S6+KGIetTwdg== + dependencies: + babel-polyfill "^6.23.0" + ttfinfo "https://github.com/rBurgett/ttfinfo.git" + tar@^4.4.12: version "4.4.13" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" @@ -2830,6 +2858,10 @@ tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== +"ttfinfo@https://github.com/rBurgett/ttfinfo.git": + version "0.2.0" + resolved "https://github.com/rBurgett/ttfinfo.git#f00e43e2a6d4c8a12a677df20b7804492d50863c" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"