|
@@ -13,6 +13,13 @@ import {
|
|
FillCrossHatchIcon,
|
|
FillCrossHatchIcon,
|
|
FillHachureIcon,
|
|
FillHachureIcon,
|
|
FillSolidIcon,
|
|
FillSolidIcon,
|
|
|
|
+ FontFamilyCodeIcon,
|
|
|
|
+ FontFamilyHandDrawnIcon,
|
|
|
|
+ FontFamilyNormalIcon,
|
|
|
|
+ FontSizeExtraLargeIcon,
|
|
|
|
+ FontSizeLargeIcon,
|
|
|
|
+ FontSizeMediumIcon,
|
|
|
|
+ FontSizeSmallIcon,
|
|
SloppinessArchitectIcon,
|
|
SloppinessArchitectIcon,
|
|
SloppinessArtistIcon,
|
|
SloppinessArtistIcon,
|
|
SloppinessCartoonistIcon,
|
|
SloppinessCartoonistIcon,
|
|
@@ -20,18 +27,15 @@ import {
|
|
StrokeStyleDottedIcon,
|
|
StrokeStyleDottedIcon,
|
|
StrokeStyleSolidIcon,
|
|
StrokeStyleSolidIcon,
|
|
StrokeWidthIcon,
|
|
StrokeWidthIcon,
|
|
- FontSizeSmallIcon,
|
|
|
|
- FontSizeMediumIcon,
|
|
|
|
- FontSizeLargeIcon,
|
|
|
|
- FontSizeExtraLargeIcon,
|
|
|
|
- FontFamilyHandDrawnIcon,
|
|
|
|
- FontFamilyNormalIcon,
|
|
|
|
- FontFamilyCodeIcon,
|
|
|
|
- TextAlignLeftIcon,
|
|
|
|
TextAlignCenterIcon,
|
|
TextAlignCenterIcon,
|
|
|
|
+ TextAlignLeftIcon,
|
|
TextAlignRightIcon,
|
|
TextAlignRightIcon,
|
|
} from "../components/icons";
|
|
} from "../components/icons";
|
|
-import { DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE } from "../constants";
|
|
|
|
|
|
+import {
|
|
|
|
+ DEFAULT_FONT_FAMILY,
|
|
|
|
+ DEFAULT_FONT_SIZE,
|
|
|
|
+ FONT_FAMILY,
|
|
|
|
+} from "../constants";
|
|
import {
|
|
import {
|
|
getNonDeletedElements,
|
|
getNonDeletedElements,
|
|
isTextElement,
|
|
isTextElement,
|
|
@@ -44,7 +48,7 @@ import {
|
|
ExcalidrawElement,
|
|
ExcalidrawElement,
|
|
ExcalidrawLinearElement,
|
|
ExcalidrawLinearElement,
|
|
ExcalidrawTextElement,
|
|
ExcalidrawTextElement,
|
|
- FontFamily,
|
|
|
|
|
|
+ FontFamilyValues,
|
|
TextAlign,
|
|
TextAlign,
|
|
} from "../element/types";
|
|
} from "../element/types";
|
|
import { getLanguage, t } from "../i18n";
|
|
import { getLanguage, t } from "../i18n";
|
|
@@ -499,19 +503,23 @@ export const actionChangeFontFamily = register({
|
|
};
|
|
};
|
|
},
|
|
},
|
|
PanelComponent: ({ elements, appState, updateData }) => {
|
|
PanelComponent: ({ elements, appState, updateData }) => {
|
|
- const options: { value: FontFamily; text: string; icon: JSX.Element }[] = [
|
|
|
|
|
|
+ const options: {
|
|
|
|
+ value: FontFamilyValues;
|
|
|
|
+ text: string;
|
|
|
|
+ icon: JSX.Element;
|
|
|
|
+ }[] = [
|
|
{
|
|
{
|
|
- value: 1,
|
|
|
|
|
|
+ value: FONT_FAMILY.Virgil,
|
|
text: t("labels.handDrawn"),
|
|
text: t("labels.handDrawn"),
|
|
icon: <FontFamilyHandDrawnIcon theme={appState.theme} />,
|
|
icon: <FontFamilyHandDrawnIcon theme={appState.theme} />,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- value: 2,
|
|
|
|
|
|
+ value: FONT_FAMILY.Helvetica,
|
|
text: t("labels.normal"),
|
|
text: t("labels.normal"),
|
|
icon: <FontFamilyNormalIcon theme={appState.theme} />,
|
|
icon: <FontFamilyNormalIcon theme={appState.theme} />,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- value: 3,
|
|
|
|
|
|
+ value: FONT_FAMILY.Cascadia,
|
|
text: t("labels.code"),
|
|
text: t("labels.code"),
|
|
icon: <FontFamilyCodeIcon theme={appState.theme} />,
|
|
icon: <FontFamilyCodeIcon theme={appState.theme} />,
|
|
},
|
|
},
|
|
@@ -520,7 +528,7 @@ export const actionChangeFontFamily = register({
|
|
return (
|
|
return (
|
|
<fieldset>
|
|
<fieldset>
|
|
<legend>{t("labels.fontFamily")}</legend>
|
|
<legend>{t("labels.fontFamily")}</legend>
|
|
- <ButtonIconSelect<FontFamily | false>
|
|
|
|
|
|
+ <ButtonIconSelect<FontFamilyValues | false>
|
|
group="font-family"
|
|
group="font-family"
|
|
options={options}
|
|
options={options}
|
|
value={getFormValue(
|
|
value={getFormValue(
|