![](/img/trans.png)
[英]How to apply expo react-native custom font to the entire container
[英]How to apply custom font in fabric text object?
我想在結構文本對象中使用自定義字體,我按照以下鏈接: http : //fabricjs.com/fabric-intro-part-4/
但它似乎只在node.js中受支持。
有沒有辦法在畫布上的簡單布料文本對象上支持它?
使用CSS:
@font-face
{
font-family: myFirstFont;
src: url('Sansation_Light.ttf'),
url('Sansation_Light.eot'); /* IE9 */
}
創建結構文本對象實例:
var object = new fabric.Text("NEW TEXT", {
fontFamily: "myFirstFont",
left: 150,
top: 100,
fontSize: 24,
textAlign: "left",
fill: "#000000"
});
canvas.add(object);
canvas.renderAll();
通過使用Simple Css屬性Font @Face
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.