-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle 2-bytes to 6-bytes unicode characters (#58)
BREAKING CHANGE: automatically includes 2-byte unicode characters with autodetect
- Loading branch information
Showing
10 changed files
with
129 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@font-face { | ||
font-family: 'custom-icon'; | ||
src: url('./custom-icon/custom-icon.eot'); | ||
src: url('./custom-icon/custom-icon.eot#iefix') format('embedded-opentype'), | ||
url('./custom-icon/custom-icon.ttf') format('truetype'), | ||
url('./custom-icon/custom-icon.woff') format('woff'), | ||
url('./custom-icon/custom-icon.svg#custom-icon') format('svg'); | ||
font-weight: normal; | ||
font-style: normal; | ||
font-display: block; | ||
} | ||
|
||
[class^="custom-icon-"], [class*=" custom-icon-"] { | ||
/* use !important to prevent issues with browser extensions that change fonts */ | ||
font-family: 'custom-icon' !important; | ||
speak: never; | ||
font-style: normal; | ||
font-weight: normal; | ||
font-variant: normal; | ||
text-transform: none; | ||
line-height: 1; | ||
|
||
/* Better Font Rendering =========== */ | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
.custom-icon-coffee:before { | ||
content: "\e900"; | ||
} | ||
|
||
.custom-icon-plus:before { | ||
content: "\2b"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require('./custom-icon.css') |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,10 @@ | |
content: '\f0ce'; | ||
} | ||
|
||
.custom-content { | ||
content: '\f0'; /* ð */ | ||
} | ||
|
||
.entry { | ||
background: white; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const FontminPlugin = require('../../lib') | ||
|
||
module.exports = { | ||
entry: `${__dirname}/custom-icon.js`, | ||
output: {filename: 'out.js', path: `${__dirname}/dist`, publicPath: '/test/fixtures/dist/'}, | ||
module: { | ||
rules: [ | ||
{test: /\.(woff|woff2)(\?v=.+)?$/, use: ['file-loader']}, | ||
{test: /\.(svg|ttf|eot|png)(\?v=.+)?$/, use: ['file-loader']}, | ||
{test: /\.css$/, use: ['style-loader', 'css-loader'], include: __dirname}, | ||
], | ||
}, | ||
plugins: [new FontminPlugin()], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters