첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
using System;
using System.Runtime.InteropServices;

#region 현재 콘솔 폰트 설정하기 - SetCurrentConsoleFontEx(outputHandle, maximumWindow, info)

/// <summary>
/// 현재 콘솔 폰트 설정하기
/// </summary>
/// <param name="outputHandle">출력 핸들</param>
/// <param name="maximumWindow">최대 창 크기 글꼴 정보 여부</param>
/// <param name="info">콘솔 폰트 정보 확장</param>
/// <returns>처리 결과</returns>
[DllImport("kernel32", SetLastError = true)]
private static extern bool SetCurrentConsoleFontEx(IntPtr outputHandle, bool maximumWindow, ref CONSOLE_FONT_INFO_EX info);

#endregion

/// <summary>
/// 좌표
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct COORD
{
    //////////////////////////////////////////////////////////////////////////////////////////////////// Field
    ////////////////////////////////////////////////////////////////////////////////////////// Public

    #region Field

    /// <summary>
    /// X
    /// </summary>
    public short X;

    /// <summary>
    /// Y
    /// </summary>
    public short Y;

    #endregion

    //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
    ////////////////////////////////////////////////////////////////////////////////////////// Public

    #region 생성자 - COORD(x, y)

    /// <summary>
    /// 생성자
    /// </summary>
    /// <param name="x">X</param>
    /// <param name="y">Y</param>
    public COORD(short x, short y)
    {
        X = x;
        Y = y;
    }

    #endregion
}

/// <summary>
/// LF_FACESIZE
/// </summary>
public const int LF_FACESIZE = 32;

/// <summary>
/// 콘솔 폰트 정보 확장
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public unsafe struct CONSOLE_FONT_INFO_EX
{
    //////////////////////////////////////////////////////////////////////////////////////////////////// Field
    ////////////////////////////////////////////////////////////////////////////////////////// Public

    #region Field

    /// <summary>
    /// 크기
    /// </summary>
    public uint Size;

    /// <summary>
    /// 폰트
    /// </summary>
    public uint Font;

    /// <summary>
    /// 폰트 크기
    /// </summary>
    public COORD FontSize;

    /// <summary>
    /// 폰트 패밀리
    /// </summary>
    public int FontFamily;

    /// <summary>
    /// 폰트 가중치
    /// </summary>
    public int FontWeight;

    /// <summary>
    /// 페이스명
    /// </summary>
    public fixed char FaceName[LF_FACESIZE];

    #endregion
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요