Class FontService
Namespace: Aurigma.DesignAtoms.Services
Assembly: Aurigma.DesignAtoms.dll
public class FontService : IFontService, IDisposable
Inheritance: System.Object -> FontService
Implements
- Aurigma.DesignAtoms.Services.IFontService
System.IDisposable
Inherited Members
System.Object.ToStringSystem.Object.Equals(System.Object)System.Object.Equals(System.Object,System.Object)System.Object.ReferenceEquals(System.Object,System.Object)System.Object.GetHashCodeSystem.Object.GetTypeSystem.Object.MemberwiseClone
Constructors
FontService
public FontService(IConfiguration configuration, IFontStorage fontStorage, IFontInfoProvider fontInfoProvider, bool initialize = true)
Properties
LocalFonts
public virtual IReadOnlyDictionary<string, IList<FontService.FontData>> LocalFonts { get; }
AllFontsByFamily
public IReadOnlyDictionary<string, IList<FontService.FontData>> AllFontsByFamily { get; }
AllFontsByPsName
public IReadOnlyDictionary<string, FontService.FontData> AllFontsByPsName { get; }
FontRemaps
public IReadOnlyDictionary<string, string> FontRemaps { get; }
FontSizeWarningThreshold
public long FontSizeWarningThreshold { get; }
DefaultPostscriptName
public string DefaultPostscriptName { get; }
FontRegistry
public FontRegistry FontRegistry { get; }
Methods
Dispose
public void Dispose()
GetCompressedFontStreamAsync
public Task<Stream> GetCompressedFontStreamAsync(string postscriptName)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | postscriptName |
Returns
System.Threading.Tasks.Task<System.IO.Stream>
GetCompressedFontStream
[Obsolete("This method is obsolete, use GetCompressedFontStream instead.")]
public Task<Stream> GetCompressedFontStream(string postscriptName)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | postscriptName |
Returns
System.Threading.Tasks.Task<System.IO.Stream>
GetFontRegistry
public FontRegistry GetFontRegistry()
Returns
Aurigma.GraphicsMill.AdvancedDrawing.FontRegistry
CreateFont
public Font CreateFont(FontRegistry fontRegistry, string postScriptName, float size, float dpiX, float dpiY)
Parameters
| Type | Name | Description |
|---|---|---|
Aurigma.GraphicsMill.AdvancedDrawing.FontRegistry | fontRegistry | |
System.String | postScriptName | |
System.Single | size | |
System.Single | dpiX | |
System.Single | dpiY |
Returns
Aurigma.GraphicsMill.AdvancedDrawing.Font
InitializeAsync
public Task InitializeAsync()
Returns
System.Threading.Tasks.Task
WaitUntilReadyAsync
public Task WaitUntilReadyAsync()
Returns
System.Threading.Tasks.Task
UpdateLocalFonts
[Obsolete]
public void UpdateLocalFonts()
GetBytes
public IEnumerable<byte> GetBytes()
Returns
System.Collections.Generic.IEnumerable<System.Byte>
RecognizeFontStyle
public FontService.FontStyle RecognizeFontStyle(string style)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | style |
Returns
Aurigma.DesignAtoms.Services.FontService.FontStyle
GetCssPsName
public string GetCssPsName(FontService.FontData requestedFont)
Parameters
| Type | Name | Description |
|---|---|---|
| Aurigma.DesignAtoms.Services.FontService.FontData | requestedFont |
Returns
System.String
GetCssFamilyName
public string GetCssFamilyName(FontService.FontData requestedFont)
Parameters
| Type | Name | Description |
|---|---|---|
| Aurigma.DesignAtoms.Services.FontService.FontData | requestedFont |
Returns
System.String
FindSuitableFont
public FontSettings FindSuitableFont(string fontFamily, bool requestedBold = false, bool requestedItalic = false, string requestedStyle = null)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fontFamily | |
System.Boolean | requestedBold | |
System.Boolean | requestedItalic | |
System.String | requestedStyle |
Returns
Aurigma.DesignAtoms.Model.Items.FontSettings
FilterMissedFonts
public IEnumerable<string> FilterMissedFonts(IEnumerable<string> requestedFontsPsNames)
Parameters
| Type | Name | Description |
|---|---|---|
System.Collections.Generic.IEnumerable<System.String> | requestedFontsPsNames |
Returns
System.Collections.Generic.IEnumerable<System.String>
CreateProductAvailableFontsAsync
public Task<Dictionary<string, IEnumerable<FontService.ExtendedFontData>>> CreateProductAvailableFontsAsync(IProductHandler productHandler, Product product, IList<string> requestedLocalFonts, string requestedDefaultFont)
Parameters
| Type | Name | Description |
|---|---|---|
| Aurigma.DesignAtoms.Model.IProductHandler | productHandler | |
| Aurigma.DesignAtoms.Model.Product | product | |
System.Collections.Generic.IList<System.String> | requestedLocalFonts | |
System.String | requestedDefaultFont |
Returns
System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<System.String,System.Collections.Generic.IEnumerable<Aurigma.DesignAtoms.Services.FontService.ExtendedFontData>>>
CreateProductAvailableFonts1
[Obsolete]
public Dictionary<string, IEnumerable<FontService.ExtendedFontData>> CreateProductAvailableFonts1(IProductHandler productHandler, Product product, IList<string> requestedLocalFonts, string requestedDefaultFont)
Parameters
| Type | Name | Description |
|---|---|---|
| Aurigma.DesignAtoms.Model.IProductHandler | productHandler | |
| Aurigma.DesignAtoms.Model.Product | product | |
System.Collections.Generic.IList<System.String> | requestedLocalFonts | |
System.String | requestedDefaultFont |
Returns
System.Collections.Generic.Dictionary<System.String,System.Collections.Generic.IEnumerable<Aurigma.DesignAtoms.Services.FontService.ExtendedFontData>>
GetFontStreamByPostscriptNameAsync
public Task<Stream> GetFontStreamByPostscriptNameAsync(string psName)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | psName |
Returns
System.Threading.Tasks.Task<System.IO.Stream>
GetFontStreamByPostscriptName
[Obsolete("This method is obsolete, use GetFontStreamByPostscriptNameAsync instead.")]
public Task<Stream> GetFontStreamByPostscriptName(string psName)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | psName |
Returns
System.Threading.Tasks.Task<System.IO.Stream>
GetFontPath
public string GetFontPath(string fontKey)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fontKey |
Returns
System.String
GetFontStreamByPathAsync
public Task<Stream> GetFontStreamByPathAsync(string fontPath)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fontPath |
Returns
System.Threading.Tasks.Task<System.IO.Stream>
GetFontStreamByPath
[Obsolete("This method is obsolete, use GetFontStreamByPathAsync instead.")]
public Task<Stream> GetFontStreamByPath(string fontPath)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fontPath |
Returns
System.Threading.Tasks.Task<System.IO.Stream>
FixFontPsName
public string FixFontPsName(string psName)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | psName |
Returns
System.String
GetFontKey
public static string GetFontKey(string postScriptName, string fontFileFullName)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | postScriptName | |
System.String | fontFileFullName |
Returns
System.String
GetFontMimeType
public static string GetFontMimeType(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fileName |
Returns
System.String