
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
glyph-segregator
Advanced tools
中文介绍博客 (An introductory blog in Chinese)
A new way to optimize web fonts for a specific static site:
Divide all the glyphs (characters) in a font into two groups: commonly used glyphs and less commonly used glyphs. The decision is based on the estimated cost of putting a glyph in the less commonly used group, which is then based on the estimated probability that a visitor will access each page on the site. For the commonly used glyphs, a single font file will be shared across all pages. For the less commonly used glyphs, each page will have its own unique font file.
Users of glyph-segregator need to provide a list of all pages on the site and the estimated probability for a visitor to access each page, and a URL on which the site is served. glyph-segregator will figure out the glyphs used on each page (by using Headless Chrome), do the glyph division, generate font files, and inject corresponding @font-face CSS into the HTML files in place.
The access probability of each page needs to be estimated by the library user, which can be based on web analytics (Google Analytics, Plausible Analytics, Matomo Analytics, etc.) or heuristics. A glyph is considered commonly used if the aggregated access probability of all pages that use the glyph is greater than 1.
export function glyphSegregator(config: Config): Promise<void>;
See the Config interface and corresponding comments in types.ts for the arguments.
@font-face rules, including font-family values containing the name of the web font.glyphSegregator.glyphSegregator function.Notes:
useCache config to true on daily builds and set it to false on schedule.file:// protocal without running a server.<body> that are not descendants of a <script> or <style> element, and alt attributes of <img> elements.font-stretch, font-style, etc. is currently unsupported.FAQs
A new way to optimize web fonts for a specific site.
We found that glyph-segregator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.