VectSharp
2.2.1
A light library for C# vector graphics
|
Represents a font file in TrueType format. Reference: http://stevehanov.ca/blog/?id=143, https://developer.apple.com/fonts/TrueType-Reference-Manual/, https://docs.microsoft.com/en-us/typography/opentype/spec/ More...
Classes | |
struct | Bearings |
Represents the left- and right-side bearings of a glyph. More... | |
class | PairKerning |
Contains information describing how the position of two glyphs in a kerning pair should be altered. More... | |
struct | TrueTypePoint |
Represents a point in a TrueType path description. More... | |
struct | VerticalMetrics |
Represents the maximum heigth above and depth below the baseline of a glyph. More... | |
Public Member Functions | |
void | Destroy () |
Remove this TrueType file from the cache, clear the tables and release the FontStream. Only call this when the actual file that was used to create this object needs to be changed! More... | |
TrueTypeFile | SubsetFont (string charactersToInclude, bool consolidateAt32=false, Dictionary< char, char > outputEncoding=null) |
Create a subset of the TrueType file, containing only the glyphs for the specified characters. More... | |
string | GetFontFamilyName () |
Obtains the font family name from the TrueType file. More... | |
string | GetFullFontFamilyName () |
Obtains the full font family name from the TrueType file. More... | |
string | GetFontName () |
Obtains the PostScript font name from the TrueType file. More... | |
ushort | GetFirstCharIndex () |
Returns the index of the first character glyph represented by the font. More... | |
ushort | GetLastCharIndex () |
Returns the index of the last character glyph represented by the font. More... | |
bool | IsItalic () |
Determines whether the typeface is Italic or Oblique or not. More... | |
bool | IsOblique () |
Determines whether the typeface is Oblique or not. More... | |
bool | IsBold () |
Determines whether the typeface is Bold or not. More... | |
bool | IsFixedPitch () |
Determines whether the typeface is fixed-pitch (aka monospaces) or not. More... | |
bool | IsSerif () |
Determines whether the typeface is serifed or not. More... | |
bool | IsScript () |
Determines whether the typeface is a script typeface or not. More... | |
int | GetGlyphIndex (char glyph) |
Determines the index of the glyph corresponding to a certain character. More... | |
TrueTypePoint[][] | GetGlyphPath (int glyphIndex, double size) |
Get the path that describes the shape of a glyph. More... | |
TrueTypePoint[][] | GetGlyphPath (char glyph, double size) |
Get the path that describes the shape of a glyph. More... | |
double | Get1000EmGlyphWidth (char glyph) |
Computes the advance width of a glyph, in thousandths of em unit. More... | |
double | Get1000EmGlyphWidth (int glyphIndex) |
Computes the advance width of a glyph, in thousandths of em unit. More... | |
double | Get1000EmWinAscent () |
Computes the font's Win ascent, in thousandths of em unit. More... | |
double | Get1000EmAscent () |
Computes the font ascent, in thousandths of em unit. More... | |
double | Get1000EmDescent () |
Computes the font descent, in thousandths of em unit. More... | |
double | Get1000EmYMax () |
Computes the maximum height over the baseline of the font, in thousandths of em unit. More... | |
double | Get1000EmYMin () |
Computes the maximum depth below the baseline of the font, in thousandths of em unit. More... | |
double | Get1000EmXMax () |
Computes the maximum distance to the right of the glyph origin of the font, in thousandths of em unit. More... | |
double | Get1000EmXMin () |
Computes the maximum distance to the left of the glyph origin of the font, in thousandths of em unit. More... | |
Bearings | Get1000EmGlyphBearings (char glyph) |
Computes the left- and right- side bearings of a glyph, in thousandths of em unit. More... | |
VerticalMetrics | Get1000EmGlyphVerticalMetrics (char glyph) |
Computes the vertical metrics of a glyph, in thousandths of em unit. More... | |
double | Get1000EmUnderlinePosition () |
Computes the distance of the top of the underline from the baseline, in thousandths of em unit. More... | |
double | Get1000EmUnderlineThickness () |
Computes the thickness of the underline, in thousandths of em unit. More... | |
double | GetItalicAngle () |
Computes the italic angle for the current font, in thousandths of em unit. This is computed from the vertical and is negative for text that leans forwards. More... | |
double[] | Get1000EmUnderlineIntersections (char glyph, double position, double thickness) |
Computes the intersections between an underline at the specified position and thickness and a glyph, in thousandths of em units. More... | |
PairKerning | Get1000EmKerning (char glyph1, char glyph2) |
Gets the kerning between two glyphs. More... | |
PairKerning | Get1000EmKerning (int glyph1Index, int glyph2Index) |
Gets the kerning between two glyphs. More... | |
Properties | |
Stream | FontStream [get] |
A stream pointing to the TrueType file source (either on disk or in memory). Never dispose this stream directly; if you really need to, call Destroy instead. More... | |
Represents a font file in TrueType format. Reference: http://stevehanov.ca/blog/?id=143, https://developer.apple.com/fonts/TrueType-Reference-Manual/, https://docs.microsoft.com/en-us/typography/opentype/spec/
Definition at line 30 of file TrueType.cs.
void VectSharp.TrueTypeFile.Destroy | ( | ) |
Remove this TrueType file from the cache, clear the tables and release the FontStream. Only call this when the actual file that was used to create this object needs to be changed!
Definition at line 53 of file TrueType.cs.
double VectSharp.TrueTypeFile.Get1000EmAscent | ( | ) |
Computes the font ascent, in thousandths of em unit.
Definition at line 2131 of file TrueType.cs.
double VectSharp.TrueTypeFile.Get1000EmDescent | ( | ) |
Computes the font descent, in thousandths of em unit.
Definition at line 2141 of file TrueType.cs.
Bearings VectSharp.TrueTypeFile.Get1000EmGlyphBearings | ( | char | glyph | ) |
Computes the left- and right- side bearings of a glyph, in thousandths of em unit.
glyph | The glyph whose bearings are to be computed. |
Definition at line 2223 of file TrueType.cs.
VerticalMetrics VectSharp.TrueTypeFile.Get1000EmGlyphVerticalMetrics | ( | char | glyph | ) |
Computes the vertical metrics of a glyph, in thousandths of em unit.
glyph | The glyph whose vertical metrics are to be computed. |
Definition at line 2271 of file TrueType.cs.
double VectSharp.TrueTypeFile.Get1000EmGlyphWidth | ( | char | glyph | ) |
Computes the advance width of a glyph, in thousandths of em unit.
glyph | The glyph whose advance width is to be computed. |
Definition at line 2082 of file TrueType.cs.
double VectSharp.TrueTypeFile.Get1000EmGlyphWidth | ( | int | glyphIndex | ) |
Computes the advance width of a glyph, in thousandths of em unit.
glyphIndex | The index of the glyph whose advance width is to be computed. |
Definition at line 2100 of file TrueType.cs.
PairKerning VectSharp.TrueTypeFile.Get1000EmKerning | ( | char | glyph1, |
char | glyph2 | ||
) |
Gets the kerning between two glyphs.
glyph1 | The first glyph of the kerning pair. |
glyph2 | The second glyph of the kerning pair. |
Definition at line 2490 of file TrueType.cs.
PairKerning VectSharp.TrueTypeFile.Get1000EmKerning | ( | int | glyph1Index, |
int | glyph2Index | ||
) |
Gets the kerning between two glyphs.
glyph1Index | The index of the first glyph of the kerning pair. |
glyph2Index | The index of the second glyph of the kerning pair. |
Definition at line 2504 of file TrueType.cs.
double [] VectSharp.TrueTypeFile.Get1000EmUnderlineIntersections | ( | char | glyph, |
double | position, | ||
double | thickness | ||
) |
Computes the intersections between an underline at the specified position and thickness and a glyph, in thousandths of em units.
glyph | The glyph whose intersections with the underline will be computed. |
position | The distance of the top of the underline from the baseline, in thousandths of em unit. |
thickness | The thickness of the underline, in thousandths of em unit. |
null
. Otherwise, it returns an array containing two elements, representing the horizontal coordinates of the leftmost and rightmost intersection points.Definition at line 2340 of file TrueType.cs.
double VectSharp.TrueTypeFile.Get1000EmUnderlinePosition | ( | ) |
Computes the distance of the top of the underline from the baseline, in thousandths of em unit.
Definition at line 2288 of file TrueType.cs.
double VectSharp.TrueTypeFile.Get1000EmUnderlineThickness | ( | ) |
Computes the thickness of the underline, in thousandths of em unit.
Definition at line 2304 of file TrueType.cs.
double VectSharp.TrueTypeFile.Get1000EmWinAscent | ( | ) |
Computes the font's Win ascent, in thousandths of em unit.
Definition at line 2111 of file TrueType.cs.
double VectSharp.TrueTypeFile.Get1000EmXMax | ( | ) |
Computes the maximum distance to the right of the glyph origin of the font, in thousandths of em unit.
Definition at line 2168 of file TrueType.cs.
double VectSharp.TrueTypeFile.Get1000EmXMin | ( | ) |
Computes the maximum distance to the left of the glyph origin of the font, in thousandths of em unit.
Definition at line 2177 of file TrueType.cs.
double VectSharp.TrueTypeFile.Get1000EmYMax | ( | ) |
Computes the maximum height over the baseline of the font, in thousandths of em unit.
Definition at line 2150 of file TrueType.cs.
double VectSharp.TrueTypeFile.Get1000EmYMin | ( | ) |
Computes the maximum depth below the baseline of the font, in thousandths of em unit.
Definition at line 2159 of file TrueType.cs.
ushort VectSharp.TrueTypeFile.GetFirstCharIndex | ( | ) |
Returns the index of the first character glyph represented by the font.
Definition at line 1920 of file TrueType.cs.
string VectSharp.TrueTypeFile.GetFontFamilyName | ( | ) |
Obtains the font family name from the TrueType file.
null
otherwise.Definition at line 1846 of file TrueType.cs.
string VectSharp.TrueTypeFile.GetFontName | ( | ) |
Obtains the PostScript font name from the TrueType file.
null
otherwise.Definition at line 1901 of file TrueType.cs.
string VectSharp.TrueTypeFile.GetFullFontFamilyName | ( | ) |
Obtains the full font family name from the TrueType file.
null
otherwise.Definition at line 1873 of file TrueType.cs.
int VectSharp.TrueTypeFile.GetGlyphIndex | ( | char | glyph | ) |
Determines the index of the glyph corresponding to a certain character.
glyph | The character whose glyph is sought. |
Definition at line 2010 of file TrueType.cs.
TrueTypePoint [][] VectSharp.TrueTypeFile.GetGlyphPath | ( | char | glyph, |
double | size | ||
) |
Get the path that describes the shape of a glyph.
glyph | The glyph whose path is sought. |
size | The font size to be used for the font coordinates. |
Definition at line 2072 of file TrueType.cs.
TrueTypePoint [][] VectSharp.TrueTypeFile.GetGlyphPath | ( | int | glyphIndex, |
double | size | ||
) |
Get the path that describes the shape of a glyph.
glyphIndex | The index of the glyph whose path is sought. |
size | The font size to be used for the font coordinates. |
Definition at line 2061 of file TrueType.cs.
double VectSharp.TrueTypeFile.GetItalicAngle | ( | ) |
Computes the italic angle for the current font, in thousandths of em unit. This is computed from the vertical and is negative for text that leans forwards.
Definition at line 2320 of file TrueType.cs.
ushort VectSharp.TrueTypeFile.GetLastCharIndex | ( | ) |
Returns the index of the last character glyph represented by the font.
Definition at line 1931 of file TrueType.cs.
bool VectSharp.TrueTypeFile.IsBold | ( | ) |
Determines whether the typeface is Bold or not.
Definition at line 1965 of file TrueType.cs.
bool VectSharp.TrueTypeFile.IsFixedPitch | ( | ) |
Determines whether the typeface is fixed-pitch (aka monospaces) or not.
Definition at line 1976 of file TrueType.cs.
bool VectSharp.TrueTypeFile.IsItalic | ( | ) |
Determines whether the typeface is Italic or Oblique or not.
Definition at line 1943 of file TrueType.cs.
bool VectSharp.TrueTypeFile.IsOblique | ( | ) |
Determines whether the typeface is Oblique or not.
Definition at line 1954 of file TrueType.cs.
bool VectSharp.TrueTypeFile.IsScript | ( | ) |
Determines whether the typeface is a script typeface or not.
Definition at line 1998 of file TrueType.cs.
bool VectSharp.TrueTypeFile.IsSerif | ( | ) |
Determines whether the typeface is serifed or not.
Definition at line 1987 of file TrueType.cs.
TrueTypeFile VectSharp.TrueTypeFile.SubsetFont | ( | string | charactersToInclude, |
bool | consolidateAt32 = false , |
||
Dictionary< char, char > | outputEncoding = null |
||
) |
Create a subset of the TrueType file, containing only the glyphs for the specified characters.
charactersToInclude | A string containing the characters for which the glyphs should be included. |
consolidateAt32 | If true, the character map is rearranged so that the included glyphs start at the unicode U+0032 control point. |
outputEncoding | If consolidateAt32 is true, entries will be added to this dictionary mapping the original characters to the new map (that starts at U+0033). |
Definition at line 562 of file TrueType.cs.
|
get |
A stream pointing to the TrueType file source (either on disk or in memory). Never dispose this stream directly; if you really need to, call Destroy instead.
Definition at line 47 of file TrueType.cs.