use SDL TTF without needing X Windows
|Reported by:||paul.wratt||Owned by:||PulkoMandy|
this is a fix that unbinds Grafx2 from X Windows (on Linux/Unix), allowing console use of any font SDL_TTF can read (not just TTF)
The original code locks in the use of X Windows by querying the fontpath array, however nowadays "built-ins" is the primary and cant be resolved without further coding.
Solution, provide a directory tree iterator that is fed a path where fonts are know to live in common Nix distributions (Solaris, Debian, etc)
provided here are the two (2) modified files, and a 3rd that dumps your X Windows FontPath array (from a console under X Windows).
The principle of the modifications basically search the entire tree "one-up" from what is shown for fontpath, which (mostly) by default will be your actual root font folder (eg /usr/share/font instead of only /usr/share/font/ttf/cyrillic)
SDL_TTF can read and render TTF, OTF, BDF, PCF, Windows FON plus others. This needs to be further researched so "Add_font()" can be updated to ALL formats, not just the common ones. A user provided fontpath supplied on the command line should be added to the array as well.
The result allows use of TTF (and other) under console and X Windows
NOTE: the default path currently set for Atari ST systems is non-standard, more commonly found in C:\GEMSYS\FONTS or C:\GEMSYS\TTF or similar. Use of SDL_TTF and an FontPath Array with an additional command line option would assist a default installation without need for source changes/edits.