+
+
+
+
+ {rive === null ? (
+
Loading…
+ ) : (
+
+ {FONT_OPTIONS.map((font) => (
+
+ ))}
+
+
+
+ )}
+
+ {currentFont && (
+
+ Current font: {currentFont}
+
+ )}
+
+ );
+};
+
// List Property Test
const TodoItemComponent = ({
diff --git a/src/hooks/useViewModelInstanceFont.ts b/src/hooks/useViewModelInstanceFont.ts
new file mode 100644
index 0000000..860ec3c
--- /dev/null
+++ b/src/hooks/useViewModelInstanceFont.ts
@@ -0,0 +1,38 @@
+import { useCallback } from 'react';
+import { ViewModelInstance, ViewModelInstanceAssetFont } from '@rive-app/canvas';
+import { UseViewModelInstanceFontResult, RiveDecodedFont } from '../types';
+import { useViewModelInstanceProperty } from './useViewModelInstanceProperty';
+
+/**
+ * Hook for interacting with font properties of a ViewModelInstance.
+ *
+ * @param path - Path to the font property (e.g. "boundFont" or "group/titleFont")
+ * @param viewModelInstance - The ViewModelInstance containing the font property
+ * @returns An object with a setter function to set a new font value
+ */
+export default function useViewModelInstanceFont(
+ path: string,
+ viewModelInstance?: ViewModelInstance | null
+): UseViewModelInstanceFontResult {
+ const result = useViewModelInstanceProperty