Axis: Metadata for a variable font axis.
type Axis struct { // End: maximum value End float64 `json:"end,omitempty"` // Start: minimum value Start float64 `json:"start,omitempty"` // Tag: tag name. Tag string `json:"tag,omitempty"` // ForceSendFields is a list of field names (e.g. "End") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "End") to include in API requests // with the JSON null value. By default, fields with empty values are omitted // from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
func (s *Axis) MarshalJSON() ([]byte, error)
func (s *Axis) UnmarshalJSON(data []byte) error
type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Webfonts *WebfontsService // contains filtered or unexported fields }
func New(client *http.Client) (*Service, error)
New creates a new Service. It uses the provided http.Client for requests.
Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)
NewService creates a new Service.
Webfont: Metadata describing a family of fonts.
type Webfont struct { // Axes: Axis for variable fonts. Axes []*Axis `json:"axes,omitempty"` // Category: The category of the font. Category string `json:"category,omitempty"` // ColorCapabilities: The color format(s) available for this family. ColorCapabilities []string `json:"colorCapabilities,omitempty"` // Family: The name of the font. Family string `json:"family,omitempty"` // Files: The font files (with all supported scripts) for each one of the // available variants, as a key : value map. Files map[string]string `json:"files,omitempty"` // Kind: This kind represents a webfont object in the webfonts service. Kind string `json:"kind,omitempty"` // LastModified: The date (format "yyyy-MM-dd") the font was modified for the // last time. LastModified string `json:"lastModified,omitempty"` // Menu: Font URL for menu subset, a subset of the font that is enough to // display the font name Menu string `json:"menu,omitempty"` // Subsets: The scripts supported by the font. Subsets []string `json:"subsets,omitempty"` // Variants: The available variants for the font. Variants []string `json:"variants,omitempty"` // Version: The font version. Version string `json:"version,omitempty"` // ForceSendFields is a list of field names (e.g. "Axes") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Axes") to include in API requests // with the JSON null value. By default, fields with empty values are omitted // from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
func (s *Webfont) MarshalJSON() ([]byte, error)
WebfontList: Response containing the list of fonts currently served by the Google Fonts API.
type WebfontList struct { // Items: The list of fonts currently served by the Google Fonts API. Items []*Webfont `json:"items,omitempty"` // Kind: This kind represents a list of webfont objects in the webfonts // service. Kind string `json:"kind,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Items") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Items") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
func (s *WebfontList) MarshalJSON() ([]byte, error)
type WebfontsListCall struct {
// contains filtered or unexported fields
}
func (c *WebfontsListCall) Capability(capability ...string) *WebfontsListCall
Capability sets the optional parameter "capability": Controls the font urls in `Webfont.files`, by default, static ttf fonts are sent.
Possible values:
"CAPABILITY_UNSPECIFIED" - Default means static ttf fonts. "WOFF2" - Use WOFF2(Compressed)instead of ttf. "VF" - Prefer variable font files instead of static fonts instantiated at
standard weights.
func (c *WebfontsListCall) Context(ctx context.Context) *WebfontsListCall
Context sets the context to be used in this call's Do method.
func (c *WebfontsListCall) Do(opts ...googleapi.CallOption) (*WebfontList, error)
Do executes the "webfonts.webfonts.list" call. Any non-2xx status code is an error. Response headers are in either *WebfontList.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (c *WebfontsListCall) Family(family ...string) *WebfontsListCall
Family sets the optional parameter "family": Filters by Webfont.family, using literal match. If not set, returns all families
func (c *WebfontsListCall) Fields(s ...googleapi.Field) *WebfontsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (c *WebfontsListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (c *WebfontsListCall) IfNoneMatch(entityTag string) *WebfontsListCall
IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.
func (c *WebfontsListCall) Sort(sort string) *WebfontsListCall
Sort sets the optional parameter "sort": Enables sorting of the list.
Possible values:
"SORT_UNDEFINED" - No sorting specified, use the default sorting method. "ALPHA" - Sort alphabetically "DATE" - Sort by date added "POPULARITY" - Sort by popularity "STYLE" - Sort by number of styles "TRENDING" - Sort by trending
func (c *WebfontsListCall) Subset(subset string) *WebfontsListCall
Subset sets the optional parameter "subset": Filters by Webfont.subset, if subset is found in Webfont.subsets. If not set, returns all families.
type WebfontsService struct {
// contains filtered or unexported fields
}
func NewWebfontsService(s *Service) *WebfontsService
func (r *WebfontsService) List() *WebfontsListCall
List: Retrieves the list of fonts currently served by the Google Fonts Developer API.