accessing system fonts for document.execCommand?
-
05-07-2021 - |
题
So I am using execCommand (with FontName command) on a text edit area (much like TinyMC editor), but I am not sure how to access the list of most common system fonts on a machine.
Or rather, should one specify certain most common used fonts and expect that they are found on the client machine?
(I did my homework and I didn't find any other thread on this subject).
thanks, Gabstero
解决方案
Here is a link to site with that script: http://www.lalit.org/lab/javascript-css-font-detect/
Usage is pretty simple:
window.onload = function() {
var detective = new Detector();
alert(detective.detect('font name'));
};
On my project it helped me a lot.
不隶属于 StackOverflow