레이블이 일개미의 Etc인 게시물을 표시합니다. 모든 게시물 표시
레이블이 일개미의 Etc인 게시물을 표시합니다. 모든 게시물 표시

2010년 7월 26일 월요일

헝가리안 표기법

:: 개발팀마다 약간의 표기법이 다를 수 있음

 

Prefix

Type

Example

dw

double word

dwTotal

w

WORD

wNumber

l

long

lTotal

i

Integer

iNumber

f

float

fAvarage

b

bool

bCheck

n

short

nCount

by

BYTE

byOffset

ch

CHAR

chKey

sz

CHAR[] Null Terminatied

szFlag

sz

WCHAR[] Null Terminatied

szPin

C

Class

CButton

s

static

sHelper

p

Pointer

pButton

str

CString

strAddress

r

RECT

rDraw

a

Array

aBags

g_

Global Val

g_bShow

m_

Member Val

m_iMans

si

size_t

siCount

 

 

 

vec

vector

vecMan

map

map

mapWoman

lst

list

lstHome

hsh

hash

hshHome

h

handle

hWindow

2010년 7월 19일 월요일

c# Font Exists

c# Font Exists

 

Code 1)

/// 입력된 폰트 이름으로 실재 폰트를 생성
/// 가상 시스템 폰트 이름을 입력 했을때 맵핑된 폰트 또는 기본 폰트가 생성된다.

 

public partial class Form1 : Form
{
    public Form1()
    {
        SetFontFinal();
        InitializeComponent();
    }

    /// <summary>
    /// This method attempts to set the font in the form to Cambria, which
    /// will only work in some scenarios. If Cambria is not available, it will
    /// fall back to Times New Roman, so the font is good on almost all systems.
    /// </summary>
    private void SetFontFinal()
    {
        string fontName = "Cambria";
        Font testFont = new Font(fontName, 16.0f, FontStyle.Regular, GraphicsUnit.Pixel);

        if (testFont.Name == fontName) // if(testFont != null)
        {
            // The font exists, so use it.
            this.Font = testFont;
        }
        else
        {
            // The font we tested doesn't exist, so fallback to Times.
            this.Font = new Font("Times New Roman", 16.0f, FontStyle.Regular, GraphicsUnit.Pixel);
        }
    }
}


Code 2)

/// 설치 되어 있는 폰트 이름

InstalledFontCollection installedFontCollection = new InstalledFontCollection();
 
// Get the array of FontFamily objects.
FontFamily[] fontFamilies = installedFontCollection.Families;

 

--------------------------------------------------------------------------------------

 

/// font mapping reg
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Current Version\FontSubstitutes