This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The family read-only property of the FontData interface returns the family of the font face.
This is the name used when referring to the font family from code, for example, in the font-family property or in places within the @font-face at-rule such as the local() function.
Examples include:
A string.
The following snippet will query for all available fonts, and log metadata. This could be used, for example, to populate a font-picker control.
async function logFontData() {
try {
const availableFonts = await window.queryLocalFonts();
for (const fontData of availableFonts) {
console.log(fontData.postscriptName);
console.log(fontData.fullName);
console.log(fontData.family);
console.log(fontData.style);
}
} catch (err) {
console.error(err.name, err.message);
}
}
| Specification |
|---|
| Local Font Access API> # ref-for-dom-fontdata-family> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
family |
103 | 103 | No | 89 | No | No | No | No | No | No | No | No |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/FontData/family