//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//
// WFX satellite library | Author: Sergei Y.Kitáev
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;

using WF = System.Windows.Forms;
using DRW = System.Drawing;

using CommonHelpers;

namespace WFX {

//**************************************************************************************************
/// <summary>
/// </summary>
public static partial class Font {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static DRW.Font Create(DRW.Font prototypeFont)
{
   return new DRW.Font( prototypeFont, 0 );
}

//--------------------------------------------------------------------------------------------------

public static DRW.Font CreateBold(DRW.Font prototypeFont)
{
   return CreateBold( prototypeFont, true );
}

public static DRW.Font CreateBold(DRW.Font prototypeFont,bool bold)
{
   return bold ?
      CreateAltered( prototypeFont, DRW.FontStyle.Bold ) :
      CreateAltered( prototypeFont, 0, DRW.FontStyle.Bold );
}

//--------------------------------------------------------------------------------------------------

public static DRW.Font CreateItalic(DRW.Font prototypeFont)
{
   return CreateItalic( prototypeFont, true );
}

public static DRW.Font CreateItalic(DRW.Font prototypeFont,bool italic)
{
   return italic ?
      CreateAltered( prototypeFont, DRW.FontStyle.Italic ) :
      CreateAltered( prototypeFont, 0, DRW.FontStyle.Italic );
}

//--------------------------------------------------------------------------------------------------

public static DRW.Font CreateUnderlined(DRW.Font prototypeFont)
{
   return CreateUnderlined( prototypeFont, true );
}

public static DRW.Font CreateUnderlined(DRW.Font prototypeFont,bool underlined)
{
   return underlined ?
      CreateAltered( prototypeFont, DRW.FontStyle.Underline ) :
      CreateAltered( prototypeFont, 0, DRW.FontStyle.Underline );
}

//--------------------------------------------------------------------------------------------------

public static DRW.Font CreateStrikeout(DRW.Font prototypeFont)
{
   return CreateStrikeout( prototypeFont, true );
}

public static DRW.Font CreateStrikeout(DRW.Font prototypeFont,bool strikeout)
{
   return strikeout ?
      CreateAltered( prototypeFont, DRW.FontStyle.Strikeout ) :
      CreateAltered( prototypeFont, 0, DRW.FontStyle.Strikeout );
}

//--------------------------------------------------------------------------------------------------

public static DRW.Font CreateAltered( DRW.Font prototypeFont,
                                      [HOptional] DRW.FontStyle stylesToAdd )
{
   return CreateAltered( prototypeFont, stylesToAdd, 0 );
}

public static DRW.Font CreateAltered( DRW.Font prototypeFont,
                                      [HOptional] DRW.FontStyle stylesToAdd,
                                      [HOptional] DRW.FontStyle stylesToRemove )
{
   HArgChecking.VerifyNotNull( prototypeFont );
   var style = prototypeFont.Style;
   style |= stylesToAdd;
   style &= ~stylesToRemove;
   return new DRW.Font( prototypeFont, style );
}

//==================================================================================================

public static DRW.Font Duplicate(DRW.Font font)
{
   return CreateAltered( font, 0 );
}

//==================================================================================================

static Font()
{
   WFX_Library.Access();
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // Font
//**************************************************************************************************

} // WFX
