diff --git a/public/fonts.css b/public/fonts.css index a2cd4e86f..33a1f3e41 100644 --- a/public/fonts.css +++ b/public/fonts.css @@ -13,7 +13,19 @@ } @font-face { - font-family: "Redacted"; + font-family: "REDACTED_REGULAR"; + src: url("redacted-regular.woff2"); + font-display: swap; +} + +@font-face { + font-family: "REDACTED_SCRIPT_BOLD"; + src: url("redacted-script-bold.woff2"); + font-display: swap; +} + +@font-face { + font-family: "REDACTED_SCRIPT_REGULAR"; src: url("redacted-script-regular.woff2"); font-display: swap; } @@ -27,4 +39,5 @@ @font-face { font-family: "Blokk"; src: url("BLOKKNeue-Regular.woff2"); + font-display: swap; } diff --git a/public/redacted-regular.woff2 b/public/redacted-regular.woff2 new file mode 100644 index 000000000..86eacb55a Binary files /dev/null and b/public/redacted-regular.woff2 differ diff --git a/public/redacted-script-bold.woff2 b/public/redacted-script-bold.woff2 new file mode 100644 index 000000000..bfa1d2aeb Binary files /dev/null and b/public/redacted-script-bold.woff2 differ diff --git a/src/actions/actionProperties.tsx b/src/actions/actionProperties.tsx index 5b6cfa5a1..8e4bedc31 100644 --- a/src/actions/actionProperties.tsx +++ b/src/actions/actionProperties.tsx @@ -13,9 +13,9 @@ import { FillCrossHatchIcon, FillHachureIcon, FillSolidIcon, - FontFamilyCodeIcon, - FontFamilyHandDrawnIcon, - FontFamilyNormalIcon, + // FontFamilyCodeIcon, + // FontFamilyHandDrawnIcon, + // FontFamilyNormalIcon, FontSizeExtraLargeIcon, FontSizeLargeIcon, FontSizeMediumIcon, @@ -30,12 +30,11 @@ import { TextAlignCenterIcon, TextAlignLeftIcon, TextAlignRightIcon, - FontFamilyWireframeIcon, } from "../components/icons"; import { DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, - FONT_FAMILY, + //FONT_FAMILY, } from "../constants"; import { getNonDeletedElements, @@ -49,7 +48,7 @@ import { ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawTextElement, - FontFamilyValues, + //FontFamilyValues, TextAlign, } from "../element/types"; import { getLanguage, t } from "../i18n"; @@ -63,6 +62,7 @@ import { } from "../scene"; import { hasStrokeColor } from "../scene/comparisons"; import { register } from "./register"; +import FontsList from "../components/FontList"; const changeProperty = ( elements: readonly ExcalidrawElement[], @@ -507,56 +507,43 @@ export const actionChangeFontFamily = register({ }; }, PanelComponent: ({ elements, appState, updateData }) => { - const options: { - value: FontFamilyValues; - text: string; - icon: JSX.Element; - }[] = [ - { - value: FONT_FAMILY.Virgil, - text: t("labels.handDrawn"), - icon: , - }, - { - value: FONT_FAMILY.Helvetica, - text: t("labels.normal"), - icon: , - }, - { - value: FONT_FAMILY.Cascadia, - text: t("labels.code"), - icon: , - }, - { - value: FONT_FAMILY.REDACTED, - text: t("labels.wireframe"), - icon: , - }, - { - value: FONT_FAMILY.SCRIBBLE, - text: t("labels.wireframe"), - icon: , - }, - { - value: FONT_FAMILY.BLOKK, - text: t("labels.wireframe"), - icon: , - }, - ]; + // const options: { + // value: FontFamilyValues; + // text: string; + // icon: JSX.Element; + // }[] = [ + // { + // value: FONT_FAMILY.Virgil, + // text: t("labels.handDrawn"), + // icon: , + // }, + // { + // value: FONT_FAMILY.Helvetica, + // text: t("labels.normal"), + // icon: , + // }, + // { + // value: FONT_FAMILY.Cascadia, + // text: t("labels.code"), + // icon: , + // }, + // ]; return (
{t("labels.fontFamily")} - - group="font-family" - options={options} - value={getFormValue( - elements, - appState, - (element) => isTextElement(element) && element.fontFamily, - appState.currentItemFontFamily || DEFAULT_FONT_FAMILY, - )} - onChange={(value) => updateData(value)} + { + updateData(val); + }} + currentFontFamily={ + getFormValue( + elements, + appState, + (element) => isTextElement(element) && element.fontFamily, + appState.currentItemFontFamily || DEFAULT_FONT_FAMILY, + ) || DEFAULT_FONT_FAMILY + } />
); diff --git a/src/components/FontList.tsx b/src/components/FontList.tsx new file mode 100644 index 000000000..37e51a2c2 --- /dev/null +++ b/src/components/FontList.tsx @@ -0,0 +1,53 @@ +import { FONT_FAMILY } from "../constants"; +import { FontFamilyValues } from "../element/types"; + +const FontsList = ({ + onChange, + currentFontFamily, +}: { + onChange: (val: FontFamilyValues) => void; + currentFontFamily: FontFamilyValues; +}) => { + return ( + + ); +}; + +export default FontsList; diff --git a/src/components/LayerUI.tsx b/src/components/LayerUI.tsx index c958abf77..5bc1920d9 100644 --- a/src/components/LayerUI.tsx +++ b/src/components/LayerUI.tsx @@ -725,6 +725,7 @@ const LayerUI = ({ > {renderCustomFooter?.(false, appState)} +