uni-app使用ttf字体在android中不生效问题解决办法

百度上有说是因为后缀名为 .ttf的字体的format()不是ttf,而是 truetype,改成如下就行了
@font-face {
    font-family: 'myFont';
    src: url('./my-font.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}
试了还是没有生效,无奈之下想到一个办法,那就是用0-9和.的图片代替,数字图片特殊处理下保证可以改变颜色(其实就是让UI设计师将字体设置成透明色)
num..png
num0.png
num1.png
num2.png
num3.png
num4.png
num5.png
num6.png
num7.png
num8.png
num9.png

你可能感兴趣的:(uni-app使用ttf字体在android中不生效问题解决办法)