Re: [Programming objects] I did something which "dia_font_get_style" doesn't like !



Jonathan CHABOISSIER wrote :
The instruction :
g_assert(PANGO_WEIGHT_ULTRALIGHT <= pango_weight && pango_weight <= PANGO_WEIGHT_HEAVY); 
in the file dia/lib/font.c line 346 makes Dia crash when I put my own object, and then try to create an other object using Text. I always have the error EXCEPT if I erased the dia default file juste before ! Does somebody knows what happen ?

I know this is not a bug, I think I just badly used something like a pointer on a TextAttribute. I am working on the Win32 Dia 0.94 cvs version.
I finally discovered what I should change in my object PropDescription to make Pango feeling good. Actually, I had chosen to change the standard Text properties :

PROP_STD_TEXT_ALIGNMENT,
PROP_STD_TEXT_FONT,
PROP_STD_TEXT_HEIGHT,
PROP_STD_TEXT_COLOUR,


into :

PROP_STD_TEXT_ALIGNMENT_OPTIONS(PROP_FLAG_VISIBLE|PROP_FLAG_DONT_MERGE),
PROP_STD_TEXT_FONT_OPTIONS(PROP_FLAG_VISIBLE|PROP_FLAG_DONT_MERGE),
PROP_STD_TEXT_HEIGHT_OPTIONS(PROP_FLAG_VISIBLE|PROP_FLAG_DONT_MERGE),
PROP_STD_TEXT_COLOUR_OPTIONS(PROP_FLAG_VISIBLE|PROP_FLAG_DONT_MERGE),


In my font properties, there was not the PROP_FLAG_DONT_SAVE anymore and my tests prove that was the thing which made Pango crash (in fact this is not a crash, but an "assert" verification which make Dia stop) ! I do not understand why, but one MUST use this flag for the Font properties (and may be the height properties too)... And because I see Dia Developers in the properties.h file wrote the PROP_STD_TEXT_FONT like that, I think they may saw this problem one day.

If your remember, I sent past weeks a mail to this list to ask why there was this flag in the PROP_STD_TEXT_XXX and Lars Clausen told me I should use the most of the time the things like there are given. So The today's advice : still use the PROP_STD_XXX :-)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]