blob: cd1a1dbdf18a5e503a0892e8d2dfad07c8398ce3 [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.fonts
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div>
## **PROTOCOLS**
## FontSetEventListener {#FontSetEventListener}
*Defined in [fuchsia.fonts/events.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/events.fidl;l=9)*
<p>Protocol for listening to possible events that may occur in the <code>Provider</code>'s set of fonts.</p>
<p>Register a listener using <a class='link' href='../fuchsia.fonts/'>fuchsia.fonts</a>/<a class='link' href='../fuchsia.fonts/#Provider.RegisterFontSetEventListener'>Provider.RegisterFontSetEventListener</a>.</p>
### OnFontSetUpdated {#FontSetEventListener.OnFontSetUpdated}
<p>The set of fonts available in the <code>Provider</code> has changed. See
<a class='link' href='../fuchsia.fonts/'>fuchsia.fonts</a>/<a class='link' href='../fuchsia.fonts/#FontSetUpdatedEvent'>FontSetUpdatedEvent</a>.</p>
#### Request {#FontSetEventListener.OnFontSetUpdated_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>event</code></td>
<td>
<code><a class='link' href='#FontSetUpdatedEvent'>FontSetUpdatedEvent</a></code>
</td>
</tr>
</table>
#### Response {#FontSetEventListener.OnFontSetUpdated_Response}
&lt;EMPTY&gt;
## Provider {#Provider}
*Defined in [fuchsia.fonts/font_provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/font_provider.fidl;l=113)*
<p>Provider of digital font files and metadata.</p>
<p>TODO(fxbug.dev/8903): Remove deprecated methods and move to provider.fidl.</p>
### GetFamilyInfo {#Provider.GetFamilyInfo}
<p>Deprecated. See <code>GetFontFamilyInfo</code>.</p>
<p>Returns information for the specified font family or null if there is
no family with the specified name. This function respects family name
aliases and ignores case, so request for &quot;robotoSLAB&quot; will return
FamilyInfo for &quot;Roboto Slab&quot;.</p>
#### Request {#Provider.GetFamilyInfo_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>family</code></td>
<td>
<code>string[128]</code>
</td>
</tr>
</table>
#### Response {#Provider.GetFamilyInfo_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>family_info</code></td>
<td>
<code><a class='link' href='#FamilyInfo'>FamilyInfo</a>?</code>
</td>
</tr>
</table>
### GetFont {#Provider.GetFont}
<p>Deprecated. See <code>GetTypeface</code>.</p>
<p>Returns font that matches specified <code>request</code>.</p>
#### Request {#Provider.GetFont_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>request</code></td>
<td>
<code><a class='link' href='#Request'>Request</a></code>
</td>
</tr>
</table>
#### Response {#Provider.GetFont_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>response</code></td>
<td>
<code><a class='link' href='#Response'>Response</a>?</code>
</td>
</tr>
</table>
### GetFontFamilyInfo {#Provider.GetFontFamilyInfo}
<p>Returns information for the specified font family, or an empty table if there is no family
with the specified name.</p>
<p>This function respects family name aliases and ignores case. For example, &quot;RobotoSlab&quot; is an
alias for the canonical name &quot;Roboto Slab&quot;. A request for &quot;robotoSLAB&quot; would return the
<code>FontFamilyInfo</code> for &quot;Roboto Slab&quot; due to the case-insensitivity and alias resolution.</p>
#### Request {#Provider.GetFontFamilyInfo_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>family</code></td>
<td>
<code><a class='link' href='#FamilyName'>FamilyName</a></code>
</td>
</tr>
</table>
#### Response {#Provider.GetFontFamilyInfo_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>family_info</code></td>
<td>
<code><a class='link' href='#FontFamilyInfo'>FontFamilyInfo</a></code>
</td>
</tr>
</table>
### GetTypeface {#Provider.GetTypeface}
<p>Returns a typeface that matches the specified <code>request</code>, or an empty table if no matching
face is found. (The latter is more likely to happen if <code>TypefaceRequestFlags.EXACT_FAMILY</code>
is used to disable fallbacks.)</p>
#### Request {#Provider.GetTypeface_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>request</code></td>
<td>
<code><a class='link' href='#TypefaceRequest'>TypefaceRequest</a></code>
</td>
</tr>
</table>
#### Response {#Provider.GetTypeface_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>response</code></td>
<td>
<code><a class='link' href='#TypefaceResponse'>TypefaceResponse</a></code>
</td>
</tr>
</table>
### RegisterFontSetEventListener {#Provider.RegisterFontSetEventListener}
<p>Register a listener to be notified when the set of available fonts or mappings has changed.
A client can register as many listeners as it wishes.</p>
<p>To unregister, close the channel.</p>
#### Request {#Provider.RegisterFontSetEventListener_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>listener</code></td>
<td>
<code><a class='link' href='#FontSetEventListener'>FontSetEventListener</a></code>
</td>
</tr>
</table>
#### Response {#Provider.RegisterFontSetEventListener_Response}
&lt;EMPTY&gt;
## **STRUCTS**
### FamilyInfo {#FamilyInfo data-text="FamilyInfo"}
*Defined in [fuchsia.fonts/font_provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/font_provider.fidl;l=98)*
<p>Deprecated. See <code>FontFamilyInfo</code>.</p>
<p>Information about font family that can be requested using GetFamilyInfo().</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="FamilyInfo.name">
<td><code>name</code></td>
<td>
<code>string[128]</code>
</td>
<td><p>Canonical font family name. Note that this may be different from the
value passed to GetFamilyInfo() because GetFamilyInfo() also resolves
font aliases and ignores case. For example GetFamilyInfo(&quot;robotoslab&quot;)
will FamilyInfo.name = &quot;Robot Slab&quot;.</p>
</td>
<td>No default</td>
</tr>
<tr id="FamilyInfo.styles">
<td><code>styles</code></td>
<td>
<code>vector&lt;<a class='link' href='#Style'>Style</a>&gt;[300]</code>
</td>
<td><p>Unordered list of all available styles in the family.</p>
</td>
<td>No default</td>
</tr>
</table>
### FamilyName {#FamilyName data-text="FamilyName"}
*Defined in [fuchsia.fonts/provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/provider.fidl;l=31)*
<p>The name of a family of fonts.</p>
<p>Examples: &quot;Roboto&quot;, &quot;Noto Serif&quot;.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="FamilyName.name">
<td><code>name</code></td>
<td>
<code>string[128]</code>
</td>
<td><p>The characters that make up the name.</p>
</td>
<td>No default</td>
</tr>
</table>
### Request {#Request data-text="Request"}
*Defined in [fuchsia.fonts/font_provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/font_provider.fidl;l=32)*
<p>Deprecated. See <code>FaceRequest</code>.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Request.family">
<td><code>family</code></td>
<td>
<code>string[128]?</code>
</td>
<td><p>Desired font family name, e.g. &quot;Roboto&quot;. Font family search is
case-insensitive. In case when there is no specified family or the
specified family doesn't have glyph for the requested <code>character</code> then
a font from another family may be returned. This behavior can be disabled
using <code>REQUEST_FLAG_NO_FALLBACK</code>.</p>
</td>
<td>No default</td>
</tr>
<tr id="Request.weight">
<td><code>weight</code></td>
<td>
<code>uint32</code>
</td>
<td><p>For example, 400 is normal, 700 is bold.</p>
</td>
<td>400</td>
</tr>
<tr id="Request.width">
<td><code>width</code></td>
<td>
<code>uint32</code>
</td>
<td><p>Numeric values matching OS/2 &amp; Windows Metrics usWidthClass table.
https://www.microsoft.com/typography/otspec/os2.htm
For example, 5 is normal.</p>
</td>
<td>5</td>
</tr>
<tr id="Request.slant">
<td><code>slant</code></td>
<td>
<code><a class='link' href='#Slant'>Slant</a></code>
</td>
<td></td>
<td><a class='link' href='#Slant.UPRIGHT'>Slant.UPRIGHT</a></td>
</tr>
<tr id="Request.language">
<td><code>language</code></td>
<td>
<code>vector&lt;string&gt;[8]?</code>
</td>
<td><p>BCP47 language tags in order of preference. See
https://tools.ietf.org/html/bcp47 .</p>
</td>
<td>No default</td>
</tr>
<tr id="Request.character">
<td><code>character</code></td>
<td>
<code>uint32</code>
</td>
<td><p>Codepoint for the character that must be present in the returned font or 0.
Caller that specify this field are expected to extract character set from
the result and cache it in order to avoid calling the API more than
necessary.</p>
</td>
<td>0</td>
</tr>
<tr id="Request.fallback_group">
<td><code>fallback_group</code></td>
<td>
<code><a class='link' href='#FallbackGroup'>FallbackGroup</a></code>
</td>
<td><p>Fallback group preference. Caller can leave this field set to NONE. In
that case the font provider will use fallback group of the specified font
family.</p>
</td>
<td><a class='link' href='#FallbackGroup.NONE'>FallbackGroup.NONE</a></td>
</tr>
<tr id="Request.flags">
<td><code>flags</code></td>
<td>
<code>uint32</code>
</td>
<td></td>
<td>0</td>
</tr>
</table>
### Response [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Response data-text="Response"}
*Defined in [fuchsia.fonts/font_provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/font_provider.fidl;l=74)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Response.buffer">
<td><code>buffer</code></td>
<td>
<code><a class='link' href='../fuchsia.mem/'>fuchsia.mem</a>/<a class='link' href='../fuchsia.mem/#Buffer'>Buffer</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="Response.buffer_id">
<td><code>buffer_id</code></td>
<td>
<code>uint32</code>
</td>
<td><p>Buffer identifier for the buffer. Responses with the same buffer_id are
guaranteed to contain the same data in the buffer. Clients may use this
value to detect if they already have the font cached in parsed form.</p>
</td>
<td>No default</td>
</tr>
<tr id="Response.font_index">
<td><code>font_index</code></td>
<td>
<code>uint32</code>
</td>
<td><p>Font index within <code>buffer</code>. Used for font formats that may contain more
than one font per file, e.g. TTC (TrueType Collection).</p>
</td>
<td>No default</td>
</tr>
</table>
### Style {#Style data-text="Style"}
*Defined in [fuchsia.fonts/font_provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/font_provider.fidl;l=89)*
<p>Deprecated.
See <code>Style2</code>.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Style.weight">
<td><code>weight</code></td>
<td>
<code>uint32</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="Style.width">
<td><code>width</code></td>
<td>
<code>uint32</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="Style.slant">
<td><code>slant</code></td>
<td>
<code><a class='link' href='#Slant'>Slant</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
## **ENUMS**
### CacheMissPolicy [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#CacheMissPolicy data-text="CacheMissPolicy"}
Type: <code>uint32</code>
*Defined in [fuchsia.fonts/provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/provider.fidl;l=50)*
<p>Options for what the font server should do if the client requests a typeface that is not yet
cached.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="CacheMissPolicy.BLOCK_UNTIL_DOWNLOADED">
<td><h3 id="CacheMissPolicy.BLOCK_UNTIL_DOWNLOADED" class="add-link hide-from-toc">BLOCK_UNTIL_DOWNLOADED</h3></td>
<td><code>1</code></td>
<td><p>The server will attempt to load the uncached typeface before providing a response. This is
the <em>default</em> behavior.</p>
<p>This option is not recommended for synchronous clients that block rendering while waiting
for a font.</p>
</td>
</tr>
<tr id="CacheMissPolicy.RETURN_EMPTY_RESPONSE">
<td><h3 id="CacheMissPolicy.RETURN_EMPTY_RESPONSE" class="add-link hide-from-toc">RETURN_EMPTY_RESPONSE</h3></td>
<td><code>2</code></td>
<td><p>The server will tell the client that the uncached typeface is unavailable, by returning an
empty <a class='link' href='../fuchsia.fonts/'>fuchsia.fonts</a>/<a class='link' href='../fuchsia.fonts/#TypefaceResponse'>TypefaceResponse</a>. The uncached typeface may be downloaded
asynchronously to be available for future requests.</p>
<p>This is similar to <code>font-display: block</code> in CSS.</p>
</td>
</tr>
<tr id="CacheMissPolicy.RETURN_FALLBACK">
<td><h3 id="CacheMissPolicy.RETURN_FALLBACK" class="add-link hide-from-toc">RETURN_FALLBACK</h3></td>
<td><code>3</code></td>
<td><p>The server will attempt to provide a cached fallback typeface (if allowed by the fallback
restrictions in <a class='link' href='../fuchsia.fonts/'>fuchsia.fonts</a>/<a class='link' href='../fuchsia.fonts/#TypefaceRequestFlags'>TypefaceRequestFlags</a>). The uncached typeface may be
downloaded asynchronously to be available for future requests.</p>
<p>This is similar to <code>font-display: swap</code> in CSS.</p>
</td>
</tr>
</table>
### FallbackGroup [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#FallbackGroup data-text="FallbackGroup"}
Type: <code>uint32</code>
*Defined in [fuchsia.fonts/font_provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/font_provider.fidl;l=11)*
<p>Deprecated. See <code>GenericFontFamily</code>.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="FallbackGroup.NONE">
<td><h3 id="FallbackGroup.NONE" class="add-link hide-from-toc">NONE</h3></td>
<td><code>0</code></td>
<td></td>
</tr>
<tr id="FallbackGroup.SERIF">
<td><h3 id="FallbackGroup.SERIF" class="add-link hide-from-toc">SERIF</h3></td>
<td><code>1</code></td>
<td></td>
</tr>
<tr id="FallbackGroup.SANS_SERIF">
<td><h3 id="FallbackGroup.SANS_SERIF" class="add-link hide-from-toc">SANS_SERIF</h3></td>
<td><code>2</code></td>
<td></td>
</tr>
<tr id="FallbackGroup.MONOSPACE">
<td><h3 id="FallbackGroup.MONOSPACE" class="add-link hide-from-toc">MONOSPACE</h3></td>
<td><code>3</code></td>
<td></td>
</tr>
<tr id="FallbackGroup.CURSIVE">
<td><h3 id="FallbackGroup.CURSIVE" class="add-link hide-from-toc">CURSIVE</h3></td>
<td><code>4</code></td>
<td></td>
</tr>
<tr id="FallbackGroup.FANTASY">
<td><h3 id="FallbackGroup.FANTASY" class="add-link hide-from-toc">FANTASY</h3></td>
<td><code>5</code></td>
<td></td>
</tr>
</table>
### GenericFontFamily [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#GenericFontFamily data-text="GenericFontFamily"}
Type: <code>uint32</code>
*Defined in [fuchsia.fonts/styles.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=90)*
<p>Generic groups of font families that can serve as fallbacks for a specific family.</p>
<p>Every font family belongs to some <em>generic</em> font family (see examples below).</p>
<p>If an exact requested family is unavailable but a fallback group is specified in the request,
the provider may return some other family that belongs to the fallback group. For example, if
the client requests the &quot;Arial&quot; family with a <code>SANS_SERIF</code> fallback, and &quot;Arial&quot; is unavailable,
the provider may return another available sans serif family, such as &quot;Roboto Regular&quot;, instead.</p>
<p>See also:
https://www.w3.org/TR/css-fonts-4/#generic-font-families</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="GenericFontFamily.SERIF">
<td><h3 id="GenericFontFamily.SERIF" class="add-link hide-from-toc">SERIF</h3></td>
<td><code>1</code></td>
<td><p>Glyphs have little &quot;serifs&quot;, hooks, or notches at the ends of most strokes.
Examples: Georgia, Noto Serif, Times New Roman.</p>
</td>
</tr>
<tr id="GenericFontFamily.SANS_SERIF">
<td><h3 id="GenericFontFamily.SANS_SERIF" class="add-link hide-from-toc">SANS_SERIF</h3></td>
<td><code>2</code></td>
<td><p>Glyphs that have no serifs at the ends of most strokes.
Examples: Arial, Noto Sans, Roboto, Tahoma.</p>
</td>
</tr>
<tr id="GenericFontFamily.MONOSPACE">
<td><h3 id="GenericFontFamily.MONOSPACE" class="add-link hide-from-toc">MONOSPACE</h3></td>
<td><code>3</code></td>
<td><p>Fixed-width fonts.
Examples: Consolas, Courier New, Inconsolata.</p>
</td>
</tr>
<tr id="GenericFontFamily.CURSIVE">
<td><h3 id="GenericFontFamily.CURSIVE" class="add-link hide-from-toc">CURSIVE</h3></td>
<td><code>4</code></td>
<td><p>Handwritten or cursive fonts.
Examples: Brush Script, Comic Sans, Lucida Calligraphy.</p>
</td>
</tr>
<tr id="GenericFontFamily.FANTASY">
<td><h3 id="GenericFontFamily.FANTASY" class="add-link hide-from-toc">FANTASY</h3></td>
<td><code>5</code></td>
<td><p>Decorative fonts.
Examples: Impact, Papyrus.</p>
</td>
</tr>
<tr id="GenericFontFamily.SYSTEM_UI">
<td><h3 id="GenericFontFamily.SYSTEM_UI" class="add-link hide-from-toc">SYSTEM_UI</h3></td>
<td><code>6</code></td>
<td><p>The default user interface font on the target platform.
This is included for completeness with the CSS specification; font manifests should not
declare that a font belongs to the <code>SYSTEM_UI</code> generic family, but instead should declare a
more specific option (e.g. <code>SERIF</code> for Roboto).</p>
<p>Not commonly used.</p>
</td>
</tr>
<tr id="GenericFontFamily.EMOJI">
<td><h3 id="GenericFontFamily.EMOJI" class="add-link hide-from-toc">EMOJI</h3></td>
<td><code>7</code></td>
<td><p>Fonts that are used specifically for rendering emoji code points.
Examples: Noto Color Emoji.</p>
</td>
</tr>
<tr id="GenericFontFamily.MATH">
<td><h3 id="GenericFontFamily.MATH" class="add-link hide-from-toc">MATH</h3></td>
<td><code>8</code></td>
<td><p>Fonts that are used primarily for rendering mathematical expressions.</p>
<p>Not commonly used.</p>
</td>
</tr>
<tr id="GenericFontFamily.FANGSONG">
<td><h3 id="GenericFontFamily.FANGSONG" class="add-link hide-from-toc">FANGSONG</h3></td>
<td><code>9</code></td>
<td><p>A group of Chinese fonts between serif and cursive, often used for official Chinese
Government documents.</p>
<p>Not commonly used.</p>
</td>
</tr>
</table>
### Slant [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Slant data-text="Slant"}
Type: <code>uint32</code>
*Defined in [fuchsia.fonts/styles.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=20)*
<p>The type of slant of a type face.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="Slant.UPRIGHT">
<td><h3 id="Slant.UPRIGHT" class="add-link hide-from-toc">UPRIGHT</h3></td>
<td><code>1</code></td>
<td><p>The default; upright glyphs.</p>
</td>
</tr>
<tr id="Slant.ITALIC">
<td><h3 id="Slant.ITALIC" class="add-link hide-from-toc">ITALIC</h3></td>
<td><code>2</code></td>
<td><p>Specially designed, slanted and slightly calligraphic glyphs.</p>
</td>
</tr>
<tr id="Slant.OBLIQUE">
<td><h3 id="Slant.OBLIQUE" class="add-link hide-from-toc">OBLIQUE</h3></td>
<td><code>3</code></td>
<td><p>Skewed glyphs. Oblique usually means an geometric transformation of the upright variant,
rather than a custom-designed variant.</p>
</td>
</tr>
</table>
### Width [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Width data-text="Width"}
Type: <code>uint32</code>
*Defined in [fuchsia.fonts/styles.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=33)*
<p>Horizontal width class of the glyphs.</p>
<p>See https://docs.microsoft.com/en-us/typography/opentype/spec/os2#uswidthclass.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="Width.ULTRA_CONDENSED">
<td><h3 id="Width.ULTRA_CONDENSED" class="add-link hide-from-toc">ULTRA_CONDENSED</h3></td>
<td><code>1</code></td>
<td><p>50% of normal width</p>
</td>
</tr>
<tr id="Width.EXTRA_CONDENSED">
<td><h3 id="Width.EXTRA_CONDENSED" class="add-link hide-from-toc">EXTRA_CONDENSED</h3></td>
<td><code>2</code></td>
<td><p>62.5% of normal width</p>
</td>
</tr>
<tr id="Width.CONDENSED">
<td><h3 id="Width.CONDENSED" class="add-link hide-from-toc">CONDENSED</h3></td>
<td><code>3</code></td>
<td><p>75% of normal width</p>
</td>
</tr>
<tr id="Width.SEMI_CONDENSED">
<td><h3 id="Width.SEMI_CONDENSED" class="add-link hide-from-toc">SEMI_CONDENSED</h3></td>
<td><code>4</code></td>
<td><p>87.5% of normal width</p>
</td>
</tr>
<tr id="Width.NORMAL">
<td><h3 id="Width.NORMAL" class="add-link hide-from-toc">NORMAL</h3></td>
<td><code>5</code></td>
<td><p>Normal width</p>
</td>
</tr>
<tr id="Width.SEMI_EXPANDED">
<td><h3 id="Width.SEMI_EXPANDED" class="add-link hide-from-toc">SEMI_EXPANDED</h3></td>
<td><code>6</code></td>
<td><p>112.5% of normal width</p>
</td>
</tr>
<tr id="Width.EXPANDED">
<td><h3 id="Width.EXPANDED" class="add-link hide-from-toc">EXPANDED</h3></td>
<td><code>7</code></td>
<td><p>125% of normal width</p>
</td>
</tr>
<tr id="Width.EXTRA_EXPANDED">
<td><h3 id="Width.EXTRA_EXPANDED" class="add-link hide-from-toc">EXTRA_EXPANDED</h3></td>
<td><code>8</code></td>
<td><p>150% of normal width</p>
</td>
</tr>
<tr id="Width.ULTRA_EXPANDED">
<td><h3 id="Width.ULTRA_EXPANDED" class="add-link hide-from-toc">ULTRA_EXPANDED</h3></td>
<td><code>9</code></td>
<td><p>200% of normal width</p>
</td>
</tr>
</table>
## **TABLES**
### FontFamilyInfo {#FontFamilyInfo data-text="FontFamilyInfo"}
*Defined in [fuchsia.fonts/provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/provider.fidl;l=167)*
<p>Information about a font family that can be requested using <code>Provider.GetFontFamilyInfo()</code>.</p>
<p>If a matching font family is not found, the table will be empty.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="FontFamilyInfo.name">
<td><h3 id="FontFamilyInfo.name" class="add-link hide-from-toc">1</h3></td>
<td><code>name</code></td>
<td>
<code><a class='link' href='#FamilyName'>FamilyName</a></code>
</td>
<td><p>Canonical font family name. Note that this may be different from the value passed to
<code>GetFontFamilyInfo()</code> due to the resolution of font aliases, and/or differences in
whitespace and capitalization.</p>
</td>
</tr>
<tr id="FontFamilyInfo.styles">
<td><h3 id="FontFamilyInfo.styles" class="add-link hide-from-toc">2</h3></td>
<td><code>styles</code></td>
<td>
<code>vector&lt;<a class='link' href='#Style2'>Style2</a>&gt;[300]</code>
</td>
<td><p>Unordered list of all available styles in the family.</p>
</td>
</tr>
</table>
### FontSetUpdatedEvent {#FontSetUpdatedEvent data-text="FontSetUpdatedEvent"}
*Defined in [fuchsia.fonts/events.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/events.fidl;l=24)*
<p>An event indicating that the set of fonts available in the <code>Provider</code> has changed. This is most
frequently caused by an ephemeral font being downloaded and cached. Clients should consider
re-requesting fonts and re-rendering any displayed text.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
</table>
### Style2 {#Style2 data-text="Style2"}
*Defined in [fuchsia.fonts/styles.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=64)*
<p>Style properties that can be used when requesting or describing a type face.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="Style2.slant">
<td><h3 id="Style2.slant" class="add-link hide-from-toc">1</h3></td>
<td><code>slant</code></td>
<td>
<code><a class='link' href='#Slant'>Slant</a></code>
</td>
<td><p>See <code>Slant</code>.</p>
</td>
</tr>
<tr id="Style2.weight">
<td><h3 id="Style2.weight" class="add-link hide-from-toc">2</h3></td>
<td><code>weight</code></td>
<td>
<code><a class='link' href='#Weight'>Weight</a></code>
</td>
<td><p>Weight or thickness of the glyphs. Allowed values are integers in the range [1, 1000], but
most real-world font families only support some integer multiples of 100:
{100, 200, ..., 900}. Normal text (<code>WEIGHT_NORMAL</code>) is 400; <code>WEIGHT_BOLD</code> is 700.</p>
<p>See:
https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#Common_weight_name_mapping
https://docs.microsoft.com/en-us/typography/opentype/spec/os2#usweightclass</p>
</td>
</tr>
<tr id="Style2.width">
<td><h3 id="Style2.width" class="add-link hide-from-toc">3</h3></td>
<td><code>width</code></td>
<td>
<code><a class='link' href='#Width'>Width</a></code>
</td>
<td><p>See <code>Width</code>.</p>
</td>
</tr>
</table>
### TypefaceQuery {#TypefaceQuery data-text="TypefaceQuery"}
*Defined in [fuchsia.fonts/provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/provider.fidl;l=94)*
<p>Parameters for looking up a typeface.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="TypefaceQuery.family">
<td><h3 id="TypefaceQuery.family" class="add-link hide-from-toc">1</h3></td>
<td><code>family</code></td>
<td>
<code><a class='link' href='#FamilyName'>FamilyName</a></code>
</td>
<td><p>Desired font family name, e.g. &quot;Roboto&quot;. Font family search is case-insensitive.</p>
<p>Note: In cases where the specified family doesn't exist, or the specified family doesn't
have a glyph for the requested <code>code_point</code>, a face from another family may be returned.
This behavior can be disabled using <code>TypefaceRequestFlags.EXACT_FAMILY</code>.</p>
</td>
</tr>
<tr id="TypefaceQuery.style">
<td><h3 id="TypefaceQuery.style" class="add-link hide-from-toc">2</h3></td>
<td><code>style</code></td>
<td>
<code><a class='link' href='#Style2'>Style2</a></code>
</td>
<td><p>Style properties of the desired typeface.</p>
</td>
</tr>
<tr id="TypefaceQuery.languages">
<td><h3 id="TypefaceQuery.languages" class="add-link hide-from-toc">3</h3></td>
<td><code>languages</code></td>
<td>
<code>vector&lt;<a class='link' href='../fuchsia.intl/'>fuchsia.intl</a>/<a class='link' href='../fuchsia.intl/#LocaleId'>LocaleId</a>&gt;[8]</code>
</td>
<td><p>Language tags in order of preference. This allows disambiguating code points that map
to different glyphs in different languages (e.g. CJK code points).</p>
<p>See <code>fuchsia.intl.LocaleId</code>.</p>
</td>
</tr>
<tr id="TypefaceQuery.code_points">
<td><h3 id="TypefaceQuery.code_points" class="add-link hide-from-toc">4</h3></td>
<td><code>code_points</code></td>
<td>
<code>vector&lt;uint32&gt;[128]</code>
</td>
<td><p>Optional code points for which glyphs must be present in the returned face.</p>
<p>Callers that specify this field are expected to extract the character set from the result
and cache it in order to avoid calling the API more than necessary.</p>
</td>
</tr>
<tr id="TypefaceQuery.fallback_family">
<td><h3 id="TypefaceQuery.fallback_family" class="add-link hide-from-toc">5</h3></td>
<td><code>fallback_family</code></td>
<td>
<code><a class='link' href='#GenericFontFamily'>GenericFontFamily</a></code>
</td>
<td><p>A generic font family to fall back to if an exact match is unavailable or does not contain
the requested code point.</p>
<p>Every font family belongs to a generic family (configured in the font manifest). If a
particular font family doesn't contain a requested code point, the provider can search for
the code point in other font families <em>in the same generic family</em> as a fallback.</p>
<p>Specifying <code>fallback_family</code> in a query allows the client to override the generic family
that would be used as a fallback.</p>
</td>
</tr>
<tr id="TypefaceQuery.postscript_name">
<td><h3 id="TypefaceQuery.postscript_name" class="add-link hide-from-toc">6</h3></td>
<td><code>postscript_name</code></td>
<td>
<code>string[63]</code>
</td>
<td><p>The exact Postscript name of the typeface to look up. This corresponds to name ID <code>6</code> in
the TrueType/OpenType <code>name</code> table.</p>
<p>All characters must be in the printable ASCII range (U+0021 to U+007E), and must not be
'[', ']', '(', ')', '{', '}', '&lt;', '&gt;', '/', or '%'.</p>
<p>If this field is specified, all the other query fields are ignored.</p>
</td>
</tr>
<tr id="TypefaceQuery.full_name">
<td><h3 id="TypefaceQuery.full_name" class="add-link hide-from-toc">7</h3></td>
<td><code>full_name</code></td>
<td>
<code>string[128]</code>
</td>
<td><p>The exact full name of the typeface to look up. This corresponds to name ID <code>4</code> in the
TrueType/OpenType <code>name</code> table.</p>
<p>If this field is specified, all the other query fields are ignored.</p>
</td>
</tr>
</table>
### TypefaceRequest {#TypefaceRequest data-text="TypefaceRequest"}
*Defined in [fuchsia.fonts/provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/provider.fidl;l=74)*
<p>Parameters for requesting a typeface.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="TypefaceRequest.query">
<td><h3 id="TypefaceRequest.query" class="add-link hide-from-toc">1</h3></td>
<td><code>query</code></td>
<td>
<code><a class='link' href='#TypefaceQuery'>TypefaceQuery</a></code>
</td>
<td><p>Parameters for looking up a typeface.</p>
</td>
</tr>
<tr id="TypefaceRequest.flags">
<td><h3 id="TypefaceRequest.flags" class="add-link hide-from-toc">2</h3></td>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#TypefaceRequestFlags'>TypefaceRequestFlags</a></code>
</td>
<td><p>Flags for how to process the request, such as which kinds of substitutions are permitted.</p>
</td>
</tr>
<tr id="TypefaceRequest.cache_miss_policy">
<td><h3 id="TypefaceRequest.cache_miss_policy" class="add-link hide-from-toc">3</h3></td>
<td><code>cache_miss_policy</code></td>
<td>
<code><a class='link' href='#CacheMissPolicy'>CacheMissPolicy</a></code>
</td>
<td><p>Setting for what to do if the requested typeface exists but is not cached, and therefore
cannot be served immediately.</p>
<p>If this field is empty, the default policy is
<a class='link' href='../fuchsia.fonts/'>fuchsia.fonts</a>/<a class='link' href='../fuchsia.fonts/#CacheMissPolicy.BLOCK_UNTIL_DOWNLOADED'>CacheMissPolicy.BLOCK_UNTIL_DOWNLOADED</a>.</p>
<p>If the client needs an immediate response, it can choose one of the non-blocking policies.
In this case, clients can also register to be notified when new fonts have been added to the
cache by calling <a class='link' href='../fuchsia.fonts/'>fuchsia.fonts</a>/<a class='link' href='../fuchsia.fonts/#Provider.RegisterFontSetEventListener'>Provider.RegisterFontSetEventListener</a>.</p>
</td>
</tr>
</table>
### TypefaceResponse [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#TypefaceResponse data-text="TypefaceResponse"}
*Defined in [fuchsia.fonts/provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/provider.fidl;l=148)*
<p>Response to a TypefaceRequest. Contains the digital font file and metadata corresponding to a
returned typeface. Clients are expected to cache the results if they plan to reuse them.</p>
<p>If a matching typeface cannot be found, the table will be empty.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="TypefaceResponse.buffer">
<td><h3 id="TypefaceResponse.buffer" class="add-link hide-from-toc">1</h3></td>
<td><code>buffer</code></td>
<td>
<code><a class='link' href='../fuchsia.mem/'>fuchsia.mem</a>/<a class='link' href='../fuchsia.mem/#Buffer'>Buffer</a></code>
</td>
<td><p>A memory buffer containing the bytes of a digital font file.
It is the client's responsibility to identify the type of file and to parse it (usually by
delegating to FreeType or a similar library).</p>
</td>
</tr>
<tr id="TypefaceResponse.buffer_id">
<td><h3 id="TypefaceResponse.buffer_id" class="add-link hide-from-toc">2</h3></td>
<td><code>buffer_id</code></td>
<td>
<code>uint32</code>
</td>
<td><p>Identifier for the buffer. Responses with the same <code>buffer_id</code> are guaranteed to contain the
same data in the buffer. Clients may use this value to detect if they already have the font
cached in parsed form.</p>
</td>
</tr>
<tr id="TypefaceResponse.font_index">
<td><h3 id="TypefaceResponse.font_index" class="add-link hide-from-toc">3</h3></td>
<td><code>font_index</code></td>
<td>
<code>uint32</code>
</td>
<td><p>Index of the returned typeface within <code>buffer</code>. Used for digital font formats that may
contain more than one typeface per file, e.g. TTC (TrueType Collection).</p>
</td>
</tr>
</table>
## **BITS**
### TypefaceRequestFlags [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#TypefaceRequestFlags}
Type: <code>uint32</code>
*Defined in [fuchsia.fonts/provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/provider.fidl;l=37)*
<p>Boolean flags for <code>TypefaceRequest</code>.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="TypefaceRequestFlags.EXACT_FAMILY">
<td><h3 id="TypefaceRequestFlags.EXACT_FAMILY" class="add-link hide-from-toc">EXACT_FAMILY</h3></td>
<td>1</td>
<td><p>Disables font family fallback. The service won't try to search the fallback font set if the
requested font family doesn't exist or if it doesn't contain the requested code point.</p>
</td>
</tr>
<tr id="TypefaceRequestFlags.EXACT_STYLE">
<td><h3 id="TypefaceRequestFlags.EXACT_STYLE" class="add-link hide-from-toc">EXACT_STYLE</h3></td>
<td>2</td>
<td><p>Disables approximate style matching. The service will only return a face that matches the
requested style exactly. For example, there will be no substitutions of &quot;medium&quot; for a
requested &quot;semi-bold&quot; weight, or &quot;oblique&quot; for a requested &quot;italic&quot; slant.</p>
</td>
</tr>
</table>
## **CONSTANTS**
<table>
<tr><th>Name</th><th>Value</th><th>Type</th><th>Description</th></tr>
<tr id="DEFAULT_SLANT">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=58">DEFAULT_SLANT</a></td>
<td><p>Default slant of a typeface when none is specified.</p>
</td>
</tr>
<tr id="DEFAULT_WEIGHT">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=55">DEFAULT_WEIGHT</a></td>
<td>
<code><a class='link' href='#WEIGHT_NORMAL'>WEIGHT_NORMAL</a></code>
</td>
<td><code>uint16</code></td>
<td><p>Default weight of a typeface when none is specified.</p>
</td>
</tr>
<tr id="DEFAULT_WIDTH">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=61">DEFAULT_WIDTH</a></td>
<td><p>Default width of a typeface when none is specified.</p>
</td>
</tr>
<tr id="MAX_FACE_QUERY_CODE_POINTS">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/provider.fidl;l=13">MAX_FACE_QUERY_CODE_POINTS</a></td>
<td>
<code>128</code>
</td>
<td><code>uint32</code></td>
<td><p>The maximum number of code points allowed in a typeface query.</p>
</td>
</tr>
<tr id="MAX_FACE_QUERY_LANGUAGES">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/provider.fidl;l=16">MAX_FACE_QUERY_LANGUAGES</a></td>
<td>
<code>8</code>
</td>
<td><code>uint32</code></td>
<td><p>The maximum number of preferred languages allowed in a typeface query.</p>
</td>
</tr>
<tr id="MAX_FAMILY_NAME_LENGTH">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/provider.fidl;l=10">MAX_FAMILY_NAME_LENGTH</a></td>
<td>
<code>128</code>
</td>
<td><code>uint32</code></td>
<td><p>The maximum length of a font family name.</p>
</td>
</tr>
<tr id="MAX_FAMILY_STYLES">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/provider.fidl;l=19">MAX_FAMILY_STYLES</a></td>
<td>
<code>300</code>
</td>
<td><code>uint32</code></td>
<td><p>The maximum number of styles that will be returned for a font family.</p>
</td>
</tr>
<tr id="MAX_POSTSCRIPT_TYPEFACE_NAME_LENGTH">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/provider.fidl;l=26">MAX_POSTSCRIPT_TYPEFACE_NAME_LENGTH</a></td>
<td>
<code>63</code>
</td>
<td><code>uint32</code></td>
<td><p>The maximum length of a typeface's Postscript name. The limit comes from the OpenType <code>name</code>
table specification.</p>
</td>
</tr>
<tr id="MAX_TYPEFACE_NAME_LENGTH">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/provider.fidl;l=22">MAX_TYPEFACE_NAME_LENGTH</a></td>
<td>
<code>128</code>
</td>
<td><code>uint32</code></td>
<td><p>The maximum length of a typeface's full name.</p>
</td>
</tr>
<tr id="REQUEST_FLAG_EXACT_MATCH">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/font_provider.fidl;l=29">REQUEST_FLAG_EXACT_MATCH</a></td>
<td>
<code>2</code>
</td>
<td><code>uint32</code></td>
<td><p>Deprecated. See <code>FaceRequestFlags</code>.
Disables approximate style matching. The service will only return font that
matches the requested style exactly.</p>
</td>
</tr>
<tr id="REQUEST_FLAG_NO_FALLBACK">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/font_provider.fidl;l=24">REQUEST_FLAG_NO_FALLBACK</a></td>
<td>
<code>1</code>
</td>
<td><code>uint32</code></td>
<td><p>Deprecated. See <code>FaceRequestFlags</code>.
Disables font fallback. The service won't try to search fallback font set if
there is no requested font family or if it doesn't contain requested
character.</p>
</td>
</tr>
<tr id="WEIGHT_BLACK">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=17">WEIGHT_BLACK</a></td>
<td>
<code>900</code>
</td>
<td><code>uint16</code></td>
<td></td>
</tr>
<tr id="WEIGHT_BOLD">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=15">WEIGHT_BOLD</a></td>
<td>
<code>700</code>
</td>
<td><code>uint16</code></td>
<td></td>
</tr>
<tr id="WEIGHT_EXTRA_BOLD">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=16">WEIGHT_EXTRA_BOLD</a></td>
<td>
<code>800</code>
</td>
<td><code>uint16</code></td>
<td></td>
</tr>
<tr id="WEIGHT_EXTRA_LIGHT">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=10">WEIGHT_EXTRA_LIGHT</a></td>
<td>
<code>200</code>
</td>
<td><code>uint16</code></td>
<td></td>
</tr>
<tr id="WEIGHT_LIGHT">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=11">WEIGHT_LIGHT</a></td>
<td>
<code>300</code>
</td>
<td><code>uint16</code></td>
<td></td>
</tr>
<tr id="WEIGHT_MEDIUM">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=13">WEIGHT_MEDIUM</a></td>
<td>
<code>500</code>
</td>
<td><code>uint16</code></td>
<td></td>
</tr>
<tr id="WEIGHT_NORMAL">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=12">WEIGHT_NORMAL</a></td>
<td>
<code>400</code>
</td>
<td><code>uint16</code></td>
<td></td>
</tr>
<tr id="WEIGHT_SEMI_BOLD">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=14">WEIGHT_SEMI_BOLD</a></td>
<td>
<code>600</code>
</td>
<td><code>uint16</code></td>
<td></td>
</tr>
<tr id="WEIGHT_THIN">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=9">WEIGHT_THIN</a></td>
<td>
<code>100</code>
</td>
<td><code>uint16</code></td>
<td></td>
</tr>
</table>
## **ALIASES**
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="Weight">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.fonts/styles.fidl;l=6">Weight</a></td>
<td>
<code>uint16</code></td>
<td></td>
</tr>
</table>