[lazarus] is there a font problem?

Stefan Weber weber at freestyling.de
Mon Jun 9 10:47:43 EDT 2003


Tony Maro wrote:

> What I found is that all fonts by default try to go with the user's GTK
> theme, but if you try to programmatically change a font, they don't
> change.

That's what I experienced and why I thought there was an error.

> Unfortunately many people don't have a real working GTK theme
> (users of only KDE for instance), making it hard to read.  I've had some
> users be able to work around this by creating a .gtkrc file by hand.

Mayme mine is broken ... I'll have to check that.

> When I designed the checkbook control for CBT I learned that custom
> drawing my own fonts onto the control's canvas worked perfect though...

Having read this I tried the same and it worked.

> Specifically it would be nice if the TLabel component would respond to
> custom font definitions instead of only the GTK theme default.  That
> would make headers and such easier to create, and the labels would be
> more predictable in relation to size and spacing, even if not quite
> gnome compliant.
>
> -Tony

Well I don't know much about GTK and even less about Gnome. As a Delphi
programmer I was confused by the fact that changing the TLabel.Font in
the Object Inspector doesn't do anything.

I understand that it is sensible to default to the theme font, but it
should be possible to override it or some of its properties while keeping
the others, e.g. if I need a bold label.

Anyhow I find it misleading that a font selected in the object inspector
is stored inside the Name property in the .lfm but has no effect.

Maybe this could be accomplished through a new property similar to the
ParentFont property e.g. "DefaultFont". If set to true no properties
would get streamed to the .lfm and the properties would be locked
to the default values.

> Mattias Gaertner wrote:
> >The font support of the gtk-interface is not complete. And of course
> >it is a lot of work to complete it.
> >Maybe you can tell me the exact fonts and
> >features you need and I can try to improve some things.

For my layout engine I need access to accurate text metric information
like Ascent, Descent, Leading and Width in order to line up everything
on a base line.

I've looked into the GetTextMetrics stuff and experimented a little with
it and it looks promising ...

-Stefan






More information about the Lazarus mailing list