mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-20 03:17:57 +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));
|
Segments = segments ?? throw new ArgumentNullException(nameof(segments));
|
||||||
GlyphIds = glyphIds ?? throw new ArgumentNullException(nameof(glyphIds));
|
GlyphIds = glyphIds ?? throw new ArgumentNullException(nameof(glyphIds));
|
||||||
|
|
||||||
FirstCharacterCode = Segments[0].StartCode;
|
if (Segments.Count > 0)
|
||||||
LastCharacterCode = Segments[Segments.Count - 2].EndCode;
|
{
|
||||||
|
FirstCharacterCode = Segments[0].StartCode;
|
||||||
|
LastCharacterCode = Segments[Segments.Count - 1].EndCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int CharacterCodeToGlyphIndex(int characterCode)
|
public int CharacterCodeToGlyphIndex(int characterCode)
|
||||||
|
Reference in New Issue
Block a user