Exemple #1
0
        /// <summary>
        /// Computes the size of a text span.
        /// </summary>
        /// <remarks>
        /// The span is first asked to measure itself, then the current style is
        /// allowed to override the size.
        /// </remarks>
        /// <param name="span"></param>
        /// <param name="text"></param>
        /// <param name="font"></param>
        /// <param name="g"></param>
        /// <returns></returns>
        private SizeF GetSize(TextSpan span, string text, Font font, Graphics g)
        {
            var size  = span.GetSize(text, font, g);
            int?width = styleStack.GetWidth();

            if (width.HasValue)
            {
                size.Width = width.Value;
            }
            return(size);
        }
Exemple #2
0
        /// <summary>
        /// Computes the size of a text span.
        /// </summary>
        /// <remarks>
        /// The span is first asked to measure itself, then the current style is
        /// allowed to override the size.
        /// </remarks>
        /// <param name="span"></param>
        /// <param name="text"></param>
        /// <param name="font"></param>
        /// <param name="g"></param>
        /// <returns></returns>
        private SizeF GetSize(TextSpan span, string text, Font font, Graphics g)
        {
            var     size  = span.GetSize(text, font, g);
            UiStyle style = GetStyle(span.Style);

            if (style != null && style.Width.HasValue)
            {
                size.Width = style.Width.Value;
            }
            return(size);
        }
Exemple #3
0
 /// <summary>
 /// Computes the size of a text span.
 /// </summary>
 /// <remarks>
 /// The span is first asked to measure itself, then the current style is 
 /// allowed to override the size.
 /// </remarks>
 /// <param name="span"></param>
 /// <param name="text"></param>
 /// <param name="font"></param>
 /// <param name="g"></param>
 /// <returns></returns>
 private SizeF GetSize(TextSpan span, string text, Font font, Graphics g)
 {
     var size = span.GetSize(text, font, g);
     int? width = styleStack.GetWidth(this);
     if (width.HasValue)
     {
         size.Width = width.Value;
     }
     return size;
 }
Exemple #4
0
 /// <summary>
 /// Computes the size of a text span.
 /// </summary>
 /// <remarks>
 /// The span is first asked to measure itself, then the current style is 
 /// allowed to override the size.
 /// </remarks>
 /// <param name="span"></param>
 /// <param name="text"></param>
 /// <param name="font"></param>
 /// <param name="g"></param>
 /// <returns></returns>
 private SizeF GetSize(TextSpan span, string text, Font font, Graphics g)
 {
     var size = span.GetSize(text, font, g);
     UiStyle style = GetStyle(span.Style);
     if (style != null && style.Width.HasValue)
     {
         size.Width = style.Width.Value;
     }
     return size;
 }