HTML canvas font Property
ဥပမာ
"Arial" ဖောင့်ကို အသုံးပြု၍ ကင်းဗတ်ပေါ်တွင် 30px မြင့်သောစာသားကို ရေးပါ-
JavaScript-
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.font = "30px Arial";
ctx.fillText("Hello World", 10, 50);
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် ပိုင်ဆိုင်မှုကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
Property | |||||
---|---|---|---|---|---|
font | Yes | 9.0 | Yes | Yes | Yes |
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ဖောင့်ပိုင်ဆိုင်မှုသည် ကင်းဗတ်ပေါ်ရှိ စာသားအကြောင်းအရာအတွက် လက်ရှိဖောင့်ဂုဏ်သတ္တိများကို သတ်မှတ်ပေးသည် သို့မဟုတ် ပြန်ပေးသည်။
ဖောင့်ပိုင်ဆိုင်မှုသည် CSS ဖောင့်ပိုင်ဆိုင်မှု နှင့်တူညီသော syntax ကိုအသုံးပြုသည် ။
မူလတန်ဖိုး: | 10px sans-serif |
---|---|
JavaScript syntax- | context .font="italic small-caps bold 12px arial"; |
အိမ်ခြံမြေတန်ဖိုးများ
Values | Description | Play it |
---|---|---|
font-style | Specifies the font style. Possible values:
|
|
font-variant | Specifies the font variant. Possible values:
|
|
font-weight | Specifies the font weight. Possible values:
|
|
font-size/line-height | Specifies the font size and the line-height, in pixels | |
font-family | Specifies the font family | |
caption | Use the font captioned controls (like buttons, drop-downs, etc.) | |
icon | Use the font used to label icons | |
menu | Use the font used in menus (drop-down menus and menu lists) | |
message-box | Use the font used in dialog boxes | |
small-caption | Use the font used for labeling small controls | |
status-bar | Use the fonts used in window status bar |
❮ HTML Canvas အကိုးအကား