-
Notifications
You must be signed in to change notification settings - Fork 25
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
Missing non-breaking spaces at the deck preview widget. #234
Comments
Looks like this could be solved by just adding non-breaking space markup entry to cairo.cpp and use it in deck_preview_widget.cfg EDIT: Nope, taking that back. It's not that simple 😅 |
I'd try to create two strings, one for the school analysis and the other for spell-creature-land analysis, then replace all spaces by It'll break anyway once added RTL languages. 😅 |
I already split the big string into two separate strings. I just don't know how to properly implement non-breaking space. The strings use anura's own markup languag implementation and I'm not sure if it supports non-breaking space. |
I never did before. I tried to create a non breaking space by passing
It seems the engine eats the input, hopefully doing the wanted thing. What do we do here?
If you try both I think that could be a right clue. Ask any doubt it still remains or this raises... |
What kind of problem using Also all these markup expressions of non-breaking space seem to produce a space with various sizes, but all these spaces are not the non-breaking ones. And I tried both the commands you suggested at the end of your comment and they seem to produce slightly different result. After using |
I get:
Oops, bad idea then. Maybe use two texts instead of only one, unless everything fits in one line? |
Right now the text on the widget is separated into 4 parts:
All of these fit well except for the second one (we know that) and I'm not sure how to fix this really. |
I think there are a number of ways: # 1: I was hoping we can create any number of canvases. Maybe this is worth trying. But canvases are large to work with, I'd say also not the easiest part of the FFL toolset. # 2: If canvases overlap is not supported, or is not working for some other reason, we could use an implementation of the line break HTML tag I believe to read in https://github.com/anura-engine/anura/blame/trunk/src/xhtml/xhtml_element.cpp#L176-L180. I can't make it work. Maybe it worked but broke, maybe it's half baked, I don't know. # 3: I still think the plan could work. Look at this larger example:
That's breaking, OK it's surely working as it should. Let's insert a non-breaking space:
The non breaking space prevented the break, that's nice. So the idea could work! Alright, I get one of your points now. The space is doubled. That's no good. Maybe that's simply a rendering issue of the console. Been sighting similar cases because, we know, our own locale only nonASCII characters (as č or ñ)... console doesn't handle them perfectly. I suspect of something about wide chars being interpreted as plain old chars, but I don't know. Maybe the issue is not actually occurring to a canvas printing text using a TTF with typical large Unicode support? Did you try this? Let's suppose the worst case and the space is rendering doubly, or badly for some other reason, when actually rendering the text in the canvas, while running the game. # 3.1: Then there would be a simple FFL fast workaround to it. What about..?
https://www.youtube.com/watch?v=bjxf-eQWKoo Tada! Double space gone. This is quite unoptimal, maybe a bit convoluted, surely not the tersest way, worst of all taking advantage of an excessively simplistic example; but to illustrate a possible last resort alternative. Many times there is an easy-to-code FFL block you can use for temporarily fixing whatever ugly stuff obstructing. |
There was an error I fixed and now the example can be run in the console without getting a brackets balance error. |
Example: pic at #230 (comment), the creature icon is separated from the
30
by a standard space, a breaking is required, and happens at a wrong place.Future proof explanation.
It currently can arrange as:
That's ugly. It should better arrange as either:
Or better yet, if possible:
The text was updated successfully, but these errors were encountered: