Struct ContentGlyph
A single glyph (character) extracted from a content stream, with its position, font, and size (spec §9).
Implements
Inherited Members
Namespace: DRIT.Pdf.Content
Assembly: DRIT.Pdf.dll
Syntax
public readonly struct ContentGlyph : IEquatable<ContentGlyph>
Constructors
ContentGlyph(char, PdfPoint, double, string?, PdfRect)
Initializes a content glyph.
Declaration
public ContentGlyph(char character, PdfPoint position, double fontSize, string? fontName, PdfRect bounds)
Parameters
| Type | Name | Description |
|---|---|---|
| char | character | |
| PdfPoint | position | |
| double | fontSize | |
| string | fontName | |
| PdfRect | bounds |
Properties
Bounds
Gets the bounding box of this glyph.
Declaration
public PdfRect Bounds { get; }
Property Value
| Type | Description |
|---|---|
| PdfRect |
Character
Gets the Unicode character.
Declaration
public char Character { get; }
Property Value
| Type | Description |
|---|---|
| char |
FontName
Gets the PostScript font name used to render this glyph.
Declaration
public string? FontName { get; }
Property Value
| Type | Description |
|---|---|
| string |
FontSize
Gets the font size in points.
Declaration
public double FontSize { get; }
Property Value
| Type | Description |
|---|---|
| double |
Position
Gets the position of the glyph baseline origin in user-space coordinates.
Declaration
public PdfPoint Position { get; }
Property Value
| Type | Description |
|---|---|
| PdfPoint |
Methods
Equals(ContentGlyph)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(ContentGlyph other)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentGlyph | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool | true if the current object is equal to the |
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool | true if |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The fully qualified type name. |
Overrides
Operators
operator ==(ContentGlyph, ContentGlyph)
Equality operator.
Declaration
public static bool operator ==(ContentGlyph a, ContentGlyph b)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentGlyph | a | |
| ContentGlyph | b |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(ContentGlyph, ContentGlyph)
Inequality operator.
Declaration
public static bool operator !=(ContentGlyph a, ContentGlyph b)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentGlyph | a | |
| ContentGlyph | b |
Returns
| Type | Description |
|---|---|
| bool |