jQuery-FontSpy.js icon indicating copy to clipboard operation
jQuery-FontSpy.js copied to clipboard

Add updates to prevent FOUC

Open ghost opened this issue 10 years ago • 4 comments

Added a quick example (and doc) on how to hide text block while custom font is loading.

ghost avatar Feb 16 '15 20:02 ghost

This doesn't allow for each font to appear as loaded - couldn't we simply hide/show content based on fontName/no-fontName classes on html element?

patrickmarabeas avatar Feb 16 '15 22:02 patrickmarabeas

Ah your right. What are you thinking for showing/hiding content based on the fontName/no-fontName classes?

ghost avatar Feb 16 '15 22:02 ghost

Ah assumed fontName class was added on success. Could either do that, or add a fontName-loading class

patrickmarabeas avatar Feb 17 '15 09:02 patrickmarabeas

Reworked the styles and JS a bit so there is a class hook to hide elements using custom fonts on load. Then hooked into the fontname class that is added on success/failure to display elements using custom fonts.

ghost avatar Feb 17 '15 15:02 ghost