diff --git a/app/src-tauri/Cargo.lock b/app/src-tauri/Cargo.lock index 95c977d..efc5f2f 100644 --- a/app/src-tauri/Cargo.lock +++ b/app/src-tauri/Cargo.lock @@ -3453,7 +3453,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scribe" -version = "0.5.3" +version = "0.5.4" dependencies = [ "cocoa 0.26.0", "core-graphics 0.24.0", diff --git a/app/src-tauri/Cargo.toml b/app/src-tauri/Cargo.toml index b6f158a..939eecd 100644 --- a/app/src-tauri/Cargo.toml +++ b/app/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "scribe" -version = "0.5.3" +version = "0.5.4" description = "A note taking app with seamless user experience" authors = ["HoaX7"] license = "" @@ -30,7 +30,7 @@ cocoa = "0.26.0" core-graphics = "0.24.0" [target.'cfg(windows)'.dependencies] -winapi = { version = "0.3.9", features = ["winuser", "dwmapi"] } +winapi = { version = "0.3.9", features = ["winuser", "dwmapi", "shellscalingapi"] } [features] # this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled. diff --git a/app/src-tauri/src/main.rs b/app/src-tauri/src/main.rs index 6b8669f..c779d7e 100644 --- a/app/src-tauri/src/main.rs +++ b/app/src-tauri/src/main.rs @@ -16,6 +16,10 @@ use tauri::{AppHandle, Manager}; use window_shadows::set_shadow; fn main() { + #[cfg(target_os = "windows")] + unsafe { + winapi::um::shellscalingapi::SetProcessDpiAwareness(1); + } std::panic::set_hook(Box::new(|info| { let msg = match info.payload().downcast_ref::<&'static str>() { Some(s) => *s, diff --git a/app/src-tauri/tauri.conf.json b/app/src-tauri/tauri.conf.json index 67c430d..1bdcae5 100644 --- a/app/src-tauri/tauri.conf.json +++ b/app/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "scribe", - "version": "0.5.3" + "version": "0.5.4" }, "tauri": { "allowlist": { diff --git a/app/src/app.css b/app/src/app.css index 18d7018..16c9c0d 100644 --- a/app/src/app.css +++ b/app/src/app.css @@ -33,7 +33,7 @@ html, body { margin: 0; height: 100%; - font-family: 'Nunito Regular'; + font-family: 'Inter'; } ul li { list-style: disc; diff --git a/app/src/fonts/Helvetica-Bold.woff b/app/src/fonts/Helvetica-Bold.woff deleted file mode 100644 index 649c4b8..0000000 Binary files a/app/src/fonts/Helvetica-Bold.woff and /dev/null differ diff --git a/app/src/fonts/Helvetica-BoldOblique.woff b/app/src/fonts/Helvetica-BoldOblique.woff deleted file mode 100644 index 1ac0d88..0000000 Binary files a/app/src/fonts/Helvetica-BoldOblique.woff and /dev/null differ diff --git a/app/src/fonts/Helvetica-Oblique.woff b/app/src/fonts/Helvetica-Oblique.woff deleted file mode 100644 index 18e34f5..0000000 Binary files a/app/src/fonts/Helvetica-Oblique.woff and /dev/null differ diff --git a/app/src/fonts/Helvetica.woff b/app/src/fonts/Helvetica.woff deleted file mode 100644 index 0da10e1..0000000 Binary files a/app/src/fonts/Helvetica.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-Black.woff b/app/src/fonts/Nunito-Black.woff deleted file mode 100644 index 30c02d5..0000000 Binary files a/app/src/fonts/Nunito-Black.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-BlackItalic.woff b/app/src/fonts/Nunito-BlackItalic.woff deleted file mode 100644 index 2c19c8d..0000000 Binary files a/app/src/fonts/Nunito-BlackItalic.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-Bold.woff b/app/src/fonts/Nunito-Bold.woff deleted file mode 100644 index 15b2db9..0000000 Binary files a/app/src/fonts/Nunito-Bold.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-BoldItalic.woff b/app/src/fonts/Nunito-BoldItalic.woff deleted file mode 100644 index a29c679..0000000 Binary files a/app/src/fonts/Nunito-BoldItalic.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-ExtraBold.woff b/app/src/fonts/Nunito-ExtraBold.woff deleted file mode 100644 index c39ae48..0000000 Binary files a/app/src/fonts/Nunito-ExtraBold.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-ExtraBoldItalic.woff b/app/src/fonts/Nunito-ExtraBoldItalic.woff deleted file mode 100644 index bb2cbb0..0000000 Binary files a/app/src/fonts/Nunito-ExtraBoldItalic.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-ExtraLight.woff b/app/src/fonts/Nunito-ExtraLight.woff deleted file mode 100644 index 5dbde80..0000000 Binary files a/app/src/fonts/Nunito-ExtraLight.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-ExtraLightItalic.woff b/app/src/fonts/Nunito-ExtraLightItalic.woff deleted file mode 100644 index 6a3422f..0000000 Binary files a/app/src/fonts/Nunito-ExtraLightItalic.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-Italic.woff b/app/src/fonts/Nunito-Italic.woff deleted file mode 100644 index 85357c3..0000000 Binary files a/app/src/fonts/Nunito-Italic.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-Light.woff b/app/src/fonts/Nunito-Light.woff deleted file mode 100644 index 39900b1..0000000 Binary files a/app/src/fonts/Nunito-Light.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-LightItalic.woff b/app/src/fonts/Nunito-LightItalic.woff deleted file mode 100644 index 056bacb..0000000 Binary files a/app/src/fonts/Nunito-LightItalic.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-Regular.woff b/app/src/fonts/Nunito-Regular.woff deleted file mode 100644 index b604dd4..0000000 Binary files a/app/src/fonts/Nunito-Regular.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-SemiBold.woff b/app/src/fonts/Nunito-SemiBold.woff deleted file mode 100644 index f93ec53..0000000 Binary files a/app/src/fonts/Nunito-SemiBold.woff and /dev/null differ diff --git a/app/src/fonts/Nunito-SemiBoldItalic.woff b/app/src/fonts/Nunito-SemiBoldItalic.woff deleted file mode 100644 index a81d936..0000000 Binary files a/app/src/fonts/Nunito-SemiBoldItalic.woff and /dev/null differ diff --git a/app/src/fonts/font.css b/app/src/fonts/font.css index e65c07f..05b9f42 100644 --- a/app/src/fonts/font.css +++ b/app/src/fonts/font.css @@ -1,167 +1,6 @@ -@font-face { - font-family: 'Helvetica'; - font-style: normal; - font-weight: normal; - src: local('Helvetica'), url('Helvetica.woff') format('woff'); - } - - - @font-face { - font-family: 'Helvetica Oblique'; - font-style: normal; - font-weight: normal; - src: local('Helvetica Oblique'), url('Helvetica-Oblique.woff') format('woff'); - } - - - @font-face { - font-family: 'Helvetica Compressed'; - font-style: normal; - font-weight: normal; - src: local('Helvetica Compressed'), url('helvetica-compressed-5871d14b6903a.woff') format('woff'); - } - - - @font-face { - font-family: 'Helvetica Rounded Bold'; - font-style: normal; - font-weight: normal; - src: local('Helvetica Rounded Bold'), url('helvetica-rounded-bold-5871d05ead8de.woff') format('woff'); - } - - - @font-face { - font-family: 'Helvetica'; - font-style: normal; - font-weight: normal; - src: local('Helvetica'), url('Helvetica-Bold.woff') format('woff'); - } - - @font-face { - font-family: 'Helvetica Bold Oblique'; - font-style: normal; - font-weight: normal; - src: local('Helvetica Bold Oblique'), url('Helvetica-BoldOblique.woff') format('woff'); - } - - - @font-face { - font-family: 'Helvetica Light'; - font-style: normal; - font-weight: normal; - src: local('Helvetica Light'), url('helvetica-light-587ebe5a59211.woff') format('woff'); - } - - /* #### Generated By: http://font.download #### */ - - @font-face { - font-family: 'Nunito Regular'; - font-style: normal; - font-weight: normal; - src: local('Nunito Regular'), url('Nunito-Regular.woff') format('woff'); - } - - - @font-face { - font-family: 'Nunito Italic'; - font-style: normal; - font-weight: normal; - src: local('Nunito Italic'), url('Nunito-Italic.woff') format('woff'); - } - - - @font-face { - font-family: 'Nunito ExtraLight'; - font-style: normal; - font-weight: normal; - src: local('Nunito ExtraLight'), url('Nunito-ExtraLight.woff') format('woff'); - } - - - @font-face { - font-family: 'Nunito ExtraLight Italic'; - font-style: normal; - font-weight: normal; - src: local('Nunito ExtraLight Italic'), url('Nunito-ExtraLightItalic.woff') format('woff'); - } - - - @font-face { - font-family: 'Nunito Light'; - font-style: normal; - font-weight: normal; - src: local('Nunito Light'), url('Nunito-Light.woff') format('woff'); - } - - - @font-face { - font-family: 'Nunito Light Italic'; - font-style: normal; - font-weight: normal; - src: local('Nunito Light Italic'), url('Nunito-LightItalic.woff') format('woff'); - } - - - @font-face { - font-family: 'Nunito SemiBold'; - font-style: normal; - font-weight: normal; - src: local('Nunito SemiBold'), url('Nunito-SemiBold.woff') format('woff'); - } - - - @font-face { - font-family: 'Nunito SemiBold Italic'; - font-style: normal; - font-weight: normal; - src: local('Nunito SemiBold Italic'), url('Nunito-SemiBoldItalic.woff') format('woff'); - } - - - @font-face { - font-family: 'Nunito Bold'; - font-style: normal; - font-weight: normal; - src: local('Nunito Bold'), url('Nunito-Bold.woff') format('woff'); - } - - - @font-face { - font-family: 'Nunito Bold Italic'; - font-style: normal; - font-weight: normal; - src: local('Nunito Bold Italic'), url('Nunito-BoldItalic.woff') format('woff'); - } - - - @font-face { - font-family: 'Nunito ExtraBold'; - font-style: normal; - font-weight: normal; - src: local('Nunito ExtraBold'), url('Nunito-ExtraBold.woff') format('woff'); - } - - - @font-face { - font-family: 'Nunito ExtraBold Italic'; - font-style: normal; - font-weight: normal; - src: local('Nunito ExtraBold Italic'), url('Nunito-ExtraBoldItalic.woff') format('woff'); - } - - - @font-face { - font-family: 'Nunito Black'; - font-style: normal; - font-weight: normal; - src: local('Nunito Black'), url('Nunito-Black.woff') format('woff'); - } - - - @font-face { - font-family: 'Nunito Black Italic'; - font-style: normal; - font-weight: normal; - src: local('Nunito Black Italic'), url('Nunito-BlackItalic.woff') format('woff'); - } \ No newline at end of file +@font-face { + font-family: 'Inter'; + font-weight: 400 800; + src: url('./inter/inter-variable-font.ttf'); +} \ No newline at end of file diff --git a/app/src/fonts/helvetica-compressed-5871d14b6903a.woff b/app/src/fonts/helvetica-compressed-5871d14b6903a.woff deleted file mode 100644 index 136fa7c..0000000 Binary files a/app/src/fonts/helvetica-compressed-5871d14b6903a.woff and /dev/null differ diff --git a/app/src/fonts/helvetica-light-587ebe5a59211.woff b/app/src/fonts/helvetica-light-587ebe5a59211.woff deleted file mode 100644 index 5e3db7c..0000000 Binary files a/app/src/fonts/helvetica-light-587ebe5a59211.woff and /dev/null differ diff --git a/app/src/fonts/helvetica-rounded-bold-5871d05ead8de.woff b/app/src/fonts/helvetica-rounded-bold-5871d05ead8de.woff deleted file mode 100644 index 065b723..0000000 Binary files a/app/src/fonts/helvetica-rounded-bold-5871d05ead8de.woff and /dev/null differ diff --git a/app/src/fonts/inter/inter-variable-font.ttf b/app/src/fonts/inter/inter-variable-font.ttf new file mode 100644 index 0000000..e31b51e Binary files /dev/null and b/app/src/fonts/inter/inter-variable-font.ttf differ diff --git a/app/src/lib/components/common/DropDown.svelte b/app/src/lib/components/common/DropDown.svelte index 0593e13..b187499 100644 --- a/app/src/lib/components/common/DropDown.svelte +++ b/app/src/lib/components/common/DropDown.svelte @@ -1,18 +1,49 @@ -
- - {selectedItem} + +
+ showdd = !showdd} + > + {selectedItem.name || "Select"} + {#if showdd} +
+
+ {#if items.length === 0} + + No Items + + {:else} + {#each items as item} + + {/each} + {/if} +
+ {/if}
diff --git a/app/src/lib/components/common/Typography.svelte b/app/src/lib/components/common/Typography.svelte index 27bcc58..3209a00 100644 --- a/app/src/lib/components/common/Typography.svelte +++ b/app/src/lib/components/common/Typography.svelte @@ -16,7 +16,7 @@ - + @@ -46,14 +46,11 @@ } .font-medium { font-weight: 500; - font-family: 'Nunito SemiBold'; } .font-semi-bold { font-weight: 600; - font-family: 'Nunito Bold'; } .font-bold { font-weight: 700; - font-family: 'Nunito ExtraBold'; } \ No newline at end of file diff --git a/app/src/lib/components/editor/extensions/index.ts b/app/src/lib/components/editor/extensions/index.ts index 915f1e2..5b941bf 100644 --- a/app/src/lib/components/editor/extensions/index.ts +++ b/app/src/lib/components/editor/extensions/index.ts @@ -23,7 +23,7 @@ export const StarterKitOptions = { code: { HTMLAttributes: { class: "px-1 bg-gray-200 rounded" } }, horizontalRule: { HTMLAttributes: { class: "my-8" } }, codeBlock: false as const, - heading: { HTMLAttributes: { class: "mt-8" } }, + heading: { HTMLAttributes: { class: "mt-6" } }, }; export default [ diff --git a/app/src/lib/components/settings/tabs/Home.svelte b/app/src/lib/components/settings/tabs/Home.svelte index f72ce4a..fe7ecdd 100644 --- a/app/src/lib/components/settings/tabs/Home.svelte +++ b/app/src/lib/components/settings/tabs/Home.svelte @@ -8,6 +8,7 @@ import { emit } from "@tauri-apps/api/event"; import { TAURI_EVENTS } from "../../../../utils/constants"; import SettingStore from "../../../../store/settings"; + import DropDown from "$lib/components/common/DropDown.svelte"; export let settings: SettingProps; let saving = false; @@ -32,6 +33,29 @@ } saving = false; }; + + const fonts = [{ + name: "Default", + key: "default" + }, { + name: "Inter", + key: "inter" + }]; + + let selected = $ctx.defaultFont ? fonts[0] : fonts[1]; + + const handleSelect = (e: { detail: any; }) => { + const data = e.detail; + let isDefault = false; + if (data.key === fonts[0].key) { + isDefault = true; + } + document.body.style.fontFamily = isDefault ? "unset" : "Inter"; + ctx.update((store) => { + store.defaultFont = isDefault; + return store; + }); + }
@@ -76,4 +100,17 @@ new one.
+
+ + Font + +
+ +
+
diff --git a/app/src/routes/+layout.svelte b/app/src/routes/+layout.svelte index be15162..07a5dcd 100644 --- a/app/src/routes/+layout.svelte +++ b/app/src/routes/+layout.svelte @@ -27,11 +27,17 @@ platform(), getVersion() ]); // darwin | linux | win32. see https://tauri.app/v1/api/js/os for all platforms. + + if ($ctx?.defaultFont) { + document.body.style.fontFamily = "unset"; + } + ctx?.update((store) => { store.os = os; store.version = version; return store; }); + checkUpdates(); pollupdate(); }); @@ -40,7 +46,7 @@ const pollupdate = () => { timer = setInterval(async () => { checkUpdates(); - }, 60 * 60 * 1000 * 6); + }, 60 * 60 * 1000); } const checkUpdates = async (force = false) => { diff --git a/app/src/types/index.ts b/app/src/types/index.ts index fc9d811..7807e5a 100644 --- a/app/src/types/index.ts +++ b/app/src/types/index.ts @@ -15,6 +15,7 @@ export type SettingStoreProps = { lastQuickNoteAt?: number; os?: string; version?: string; + defaultFont?: boolean; } export type FileListProps = {