Skip to content

Commit

Permalink
[css-font-loading] highlight some examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tabatkins committed Jun 6, 2018
1 parent fc83249 commit 1c23d4b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions css-font-loading-3/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ Interaction with CSS Font Loading and Matching</h3>
(This means it must run the same algorithm,
not literally call the value currently stored in the <code>load</code> property of the object.)

<div class="example">
<div class="example" highlight=js>
Fonts are available when they are added to a {{FontFaceSet}}.
Adding a new ''@font-face'' rule to a stylesheet
also adds a new {{FontFace}} to the {{FontFaceSet}} of the {{Document}} object.
Expand Down Expand Up @@ -1071,7 +1071,7 @@ API Examples</h2>
<div class="example">
To show content only after all font loads complete:

<pre>
<pre highlight=js>
document.fonts.ready.then(function() {
var content = document.getElementById("content");
content.style.visibility = "visible";
Expand All @@ -1083,7 +1083,7 @@ API Examples</h2>
Drawing text in a canvas with a downloadable font, explicitly
initiating the font download and drawing upon completion:

<pre>
<pre highlight=js>
function drawStuff() {
var ctx = document.getElementById("c").getContext("2d");

Expand All @@ -1104,7 +1104,7 @@ API Examples</h2>
may already have been downloaded, the measurement procedures need to
occur after those font loads complete:

<pre>
<pre highlight=js>
function measureTextElements() {
// contents can now be measured using the metrics of
// the downloadable font(s)
Expand All @@ -1121,7 +1121,7 @@ API Examples</h2>
The {{loadingdone}} event only fires after all font related loads have completed
<strong>and</strong> text has been laid out without causing additional font loads:

<pre>
<pre highlight=html>
&lt;style>
@font-face {
font-family: latin-serif;
Expand Down

0 comments on commit 1c23d4b

Please sign in to comment.