Journal Manipulation

Announcements and discussion regarding any projects related to Cyan Worlds' Plasma Engine including (but not limited to) CyanWorlds.com Engine, Drizzle, OfflineKI, PyPRP, and libHSPlasma.

Re: Journal Manipulation

Postby Tsar Hoikas » Mon Sep 07, 2020 8:12 am

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>
Image
User avatar
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2075
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Re: Journal Manipulation

Postby JulyForToday » Mon Sep 07, 2020 11:23 am

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.
User avatar
JulyForToday
 
Posts: 118
Joined: Sat Sep 29, 2007 5:34 am

Re: Journal Manipulation

Postby Tsar Hoikas » Mon Sep 07, 2020 12:43 pm

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.
Image
User avatar
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2075
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Re: Journal Manipulation

Postby Sirius » Mon Sep 07, 2020 1:12 pm

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.
User avatar
Sirius
 
Posts: 1320
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: Journal Manipulation

Postby JulyForToday » Mon Sep 07, 2020 1:42 pm

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:
User avatar
JulyForToday
 
Posts: 118
Joined: Sat Sep 29, 2007 5:34 am

Re: Journal Manipulation

Postby Tsar Hoikas » Mon Sep 07, 2020 2:48 pm

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-)
Image
User avatar
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2075
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Previous

Return to Plasma Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron