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 <p>Although ISO 15924 provides script codes like "Japn" for Japanese and "Kore" |
| 285 for Korean, these codes are newer than "Hrkt" and "Hang" which Chrome continues |
| 286 to use for compatibility purposes.</p> |
| 287 <h2 id="examples">Examples</h2> |
| 288 <p>The following code gets the standard font for Arabic.</p> |
| 289 <pre>chrome.experimental.fontSettings.getFontName( |
| 290 { genericFamily: 'standard', script: 'Arab' }, |
| 291 function(details) { console.log(details.fontName); } |
| 292 ); |
| 293 </pre> |
| 294 <p>The next snippet sets the sans-serif font for Japanese.</p> |
| 295 <pre>chrome.experimental.fontSettings.setFontName( |
| 296 { genericFamily: 'sansserif', script: 'Hrkt', fontName: 'IPAPGothic' } |
| 297 ); |
| 298 </pre> |
| 299 <p>You can find a sample extension using the Font Settings API in the |
| 300 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/api/fontSettings/">examples/api/fontSettings</a> |
| 301 directory. For other examples and for help in viewing the source code, see |
| 302 <a href="samples.html">Samples</a>.</p> |
| 303 <!-- END AUTHORED CONTENT --> |
| 304 </div> |
242 <!-- API PAGE --> | 305 <!-- API PAGE --> |
243 <div class="apiPage"> | 306 <div class="apiPage"> |
244 <a name="apiReference"></a> | 307 <a name="apiReference"></a> |
245 <h2>API reference: chrome.experimental.fontSettings</h2> | 308 <h2>API reference: chrome.experimental.fontSettings</h2> |
246 <!-- PROPERTIES --> | 309 <!-- PROPERTIES --> |
247 <!-- /apiGroup --> | 310 <!-- /apiGroup --> |
248 <!-- METHODS --> | 311 <!-- METHODS --> |
249 <div id="methodsTemplate" class="apiGroup"> | 312 <div id="methodsTemplate" class="apiGroup"> |
250 <a name="global-methods"></a> | 313 <a name="global-methods"></a> |
251 <h3>Methods</h3> | 314 <h3>Methods</h3> |
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 _uff=0; | 1632 _uff=0; |
1570 urchinTracker(); | 1633 urchinTracker(); |
1571 } | 1634 } |
1572 catch(e) {/* urchinTracker not available. */} | 1635 catch(e) {/* urchinTracker not available. */} |
1573 </script> | 1636 </script> |
1574 <!-- end analytics --> | 1637 <!-- end analytics --> |
1575 </div> | 1638 </div> |
1576 </div> <!-- /gc-footer --> | 1639 </div> <!-- /gc-footer --> |
1577 </div> <!-- /gc-container --> | 1640 </div> <!-- /gc-container --> |
1578 </body></html> | 1641 </body></html> |
OLD | NEW |