How to use external fonts?

Ivan Prodanov picture Ivan Prodanov · Feb 21, 2010 · Viewed 11.1k times · Source

Is it possible to use a font directly from resources in Delphi and how?

I have a problem with the very first steps.Example I cannot include Segoe UI Light font in resources of a project,an exception occurs.And that is only if the file's extension is 'ttf'.

If the written above is not possible then how do I use an external font without deploying the font separately(from executable)?

Thanks in advance!

Answer

Ondrej Kelle picture Ondrej Kelle · Feb 22, 2010

On Windows 2000 and later, you can use AddFontMemResourceEx to install fonts for your process from memory.