mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-19 10:47:56 +08:00
fix off-by-one error in format 4 cmap subtable for truetype #91
This commit is contained in:
@@ -35,8 +35,11 @@ namespace UglyToad.PdfPig.Fonts.TrueType.Tables.CMapSubTables
|
||||
Segments = segments ?? throw new ArgumentNullException(nameof(segments));
|
||||
GlyphIds = glyphIds ?? throw new ArgumentNullException(nameof(glyphIds));
|
||||
|
||||
FirstCharacterCode = Segments[0].StartCode;
|
||||
LastCharacterCode = Segments[Segments.Count - 2].EndCode;
|
||||
if (Segments.Count > 0)
|
||||
{
|
||||
FirstCharacterCode = Segments[0].StartCode;
|
||||
LastCharacterCode = Segments[Segments.Count - 1].EndCode;
|
||||
}
|
||||
}
|
||||
|
||||
public int CharacterCodeToGlyphIndex(int characterCode)
|
||||
|
Reference in New Issue
Block a user