// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"namespace": "fontSettings",
"description": "The fontSettings API.",
"types": [
{
"id": "FontName",
"type": "object",
"description": "Represents a font name.",
"properties": {
"fontName": {
"type": "string",
"description": "The font name."
},
"localizedName": {
"type": "string",
"description": "The font name localized for the current locale."
}
}
},
{
"id": "FakeStringType",
"type": "string",
"description": "Used to test a string type."
},
{
"id": "GenericFamily",
"type": "string",
"enum": ["standard", "sansserif", "serif", "fixed", "cursive", "fantasy"],
"description": "A CSS generic font family."
},
{
"id": "LevelOfControl",
"description": "One of
not_controllable: cannot be controlled by any extension
controlled_by_other_extensions: controlled by extensions with higher precedence
controllable_by_this_extension: can be controlled by this extension
controlled_by_this_extension: controlled by this extension",
"type": "string",
"enum": ["not_controllable", "controlled_by_other_extensions", "controllable_by_this_extension", "controlled_by_this_extension"]
}
],
"functions": [
{
"name": "clearFont",
"description": "Clears the font set by this extension, if any.",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"script": {
"$ref": "FakeStringType",
"description": "The script for which the font should be cleared. If omitted, the global script font setting is cleared.",
"optional": true
},
"genericFamily": {
"$ref": "GenericFamily",
"description": "The generic font family for which the font should be cleared."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "getFont",
"description": "Gets the font for a given script and generic font family.",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"script": {
"$ref": "FakeStringType",
"description": "The script for which the font should be retrieved. If omitted, the font for the global script is retrieved.",
"optional": true
},
"genericFamily": {
"$ref": "GenericFamily",
"description": "The generic font family for which the font should be retrieved."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"fontName": {
"type": "string",
"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 script font setting."
}
}
}
]
}
]
},
{
"name": "setFont",
"description": "Sets the font for a given script and generic font family.",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"script": {
"$ref": "FakeStringType",
"description": "The script code which the font should be set. If omitted, the font for the global script is set.",
"optional": true
},
"genericFamily": {
"$ref": "GenericFamily",
"description": "The generic font family for which the font should be set."
},
"fontName": {
"type": "string",
"description": "The font name. If a script is specified, the empty string means to fallback to the global script font setting."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "getFontList",
"description": "Gets a list of fonts on the system.",
"parameters": [
{
"type": "function",
"name": "callback",
"parameters": [
{
"name": "results",
"type": "array",
"items": { "$ref": "FontName" }
}
]
}
]
},
{
"name": "clearDefaultFontSize",
"description": "Clears the default font size set by this extension, if any.",
"parameters": [
{
"name": "details",
"type": "object",
"optional": true,
"description": "This parameter is currently unused.",
"properties": {}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "getDefaultFontSize",
"description": "Gets the default font size.",
"parameters": [
{
"name": "details",
"type": "object",
"optional": true,
"description": "This parameter is currently unused.",
"properties": {}
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"pixelSize": {
"type": "integer",
"description": "The font size in pixels."
}
}
}
]
}
]
},
{
"name": "setDefaultFontSize",
"description": "Sets the default font size.",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"pixelSize": {
"type": "integer",
"description": "The font size in pixels."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "clearDefaultFixedFontSize",
"description": "Clears the default fixed font size set by this extension, if any.",
"parameters": [
{
"name": "details",
"type": "object",
"optional": true,
"description": "This parameter is currently unused.",
"properties": {}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "getDefaultFixedFontSize",
"description": "Gets the default size for fixed width fonts.",
"parameters": [
{
"name": "details",
"type": "object",
"optional": true,
"description": "This parameter is currently unused.",
"properties": {}
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"pixelSize": {
"type": "integer",
"description": "The font size in pixels."
}
}
}
]
}
]
},
{
"name": "setDefaultFixedFontSize",
"description": "Sets the default size for fixed width fonts.",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"pixelSize": {
"type": "integer",
"description": "The font size in pixels."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "clearMinimumFontSize",
"description": "Clears the minimum font size set by this extension, if any.",
"parameters": [
{
"name": "details",
"type": "object",
"optional": true,
"description": "This parameter is currently unused.",
"properties": {}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "getMinimumFontSize",
"description": "Gets the minimum font size.",
"parameters": [
{
"name": "details",
"type": "object",
"optional": true,
"description": "This parameter is currently unused.",
"properties": {}
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"pixelSize": {
"type": "integer",
"description": "The font size in pixels."
}
}
}
]
}
]
},
{
"name": "setMinimumFontSize",
"description": "Sets the minimum font size.",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"pixelSize": {
"type": "integer",
"description": "The font size in pixels."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "clearDefaultCharacterSet",
"description": "Clears the default character set set by this extension, if any.",
"parameters": [
{
"name": "details",
"type": "object",
"optional": true,
"description": "This parameter is currently unused.",
"properties": {}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "getDefaultCharacterSet",
"description": "Gets the default character set.",
"parameters": [
{
"name": "details",
"type": "object",
"optional": true,
"description": "This parameter is currently unused.",
"properties": {}
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"charset": {
"type": "string",
"description": "The default character set, such as \"ISO-8859-1\"."
}
}
}
]
}
]
},
{
"name": "setDefaultCharacterSet",
"description": "Sets the default character set.",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"charset": {
"type": "string",
"description": "The character set."
}
}
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": []
}
]
}
],
"events": [
{
"name": "onFontChanged",
"description": "Fired when a font setting changes.",
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"fontName": { "type": "string" },
"script": {
"$ref": "FakeStringType",
"description": "The script code for which the font setting has changed. If omitted, the global script font setting has changed.",
"optional": true
},
"genericFamily": {
"$ref": "GenericFamily",
"description": "The generic font family for which the font setting has changed."
},
"levelOfControl": {
"$ref": "LevelOfControl",
"description": "The level of control this extension has over the setting."
}
}
}
]
},
{
"name": "onDefaultFontSizeChanged",
"description": "Fired when the default font size setting changes.",
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"pixelSize": {
"type": "integer",
"description": "The font size in pixels."
},
"levelOfControl": {
"$ref": "LevelOfControl",
"description": "The level of control this extension has over the setting."
}
}
}
]
},
{
"name": "onDefaultFixedFontSizeChanged",
"description": "Fired when the default fixed font size setting changes.",
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"pixelSize": {
"type": "integer",
"description": "The font size in pixels."
},
"levelOfControl": {
"$ref": "LevelOfControl",
"description": "The level of control this extension has over the setting."
}
}
}
]
},
{
"name": "onMinimumFontSizeChanged",
"description": "Fired when the minimum font size setting changes.",
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"pixelSize": {
"type": "integer",
"description": "The font size in pixels."
},
"levelOfControl": {
"$ref": "LevelOfControl",
"description": "The level of control this extension has over the setting."
}
}
}
]
},
{
"name": "onDefaultCharacterSetChanged",
"description": "Fired when the default character set setting changes.",
"parameters": [
{
"type": "object",
"name": "details",
"properties": {
"charset": {
"type": "string",
"description": "The character set."
},
"levelOfControl": {
"$ref": "LevelOfControl",
"description": "The level of control this extension has over the setting."
}
}
}
]
}
]
}
]