Text Formatting question
paul_one
18 Apr 2009, 04:58Erm, I've tried searching the Quest Docs on this, but can't find anything.
Perhaps someone has come across this before, perhaps it's on Alex's list even.
When displaying text in Quest, there are symbols it can't display (less than, greater than) - which can be accessed via "$symbol(lt)$" or "$symbol(gt)$" respectively ..
When you want a hash or percentage sign, you double it up:
## prints out "#", %% prints out "%".
Now what about the "Pipe" character ?
| is used for text formatting (bold, italic, etc) - but if you want to print out (verbatim):
"[ Y | N ]"
How do you (without using a text block - which has just sprung to mind as a possibility although I'm not sure) print out a pipe character?
Perhaps someone has come across this before, perhaps it's on Alex's list even.
When displaying text in Quest, there are symbols it can't display (less than, greater than) - which can be accessed via "$symbol(lt)$" or "$symbol(gt)$" respectively ..
When you want a hash or percentage sign, you double it up:
## prints out "#", %% prints out "%".
Now what about the "Pipe" character ?
| is used for text formatting (bold, italic, etc) - but if you want to print out (verbatim):
"[ Y | N ]"
How do you (without using a text block - which has just sprung to mind as a possibility although I'm not sure) print out a pipe character?
Overcat
18 Apr 2009, 10:25I don't think you can print a pipe character using a text block, either, since you can now use text formatting codes in them.
Beyond that, I have no idea.
Beyond that, I have no idea.

paul_one
18 Apr 2009, 12:02I hope Alex revises this formatting and simplifies it down neatly.
| could be treated as an escape character (or better yet, \ could), and the character after that used for determining what is to be produced.
So instead of "##" "\#" would be used.
I can't quite see how HTML-style formatting will fit in, especially seeing as how < and > can't be used inside a text string (with the "escape character" idea, you'd use \G \S - "greater than, smaller than" - or something like that).
Just seems bizarre that we have 3 different methods for processing a character for output (function, ## and %% or |cb)
There's 52 letters in the English alphabet, 120-something plus using ascii.
I'm sure we can assign sane meanings to all of them for this purpose (and yes, it does strike close to your colour idea Overcat).
| could be treated as an escape character (or better yet, \ could), and the character after that used for determining what is to be produced.
So instead of "##" "\#" would be used.
I can't quite see how HTML-style formatting will fit in, especially seeing as how < and > can't be used inside a text string (with the "escape character" idea, you'd use \G \S - "greater than, smaller than" - or something like that).
Just seems bizarre that we have 3 different methods for processing a character for output (function, ## and %% or |cb)
There's 52 letters in the English alphabet, 120-something plus using ascii.
I'm sure we can assign sane meanings to all of them for this purpose (and yes, it does strike close to your colour idea Overcat).
Overcat
18 Apr 2009, 12:24...assign sane meanings to all of them for this purpose...
Especially if the scripter can assign them him/herself. (Unless that's what you meant.) It's one thing to have them hard-coded, and another to have them mutable. Perhaps they could have default assignments but could be overwritten by the scripter.
paul_one
19 Apr 2009, 12:40.. They should definitely NOT be able to be changed by the coder..
What would be the purpose of switching \r with \g ?
You wouldn't be adding functionality at all - you'd be over complicating the Quest player, and causing the text formatting to become unreadable without you knowing exactly how it's switched.
The whole reason for formatting codes is that there's one standard way to do so (look at the echo command, or C output codes, perl, python etc)so that everyone can read and write the SAME thing.
NOTE: I am not against "operators" being overridden (ie : std::cout << "hello" << std::endl ) since they simplify code and also add a more graphical flow of the code.
Allowing a user to "switch" around \[x] codes would not provide anything similar.
What would be the purpose of switching \r with \g ?
You wouldn't be adding functionality at all - you'd be over complicating the Quest player, and causing the text formatting to become unreadable without you knowing exactly how it's switched.
The whole reason for formatting codes is that there's one standard way to do so (look at the echo command, or C output codes, perl, python etc)so that everyone can read and write the SAME thing.
NOTE: I am not against "operators" being overridden (ie : std::cout << "hello" << std::endl ) since they simplify code and also add a more graphical flow of the code.
Allowing a user to "switch" around \[x] codes would not provide anything similar.
Overcat
19 Apr 2009, 13:08The whole reason for formatting codes is that there's one standard way to do so (look at the echo command, or C output codes, perl, python etc)so that everyone can read and write the SAME thing.
I see what you're saying. I wasn't thinking clearly!

This would be cool:
set color <c1; 100909>
set color <c2; FF0909>
set formatter <f1; |c1|b>
set formatter <f2; |c1|xb>
...
msg <|f2Joe: |f1Hello.>
paul_one
19 Apr 2009, 14:43Yes, you're talking about "styles" there
.
So, I'd prefer:
.. the f and h formatting do something (like default font and highlights the text - or something to be defined) and the \*[] changes the colour (RGB hex).
You'd then use this in your text:

So, I'd prefer:
style <name1; \f\h\*[a1a1a1] >
style <name2; \f\h\*[b2b2b2]>
.. the f and h formatting do something (like default font and highlights the text - or something to be defined) and the \*[] changes the colour (RGB hex).
You'd then use this in your text:
msg <default \s[name1]style is now name1 \s[name2]style has changed again!\B This is in bold\b - and this isn't.>
Freak
19 Apr 2009, 15:24Doing it that way has potential ambiguity problems.
paul_one
20 Apr 2009, 00:08Which part would be ambiguous?
If you mean there's already a "style" type, then I really just used it to show my POV - not for any real-case use.
hmmm, oh a thought just popped into my head - you can already do this... using strings!
.. so if you set a string like so:
You can use them in your output to format it the way you'd like (so no need for styles).
If you mean there's already a "style" type, then I really just used it to show my POV - not for any real-case use.
hmmm, oh a thought just popped into my head - you can already do this... using strings!
.. so if you set a string like so:
set string <default; |cb|xb|xi|xu|s0>
set string <style1; |cr|s2|b>
You can use them in your output to format it the way you'd like (so no need for styles).
Overcat
20 Apr 2009, 00:31hmmm, oh a thought just popped into my head - you can already do this... using strings!
Nice!