OLD | NEW |
---|---|
1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note: | 1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note: |
2 1) The <head> information in this page is significant, should be uniform | 2 1) The <head> information in this page is significant, should be uniform |
3 across api docs and should be edited only with knowledge of the | 3 across api docs and should be edited only with knowledge of the |
4 templating mechanism. | 4 templating mechanism. |
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a | 5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a |
6 browser, it will be re-generated from the template, json schema and | 6 browser, it will be re-generated from the template, json schema and |
7 authored overview content. | 7 authored overview content. |
8 4) The <body>.innerHTML is also generated by an offline step so that this | 8 4) The <body>.innerHTML is also generated by an offline step so that this |
9 page may easily be indexed by search engines. | 9 page may easily be indexed by search engines. |
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 initToggles(); | 184 initToggles(); |
185 </script> | 185 </script> |
186 <div class="g-unit" id="gc-pagecontent"> | 186 <div class="g-unit" id="gc-pagecontent"> |
187 <div id="pageTitle"> | 187 <div id="pageTitle"> |
188 <h1 class="page_title">chrome.experimental.fontSettings</h1> | 188 <h1 class="page_title">chrome.experimental.fontSettings</h1> |
189 </div> | 189 </div> |
190 <!-- TABLE OF CONTENTS --> | 190 <!-- TABLE OF CONTENTS --> |
191 <div id="toc"> | 191 <div id="toc"> |
192 <h2>Contents</h2> | 192 <h2>Contents</h2> |
193 <ol> | 193 <ol> |
194 <li> | |
195 <a href="#manifest">Manifest</a> | |
196 <ol> | |
197 </ol> | |
198 </li><li> | |
199 <a href="#scripts">Generic Font Families and Scripts</a> | |
200 <ol> | |
201 </ol> | |
202 </li><li> | |
203 <a href="#examples">Examples</a> | |
204 <ol> | |
205 </ol> | |
206 </li> | |
194 <li> | 207 <li> |
195 <a href="#apiReference">API reference: chrome.experimental.fontS ettings</a> | 208 <a href="#apiReference">API reference: chrome.experimental.fontS ettings</a> |
196 <ol> | 209 <ol> |
197 <li> | 210 <li> |
198 <a href="#global-methods">Methods</a> | 211 <a href="#global-methods">Methods</a> |
199 <ol> | 212 <ol> |
200 <li> | 213 <li> |
201 <a href="#method-getDefaultFixedFontSize">getDefaultFixedFontSiz e</a> | 214 <a href="#method-getDefaultFixedFontSize">getDefaultFixedFontSiz e</a> |
202 </li><li> | 215 </li><li> |
203 <a href="#method-getDefaultFontSize">getDefaultFontSize</a> | 216 <a href="#method-getDefaultFontSize">getDefaultFontSize</a> |
(...skipping 27 matching lines...) Expand all Loading... | |
231 </ol> | 244 </ol> |
232 </li> | 245 </li> |
233 </ol> | 246 </ol> |
234 </div> | 247 </div> |
235 <!-- /TABLE OF CONTENTS --> | 248 <!-- /TABLE OF CONTENTS --> |
236 <!-- Standard content lead-in for experimental API pages --> | 249 <!-- Standard content lead-in for experimental API pages --> |
237 <p id="classSummary"> | 250 <p id="classSummary"> |
238 For information on how to use experimental APIs, see the <a href="expe rimental.html">chrome.experimental.* APIs</a> page. | 251 For information on how to use experimental APIs, see the <a href="expe rimental.html">chrome.experimental.* APIs</a> page. |
239 </p> | 252 </p> |
240 <!-- STATIC CONTENT PLACEHOLDER --> | 253 <!-- STATIC CONTENT PLACEHOLDER --> |
241 <div id="static"></div> | 254 <div id="static"><!-- BEGIN AUTHORED CONTENT --> |
255 <p>The Font Settings API allows you to manage Chrome's font settings.</p> | |
256 <h2 id="manifest">Manifest</h2> | |
257 <p>The Font Settings API is currently experimental, so you must declare the | |
258 "experimental" permission to use it. For example:</p> | |
259 <pre>{ | |
260 "name": "My Font Settings Extension", | |
261 "description": "Customize your fonts", | |
262 "version": "0.2", | |
263 "permissions": ["experimental"] | |
264 }</pre> | |
265 <h2 id="scripts">Generic Font Families and Scripts</h2> | |
266 <p>Chrome allows for some font settings to depend on certain generic font | |
267 families and language scripts. For example, the font used for sans-serif | |
268 Simplified Chinese may be different than the font used for serif Japanese.</p> | |
269 <p>The generic font families supported by Chrome are based on | |
270 <a href="http://www.w3.org/TR/CSS21/fonts.html#generic-font-families">CSS generi c font families</a> | |
271 and are listed in the API reference below. When a webpage specifies a generic | |
272 font family, Chrome selects the font based on the corresponding setting. If no | |
273 generic font family is specified, Chrome uses the setting for the "standard" | |
274 generic font family.</p> | |
275 <p>When a webpage specifies a language, Chrome selects the font based on the | |
276 setting for the corresponding language script. If no language is specified, | |
277 Chrome uses the setting for the default, or global, script.</p> | |
278 <p>The supported language scripts are based on ISO 15924 script codes and listed | |
279 in the API reference below. Technically, Chrome settings are not strictly | |
280 per-script but also depend on language. For example, Chrome chooses the font for | |
281 Hangul (ISO 15924 script code "Hang") when a webpage specifies Korean language, | |
282 and uses this font not just for Hangul script but for everything the font | |
283 covers, such as Hanja.</p> | |
284 <h2 id="examples">Examples</h2> | |
285 <p>The following code gets the standard font for Arabic.</p> | |
286 <pre>chrome.experimental.fontSettings.getFontName( | |
287 { genericFamily: 'standard', script: 'Arab' }, | |
288 function(details) { console.log(details.fontName); } | |
289 ); | |
290 </pre> | |
291 <p>The next snippet sets the sans-serif font for Japanese.</p> | |
292 <pre>chrome.experimental.fontSettings.setFontName( | |
293 { genericFamily: 'sansserif', script: 'Hrkt', fontName: 'IPAPGothic' } | |
jungshik at Google
2012/03/28 20:09:45
This is not a documentation issue but the API impl
falken
2012/03/29 06:58:22
Thanks, good idea. I added a little explanation to
| |
294 ); | |
295 </pre> | |
296 <p>You can find a sample extension using the Font Settings API in the | |
297 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension s/docs/examples/api/fontSettings/">examples/api/fontSettings</a> | |
298 directory. For other examples and for help in viewing the source code, see | |
299 <a href="samples.html">Samples</a>.</p> | |
300 <!-- END AUTHORED CONTENT --> | |
301 </div> | |
242 <!-- API PAGE --> | 302 <!-- API PAGE --> |
243 <div class="apiPage"> | 303 <div class="apiPage"> |
244 <a name="apiReference"></a> | 304 <a name="apiReference"></a> |
245 <h2>API reference: chrome.experimental.fontSettings</h2> | 305 <h2>API reference: chrome.experimental.fontSettings</h2> |
246 <!-- PROPERTIES --> | 306 <!-- PROPERTIES --> |
247 <!-- /apiGroup --> | 307 <!-- /apiGroup --> |
248 <!-- METHODS --> | 308 <!-- METHODS --> |
249 <div id="methodsTemplate" class="apiGroup"> | 309 <div id="methodsTemplate" class="apiGroup"> |
250 <a name="global-methods"></a> | 310 <a name="global-methods"></a> |
251 <h3>Methods</h3> | 311 <h3>Methods</h3> |
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1569 _uff=0; | 1629 _uff=0; |
1570 urchinTracker(); | 1630 urchinTracker(); |
1571 } | 1631 } |
1572 catch(e) {/* urchinTracker not available. */} | 1632 catch(e) {/* urchinTracker not available. */} |
1573 </script> | 1633 </script> |
1574 <!-- end analytics --> | 1634 <!-- end analytics --> |
1575 </div> | 1635 </div> |
1576 </div> <!-- /gc-footer --> | 1636 </div> <!-- /gc-footer --> |
1577 </div> <!-- /gc-container --> | 1637 </div> <!-- /gc-container --> |
1578 </body></html> | 1638 </body></html> |
OLD | NEW |