Socket
Book a DemoInstallSign in
Socket

font-subset-loader

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

font-subset-loader

font subset loader module for webpack

1.0.4
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

font subset loader for webpack

Transforms a TTF font resource so that it contains only a specified subset of glyphs with all other glyphs stripped out.

Install

npm install font-subset-loader fontmin --save-dev

font-subset-loader requires fontmin as a peerDependency. Thus you are able to specify the required version accurately.

david

Usage

Webpack Documentation: Using loaders

Glyphs like ! or , conflict with webpack's query string syntax (i.e. 'font-subset?glyphs=hey,you!'). It is therefore recommended to instead use a query object for passing the glyphs to the loader as a property:

{
	test: /\.ttf$/,
	loader: 'font-subset',
	query: { glyphs: 'hey,you!' }
}
// returns the file content of the subsetted file.ttf
// that contains only the specified glyphs 'h', 'e', 'y', ',', 'o', 'u' and '!'

Usage with other loaders

Process subsetted .ttf files with file-loader:

loaders: [
	{
		test: /\.ttf$/,
		loader: 'file'
	},
	{
		test: /\.ttf$/,
		loader: 'font-subset',
		query: { glyphs: 'hey,you!' }
	}
]

Process subsetted .ttf files with url-loader:

loaders: [
	{
		test: /\.ttf$/,
		loader: 'url'
	},
	{
		test: /\.ttf$/,
		loader: 'font-subset',
		query: { glyphs: 'hey,you!' }
	}
]

License

MIT

FAQs

Package last updated on 03 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.