For my widget I want to write text in the same line. Important text, such as numbers should be written bigger.
Before I used a textarea and the text had same size.
Now I use drawtext() but the smaller text I cannot align on the bottom together with the bigger text.
Should I use getTextDimensions() and add spacing?
function drawText(dc) { var spacing = 2; var weekNumberWidth = dc.getTextWidthInPixels(_currentWoP.get(:week).toString(), Graphics.FONT_SYSTEM_MEDIUM); var textWopWidth = dc.getTextWidthInPixels(WatchUi.loadResource(Rez.Strings.wop), Graphics.FONT_SYSTEM_TINY); var exactWeekWidth = dc.getTextWidthInPixels(" ("+ (_currentWoP.get(:exactWeek)+"W + "), Graphics.FONT_SYSTEM_MEDIUM); var exactDayWidth = dc.getTextWidthInPixels(_currentWoP.get(:dayInWeek) +")",Graphics.FONT_SMALL); var label1X = (dc.getWidth() - (weekNumberWidth + spacing + textWopWidth + spacing + exactWeekWidth + spacing + exactDayWidth)) / 2; var label2X = label1X + weekNumberWidth + spacing; var label3X = label2X + textWopWidth + spacing; System.println("DrawText"); dc.setColor(Graphics.COLOR_BLACK, Graphics.COLOR_WHITE); dc.drawText(label1X, dc.getHeight()/2, Graphics.FONT_SYSTEM_MEDIUM, _currentWoP.get(:week), Graphics.TEXT_JUSTIFY_LEFT | Graphics.TEXT_JUSTIFY_VCENTER); dc.drawText(label2X, dc.getHeight()/2,Graphics.FONT_SYSTEM_TINY, WatchUi.loadResource(Rez.Strings.wop), Graphics.TEXT_JUSTIFY_LEFT ); dc.drawText(label3X, dc.getHeight()/2,Graphics.FONT_SYSTEM_MEDIUM, "("+ (_currentWoP.get(:exactWeek)+"W + "), Graphics.TEXT_JUSTIFY_LEFT| Graphics.TEXT_JUSTIFY_VCENTER);