Page 2 of 2

Re: Journal Manipulation

PostPosted: Mon Sep 07, 2020 8:12 am
by Tsar Hoikas
I took this opportunity to update the esHTML wiki page with some more details. There are still some things missing like movies and decals, but I think it's got the essentials now. Despite the wiki page being called "esHTML" please note that Plasma DOES NOT use HTML at all.

Anyway, you're looking for
<font face=Arial style=bi>

Re: Journal Manipulation

PostPosted: Mon Sep 07, 2020 11:23 am
by JulyForToday
Tsar Hoikas wrote:Anyway, you're looking for
<font face=Arial style=bi>


Ah, yes, that's the ticket! Got it working. :)

Would you happen to know whether something like style=u would work for underline? That or possibly strike-out? (assuming you had a font with underlined or strike-out versions -- something none of Uru's fonts come with out-of-the-box).
I'll have to see if I can set up a .p2f file to actually test that out. That or search through the source code.

Useful: using quotes with the style attribute <font style=""> can be used to 'turn off' the styling.

Limitation: this can't be used to style an isolated word in a line the way I can do here on the forum in BBC code by making a particular word bold by wrapping it in [ b ] or [ i ] tags.
Example:

Code: Select all
<font style=b>First styled<font style=""> and <font style=b>second styled<font style=""> then the rest of the line.

The desired result should be something along these lines:
First styled and second styled then the rest of the line.

Instead this happens:
Image

They do get styled differently, but they are drawn on top of each other (at least in PoTS).
Maybe there is some other way to terminate the styling, or a way to get around this? I don't know.

Pity about that, since being able to add emphasis to a particular word or phrase in this way is a nice way to inject a bit more storytelling or emotion into a journal.

Re: Journal Manipulation

PostPosted: Mon Sep 07, 2020 12:43 pm
by Tsar Hoikas
Unfortunately, only the options b and i are supported.

I suspect that the kerning code uses the current styling to layout the text--the journal code doesn't really take into account the previous options for figuring out where to lay things out. In other words, it was designed for each paragraph of text to use the same style options. We could fix it, but it would be a rather large undertaking, I suspect, and it would still be flawed in PotS. Considering the previous and that journals were mostly for either handwritten or typewritten content, I'm not sure how much sense it makes to spend effort on this use case.

Re: Journal Manipulation

PostPosted: Mon Sep 07, 2020 1:12 pm
by Sirius
Tsar Hoikas wrote:I took this opportunity to update the esHTML wiki page with some more details.

Cool ! :) I updated my post with a link to the Wiki page to make sure everyone goes there instead.

JulyForToday wrote:Pity about that, since being able to add emphasis to a particular word or phrase in this way is a nice way to inject a bit more storytelling or emotion into a journal.

Agreed, it's convenient when you want people to remember that balanced systems stimulate civilizations.

For real though, rendering stylized text and UI is a really difficult task, and it's usually best to embed a dedicated HTML renderer (like Chromium) and let it handle things. But this comes with a bunch of other problems, unfortunately.

Re: Journal Manipulation

PostPosted: Mon Sep 07, 2020 1:42 pm
by JulyForToday
Good to know one way or the other. This was the last piece I needed to get sorted for the first version of the clickable age (since I have a journal with all these formatting options in there)

I suppose if someone really wanted to work around that limitation, they could use text rendered to images for unusually styled lines of text. Of course that would make localization a pain. Always a trade off. :lol:

Re: Journal Manipulation

PostPosted: Mon Sep 07, 2020 2:48 pm
by Tsar Hoikas
There is actually a system in the engine that will swap out localized images based on their filename. At some point, that needs to be documented. 8-) 8-)