# Icon fonts aren't evil, you just have to care
'define expected-reading 9 min
'define created 19 July 2023
'define edited 19 July 2023
[$pagenav]
.contents
.numbered
1. [url #the-problem-with-svgs The problem with SVGs]
2. [url #icon-fonts Icon fonts]
.numbered
1. [url #text-antialiasing-unavoidable Text antialiasing: unavoidable]
2. [url #better-control-over-svgs-not-always-needed Better control over SVGs: not always needed]
3. [url #fetching-failures-and-accessible-fonts-fixable-with-care Fetching failures and accessible fonts: fixable with care]
4. [url #screen-reader-accessibility-almost-unavoidable Screen reader accessibility: almost unavoidable]
5. [url #file-size-fixable-with-care File size: fixable with care]
Recently I did a [url https://gitlab.com/Syndamia/syndamiadotcom/-/merge_requests/10 whole bunch of changes to the way this website works] and one of them included replacing all SVG icons with an icon font.
While doing research, I found [url https://www.youtube.com/watch?v=9xXBYcWgCHA Seren Davies' talk] as well as [url https://www.irigoyen.dev/blog/2021/02/17/stop-using-icon-fonts/ many] [url http://technotes.iangreenleaf.com/posts/font-awesome-not-awesome.html other] [url https://www.ianfeather.co.uk/ten-reasons-we-switched-from-an-icon-font-to-svg/ posts] being against them.
A lot of these concerns and issues are valid and multiple times I stopped that rework, but in the end I believe, with enough care, you could make them work almost perfectly.
## The problem with SVGs
First, we have to get acquaintanced with why I wanted change: before the big rework, this website used SVG images for all icons.
For [url https://gitlab.com/Syndamia/syndamiadotcom/-/releases/v3.0 quite a while] I've added support for an alternative light theme, but ever since the beginning icons have been an issue.
How can you change the color, or more specifically, the internal styling of an SVG?
You have a [url https://stackoverflow.com/questions/22252472/how-can-i-change-the-color-of-an-svg-element couple of options], if you include it with a normal `[]` tag, as I was doing, you could do some [url https://stackoverflow.com/a/53336754 magic with filters] to change the exact color, though this is kinda difficult and [url https://caniuse.com/css-filters browsers support filters since somewhat recently].
This is a deal-breaker, because I care about older browsers and without that CSS property, icons become very difficult to see on the light theme.
Another option is to load it with an `[\