Canvas:Text: Difference between revisions

Line 45: Line 45:
* gerv: I think we should sidestep the complexity problem by implementing drawElement(), to match drawWindow(). This way we can leverage all of the text styling and handling capabilities of Gecko (left-to-right, kerning, line breaking, CSS text properties etc. etc.), encourage people to provide fallback accessible content (because the divs they are filling with text and using for drawElement() can be inside the canvas tag). It's easy enough to use, as well, and far less heavyweight than doing the same thing using drawWindow(). And I doubt you can have a transparent background on a window, anyway. You can also get the metrics you need to fit the text to wherever you want to put it, just be reading the width and height of the div. And it leverages existing code in drawWindow().
* gerv: I think we should sidestep the complexity problem by implementing drawElement(), to match drawWindow(). This way we can leverage all of the text styling and handling capabilities of Gecko (left-to-right, kerning, line breaking, CSS text properties etc. etc.), encourage people to provide fallback accessible content (because the divs they are filling with text and using for drawElement() can be inside the canvas tag). It's easy enough to use, as well, and far less heavyweight than doing the same thing using drawWindow(). And I doubt you can have a transparent background on a window, anyway. You can also get the metrics you need to fit the text to wherever you want to put it, just be reading the width and height of the div. And it leverages existing code in drawWindow().


** shaustein: I do not think drawElement alone would be sufficient. Applications for drawString() will be labels on maps, in games, graphs, diagrams. There you need to measure the actual size of the text box. For a more detailed list of arguments, see [http://rhino-canvas.sourceforge.net/www/drawstring.htm http://rhino-canvas.sourceforge.net/www/drawstring.htm].
** shaustein: I do not think drawElement alone would be sufficient. Applications for drawString() will be labels on maps, in games, graphs, diagrams. There you need to measure the actual size of the text box. For a more detailed list of arguments, see [http://rhino-canvas.sourceforge.net/www/drawstring.html http://rhino-canvas.sourceforge.net/www/drawstring.html].
3

edits