Text Size

import io.data2viz.color.* import io.data2viz.geom.* import io.data2viz.math.* import io.data2viz.viz.* const val baseLine = 100.0 const val fontS = 80.0 fun main() { viz { size = size(600, 600) //<- you need a viz size // but change everything from here val gradient = Colors.Gradient.linear(point(0, 0), point(600, 0)) .withColor(Colors.Web.hotpink) .andColor(Colors.Web.blueviolet) text { x = 10.0 y = baseLine textContent = """Sketch \ryour Viz!""" textColor = gradient fontSize = fontS } path { moveTo(0.0, baseLine) lineTo(600.0, baseLine) stroke = Colors.Web.red } path { moveTo(0.0, baseLine- fontS) lineTo(600.0, baseLine - fontS) stroke = Colors.Web.red } // to here }.bindRendererOnNewCanvas() }
gaetan avatar

Sketch created by

gaetan