OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 [ | 5 [ |
6 { | 6 { |
7 "namespace": "experimental.fontSettings", | 7 "namespace": "experimental.fontSettings", |
8 "types": [ | 8 "types": [ |
9 { | 9 { |
10 "id": "FontName", | 10 "id": "FontName", |
11 "type": "object", | 11 "type": "object", |
12 "description": "Represents a font name.", | 12 "description": "Represents a font name.", |
13 "properties": { | 13 "properties": { |
14 "fontName": { | 14 "fontName": { |
15 "type": "string", | 15 "type": "string", |
16 "description": "The font name." | 16 "description": "The font name." |
17 }, | 17 }, |
18 "localizedName": { | 18 "localizedName": { |
19 "type": "string", | 19 "type": "string", |
20 "description": "The font name localized for the current locale." | 20 "description": "The font name localized for the current locale." |
21 } | 21 } |
22 } | 22 } |
| 23 }, |
| 24 { |
| 25 "id": "ScriptCode", |
| 26 "type": "string", |
| 27 "enum": [ "Arab", "Armn", "Beng", "Cans", "Cher", "Cyrl", "Deva", "Ethi"
, "Geor", |
| 28 "Grek", "Gujr", "Guru", "Hang", "Hans", "Hant", "Hebr", "Hrkt"
, "Knda", |
| 29 "Khmr", "Laoo", "Mlym", "Mong", "Mymr", "Orya", "Sinh", "Taml"
, "Telu", |
| 30 "Thaa", "Thai", "Tibt", "Yiii" |
| 31 ], |
| 32 "description": "An ISO 15924 script code." |
| 33 }, |
| 34 { |
| 35 "id": "GenericFamily", |
| 36 "type": "string", |
| 37 "enum": ["standard", "sansserif", "serif", "fixed", "cursive", "fantasy"
], |
| 38 "description": "A CSS generic font family." |
23 } | 39 } |
24 ], | 40 ], |
25 "functions": [ | 41 "functions": [ |
26 { | 42 { |
27 "name": "getFontName", | 43 "name": "getFontName", |
28 "type": "function", | |
29 "description": "Gets the font name of the current setting for a given sc
ript and generic font family.", | 44 "description": "Gets the font name of the current setting for a given sc
ript and generic font family.", |
30 "parameters": [ | 45 "parameters": [ |
31 { | 46 { |
32 "name": "details", | 47 "name": "details", |
33 "type": "object", | 48 "type": "object", |
34 "properties": { | 49 "properties": { |
35 "script": { | 50 "script": { |
36 "type": "string", | 51 "$ref": "ScriptCode", |
37 "enum": [ | 52 "description": "The script for which the font setting should be
retrieved. If omitted, the global script font setting is retrieved.", |
38 "Arab", "Armn", "Beng", "Cans", "Cher", "Cyrl", "Deva", "Eth
i", "Geor", | |
39 "Grek", "Gujr", "Guru", "Hang", "Hans", "Hant", "Hebr", "Hrk
t", "Knda", | |
40 "Khmr", "Laoo", "Mlym", "Mong", "Mymr", "Orya", "Sinh", "Tam
l", "Telu", | |
41 "Thaa", "Thai", "Tibt", "Yiii" | |
42 ], | |
43 "description": "The ISO 15924 script code for which the font set
ting should be retrieved. If omitted, the global script font setting is retrieve
d.", | |
44 "optional": true | 53 "optional": true |
45 }, | 54 }, |
46 "genericFamily": { | 55 "genericFamily": { |
47 "type": "string", | 56 "$ref": "GenericFamily", |
48 "enum": ["standard", "sansserif", "serif", "fixed", "cursive", "
fantasy"], | 57 "description": "The generic font family for which the font setti
ng should be retrieved." |
49 "description": "The CSS generic font family for which the font s
etting should be retrieved." | |
50 } | 58 } |
51 } | 59 } |
52 }, | 60 }, |
53 { | 61 { |
54 "type": "function", | 62 "type": "function", |
55 "name": "callback", | 63 "name": "callback", |
56 "optional": true, | 64 "optional": true, |
57 "parameters": [ | 65 "parameters": [ |
58 { | 66 { |
59 "name": "details", | 67 "name": "details", |
60 "type": "object", | 68 "type": "object", |
61 "properties": { | 69 "properties": { |
62 "fontName": { | 70 "fontName": { |
63 "type": "string", | 71 "type": "string", |
64 "description": "The font name. Rather than the literal font
name preference value, this may be the name of the font that the system resolves
the preference value to. The empty string signifies fallback to the global scri
pt font setting." | 72 "description": "The font name. Rather than the literal font
name preference value, this may be the name of the font that the system resolves
the preference value to. The empty string signifies fallback to the global scri
pt font setting." |
65 } | 73 } |
66 } | 74 } |
67 } | 75 } |
68 ] | 76 ] |
69 } | 77 } |
70 ] | 78 ] |
71 }, | 79 }, |
72 { | 80 { |
73 "name": "setFontName", | 81 "name": "setFontName", |
74 "type": "function", | |
75 "description": "Sets the font name of the current setting for a given sc
ript and generic font family.", | 82 "description": "Sets the font name of the current setting for a given sc
ript and generic font family.", |
76 "parameters": [ | 83 "parameters": [ |
77 { | 84 { |
78 "name": "details", | 85 "name": "details", |
79 "type": "object", | 86 "type": "object", |
80 "properties": { | 87 "properties": { |
81 "script": { | 88 "script": { |
82 "type": "string", | 89 "$ref": "ScriptCode", |
83 "enum": [ | 90 "description": "The script code which the font setting should be
set. If omitted, the global script font setting is set.", |
84 "Arab", "Armn", "Beng", "Cans", "Cher", "Cyrl", "Deva", "Eth
i", "Geor", | |
85 "Grek", "Gujr", "Guru", "Hang", "Hans", "Hant", "Hebr", "Hrk
t", "Knda", | |
86 "Khmr", "Laoo", "Mlym", "Mong", "Mymr", "Orya", "Sinh", "Tam
l", "Telu", | |
87 "Thaa", "Thai", "Tibt", "Yiii" | |
88 ], | |
89 "description": "The ISO 15924 script code for which the font set
ting should be set. If omitted, the global script font setting is set.", | |
90 "optional": true | 91 "optional": true |
91 }, | 92 }, |
92 "genericFamily": { | 93 "genericFamily": { |
93 "type": "string", | 94 "$ref": "GenericFamily", |
94 "enum": ["standard", "sansserif", "serif", "fixed", "cursive", "
fantasy"], | 95 "description": "The generic font family for which the font setti
ng should be set." |
95 "description": "The CSS generic font family for which the font s
etting should be set." | |
96 }, | 96 }, |
97 "fontName": { | 97 "fontName": { |
98 "type": "string", | 98 "type": "string", |
99 "description": "The font name. If a script is specified, the emp
ty string means to fallback to the global script font setting." | 99 "description": "The font name. If a script is specified, the emp
ty string means to fallback to the global script font setting." |
100 } | 100 } |
101 } | 101 } |
102 }, | 102 }, |
103 { | 103 { |
104 "type": "function", | 104 "type": "function", |
105 "name": "callback", | 105 "name": "callback", |
106 "optional": true, | 106 "optional": true, |
107 "parameters": [] | 107 "parameters": [] |
108 } | 108 } |
109 ] | 109 ] |
110 }, | 110 }, |
111 { | 111 { |
112 "name": "getFontList", | 112 "name": "getFontList", |
113 "type": "function", | |
114 "description": "Gets a list of fonts on the system.", | 113 "description": "Gets a list of fonts on the system.", |
115 "parameters": [ | 114 "parameters": [ |
116 { | 115 { |
117 "type": "function", | 116 "type": "function", |
118 "name": "callback", | 117 "name": "callback", |
119 "parameters": [ | 118 "parameters": [ |
120 { | 119 { |
121 "name": "results", | 120 "name": "results", |
122 "type": "array", | 121 "type": "array", |
123 "items": { "$ref": "FontName" } | 122 "items": { "$ref": "FontName" } |
124 } | 123 } |
125 ] | 124 ] |
126 } | 125 } |
127 ] | 126 ] |
128 }, | 127 }, |
129 { | 128 { |
130 "name": "getDefaultFontSize", | 129 "name": "getDefaultFontSize", |
131 "type": "function", | |
132 "description": "Gets the default font size.", | 130 "description": "Gets the default font size.", |
133 "parameters": [ | 131 "parameters": [ |
134 { | 132 { |
135 "name": "details", | 133 "name": "details", |
136 "type": "object", | 134 "type": "object", |
137 "optional": true, | 135 "optional": true, |
138 "description": "This parameter is currently unused." | 136 "description": "This parameter is currently unused." |
139 }, | 137 }, |
140 { | 138 { |
141 "name": "callback", | 139 "name": "callback", |
142 "type": "function", | 140 "type": "function", |
143 "optional": true, | 141 "optional": true, |
144 "parameters": [ | 142 "parameters": [ |
145 { | 143 { |
146 "name": "details", | 144 "name": "details", |
147 "type": "object", | 145 "type": "object", |
148 "properties": { | 146 "properties": { |
149 "pixelSize": { | 147 "pixelSize": { |
150 "type": "integer", | 148 "type": "integer", |
151 "description": "The font size in pixels." | 149 "description": "The font size in pixels." |
152 } | 150 } |
153 } | 151 } |
154 } | 152 } |
155 ] | 153 ] |
156 } | 154 } |
157 ] | 155 ] |
158 }, | 156 }, |
159 { | 157 { |
160 "name": "setDefaultFontSize", | 158 "name": "setDefaultFontSize", |
161 "type": "function", | |
162 "description": "Sets the default font size.", | 159 "description": "Sets the default font size.", |
163 "parameters": [ | 160 "parameters": [ |
164 { | 161 { |
165 "name": "details", | 162 "name": "details", |
166 "type": "object", | 163 "type": "object", |
167 "properties": { | 164 "properties": { |
168 "pixelSize": { | 165 "pixelSize": { |
169 "type": "integer", | 166 "type": "integer", |
170 "description": "The font size in pixels." | 167 "description": "The font size in pixels." |
171 } | 168 } |
172 } | 169 } |
173 }, | 170 }, |
174 { | 171 { |
175 "type": "function", | 172 "type": "function", |
176 "name": "callback", | 173 "name": "callback", |
177 "optional": true, | 174 "optional": true, |
178 "parameters": [] | 175 "parameters": [] |
179 } | 176 } |
180 ] | 177 ] |
181 }, | 178 }, |
182 { | 179 { |
183 "name": "getDefaultFixedFontSize", | 180 "name": "getDefaultFixedFontSize", |
184 "type": "function", | |
185 "description": "Gets the default size for fixed width fonts.", | 181 "description": "Gets the default size for fixed width fonts.", |
186 "parameters": [ | 182 "parameters": [ |
187 { | 183 { |
188 "name": "details", | 184 "name": "details", |
189 "type": "object", | 185 "type": "object", |
190 "optional": true, | 186 "optional": true, |
191 "description": "This parameter is currently unused." | 187 "description": "This parameter is currently unused." |
192 }, | 188 }, |
193 { | 189 { |
194 "name": "callback", | 190 "name": "callback", |
195 "type": "function", | 191 "type": "function", |
196 "optional": true, | 192 "optional": true, |
197 "parameters": [ | 193 "parameters": [ |
198 { | 194 { |
199 "name": "details", | 195 "name": "details", |
200 "type": "object", | 196 "type": "object", |
201 "properties": { | 197 "properties": { |
202 "pixelSize": { | 198 "pixelSize": { |
203 "type": "integer", | 199 "type": "integer", |
204 "description": "The font size in pixels." | 200 "description": "The font size in pixels." |
205 } | 201 } |
206 } | 202 } |
207 } | 203 } |
208 ] | 204 ] |
209 } | 205 } |
210 ] | 206 ] |
211 }, | 207 }, |
212 { | 208 { |
213 "name": "setDefaultFixedFontSize", | 209 "name": "setDefaultFixedFontSize", |
214 "type": "function", | |
215 "description": "Sets the default size for fixed width fonts.", | 210 "description": "Sets the default size for fixed width fonts.", |
216 "parameters": [ | 211 "parameters": [ |
217 { | 212 { |
218 "name": "details", | 213 "name": "details", |
219 "type": "object", | 214 "type": "object", |
220 "properties": { | 215 "properties": { |
221 "pixelSize": { | 216 "pixelSize": { |
222 "type": "integer", | 217 "type": "integer", |
223 "description": "The font size in pixels." | 218 "description": "The font size in pixels." |
224 } | 219 } |
225 } | 220 } |
226 }, | 221 }, |
227 { | 222 { |
228 "type": "function", | 223 "type": "function", |
229 "name": "callback", | 224 "name": "callback", |
230 "optional": true, | 225 "optional": true, |
231 "parameters": [] | 226 "parameters": [] |
232 } | 227 } |
233 ] | 228 ] |
234 }, | 229 }, |
235 { | 230 { |
236 "name": "getMinimumFontSize", | 231 "name": "getMinimumFontSize", |
237 "type": "function", | |
238 "description": "Gets the minimum font size.", | 232 "description": "Gets the minimum font size.", |
239 "parameters": [ | 233 "parameters": [ |
240 { | 234 { |
241 "name": "details", | 235 "name": "details", |
242 "type": "object", | 236 "type": "object", |
243 "optional": true, | 237 "optional": true, |
244 "description": "This parameter is currently unused." | 238 "description": "This parameter is currently unused." |
245 }, | 239 }, |
246 { | 240 { |
247 "name": "callback", | 241 "name": "callback", |
248 "type": "function", | 242 "type": "function", |
249 "optional": true, | 243 "optional": true, |
250 "parameters": [ | 244 "parameters": [ |
251 { | 245 { |
252 "name": "details", | 246 "name": "details", |
253 "type": "object", | 247 "type": "object", |
254 "properties": { | 248 "properties": { |
255 "pixelSize": { | 249 "pixelSize": { |
256 "type": "integer", | 250 "type": "integer", |
257 "description": "The font size in pixels." | 251 "description": "The font size in pixels." |
258 } | 252 } |
259 } | 253 } |
260 } | 254 } |
261 ] | 255 ] |
262 } | 256 } |
263 ] | 257 ] |
264 }, | 258 }, |
265 { | 259 { |
266 "name": "setMinimumFontSize", | 260 "name": "setMinimumFontSize", |
267 "type": "function", | |
268 "description": "Sets the minimum font size.", | 261 "description": "Sets the minimum font size.", |
269 "parameters": [ | 262 "parameters": [ |
270 { | 263 { |
271 "name": "details", | 264 "name": "details", |
272 "type": "object", | 265 "type": "object", |
273 "properties": { | 266 "properties": { |
274 "pixelSize": { | 267 "pixelSize": { |
275 "type": "integer", | 268 "type": "integer", |
276 "description": "The font size in pixels." | 269 "description": "The font size in pixels." |
277 } | 270 } |
278 } | 271 } |
279 }, | 272 }, |
280 { | 273 { |
281 "type": "function", | 274 "type": "function", |
282 "name": "callback", | 275 "name": "callback", |
283 "optional": true, | 276 "optional": true, |
284 "parameters": [] | 277 "parameters": [] |
285 } | 278 } |
286 ] | 279 ] |
287 } | 280 } |
| 281 ], |
| 282 "events": [ |
| 283 { |
| 284 "name": "onFontNameChanged", |
| 285 "description": "Fired when a font name preference changes.", |
| 286 "parameters": [ |
| 287 { |
| 288 "type": "object", |
| 289 "name": "details", |
| 290 "properties": { |
| 291 "fontName": { "type": "string" }, |
| 292 "script": { |
| 293 "$ref": "ScriptCode", |
| 294 "description": "The script code for which the font setting has c
hanged. If omitted, the global script font setting has changed.", |
| 295 "optional": true |
| 296 }, |
| 297 "genericFamily": { |
| 298 "$ref": "GenericFamily", |
| 299 "description": "The generic font family for which the font setti
ng has changed." |
| 300 }, |
| 301 "levelOfControl": { |
| 302 "description": "One of<br><var>not_controllable</var>: cannot be
controlled by any extension<br><var>controlled_by_other_extensions</var>: contr
olled by extensions with higher precedence<br><var>controllable_by_this_extensio
n</var>: can be controlled by this extension<br><var>controlled_by_this_extensio
n</var>: controlled by this extension", |
| 303 "type": "string", |
| 304 "enum": ["not_controllable", "controlled_by_other_extensions", "
controllable_by_this_extension", "controlled_by_this_extension"] |
| 305 } |
| 306 } |
| 307 } |
| 308 ] |
| 309 } |
288 ] | 310 ] |
289 } | 311 } |
290 ] | 312 ] |
OLD | NEW |