diff --git a/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs b/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs index e96e60a0..db36c85b 100644 --- a/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs +++ b/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs @@ -92,11 +92,13 @@ "UglyToad.PdfPig.Filters.IFilterProvider", "UglyToad.PdfPig.Functions.FunctionTypes", "UglyToad.PdfPig.Functions.PdfFunction", + "UglyToad.PdfPig.PdfFonts.CharacterBoundingBox", "UglyToad.PdfPig.PdfFonts.DescriptorFontFile", "UglyToad.PdfPig.PdfFonts.FontDescriptor", "UglyToad.PdfPig.PdfFonts.FontDescriptorFlags", "UglyToad.PdfPig.PdfFonts.FontDetails", "UglyToad.PdfPig.PdfFonts.FontStretch", + "UglyToad.PdfPig.PdfFonts.IFont", "UglyToad.PdfPig.Geometry.GeometryExtensions", "UglyToad.PdfPig.Graphics.Colors.CMYKColor", "UglyToad.PdfPig.Graphics.Colors.ColorSpace", @@ -199,6 +201,7 @@ "UglyToad.PdfPig.Graphics.Operations.TextState.Type3SetGlyphWidth", "UglyToad.PdfPig.Graphics.Operations.TextState.Type3SetGlyphWidthAndBoundingBox", "UglyToad.PdfPig.Graphics.TextMatrices", + "UglyToad.PdfPig.Graphics.XObjectContentRecord", "UglyToad.PdfPig.Images.ColorSpaceDetailsByteConverter", "UglyToad.PdfPig.Logging.ILog", "UglyToad.PdfPig.Outline.Bookmarks", @@ -227,7 +230,9 @@ "UglyToad.PdfPig.Writer.PdfWriterType", "UglyToad.PdfPig.Writer.PdfPageBuilder", "UglyToad.PdfPig.Writer.TokenWriter", - "UglyToad.PdfPig.XObjects.XObjectImage" + "UglyToad.PdfPig.XObjects.XObjectImage", + "UglyToad.PdfPig.XObjects.XObjectImage", + "UglyToad.PdfPig.XObjects.XObjectType" }; foreach (var publicTypeName in publicTypeNames) diff --git a/src/UglyToad.PdfPig/Functions/PdfFunctionType0.cs b/src/UglyToad.PdfPig/Functions/PdfFunctionType0.cs index 1a0dc8d4..feb41f8a 100644 --- a/src/UglyToad.PdfPig/Functions/PdfFunctionType0.cs +++ b/src/UglyToad.PdfPig/Functions/PdfFunctionType0.cs @@ -348,8 +348,6 @@ // Successive values are adjacent in the bit stream; there is no padding at byte boundaries. var bits = new BitArray(FunctionStream.Data.ToArray()); - System.Diagnostics.Debug.Assert(bits.Length == arraySize * nOut * bitsPerSample); - for (int i = 0; i < arraySize; i++) { samples[i] = new int[nOut]; diff --git a/src/UglyToad.PdfPig/Functions/Type4/Parser.cs b/src/UglyToad.PdfPig/Functions/Type4/Parser.cs index b971965a..085ccf30 100644 --- a/src/UglyToad.PdfPig/Functions/Type4/Parser.cs +++ b/src/UglyToad.PdfPig/Functions/Type4/Parser.cs @@ -201,7 +201,6 @@ private void ScanNewLine() { - System.Diagnostics.Debug.Assert(state == State.NEWLINE); char ch = CurrentChar(); buffer.Append(ch); if (ch == CR && Peek() == LF) @@ -215,7 +214,6 @@ private void ScanWhitespace() { - System.Diagnostics.Debug.Assert(state == State.WHITESPACE); buffer.Append(CurrentChar()); bool loop = true; @@ -239,7 +237,6 @@ private void ScanComment() { - System.Diagnostics.Debug.Assert(state == State.COMMENT); buffer.Append(CurrentChar()); bool loop = true; @@ -264,7 +261,6 @@ private void ScanToken() { - System.Diagnostics.Debug.Assert(state == State.TOKEN); char ch = CurrentChar(); buffer.Append(ch); switch (ch) diff --git a/src/UglyToad.PdfPig/Graphics/IOperationContext.cs b/src/UglyToad.PdfPig/Graphics/IOperationContext.cs index 8d5fd62f..83fdf21c 100644 --- a/src/UglyToad.PdfPig/Graphics/IOperationContext.cs +++ b/src/UglyToad.PdfPig/Graphics/IOperationContext.cs @@ -68,11 +68,6 @@ /// PdfPoint? CloseSubpath(); - /// - /// Add the current subpath to the path. - /// - void AddCurrentSubpath(); - /// /// Stroke the current path. /// diff --git a/src/UglyToad.PdfPig/Graphics/XObjectContentRecord.cs b/src/UglyToad.PdfPig/Graphics/XObjectContentRecord.cs index 751978f3..90a2a887 100644 --- a/src/UglyToad.PdfPig/Graphics/XObjectContentRecord.cs +++ b/src/UglyToad.PdfPig/Graphics/XObjectContentRecord.cs @@ -8,20 +8,38 @@ using Util.JetBrains.Annotations; using XObjects; - internal class XObjectContentRecord + /// + /// An XObject content record. + /// + public class XObjectContentRecord { + /// + /// The XObject type. + /// public XObjectType Type { get; } + /// + /// The XObject stream. + /// [NotNull] public StreamToken Stream { get; } + /// + /// The applied transformation. + /// public TransformationMatrix AppliedTransformation { get; } + /// + /// The default rendering intent. + /// public RenderingIntent DefaultRenderingIntent { get; } + /// + /// The default color space. + /// public ColorSpace DefaultColorSpace { get; } - public XObjectContentRecord(XObjectType type, StreamToken stream, TransformationMatrix appliedTransformation, + internal XObjectContentRecord(XObjectType type, StreamToken stream, TransformationMatrix appliedTransformation, RenderingIntent defaultRenderingIntent, ColorSpace defaultColorSpace) { diff --git a/src/UglyToad.PdfPig/PdfFonts/CharacterBoundingBox.cs b/src/UglyToad.PdfPig/PdfFonts/CharacterBoundingBox.cs index f7517db3..7dbc57a4 100644 --- a/src/UglyToad.PdfPig/PdfFonts/CharacterBoundingBox.cs +++ b/src/UglyToad.PdfPig/PdfFonts/CharacterBoundingBox.cs @@ -2,13 +2,22 @@ { using Core; - internal class CharacterBoundingBox + /// + /// Character bounding box. + /// + public class CharacterBoundingBox { + /// + /// The glyph bounds. + /// public PdfRectangle GlyphBounds { get; } + /// + /// THe width. + /// public double Width { get; } - public CharacterBoundingBox(PdfRectangle bounds, double width) + internal CharacterBoundingBox(PdfRectangle bounds, double width) { GlyphBounds = bounds; Width = width; diff --git a/src/UglyToad.PdfPig/PdfFonts/IFont.cs b/src/UglyToad.PdfPig/PdfFonts/IFont.cs index 9bde66d1..0b70c95f 100644 --- a/src/UglyToad.PdfPig/PdfFonts/IFont.cs +++ b/src/UglyToad.PdfPig/PdfFonts/IFont.cs @@ -4,20 +4,44 @@ using System.Collections.Generic; using Tokens; - internal interface IFont + /// + /// Font base interface. + /// + public interface IFont { + /// + /// The font name. + /// NameToken Name { get; } + /// + /// Is the font vertical. + /// bool IsVertical { get; } + /// + /// The font details. + /// FontDetails Details { get; } + /// + /// Read the character code. + /// int ReadCharacterCode(IInputBytes bytes, out int codeLength); + /// + /// Try get the unicode value. + /// bool TryGetUnicode(int characterCode, out string value); + /// + /// Get the font bounding box. + /// CharacterBoundingBox GetBoundingBox(int characterCode); + /// + /// Get the font transformation matrix. + /// TransformationMatrix GetFontMatrix(); /// diff --git a/src/UglyToad.PdfPig/XObjects/XObjectType.cs b/src/UglyToad.PdfPig/XObjects/XObjectType.cs index 6e65d7b8..56e9e881 100644 --- a/src/UglyToad.PdfPig/XObjects/XObjectType.cs +++ b/src/UglyToad.PdfPig/XObjects/XObjectType.cs @@ -1,9 +1,23 @@ namespace UglyToad.PdfPig.XObjects { - internal enum XObjectType + /// + /// XObject type. + /// + public enum XObjectType { + /// + /// Image. + /// Image, + + /// + /// Form. + /// Form, + + /// + /// PostScript. + /// PostScript } }