Skip to content

Commit f9cc74f

Browse files
supergaojianxxyan0205
authored andcommitted
fix(ruler,water-mark): change canvas font family (didi#408)
* fix(ruler,water-mark): change canvas font family * example(ruler): change ruler demo doc * feat(ruler,water-mark): change canvas font-family
1 parent 58352d6 commit f9cc74f

5 files changed

Lines changed: 17 additions & 4 deletions

File tree

components/ruler/demo/cases/demo0.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@
1515
<script>import {Ruler} from 'mand-mobile'
1616
1717
export default {
18-
name: 'ruler-demo',
18+
name: 'ruler-demo-0',
19+
/* DELETE */
1920
title: '基本',
21+
titleEnUS: 'Basic',
22+
message: '请在移动设备中扫码预览',
23+
messageEnUS: 'Please scan QR code and preview on mobile device',
24+
/* DELETE */
2025
components: {
2126
[Ruler.name]: Ruler,
2227
},

components/ruler/demo/cases/demo1.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@
1717
<script>import {Ruler} from 'mand-mobile'
1818
1919
export default {
20-
name: 'ruler-demo',
20+
name: 'ruler-demo-1',
21+
/* DELETE */
2122
title: '最大1800,最小1200',
23+
titleEnUS: 'Max 1800, Min 1200',
24+
message: '请在移动设备中扫码预览',
25+
messageEnUS: 'Please scan QR code and preview on mobile device',
26+
/* DELETE */
2227
components: {
2328
[Ruler.name]: Ruler,
2429
},

components/ruler/demo/cases/demo2.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export default {
2323
titleEnUS: 'trigger <a href="javascript:window.triggerRuler2()">Change to 1500</a>',
2424
describe: '只在滚动停止时有效',
2525
describeEnUS: 'only valid when scroll is stopped',
26+
message: '请在移动设备中扫码预览',
27+
messageEnUS: 'Please scan QR code and preview on mobile device',
2628
/* DELETE */
2729
components: {
2830
[Ruler.name]: Ruler,

components/ruler/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ export default {
215215
const _stepUnit = Math.round(step / unit)
216216
217217
ctx.lineWidth = 2
218-
ctx.font = `${_fontSize * ratio}px DINPro-Medium`
218+
ctx.font = `${_fontSize *
219+
ratio}px DIN Alternate, "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif`
219220
220221
for (let i = 0; i <= unitCount; i++) {
221222
const _x = x + i * blank

components/water-mark/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export default {
143143
const xCount = Math.ceil(ctxWidth * ratio / (contentLength + realSpacing))
144144
const yCount = Math.ceil(ctxHeight * ratio / (_fontSize + realSpacing))
145145
146-
ctx.font = `${_fontSize}px DINPro-Medium`
146+
ctx.font = `${_fontSize}px DIN Alternate, "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif`
147147
ctx.fillStyle = color
148148
149149
let ctxX = 0

0 commit comments

Comments
 (0)