dwelle 1 year ago
parent
commit
f7a6bffb99

+ 7 - 0
index.html

@@ -111,6 +111,13 @@
       type="font/woff2"
       crossorigin="anonymous"
     />
+    <link
+      rel="preload"
+      href="/VirgilNew2023Beta-Regular.woff2"
+      as="font"
+      type="font/woff2"
+      crossorigin="anonymous"
+    />
     <link
       rel="preload"
       href="/Cascadia.woff2"

BIN
public/VirgilNew2023Beta-Regular.woff2


+ 6 - 0
public/fonts.css

@@ -5,6 +5,12 @@
   font-display: swap;
 }
 
+@font-face {
+  font-family: "Virgil2";
+  src: url("VirgilNew2023Beta-Regular.woff2");
+  font-display: swap;
+}
+
 /* https://github.com/microsoft/cascadia-code */
 @font-face {
   font-family: "Cascadia";

+ 5 - 0
src/actions/actionProperties.tsx

@@ -698,6 +698,11 @@ export const actionChangeFontFamily = register({
         text: t("labels.handDrawn"),
         icon: FreedrawIcon,
       },
+      {
+        value: FONT_FAMILY.HAND_DRAWN2.fontFamilyId,
+        text: t("labels.handDrawn"),
+        icon: FreedrawIcon,
+      },
       {
         value: FONT_FAMILY.NORMAL.fontFamilyId,
         text: t("labels.normal"),

+ 4 - 0
src/constants.ts

@@ -98,6 +98,10 @@ export const FONT_FAMILY = {
     fontFamilyId: 1,
     fontFamily: "Virgil",
   },
+  HAND_DRAWN2: {
+    fontFamilyId: 4,
+    fontFamily: "Virgil2",
+  },
   NORMAL: {
     fontFamilyId: 2,
     fontFamily: "Helvetica",

+ 2 - 0
src/element/textElement.ts

@@ -970,6 +970,8 @@ const DEFAULT_LINE_HEIGHT = {
   // Gecko (FF) uses ~1.28.
   [FONT_FAMILY.HAND_DRAWN.fontFamilyId]:
     1.25 as ExcalidrawTextElement["lineHeight"],
+  [FONT_FAMILY.HAND_DRAWN2.fontFamilyId]:
+    1.25 as ExcalidrawTextElement["lineHeight"],
   // ~1.15 is the average for Virgil in WebKit and Blink.
   // Gecko if all over the place.
   [FONT_FAMILY.NORMAL.fontFamilyId]: