Changes
- New option "remove unused glyphs" in the Fonts section (experimental, off by default): the glyphs the page does not draw are removed from the embedded TrueType, WOFF and WOFF2 fonts. The characters kept are those the page text, the CSS-generated content, the list markers and the
text-transformvalues draw, plus their canonical decompositions and compositions, their bidi mirrors and their variation selectors, so a font that shapes them with ligatures or marks keeps the glyphs it needs. A font is left untouched when it is a CFF or a variable font, when it declares aMATHtable, when the rewritten font is not smaller, or when the browser fails to load it. WOFF2 fonts need Brotli in the browser's Compression Streams, available in Firefox 147 and later; in Chrome they are kept as they are. On the sites tested the saved page shrinks by 3% to 30%. - New
%titlecasetemplate function for filenames: the first letter of every word is uppercased, the other letters are left as typed (#2026). - Whitespace runs in a filename are collapsed to a single space after the replacement rules are applied, so a removed character no longer leaves a double space behind (#2025).
- The labels of the options page start with a capital letter (#2013).
Fixes
- The filename replacement rules now match characters outside the Basic Multilingual Plane, so a rule written to remove emojis removes every one of them (#2025).
- The repair of invalid nesting no longer drops the text between displaced siblings: a sentence built as
<div>blocks inside a<p>, one per word, separated by spaces, was saved without its spaces (#1935). - A page holding a very large amount of text no longer fails with
RangeError: Invalid array lengthin the "remove unused fonts" step (#2029). - A stylesheet holding large embedded resources no longer costs a multiple of their size in memory: the
url()codec of the vendored css-tree built every value one character at a time, and the syntax tree kept every intermediate node alive. Contributed by @pirate in single-file-core#10. - A stylesheet modified by the page's scripts no longer loses the rules under a media or container query whose value Firefox serializes as
infinity * 1px, the way styled-components writes an open-ended last breakpoint. - A styled XML document no longer hangs the capture.
- Text can be selected again in the options page on Firefox (#2027).
- The editor configures the path of its zip worker explicitly, so the zip.js 2.8 update no longer makes it fall back to the main thread.