denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Denemo-devel] Windows Font, API Call


From: Richard Shann
Subject: Re: [Denemo-devel] Windows Font, API Call
Date: Sun, 07 Feb 2010 09:42:35 +0000

That's interesting.
This would be the thing to use if the application needed to access a
font that it was getting dynamically (e.g. downloading from denemo.org).
Hopefully we can get the normal font installation thing working. It
would be a little inelegant to install code to do this for a font that
is being provided with the installation, of course.
I have never come across a problem with installing LilyPond and finding
fonts uninstalled, and at the worst we can surely get the same
installation as denemo.ttf working for fetta.ttf...
Richard



On Sun, 2010-02-07 at 00:33 +0100, address@hidden wrote:
> Hi.
> 
> I just stumbled upon this. Its unverified but could be nice to have. No
> more trouble with fonts. Maybe this is even possible without
> admin-rights.
> 
> I just included the Delphi example as it was written. Don't know if it
> helps
> 
> Quote:
> 
> There's a windows API call "AddFontResource" (and a companion
> "RemoveFontResource") which can temporarily enable a font from any
> directory. Either should be followed with a WM_FONTCHANGE to all top
> level windows to make the font immediately available.
> 
> Here's the Delphi thread that executes adding portable fonts in
> geek.menu:
> 
> procedure TRegisterFontsThread.Execute;
> var
> srchRecord: TSearchRec;
> baseDir: string;
> begin
> baseDir := ExtractFileDir(Application.ExeName) + '\Data\PortableFonts\';
> if FindFirst(baseDir + '*.ttf',faAnyFile,srchRecord)=0 then
> repeat
> AddFontResource(pAnsiChar(baseDir + srchRecord.Name));
> until FindNext(srchRecord)<>0;
> FindClose(srchRecord);
> sendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0 );
> end;
> 
> 
> 
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/denemo-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]