From ccdf5db3243ded53b4c269a35b432d7ef6fa8075 Mon Sep 17 00:00:00 2001 From: Marek Date: Fri, 16 Nov 2018 15:54:54 +0100 Subject: [PATCH] loading the corresponding font-weight --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 058eb8c..cc5a88d 100644 --- a/index.js +++ b/index.js @@ -6,8 +6,10 @@ module.exports = { var _this = this var fontFamily = this.getOption('fontFamily') - var regular = new FontFaceObserver(fontFamily).load() - var bold = new FontFaceObserver(fontFamily, { weight: 'bold' }).load() + var fontWeight = this.getOption('fontWeight') + var fontWeightBold = this.getOption('fontWeightBold') + var regular = new FontFaceObserver(fontFamily, { weight: fontWeight }).load() + var bold = new FontFaceObserver(fontFamily, { weight: fontWeightBold }).load() return regular.constructor.all([regular, bold]).then( function() {