我用roImageCanvas創建了一個頁面,我試圖改變它的默認字體與另一個one.bellow是我的代碼,但這不會工作。請幫我解決這個錯誤。謝謝提前。在Roku中更改默認字體roFontRegistry
canvas = CreateObject("roImageCanvas")
port = CreateObject("roMessagePort")
canvas.SetMessagePort(port)
items = []
FontInterface=CreateObject("roFontRegistry") 'create global font access
Fontinterface.Register("pkg:/source/Univers.ttf")
Font=FontInterface.GetFont("Univers",36,false,false)
FontSmall=FontInterface.GetFont("Univers",15,false,false)
items.Push({
Text: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s"
TextAttrs:{ font: Font, color: "#a0a0a0"}
TargetRect: {x: 200, y: 75, w: 300, h: 500}
})
items.Push({
Text: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s"
TextAttrs:{ font: FontSmall, color: "#a0a0a0"}
TargetRect: {x: 600, y: 75, w: 300, h: 500}
})
canvas.SetLayer(0, { Color: "#00ff00", CompositionMode: "Source" })
canvas.SetLayer(1, items)
canvas.Show()