Font Size Bug?

This is a new one. In the simulator, for the Edge 1030 at least, drawing to a single data field generates a different font size than when rendered in more than one data field. My "value" content is drawn with Font = 3. I don't adjust that in the code based on field size. I know that a particular font may render differently on different devices. That is fine. But I've never seen the size change on the same device, depending on the # fields displayed. Maybe a new feature? Or more likely a bug.

Ignore the other issue of the screen not clearing in all but the last field when displaying more than one field.

[IMG2=JSON]{"data-align":"none","data-size":"full","src":"https:\/\/i.postimg.cc\/pd18MF9G\/screens.jpg"}[/IMG2]
  • If I understand correctly, you're saying that you are rendering text using the same font and the font size is changing based on which data field layout is being used.. i.e. the text 315 [163] in the image on the left is drawn with the same font as 316 [164] is in the bottom of the image on the right. Clearly the displayed text is a different size.

    Are you absolutely certain that the font size is the same? It looks to me that the blue text is using the same font, but the black text is not. I have tried to reproduce this, but have been unsuccessful using both the 3.0.8 and 3.0.9 SDKs using various font sizes.

    Here is a paste of the code I used to test

    using Toybox.WatchUi;
    using Toybox.Graphics;
    using Toybox.Lang;
    using Toybox.System;
    using Toybox.Time;

    class DataFieldSizeView extends WatchUi.DataField {

    function initialize() {
    DataField.initialize();
    }

    const colors = [
    Graphics.COLOR_RED,
    Graphics.COLOR_ORANGE,
    Graphics.COLOR_YELLOW,
    Graphics.COLOR_GREEN,
    Graphics.COLOR_BLUE,
    Graphics.COLOR_PURPLE,
    Graphics.COLOR_PINK,
    ];

    function onUpdate(dc) {
    dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_BLACK);
    dc.clear();

    var width = dc.getWidth();
    var height = dc.getHeight();

    var cx = width / 2;
    var cy = height / 2;

    var dims = [ width, height ];
    dc.drawText(cx, cy, Graphics.FONT_SMALL, Lang.format("$1$ $2$", dims), Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER);

    var color = colors[ Math.rand() % colors.size() ];
    dc.setColor(color, color);

    dc.drawRectangle(0, 0, width, height);
    }

    }