Last active
August 29, 2015 14:20
-
-
Save eseidelGoogle/b8c42258423b81c2af2b to your computer and use it in GitHub Desktop.
Painting wrapped Text in Sky?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "dart:sky"; | |
var inline = new RenderInline(); | |
// We'll need a better API for looking up fonts. | |
inline.textStyle.fontSize = "Helvetica"; | |
var text = new RenderText("This is a long bit of text which should wrap. "); | |
var text2 = new RenderText("And this bit is bold "); | |
text2.textStyle.weight = 900; | |
inline.add(text); | |
inline.add(text2); | |
var text3 = new RenderText("And this bit has the default font"); | |
var block = new RenderParagraph(); | |
block.add(inline); | |
block.add(text3); | |
block.layout(minWidth: 100, maxWidth: 100); | |
var list = new DisplayList(); | |
block.paint(list); | |
sky.rootDisplayList = list; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm going to start with something even simpler for now:
https://gist.github.com/eseidelGoogle/56973c1495e1d256c827