Skip to content

Commit

Permalink
Use FiraSans (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenjohanson authored Sep 11, 2024
1 parent 0fc8ed3 commit 70a1528
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 96 deletions.
4 changes: 2 additions & 2 deletions excalidraw-app/share/ShareDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
border: none;
border-radius: 0.6875rem;

font-family: "Assistant";
font-family: "FiraSans";
font-style: normal;
font-weight: 600;
font-size: 0.75rem;
Expand All @@ -100,7 +100,7 @@
}

&__picker {
font-family: "Assistant";
font-family: "FiraSans";

&__illustration {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion packages/excalidraw/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ class App extends React.Component<AppProps, AppState> {
padding: `${FRAME_NAME_EDIT_PADDING}px`,
borderRadius: 4,
boxShadow: "inset 0 0 0 1px var(--color-primary)",
fontFamily: "Assistant",
fontFamily: "FiraSans",
fontSize: "14px",
transform: `translate(-${FRAME_NAME_EDIT_PADDING}px, ${FRAME_NAME_EDIT_PADDING}px)`,
color: "var(--color-gray-80)",
Expand Down
4 changes: 2 additions & 2 deletions packages/excalidraw/components/ImageExportDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
user-select: none;

& h3 {
font-family: "Assistant";
font-family: "FiraSans";
font-style: normal;
font-weight: 700;
font-size: 1.313rem;
Expand Down Expand Up @@ -135,7 +135,7 @@
flex-direction: row;
align-items: center;

font-family: "Assistant";
font-family: "FiraSans";
font-weight: 600;
font-size: 1rem;
line-height: 150%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
background: var(--color-danger-background);
border-radius: 0.5rem;

font-family: "Assistant";
font-family: "FiraSans";
font-style: normal;
font-weight: 400;
font-size: 1rem;
Expand Down
2 changes: 1 addition & 1 deletion packages/excalidraw/components/RadioGroup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

border-radius: 8px;

font-family: "Assistant";
font-family: "FiraSans";
font-style: normal;
font-weight: 600;
font-size: 0.75rem;
Expand Down
5 changes: 3 additions & 2 deletions packages/excalidraw/components/ShareableLinkDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}

h3 {
font-family: "Assistant";
font-family: "FiraSans";
font-weight: 700;
font-size: 1.313rem;
line-height: 130%;
Expand All @@ -26,6 +26,7 @@
from {
opacity: 0;
}

to {
opacity: 1;
}
Expand All @@ -46,7 +47,7 @@
border: none;
border-radius: 0.6875rem;

font-family: "Assistant";
font-family: "FiraSans";
font-style: normal;
font-weight: 600;
font-size: 0.75rem;
Expand Down
4 changes: 2 additions & 2 deletions packages/excalidraw/components/TextField.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}

&__label {
font-family: "Assistant";
font-family: "FiraSans";
font-style: normal;
font-weight: 600;
font-size: 0.875rem;
Expand Down Expand Up @@ -69,7 +69,7 @@

color: var(--ExcTextField--color);

font-family: "Assistant";
font-family: "FiraSans";
font-style: normal;
font-weight: 400;
font-size: 1rem;
Expand Down
2 changes: 1 addition & 1 deletion packages/excalidraw/components/Tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// container in body where the actual tooltip is appended to
.excalidraw-tooltip {
--ui-font: Assistant, system-ui, BlinkMacSystemFont, -apple-system, Segoe UI,
--ui-font: FiraSans, system-ui, BlinkMacSystemFont, -apple-system, Segoe UI,
Roboto, Helvetica, Arial, sans-serif;
font-family: var(--ui-font);
position: fixed;
Expand Down
4 changes: 2 additions & 2 deletions packages/excalidraw/css/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ body.excalidraw-cursor-resize * {
}

.excalidraw {
--ui-font: Assistant, system-ui, BlinkMacSystemFont, -apple-system, Segoe UI,
--ui-font: FiraSans, system-ui, BlinkMacSystemFont, -apple-system, Segoe UI,
Roboto, Helvetica, Arial, sans-serif;
font-family: var(--ui-font);

Expand Down Expand Up @@ -793,6 +793,6 @@ body.excalidraw-cursor-resize * {
color: #fff;
font-weight: 700;
letter-spacing: 0.6px;
font-family: "Assistant";
font-family: "FiraSans";
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
31 changes: 8 additions & 23 deletions packages/excalidraw/fonts/assets/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,18 @@
/* WARN: The following content is replaced during excalidraw-app build */

@font-face {
font-family: "Assistant";
src: url(./Assistant-Regular.woff2) format("woff2");
font-weight: 400;
style: normal;
display: swap;
font-family: "FiraSans";
src: url("FiraSans-Regular.otf") format("opentype");
}

@font-face {
font-family: "Assistant";
src: url(./Assistant-Medium.woff2) format("woff2");
font-weight: 500;
style: normal;
display: swap;
font-family: "FiraSans";
font-weight: light;
src: url("FiraSans-Light.otf") format("opentype");
}

@font-face {
font-family: "Assistant";
src: url(./Assistant-SemiBold.woff2) format("woff2");
font-weight: 600;
style: normal;
display: swap;
}

@font-face {
font-family: "Assistant";
src: url(./Assistant-Bold.woff2) format("woff2");
font-weight: 700;
style: normal;
display: swap;
font-family: "FiraSans";
font-weight: bold;
src: url("FiraSans-Bold.otf") format("opentype");
}
25 changes: 0 additions & 25 deletions public/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,6 @@
font-display: swap;
}

@font-face {
font-family: "Assistant";
src: url("Assistant-Regular.woff2");
font-display: swap;
font-weight: 400;
}
@font-face {
font-family: "Assistant";
src: url("Assistant-Medium.woff2");
font-display: swap;
font-weight: 500;
}
@font-face {
font-family: "Assistant";
src: url("Assistant-SemiBold.woff2");
font-display: swap;
font-weight: 600;
}
@font-face {
font-family: "Assistant";
src: url("Assistant-Bold.woff2");
font-display: swap;
font-weight: 700;
}

@font-face {
font-family: "FiraSans";
src: url("FiraSans-Regular.otf") format("opentype");
Expand Down
53 changes: 19 additions & 34 deletions scripts/woff2/woff2-vite-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,22 @@ module.exports.woff2BrowserPlugin = () => {
if (!isDev && id.endsWith("/excalidraw/fonts/assets/fonts.css")) {
return `/* WARN: The following content is generated during excalidraw-app build */
@font-face {
font-family: "Assistant";
src: url(./Assistant-Regular-DVxZuzxb.woff2) format("woff2");
font-weight: 400;
style: normal;
display: swap;
}
@font-face {
font-family: "Assistant";
src: url(./Assistant-Medium-DrcxCXg3.woff2) format("woff2");
font-weight: 500;
style: normal;
display: swap;
}
@font-face {
font-family: "Assistant";
src: url(./Assistant-SemiBold-SCI4bEL9.woff2) format("woff2");
font-weight: 600;
style: normal;
display: swap;
}
@font-face {
font-family: "Assistant";
src: url(./Assistant-Bold-gm-uSS1B.woff2) format("woff2");
font-weight: 700;
style: normal;
display: swap;
}`;
@font-face {
font-family: "FiraSans";
src: url("FiraSans-Regular.otf") format("opentype");
}
@font-face {
font-family: "FiraSans";
font-weight: light;
src: url("FiraSans-Light.otf") format("opentype");
}
@font-face {
font-family: "FiraSans";
font-weight: bold;
src: url("FiraSans-Bold.otf") format("opentype");
}`;
}

// using EXCALIDRAW_ASSET_PATH as a SSOT
Expand All @@ -96,21 +81,21 @@ module.exports.woff2BrowserPlugin = () => {
<!-- Preload all default fonts and Virgil for backwards compatibility to avoid swap on init -->
<link
rel="preload"
href="./Excalifont-Regular-C9eKQy_N.woff2"
href="Excalifont-Regular-C9eKQy_N.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
href="./Virgil-Regular-hO16qHwV.woff2"
href="Virgil-Regular-hO16qHwV.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
href="./ComicShanns-Regular-D0c8wzsC.woff2"
href="ComicShanns-Regular-D0c8wzsC.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
Expand Down

0 comments on commit 70a1528

Please sign in to comment.