tpframe2020
tpframe2020
  • 发布:2020-10-20 20:09
  • 更新:2022-10-23 14:43
  • 阅读:1115

【报Bug】nvue 下 gcanvas 组件 filltext汉字不显示

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: w10

HBuilderX类型: 正式

HBuilderX版本号: 2.7.14

手机系统: Android

手机系统版本号: Android 11

手机厂商: 小米

手机机型: mi8

页面类型: nvue

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

handleFillText() {
var ctx = this.context;
ctx.setFontSize(20)
ctx.fillText('Hello测试abc', 20, 20)
ctx.fillText('DCloud', 100, 100)
ctx.draw(true)
}

操作步骤:

ctx.fillText('Hello测试abc', 20, 20)

预期结果:

想显示中文

实际结果:

不能显示中文

bug描述:

官方git地址下的插件:https://github.com/dcloudio/NvueCanvasDemo

其中canvas.nuve里面的绘图代码,其中

handleFillText() {  
                var ctx = this.context;  
                ctx.setFontSize(20)  
                ctx.fillText('Hello测试', 20, 20)   //原来是:ctx.fillText('Hello', 20, 20)  
                ctx.fillText('DCloud', 100, 100)  
                ctx.draw(true)  
            },

结果中文显示不了,英文可以

2020-10-20 20:09 负责人:DCloud_Android_zl 分享
已邀请:
1***@qq.com

1***@qq.com - hahaha

人呢,都哪去了

惊鸿照影来

惊鸿照影来 - 惊鸿照影来

相同BUG。
var ctx = this.context;
ctx.setFontSize(18);
ctx.setFillStyle("#000000");
ctx.fillText('11111', 20, 20);
ctx.fillText('汉字', 20, 40);
ctx.fillText('ADC', 20, 60);
ctx.draw();

其中数字,英文可以正常显示,中文不显示。

3***@qq.com

3***@qq.com

请问解决了吗?

要回复问题请先登录注册