Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow basic inline styling pychan widgets with text #599

Open
ChrisOelmueller opened this issue Nov 4, 2011 · 4 comments
Open

Allow basic inline styling pychan widgets with text #599

ChrisOelmueller opened this issue Nov 4, 2011 · 4 comments

Comments

@ChrisOelmueller
Copy link
Member

When working with larger strings, we from time to time would like to have parts of it set in bold or italics.

As pychan already uses syntax like [br], a BBcode-like syntax might work (some [b]bold[/b] text). Every other approach will also work as long as it only depends on the widget text attribute (important for i18n).

Possibly requested features would also include changing font size for parts of the label, but this will cause a lot of layouting trouble I guess, so it's not critical right now.

Not sure whether this also belongs in here, but we'd have use cases where displaying an image ''in'' a Label would make sense (huge logbook pages are implemented as wrapping Labels, we use them to tell scenarios, so some images or icons would be cool).
A way to implement this would be creating sufficient amounts of newline whitespace in the actual Label and then place an Icon in that spot in another step.

@ChrisOelmueller
Copy link
Member Author

SDL_TTF seems to allow any combination of the masks BOLD, ITALIC, UNDERLINE, STRIKETHROUGH and the regular font shape NORMAL.

http://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf_22.html

I propose the tags [b]bold[/b], [i]italics[/i], [u]underlined[/u] and [s]strikethrough[/s] to go with those styles mentioned above.

@prock-fife
Copy link
Member

.

@helios2000
Copy link
Member

I think that could be a useful feature. But it is only possible for the whole text of a widget.
The design of Fifechan requires the use of containers to implement something like this. The same applies for font colors, sizes and particularly icons and images. A Label is only a simple widget that can hold and render a string.
Besides from that, it is than only possible for TTF and not for Image Fonts. It does not bother me but it should be an known issue.

@LinuxDonald LinuxDonald removed this from the 0.4.0 milestone Dec 4, 2016
@helios2000 helios2000 added this to the Fifechan function milestone Jan 22, 2017
@helios2000
Copy link
Member

It's partially possible. But needs a better interface for clients or maybe a new Widget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants