Hi again, ok, just for fun, here's a patch to a basic functional version...(and the modified files in case patch is not working acording to plans...) it's tiny modifications to src/highlighting.c and src/highlighting.h :D
once the patch applied you should be able to add to styling sections of filetypes.whatever a font name, and a font size... in that fashion: a_style=fg_color;bg_color;bold?;italic?;fontname;font_size
I've attached a filetype example to see how to use... if you leave it the way it is...then you just get the usual highlighting...
I've only tested it with Python and C....
as mentionned earlier, if you change the default font during a session, it will break the custom styling for the duration of the session.... i'll work on that...
later on I'll provide extra options to change margin sizes, markers and such....
let me know if it works
cheers, jimmy
2009/5/8 Jimmy Paillet jimmy.paillet@gmail.com
nevermind...just used a strcpy...went just fine... i'll probably make decent advances now... cheers j
2009/5/8 Jimmy Paillet jimmy.paillet@gmail.com
Hi,
I think i can express it clearly now.... this my GeanyLexerStyle:
typedef struct GeanyLexerStyle { gint foreground; /**< Foreground text colour, in @c 0xBBGGRR format. */ gint background; /**< Background text colour, in @c 0xBBGGRR format. */ gboolean bold; /**< Bold. */ gboolean italic; /**< Italic. */ gchar* font_perso; /** A font name*/ gint font_size; } GeanyLexerStyle;
in get_keyfile_style, this struct is filled (as least for c)... thanks to a gchar** list... pointing to the [styling] sections of filetypes.foo
of course at the end of this function, list is free'd....so my pointer font_perso points to crap outside the func...hence my pb... :D when I comment out the free statement, thinhs behave logically...
what do you reckon? free the list variable later on?
jimmy
2009/5/8 Enrico Tröger enrico.troeger@uvena.de
On Fri, 8 May 2009 18:26:15 +0200, Jimmy wrote:
functions...i'm facing pointer pbs, basically...my font name does not propagate properly through functions...
If you need help for a specific problem, just ask.
ok...it's probably silly, as i'm not an experienced C programmer...and didn't spend a lot of time on it... but as I told you, I expanded the GeanyLexerStyle structure....
in get_keyfile_style and get_key_file_hex my adds to the filetypes.foo are properly read... and when i print out my new element of the struct it's either null or the fontname I've just entered in the file....
but when i try to access my new entry in a another function (such as set_sci_style), it has been obviously been written over by something
Hard to say without any code but it sounds like the char* pointer is either freed in between or it's a static string which is only valid within a function. Just create a diff of your current code and send it to the list or me or some paste bin or whatever.
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.asc
Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel