fonttools VS purgecss

Compare fonttools vs purgecss and see what are their differences.

fonttools

A library to manipulate font files from Python. (by fonttools)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
fonttools purgecss
17 51
4,022 7,638
1.9% 0.4%
9.9 8.1
6 days ago 7 days ago
Python TypeScript
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

fonttools

Posts with mentions or reviews of fonttools. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-09-08.
  • The new Google Fonts: find what you’re looking for
    8 projects | news.ycombinator.com | 8 Sep 2023
    The tool parent and sibling comment listed allows you to do basic subsetting [1], and generates the formats you need. If you do this more often, it is of course useful to learn how to do this yourself. A commonly used tool is pyftsubset, part of fonttools [2]

    [1]: https://fonts.google.com/knowledge/glossary/subsetting

    [2]: https://github.com/fonttools/fonttools

  • Retro Pixel Font - A new font and the intro of how to make it
    2 projects | /r/fonts | 7 Feb 2023
    In short, I draw glyphs in png and use python to build fonts (by https://github.com/fonttools/fonttools ). I agreed on some rules and then everything became simple. No required professional font editer.
  • I created a language for font design using FontForge
    3 projects | /r/FontForge | 24 Oct 2022
  • Self-Hosting Fonts - No more excuses
    4 projects | dev.to | 29 Sep 2022
    What I like the most is that you can also download google-fonts and convert them automatically. Webfont-Kit-Generator uses fonttools (written in Python), that's pretty cool too.
  • How much do custom fonts affect an app size?
    3 projects | /r/iOSProgramming | 19 Jul 2022
    A drawback to icon fonts is that by default, you are carrying all of the glyphs in an icon font along for the ride. You can mitigate that by using a tool like fonttools to strip out the unused font glyphs.
  • Montserrat cyrillic issues?
    5 projects | /r/fonts | 17 Mar 2022
    If you want to look inside a font file, you can use the ttx command line tool (included with fontTools) to convert binary fonts to human-readable XML format. You can also open them in a font editor like FontForge or Glyphs if you want a GUI, but font editors may not show you everything that's inside the file.
  • 10 ways to speed up web font loading
    2 projects | dev.to | 10 Feb 2022
    Font subsetting means trimming your fonts down to only the characters you need. Subsetting can yield massive amounts of size savings without having any drawbacks as long as you are not using the characters you remove. The simplest way to do this is subsetting to remove languages that you do not use. For example, take Inter, one of the most popular fonts. If you include all languages, which includes the Latin alphabet, Cyrillic, Vietnamese, and Greek, the size of the WOFF2 font is 95kb. However, chances are you are not using all of those languages. If you remove all characters outside of the English language, the size is reduced to just 16kb! There are many ways to subset fonts, including Google Fonts (and by extension, Google Webfonts Helper), Everything Fonts, and fontTools.
  • The pdfplumber module is awesome
    2 projects | /r/Python | 18 Nov 2021
    If you're in the first case, here's a good place to start reading: https://github.com/adobe-type-tools/cmap-resources. If you're in either the second or the third case, you'll have to use a library like fontTools (see here: https://github.com/fonttools/fonttools) to query the font's cmap table in reverse---if the subsetter didn't strip it out when embedding the font, that is! Note that this isn't guaranteed to work or yield a unique result, especially with non-Latin scripts.
  • How I reduced Raveberry's transferred frontend code by 90%
    10 projects | /r/Raveberry | 3 Apr 2021
    Similar to the approach used for the css code, the fonts were also modified to only contain used symbols. A script parses html and javascript files to find used identifiers. Then, fonttools is used to create a subtyped font file with only these symbols. Since Raveberry only uses a small set of icons and Font Awesome provides a lot of them, this approach eliminates the vast majority. The resulting font files are 6.7KB and 2.3KB, much smaller than the original ones.

purgecss

Posts with mentions or reviews of purgecss. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-17.
  • Optimize CSS with SAT Solving
    5 projects | news.ycombinator.com | 17 Mar 2024
    As a starting point, Tailwind used to use PurgeCSS [0] but I'm not sure what they use now.

    [0] https://purgecss.com

  • Frontend development roadmap
    9 projects | /r/learnprogramming | 2 Oct 2023
    PurgeCss
  • Removing unused CSS in a Django template-based project
    3 projects | dev.to | 4 Feb 2023
    When I searched online I couldn't find an "industry standard" solution to this problem. What I ended up doing was using the popular tool PurgeCSS along with a quick Python script to generate the appropriate command. What the PurgeCSS tool does is search for all your HTML files, gather all the CSS classes used, and then "purge" all the unused ones from the CSS file. You just need to declare all the HTML files you have.
  • 23 of the best Eleventy Themes (Starters) for 2023
    30 projects | dev.to | 10 Jan 2023
    Skeleventy gives you a rock-solid foundation to build fast and accessible static websites, with clean, understated design. Features include a minimal build pipeline with Laravel Mix, the Sass-powered utility class generator Gorko, Purge CSS, an HTML minifier, SEO-friendly page metadata, image lazy loading, responsive navigation, and an XML sitemap.
  • Eliminating unused selectors from Sass
    2 projects | dev.to | 2 Nov 2022
  • Workplaces for digital nomads: the frontend
    9 projects | dev.to | 1 Nov 2022
    Unable to get rid of unused styles. Importing components individually and setting styles in SASS can greatly simplify builds, but several common unused styles can't be deleted using PurgeCSS and analogues due to dynamic class names.
  • Does My Website Look Big in This? Six Tips to Lower your Page Weight
    3 projects | dev.to | 20 Oct 2022
    If you’re hand-crafting your CSS, using only the exact classes you need, you’ll still probably find that your CSS file size grows as your site does. But it doesn’t need to grow too much — you can remove unused classes with tools like Purge CSS .
  • Artisanal Web Development
    2 projects | dev.to | 11 Oct 2022
    Joost interprets this approach as deliberately avoiding frameworks that ‘simplify’ code by including predefined classes and functions that are shipped client-side, even if they’re not used. In principle you’d think these frameworks would be helpful, and they certainly can be, on the development side. The trouble is, unless they’re pared back with additional tooling (like PurgeCSS, for example), even well designed and developed sites can bloat significantly.
  • How to improve the PageSpeed score of your Nuxt.js website in 6 steps
    8 projects | dev.to | 18 Jul 2022
    Purge CSS is another great option to keep your stylesheet size low and increase the PageSpeed score. It's especially useful if you're importing some 3rd party stylesheets and would like to use only what's required. The configuration usually takes a bit of tinkering to get right, but it's definitely worth the effort.
  • Remove unused CSS with PurgeCSS
    2 projects | dev.to | 15 Jul 2022
    Check out PrugeCSS

What are some alternatives?

When comparing fonttools and purgecss you can also consider the following projects:

vue-vite-starter-template - A single page app Vite starter template, created to easily bootstrap Vue.js 2 apps

cssnano - A modular minifier, built on top of the PostCSS ecosystem.

PostCSS - Transforming styles with JS plugins

esbuild-loader - Webpack loader for esbuild: Speed up your build ⚡️

snarkdown - :smirk_cat: A snarky 1kb Markdown parser written in JavaScript

purifycss - Remove unused CSS. Also works with single-page apps.

twin.macro - 🦹‍♂️ Twin blends the magic of Tailwind with the flexibility of css-in-js (emotion, styled-components, solid-styled-components, stitches and goober) at build time.

storybook - Storybook is a frontend workshop for building UI components and pages in isolation. Made for UI development, testing, and documentation.

tailwindcss-jit

PrismJS - Lightweight, robust, elegant syntax highlighting.

uncss - Remove unused styles from CSS

Ahoy - Simple, powerful, first-party analytics for Rails