Browse Source

2023.12.4

Marcin Ziąbek 1 year ago
parent
commit
feac3938cb

+ 1 - 4
Source/QuestPDF/Fluent/TextSpanDescriptorExtensions.cs

@@ -76,11 +76,8 @@ namespace QuestPDF.Fluent
         }
 
         /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.letterSpacing"]/*' />
-        public static T LetterSpacing<T>(this T descriptor, float factor) where T : TextSpanDescriptor
+        public static T LetterSpacing<T>(this T descriptor, float factor = 0) where T : TextSpanDescriptor
         {
-            if (factor <= 0)
-                throw new ArgumentException("Letter spacing must be greater than 0.");
-            
             descriptor.MutateTextStyle(TextStyleExtensions.LetterSpacing, factor);
             return descriptor;
         }

+ 1 - 4
Source/QuestPDF/Fluent/TextStyleExtensions.cs

@@ -66,11 +66,8 @@ namespace QuestPDF.Fluent
         }
 
         /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="text.letterSpacing"]/*' />
-        public static TextStyle LetterSpacing(this TextStyle style, float factor = 1)
+        public static TextStyle LetterSpacing(this TextStyle style, float factor = 0)
         {
-            if (factor <= 0)
-                throw new ArgumentException("Letter spacing must be greater than 0.");
-            
             return style.Mutate(TextStyleProperty.LetterSpacing, factor);
         }
 

+ 1 - 1
Source/QuestPDF/QuestPDF.csproj

@@ -3,7 +3,7 @@
         <Authors>MarcinZiabek</Authors>
         <Company>CodeFlint</Company>
         <PackageId>QuestPDF</PackageId>
-        <Version>2023.12.3</Version>
+        <Version>2023.12.4</Version>
         <PackageDescription>QuestPDF is an open-source, modern and battle-tested library that can help you with generating PDF documents by offering friendly, discoverable and predictable C# fluent API. Easily generate PDF reports, invoices, exports, etc.</PackageDescription>
         <PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/Resources/ReleaseNotes.txt"))</PackageReleaseNotes>
         <LangVersion>10</LangVersion>

+ 2 - 3
Source/QuestPDF/Resources/Documentation.xml

@@ -187,14 +187,13 @@
     <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.
+            The adjustment is proportional to the text size.
             <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>
+            <para>A value of 0 maintains the original spacing. When the value is positive, the text is more spread out. When it is negative, the text is more condensed.</para>
         </param>
     </doc>
     

+ 3 - 0
Source/QuestPDF/Resources/ReleaseNotes.txt

@@ -19,3 +19,6 @@ Version 2023.12.3
 - Improvement: enhanced the automated layout issue detection algorithm to cover a broader range of cases.
 - Update: upgraded the SkiaSharp dependency to version 2.88.7. This update addresses issues with JPEG images being incorrectly encoded/decoded on ARM devices.
 - Maintenance: added .NET 8 as an official build target for the library.
+
+Version 2023.12.4
+- Fixed: the TextStyle.LetterSpacing property was not documented correctly, and the FluentAPI code prevented its correct use.