diff --git a/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx b/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx
index a6c95ab2a..c827d11c6 100644
--- a/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx
+++ b/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx
@@ -10,13 +10,13 @@ import { FONT_FAMILY } from "@excalidraw/excalidraw";
`FONT_FAMILY` contains all the font families used in `Excalidraw` as explained below
-| Font Family | Description |
-| ----------- | ---------------------- |
-| `Virgil` | The `handwritten` font |
-| `Helvetica` | The `Normal` Font |
-| `Cascadia` | The `Code` Font |
+| Font Family | Description |
+| ------------ | ------------------------------------------- |
+| `HAND_DRAWN` | The handwritten font (by default, `Virgil`) |
+| `NORMAL` | The regular font (by default, `Helvetica`) |
+| `CODE` | The code font (by default, `Cascadia`) |
-Defaults to `FONT_FAMILY.Virgil` unless passed in `initialData.appState.currentItemFontFamily`.
+Defaults to `HAND_DRAWN` unless passed in `initialData.appState.currentItemFontFamily`.
### THEME
diff --git a/src/actions/actionBoundText.tsx b/src/actions/actionBoundText.tsx
index b42169544..28bccd33d 100644
--- a/src/actions/actionBoundText.tsx
+++ b/src/actions/actionBoundText.tsx
@@ -10,6 +10,7 @@ import {
computeBoundTextPosition,
computeContainerDimensionForBoundText,
getBoundTextElement,
+ getFontString,
measureText,
redrawTextBoundingBox,
} from "../element/textElement";
@@ -31,7 +32,6 @@ import {
} from "../element/types";
import { AppState } from "../types";
import { Mutable } from "../utility-types";
-import { getFontString } from "../utils";
import { register } from "./register";
export const actionUnbindText = register({
diff --git a/src/actions/actionProperties.tsx b/src/actions/actionProperties.tsx
index e0d61a271..56e2ebba0 100644
--- a/src/actions/actionProperties.tsx
+++ b/src/actions/actionProperties.tsx
@@ -74,7 +74,7 @@ import {
ExcalidrawElement,
ExcalidrawLinearElement,
ExcalidrawTextElement,
- FontFamilyValues,
+ FontFamilyId,
TextAlign,
VerticalAlign,
} from "../element/types";
@@ -689,22 +689,22 @@ export const actionChangeFontFamily = register({
},
PanelComponent: ({ elements, appState, updateData }) => {
const options: {
- value: FontFamilyValues;
+ value: FontFamilyId;
text: string;
icon: JSX.Element;
}[] = [
{
- value: FONT_FAMILY.Virgil,
+ value: FONT_FAMILY.HAND_DRAWN.fontFamilyId,
text: t("labels.handDrawn"),
icon: FreedrawIcon,
},
{
- value: FONT_FAMILY.Helvetica,
+ value: FONT_FAMILY.NORMAL.fontFamilyId,
text: t("labels.normal"),
icon: FontFamilyNormalIcon,
},
{
- value: FONT_FAMILY.Cascadia,
+ value: FONT_FAMILY.CODE.fontFamilyId,
text: t("labels.code"),
icon: FontFamilyCodeIcon,
},
@@ -713,7 +713,7 @@ export const actionChangeFontFamily = register({
return (