[Update] Add Font Family.

This commit is contained in:
Sakamoto Shiina
2024-10-02 17:52:19 +09:00
parent 3570fffbf6
commit faa6656e00
7 changed files with 124 additions and 6 deletions

View File

@@ -0,0 +1,24 @@
import { useStore_SelectedFontFamily } from "@store";
import { useStdoutToPython } from "@logics/useStdoutToPython";
export const useSelectedFontFamily = () => {
const { asyncStdoutToPython } = useStdoutToPython();
const { currentSelectedFontFamily, updateSelectedFontFamily, pendingSelectedFontFamily } = useStore_SelectedFontFamily();
const getSelectedFontFamily = () => {
pendingSelectedFontFamily();
asyncStdoutToPython("/get/data/font_family");
};
const setSelectedFontFamily = (selected_font_family) => {
pendingSelectedFontFamily();
asyncStdoutToPython("/set/data/font_family", selected_font_family);
};
return {
currentSelectedFontFamily,
getSelectedFontFamily,
updateSelectedFontFamily,
setSelectedFontFamily,
};
};