Icon font libraries
PurgeTSS ships with four official icon font families. Alloy projects can use their preconfigured TSS classes; Classic projects can install the same font files and use their fontFamily and Unicode values directly, without adopting the PurgeTSS styling workflow.
- Font Awesome 7 Free (upgrade with
purgetss il -v=fa) - Framework 7 Icons
- Material Icons
- Material Symbols
Older versions of PurgeTSS bundled additional libraries (Bootstrap Icons, Boxicons, LineIcons, Tabler Icons). They were removed to make maintenance easier, but you can recreate them at the bottom of this page.
Icon families reference
Each family ships one or more variant classes, each pointing to a specific font file. Combine a variant class with an icon class to render a glyph. For example, msr ms-home uses the Material Symbols Rounded font with the home icon.
| Family | Variant | Class | fontFamily |
|---|---|---|---|
| Material Symbols | Outlined (default) | .ms | MaterialSymbolsOutlined-Regular |
| Material Symbols | Outlined (alias) | .mso | MaterialSymbolsOutlined-Regular |
| Material Symbols | Rounded | .msr | MaterialSymbolsRounded-Regular |
| Material Symbols | Sharp | .mss | MaterialSymbolsSharp-Regular |
| Font Awesome | Solid (default) | .fa | FontAwesome7Free-Solid |
| Font Awesome | Solid (alias) | .fas | FontAwesome7Free-Solid |
| Font Awesome | Regular | .far | FontAwesome7Free-Regular |
| Font Awesome | Brands | .fab | FontAwesome7Brands-Regular |
| Material Icons | Regular | .mi | MaterialIcons-Regular |
| Framework 7 | Regular | .f7 | Framework7-Icons |
Across a family, the icon class is shared by every variant. For Material Symbols, there is one ms-home class; pair it with .ms, .mso, .msr, or .mss to pick the shape (outlined, rounded, or sharp). FontAwesome works the same way: fa-home pairs with .fa/.fas (Solid) or .far (Regular), while brand icons like fa-github need .fab. The variant class chooses the font file. The icon class chooses the glyph.
Full class lists
The complete class definitions live in the PurgeTSS dist/ folder:
Installing the icon fonts
Run icon-library to copy the .ttf files into the native font folder for the detected layout:
- Alloy:
app/assets/fonts/ - Classic:
Resources/fonts/
In Alloy, the icon classes from the table above work once the fonts are installed. In Classic, use fontFamily directly and either a raw Unicode value or the optional CommonJS module.
# All four families
$ purgetss icon-library
# Selective install
$ purgetss il -v=fa,mi,ms,f7
PurgeTSS already knows every official icon class and resolves them at compile time from its own bundled dist/ files. You do not need fontawesome.tss, materialsymbols.tss, materialicons.tss, or framework7icons.tss inside ./purgetss/styles/ for class="fas fa-home" (or any other icon class) to work in your XML and controllers. Install the .ttf files with icon-library and the classes are ready.
The resolved classes are written to the generated app/styles/app.tss, not to purgetss/styles/utilities.tss. If you go looking for a class like .ms-home, check app.tss.
Classic projects do not run this class-resolution step. The command installs only the native font resources and any requested JavaScript module.
Optional flags
Two optional flags adjust what icon-library copies into your project:
-s, --styles: Alloy only. Copies the official.tsssource files into./purgetss/styles/for reference. In Classic it is skipped and no TSS file is created.-m, --module: copies the matching CommonJS module into./app/lib/on Alloy or./Resources/lib/on Classic. It exposes each icon's Unicode string to JavaScript.
# Add either flag when you want them
$ purgetss il -s
$ purgetss il -m
$ purgetss il -m -s
Using an installed icon in Classic
The CommonJS module lets a Classic app avoid hard-coded Unicode strings:
const fontAwesome = require('lib/fontawesome')
const home = Ti.UI.createLabel({
text: fontAwesome.icons.home,
font: {
fontFamily: fontAwesome.solid,
fontSize: 24
}
})
Each module exposes families plus direct aliases for its variants. families is the stable, consistent form; the direct aliases keep the common cases concise.
| Module | Aliases |
|---|---|
fontawesome | solid, regular, brands |
materialicons | regular, outlined, round, sharp, twoTone |
materialsymbols | outlined, rounded, sharp |
framework7icons | fontFamily |
Every module also provides families.default. For example, fontAwesome.families.solid is the same value as fontAwesome.solid.
The module filename follows the selected library (fontawesome, materialicons, materialsymbols, or framework7icons).
In Classic, every generated module is inside Resources/lib/, so include lib/ in its require() path:
const fontAwesome = require('lib/fontawesome')
const materialIcons = require('lib/materialicons')
const materialSymbols = require('lib/materialsymbols')
const framework7Icons = require('lib/framework7icons')
The path is relative to Resources/; do not include Resources/ or the .js extension. This is the resolution rule documented in Titanium's official CommonJS Modules guide.
Using icons in Alloy XML
The variant class sets the fontFamily. The icon class sets the glyph (text / title). Apply both together:
<Alloy>
<Window>
<View class="grid">
<View class="vertical mx-auto grid-cols-2 gap-y-2">
<!-- Material Symbols variants -->
<Label class="mt-2 text-gray-700" text="Material Symbols" />
<Button class="ms ms-home my-1 h-10 w-10 text-xl text-blue-500" />
<Button class="msr ms-home my-1 h-10 w-10 text-xl text-blue-500" />
<Button class="mss ms-home my-1 h-10 w-10 text-xl text-blue-500" />
</View>
<View class="vertical mx-auto grid-cols-2 gap-y-2">
<!-- FontAwesome variants -->
<Label class="mt-2 text-gray-700" text="Font Awesome" />
<Button class="fas fa-home my-1 h-10 w-10 text-xl text-blue-500" />
<Button class="far fa-bell my-1 h-10 w-10 text-xl text-blue-500" />
<Button class="fab fa-github my-1 h-10 w-10 text-xl text-blue-500" />
</View>
</View>
</Window>
</Alloy>
Complete example with all four families
A side-by-side example using all four official families.
To use this file:
- Copy the content of
index.xmlinto a new Alloy project. - Install the official icon font files using
purgetss icon-library.- Without
--vendor, PurgeTSS copies all official icon fonts.
- Without
- Run
purgetssonce to generate the required files. - Compile your app as usual.
- Use
liveviewif you want faster testing.
<Alloy>
<Window>
<View class="grid">
<View class="vertical mx-auto grid-cols-2 gap-y-2">
<!-- FontAwesome -->
<Label class="mt-2 text-gray-700" text="FontAwesome" />
<Button class="fa fa-home my-1 h-10 w-10 text-xl text-blue-500" />
<Button class="fa fa-home my-1 h-10 w-10 rounded bg-blue-500 text-xl text-white" />
</View>
<View class="vertical mx-auto grid-cols-2 gap-y-2">
<!-- Material Icons -->
<Label class="mt-2 text-gray-700" text="Material Icons" />
<Button class="mi mi-home my-1 h-10 w-10 text-xl text-blue-500" />
<Button class="mi mi-home my-1 h-10 w-10 rounded bg-blue-500 text-xl text-white" />
</View>
<View class="vertical mx-auto grid-cols-2 gap-y-2">
<!-- Material Symbol -->
<Label class="mt-2 text-gray-700" text="Material Symbol" />
<Button class="ms ms-home my-1 h-10 w-10 text-xl text-blue-500" />
<Button class="ms ms-home my-1 h-10 w-10 rounded bg-blue-500 text-xl text-white" />
</View>
<View class="vertical mx-auto grid-cols-2 gap-y-2">
<!-- Framework7-Icons -->
<Label class="mt-2 text-gray-700" text="Framework7-Icons" />
<Button class="f7 f7-house my-1 h-10 w-10 text-xl text-blue-500" />
<Button class="f7 f7-house my-1 h-10 w-10 rounded bg-blue-500 text-xl text-white" />
</View>
</View>
</Window>
</Alloy>
// PurgeTSS v7.10.2
// Created by César Estrada
// https://purgetss.com
/* Ti Elements */
'View': { width: Ti.UI.SIZE, height: Ti.UI.SIZE }
'Window': { backgroundColor: '#FFFFFF' }
/* Main Styles */
'.bg-blue-500': { backgroundColor: '#3b82f6' }
'.gap-y-2': { top: 8, bottom: 8 }
'.grid': { layout: 'horizontal', width: '100%' }
'.grid-cols-2': { width: '50%' }
'.h-10': { height: 40 }
'.mt-2': { top: 8 }
'.mx-auto': { right: null, left: null }
'.my-1': { top: 4, bottom: 4 }
'.rounded': { borderRadius: 4 }
'.text-blue-500': { color: '#3b82f6', textColor: '#3b82f6' }
'.text-gray-700': { color: '#374151', textColor: '#374151' }
'.text-white': { color: '#ffffff', textColor: '#ffffff' }
'.text-xl': { font: { fontSize: 20 } }
'.vertical': { layout: 'vertical' }
'.w-10': { width: 40 }
/* Default Font Awesome */
'.fa': { font: { fontFamily: 'FontAwesome7Free-Solid' } }
'.fa-home': { text: '\uf015', title: '\uf015' }
/* Material Icons */
'.mi': { font: { fontFamily: 'MaterialIcons-Regular' } }
'.mi-home': { text: '\ue88a', title: '\ue88a' }
/* Material Symbols */
'.ms': { font: { fontFamily: 'MaterialSymbolsOutlined-Regular' } }
'.ms-home': { text: '\ue88a', title: '\ue88a' }
/* Framework7 */
'.f7': { font: { fontFamily: 'Framework7-Icons' } }
'.f7-house': { text: 'house', title: 'house' }

Maintaining bundled Font Awesome Free
PurgeTSS 7.20.1 generates Free font families from the desktop fonts' internal PostScript metadata, using the same names in TSS, JavaScript aliases and copied files. Application users receive these bundled files with purgetss icon-library --vendor=fa; they do not need to download OTFs or install the npm icon package separately.
When updating Font Awesome inside the PurgeTSS source repository:
- Install the desired
@fortawesome/fontawesome-freeversion. Its CSS supplies the icon definitions. - Download the matching Free desktop fonts and replace the previous set in
src/fonts/with exactly one Solid, Regular and Brands OTF. This remains a manual step; the npm package's webfonts are not the source for these desktop font copies. - Run the targeted distribution builders:
npm run build:fa
npm run build:fa-js
npm run build:fonts
These builders validate the source fonts against the installed npm version. Missing faces, duplicate faces, unreadable version metadata or a version mismatch stop the affected builder before it replaces its Free outputs. Font-family names and copied filenames are derived from the fonts; both Free header templates receive the installed package version automatically. You no longer edit free-template.js.cjs, free-template.tss or the Free family names when updating the library. Keep the manual OTFs aligned with the npm dependency.
The bundled copies retain the existing .ttf filename convention; copying does not convert the OTF format. Obsolete generated Free filenames are removed from the distribution's font folder when family names change.
Maintaining Framework7 and Material headers
In PurgeTSS 7.20.1, these distribution builders also generate both TSS and JavaScript headers automatically:
| Library | Header version source | Icon definitions |
|---|---|---|
| Framework7 Icons | Installed framework7-icons/package.json | SVG names from that package, rendered as ligatures |
| Material Icons | Version metadata of each bundled font variant | Files in lib/templates/materialicons/*.codepoints |
| Material Symbols | Version metadata of each bundled font variant | Files in lib/templates/materialsymbols/*.codepoints |
This is a contributor workflow inside the PurgeTSS repository. For Framework7, update the npm dependency. For Material Icons/Symbols, continue replacing the desktop fonts in assets/fonts/ and their matching .codepoints files manually, using the same upstream revision for each pair. Their icon classes are not generated from CSS.
npm run build:framework7
npm run build:framework7-js
npm run build:material
npm run build:material-js
npm run build:symbols
npm run build:symbols-js
Run only the pair for the library you updated, or use the normal full distribution build. You no longer edit version numbers or update dates in these header templates. Missing package versions or missing/unreadable font version metadata stop the affected builders.
Material variants can carry different internal versions; some fonts store an ISO timestamp instead of a release number. The generated headers report those values as bundled font versions, preserving their meaning. They do not invent a single Material release version, date the update with the build day, or establish that the separately maintained codepoints match the fonts. Class generation and public family aliases are preserved.
Customizing Font Awesome
If you have a Font Awesome Pro account or want to try the Beta, PurgeTSS can generate a custom ./purgetss/styles/fontawesome.tss with the Pro or Beta classes.
Font Awesome Pro
After setting the @fortawesome scope with your token, install it in your project's root folder with npm init and npm install --save-dev @fortawesome/fontawesome-pro. Version 7.1.0 was used for the original example; check the version installed in your project.
To generate a new purgetss/styles/fontawesome.tss, run purgetss build. It also copies the Pro font files into ./app/assets/fonts if needed.
Note: Titanium cannot use Font Awesome duotone icons because each icon uses two glyphs.
Font Awesome 7 Beta
To generate a custom fontawesome.tss file from Font Awesome 7 Beta:
Move the "css" and "webfonts" folders from "fontawesome-pro-7.0.0-beta3-web/":
fontawesome-pro-7.0.0-beta3-web
└─ css
└─ webfonts
Into ./purgetss/fontawesome-beta:
purgetss
└─ fontawesome-beta
├─ css
└─ webfonts
Then run purgetss build to generate your custom fontawesome.tss file and test the new icons.
Pro/Beta font-family compatibility
In published PurgeTSS 7.20.0, the Pro/Beta reset templates select FontAwesome6Pro-*, while generated font filenames use FontAwesome7Pro-* or FontAwesome7Beta-*. A filename does not establish the font's internal PostScript name. Compare the installed font metadata with fontFamily in purgetss/styles/fontawesome.tss and the generated JavaScript module when diagnosing missing glyphs. Regeneration can replace edits to generated files.
PurgeTSS 7.20.1 reads each installed TTF's PostScript name and uses it consistently for TSS, module families and aliases, and copied filenames. Missing optional faces are omitted. The alternate Pro installation under app/lib/node_modules/@fortawesome/fontawesome-pro also generates its JavaScript module. These corrections do not establish device rendering compatibility with every Pro/Beta package; check the actual glyphs on your target platform. The duotone limitation above still applies.
Recreating removed icon libraries
Older versions of PurgeTSS bundled Bootstrap Icons, Boxicons, LineIcons, and Tabler Icons. The list was trimmed to make maintenance easier, but you can rebuild any of them:
- Download the library from its official site:
- Place the
.ttf/.otfand.cssfiles into./purgetss/fonts/<library>/. - Run
purgetss build-fonts.
For the underlying mechanics (how build-fonts reads the .css, options like -m and -f), see Custom fonts.