Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Display XML tags in font.draw
- - By mistiru Date 2015-01-02 10:58
Hello everybody,

I'm working on a project where I would like to display some code on the screen, and I would like to add syntax highlighting.
I know that Gosu::Font recognizes XML tags so I used <c> tags to change text color.

But now, I would like to display these tags on the screen, but I don't know how to escape them...

Is it possible to realize ?

Thank you in advance.
Parent - By EdwinOdesseiron Date 2015-01-02 18:41
Not sure if it'll work, and can't check atm, but wouldn't \<c> work?
Parent - - By RunnerPack Date 2015-01-02 21:24
It supports entities, e.g. "&lt;" for "<", so just substitute them for the real characters.
Parent - By mistiru Date 2015-01-03 00:37
It's working, thank you !
Parent - - By mistiru Date 2015-01-03 11:41 Edited 2015-01-03 12:28
Other question ^_^

If I want to display '&lt;' instead of '<', what should I do ?
(As for '<', is there an entity to display '&' ?)
(If there is, how can I know all those supported entities ?)

edit :
Oh, I found that those entities are HTML entities (sorry if my questions are stupid --')
So '&' would be '&amp;'.

But one question remains : How can I know the list of "things" that are converted when they are drawn ?
Parent - By jlnr (dev) Date 2015-01-03 12:56
You can't, that's a bit of a problem with Gosu currently. :( By default, Gosu only supports &lt;, &gt; and &amp;.
Up Topic Gosu / Gosu Exchange / Display XML tags in font.draw

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill