Skip to content

Instantly share code, notes, and snippets.

@eseidelGoogle
Last active August 29, 2015 14:20
Show Gist options
  • Save eseidelGoogle/b8c42258423b81c2af2b to your computer and use it in GitHub Desktop.
Save eseidelGoogle/b8c42258423b81c2af2b to your computer and use it in GitHub Desktop.
Painting wrapped Text in Sky?
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;
@eseidelGoogle
Copy link
Author

I'm going to start with something even simpler for now:
https://gist.github.com/eseidelGoogle/56973c1495e1d256c827

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment