#endregion
- #region Properties
-
- float WrapWidth {
- get { return (_format.IsVertical ? Height : Width) - (Margin * 2); }
+ #region Properties\r
+\r
+ float WrapWidth\r
+ {\r
+ get {\r
+ float widthOrHeight = _format.IsVertical ? Height : Width;\r
+ if (!_format.IsGenericTypographic) {\r
+ widthOrHeight =\r
+ ((_format.IsVertical ? Height : Width) - (0.463f * FontSize)) / 1.028f;\r
+ }\r
+ return widthOrHeight;\r
+ }\r
}
- internal float WrapHeight {
- get { return (_format.IsVertical ? Width : Height); }
+ internal float WrapHeight {\r
+ get {\r
+ float widthOrHeight = _format.IsVertical ? Width : Height;\r
+ if (!_format.IsGenericTypographic) {\r
+ widthOrHeight = (_format.IsVertical ? Width : Height) / 1.08864f;\r
+ }\r
+ return widthOrHeight;
+ }
}
internal float Width {
internal StringFormat Format {
get { return _format; }
- }
-
- internal float Margin {
- get { return _margin; }
+ }\r
+\r
+ internal float PadWidth (float origWidth)\r
+ {\r
+ if (Format.IsGenericTypographic)\r
+ return origWidth;\r
+\r
+ //This is a proximity to .NET calculated Width.\r
+ return origWidth * 1.028f + 0.463f * FontSize;\r
+ }\r
+\r
+ internal float PadHeight (float origHeight)\r
+ {\r
+ if (Format.IsGenericTypographic)\r
+ return origHeight;\r
+\r
+ //This is a proximity to .NET calculated Height.\r
+ return 1.08864f * origHeight;\r
+ } \r
+\r
+ internal float FontSize\r
+ {\r
+ get {\r
+ return _font.Size;\r
+ }\r
}
internal int CharsConsumed {
LineLayout lineLayout = new LineLayout(
layout,
this,
- _accumulatedHeight);
-
- float lineHeight = lineLayout.Ascent + lineLayout.Descent;
+ _accumulatedHeight);\r
+\r
+ float lineHeight = PadHeight (lineLayout.Ascent + lineLayout.Descent + lineLayout.Leading);
if (Format.LineLimit && (_accumulatedHeight + lineHeight > WrapHeight)) {
_charsConsumed += _currentPos;