For the record:
This had been caused by a bug in Optifine and any version released after Oct 2, 2017 should include the fix.
If you're on 1.8 or 1.8.9, no new optifine versions have been released since then to this date. In that case, this old workaround still applies:
HD fonts on some systems are bugged. Try to remove either just the fonts from your resource pack or remove your resource pack as a whole.
To remove the HD fonts from your resource pack do this:
1. Open the resource pack .zip
file
2. Go into assets/minecraft/textures
and remove the font
folder
3. Go into assets/minecraft/mcpatcher
and remove the MCfont
folder
If you're on Windows, there's also a video in case you're not sure how to do the above: https://youtu.be/In-VJrpF5UU