Skip to content

Build your personal knowledge base with Trilium Notes

feat(fonts): let a font note into the picker with a switch, by id

Elian Doran134a4535162d
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 6ea4dc2efb..cc39bbc13a 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -581,7 +581,7 @@
"app_css": "Marks CSS notes which are loaded into the Trilium application and can thus be used to modify Trilium's looks.",
"app_theme": "Marks CSS notes which are full Trilium themes and are thus available in Trilium options.",
"app_theme_base": "Set to \"next\", \"next-light\", or \"next-dark\" to use the corresponding TriliumNext theme (auto, light or dark) as the base for a custom theme, instead of the legacy one.",
- "custom_font": "Marks font files which are offered in the font picker in Trilium options. The value is the family name to list it under; without one, the note's title is used.",
+ "custom_font": "Marks font files which are offered in the font picker in Trilium options, under the note's own title.",
"css_class": "Value of this label is then added as CSS class to the node representing given note in the tree. This can be useful for advanced theming. Can be used in template notes.",
"icon_class": "Value of this label is added as a CSS class to the icon on the tree which can help visually distinguish the notes in the tree. Example might be bx bx-home - icons are taken from boxicons. Can be used in template notes.",
"page_size": "Number of items per page in note listing.",
@@ -1615,7 +1615,10 @@
"pangram": "The quick brown fox jumps over the lazy dog",
"specimen_placeholder": "Type to preview your own text…",
"size": "Preview size",
- "size_pixels": "{{size}} px"
+ "size_pixels": "{{size}} px",
+ "in_picker": "In font picker",
+ "offer_in_picker": "Offer this font in the appearance settings",
+ "remove_from_picker": "Stop offering this font in the appearance settings"
},
"media": {
"play": "Play",
diff --git a/apps/client/src/widgets/type_widgets/file/FontPreview.css b/apps/client/src/widgets/type_widgets/file/FontPreview.css
index 9ce6ee0dab..25dfd198a1 100644
--- a/apps/client/src/widgets/type_widgets/file/FontPreview.css
+++ b/apps/client/src/widgets/type_widgets/file/FontPreview.css
@@ -6,11 +6,17 @@
.font-preview-controls {
display: flex;
+ flex-wrap: wrap;
align-items: center;
gap: 16px;
margin-bottom: 20px;
}
+ .font-preview-offer {
+ flex: 0 0 auto;
+ margin-left: auto;
+ }
+
.font-preview-specimen-input {
flex: 1 1 auto;
min-width: 0;
diff --git a/apps/client/src/widgets/type_widgets/file/FontPreview.spec.tsx b/apps/client/src/widgets/type_widgets/file/FontPreview.spec.tsx
index bed51cb68d..6c6b0a4cbf 100644
--- a/apps/client/src/widgets/type_widgets/file/FontPreview.spec.tsx
+++ b/apps/client/src/widgets/type_widgets/file/FontPreview.spec.tsx
@@ -7,6 +7,15 @@ vi.mock("../../../services/i18n", () => ({
t: (key: string, opts?: Record<string, unknown>) => [ key, ...Object.values(opts ?? {}) ].join("|")
}));
+// The real hooks module imports half the app (app_context, keyboard actions) at module scope; only
+// the one the preview reaches for is stood in for.
+const setOffered = vi.fn();
+let isOffered = false;
+
+vi.mock("../../react/hooks", () => ({
+ useNoteLabelBoolean: () => [ isOffered, setOffered ]
+}));
+
const { default: FontPreview } = await import("./FontPreview");
/** The faces `document.fonts` currently holds, as the stubbed registry below sees them. */
@@ -26,6 +35,7 @@ class FontStub {
}
beforeEach(() => {
+ isOffered = false;
registeredFonts = new Set();
fetchMock = vi.fn(async () => new Response(new Uint8Array([ 0x00, 0x01, 0x00, 0x00 ])));
@@ -50,8 +60,8 @@ afterEach(() => {
vi.clearAllMocks();
});
-function mount({ noteId = "font1", blobId = "blobA" as string | null, isContentAvailable = true } = {}) {
- const note = { noteId, isContentAvailable: () => isContentAvailable };
+function mount({ noteId = "font1", blobId = "blobA" as string | null, isContentAvailable = true, title = "Iosevka-Regular" } = {}) {
+ const note = { noteId, title, isContentAvailable: () => isContentAvailable };
const blob = blobId ? { blobId } : null;
const props = { note, blob } as unknown as Parameters<typeof FontPreview>[0];
render(<FontPreview {...props} />, container);
@@ -146,6 +156,27 @@ describe("FontPreview", () => {
expect(fetchMock).not.toHaveBeenCalled();
});
+ it("offers the font to the picker, and takes the offer back, through #customFont", async () => {
+ mount();
+ await waitForSpecimen();
+
+ const toggle = () => container.querySelector<HTMLInputElement>(".font-preview-offer input.switch-toggle");
+ expect(toggle()?.checked).toBe(false);
+ toggle()?.dispatchEvent(new Event("input", { bubbles: true }));
+ expect(setOffered).toHaveBeenCalledWith(true);
+
+ // The label alone says the font is offered — the picker names it by the note's title, so
+ // there is no family to keep in step with a rename.
+ isOffered = true;
+ render(null, container);
+ mount();
+ await waitForSpecimen();
+
+ expect(toggle()?.checked).toBe(true);
+ toggle()?.dispatchEvent(new Event("input", { bubbles: true }));
+ expect(setOffered).toHaveBeenCalledWith(false);
+ });
+
it("stays blank until the blob that versions the request arrives", () => {
mount({ blobId: null });
diff --git a/apps/client/src/widgets/type_widgets/file/FontPreview.tsx b/apps/client/src/widgets/type_widgets/file/FontPreview.tsx
index a8e7cb37fa..d100b95eaf 100644
--- a/apps/client/src/widgets/type_widgets/file/FontPreview.tsx
+++ b/apps/client/src/widgets/type_widgets/file/FontPreview.tsx
@@ -9,6 +9,8 @@ import { registerFontNote } from "../../../services/custom_fonts";
import { t } from "../../../services/i18n";
import Alert from "../../react/Alert";
import FormTextBox from "../../react/FormTextBox";
+import FormToggle from "../../react/FormToggle";
+import { useNoteLabelBoolean } from "../../react/hooks";
import Slider from "../../react/Slider";
/** The sizes the specimen is laddered at, from a display line down to body copy. */
@@ -74,6 +76,8 @@ export default function FontPreview({ note, blob }: FontPreviewProps) {
/>
<span className="font-preview-size-value">{t("font_preview.size_pixels", { size })}</span>
</div>
+
+ <PickerOffer note={note} />
</div>
<div className="font-preview-specimen" style={{ "--font-preview-specimen-size": `${size}px` }}>{text}</div>
@@ -96,6 +100,25 @@ export default function FontPreview({ note, blob }: FontPreviewProps) {
);
}
+/** Whether the font picker in the appearance settings offers this font, and the switch that puts it
+ * there or takes it back — the `#customFont` label, which the picker reads. */
+function PickerOffer({ note }: { note: FNote }) {
+ const [ offered, setOffered ] = useNoteLabelBoolean(note, "customFont");
+
+ return (
+ <div className="font-preview-offer">
+ <FormToggle
+ currentValue={offered}
+ switchOnName={t("font_preview.in_picker")}
+ switchOnTooltip={t("font_preview.offer_in_picker")}
+ switchOffName={t("font_preview.in_picker")}
+ switchOffTooltip={t("font_preview.remove_from_picker")}
+ onChange={setOffered}
+ />
+ </div>
+ );
+}
+
/**
* Registers the note's font with the document for as long as the preview is mounted, and returns
* the family name to render it with — `undefined` while it loads, `null` if the file is not a font
diff --git a/apps/client/src/widgets/type_widgets/options/appearance.spec.tsx b/apps/client/src/widgets/type_widgets/options/appearance.spec.tsx
index 9af201da24..adc877f35d 100644
--- a/apps/client/src/widgets/type_widgets/options/appearance.spec.tsx
+++ b/apps/client/src/widgets/type_widgets/options/appearance.spec.tsx
@@ -6,7 +6,7 @@ const mocks = vi.hoisted(() => ({
electron: true,
mobile: false,
stored: {} as Record<string, string | boolean>,
- userFonts: [] as { family: string; title: string; noteId: string; blobId: string }[]
+ userFonts: [] as { noteId: string; title: string; blobId: string }[]
}));
// Both the desktop card and the illustrated layout choices turn on which kind of client this is.
@@ -31,12 +31,6 @@ vi.mock("../../../services/server", () => ({
}
}));
-vi.mock("../../react/hooks", async (importOriginal) => ({
- ...(await importOriginal<typeof import("../../react/hooks")>()),
- useTriliumOption: (name: string) => [ String(mocks.stored[name] ?? ""), vi.fn() ],
- useTriliumOptionBool: (name: string) => [ mocks.stored[name] === true, vi.fn() ]
-}));
-
vi.mock("./components/OptionsPageHeader", () => ({ default: () => <div className="header-stub" /> }));
// The font picker asks for the user's own fonts and registers each one it is given; only the list
@@ -46,6 +40,14 @@ vi.mock("../../../services/custom_fonts", () => ({
registerFontNote: async (_noteId: string, family: string) => ({ family })
}));
+// useNoteTitle names the font a font option points at; the listing above is what the picker lists.
+vi.mock("../../react/hooks", async (importOriginal) => ({
+ ...(await importOriginal<typeof import("../../react/hooks")>()),
+ useNoteTitle: (noteId: string | undefined) => mocks.userFonts.find((font) => font.noteId === noteId)?.title,
+ useTriliumOption: (name: string) => [ String(mocks.stored[name] ?? ""), vi.fn() ],
+ useTriliumOptionBool: (name: string) => [ mocks.stored[name] === true, vi.fn() ]
+}));
+
import AppearanceSettings from "./appearance";
let host: HTMLElement;
@@ -102,13 +104,13 @@ describe("the font settings", () => {
expect(fontRows().every((row) => row.className.includes("tn-card-section-nested"))).toBe(true);
});
- it("offers the fonts the user labelled #customFont, one entry per family", async () => {
+ it("offers the fonts the user labelled #customFont, one entry per note", async () => {
mocks.stored = { overrideThemeFonts: true };
mocks.userFonts = [
- { family: "Iosevka", title: "Iosevka.woff2", noteId: "n1", blobId: "b1" },
- { family: "Inter", title: "Inter.woff2", noteId: "n2", blobId: "b2" },
- // A second note offering a family already on the list is not a second entry.
- { family: "Inter", title: "Inter (copy).woff2", noteId: "n3", blobId: "b3" }
+ { noteId: "fontNoteA1", title: "Iosevka", blobId: "b1" },
+ { noteId: "fontNoteB2", title: "Inter", blobId: "b2" },
+ // Two notes may well carry the same name; each is its own entry, told apart by its note.
+ { noteId: "fontNoteC3", title: "Inter", blobId: "b3" }
];
open();
await act(async () => {});
@@ -119,11 +121,21 @@ describe("the font settings", () => {
const headers = [ ...(picker?.querySelectorAll(".dropdown-header") ?? []) ].map((header) => header.textContent);
expect(headers).toContain("fonts.user-fonts");
+ // Each is named by its note's own title, and stands for the note rather than for a family.
const listed = [ ...(picker?.querySelectorAll(".dropdown-item") ?? []) ].map((item) => item.textContent?.trim());
- expect(listed.filter((entry) => entry === "Inter")).toHaveLength(1);
+ expect(listed.filter((entry) => entry === "Inter")).toHaveLength(2);
expect(listed).toContain("Iosevka");
});
+ it("names a set custom font by its note's title, not by the reference the option holds", async () => {
+ mocks.stored = { overrideThemeFonts: true, mainFontFamily: "customFont:fontNoteA1" };
+ mocks.userFonts = [ { noteId: "fontNoteA1", title: "Iosevka", blobId: "b1" } ];
+ open();
+ await act(async () => {});
+
+ expect(fontRows()[0].querySelector(".font-option-specimen")?.textContent).toBe("Iosevka");
+ });
+
it("lists only the built-in families when the user has labelled no fonts", async () => {
mocks.stored = { overrideThemeFonts: true };
open();
diff --git a/apps/client/src/widgets/type_widgets/options/appearance.tsx b/apps/client/src/widgets/type_widgets/options/appearance.tsx
index e0120771a5..86c6a8e0a7 100644
--- a/apps/client/src/widgets/type_widgets/options/appearance.tsx
+++ b/apps/client/src/widgets/type_widgets/options/appearance.tsx
@@ -1,6 +1,6 @@
import "./appearance.css";
-import { FontFamily, OptionNames, SYSTEM_MONOSPACE_FONT_STACK, SYSTEM_SANS_SERIF_FONT_STACK, UserFont } from "@triliumnext/commons";
+import { customFontFamily, customFontNoteId, customFontOption, FontFamily, OptionNames, SYSTEM_MONOSPACE_FONT_STACK, SYSTEM_SANS_SERIF_FONT_STACK, UserFont } from "@triliumnext/commons";
import clsx from "clsx";
import { Fragment } from "preact";
import { createPortal } from "preact/compat";
@@ -19,7 +19,7 @@ import FormList, { FormListHeader, FormListItem } from "../../react/FormList";
import { FormTextBoxWithUnit } from "../../react/FormTextBox";
import FormToggle from "../../react/FormToggle";
import HelpButton from "../../react/HelpButton";
-import { useTriliumOption, useTriliumOptionBool } from "../../react/hooks";
+import { useNoteTitle, useTriliumOption, useTriliumOptionBool } from "../../react/hooks";
import Icon from "../../react/Icon";
import Modal from "../../react/Modal";
import SegmentedChoice, { SegmentedChoiceOption } from "../../react/SegmentedChoice";
@@ -503,15 +503,13 @@ function useFontGroups(): FontGroup[] {
const registered: FontFace[] = [];
(async () => {
- // By family, since that is what the picker lists and what an option holds: two notes
- // offering the same name are one entry.
- const fonts = [ ...new Map((await getCustomFonts()).map((font) => [ font.family, font ])).values() ];
+ const fonts = await getCustomFonts();
if (cancelled) return;
setCustomFonts(fonts);
- await Promise.all(fonts.map(async ({ noteId, family, blobId }) => {
+ await Promise.all(fonts.map(async ({ noteId, blobId }) => {
try {
- const face = await registerFontNote(noteId, family, blobId);
+ const face = await registerFontNote(noteId, customFontFamily(noteId), blobId);
if (cancelled) {
document.fonts.delete(face);
} else {
@@ -533,7 +531,10 @@ function useFontGroups(): FontGroup[] {
}, []);
return useMemo(() => (customFonts.length
- ? [ ...FONT_FAMILIES, { title: t("fonts.user-fonts"), items: customFonts.map(({ family }) => ({ value: family })) } ]
+ ? [ ...FONT_FAMILIES, {
+ title: t("fonts.user-fonts"),
+ items: customFonts.map(({ noteId, title }) => ({ value: customFontOption(noteId), label: title }))
+ } ]
: FONT_FAMILIES), [ customFonts ]);
}
@@ -554,11 +555,15 @@ function Font({ label, description, sizeDescription, groups, fontFamilyOption, f
const [ fontSize, setFontSize ] = useTriliumOption(fontSizeOption);
const [ showModal, setShowModal ] = useState(false);
+ // One of the user's own fonts is named by the note holding it, so its own title says what is
+ // set — read from the cache rather than waited for from the listing, and it follows a rename.
+ const customFontTitle = useNoteTitle(customFontNoteId(fontFamily) ?? undefined, undefined);
+
// Find the current font entry to display
const currentFont = groups
.flatMap(group => group.items)
.find(item => item.value === fontFamily);
- const displayLabel = currentFont?.label ?? currentFont?.value ?? fontFamily ?? "";
+ const displayLabel = customFontTitle ?? currentFont?.label ?? currentFont?.value ?? fontFamily ?? "";
// Map option name to CSS variable
const themeCssVariable = {
@@ -578,7 +583,10 @@ function Font({ label, description, sizeDescription, groups, fontFamilyOption, f
// Use the appropriate system font stack
return isMonospace ? SYSTEM_MONOSPACE_FONT_STACK : SYSTEM_SANS_SERIF_FONT_STACK;
}
- return value;
+ // One of the user's own fonts names the note it is stored in, not a family the browser
+ // could resolve; the family it was registered under is built from the same id.
+ const noteId = customFontNoteId(value);
+ return noteId ? customFontFamily(noteId) : value;
};
return (
diff --git a/packages/commons/src/index.ts b/packages/commons/src/index.ts
index 632f8717f8..1d73468e30 100644
--- a/packages/commons/src/index.ts
+++ b/packages/commons/src/index.ts
@@ -6,6 +6,7 @@ export * from "./lib/hidden_subtree.js";
export * from "./lib/rows.js";
export * from "./lib/test-utils.js";
export * from "./lib/attachment_roles.js";
+export * from "./lib/custom_fonts.js";
export * from "./lib/font_mimes.js";
export * from "./lib/image_mimes.js";
export * from "./lib/mime_type.js";
diff --git a/packages/commons/src/lib/builtin_attributes.ts b/packages/commons/src/lib/builtin_attributes.ts
index 458222bfe3..37d46240b5 100644
--- a/packages/commons/src/lib/builtin_attributes.ts
+++ b/packages/commons/src/lib/builtin_attributes.ts
@@ -89,9 +89,8 @@ const BUILTIN_ATTRIBUTES = [
{ type: "label", name: "appThemeBase", valueType: "select", selectOptions: [
"next", "next-light", "next-dark"
] },
- // The family name a font file note is offered under in the font picker; the note's title
- // stands in where the label carries no value.
- { type: "label", name: "customFont", valueType: "text" },
+ // Offers a font file note in the font picker, under the note's own title.
+ { type: "label", name: "customFont", valueType: "boolean" },
{ type: "label", name: "hidePromotedAttributes", valueType: "boolean" },
{ type: "label", name: "readOnly", valueType: "boolean" },
{ type: "label", name: "autoReadOnlyDisabled", valueType: "boolean" },
diff --git a/packages/commons/src/lib/custom_fonts.spec.ts b/packages/commons/src/lib/custom_fonts.spec.ts
new file mode 100644
index 0000000000..c8014c2f1e
--- /dev/null
+++ b/packages/commons/src/lib/custom_fonts.spec.ts
@@ -0,0 +1,25 @@
+import { describe, expect, it } from "vitest";
+
+import { customFontFamily, customFontNoteId, customFontOption } from "./custom_fonts.js";
+
+describe("custom font options", () => {
+ it("round-trips a note id through the option value, and registers it under a family of its own", () => {
+ const option = customFontOption("abc123XYZ_89");
+ expect(customFontNoteId(option)).toBe("abc123XYZ_89");
+ expect(customFontFamily("abc123XYZ_89")).toBe("trilium-font-abc123XYZ_89");
+ });
+
+ it("reads no note out of an option naming a family the browser resolves itself", () => {
+ for (const value of [ "theme", "system", "Arial", "Times New Roman", "", undefined, null ]) {
+ expect(customFontNoteId(value), String(value)).toBeNull();
+ }
+ });
+
+ it("reads no note out of a reference that is not one Trilium could have written", () => {
+ // The id is built into a CSS family, so anything a stylesheet would read as more than a
+ // family name resolves to nothing rather than reaching the declaration.
+ for (const value of [ "customFont:", "customFont:abc\"; } body {", "customFont:a b", "customFont:a-b" ]) {
+ expect(customFontNoteId(value), value).toBeNull();
+ }
+ });
+});
diff --git a/packages/commons/src/lib/custom_fonts.ts b/packages/commons/src/lib/custom_fonts.ts
new file mode 100644
index 0000000000..d20155ec53
--- /dev/null
+++ b/packages/commons/src/lib/custom_fonts.ts
@@ -0,0 +1,37 @@
+/**
+ * How a font option points at one of the user's own fonts — a note labelled `#customFont` — and the
+ * CSS family that note's file is registered under.
+ *
+ * The reference is the note's id, not the font's name. The name a font is offered under is the
+ * note's title, which the user is free to change at any time, and an option holding that name would
+ * stop resolving the moment they did. The id also keeps user-authored text out of the stylesheet the
+ * font options are served as (see `getFontCss`): what reaches a CSS declaration is the family below,
+ * built from an id this module has checked.
+ */
+const OPTION_PREFIX = "customFont:";
+
+/** A note id as Trilium mints them. Checked before an id is built into a CSS family. */
+const NOTE_ID_PATTERN = /^[A-Za-z0-9_]+$/;
+
+/** What a font option holds to name the user's own font note. */
+export function customFontOption(noteId: string): string {
+ return `${OPTION_PREFIX}${noteId}`;
+}
+
+/**
+ * The note a font option names, or `null` where the option names a family the browser resolves for
+ * itself ("Arial", "theme", "system").
+ */
+export function customFontNoteId(optionValue: string | undefined | null): string | null {
+ if (!optionValue?.startsWith(OPTION_PREFIX)) {
+ return null;
+ }
+
+ const noteId = optionValue.substring(OPTION_PREFIX.length);
+ return NOTE_ID_PATTERN.test(noteId) ? noteId : null;
+}
+
+/** The CSS family a note's font file is registered under. */
+export function customFontFamily(noteId: string): string {
+ return `trilium-font-${noteId}`;
+}
diff --git a/packages/commons/src/lib/server_api.ts b/packages/commons/src/lib/server_api.ts
index 29bfb5d8aa..074bf6c08d 100644
--- a/packages/commons/src/lib/server_api.ts
+++ b/packages/commons/src/lib/server_api.ts
@@ -742,10 +742,9 @@ export type SaveSearchNoteResponse = CloneResponse;
/** A font file note carrying `#customFont`, as the font picker in the options lists it. */
export interface UserFont {
- /** The family name the font is registered and selected under. */
- family: string;
- title: string;
noteId: string;
+ /** The name the font is offered under: the note's own title. */
+ title: string;
/** Versions the request for the font's bytes, so a replaced file is not served from the cache. */
blobId: string;
}
diff --git a/packages/trilium-core/src/routes/api/options.spec.ts b/packages/trilium-core/src/routes/api/options.spec.ts
index f89ba12c76..75a73c87c5 100644
--- a/packages/trilium-core/src/routes/api/options.spec.ts
+++ b/packages/trilium-core/src/routes/api/options.spec.ts
@@ -17,13 +17,13 @@ function getOptionValue(name: string): string | null {
}
/** Creates a file note carrying a `#customFont` label and returns its note ID. */
-async function createFontNote(title: string, family: string): Promise<string> {
+async function createFontNote(title: string): Promise<string> {
const created = await api.post<{ note: { noteId: string } }>("/api/notes/root/children?target=into", {
body: { title, type: "file", mime: "font/woff2", content: "wOF2" }
});
const { noteId } = created.body.note;
await api.put(`/api/notes/${noteId}/set-attribute`, {
- body: { type: "label", name: "customFont", value: family }
+ body: { type: "label", name: "customFont", value: "" }
});
return noteId;
}
@@ -202,19 +202,16 @@ describe("Options API (core)", () => {
expect(noValueEntry?.val).toBe("theme-b--");
});
- it("returns user fonts, falling back to the title as the family when customFont has no value", async () => {
- const named = await createFontNote("Iosevka.woff2", "Iosevka");
- const unnamed = await createFontNote("Inter Variable", "");
+ it("returns each font note by id, named by its title", async () => {
+ const noteId = await createFontNote("Iosevka");
const res = await api.get<UserFont[]>("/api/options/user-fonts");
expect(res.status).toBe(200);
- const namedEntry = res.body.find((font) => font.noteId === named);
- const unnamedEntry = res.body.find((font) => font.noteId === unnamed);
- expect(namedEntry?.family).toBe("Iosevka");
- expect(namedEntry?.title).toBe("Iosevka.woff2");
- // The family the picker lists it under, and the version the bytes are fetched with.
- expect(unnamedEntry?.family).toBe("Inter Variable");
- expect(unnamedEntry?.blobId).toBeTruthy();
+ // The id an option points at, the name the picker offers it under, and the version the
+ // request for its bytes carries.
+ const entry = res.body.find((font) => font.noteId === noteId);
+ expect(entry?.title).toBe("Iosevka");
+ expect(entry?.blobId).toBeTruthy();
});
});
diff --git a/packages/trilium-core/src/routes/api/options.ts b/packages/trilium-core/src/routes/api/options.ts
index a33d44b3af..44f3dc877d 100644
--- a/packages/trilium-core/src/routes/api/options.ts
+++ b/packages/trilium-core/src/routes/api/options.ts
@@ -293,12 +293,9 @@ function getUserFonts() {
continue;
}
- const title = note.getTitleOrProtected();
-
ret.push({
- family: note.getOwnedLabelValue("customFont") || title,
- title,
noteId: note.noteId,
+ title: note.getTitleOrProtected(),
blobId: note.blobId ?? ""
});
}