|
112 | 112 |
|
113 | 113 | <h1>CSS Fonts Module Level 3</h1> |
114 | 114 |
|
115 | | - <h2 class="no-num no-toc" id=editors-draft-13-february-2013>Editor's Draft |
116 | | - 13 February 2013</h2> |
| 115 | + <h2 class="no-num no-toc" id=editors-draft-14-february-2013>Editor's Draft |
| 116 | + 14 February 2013</h2> |
117 | 117 |
|
118 | 118 | <dl id=authors> |
119 | 119 | <dt>This version: |
120 | 120 |
|
121 | 121 | <dd><a |
122 | 122 | href="http://dev.w3.org/csswg/css3-fonts/">http://dev.w3.org/csswg/css3-fonts/</a> |
123 | | - <!-- <dd><a href="http://www.w3.org/TR/2013/ED-css3-fonts-20130213/">http://www.w3.org/TR/2013/ED-css3-fonts-20130213/</a> --> |
| 123 | + <!-- <dd><a href="http://www.w3.org/TR/2013/ED-css3-fonts-20130214/">http://www.w3.org/TR/2013/ED-css3-fonts-20130214/</a> --> |
124 | 124 |
|
125 | 125 |
|
126 | 126 | <dt>Latest version: |
@@ -5668,14 +5668,42 @@ <h3 id=font-load-event-examples><span class=secno>9.3 </span>Font load |
5668 | 5668 | } |
5669 | 5669 |
|
5670 | 5670 | function doEditing() { |
5671 | | - |
5672 | 5671 | // content/layout operations that may cause additional font loads |
5673 | | - |
5674 | 5672 | document.fontloader.notifyWhenFontsReady(measureTextElements); |
5675 | 5673 | } |
5676 | 5674 | </pre> |
5677 | 5675 | </div> |
5678 | 5676 |
|
| 5677 | + <div class=example> |
| 5678 | + <p>Unlike the per-font load events, the <code |
| 5679 | + class=idl-code>"loadingdone"</code> event only fires after all font |
| 5680 | + related loads have completed <strong>and</strong> text has been laid out |
| 5681 | + without causing additional font loads:</p> |
| 5682 | + |
| 5683 | + <pre> @font-face { |
| 5684 | + font-family: latin-serif; |
| 5685 | + src: url(latinserif.woff) format("woff"); /* contains no kanji/kana */ |
| 5686 | + } |
| 5687 | + |
| 5688 | + @font-face { |
| 5689 | + font-family: jpn-mincho; |
| 5690 | + src: url(mincho.woff) format("woff"); |
| 5691 | + } |
| 5692 | + |
| 5693 | + body { font-family: latin-serif, jpn-mincho; } |
| 5694 | + |
| 5695 | + <p><a href="https://twitter.com/maji_kichi_/status/292546415685693440/photo/1" style="text-decoration: none;">納豆はいかがでしょうか</a></p> |
| 5696 | +</pre> |
| 5697 | + |
| 5698 | + <p>In this situation, the user agent first downloads ‘<code |
| 5699 | + class=css>latinserif.woff</code>’ and then tries to use this to draw |
| 5700 | + the Japanese text. But because no Japanese glyphs are present in that |
| 5701 | + font, fallback occurs and the font ‘<code |
| 5702 | + class=css>mincho.woff</code>’ is downloaded. Only after the second font |
| 5703 | + is downloaded and the Japanese text laid out does the <code |
| 5704 | + class=idl-code>"loadingdone"</code> event fire.</p> |
| 5705 | + </div> |
| 5706 | + |
5679 | 5707 | <h2 class=no-num id=platform-props-to-css>Appendix A: Mapping platform font |
5680 | 5708 | properties to CSS properties</h2> |
5681 | 5709 |
|
|
0 commit comments