News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Optional: Station names with shaded text instead of background color

Started by Spike, November 02, 2010, 03:03:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Spike

I'd like an option to display station names as shaded text (e.g. white text with a one pixel dark shadow around it), instead of the rectangular labels.

This sort of display would obstruct less of the players view, and still be readable.

Dark shadow can be coded by simply drawing the same text with one pixel offset in x and y direction in dark color before drawing the text in the light color.

prissi

I tested it and found it very hard to read for forest background or over an animated sea.

Maybe one can thinck about a configure option.

Also shadows do not work well for far east characters.

Spike

Quote from: prissi on November 03, 2010, 12:14:36 AM
I tested it and found it very hard to read for forest background or over an animated sea.

A pity. I'd have expected that a 4 direction shadow (left, top, right, bottom) helps, but I also know that some backgrounds still make text hard to read. It's not urgent, but I'd like it for pak.Excentrique.

Thank you for investigating the option :)

prissi

The problem is, that the player color must be somehow included. Thus green or blueish colors are badly visible near normal ground or sea. But I think one could esperiment further.

felo

White letters with a yellow border are easier to read or yellow letters with black border.

prissi

But how include the player color for the owner of the station?

Spike

Maybe one of these would work:

- Brightest player color with black shadow.
- Darkest player color with white shadow.
- White text with bright player color top-left shadow and dark player color bottom-right shadow.

If all of those are unreadable, we're probably out of luck.

felo


prissi

Then you can use the box already there ...

THe best I could do was this:

void display_ddd_proportional[_clip](KOORD_VAL xpos, KOORD_VAL ypos, KOORD_VAL width, KOORD_VAL hgt, PLAYER_COLOR_VAL ddd_farbe, PLAYER_COLOR_VAL text_farbe, const char *text, int dirty)
{
PLAYER_COLOR_VAL pc = (ddd_farbe & 0xFFF8)+1;
if(  text_farbe==COL_BLACK   ) {
text_farbe = ddd_farbe+5;
ddd_farbe = COL_BLACK;
}
// display_text_proportional_len_clip(xpos + 1, ypos - 6 + (12 - large_font_height) / 2, text, ALIGN_LEFT | DT_CLIP, pc+7, -1);
display_text_proportional_len_clip(xpos + 3, ypos - 4 + (12 - large_font_height) / 2, text, ALIGN_LEFT | DT_CLIP, pc, -1);
display_text_proportional_len_clip(xpos + 2, ypos - 5 + (12 - large_font_height) / 2, text, ALIGN_LEFT | DT_CLIP, text_farbe, -1);
}


Producing the image below. Imhow, Name are hard to read in towns, du to many different colors. But there is not much effort in making drawing dependent on simuconf.tab entries.

Spike

Looks good enough to me. Thank you for the support, Prissi.

I was thinking about more shadow, though (if I understood the color logic right - shadow is supposed to be dark, preferably black, and text in player color, bright?):

display_text_proportional_len_clip(xpos + 1, ypos - 5 + (12 - large_font_height) / 2, text, ALIGN_LEFT | DT_CLIP, pc, -1);
display_text_proportional_len_clip(xpos + 3, ypos - 5 + (12 - large_font_height) / 2, text, ALIGN_LEFT | DT_CLIP, pc, -1);
display_text_proportional_len_clip(xpos + 2, ypos - 4 + (12 - large_font_height) / 2, text, ALIGN_LEFT | DT_CLIP, pc, -1);
display_text_proportional_len_clip(xpos + 2, ypos - 6 + (12 - large_font_height) / 2, text, ALIGN_LEFT | DT_CLIP, pc, -1);

display_text_proportional_len_clip(xpos + 2, ypos - 5 + (12 - large_font_height) / 2, text, ALIGN_LEFT | DT_CLIP, text_farbe, -1);


I have no C++ developement environment these days which can compile Simutrans, so I can't test this myself. But the screenshot looks good enough to me alreedy, so if further testing is too much work, I'll happily take the version that you demonstrated there :)

felo

Code:

display_fillbox_wh_clip(xpos - large_font_height, ypos - halfheight - hgt, large_font_height, halfheight * 2, ddd_farbe, dirty);

display_text_proportional_len_clip(xpos + 1, ypos - 5 + (12 - large_font_height) / 2, text, ALIGN_LEFT | DT_CLIP, COL_BLACK, -1);
display_text_proportional_len_clip(xpos + 3, ypos - 5 + (12 - large_font_height) / 2, text, ALIGN_LEFT | DT_CLIP, COL_BLACK, -1);
display_text_proportional_len_clip(xpos + 2, ypos - 4 + (12 - large_font_height) / 2, text, ALIGN_LEFT | DT_CLIP, COL_BLACK, -1);
display_text_proportional_len_clip(xpos + 2, ypos - 6 + (12 - large_font_height) / 2, text, ALIGN_LEFT | DT_CLIP, COL_BLACK, -1);

display_text_proportional_len_clip(xpos + 2, ypos - 5 + (12 - large_font_height) / 2, text, ALIGN_LEFT | DT_CLIP, COL_LIGHT_YELLOW, -1);

Fabio

I really like this version:

much better than the present time box.

inkelyad


Combuijs

Quotemuch better than the present time box.

No, it is unreadable in certain circumstances.

Felo's proposal seems to work better, but that can be coincidence, because it depends on the colors used in the backgrond.
Bob Marley: No woman, no cry

Programmer: No user, no bugs



prissi


skreyola

I like both the income-like player color shadows and (to a lesser extent) the box beside. Some suggestions:
Allow these two and the current box using a conf.tab entry.
For income-like shadow, I think 2px instead of 1px shadow would be better.
For the box beside, give it a shadow (darkest player color shade) or a black border (white for dark colors).

And another idea:
The player color could be a box behind only the first character of the station instead of before the name.
--Skreyola
You can also help translate for your language with SimuTranslator.

felo

What I propose is the yellow letters with black border.
The letters or the border color can not depend on the player color, because there are combinations that are impossible to read.
We also have to avoid combinations of red with blue and yellow with green because color blindness is more common than believed.
The combination that I propose is the one used in the captioning of movies in my country, almost all the movies that get in my country who are not are native spanish language are subtitled, so I can say that this combination is best read on almost all background.

[ES]
Lo que propongo son las letras amarillas con el borde negro.
Las letras o el borde no pueden depender del color del jugador, porque hay combinaciones que son imposibles de leer.
Además hay que evitar las combinaciones de rojo con azul y amarillo con verde porque el daltonismo es mas común de lo que se cree.
La combinación que propongo es la que se usa en el subtitulaje de las peliculas en mi país, casi todas las peliculas que ponen en mi país que no son de lenguaje español nativo son subtituladas por lo que puedo decir que esta combinación es la que mejor se lee sobre casi todos los fondos.

prissi

Yes, but we need to see who is the owner of a station. Thus using player color is needed.

felo

Using a small block or symbol with the color of the player and the black border at the beginning of the name for example.

Spike

Obviously the impression of "readable" differs much. Screens that looked "good enough" to me, were labeled "unreadable" by others. So I assume it will be hard to find a common agreement.

Two remarks:

- Maybe the labels do not need to be in player color. The station buildings should be player color already, and the owner can be guessed from them.

- Maybe perfect readability is unachievable in all cases. I'd suggest brightest player color with 4 direction black shadow as a compromise for the option. This will be readable in _many_ cases, and people who have troubles with it, can still use the old label background option.

The second options has these benefits:

- Black shadow makes the text readable in many environments.
- Text only display obstructs player view less than label background.
- Brightest player color has biggest possible contrast to black shadow.
- Use of player color makes station ownership obvious.
- No problematic color combinations for color blind people, works with light-dark contrast.

I'd assume this is a good compromise for the new option. I don't think we get something much better easily. Before this is talked to death again, and the option will not be made at all, I'd like to see the option implemented with the described benefits.


Lmallet

Quote from: Hajo on November 08, 2010, 03:27:16 PM
Obviously the impression of "readable" differs much. Screens that looked "good enough" to me, were labeled "unreadable" by others. So I assume it will be hard to find a common agreement.
I was thinking the same thing.  Maybe the "hide station names" key could be changed to support 3 states, so either off, with background colour, and without background colour?

PS.  I really like Felo's version.


prissi

In night mode yellow screams visually at me ... but check for yourself: The next nightly will have all three versions to cycle through with "!" (temporary of course).

skreyola

Personally, I don't like the block-beside mode. That's why I think it should be an option. The screenshots imply that someone has gone to the trouble of coding each of the options, so I think the player should be able to choose.
As to some combinations being unreadable in a shadow version, I think that is not a problem, because the player can change the colors so they are readable, or use one of the other options for station name display.
And prissi has a good point. A high-intensity color will be distracting.
--Skreyola
You can also help translate for your language with SimuTranslator.

Isaac Eiland-Hall

Wow. I really like the block-beside option.

I have a couple of ideas:

1. Instead of only the solid primary colour ( [_] ), perhaps use both, diagonally ( [ / ] )

2. Perhaps calculate the text colour from the primary colour, but make it bright in the daytime, and dim with night

Fabio

I don't like the block-beside option, instead.
Maybe with Isaac's suggestion of diagonal it could improve, and I would also make it shadowed like the text.

Instead, I would like better brightest player-colour text + black shadow.