fix(core): some fonts are unavailable (#8139)

close AF-1349 AF-1347
This commit is contained in:
JimmFly 2024-09-06 05:08:12 +00:00
parent 7d93fae1dd
commit a027cef457
No known key found for this signature in database
GPG Key ID: 126E0320FEB0D05C
3 changed files with 11 additions and 10 deletions

View File

@ -234,7 +234,7 @@ const FontMenuItem = ({
onSelect: (font: string) => void;
}) => {
const handleFontSelect = useCallback(
() => onSelect(font.fullName),
() => onSelect(font.family),
[font, onSelect]
);
const fontFamily = getFontFamily(font.family);
@ -268,6 +268,7 @@ const CustomFontFamilySettings = () => {
const settings = useLiveData(editorSettingService.editorSetting.settings$);
const fontFamily = getFontFamily(settings.customFontFamily);
const onCustomFontFamilyChange = useCallback(
(fontFamily: string) => {
editorSettingService.editorSetting.set('customFontFamily', fontFamily);

View File

@ -414,19 +414,19 @@
"com.affine.appUpdater.updateAvailable": "Update available",
"com.affine.appUpdater.whatsNew": "Discover what's new!",
"com.affine.appearanceSettings.clientBorder.description": "Customise the appearance of the client.",
"com.affine.appearanceSettings.clientBorder.title": "Client Border Style",
"com.affine.appearanceSettings.clientBorder.title": "Client border style",
"com.affine.appearanceSettings.color.description": "Choose your colour mode",
"com.affine.appearanceSettings.color.title": "Colour Mode",
"com.affine.appearanceSettings.color.title": "Colour mode",
"com.affine.appearanceSettings.date.title": "Date",
"com.affine.appearanceSettings.dateFormat.description": "Customise your date style.",
"com.affine.appearanceSettings.dateFormat.title": "Date Format",
"com.affine.appearanceSettings.dateFormat.title": "Date format",
"com.affine.appearanceSettings.font.description": "Choose your font style",
"com.affine.appearanceSettings.font.title": "Font Style",
"com.affine.appearanceSettings.font.title": "Font style",
"com.affine.appearanceSettings.fontStyle.mono": "Mono",
"com.affine.appearanceSettings.fontStyle.sans": "Sans",
"com.affine.appearanceSettings.fontStyle.serif": "Serif",
"com.affine.appearanceSettings.fullWidth.description": "Maximum display of content within a doc.",
"com.affine.appearanceSettings.fullWidth.title": "Full width Layout",
"com.affine.appearanceSettings.fullWidth.title": "Full width layout",
"com.affine.appearanceSettings.language.description": "Select the language for the interface.",
"com.affine.appearanceSettings.language.title": "Display language",
"com.affine.appearanceSettings.noisyBackground.description": "Use background noise effect on the sidebar.",
@ -1253,7 +1253,7 @@
"com.affine.settings.editorSettings.edgeless.connecter.border-style": "Border style",
"com.affine.settings.editorSettings.edgeless.connecter.border-thickness": "Border thickness",
"com.affine.settings.editorSettings.edgeless.connecter.color": "Color",
"com.affine.settings.editorSettings.edgeless.connecter.connector-shape": "Connector Shape",
"com.affine.settings.editorSettings.edgeless.connecter.connector-shape": "Connector shape",
"com.affine.settings.editorSettings.edgeless.connecter.connector-shape.curve": "Curve",
"com.affine.settings.editorSettings.edgeless.connecter.connector-shape.elbowed": "Elbowed",
"com.affine.settings.editorSettings.edgeless.connecter.connector-shape.straight": "Straight",
@ -1304,9 +1304,9 @@
"com.affine.settings.editorSettings.edgeless.text.alignment.right": "Right",
"com.affine.settings.editorSettings.edgeless.text.color": "Text color",
"com.affine.settings.editorSettings.edgeless.text.font": "Font",
"com.affine.settings.editorSettings.edgeless.text.font-family": "Font Family",
"com.affine.settings.editorSettings.edgeless.text.font-family": "Font family",
"com.affine.settings.editorSettings.edgeless.text.font-size": "Font size",
"com.affine.settings.editorSettings.edgeless.text.font-style": "Font Style",
"com.affine.settings.editorSettings.edgeless.text.font-style": "Font style",
"com.affine.settings.editorSettings.edgeless.text.font-weight": "Font weight",
"com.affine.settings.editorSettings.general": "General",
"com.affine.settings.editorSettings.general.ai.description": "Enable the powerful AI assistant, AFFiNE AI.",

View File

@ -1288,7 +1288,7 @@
"com.affine.settings.editorSettings.edgeless.shape.font": "字体",
"com.affine.settings.editorSettings.edgeless.shape.font-size": "字体大小",
"com.affine.settings.editorSettings.edgeless.shape.font-style": "字体样式",
"com.affine.settings.editorSettings.edgeless.shape.rounded-rectangle": "长方形",
"com.affine.settings.editorSettings.edgeless.shape.rounded-rectangle": "圆角矩形",
"com.affine.settings.editorSettings.edgeless.shape.square": "正方形",
"com.affine.settings.editorSettings.edgeless.shape.text-alignment": "文本对齐",
"com.affine.settings.editorSettings.edgeless.shape.text-color": "文本颜色",