add content order text extractor and example of use

This commit is contained in:
Eliot Jones
2020-04-19 17:06:34 +01:00
parent f18bc0766a
commit 407ee5ca51
8 changed files with 202 additions and 3 deletions

View File

@@ -15,7 +15,7 @@
{
private readonly IReadOnlyList<uint> glyphOffsets;
private readonly PdfRectangle maxGlyphBounds;
private readonly TrueTypeDataBytes tableBytes;
private TrueTypeDataBytes tableBytes;
/// <inheritdoc />
public string Tag => TrueTypeHeaderTable.Glyf;
@@ -98,6 +98,11 @@
private IReadOnlyList<IGlyphDescription> ReadGlyphs()
{
if (tableBytes == null)
{
throw new InvalidOperationException("Bytes cache was discarded before lazy value evaluated.");
}
var data = tableBytes;
var offsets = glyphOffsets;
@@ -149,6 +154,8 @@
result[compositeLocation.Key] = ReadCompositeGlyph(data, compositeLocation.Value, compositeLocations, result, emptyGlyph);
}
tableBytes = null;
return result;
}