diff --git a/manifest-beta.json b/manifest-beta.json
index f7ed5f8..ed9029a 100644
--- a/manifest-beta.json
+++ b/manifest-beta.json
@@ -1,7 +1,7 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
- "version": "2.6.5-beta-1",
+ "version": "2.6.5",
"minAppVersion": "1.1.6",
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
"author": "Zsolt Viczian",
diff --git a/manifest.json b/manifest.json
index 0e490b7..453f9fe 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,7 +1,7 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
- "version": "2.6.4",
+ "version": "2.6.5",
"minAppVersion": "1.1.6",
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
"author": "Zsolt Viczian",
diff --git a/src/ExcalidrawView.ts b/src/ExcalidrawView.ts
index 6c4c5c6..ecb188f 100644
--- a/src/ExcalidrawView.ts
+++ b/src/ExcalidrawView.ts
@@ -1527,6 +1527,10 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
onload() {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.onload, "ExcalidrawView.onload");
+ if(this.plugin.settings.overrideObsidianFontSize) {
+ document.documentElement.style.fontSize = "";
+ }
+
const apiMissing = Boolean(typeof this.containerEl.onWindowMigrated === "undefined")
this.packages = this.plugin.getPackage(this.ownerWindow);
diff --git a/src/dialogs/Messages.ts b/src/dialogs/Messages.ts
index a05e9ed..abf2eb6 100644
--- a/src/dialogs/Messages.ts
+++ b/src/dialogs/Messages.ts
@@ -17,6 +17,11 @@ I develop this plugin as a hobby, spending my free time doing this. If you find

`,
+"2.6.5":`
+## Fixed
+- Text sizing issue in the drawing that is first loaded after Obsidian restarts [#2086](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2086)
+- Excalidraw didn't load if there was a file in the Excalidraw folder with a name that starts the same way as the Scripts folder name. [#2095](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2095)
+- **OVERSIZED EXCALIDRAW TOOLBAR**: Added a new setting under "Excalidraw Appearance and Behavior > Theme and Styling" called "Limit Obsidian Font Size to Editor Text." This setting is off by default. When enabled, it restricts Obsidian’s custom font size adjustments to editor text only, preventing unintended scaling of Excalidraw UI elements and other themes that rely on the default interface font size. Feel free to experiment with this setting to improve Excalidraw UI consistency. However, because this change affects the broader Obsidian UI, it’s recommended to turn it off if any layout issues arise. [#2087](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2087)`,
"2.6.4":`
## Fixed
- Error saving when cropping images embedded from a URL (not from a file in the Vault) [#2096](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2096)
diff --git a/src/lang/locale/en.ts b/src/lang/locale/en.ts
index 611f41a..51e693b 100644
--- a/src/lang/locale/en.ts
+++ b/src/lang/locale/en.ts
@@ -328,6 +328,11 @@ FILENAME_HEAD: "Filename",
"i.e. you are not using Excalidraw markdown files.
Toggle ON: filename ends with .excalidraw.md
Toggle OFF: filename ends with .md",
DISPLAY_HEAD: "Excalidraw appearance and behavior",
DISPLAY_DESC: "In the 'appearance and behavior' section of Excalidraw Settings, you can fine-tune how Excalidraw appears and behaves. This includes options for dynamic styling, left-handed mode, matching Excalidraw and Obsidian themes, default modes, and more.",
+ OVERRIDE_OBSIDIAN_FONT_SIZE_NAME: "Limit Obsidian Font Size to Editor Text",
+ OVERRIDE_OBSIDIAN_FONT_SIZE_DESC:
+ "Obsidian's custom font size setting affects the entire interface, including Excalidraw and themes that depend on the default font size. " +
+ "Enabling this option restricts font size changes to editor text, which will improve the look of Excalidraw. " +
+ "If parts of the UI look incorrect after enabling, try turning this setting off.",
DYNAMICSTYLE_NAME: "Dynamic styling",
DYNAMICSTYLE_DESC:
"Change Excalidraw UI colors to match the canvas color",
diff --git a/src/main.ts b/src/main.ts
index 642cc17..abcf96d 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -3005,6 +3005,12 @@ export default class ExcalidrawPlugin extends Plugin {
}
this.leafChangeTimeout = window.setTimeout(()=>{this.leafChangeTimeout = null;},1000);
+ if(this.settings.overrideObsidianFontSize) {
+ if(leaf.view && (leaf.view.getViewType() === VIEW_TYPE_EXCALIDRAW)) {
+ document.documentElement.style.fontSize = "";
+ }
+ }
+
const previouslyActiveEV = this.activeExcalidrawView;
const newActiveviewEV: ExcalidrawView =
leaf.view instanceof ExcalidrawView ? leaf.view : null;
diff --git a/src/settings.ts b/src/settings.ts
index 4a6adf7..96180cd 100644
--- a/src/settings.ts
+++ b/src/settings.ts
@@ -41,6 +41,7 @@ import { Rank } from "./menu/ActionIcons";
import { TAG_AUTOEXPORT, TAG_MDREADINGMODE, TAG_PDFEXPORT } from "src/constants/constSettingsTags";
import { HotkeyEditor } from "./dialogs/HotkeyEditor";
import { getExcalidrawViews } from "./utils/ObsidianUtils";
+import de from "./lang/locale/de";
export interface ExcalidrawSettings {
folder: string;
@@ -76,6 +77,7 @@ export interface ExcalidrawSettings {
previewMatchObsidianTheme: boolean;
width: string;
height: string;
+ overrideObsidianFontSize: boolean;
dynamicStyling: DynamicStyle;
isLeftHanded: boolean;
iframeMatchExcalidrawTheme: boolean;
@@ -253,6 +255,7 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
previewMatchObsidianTheme: false,
width: "400",
height: "",
+ overrideObsidianFontSize: false,
dynamicStyling: "colorful",
isLeftHanded: false,
iframeMatchExcalidrawTheme: true,
@@ -516,6 +519,12 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
}
async hide() {
+ if(this.plugin.settings.overrideObsidianFontSize) {
+ document.documentElement.style.fontSize = "";
+ } else if(!document.documentElement.style.fontSize) {
+ document.documentElement.style.fontSize = getComputedStyle(document.body).getPropertyValue("--font-text-size");
+ }
+
this.plugin.settings.scriptFolderPath = normalizePath(
this.plugin.settings.scriptFolderPath,
);
@@ -1163,6 +1172,18 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
cls: "excalidraw-setting-h3",
});
+ new Setting(detailsEl)
+ .setName(t("OVERRIDE_OBSIDIAN_FONT_SIZE_NAME"))
+ .setDesc(fragWithHTML(t("OVERRIDE_OBSIDIAN_FONT_SIZE_DESC")))
+ .addToggle((toggle) =>
+ toggle
+ .setValue(this.plugin.settings.overrideObsidianFontSize)
+ .onChange((value) => {
+ this.plugin.settings.overrideObsidianFontSize = value;
+ this.applySettingsUpdate();
+ }),
+ );
+
new Setting(detailsEl)
.setName(t("DYNAMICSTYLE_NAME"))
.setDesc(fragWithHTML(t("DYNAMICSTYLE_DESC")))