Add webpack config for font files

This commit is contained in:
j433866 2019-07-02 15:31:29 +01:00
parent f473807459
commit be08a62f52
5 changed files with 14 additions and 6 deletions

View file

@ -1,6 +1,6 @@
info face="Roboto" size=72 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2
common lineHeight=85 base=67 scaleW=512 scaleH=512 pages=1 packed=0
page id=0 file="images/Roboto72White.png"
page id=0 file="Roboto72White.png"
chars count=98
char id=0 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=66 xadvance=0 page=0 chnl=0
char id=10 x=0 y=0 width=70 height=99 xoffset=2 yoffset=-11 xadvance=74 page=0 chnl=0

View file

@ -1,6 +1,6 @@
info face="Roboto Black" size=72 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2
common lineHeight=85 base=67 scaleW=512 scaleH=512 pages=1 packed=0
page id=0 file="images/RobotoBlack72White.png"
page id=0 file="RobotoBlack72White.png"
chars count=98
char id=0 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=66 xadvance=0 page=0 chnl=0
char id=10 x=0 y=0 width=70 height=99 xoffset=2 yoffset=-11 xadvance=74 page=0 chnl=0

View file

@ -1,6 +1,6 @@
info face="Roboto Mono" size=72 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2
common lineHeight=96 base=76 scaleW=512 scaleH=512 pages=1 packed=0
page id=0 file="images/RobotoMono72White.png"
page id=0 file="RobotoMono72White.png"
chars count=98
char id=0 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=75 xadvance=0 page=0 chnl=0
char id=10 x=0 y=0 width=45 height=99 xoffset=-1 yoffset=-2 xadvance=43 page=0 chnl=0

View file

@ -1,6 +1,6 @@
info face="Roboto Slab Regular" size=72 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2
common lineHeight=96 base=76 scaleW=512 scaleH=512 pages=1 packed=0
page id=0 file="images/RobotoSlab72White.png"
page id=0 file="RobotoSlab72White.png"
chars count=98
char id=0 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=75 xadvance=0 page=0 chnl=0
char id=10 x=0 y=0 width=70 height=98 xoffset=0 yoffset=-1 xadvance=70 page=0 chnl=0

View file

@ -104,7 +104,7 @@ module.exports = {
]
},
{
test: /\.(ico|eot|ttf|woff|woff2|fnt)$/,
test: /\.(ico|eot|ttf|woff|woff2)$/,
loader: "url-loader",
options: {
limit: 10000,
@ -119,9 +119,17 @@ module.exports = {
encoding: "base64"
}
},
{ // Store font .fnt and .png files in a separate fonts folder
test: /(\.fnt$|bmfonts\/.+\.png$)/,
loader: "file-loader",
options: {
name: "[name].[ext]",
outputPath: "assets/fonts"
}
},
{ // First party images are saved as files to be cached
test: /\.(png|jpg|gif)$/,
exclude: /node_modules/,
exclude: /(node_modules|bmfonts)/,
loader: "file-loader",
options: {
name: "images/[name].[ext]"