hi,<br><br><div class="gmail_quote">2009/5/9 Enrico Tröger <span dir="ltr"><<a href="mailto:enrico.troeger@uvena.de">enrico.troeger@uvena.de</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Fri, 8 May 2009 20:59:15 +0200, Jimmy wrote:<br>
<br>
Hey,<br>
<div class="im"><br>
>ok, just for fun, here's a patch to a basic functional version...(and<br>
>the modified files in case patch is not working acording to plans...)<br>
>it's tiny modifications to src/highlighting.c and src/highlighting.h :D<br>
<br>
</div>A few notes:<br>
- Don't use strcpy() with fixed sized strings like gchar custom_font[20]<br>
this can easily lead to memory corruptions and so crashes. It's easier<br>
and safer (while being a little less performant) to use dynamically<br>
allocated strings on the heap, e.g. with g_strdup(), so<br>
gchar custom_font[20];<br>
strcpy(style->custom_font, list[4]);<br>
gets<br>
gchar *custom_font;<br>
custom_font = g_strdup(list[4]);<br>
And don't forget to g_free() these strings afterwards in<br>
highlighting_free_styles().<br>
</blockquote><div><br>yep i knew it was dodgy...ok i'll modify my stuff to get along these lines thanks<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
- if (condition)<br>
        code();<br>
looks nicer than<br>
 if (condition) code();<br>
but this is just cosmetic.</blockquote><div><br>ok<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
- I think we should add the "!" to request Pango fonts in the code,<br>
I don't think users want to use GDK fonts and mixing both is probably<br>
not possible at all and even if, it's not desirable. Furthermore,<br>
having the "!" in the filetype definition files seems error-prone<br>
because it can be easily forgotten.<br>
This is why I suggest to specify only fontnames in the filetype<br>
definition files and add the "!" directly when reading the names in<br>
get_keyfile_int().<br>
</blockquote><div><br>ok...I was just using the scintilla model here...<br>forgetting the ! does not lead to an error, it just<br>don't anti-alias your font...<br>I'm not sure who, but someone might still want to have this control...<br>
 </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
- strlen(style_ptr->custom_font) > 0<br>
can be easier written as<br>
NZV(style_ptr->custom_font)<br>
which is a little more performant and easier to read (the NZV() macro is<br>
defined in src/utils.h).<br>
<div><div></div><div class="h5"></div></div></blockquote><div><br>I didn't come across this yet...it's useful thanks<br><br>jimmy<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div class="h5"><br>
Regards,<br>
Enrico<br>
<br>
--<br>
Get my GPG key from <a href="http://www.uvena.de/pub.asc" target="_blank">http://www.uvena.de/pub.asc</a><br>
</div></div><br>_______________________________________________<br>
Geany-devel mailing list<br>
<a href="mailto:Geany-devel@uvena.de">Geany-devel@uvena.de</a><br>
<a href="http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel" target="_blank">http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel</a><br>
<br></blockquote></div><br>