Exemple #1
0
 // Method to marshal from native to managed struct
 internal unsafe void __MarshalFrom(ref __Native @ref)
 {
     this.FontFamily  = (@ref.FontFamily == IntPtr.Zero)?null:Marshal.PtrToStringUni(@ref.FontFamily);
     this.FontWeight  = @ref.FontWeight;
     this.FontStyle   = @ref.FontStyle;
     this.FontStretch = @ref.FontStretch;
     this.Locale      = (@ref.Locale == IntPtr.Zero)?null:Marshal.PtrToStringUni(@ref.Locale);
 }
Exemple #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);
 }
Exemple #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, "")
 {
 }