diff --git a/core/frontend/src/lang/en.js b/core/frontend/src/lang/en.js
index ddd6e8b781..b10e87ca1c 100644
--- a/core/frontend/src/lang/en.js
+++ b/core/frontend/src/lang/en.js
@@ -1466,6 +1466,7 @@ export default {
dimension_text_style: 'Name Style',
dimension_letter_space: 'Name Letter Space',
font_family: 'Font Family',
+ font_family_tip: 'The font will only take effect if it is installed on the operating system',
letter_space: 'Letter Space',
font_shadow: 'Font Shadow',
chart_area: 'Area',
diff --git a/core/frontend/src/lang/tw.js b/core/frontend/src/lang/tw.js
index 7843fc63e1..9f374754f6 100644
--- a/core/frontend/src/lang/tw.js
+++ b/core/frontend/src/lang/tw.js
@@ -1465,6 +1465,7 @@ export default {
dimension_text_style: '名稱樣式',
dimension_letter_space: '名稱字間距',
font_family: '字體',
+ font_family_tip: '只有操作系統上已安裝該字體才能生效',
letter_space: '字間距',
font_shadow: '字體陰影',
chart_area: '面積圖',
diff --git a/core/frontend/src/lang/zh.js b/core/frontend/src/lang/zh.js
index 574a1bcb54..a39ad85887 100644
--- a/core/frontend/src/lang/zh.js
+++ b/core/frontend/src/lang/zh.js
@@ -1464,6 +1464,7 @@ export default {
dimension_text_style: '名称样式',
dimension_letter_space: '名称字间距',
font_family: '字体',
+ font_family_tip: '只有操作系统上已安装该字体才能生效',
letter_space: '字间距',
font_shadow: '字体阴影',
chart_area: '面积图',
diff --git a/core/frontend/src/views/chart/chart/chart.js b/core/frontend/src/views/chart/chart/chart.js
index 6eb7fa837e..1af8b92939 100644
--- a/core/frontend/src/views/chart/chart/chart.js
+++ b/core/frontend/src/views/chart/chart/chart.js
@@ -1146,6 +1146,13 @@ export const CHART_FONT_FAMILY = [
{ name: '楷体', value: 'KaiTi' }
]
+export const CHART_CONT_FAMILY_MAP = {
+ 'Microsoft YaHei': 'Microsoft YaHei',
+ 'SimSun': 'SimSun, "Songti SC", STSong',
+ 'SimHei': 'SimHei, Helvetica',
+ 'KaiTi': 'KaiTi, "Kaiti SC", STKaiti'
+}
+
export const CHART_FONT_LETTER_SPACE = [
{ name: '0px', value: '0' },
{ name: '1px', value: '1' },
diff --git a/core/frontend/src/views/chart/components/ChartComponentG2.vue b/core/frontend/src/views/chart/components/ChartComponentG2.vue
index 086615a457..1ae307cfba 100644
--- a/core/frontend/src/views/chart/components/ChartComponentG2.vue
+++ b/core/frontend/src/views/chart/components/ChartComponentG2.vue
@@ -55,7 +55,7 @@ import { baseRadarOptionAntV } from '@/views/chart/chart/radar/radar_antv'
import { baseWaterfallOptionAntV } from '@/views/chart/chart/waterfall/waterfall'
import { baseWordCloudOptionAntV } from '@/views/chart/chart/wordCloud/word_cloud'
import TitleRemark from '@/views/chart/view/TitleRemark'
-import { DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
+import { CHART_CONT_FAMILY_MAP, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
import { baseMixOptionAntV } from '@/views/chart/chart/mix/mix_antv'
import ChartTitleUpdate from './ChartTitleUpdate.vue'
import { equalsAny } from '@/utils/StringUtils'
@@ -429,7 +429,7 @@ export default {
this.title_class.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
this.title_class.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
- this.title_class.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : DEFAULT_TITLE_STYLE.fontFamily
+ this.title_class.fontFamily = customStyle.text.fontFamily ? CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : DEFAULT_TITLE_STYLE.fontFamily
this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px'
this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
}
diff --git a/core/frontend/src/views/chart/components/ChartComponentS2.vue b/core/frontend/src/views/chart/components/ChartComponentS2.vue
index deb834afdc..31d5e3ca22 100644
--- a/core/frontend/src/views/chart/components/ChartComponentS2.vue
+++ b/core/frontend/src/views/chart/components/ChartComponentS2.vue
@@ -97,7 +97,7 @@ import ViewTrackBar from '@/components/canvas/components/editor/ViewTrackBar'
import { getRemark, hexColorToRGBA } from '@/views/chart/chart/util'
import { baseTableInfo, baseTableNormal, baseTablePivot } from '@/views/chart/chart/table/table-info'
import TitleRemark from '@/views/chart/view/TitleRemark'
-import { DEFAULT_TITLE_STYLE, NOT_SUPPORT_PAGE_DATASET } from '@/views/chart/chart/chart'
+import { CHART_CONT_FAMILY_MAP, DEFAULT_TITLE_STYLE, NOT_SUPPORT_PAGE_DATASET } from '@/views/chart/chart/chart'
import ChartTitleUpdate from './ChartTitleUpdate.vue'
import { mapState } from 'vuex'
import DePagination from '@/components/deCustomCm/pagination.js'
@@ -459,7 +459,7 @@ export default {
this.$refs.title.style.fontSize = customStyle.text.fontSize + 'px'
}
- this.title_class.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : DEFAULT_TITLE_STYLE.fontFamily
+ this.title_class.fontFamily = customStyle.text.fontFamily ? CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : DEFAULT_TITLE_STYLE.fontFamily
this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px'
this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
// 表格总计与分页颜色,取标题颜色
diff --git a/core/frontend/src/views/chart/components/componentStyle/TitleSelector.vue b/core/frontend/src/views/chart/components/componentStyle/TitleSelector.vue
index d5691cc72e..0d52ad248e 100644
--- a/core/frontend/src/views/chart/components/componentStyle/TitleSelector.vue
+++ b/core/frontend/src/views/chart/components/componentStyle/TitleSelector.vue
@@ -50,6 +50,20 @@
:value="option.value"
/>
+
+
+
+
+
+
+
+