Q&A

  • Truetype글꼴등록이 ...?
팁에서 찾아서 Truetype글꼴을 등록하는것을 적용했으나, 설치완료후에

제어판의 글꼴에는 등록이 된것같은데,워드패드에서해당글꼴을 찾을 경우 나오질 않습니다.. 어케하면 조을까요...



procedure SetFontReg;

var

hReg: TRegistry;

hBool : bool;

strPath : String;

strRegPath : String;

begin

if IsNT then begin

strRegPath := 'Windows NT';

strPath := 'c:WINNTfonts';

end

else begin

strRegPath := 'Windows';

strPath := 'c:Windowsfonts';

end;

try

hReg := TRegistry.Create;

hReg.RootKey := HKEY_LOCAL_MACHINE;

hReg.LazyWrite := false;

hReg.OpenKey('SoftwareMicrosoft'+ strRegPath + 'CurrentVersionFonts',

false);

if hReg.ReadString('휴먼각진옛체 (TrueType)') <> '' then Exit;

hReg.WriteString('휴먼각진옛체 (TrueType)','HMKMCOLD.TTF');

finally

hReg.CloseKey;

hReg.free;

end;

//Add the font resource

AddFontResource(PChar(strPath + 'HMKMCOLD.TTF'));

SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);

//Remove the resource lock

RemoveFontResource(PChar(strPath + 'HMKMCOLD.TTF'));

SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);

end;



1  COMMENTS
  • Profile
    하눌이 2001.12.04 06:34
    하눌이 wrote:

    > 팁에서 찾아서 Truetype글꼴을 등록하는것을 적용했으나, 설치완료후에

    > 제어판의 글꼴에는 등록이 된것같은데,워드패드에서해당글꼴을 찾을 경우 나오질 않습니다.. 어케하면 조을까요...

    >

    > procedure SetFontReg;

    > var

    > hReg: TRegistry;

    > hBool : bool;

    > strPath : String;

    > strRegPath : String;

    > begin

    > if IsNT then begin

    > strRegPath := 'Windows NT';

    > strPath := 'c:WINNTfonts';

    > end

    > else begin

    > strRegPath := 'Windows';

    > strPath := 'c:Windowsfonts';

    > end;

    > try

    > hReg := TRegistry.Create;

    > hReg.RootKey := HKEY_LOCAL_MACHINE;

    > hReg.LazyWrite := false;

    > hReg.OpenKey('SoftwareMicrosoft'+ strRegPath + 'CurrentVersionFonts',

    > false);

    > if hReg.ReadString('휴먼각진옛체 (TrueType)') <> '' then Exit;

    > hReg.WriteString('휴먼각진옛체 (TrueType)','HMKMCOLD.TTF');

    > finally

    > hReg.CloseKey;

    > hReg.free;

    > end;

    > //Add the font resource

    > AddFontResource(PChar(strPath + 'HMKMCOLD.TTF'));

    > SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);

    요부분을 주석처리하면 되네요.. 난 바보야...!!!

    > // Remove the resource lock

    // RemoveFontResource(PChar(strPath + 'HMKMCOLD.TTF'));

    // SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);

    > end;

    >