code: private void resizeValueText() {
          double maxWidth = 0.5 * size;
          double fontSize = 0.20625 * size;
          valueText.setFont(Fonts.robotoBold(fontSize));
          if (valueText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(valueText, maxWidth, fontSize); }
          valueText.relocate((size - valueText.getLayoutBounds().getWidth()) * 0.5, (size - valueText.getLayoutBounds().getHeight()) * (unitText.getText().isEmpty() ? 0.5 : 0.42));
      }
docs: ******************** Resizing ******************************************