News:

Want to praise Simutrans?
Your feedback is important for us ;D.

Recent posts

#21
[FR]Français (French) / Re: Matériel Français
Last post by MF67_G3059 - April 12, 2024, 10:53:10 AM
quel plaisir de te revoir  ;D
ça marche ! Ah j'y avais pas pensé à la livrée Carmillon et en plus c'est une très belle livré XD
#22
I'm having the same issue in every map I make. Here are some things I observed
- It does not matter the year or map.
- It seems to happen more often when placing a new stop & line near the end of the month.
- The game doesn't always crash immediately, it only does so when opening a factory info window and clicking on the empty space where the missing supplier/consumer are supposed to be, early on it also seemed to happen if I kept the factory window open.

I tried debugging, and in gui_factory_connection_stat_t::infowin_event the variable target_fab is null and is being accessed. My understanding is that if another factory is not linked, its not supposed to be in fab_list, but the missing connection is still in there. So that is the cause of the crash. Looking into it more, the reason fabrik_t::get_fab(fab_list[line]) returns null is because of the is_factory flag of the associated gebaeude_t is false. I think there might be a problem in the newmonth update because of when the crashes seem to happen and that is also one of the few points where is_factory is modified. Still trying to look into it but my first time looking at the code.
#23
Extension Requests / Re: Allow fonts of different w...
Last post by prissi - April 11, 2024, 01:42:10 PM
I think the better way would be to use the bold font of the used TTF font, especially for CJK bold. Simutrans had in ancient times two fonts already. Hence, having a second bold font should be easy, one would just need a second fonts structure and loading it of course.
#24
Extension Requests / Allow fonts of different weigh...
Last post by Ranran(retired) - April 11, 2024, 09:59:09 AM
The new anti-aliased fonts look great.
As I tested it, I started to think there was still room for improvement.
Thin fonts look especially good on dialogs. Thin fonts are especially preferred in Japanese, which has complex shapes derived from China.
On the other hand, such thin fonts have poor visibility on the "main screen"(map view) of the game.

Particularly in the extended case, the station label's floating text defaults to a shadowed style with no background.
In my opinion, the readability is not very good.

I notice that Hajo has been changing their label design last year.
Quote from: _Hajo_ on February 15, 2023, 09:55:15 PM- Both can be drawn in bold style.
Hajo is growing flowers and James is renovating the shed but I would like to incorporate it.
Font innovation is a big effort, but I think the ability to use bold type can be achieved with a little more effort on top of that.
However, implementing this into individual UIs will require another discussion and effort but there is no doubt that this will lead to improvements to the UI in the future.


I took Hajo's code as a reference and tested it with extended.


Hajo used bold only in the title bar of the dialog.
I found the station label difficult to read so I changed it to bold. (This change is not included in the patch)

some notes:
Hajo was changing the file structure (display.h/display.cc), but I didn't do that to avoid confusing the changes. It was predicted that it would be easier to merge into extended.
Certainly simgraph is so bloated that it might make sense to separate it. If separation is required, it can be done later.
Some conflicts have arisen in the process of implementing aliasing fonts in Standard.
https://github.com/Varkalandar/simutrans_ts/commit/1fe397ed7173aacd6376468b2b50ef55e99b69b9
if(c == '\e') {
if(decoder.has_next()) {
utf32 c2 = decoder.next();
color = handle_color_sequences(c2, default_color);
}
continue; // nothing to see
}
This code in hajo's branch was removing the letter "e" from all text in my environment.




I submit a patch that I created for extended and modified for standard. I would appreciate it if you would consider implementing a bold font.
(Not tested with standard. It seems that the required libraries are different from extended in order to build. It was possible to build with git actions.)
This is like the first step; for example, in order to make bold text available in the UI, we need to prepare something like a bold option for gu_label_t.
Hajo also did something to make different font sizes available, but that's not included. (I hope to eventually implement it.)
First of all, we need to check whether bold fonts can be used correctly.

I can't attach the patch file, so I post the github link.
https://github.com/Ranran-the-JuicyPork/simutrans/commit/c8b3d1ac87800e1e5f00a59c5c481e03dcb31acf.patch
#25
Thank you for the correction priss.
I think now we can also test the std-r11091-aliasing-fonts branch.
#26
FYI we have had another help request about this bug on Reddit. I know that Prissi is hard at work on a new release so hopefully it's encouraging to know that there are players eagerly awaiting the bugfixes in it. Thank you also to ceeac for fixing it. :coffee:
#27
Simutrans-Extended major projects / Re: Incorporating changes from...
Last post by prissi - April 09, 2024, 02:19:01 PM
THe following code compiles also as C++20:
    NONCLIENTMETRICSW ncm;
    ncm.cbSize = sizeof(NONCLIENTMETRICSW);
    SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSW), &ncm, 0);
    std::wstring wsFaceName = ncm.lfMessageFont.lfFaceName;

    LPCWSTR fontRegistryPath = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
    HKEY hKey;
    LONG result;
#28
Quote from: prissi on April 09, 2024, 06:54:09 AMSeems like it is compiled with the wide char functions as default. I will add code to standard. Essentially, add a W to NONCLIENMETRICSW and to SystemParameterInfosW and change faceName to a string wsFaceName and remove the next definition.
std::wstring faceName(ncm.lfMessageFont.lfFaceName);
Thank you for looking into that.
After changing the code like this, the compilation was successful.
EDIT: This change seems to cause an error in git action.

Note that if you upgrade MSVC to 2022 and change it to be c++20 compliant, fontRegistryPath will result in an error, so it seems that you need to make it c++17 compliant.
#29
Simutrans-Extended major projects / Re: Incorporating changes from...
Last post by prissi - April 09, 2024, 06:54:09 AM
Seems like it is compiled with the wide char functions as default. I will add code to standard. Essentially, add a W to NONCLIENMETRICSW and to SystemParameterInfosW and change faceName to a string wsFaceName and remove the next definition.
#30
Quote from: Ranran(retired) on April 05, 2024, 02:26:44 PMBut for some reason I was not able to properly incorporate dr_get_system_font() in my environment.

I don't understand why this function doesn't work with the same code as standard.
It turns out that this is due to C++20 being a requirement. I was able to compile correctly with git action.
There is currently a problem with initial font retrieval as this cannot be tested properly.