What fonts does KA have built in?
When using createFont() what fonts are fully supported by khan?
I cant just decide to use fantasy or Georgia because not all computers have them?
what fonts are actually builtin within the KA platform?
I believe those would be sans-serif, serif, monospace, fantasy, and cursive.
I guess these are the built in ones, if you can call them that: sans-serif, serif, monospace, fantasy, cursive.
source: exec-pjs.js
println(PFont);
/*
function PFont(e,t){
if(e===qr){e=""}
this.name=e;
if(t===qr){t=0}
this.size=t;
this.glyph=false;
this.ascent=0;
this.descent=0;
this.leading=1.2*t;
var n=e.indexOf(" Italic Bold");
if(n!==-1){e=e.substring(0,n)}
this.style="normal";
var r=e.indexOf(" Italic");
if(r!==-1){e=e.substring(0,r);this.style="italic"}
this.weight="normal";
var i=e.indexOf(" Bold");
if(i!==-1){e=e.substring(0,i);this.weight="bold"}
this.family="sans-serif";
if(e!==qr){
switch(e){
case"sans-serif":case"serif":case"monospace":case"fantasy":case"cursive":
this.family=e;
break;
default:
this.family='"'+e+'", sans-serif';
break
}
}
this.context2d=null;
h(this);
this.css=this.getCSSDefinition();
this.context2d.font=this.css
}
PFont.prototype.getCSSDefinition=function(e,t){
if(e===qr){e=this.size+"px"}
if(t===qr){t=this.leading+"px"}
var n=[this.style,"normal",this.weight,e+"/"+t,this.family];
return n.join(" ")
};
*/
Not sure what that is.
What I mean is:
What fonts does KA use on the website that are built into the website that will look the same one every computer
Fantasy, cursive don't work on my computer
Hmm, that’s odd. I was pretty sure that those were the fonts built in, but I guess it might just depend on what device you have. Maybe try placing a help request on one of your programs, or asking a question on a relevant video/article relating to text (make sure you say that fantasy and cursive don’t work on your computer).
Source: I used my browser font tool to see what font came from where.
Menlo Regular - System
Monaco - System
Courier (monospace) - System
Apple Chancery (cursive) - System
Papyrus (fantasy) - System
Times Roman (serif) - System
Lucida Grande - System
LatoLatin Regular (Lato) (san-serif) - Remote
LatoLatin Bold (Lato bold) (san-serif Bold) - Remote
(PjsEmptyFont) - Remote
"ef51404934aee86faaf2654970b8b466.0a3a86628abd22d7c375.css"
Lato -
url(/fonts/LatoLatin-Regular.woff2) format('woff2')
url(/fonts/LatoLatin-Italic.woff2) format('woff2')
url(/fonts/LatoLatin-Bold.woff2) format('woff2')
url(/fonts/LatoLatin-Black.woff2) format('woff2')
Source Serif Pro -
url(/fonts/SourceSerifPro-Regular-Extended.woff2) format('woff2')
url(/fonts/SourceSerifPro-Regular.woff2) format('woff2')
url(/fonts/SourceSerifPro-Semibold-Extended.woff2) format('woff2')
url(/fonts/SourceSerifPro-Semibold.woff2) format('woff2')
FontAwesome -
url('/fonts/fontawesome-webfont.woff2?v=3.6.7') format('woff2')
url('/fonts/fontawesome-webfont.woff?v=3.6.7') format('woff')
"dc4f1cea1e731c1f7f8e0ff07b58da2b.8db5d598f11a07f48ab2.css"
FreeMono -
url('/fonts/FreeMono.woff?20120503') format('woff')
url('/fonts/FreeMono.ttf?20120503') format('truetype')
url('/fonts/FreeMonoBold.woff?20120503') format('woff')
url('/fonts/FreeMonoBold.ttf?20120503') format('truetype')
url('/fonts/FreeMonoOblique.woff?20120503') format('woff')
url('/fonts/FreeMonoOblique.ttf?20120503') format('truetype')
url('/fonts/FreeMonoBoldOblique.woff?20120503') format('woff')
url('/fonts/FreeMonoBoldOblique.ttf?20120503') format('truetype')
"intro.d0fe2d3794d2a5d4f67f.css"
FontAwesome -
url('/fonts/fontawesome-webfont.woff2?v=3.6.7') format('woff2')
url('/fonts/fontawesome-webfont.woff?v=3.6.7') format('woff')
<inline>
PjsEmptyFont -
url('data:application/x-font-ttf;base64,AAEAAAAKAIAAAwAgT1MvMgAAAAAAAAEoAAAAVmNtYXAAAAAAAAABiAAAACxnbHlmAAAAAAAAAbwAAAAkaGVhZAAAAAAAAACsAAAAOGhoZWEAAAAAAAAA5AAAACRobXR4AAAAAAAAAYAAAAAGbG9jYQAAAAAAAAG0AAAABm1heHAAAAAAAAABCAAAACBuYW1lAAAAAAAAAeAAAAAgcG9zdAAAAAAAAAIAAAAAEAABAAAAAQAAAkgTY18PPPUACwAgAAAAALSRooAAAAAAyld0xgAAAAAAAQABAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAAACAAIAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACMAIwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAMAAQAAAAwABAAgAAAABAAEAAEAAABB//8AAABB////wAABAAAAAAAAAAgAEgAAAAEAAAAAAAAAAAAAAAAxAAABAAAAAAABAAEAAQAAMTcBAQAAAAAAAgAeAAMAAQQJAAEAAAAAAAMAAQQJAAIAAgAAAAAAAQAAAAAAAAAAAAAAAAAA') format('truetype')
The built-in fonts on Khan Academy are:
The reason Cursive, and Fantasy were not working is that they are case sensitive so make sure the first letters of them are lowercase!
Garamond is included as well for PJS programs:
textFont(createFont("Garamond"));
fill(50, 50, 50);
textSize(90);
text("Text", 120, 210);
Garamond = sans-serif or at least I think
`
textFont(createFont("Garamond"));
fill(50, 50, 50);
textSize(90);
text("Text", 120, 210);
textFont(createFont("sans-serif"));
fill(50, 50, 50);
textSize(90)
text("Text", 118, 308);
I've made a list of all the fonts I know of and how to use them. Hope It's helpful. :)
https://www.khanacademy.org/computer-programming/the-library-of-fonts/4676057911705600
Please sign in to leave a comment.