文字を描く

document.write("はじめの形<BR>");
document.write('改行はBRを<>で囲む<BR>');
document.write('"はじめ"<BR>と<BR>"の"<BR>と<BR>"かたち"<BR>を+で繋ぐと<BR>');
document.write("はじめ"+"の"+"かたち"+"<BR>となる<BR>");
document.write(',で繋ぐと<BR>');
document.write("はじめ","の","かたち","<BR>となる");

java scliptでcanvasに文字を書きます。
//キャンバスの用意
let cav=document.createElement("canvas");
cav.width = 115;cav.height = 20;
let cot=cav.getContext("2d");
document.body.append(cav);

cot.shadowOffsetX = 2;//影のx座標
cot.shadowOffsetY = 2;//影のy座標
cot.shadowBlur = 2;//影をつけます
cot.shadowColor = "rgba(0, 0, 0, 0.5)";//影の色

cot.font = "20px Times New Roman";//文字の大きさとフォント
cot.fillStyle = "Black";//文字の色
cot.fillText("Sample String", 0, 20);/文字列,座,標
cot.textAlign="center";//文字列の横中央を座標に合わせます
cot.textBaseline="middle";//文字列の上下中央を座標に合わせます