@@ -925,7 +925,7 @@ Interaction with CSS Font Loading and Matching</h3>
925
925
(This means it must run the same algorithm,
926
926
not literally call the value currently stored in the <code> load</code> property of the object.)
927
927
928
- <div class="example">
928
+ <div class="example" highlight=js >
929
929
Fonts are available when they are added to a {{FontFaceSet}} .
930
930
Adding a new ''@font-face'' rule to a stylesheet
931
931
also adds a new {{FontFace}} to the {{FontFaceSet}} of the {{Document}} object.
@@ -1071,7 +1071,7 @@ API Examples</h2>
1071
1071
<div class="example">
1072
1072
To show content only after all font loads complete:
1073
1073
1074
- <pre>
1074
+ <pre highlight=js >
1075
1075
document.fonts.ready.then(function() {
1076
1076
var content = document.getElementById("content");
1077
1077
content.style.visibility = "visible";
@@ -1083,7 +1083,7 @@ API Examples</h2>
1083
1083
Drawing text in a canvas with a downloadable font, explicitly
1084
1084
initiating the font download and drawing upon completion:
1085
1085
1086
- <pre>
1086
+ <pre highlight=js >
1087
1087
function drawStuff() {
1088
1088
var ctx = document.getElementById("c").getContext("2d");
1089
1089
@@ -1104,7 +1104,7 @@ API Examples</h2>
1104
1104
may already have been downloaded, the measurement procedures need to
1105
1105
occur after those font loads complete:
1106
1106
1107
- <pre>
1107
+ <pre highlight=js >
1108
1108
function measureTextElements() {
1109
1109
// contents can now be measured using the metrics of
1110
1110
// the downloadable font(s)
@@ -1121,7 +1121,7 @@ API Examples</h2>
1121
1121
The {{loadingdone}} event only fires after all font related loads have completed
1122
1122
<strong> and</strong> text has been laid out without causing additional font loads:
1123
1123
1124
- <pre>
1124
+ <pre highlight=html >
1125
1125
<style>
1126
1126
@font-face {
1127
1127
font-family: latin-serif;
0 commit comments