font face can't have fallback font family

This commit is contained in:
Oleg Isonen committed 2022-09-26 12:19:22 +03:00
1 parent 02f74bade0
commit bb1e58b46b
2 files changed
+3 -3

No files matched your search

@@ -4,7 +4,7 @@ exports[`getFontFaces() same family, but different formats 1`] = `
Array [
Object {
"fontDisplay": "swap",
"fontFamily": "Roboto, sans-serif",
"fontFamily": "Roboto",
"fontStyle": "normal",
"fontWeight": 400,
"src": "url('/fonts/roboto.woff') format('woff'), url('/fonts/roboto.ttf') format('truetype')",
+2 -2
View File
@@ -1,4 +1,4 @@
import { FONT_FORMATS, DEFAULT_FONT_FALLBACK } from "./constants";
import { FONT_FORMATS } from "./constants";
import type { FontMeta } from "./schema";
import type { FontFormat } from "./types";
@@ -16,7 +16,7 @@ export const getFontFaces = (assets: Array<PartialFontAsset>) => {
if (face === undefined) {
faces.set(asset.meta.family, {
fontFamily: `${asset.meta.family}, ${DEFAULT_FONT_FALLBACK}`,
fontFamily: asset.meta.family,
fontStyle: asset.meta.style,
fontWeight: asset.meta.weight,
fontDisplay: "swap" as const,