From 43d6a7e28634399fd3ba2d35d064ed470d925361 Mon Sep 17 00:00:00 2001 From: Marcel Mraz Date: Wed, 17 Jul 2024 17:51:04 +0200 Subject: [PATCH] Docs for font picker --- .../@excalidraw/excalidraw/api/constants.mdx | 10 +++++----- .../@excalidraw/excalidraw/installation.mdx | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx b/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx index 029f5b05c..36fbfa758 100644 --- a/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx +++ b/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx @@ -8,15 +8,15 @@ import { FONT_FAMILY } from "@excalidraw/excalidraw"; ``` -`FONT_FAMILY` contains all the font families used in `Excalidraw` as explained below +`FONT_FAMILY` contains all the font families used in `Excalidraw`. The default families are the following: | Font Family | Description | | ----------- | ---------------------- | -| `Virgil` | The `handwritten` font | -| `Helvetica` | The `Normal` Font | -| `Cascadia` | The `Code` Font | +| `Excalifont` | The `Hand-drawn` font | +| `Nunito` | The `Normal` Font | +| `Comic Shanns` | The `Code` Font | -Defaults to `FONT_FAMILY.Virgil` unless passed in `initialData.appState.currentItemFontFamily`. +Pre-selected family is `FONT_FAMILY.Excalifont`, unless it's overriden with `initialData.appState.currentItemFontFamily`. ### THEME diff --git a/dev-docs/docs/@excalidraw/excalidraw/installation.mdx b/dev-docs/docs/@excalidraw/excalidraw/installation.mdx index d8ddd59c3..660114930 100644 --- a/dev-docs/docs/@excalidraw/excalidraw/installation.mdx +++ b/dev-docs/docs/@excalidraw/excalidraw/installation.mdx @@ -34,6 +34,26 @@ Copy these folders to your static assets directory, and add a `window.EXCALIDRAW window.EXCALIDRAW_ASSET_PATH = "/"; ``` +or, if you serve your assets from the root of your CDN, you would do: + +```js +// Vanilla + + + +``` + +or, if you prefer the path to be dynamicly set based on the `location.origin`, you could do the following: + +```jsx +// Next.js + +``` + ### Dimensions of Excalidraw Excalidraw takes _100%_ of `width` and `height` of the containing block so make sure the container in which you render Excalidraw has non zero dimensions.