Browse Source

Documentation: Text Style

Marcin Ziąbek 2 years ago
parent
commit
61bc24874c

+ 63 - 17
Source/QuestPDF/Fluent/TextSpanDescriptorExtensions.cs

@@ -1,12 +1,13 @@
 using System;
-using System.Runtime.CompilerServices;
 using QuestPDF.Helpers;
+using QuestPDF.Drawing;
 using QuestPDF.Infrastructure;
 
 namespace QuestPDF.Fluent
 {
     public static class TextSpanDescriptorExtensions
     {
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.style"]/*' />
         public static T Style<T>(this T descriptor, TextStyle style) where T : TextSpanDescriptor
         {
             if (style == null)
@@ -16,78 +17,96 @@ namespace QuestPDF.Fluent
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.fontFallback"]/*' />
         public static T Fallback<T>(this T descriptor, TextStyle? value = null) where T : TextSpanDescriptor
         {
             descriptor.TextStyle.Fallback = value;
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.fontFallback"]/*' />
         public static T Fallback<T>(this T descriptor, Func<TextStyle, TextStyle> handler) where T : TextSpanDescriptor
         {
             return descriptor.Fallback(handler(TextStyle.Default));
         }
         
-        public static T FontColor<T>(this T descriptor, string value) where T : TextSpanDescriptor
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.fontColor"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="colorParam"]/*' />
+        public static T FontColor<T>(this T descriptor, string color) where T : TextSpanDescriptor
         {
-            ColorValidator.Validate(value);
-            descriptor.MutateTextStyle(x => x.FontColor(value));
+            ColorValidator.Validate(color);
+            descriptor.MutateTextStyle(x => x.FontColor(color));
             return descriptor;
         }
         
-        public static T BackgroundColor<T>(this T descriptor, string value) where T : TextSpanDescriptor
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.backgroundColor"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="colorParam"]/*' />
+        public static T BackgroundColor<T>(this T descriptor, string color) where T : TextSpanDescriptor
         {
-            ColorValidator.Validate(value);
-            descriptor.MutateTextStyle(x => x.BackgroundColor(value));
+            ColorValidator.Validate(color);
+            descriptor.MutateTextStyle(x => x.BackgroundColor(color));
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.fontFamily"]/*' />
         public static T FontFamily<T>(this T descriptor, string value) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.FontFamily(value));
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.fontSize"]/*' />
         public static T FontSize<T>(this T descriptor, float value) where T : TextSpanDescriptor
         {
+            if (value <= 0)
+                throw new ArgumentException("Font size must be greater than 0.");
+            
             descriptor.MutateTextStyle(x => x.FontSize(value));
             return descriptor;
         }
         
-        public static T LineHeight<T>(this T descriptor, float value) where T : TextSpanDescriptor
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.lineHeight"]/*' />
+        public static T LineHeight<T>(this T descriptor, float factor) where T : TextSpanDescriptor
         {
-            descriptor.MutateTextStyle(x => x.LineHeight(value));
+            if (factor <= 0)
+                throw new ArgumentException("Line height must be greater than 0.");
+            
+            descriptor.MutateTextStyle(x => x.LineHeight(factor));
             return descriptor;
         }
 
-        /// <summary>
-        /// Letter spacing controls space between characters. Value 0 corresponds to normal spacing defined by a font.
-        /// Positive values create additional space, whereas negative values reduce space between characters.
-        /// Added / reduced space is relative to the font size.
-        /// </summary>
-        public static T LetterSpacing<T>(this T descriptor, float value) where T : TextSpanDescriptor
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.letterSpacing"]/*' />
+        public static T LetterSpacing<T>(this T descriptor, float factor) where T : TextSpanDescriptor
         {
-            descriptor.MutateTextStyle(x => x.LetterSpacing(value));
+            if (factor <= 0)
+                throw new ArgumentException("Letter spacing must be greater than 0.");
+            
+            descriptor.MutateTextStyle(x => x.LetterSpacing(factor));
             return descriptor;
         }
-
+        
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.italic"]/*' />
         public static T Italic<T>(this T descriptor, bool value = true) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.Italic(value));
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.strikethrough"]/*' />
         public static T Strikethrough<T>(this T descriptor, bool value = true) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.Strikethrough(value));
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.underline"]/*' />
         public static T Underline<T>(this T descriptor, bool value = true) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.Underline(value));
             return descriptor;
         }
 
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.wrapAnywhere"]/*' />
         public static T WrapAnywhere<T>(this T descriptor, bool value = true) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.WrapAnywhere(value));
@@ -96,60 +115,80 @@ namespace QuestPDF.Fluent
 
         #region Weight
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.thin"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static T Thin<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.Thin());
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.extraLight"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static T ExtraLight<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.ExtraLight());
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.light"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static T Light<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.Light());
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.normal"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static T NormalWeight<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.NormalWeight());
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.medium"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static T Medium<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.Medium());
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.semiBold"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static T SemiBold<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.SemiBold());
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.bold"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static T Bold<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.Bold());
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.extraBold"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static T ExtraBold<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.ExtraBold());
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.black"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static T Black<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.Black());
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.extraBlack"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static T ExtraBlack<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.ExtraBlack());
@@ -159,18 +198,22 @@ namespace QuestPDF.Fluent
         #endregion
 
         #region Position
+        
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.position.normal"]/*' />
         public static T NormalPosition<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.NormalPosition());
             return descriptor;
         }
 
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.position.subscript"]/*' />
         public static T Subscript<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.Subscript());
             return descriptor;
         }
 
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.position.superscript"]/*' />
         public static T Superscript<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.Superscript());
@@ -181,18 +224,21 @@ namespace QuestPDF.Fluent
         
         #region Direction
 
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.direction.auto"]/*' />
         public static T DirectionAuto<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.DirectionAuto());
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.direction.ltr"]/*' />
         public static T DirectionFromLeftToRight<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.DirectionFromLeftToRight());
             return descriptor;
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.direction.rtl"]/*' />
         public static T DirectionFromRightToLeft<T>(this T descriptor) where T : TextSpanDescriptor
         {
             descriptor.MutateTextStyle(x => x.DirectionFromRightToLeft());

+ 60 - 16
Source/QuestPDF/Fluent/TextStyleExtensions.cs

@@ -13,16 +13,20 @@ namespace QuestPDF.Fluent
             return style.FontColor(value);
         }
         
-        public static TextStyle FontColor(this TextStyle style, string value)
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.fontColor"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="colorParam"]/*' />
+        public static TextStyle FontColor(this TextStyle style, string color)
         {
-            ColorValidator.Validate(value);
-            return style.Mutate(TextStyleProperty.Color, value);
+            ColorValidator.Validate(color);
+            return style.Mutate(TextStyleProperty.Color, color);
         }
         
-        public static TextStyle BackgroundColor(this TextStyle style, string value)
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.backgroundColor"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="colorParam"]/*' />
+        public static TextStyle BackgroundColor(this TextStyle style, string color)
         {
-            ColorValidator.Validate(value);
-            return style.Mutate(TextStyleProperty.BackgroundColor, value);
+            ColorValidator.Validate(color);
+            return style.Mutate(TextStyleProperty.BackgroundColor, color);
         }
         
         [Obsolete("This element has been renamed since version 2022.3. Please use the FontFamily method.")]
@@ -31,6 +35,7 @@ namespace QuestPDF.Fluent
             return style.FontFamily(value);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.fontFamily"]/*' />
         public static TextStyle FontFamily(this TextStyle style, string value)
         {
             return style.Mutate(TextStyleProperty.FontFamily, value);
@@ -42,41 +47,52 @@ namespace QuestPDF.Fluent
             return style.FontSize(value);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.fontSize"]/*' />
         public static TextStyle FontSize(this TextStyle style, float value)
         {
+            if (value <= 0)
+                throw new ArgumentException("Font size must be greater than 0.");
+            
             return style.Mutate(TextStyleProperty.Size, value);
         }
         
-        public static TextStyle LineHeight(this TextStyle style, float value)
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.lineHeight"]/*' />
+        public static TextStyle LineHeight(this TextStyle style, float factor = 1)
         {
-            return style.Mutate(TextStyleProperty.LineHeight, value);
+            if (factor <= 0)
+                throw new ArgumentException("Line height must be greater than 0.");
+            
+            return style.Mutate(TextStyleProperty.LineHeight, factor);
         }
 
-        /// <summary>
-        /// Letter spacing controls space between characters. Value 0 corresponds to normal spacing defined by a font.
-        /// Positive values create additional space, whereas negative values reduce space between characters.
-        /// Added / reduced space is relative to the font size.
-        /// </summary>
-        public static TextStyle LetterSpacing(this TextStyle style, float value)
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.letterSpacing"]/*' />
+        public static TextStyle LetterSpacing(this TextStyle style, float factor = 1)
         {
-            return style.Mutate(TextStyleProperty.LetterSpacing, value);
+            if (factor <= 0)
+                throw new ArgumentException("Letter spacing must be greater than 0.");
+            
+            return style.Mutate(TextStyleProperty.LetterSpacing, factor);
         }
 
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.italic"]/*' />
         public static TextStyle Italic(this TextStyle style, bool value = true)
         {
             return style.Mutate(TextStyleProperty.IsItalic, value);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.strikethrough"]/*' />
         public static TextStyle Strikethrough(this TextStyle style, bool value = true)
         {
             return style.Mutate(TextStyleProperty.HasStrikethrough, value);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.underline"]/*' />
         public static TextStyle Underline(this TextStyle style, bool value = true)
         {
             return style.Mutate(TextStyleProperty.HasUnderline, value);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.wrapAnywhere"]/*' />
         public static TextStyle WrapAnywhere(this TextStyle style, bool value = true)
         {
             return style.Mutate(TextStyleProperty.WrapAnywhere, value);
@@ -89,51 +105,71 @@ namespace QuestPDF.Fluent
             return style.Mutate(TextStyleProperty.FontWeight, weight);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.thin"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static TextStyle Thin(this TextStyle style)
         {
             return style.Weight(FontWeight.Thin);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.extraLight"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static TextStyle ExtraLight(this TextStyle style)
         {
             return style.Weight(FontWeight.ExtraLight);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.light"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static TextStyle Light(this TextStyle style)
         {
             return style.Weight(FontWeight.Light);
         }
-        
+       
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.normal"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static TextStyle NormalWeight(this TextStyle style)
         {
             return style.Weight(FontWeight.Normal);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.medium"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static TextStyle Medium(this TextStyle style)
         {
             return style.Weight(FontWeight.Medium);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.semiBold"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static TextStyle SemiBold(this TextStyle style)
         {
             return style.Weight(FontWeight.SemiBold);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.bold"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static TextStyle Bold(this TextStyle style)
         {
             return style.Weight(FontWeight.Bold);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.extraBold"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static TextStyle ExtraBold(this TextStyle style)
         {
             return style.Weight(FontWeight.ExtraBold);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.black"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static TextStyle Black(this TextStyle style)
         {
             return style.Weight(FontWeight.Black);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.extraBlack"]/*' />
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.weight.remarks"]/*' />
         public static TextStyle ExtraBlack(this TextStyle style)
         {
             return style.Weight(FontWeight.ExtraBlack);
@@ -143,16 +179,19 @@ namespace QuestPDF.Fluent
 
         #region Position
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.position.normal"]/*' />
         public static TextStyle NormalPosition(this TextStyle style)
         {
             return style.Position(FontPosition.Normal);
         }
 
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.position.subscript"]/*' />
         public static TextStyle Subscript(this TextStyle style)
         {
             return style.Position(FontPosition.Subscript);
         }
 
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.position.superscript"]/*' />
         public static TextStyle Superscript(this TextStyle style)
         {
             return style.Position(FontPosition.Superscript);
@@ -167,11 +206,13 @@ namespace QuestPDF.Fluent
 
         #region Fallback
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.fontFallback"]/*' />
         public static TextStyle Fallback(this TextStyle style, TextStyle? value = null)
         {
             return style.Mutate(TextStyleProperty.Fallback, value);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.fontFallback"]/*' />
         public static TextStyle Fallback(this TextStyle style, Func<TextStyle, TextStyle> handler)
         {
             return style.Fallback(handler(TextStyle.Default));
@@ -186,16 +227,19 @@ namespace QuestPDF.Fluent
             return style.Mutate(TextStyleProperty.Direction, textDirection);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.direction.auto"]/*' />
         public static TextStyle DirectionAuto(this TextStyle style)
         {
             return style.TextDirection(Infrastructure.TextDirection.Auto);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.direction.ltr"]/*' />
         public static TextStyle DirectionFromLeftToRight(this TextStyle style)
         {
             return style.TextDirection(Infrastructure.TextDirection.LeftToRight);
         }
         
+        /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.direction.rtl"]/*' />
         public static TextStyle DirectionFromRightToLeft(this TextStyle style)
         {
             return style.TextDirection(Infrastructure.TextDirection.RightToLeft);

+ 254 - 0
Source/QuestPDF/Resources/Documentation.xml

@@ -95,4 +95,258 @@
             </para>
         </remarks>
     </doc>
+    
+    <!-- TEXT ATTRIBUTES -->
+
+    <doc for="text.fontColor">
+        <summary>
+            Sets the font color.
+        </summary>
+    </doc>
+
+    <doc for="text.backgroundColor">
+        <summary>
+            Sets a solid background color for the text.
+        </summary>
+    </doc>
+    
+    <doc for="text.fontFamily">
+        <summary>
+            Sets the text's font family.
+        </summary>
+
+        <remarks>
+            By default, the library searches for the target font through all available in the runtime environment.
+            This usually works in the development environment, but might not in the cloud where many fonts are not installed.
+            It is a safe practice to include all font files with your application and register them using the <see cref="Drawing.FontManager">FontManager</see> class.
+        </remarks>
+
+        <param name="value">The font family name (like "Times New Roman" or "Calibri") or a custom name from the <see cref="Drawing.FontManager.RegisterFontWithCustomName">FontManager</see> method.</param>
+        
+        <summary>
+            <para>Sets the font family of the text.</para>
+        </summary>
+        
+        <remarks>
+            <para>By default, the library searches all fonts available in the runtime environment.</para>
+            <para>This may work well on the development environment but may fail in the cloud where fonts are usually not installed.</para>
+            <para>It is safest deploy font files along with the application and then register them using the <see cref="Drawing.FontManager">FontManager</see> class.</para>
+        </remarks>
+        
+        <param name="value">Actual font family (e.g. "Times New Roman", "Calibri", "Lato") or custom identifier used when invoking the <see cref="Drawing.FontManager.RegisterFontWithCustomName">FontManager</see> method.</param>
+    </doc>
+    
+    <doc for="text.fontSize">
+        <summary>
+            Sets font size for the text.
+        </summary>
+
+        <remarks>
+            The visual size of the text is determined by its font size. 
+            However, it's worth noting that different fonts may render text with distinct visual sizes, even when assigned the same numerical font size.
+        </remarks>
+    </doc>
+
+    <doc for="text.wrapAnywhere">
+        <summary>
+            Allows text to wrap at any character, not just spaces.
+        </summary>
+    </doc>
+    
+    <doc for="text.lineHeight">
+        <summary>
+            Adjusts the vertical spacing between text lines.
+            The added space is proportional to the text size. 
+            A <paramref name="factor"/> value of 1 retains the original spacing.
+            <a href="https://www.questpdf.com/api-reference/text.html#line-height">Learn more</a>
+        </summary>
+
+        <param name="factor">
+            <para>Sets the proportion of vertical spacing relative to the original.</para> 
+            <para>A value greater than 1 increases spacing, while a value less than 1 reduces it. Must be greater than 0.</para>
+        </param>
+    </doc>
+
+    <doc for="text.letterSpacing">
+        <summary>
+            Adjusts the horizontal spacing between characters in the text.
+            The adjustment is proportional to the text size, where a <paramref name="factor"/> value of 1 maintains the original spacing.
+            <a href="https://www.questpdf.com/api-reference/text.html#letter-spacing">Learn more</a>
+        </summary>
+
+        <param name="factor">
+            <para>Sets the proportion by which the horizontal space between characters is changed.</para>
+            <para>A factor greater than 1 spreads characters further apart, while a factor less than 1 (but more than 0) brings them closer together.</para> 
+            <para>Must be greater than 0.</para>
+        </param>
+    </doc>
+    
+    <!-- TEXT EFFECTS -->
+
+    <doc for="text.italic">
+        <summary>
+            Draws text with a italic effect, where letters are slightly slanted to the right.
+        </summary>
+    </doc>
+
+    <doc for="text.strikethrough">
+        <summary>
+            Draws a simple solid line through the middle of the text.
+        </summary>
+    </doc>
+
+    <doc for="text.underline">
+        <summary>
+            Draws a simple solid line under the text.
+        </summary>
+    </doc>
+    
+    <!-- TEXT WEIGHT -->
+    
+    <doc for="text.weight.thin">
+        <summary>
+            Sets the font weight to "thin" (equivalent to CSS 100).
+            <a href="https://www.questpdf.com/api-reference/text.html#font-weight">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.weight.extraLight">
+        <summary>
+            Sets the font weight to "extra light" (equivalent to CSS 200).
+            <a href="https://www.questpdf.com/api-reference/text.html#font-weight">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.weight.light">
+        <summary>
+            Sets the font weight to "light" (equivalent to CSS 300).
+            <a href="https://www.questpdf.com/api-reference/text.html#font-weight">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.weight.normal">
+        <summary>
+            Sets the font weight to "normal" or "regular (equivalent to CSS 400).
+            <a href="https://www.questpdf.com/api-reference/text.html#font-weight">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.weight.medium">
+        <summary>
+            Sets the font weight to "medium" (equivalent to CSS 500).
+            <a href="https://www.questpdf.com/api-reference/text.html#font-weight">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.weight.semiBold">
+        <summary>
+            Sets the font weight to "semi bold" (equivalent to CSS 600).
+            <a href="https://www.questpdf.com/api-reference/text.html#font-weight">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.weight.bold">
+        <summary>
+            Sets the font weight to "bold" (equivalent to CSS 700).
+            <a href="https://www.questpdf.com/api-reference/text.html#font-weight">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.weight.extraBold">
+        <summary>
+            Sets the font weight to "extra bold" (equivalent to CSS 800).
+            <a href="https://www.questpdf.com/api-reference/text.html#font-weight">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.weight.black">
+        <summary>
+            Sets the font weight to "black" (equivalent to CSS 900).
+            <a href="https://www.questpdf.com/api-reference/text.html#font-weight">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.weight.extraBlack">
+        <summary>
+            Sets the font weight to "extra black" (equivalent to CSS 1000).
+            <a href="https://www.questpdf.com/api-reference/text.html#font-weight">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.weight.remarks">
+        <remarks>
+            Not all fonts support every weight. 
+            If the specified weight isn't available, the library selects the closest available option.
+        </remarks>
+    </doc>
+    
+    <!-- TEXT POSITION -->
+    
+    <doc for="text.position.normal">
+        <summary>
+            Resets the text position and size to default, utilizing the full available line height.
+            <a href="https://www.questpdf.com/api-reference/text.html#subscript-and-superscript">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.position.subscript">
+        <summary>
+            Sets the text style to subscript, making it smaller and positioning it below the baseline.
+            <a href="https://www.questpdf.com/api-reference/text.html#subscript-and-superscript">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.position.superscript">
+        <summary>
+            Sets the text style to subscript, making it smaller and positioning it above the baseline.
+            <a href="https://www.questpdf.com/api-reference/text.html#subscript-and-superscript">Learn more</a>
+        </summary>
+    </doc>
+    
+    <!-- TEXT DIRECTION -->
+
+    <doc for="text.direction.auto">
+        <summary>
+            Resets the text direction, enabling content to follow the automatically detected direction.
+            <a href="https://www.questpdf.com/api-reference/text.html#forcing-text-direction-rtl">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.direction.ltr">
+        <summary>
+            Enforces a left-to-right text direction.
+            <a href="https://www.questpdf.com/api-reference/text.html#forcing-text-direction-rtl">Learn more</a>
+        </summary>
+    </doc>
+
+    <doc for="text.direction.rtl">
+        <summary>
+            Enforces a right-to-left text direction.
+            <a href="https://www.questpdf.com/api-reference/text.html#forcing-text-direction-rtl">Learn more</a>
+        </summary>
+    </doc>
+    
+    <!-- TEXT OTHERS -->
+    <doc for="text.style">
+        <summary>
+            Sets a font style using the typography pattern.
+            <a href="https://www.questpdf.com/api-reference/text.html#typography-pattern">Learn more</a>
+        </summary>
+        
+        <remarks>
+            This API reduces the garbage collector pressure and offers the best performance.
+        </remarks>
+    </doc>
+
+    <doc for="text.fontFallback">
+        <summary>
+            Specifies an alternative text style to be used when the primary font family does not support certain character glyphs.
+            <a href="https://www.questpdf.com/api-reference/text.html#font-fallback">Learn more</a>
+        </summary>
+        
+        <remarks>
+            The library supports nested font fallbacks, ensuring a series of alternative fonts. 
+            Individual properties can be adjusted for each level of fallback.
+        </remarks>
+    </doc>
 </documentation>