Beispiel #1
0
        static Direct2D1FontCollectionCache()
        {
            s_cachedCollections = new ConcurrentDictionary <FontFamilyKey, SharpDX.DirectWrite.FontCollection>();

            s_factory = AvaloniaLocator.Current.GetService <SharpDX.DirectWrite.Factory>();

            s_installedFontCollection = s_factory.GetSystemFontCollection(false);
        }
Beispiel #2
0
 /// <summary>
 ///  Creates a text format object used for text layout.
 /// </summary>
 /// <param name="factory">an instance of <see cref = "SharpDX.DirectWrite.Factory" /></param>
 /// <param name="fontFamilyName">An array of characters that contains the name of the font family</param>
 /// <param name="fontCollection">A pointer to a font collection object. When this is NULL, indicates the system font collection.</param>
 /// <param name="fontWeight">A value that indicates the font weight for the text object created by this method.</param>
 /// <param name="fontStyle">A value that indicates the font style for the text object created by this method.</param>
 /// <param name="fontStretch">A value that indicates the font stretch for the text object created by this method.</param>
 /// <param name="fontSize">The logical size of the font in DIP ("device-independent pixel") units. A DIP equals 1/96 inch.</param>
 /// <param name="localeName">An array of characters that contains the locale name.</param>
 /// <unmanaged>HRESULT CreateTextFormat([In] const wchar* fontFamilyName,[None] IDWriteFontCollection* fontCollection,[None] DWRITE_FONT_WEIGHT fontWeight,[None] DWRITE_FONT_STYLE fontStyle,[None] DWRITE_FONT_STRETCH fontStretch,[None] FLOAT fontSize,[In] const wchar* localeName,[Out] IDWriteTextFormat** textFormat)</unmanaged>
 public TextFormat(Factory factory, string fontFamilyName, SharpDX.DirectWrite.FontCollection fontCollection, SharpDX.DirectWrite.FontWeight fontWeight, SharpDX.DirectWrite.FontStyle fontStyle, SharpDX.DirectWrite.FontStretch fontStretch, float fontSize, string localeName) : base(IntPtr.Zero)
 {
     factory.CreateTextFormat(fontFamilyName, fontCollection, fontWeight, fontStyle, fontStretch, fontSize, localeName, this);
 }
Beispiel #3
0
 /// <summary>
 ///  Creates a text format object used for text layout.
 /// </summary>
 /// <param name="factory">an instance of <see cref = "SharpDX.DirectWrite.Factory" /></param>
 /// <param name="fontFamilyName">An array of characters that contains the name of the font family</param>
 /// <param name="fontCollection">A pointer to a font collection object. When this is NULL, indicates the system font collection.</param>
 /// <param name="fontWeight">A value that indicates the font weight for the text object created by this method.</param>
 /// <param name="fontStyle">A value that indicates the font style for the text object created by this method.</param>
 /// <param name="fontStretch">A value that indicates the font stretch for the text object created by this method.</param>
 /// <param name="fontSize">The logical size of the font in DIP ("device-independent pixel") units. A DIP equals 1/96 inch.</param>
 /// <unmanaged>HRESULT CreateTextFormat([In] const wchar* fontFamilyName,[None] IDWriteFontCollection* fontCollection,[None] DWRITE_FONT_WEIGHT fontWeight,[None] DWRITE_FONT_STYLE fontStyle,[None] DWRITE_FONT_STRETCH fontStretch,[None] FLOAT fontSize,[In] const wchar* localeName,[Out] IDWriteTextFormat** textFormat)</unmanaged>
 public TextFormat(Factory factory, string fontFamilyName, SharpDX.DirectWrite.FontCollection fontCollection, SharpDX.DirectWrite.FontWeight fontWeight, SharpDX.DirectWrite.FontStyle fontStyle, SharpDX.DirectWrite.FontStretch fontStretch, float fontSize)
     : this(factory, fontFamilyName, fontCollection, fontWeight, fontStyle, fontStretch, fontSize, "")
 {
 }
Beispiel #4
0
        static Direct2D1FontCollectionCache()
        {
            s_cachedCollections = new ConcurrentDictionary <FontFamilyKey, SharpDX.DirectWrite.FontCollection>();

            s_installedFontCollection = Direct2D1Platform.DirectWriteFactory.GetSystemFontCollection(false);
        }