Improve Code Quality (#818)

* Make AdobeFontMetricsLigature a struct

* Make AdobeFontMetricsCharacterSize a struct

* Eliminate allocation in CompactFontFormatData

* Pass TransformationMatrix  by reference

* Seal Encoding classes

* Make SubTableHeaderEntry a readonly struct

* Introduce StringSplitter and eliminate various allocations in GlyphListFactory

* Eliminate a few substring allocations

* Use char overload on StringBuilder

* Eliminate virtual calls on stringIndex

* Optimize ReadHelper ReadLong and ReadInt methods

* Add additional readonly annotations to PdfRectangle

* Optimize NameTokenizer

* Eliminate allocation in TrueTypeGlyphTableSubsetter

* Use empty arrays

* Eliminate allocations in OperationWriteHelper.WriteHex

* Use simplified DecryptCbc method on .NET 6+

* Fix windows-1252 encoding not working on net6.0 and 8.0

* Update int buffers to exact unsigned max length and eliminate additional byte allocation

* Fix typo

* Remove unused constant
This commit is contained in:
Jason Nelson
2024-04-18 11:58:40 -07:00
committed by GitHub
parent 0f7077b257
commit 1ef2e127a6
42 changed files with 326 additions and 167 deletions

View File

@@ -1,12 +1,10 @@
namespace UglyToad.PdfPig.Fonts.Encodings
{
using Core;
/// <inheritdoc />
/// <summary>
/// Similar to the <see cref="T:UglyToad.PdfPig.Fonts.Encodings.MacRomanEncoding" /> with 15 additional entries.
/// </summary>
public class MacOsRomanEncoding : MacRomanEncoding
public sealed class MacOsRomanEncoding : MacRomanEncoding
{
private static readonly (int, string)[] EncodingTable =
{