Currently, the departure board uses the train type as the determining factor for styling. Some private operators like Metronom, erixx, VIAS oder SBB GmbH use a three-letter abbreviation of the company name as the train type and smush the train type and line number into the line data field. This leads to RE lines being displayed in gray instead of orange, for example:
Also in the current implementation it is not possible to tell apart two-digit train numbers with long distance trains from the line numbers the HAFAS departure board can display:
Is that ICE number 72 or some train on ICE line 72?
This patch adds improvements for both of these visual issues.
If a train has a type we don't know about AND the line number starts with a train type we do know about, we can treat that as the actual train type to display:
Outside of the departure board, the assumed operator prefix is not hidden and gets added in front of the train number like this:
Train lines are now visually distinguished from train numbers. Train numbers are set in semi-bold and roman type. Train lines keep the formatting already applied to them, for long-distance trains that means italic and full bold.
The patch also allows the _format_train template to be used in all contexts and not just for checked-in statuses. It is now uniformly used in all the places that display train numbers that was able to find, including departure board and history entries. It also adds the train types RNV (displayed like STR), Schw-B (like U) and CJX (like RE) to the set of styled train types.
apropos schwebebahn: maybe instead of the very long Schw-B that leads to this big chip with line-wrapping this could be a case where using an emoji substitute can be nice?
vs
Currently, the departure board uses the train type as the determining factor for styling. Some private operators like Metronom, erixx, VIAS oder SBB GmbH use a three-letter abbreviation of the company name as the train type and smush the train type and line number into the line data field. This leads to RE lines being displayed in gray instead of orange, for example:
Also in the current implementation it is not possible to tell apart two-digit train numbers with long distance trains from the line numbers the HAFAS departure board can display:
Is that ICE number 72 or some train on ICE line 72?
This patch adds improvements for both of these visual issues. If a train has a type we don't know about AND the line number starts with a train type we do know about, we can treat that as the actual train type to display:
Outside of the departure board, the assumed operator prefix is not hidden and gets added in front of the train number like this:
![Screenshot 2024-02-15 at 20-18-22 travelynx](https://github.com/derf/travelynx/assets/46252311/3907856a-0ef7-46dc-8b21-b73a6e556693)
Train lines are now visually distinguished from train numbers. Train numbers are set in semi-bold and roman type. Train lines keep the formatting already applied to them, for long-distance trains that means italic and full bold.
![Screenshot 2024-02-15 at 19-56-33 travelynx Hannover Hbf](https://github.com/derf/travelynx/assets/46252311/218d2be5-ff29-4915-820d-0b7c1ed122da)
The patch also allows the _format_train template to be used in all contexts and not just for checked-in statuses. It is now uniformly used in all the places that display train numbers that was able to find, including departure board and history entries. It also adds the train types RNV (displayed like STR), Schw-B (like U) and CJX (like RE) to the set of styled train types.