Пример #1
0
        public D2DFont CreateFont(FontOptions options)
        {
            if (_device == null)
            {
                throw new InvalidOperationException("The DirectX device is not initialized");
            }
            var font = new TextFormat(_fontFactory, options.FontFamilyName,
                                      options.Bold ? FontWeight.Bold : FontWeight.Normal, options.GetStyle(), options.FontSize);

            return(new D2DFont(font));
        }
Пример #2
0
 /// <inheritdoc />
 /// <summary>
 ///     Initializes a new instance of the <see cref="T:GameOverlay.Graphics.D2DFont" /> class.
 /// </summary>
 /// <param name="device">The device.</param>
 /// <param name="options">The options.</param>
 public D2DFont(Direct2DRenderer device, FontOptions options) : this(device.GetFontFactory(), options.FontFamilyName,
                                                                     options.FontSize, options.Bold, options.Italic)
 {
 }
Пример #3
0
 /// <inheritdoc />
 /// <summary>
 ///     Initializes a new instance of the <see cref="T:GameOverlay.Graphics.D2DFont" /> class.
 /// </summary>
 /// <param name="factory">The factory.</param>
 /// <param name="options">The options.</param>
 public D2DFont(FontFactory factory, FontOptions options) : this(factory, options.FontFamilyName,
                                                                 options.FontSize, options.Bold, options.Italic)
 {
 }