use cid font subroutines where applicable. add ucs 2 cmap support for type 1 fonts

* cid cff fonts have multiple sub-fonts and multiple private dictionaries, in addition to a top level font and private dictionary. this fix uses the specific sub-dictionary when getting local subroutines on a per-glyph basis.
* chinese, japanese or korean fonts can use a ucs-2 encoding cmap for retrieving unicode values.
* add support for the additional glyph list for unicode values in true type fonts. adds nonmarkingreturn mapping to carriage return.
* makes font parsing classes static where there's no reason for them to be per-instance.
This commit is contained in:
Eliot Jones
2019-12-19 13:33:44 +00:00
parent a167d4c1dd
commit c30cd1b96d
21 changed files with 240 additions and 160 deletions

View File

@@ -4,15 +4,13 @@
using System.IO;
using System.Linq;
using PdfPig.Fonts.CompactFontFormat;
using PdfPig.Fonts.CompactFontFormat.CharStrings;
using PdfPig.Fonts.CompactFontFormat.Dictionaries;
using Xunit;
public class CompactFontFormatParserTests
{
private readonly CompactFontFormatParser parser = new CompactFontFormatParser(new CompactFontFormatIndividualFontParser(
new CompactFontFormatIndexReader(), new CompactFontFormatTopLevelDictionaryReader(), new CompactFontFormatPrivateDictionaryReader()),
new CompactFontFormatIndexReader());
private readonly CompactFontFormatParser parser = new CompactFontFormatParser(
new CompactFontFormatIndividualFontParser(new CompactFontFormatTopLevelDictionaryReader(), new CompactFontFormatPrivateDictionaryReader()));
[Fact]
public void CanReadMinionPro()