mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-11-24 16:53:20 +08:00
Trim excess in long lived font collections
Some checks failed
Build, test and publish draft / build (push) Has been cancelled
Build and test [MacOS] / build (push) Has been cancelled
Run Common Crawl Tests / build (0000-0001) (push) Has been cancelled
Run Common Crawl Tests / build (0002-0003) (push) Has been cancelled
Run Common Crawl Tests / build (0004-0005) (push) Has been cancelled
Run Common Crawl Tests / build (0006-0007) (push) Has been cancelled
Run Integration Tests / build (push) Has been cancelled
Some checks failed
Build, test and publish draft / build (push) Has been cancelled
Build and test [MacOS] / build (push) Has been cancelled
Run Common Crawl Tests / build (0000-0001) (push) Has been cancelled
Run Common Crawl Tests / build (0002-0003) (push) Has been cancelled
Run Common Crawl Tests / build (0004-0005) (push) Has been cancelled
Run Common Crawl Tests / build (0006-0007) (push) Has been cancelled
Run Integration Tests / build (push) Has been cancelled
This commit is contained in:
@@ -770,6 +770,8 @@ namespace UglyToad.PdfPig.Fonts.CompactFontFormat.CharStrings
|
||||
}
|
||||
}
|
||||
|
||||
values.TrimExcess();
|
||||
|
||||
return new Type2CharStrings.CommandSequence(values, commandIdentifiers);
|
||||
}
|
||||
|
||||
|
||||
@@ -257,6 +257,10 @@
|
||||
gidToStringIdAndNameMap[gid++] = pair;
|
||||
}
|
||||
|
||||
#if NET
|
||||
gidToStringIdAndNameMap.TrimExcess();
|
||||
#endif
|
||||
|
||||
glyphIdToStringIdAndName = gidToStringIdAndNameMap;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,11 +81,15 @@ namespace UglyToad.PdfPig.PdfFonts.Cmap
|
||||
|
||||
public CMap Build()
|
||||
{
|
||||
#if NET
|
||||
BaseFontCharacterMap?.TrimExcess();
|
||||
#endif
|
||||
|
||||
return new CMap(GetCidSystemInfo(), Type, WMode, Name, Version,
|
||||
BaseFontCharacterMap ?? new Dictionary<int, string>(),
|
||||
CodespaceRanges ?? new CodespaceRange[0],
|
||||
CidRanges ?? new CidRange[0],
|
||||
CidCharacterMappings ?? new CidCharacterMapping[0]);
|
||||
CodespaceRanges ?? Array.Empty<CodespaceRange>(),
|
||||
CidRanges ?? Array.Empty<CidRange>(),
|
||||
CidCharacterMappings ?? Array.Empty<CidCharacterMapping>());
|
||||
}
|
||||
|
||||
private CharacterIdentifierSystemInfo GetCidSystemInfo()
|
||||
|
||||
Reference in New Issue
Block a user