Imgflip Logo Icon

Idk why I'm asking for this

Idk why I'm asking for this | There should be more fonts | image tagged in memes,change my mind,imgflip | made w/ Imgflip meme maker
446 views 15 upvotes Made by hak. 4 years ago in imgflip
Change My Mind memeCaption this Meme
28 Comments
6 ups, 4y,
3 replies
It's based on the installed fonts on your computer, so why not list all of them?

If only there were a way to determine installed fonts, but sadly, Javascript does not have that capability. It's possible to loop through known font names to determine the availability of a font within the browser, but that list isn't exhaustive. You can only detect the fonts that you choose to test for.

var Detector =
{
init: function()
{
this.h = document.getElementsByTagName("BODY")[0];
this.d = document.createElement("DIV");
this.s = document.createElement("SPAN");
this.d.appendChild(this.s);
this.d.style.fontFamily = "sans";
this.s.style.fontFamily = "sans";
this.s.style.fontSize = "72px";
this.s.innerHTML = "mmmmmmmmmmlil";
this.h.appendChild(this.d);
this.defaultWidth = this.s.offsetWidth;
this.defaultHeight = this.s.offsetHeight;
this.h.removeChild(this.d)
},
test: function(a)
{
this.h.appendChild(this.d);
var b = [];
b.name = this.s.style.fontFamily = a;
b.width = this.s.offsetWidth;
b.height = this.s.offsetHeight;
this.h.removeChild(this.d);
a = a.toLowerCase();
if (a == "serif") {
b.found = true
} else {
b.found = (b.width != this.defaultWidth || b.height != this.defaultHeight)
}
return b
},
getFontList: function()
{
this.init();
var a = ["cursive", "monospace", "serif", "sans-serif", "fantasy", "default","Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT Bold", "Book Antiqua", "Bookman Old Style", "Bradley Hand ITC", "Bodoni MT", "Calibri", "Century", "Century Gothic", "Casual", "Comic Sans MS", "Consolas", "Copperplate Gothic Bold", "Courier", "Courier New", "English Text MT", "Felix Titling", "Futura", "Garamond", "Geneva", "Georgia", "Gentium", "Haettenschweiler", "Helvetica", "Impact", "Jokerman", "King", "Kootenay", "Latha", "Liberation Serif", "Lucida Console", "Lalit", "Lucida Grande", "Magneto", "Mistral", "Modena", "Monotype Corsiva", "MV Boli", "OCR A Extended", "Onyx", "Palatino Linotype", "Papyrus", "Parchment", "Pericles", "Playbill", "Segoe Print", "Shruti", "Tahoma", "TeX", "Times", "Times New Roman", "Trebuchet MS", "Verdana", "Verona"];
var c = "";
for (i = 0; i < a.length; ++i) {
var b = this.test(a[i]);
if (b.found) {

c += b.name + ","
}
}
return c.slice(0, - 1)
}
};
4 ups, 4y,
1 reply
This guy. Nailing the explanation so we don't have to ;)

This is essentially what we do, it's already a bit slow for your browser to execute though. Might use Google free fonts or something in the future to expand the font selection for all devices.
0 ups, 4y,
2 replies
made w/ Imgflip meme maker
im going to guess this probably wasnt you.
1 up, 4y,
6 replies
Lol, no one who is a global mod would ever need to specify they are a global mod, it will be visible to you. Also, ours mods tend to have good grammar.
1 up, 3y
We have a situation in the LGBTQ stream. Jer-Sama needs owner so he can return the rightful owner to the user.
[deleted]
0 ups, 3y
I need to talk with you in memechat
I'm sure I can call this urgent
0 ups, 4y
It was the user DannyHogan2000 (who deleted and now has Alts)
0 ups, 4y
Also
How many users are there?
0 ups, 4y
XD yeah, tbh it was probably danny.
0 ups, 4y
thank you tho
0 ups, 4y,
1 reply
The Grammar...
1 up, 4y,
1 reply
XD
0 ups, 4y,
1 reply
Moderation at it’s finest today
1 up, 4y
XDDD
2 ups, 4y,
1 reply
Wtf is that
4 ups, 4y,
2 replies
The code necessary to detect fonts available to the browser.
3 ups, 4y,
1 reply
Thanks for sharing. That is something I never knew.
3 ups, 4y
the comment editor messed up the formatting, but it's all there. Call Detector.getFontList() and you're returned a JSON array.
2 ups, 4y
Oh ok
1 up, 3y,
1 reply
I'm on mobile, But I'm not sure if it works by finding fonts you downloaded.
1 up, 3y,
1 reply
You're right. The list is fixed, but if you don't have the fonts installed, the browser uses a default font.
1 up, 3y
OOF.
3 ups, 4y,
2 replies
Do you want more than these? Maybe you can add more fonts to your device?
3 ups, 4y
Ok
2 ups, 3y
I tried doing that on mobile, somehow some fonts I downloaded, needs to be installed.
3 ups, 4y
Yeah! I want different ones than lazy ones on here!
[deleted]
2 ups, 4y
1 up, 3y
Yes
Change My Mind memeCaption this Meme
Created with the Imgflip Meme Generator
IMAGE DESCRIPTION:
There should be more fonts