Skip to content

Commit be08a62

Browse files
committed
Add webpack config for font files
1 parent f473807 commit be08a62

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

src/web/static/fonts/bmfonts/Roboto72White.fnt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
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
22
common lineHeight=85 base=67 scaleW=512 scaleH=512 pages=1 packed=0
3-
page id=0 file="images/Roboto72White.png"
3+
page id=0 file="Roboto72White.png"
44
chars count=98
55
char id=0 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=66 xadvance=0 page=0 chnl=0
66
char id=10 x=0 y=0 width=70 height=99 xoffset=2 yoffset=-11 xadvance=74 page=0 chnl=0

src/web/static/fonts/bmfonts/RobotoBlack72White.fnt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
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
22
common lineHeight=85 base=67 scaleW=512 scaleH=512 pages=1 packed=0
3-
page id=0 file="images/RobotoBlack72White.png"
3+
page id=0 file="RobotoBlack72White.png"
44
chars count=98
55
char id=0 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=66 xadvance=0 page=0 chnl=0
66
char id=10 x=0 y=0 width=70 height=99 xoffset=2 yoffset=-11 xadvance=74 page=0 chnl=0

src/web/static/fonts/bmfonts/RobotoMono72White.fnt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
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
22
common lineHeight=96 base=76 scaleW=512 scaleH=512 pages=1 packed=0
3-
page id=0 file="images/RobotoMono72White.png"
3+
page id=0 file="RobotoMono72White.png"
44
chars count=98
55
char id=0 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=75 xadvance=0 page=0 chnl=0
66
char id=10 x=0 y=0 width=45 height=99 xoffset=-1 yoffset=-2 xadvance=43 page=0 chnl=0

src/web/static/fonts/bmfonts/RobotoSlab72White.fnt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
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
22
common lineHeight=96 base=76 scaleW=512 scaleH=512 pages=1 packed=0
3-
page id=0 file="images/RobotoSlab72White.png"
3+
page id=0 file="RobotoSlab72White.png"
44
chars count=98
55
char id=0 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=75 xadvance=0 page=0 chnl=0
66
char id=10 x=0 y=0 width=70 height=98 xoffset=0 yoffset=-1 xadvance=70 page=0 chnl=0

webpack.config.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ module.exports = {
104104
]
105105
},
106106
{
107-
test: /\.(ico|eot|ttf|woff|woff2|fnt)$/,
107+
test: /\.(ico|eot|ttf|woff|woff2)$/,
108108
loader: "url-loader",
109109
options: {
110110
limit: 10000,
@@ -119,9 +119,17 @@ module.exports = {
119119
encoding: "base64"
120120
}
121121
},
122+
{ // Store font .fnt and .png files in a separate fonts folder
123+
test: /(\.fnt$|bmfonts\/.+\.png$)/,
124+
loader: "file-loader",
125+
options: {
126+
name: "[name].[ext]",
127+
outputPath: "assets/fonts"
128+
}
129+
},
122130
{ // First party images are saved as files to be cached
123131
test: /\.(png|jpg|gif)$/,
124-
exclude: /node_modules/,
132+
exclude: /(node_modules|bmfonts)/,
125133
loader: "file-loader",
126134
options: {
127135
name: "images/[name].[ext]"

0 commit comments

Comments
 (0)