|
|
@ -116,6 +116,62 @@ const http = require('http'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let src = 'node_modules/Luciole/' |
|
|
|
let src = 'node_modules/Luciole/' |
|
|
|
|
|
|
|
const importLucioleFont = () => { |
|
|
|
|
|
|
|
copySync( |
|
|
|
|
|
|
|
'node_modules/Luciole/Luciole_webfonts/Read Me.txt', |
|
|
|
|
|
|
|
'fonts/vendor/Luciole/Read Me.txt', |
|
|
|
|
|
|
|
{ overwrite: true } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
var arr = [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
name:'Luciole-Regular', |
|
|
|
|
|
|
|
style:'normal', |
|
|
|
|
|
|
|
weight:'normal' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
name:'Luciole-Italic', |
|
|
|
|
|
|
|
style:'italic', |
|
|
|
|
|
|
|
weight:'normal' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
name:'Luciole-Bold', |
|
|
|
|
|
|
|
style:'normal', |
|
|
|
|
|
|
|
weight:'bold' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
name:'Luciole-BoldItalic', |
|
|
|
|
|
|
|
style:'italic', |
|
|
|
|
|
|
|
weight:'bold' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
let css = "/* Webfont: Luciole */\n\n" |
|
|
|
|
|
|
|
arr.forEach((data)=>{ |
|
|
|
|
|
|
|
let name = data.name |
|
|
|
|
|
|
|
copySync( |
|
|
|
|
|
|
|
`node_modules/Luciole/Luciole_webfonts/${name}/${name}.woff`, |
|
|
|
|
|
|
|
`fonts/vendor/Luciole/${name}/${name}.woff`, |
|
|
|
|
|
|
|
{ overwrite: true } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
css += |
|
|
|
|
|
|
|
`/* Webfont: ${name} */
|
|
|
|
|
|
|
|
@font-face { |
|
|
|
|
|
|
|
font-family: 'Luciole'; |
|
|
|
|
|
|
|
src: url('./${name}/${name}.woff') format('woff'); |
|
|
|
|
|
|
|
font-style: ${data.style}; |
|
|
|
|
|
|
|
font-weight: ${data.weight}; |
|
|
|
|
|
|
|
text-rendering: optimizeLegibility; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
` |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
fs.writeFileSync( |
|
|
|
|
|
|
|
path.join( |
|
|
|
|
|
|
|
basePath,
|
|
|
|
|
|
|
|
'fonts/vendor/Luciole/Luciole.css' |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
css |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let currentPath = path.join(basePath, src) |
|
|
|
let currentPath = path.join(basePath, src) |
|
|
|
if (!fs.existsSync(currentPath)) { |
|
|
|
if (!fs.existsSync(currentPath)) { |
|
|
|
fs.mkdirSync(currentPath,{recursive :true}) |
|
|
|
fs.mkdirSync(currentPath,{recursive :true}) |
|
|
@ -129,64 +185,11 @@ const request = http.get("http://www.luciole-vision.com/Fichiers/Luciole_webfont |
|
|
|
var AdmZip = require("adm-zip") |
|
|
|
var AdmZip = require("adm-zip") |
|
|
|
var zip = new AdmZip(zipPath) |
|
|
|
var zip = new AdmZip(zipPath) |
|
|
|
zip.extractAllTo(/*target path*/ currentPath, /*overwrite*/ true) |
|
|
|
zip.extractAllTo(/*target path*/ currentPath, /*overwrite*/ true) |
|
|
|
|
|
|
|
importLucioleFont() |
|
|
|
},500) |
|
|
|
},500) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
copySync( |
|
|
|
|
|
|
|
'node_modules/Luciole/Luciole_webfonts/Read Me.txt', |
|
|
|
|
|
|
|
'fonts/vendor/Luciole/Read Me.txt', |
|
|
|
|
|
|
|
{ overwrite: true } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
var arr = [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
name:'Luciole-Regular', |
|
|
|
|
|
|
|
style:'normal', |
|
|
|
|
|
|
|
weight:'normal' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
name:'Luciole-Italic', |
|
|
|
|
|
|
|
style:'italic', |
|
|
|
|
|
|
|
weight:'normal' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
name:'Luciole-Bold', |
|
|
|
|
|
|
|
style:'normal', |
|
|
|
|
|
|
|
weight:'bold' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
name:'Luciole-BoldItalic', |
|
|
|
|
|
|
|
style:'italic', |
|
|
|
|
|
|
|
weight:'bold' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
let css = "/* Webfont: Luciole */\n\n" |
|
|
|
|
|
|
|
arr.forEach((data)=>{ |
|
|
|
|
|
|
|
let name = data.name |
|
|
|
|
|
|
|
copySync( |
|
|
|
|
|
|
|
`node_modules/Luciole/Luciole_webfonts/${name}/${name}.woff`, |
|
|
|
|
|
|
|
`fonts/vendor/Luciole/${name}/${name}.woff`, |
|
|
|
|
|
|
|
{ overwrite: true } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
css += |
|
|
|
|
|
|
|
`/* Webfont: ${name} */
|
|
|
|
|
|
|
|
@font-face { |
|
|
|
|
|
|
|
font-family: 'Luciole'; |
|
|
|
|
|
|
|
src: url('./${name}/${name}.woff') format('woff'); |
|
|
|
|
|
|
|
font-style: ${data.style}; |
|
|
|
|
|
|
|
font-weight: ${data.weight}; |
|
|
|
|
|
|
|
text-rendering: optimizeLegibility; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
` |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
fs.writeFileSync( |
|
|
|
|
|
|
|
path.join( |
|
|
|
|
|
|
|
basePath,
|
|
|
|
|
|
|
|
'fonts/vendor/Luciole/Luciole.css' |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
css |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// example
|
|
|
|
// example
|
|
|
|
// mergeFilesSync(
|
|
|
|
// mergeFilesSync(
|
|
|
|