设置系统字体(TTF FontName)

cc.Class({
extends: cc.Component,

properties: {
    fontName:{
        default:"PingFang SC",
        type:cc.String
    }
},

// use this for initialization
onLoad: function () {
    var label = this.node.getComponent(cc.Label);
    if(label){
        label._sgNode.setSystemFontName(this.fontName);
    }
    this.enabled = false;
},

});

顶,不过如果设置的字体在本地没有呢?,会不会出现错误呢?

确实啊 应该加个判断

对,加个判断就更好了:watermelon: