🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #232508

How to install a font onto Windows Vista.

#232508
From: Jeffâ–˛Relf
Date: Wed, 15 Apr 2009 02:40
41 lines
2935 bytes
Speaking of how slrn should install the DejaVu Sans Mono font ..

Read_Me.TXT in www.JeffRelf.F-M.FM/X.ZIP now says:
“ X.EXE installs the DejaVu Sans Mono font, should you not have it;
  otherwise, it won't change any system ( e.g. registry ) settings.
  No installer is needed.  The DejaVu font is nice, but not required. ”.
  
>From “ www.JeffRelf.F-M.FM/X.CPP ”, my font installer looks like:

  insFont( L"DejaVuSansMono.TTF", L"DejaVu Sans Mono (TrueType)" );
      ....
insFont( LnP fileName, LnP regName ) {
  wchar_t srcNym[400], desNym[400]; LnP P = srcNym ; FILE  *fp;
  
  P += GetCurrentDirectory( 300, P ); Str( P, L"\\%s", fileName );
  fp = fopen( srcNym, L"rb" );
  if ( ! fp )
    //  No font to install, do nothing.
    return ;  fclose( fp );

  Str( desNym, L"%s\\Fonts\\%s", _wgetenv(L"WinDir"), fileName );
  fp = fopen( desNym, L"rb" );
  if ( fp ) {
    //  The font is already installed, do nothing.
    fclose( fp ); return ; }

  AddFontResource( srcNym ), CopyFile( srcNym, desNym, 0 );

  //  Update the Registry, so the font is there after a reBoot.
  HKEY Key, Key_98 ;
  RegOpenKeyExW( HKEY_LOCAL_MACHINE
  , L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"
  , 0, KEY_ALL_ACCESS, & Key );
  RegOpenKeyExW( HKEY_LOCAL_MACHINE
  , L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Fonts"
  , 0, KEY_ALL_ACCESS, & Key_98 );

  _LnP  F = _LnP( fileName );
  int Sz = strSz( fileName ) + 1 ;  Sz *= szChr ;
  RegSetValueEx( Key, regName, 0, REG_SZ, F, Sz );
  RegSetValueEx( Key_98, regName, 0, REG_SZ, F, Sz );  }
Technical Details
Message-ID: <Jeff_Relf@Seattle.2009_Apr.14|7.40pm|e>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feed.xsnews.nl!border-1.ams.xsnews.nl!news.glorb.com!news2.glorb.com!news-spur2.glorb.com!homer.glorb.com!not-for-mail
References: <b12daf2e-e90f-4f2c-9ee5-6f759c65ae74@q9g2000yqc.googlegroups.com> <20090407151408@usenet.piggo.com> <20090407152110@usenet.piggo.com> <20090414201944.659@skamandros.andrews-corner.org> <Jeff_Relf@Seattle.2009_Apr.14|1.24pm|d> <20090415085929.651@skamandros.andrews-corner.org>

Show Full Headers
Complete Article Headers
Message-ID: <Jeff_Relf@Seattle.2009_Apr.14|7.40pm|e>
Subject: How to install a font onto Windows Vista.
Date: Wed, 15 Apr 2009 02:40:46 +0000
From: Jeffâ–˛Relf <Jeff_Relf@Seattle.inValid>
References: <b12daf2e-e90f-4f2c-9ee5-6f759c65ae74@q9g2000yqc.googlegroups.com> <20090407151408@usenet.piggo.com> <20090407152110@usenet.piggo.com> <20090414201944.659@skamandros.andrews-corner.org> <Jeff_Relf@Seattle.2009_Apr.14|1.24pm|d> <20090415085929.651@skamandros.andrews-corner.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feed.xsnews.nl!border-1.ams.xsnews.nl!news.glorb.com!news2.glorb.com!news-spur2.glorb.com!homer.glorb.com!not-for-mail
Newsgroups: news.software.readers
Organization: Glorb Internet Services, http://www.glorb.com
Lines: 41
NNTP-Posting-Host: rHkC8ilpik+gnC7s6RDDMg.user.posting2.glorb.com
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@glorb.com
NNTP-Posting-Date: Wed, 15 Apr 2009 02:40:46 +0000 (UTC)
X-Mailer: hidden
X-Notice: Scanned by Mr. Bill
X-Newsreader: hidden
User-Agent: hidden