On Tue, 12 Dec 2006, Mattias Gaertner wrote:
> On Mon, 11 Dec 2006 21:44:29 +0200
> "George Birbilis" <[EMAIL PROTECTED]> wrote:
>
> > > Ignoring the font dialog since it's another thing (it has
> > > preview which covers the needs of the user a bit), the font
> > > name property editor (it shows a drop-down list, could show
> > > an owner-drawn one instead) would be the thing to change
> > > (once for all platforms I suppose). BTW, speaking of many
> > > platforms, how does Lazarus support "fonts" crossplatform?
> > > (does it delegate the burden onto the OS ? [since there is
> > > raster/bitmap fonts, TrueType, OpenType, PostScript etc.
> > > fonts that one could support)
> >
> > I know in Delphi one uses owner-drawn list to draw their own items
> > (in fact I had suggested Delphi Object Inspector do that many years
> > ago at Delphi newsgroups, when we had plain text dropdown lists even
> > for color names), but what is used in Lazarus? Is it the same scheme
> > or something that is maybe more crossplatform? Any online text about
> > it?
>
> The LCL provides a Delphi compatible TFont.
> The widgetsets searches the nearest font.
> The gtk interface also understands XLD font names, where the
> font name is a 15 attribute filter.
> So, basically you can select every available font under windows and
> under gtk/X. But they are not cross platform.
>
> The OI combobox is custom drawn, so it would be possible to draw every
> font. But afaik this would be quite slow and needs a lot of resources.
>
> I'm not an font expert, so I don't know, what properties are needed by
> TFont to make it cross platform (if this is possible).
You would need a font mapper. X (2 kinds of fonts), PostScript (also 2 kinds),
LateX and friends (many kinds), Motif layer, TTF font server, FreeType.
they all use some kind of font mapper, mapping name x to name y.
Usually they work with some text file containing the mapping.
But that is as far as you'll get. I think it's an illusion trying to get this
to work 100% cross-platform.
In my opinon, you can install a global hook:
TransformFont
Which can be set by some extra component which does font mapping; Prior to
selecting a system font, this hook can be called if it's set. it's then
up to the user to drop such a fontmapper on one of his forms.
You could implement a default one which does some basic translations
based on some known map files.
Michael.
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives