From 3efbf5bebdcb07e969d1791176c6f8d8ef8bc813 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 10 Feb 2020 13:15:23 +0530 Subject: [PATCH] fix: Remove font manager until we find alternative - font-manager fails to build on WIndows and Linux --- .travis.yml | 5 ----- models/doctype/Item/Item.js | 1 + models/doctype/PrintSettings/PrintSettings.js | 16 ---------------- package.json | 1 - yarn.lock | 8 +------- 5 files changed, 2 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index 798f9f61..b04546e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,11 +12,6 @@ matrix: services: docker language: generic -addons: - apt: - packages: - - libfontconfig-dev - cache: directories: - node_modules diff --git a/models/doctype/Item/Item.js b/models/doctype/Item/Item.js index 80a6991f..8f05171e 100644 --- a/models/doctype/Item/Item.js +++ b/models/doctype/Item/Item.js @@ -22,6 +22,7 @@ module.exports = { { fieldname: 'description', label: 'Description', + placeholder: 'Item Description', fieldtype: 'Text' }, { diff --git a/models/doctype/PrintSettings/PrintSettings.js b/models/doctype/PrintSettings/PrintSettings.js index 89a5611b..17e69c9e 100644 --- a/models/doctype/PrintSettings/PrintSettings.js +++ b/models/doctype/PrintSettings/PrintSettings.js @@ -1,7 +1,4 @@ const theme = require('@/theme'); -const fontManager = require('font-manager'); -const uniq = require('lodash/uniq'); -let fonts = []; module.exports = { name: 'PrintSettings', @@ -94,18 +91,6 @@ module.exports = { fieldname: 'font', label: 'Font', fieldtype: 'AutoComplete', - getList() { - return new Promise(resolve => { - if (fonts.length > 0) { - resolve(fonts); - } else { - fontManager.getAvailableFonts(_fonts => { - fonts = ['Inter'].concat(uniq(_fonts.map(f => f.family)).sort()); - resolve(fonts); - }); - } - }); - }, default: 'Inter' } ], @@ -114,7 +99,6 @@ module.exports = { 'displayLogo', 'template', 'color', - 'font', 'email', 'phone', 'address', diff --git a/package.json b/package.json index b261aea0..ffdb9d20 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "@popperjs/core": "^2.0.3", "core-js": "^3.4.3", "electron-store": "^5.1.0", - "font-manager": "https://github.com/q-lukasz/font-manager#issue-45--compile-error-mac-os-x--node-13-7", "frappe-charts": "^1.3.0", "frappejs": "https://github.com/frappe/frappejs", "knex": "^0.20.4", diff --git a/yarn.lock b/yarn.lock index d8fe873c..ff0a029b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4830,12 +4830,6 @@ follow-redirects@^1.0.0: dependencies: debug "^3.0.0" -"font-manager@https://github.com/q-lukasz/font-manager#issue-45--compile-error-mac-os-x--node-13-7": - version "0.3.1" - resolved "https://github.com/q-lukasz/font-manager#523d3b3c2b535a5003c2a631bf6d2ec342cc6c8f" - dependencies: - nan ">=2.14.0" - for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -7294,7 +7288,7 @@ mz@^2.4.0: object-assign "^4.0.1" thenify-all "^1.0.0" -nan@>=2.14.0, nan@^2.12.1: +nan@^2.12.1: version "2.14.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==