aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/StyleProvider.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-12-10 13:36:12 -0500
committerbobzel <zzzman@gmail.com>2021-12-10 13:36:12 -0500
commite54c1ef16b4ce0a324fac3747defdc6501834de5 (patch)
treee956e5bbe07e53a36e5ead3d637e6f7c2b01671b /src/client/views/StyleProvider.tsx
parent8176b94970b86bd3c1669130f6fef2ccd70d0b84 (diff)
parentf8ce34c8ed42646691d1e392effe79bc27daf810 (diff)
Merge branch 'master' into ink_v1
Diffstat (limited to 'src/client/views/StyleProvider.tsx')
-rw-r--r--src/client/views/StyleProvider.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx
index 3f120d385..8ee673115 100644
--- a/src/client/views/StyleProvider.tsx
+++ b/src/client/views/StyleProvider.tsx
@@ -46,6 +46,7 @@ export enum StyleProp {
JitterRotation = "jitterRotation", // whether documents should be randomly rotated
BorderPath = "customBorder", // border path for document view
FontSize = "fontSize", // size of text font
+ FontFamily = "fontFamily", // size of text font
}
function darkScheme() { return CurrentUserUtils.ActiveDashboard?.colorScheme === ColorScheme.Dark; }
@@ -91,7 +92,8 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<DocumentViewProps
case StyleProp.WidgetColor: return isAnnotated ? Colors.LIGHT_BLUE : darkScheme() ? "lightgrey" : "dimgrey";
case StyleProp.Opacity: return Cast(doc?._opacity, "number", Cast(doc?.opacity, "number", null));
case StyleProp.HideLinkButton: return props?.hideLinkButton || (!selected && (doc?.isLinkButton || doc?.hideLinkButton));
- case StyleProp.FontSize: return StrCast(doc?.[fieldKey + "fontSize"]);
+ case StyleProp.FontSize: return StrCast(doc?.[fieldKey + "fontSize"], StrCast(doc?.fontSize, StrCast(Doc.UserDoc().fontSize)));
+ case StyleProp.FontFamily: return StrCast(doc?.[fieldKey + "fontFamily"], StrCast(doc?.fontFamily, StrCast(Doc.UserDoc().fontFamily)));
case StyleProp.ShowTitle: return (doc && !doc.presentationTargetDoc &&
StrCast(doc._showTitle,
props?.showTitle?.() ||
@@ -131,6 +133,7 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<DocumentViewProps
case DocumentType.IMG:
case DocumentType.WEB:
case DocumentType.PDF:
+ case DocumentType.MAP:
case DocumentType.SCREENSHOT:
case DocumentType.VID: docColor = docColor || (darkScheme() ? Colors.DARK_GRAY : Colors.LIGHT_GRAY); break;
case DocumentType.COL: