About Store Forum Documentation Contact



Post Reply 
display text with some special character.
Author Message
mizukami Offline
Member

Post: #1
display text with some special character.
i want to display text with some special character (multi-bytes).
So, i tried...

add "Text Style" element.
add "Font" element. and these characters set into "Custom Chars".

and code below.

Code:
    TextStyle *ts_p;

    ts_p = TextStyles( UID(1485557134, 1216083411, 4256206237, 52244128) );    // Text style element
    Gui+=textTest.create("test string漢字…", ts_p).pos(Vec2(1.0f, 0.9f));

then, multi-bytes white space character (between "test" and "string") shown as "?". However "漢字…" is ok. (Screen capture attached)

What should i do?


Attached File(s) Image(s)
   
05-02-2016 04:42 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: display text with some special character.
Hi,

Could first let me know why do you need to have a different kind of space character, and not the regular space?
05-02-2016 07:06 AM
Find all posts by this user Quote this message in a reply
mizukami Offline
Member

Post: #3
RE: display text with some special character.
Our using text is written in Japanese (multi-bytes character).
So, multibytes-space is not special for us.

Reason why we don't use regular space, avoid line feed problem.
(Before that, always locates a space after all symbolic characters (like "!.,"), our rule)

Please see capture (attached).

And relational problem...

Now, EE replacing character (that cannot show) to "?".
But character "?" is usually in our text. So, it makes mistakes at scenario-writer, Debugger, and so on.

Different character can use for?


Attached File(s) Image(s)
   
(This post was last modified: 05-02-2016 08:49 AM by mizukami.)
05-02-2016 08:40 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #4
RE: display text with some special character.
Thank you for the explanation,

I've adjusted font generation source code to process full-width space correctly.
http://www.esenthel.com/forum/showthread.php?tid=9004
Now available in Source Code update on Main Branch:
https://github.com/Esenthel/EsenthelEngi...49a617f551
(Binary download has not yet been updated, only the source code)

After updating your source, and recompiling both Engine+Editor.
Please re-create your font:
Open the Font, make some change to any of the parameters in the Font Editor, and close the Font Editor window.
(without making any changes, the font will not be regenerated).

After that, it should work OK.


Quote:But character "?" is usually in our text. So, it makes mistakes at scenario-writer, Debugger, and so on.

Different character can use for?
At the moment, you can change it only by modifying engine source code:
https://github.com/Esenthel/EsenthelEngi...t.cpp#L240
Code:
case '?': sign[0]=i; break;

replace '?' with some other character.
05-02-2016 11:50 AM
Find all posts by this user Quote this message in a reply
mizukami Offline
Member

Post: #5
RE: display text with some special character.
Thanks!
05-03-2016 05:03 AM
Find all posts by this user Quote this message in a reply
Post Reply