OpenTypePackage
OpenTypeRootPackage.OpenTypePackage property
Ruft das OpenType-Metadatenpaket ab.
public OpenTypePackage OpenTypePackage { get; }
Eigentumswert
Das OpenType-Metadatenpaket.
Bemerkungen
Erfahren Sie mehr
Beispiele
Dieses Beispiel zeigt, wie Metadaten von OpenType-Schriftarten gelesen werden.
using (Metadata metadata = new Metadata(Constants.InputTtf))
{
var root = metadata.GetRootPackage<OpenTypeRootPackage>();
// Metadaten der OpenType-Schriftart lesen
foreach (var metadataEntry in root.OpenTypePackage.Fonts)
{
// Zeigt die Werte einiger Metadateneigenschaften an
Console.WriteLine(metadataEntry.Created);
Console.WriteLine(metadataEntry.DirectionHint);
Console.WriteLine(metadataEntry.EmbeddingLicensingRights);
Console.WriteLine(metadataEntry.Flags);
Console.WriteLine(metadataEntry.FontFamilyName);
Console.WriteLine(metadataEntry.FontRevision);
Console.WriteLine(metadataEntry.FontSubfamilyName);
Console.WriteLine(metadataEntry.FullFontName);
Console.WriteLine(metadataEntry.GlyphBounds);
Console.WriteLine(metadataEntry.MajorVersion);
Console.WriteLine(metadataEntry.MinorVersion);
Console.WriteLine(metadataEntry.Modified);
Console.WriteLine(metadataEntry.SfntVersion);
Console.WriteLine(metadataEntry.Style);
Console.WriteLine(metadataEntry.TypographicFamily);
Console.WriteLine(metadataEntry.TypographicSubfamily);
Console.WriteLine(metadataEntry.Weight);
Console.WriteLine(metadataEntry.Width);
foreach (OpenTypeBaseNameRecord nameRecord in metadataEntry.Names)
{
Console.WriteLine(nameRecord.NameID);
Console.WriteLine(nameRecord.Platform);
Console.WriteLine(nameRecord.Value);
OpenTypeMacintoshNameRecord macintoshNameRecord = nameRecord as OpenTypeMacintoshNameRecord;
if (macintoshNameRecord != null)
{
Console.WriteLine(macintoshNameRecord.Encoding);
Console.WriteLine(macintoshNameRecord.Language);
}
else
{
OpenTypeUnicodeNameRecord unicodeNameRecord = nameRecord as OpenTypeUnicodeNameRecord;
if (unicodeNameRecord != null)
{
Console.WriteLine(unicodeNameRecord.Encoding);
}
else
{
OpenTypeWindowsNameRecord windowsNameRecord = nameRecord as OpenTypeWindowsNameRecord;
if (windowsNameRecord != null)
{
Console.WriteLine(windowsNameRecord.Encoding);
Console.WriteLine(windowsNameRecord.Language);
}
}
}
}
}
}
Siehe auch
- class OpenTypePackage
- class OpenTypeRootPackage
- namensraum GroupDocs.Metadata.Formats.Font
- Montage GroupDocs.Metadata