Skip to content

Commit

Permalink
fix(): Add more generic font families to FabricText.genericFonts (#10167
Browse files Browse the repository at this point in the history
)
  • Loading branch information
elohmeier authored Oct 2, 2024
1 parent 3a429e4 commit 9a7a1d3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [next]

- ci(): Add some prebuilt fabric in the dist folder [#10178](https://github.com/fabricjs/fabric.js/pull/10178)
- chore(): Add more generic font families to FabricText.genericFonts [#10167](https://github.com/fabricjs/fabric.js/pull/10167)

## [6.4.2]

Expand Down
16 changes: 14 additions & 2 deletions src/shapes/Text/Text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1790,12 +1790,24 @@ export class FabricText<
return 1;
}

/**
* List of generic font families
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name
*/
static genericFonts = [
'sans-serif',
'serif',
'sans-serif',
'monospace',
'cursive',
'fantasy',
'monospace',
'system-ui',
'ui-serif',
'ui-sans-serif',
'ui-monospace',
'ui-rounded',
'math',
'emoji',
'fangsong',
];

/* _FROM_SVG_START_ */
Expand Down

0 comments on commit 9a7a1d3

Please sign in to comment.