title: Getting the Size from Size.Width property
body: <p>I have a form where a user inputs text and that text is to be printed on a label of varying sizes (depending on what label the user picks). Each label has been measured and its width is declared in points. I then calculate the size of the inputted text via:</p>
  <pre><code>int labelWidth; 
  Font defaultFont = new Font(&quot;Arial&quot;, fontSizeDefault, FontStyle.Regular); 
  Size textSize = TextRenderer.MeasureText(inputtedText, defaultFOnt);
  int width = textSize.Width;
  Size newSize = scaleText(textSize, width, labelWidth);
  </code></pre>
  <p>With this I have how wide the text is and how long the label is depending on what's selected. I then pass the <code>size</code>, <code>width</code>, and <code>labelWidth</code> into a method that should return a new size to use that ensures the text will fit the label:</p>
  <pre><code>// I know I'll want to return a Size Struct to use to print the label
  private Size scaleText(Size size, int width, int labelWidth) {
      if (width&lt; labelWidth) {
          return size; // an easy return if it doesn't need scaling
      } else {
          while (width &gt;= labelWidth) {
              width--;
          }
          // pseudo code to get the new size based on a width &lt; labelWidth
      }
  }
  
  // returned Size would then be used in a ZPL-string to print the label 
  </code></pre>
  <p>Hopefully that explains my thinking with this, and so where I'm stuck is turning that width that was ever decreasing to fit the labelWidth back into a Size structure to be returned and used with the <code>^A</code> command in ZPL. Is this possible or should I start from scratch with another way? Thank you ahead of time!</p>