Page 1 of 1

Font Handling in TSimpleGraph

PostPosted: August 18th, 2006, 8:02 am
by kokkoras
I have two nodes (node1, node2), the font of which is set to a common TFont selected from a FontDialog. So far so good. Why comparing the font of these nodes for using different fonts returns false? That is:
Code: Select all
node1.font<>node2.font

evaluates to true. Any idea?

When a node is created the typical way, does it have it's font set to some value or it is undefined and the hostSimpleGraph.font is used? Could this be the problem?

edit: after some investigation, it seems that the font property points to some address. Comparing the way I described earlier is like comparing two different addresses. Silly me.... :oops:

Now the question is:
Do I have to compare every single property of TFont to deside if two TFont instances have the same content?

PostPosted: August 18th, 2006, 1:03 pm
by Kambiz
Initial font of each object is the SimpleGraph's font.

Yes, you have to compare every single property of the font object.

PostPosted: August 18th, 2006, 1:05 pm
by kokkoras
Kambiz wrote:Yes, you have to compare every single property of the font object.


sad but true! thanks.

PostPosted: August 19th, 2006, 11:48 am
by kokkoras
a bit off-topic question:

Is there any way to fill a combo-box with the available typefaces of a given font, like in the script combo box of the TFontDialog?

Thanks.

PostPosted: August 19th, 2006, 4:38 pm
by Johnny_Bit
every tt font has regular, bold, italic and bold italic, what more d'you want? Simply use Freetype thingie and have some fun!

PostPosted: August 19th, 2006, 8:26 pm
by kokkoras
Johnny_Bit wrote:every tt font has regular, bold, italic and bold italic, what more d'you want? Simply use Freetype thingie and have some fun!


Sorry, my intention was to ask about charsets, not typefaces. I am asking about DEFAULT_CHARSET, GREEK_CHARSET, ANSI_CHARSET, etc. Is there any way to get those for the selected TT Font?