public override GlyphBitmapData ReadBitmapData(BinaryReaderFont reader, int glyphId, int index) { reader.Position += imageSize * index; return(GlyphBitmapData.Read( reader, header.imageFormat, (int)imageSize )); }
public override GlyphBitmapData ReadBitmapData(BinaryReaderFont reader, int glyphId, int index) { if (index < 0 || index >= numGlyphs - 1) { return(null); } long start = reader.Position; reader.Position = position + index; GlyphIdOffsetPair offset0 = GlyphIdOffsetPair.Read(reader); GlyphIdOffsetPair offset1 = GlyphIdOffsetPair.Read(reader); int byteSize = offset1.offset - offset0.offset; reader.Position = start + offset0.offset; return(GlyphBitmapData.Read( reader, header.imageFormat, byteSize )); }
public override GlyphBitmapData ReadBitmapData(BinaryReaderFont reader, int glyphId, int index) { if (index < 0 || index >= count - 1) { return(null); } long start = reader.Position; reader.Position = position + index; uint offset0 = reader.ReadUInt32(); uint offset1 = reader.ReadUInt32(); uint byteSize = offset1 - offset0; reader.Position = start + offset0; return(GlyphBitmapData.Read( reader, header.imageFormat, (int)byteSize )); }