> > 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).
>
> I have to agree, that it is quite difficult to handle fonts
> on multiple platforms. fpGUI handles this in a very
> rudimentary way doing some basic mapping.
>
> TGfxFontClass = (fcSerif, fcSansSerif, fcTypewriter, fcDingbats);
>
> Querying the font based in any of these 4 font classes, will
> work fine cross-platform.  Specifying a specific font will
> not be 100% cross-platform.
>
> ... Each platform will implement how the font class maps to a font.
> Here is the X11 code ...
>
> class function TX11Font.GetDefaultFontName(const AFontClass:
> TGfxFontClass): String;
> const
>   FontNames: array[TGfxFontClass] of String = (
>     'times', 'bitstream vera sans', 'courier', 'symbol'); begin
>   Result := FontNames[AFontClass];
> end;
>
>
> Fonts seem to be a tricky thing to handle.  I haven't looked
> yet, but anybody know how Qt handles this on multiple platforms?

What I need to do is
1) get list of available font names (this seems to already be done by the
TFont property editor used at the Object Inspector)
2) create onwer drawn drop-down list (instead of the standard one used now
at Tfont property editor)
3) when dropdown list / combobox calls me back to draw an item (it should do
that not for all its items, but only for the visible ones if it's good dd
list implementation), I'll do:
3.1) given that item text (which is a font name), and a font size (say 8
[whatever size the rest of the OI text uses at that time - maybe this is an
IDE option?]), measure the text with that font and size the item or the
whole list (if dd list supports changing its dropdown size to fit the
biggest item or in generally be wider than the edit box / label that is
placed above the dropdown [recent dd lists in Windows GUI seem to do that,
but not sure if they're the classic combobox windows control or other new
impl by MS])
3.2) draw the item (will result in cropping it if at 3.1 no resize of list
was done)

For 3.1 & 3.2 I could use an autosizing TLabel (is it cross-platform?) I
suppose if TFont class doesn't have measure method

Will also need to look the Tcolor property editor to do how it does the
owner-drawn dropdown list

----------------
George Birbilis ([EMAIL PROTECTED])
Computer & Informatics Engineer
Microsoft MVP J# for 2004-2006
Borland "Spirit of Delphi"
++ QuickTime, Delphi, ActiveX, .NET components ++
http://www.kagi.com/birbilis
++ Robotics ++
http://www.mech.upatras.gr/~Robotics
http://www.mech.upatras.gr/~robgroup




  _____  

avast! Antivirus <http://www.avast.com> : Outbound message clean. 


Virus Database (VPS): 0657-0, 12/12/2006
Tested on: 13/12/2006 12:23:33 ??
avast! - copyright (c) 1988-2006 ALWIL Software.



_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to