Beispiel #1
0
        /// <summary>
        /// Calculate volume of an adjusted glyph.
        /// </summary>
        /// <param name="adjustedGlyph">The glyph to calculate the volume from.</param>
        /// <returns>The calculated volume.</returns>
        private int CalculateVolume(AdjustedGlyph adjustedGlyph)
        {
            if (adjustedGlyph.WhiteSpaceAdjustment == null)
            {
                return((adjustedGlyph.Glyph.Width + _margin) * (adjustedGlyph.Glyph.Height + _margin));
            }

            return((adjustedGlyph.WhiteSpaceAdjustment.GlyphSize.Width + _margin) *
                   (adjustedGlyph.WhiteSpaceAdjustment.GlyphSize.Height + _margin));
        }
Beispiel #2
0
        private Size GetGlyphSize(AdjustedGlyph adjustedGlyph)
        {
            if (adjustedGlyph.WhiteSpaceAdjustment != null)
            {
                return(new Size(adjustedGlyph.WhiteSpaceAdjustment.GlyphSize.Width + _margin,
                                adjustedGlyph.WhiteSpaceAdjustment.GlyphSize.Height + _margin));
            }

            return(new Size(adjustedGlyph.Glyph.Width + _margin,
                            adjustedGlyph.Glyph.Height + _margin));
        }
Beispiel #3
0
 /// <summary>
 /// Calculate volume of an adjusted glyph.
 /// </summary>
 /// <param name="adjustedGlyph">The glyph to calculate the volume from.</param>
 /// <returns>The calculated volume.</returns>
 private int CalculateVolume(AdjustedGlyph adjustedGlyph)
 {
     if (adjustedGlyph.WhiteSpaceAdjustment == null)
     {
         return(adjustedGlyph.Glyph.Width * adjustedGlyph.Glyph.Height);
     }
     else
     {
         return(adjustedGlyph.WhiteSpaceAdjustment.GlyphSize.Width *
                adjustedGlyph.WhiteSpaceAdjustment.GlyphSize.Height);
     }
 }