mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-20 03:17:57 +08:00
add content order text extractor and example of use
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user