Re: Tfont



"anthony" <ajh@xxxxxxxxxxx> wrote in message
news:KbsPe.5888$iM2.579788@xxxxxxxxxxxxxxxxxx

> is it possible to turn a tFont into a string so I can save what the
> font of a certain component is
>
> I am want to store the fonts and background colors, so that when the
> appication restarts it will load the attributes for me.

Where are you storing it? I write things to the Registry; my code
uses a new key for a font and puts name, size, colour, bold, italic,
underline, and strikeout in a value each. If you're bent on having a
single string you could encode it as XML or CSS or any format of your
own devising. (CSS would be rather nice, I think.)

Windows itself saves font information in the Registry as binary dumps
of TLogFontW records. Forty lines of Pascal to decode it or possibly
(I've not tried very hard) a single CreateFontIndirect call.

It's _always_ a good time to be extending your standard library.

Groetjes,
Maarten Wiltink


.



Relevant Pages

  • Re: screen.fonts again
    ... As far as I know in a single font file ... Private Declare Function RegCloseKey Lib "advapi32.dll" _ ... ByVal lpSubKey As String, ... Dim Buffer As String, FontName As String ...
    (microsoft.public.vb.general.discussion)
  • Re: [Q]How to display Tahoma italic font
    ... I can't display Tahoma font in italic properly using ... string and incrementing XIncrement, you should do a second increment as ... character of the non-italic string that follows). ... // beginning at the specified point (XIncrement, YStart). ...
    (microsoft.public.win32.programmer.gdi)
  • Re: CListCtrl unicode doesnt display korean characters correctly
    ... Your assumptions are ok about the not described types, Strings are CString, not arrays of TCHARs ... It is a font from Microsoft. ... The korean string is in case 2. ... The LoadString method gets it from the resources. ...
    (microsoft.public.vc.mfc)
  • Re: [Q]How to display Tahoma italic font
    ... right hand normal letters overlap the last italic letter. ... other fonts, here i mean any font i've tried. ... space you need for the string. ... // beginning at the specified point (XIncrement, ...
    (microsoft.public.win32.programmer.gdi)
  • Re: File Hex View : how to improve this procedure ?
    ... OneHexLine: String; ... RichEdit With no word wrap and fixed width font ...
    (comp.lang.pascal.delphi.misc)