I'm currently developing a font detection library that must be extremely compact in size, perfect for direct inclusion on every page of a website. I've managed to shrink it down quite a bit already (compressed to 417 bytes). Take a look at it on Github.
After pondering further, I realized that I could reduce the size of the library even more (by approximately 10%) if I operate under a few fundamental assumptions:
- It seems impossible to create a functional font file (at least for browsers) without including a space character.
- OR, if by any chance a font sans space character could be produced, then all modern browsers and IE9+ would likely default to using the space character from the fallback font whenever needed.
- In addition, there's a probability that modern browsers and IE9+ might assign different widths to the space character in generic fonts like
serif
andmonospace
, but this requires further testing.
I recently experimented with defining a font devoid of a space
character using FontSquirrel's webfont generator. Despite excluding the space from the Subset selection and disabling 'Fix Missing Glyphs' for space
, FontSquirrel still generated a font containing a space character with a unique width compared to both serif
and monospace
.
While I acknowledge that certain languages may not have a conventional space
character, given the structure of font file formats and definitions, I believe fonts tailored for such languages would still encompass a space
character.
If these hypotheses prove accurate, the library could eliminate the necessity for custom text evaluation, reducing the number of tests from 3 to 2. This adjustment would enhance the library's performance, minimize its memory usage, and result in a new compressed size of approximately 380 bytes or less.
So, esteemed experts in the world of fonts, can you possibly conceive a valid font without a space
character? If such a font exists, I'd appreciate an example for reference.