[Lazarus] Fonts

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Wed Jul 21 10:15:06 CEST 2010


On Tue, Jul 20, 2010 at 2:50 PM, Kjow <antispammoni at gmail.com> wrote:
> I'm developing a multiplatform app and I need to have the same look on
> all OS. Is it possible to include a my personal font in the Lazarus
> compiled binary to have the same graphic/size/etc on all OS?

Putting the font in the executable and reading afterwards should be
the easy part. You can either use a .RC file or a .LRS file and there
are APIs to retrive this. Not sure where this is documented. Lazarus
uses this, so it should work very well.

Now the problem would be that I don't know if we currently support
loading a not-installed font from a file in TFont. You would need to
check that. If we don't, then we need a new function
TFont.LoadTTFFontFromStream / LoadTTFFontFromFile, and it will need a
per-widgetset implementation to connect this font stream with the
widgetset.

The other solution would be placing your font file in the adequate
place where system fonts should be. Your installer should do it. For
unix systems you can implement "make install" to do that too, besides
the traditional deb / rpm packages.

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list