How to iterate the installed fonts using javascript?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To start off, you might want to check what fonts are installed on the client. Read up on https://www.lalit.org/wordpress/wp-content/uploads/2008/05/fontdetect.js?ver=0.3
You need to have your own list of fonts to check, then you have an array of installed fonts by checking each of the list to see which one is installed.
The difference in widths will tell you the availability of the fonts installed on the client’s computers because the browser will fall back to its default font. So you probably need to do some invisible testing for text widths to determine if a font is installed.