canvas字体样式


<canvas style="border: aqua solid 1px;" id='canvas' width='500' height='500'></canvas>
<script>
    var canvas = document.getElementById('canvas');
    context = canvas.getContext('2d');

    context.font = '38pt Arial'; //字体样式
    context.fillStyle = 'red'; //填充线样式
    context.strokeStyle='blue'; //轮廓线样式

    context.fillText("hellocav",100,100); //填充线
    context.strokeText("hellocav",100,100); //轮廓线
</script>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM