+ WIP Makefile updates to support building for OS/2
- TODO: Makefile needs SYSNAME test to detect OS/2 (Bill has asked Elbert)
+ Added "__declspec(dllexport)" (via new "TX_EXTERN" #define'd in
`tp_magic_api.h`) to public function definitions in Magic tools
- WIP: So far just "Mirror/Flip" plugin
- TODO: Add "TX_EXTERN" prefix to all other public Magic tool functions
+ Renamed long Magic tool source files to have shorter filenames
- WIP: So far just "Mirror/Flip" (`mirror_flip.c` -> `mirror_f.c`)
- TODO: Rename all other magic tool source files.
h/t Elbert Pol for providing info and some diffs!
h/t Shin-ichi for reporting the warning
warning: the comparison will always evaluate as 'true' for the address
of 'filename' will never be NULL [-Waddress]
e.g., for Chinese Traditional, try to use the full font (that
we supply as an optional download), then try the 'subset' font
that we ship with Tux Paint.
Made sure to add our font dir (e.g., /usr/local/share/tuxpaint/fonts/)
to FontConfig's directories before trying to load uifont!
Also, update font names to match what we ship with Tux Paint.
WIP -- Would like to supply some alternatives.
The requested font & actual font loaded will be echo'd to STDOUT
when specifying the `uifont` option.
This uses Pango library directly (I was unable to convice SDL2_Pango.h
to actually notice that pango.h was #include'd before it, and expose
its SDLPango_GetPangoFontDescription() function!). This is okay,
since we want to also add a "--uifont list" option (or similar),
that will list all of the available fonts, if a user wishes to
query them. (And similar code will be added to tuxpaint-config to make
the setting available as a pull-down, rather than (or as well as) a
freeform type-in field.)
Motivation - Without SDL2_Pango, languages like Japanese,
Arabic, and Thai do not render properly. Currently, Debian
(and hence Ubuntu) do not have SDL2_Pango, so Tux Paint 0.9.28
is adversely affected. Fedora DOES have SDL2_Pango, so works well.
This also allows us to delete a lot of ancient cruft code.
Closes https://sourceforge.net/p/tuxpaint/bugs/268/
h/t Pere
(INSTALL docs to be updated momentarily)
Also, add other social media accounts to list of places to
announce Tux Paint in RELEASE docs.
Also, list a ton more options missing from default example config file
"src/tuxpaint.conf"
Previously Pango loaded system-supplied fonts instead, which could lead
to fonts not rendering in a human-readable text. This change fixes
https://sourceforge.net/p/tuxpaint/bugs/265/
Like so --
find . -name "*.c" -or -name "*.h" -exec indent -nbfda -npcs -npsl -bli0 --no-tabs {} \;
The `indent` invocation differs from the last one noted in
CHANGES.txt (from 2006!?), in that I've added "--no-tabs",
to ensure indents are all space-based.
Minor fixes from merging the master (SDL1) branch:
- KMOD_META in SDL1 is KMOD_GUI in SDL2. Changed.
- loadfonts() requires additional arguments in the SDL2 branch. Added.
Catching up with latest devel
Still things to solve/do:
Apply label seems to not work, neither in master
Onscreen keyboard size doesn't perform as in master
Test on other OSs, Windows, Android, ...
Following warnings still remain so far.
src/tuxpaint.c:199:2: warning: #warning "Attempting to define strcasestr(); if errors, build with -DHAVE_STRCASESTR" [-Wcpp]
199 | #warning "Attempting to define strcasestr(); if errors, build with -DHAVE_STRCASESTR"
| ^~~~~~~
src/parse.gperf: In function 'parse_one_option':
src/parse.gperf:306:45: warning: argument to 'sizeof' in 'memcpy' call is the same pointer type 'char *' as the destination; expected 'char' or an explicit length [-Wsizeof-pointer-memaccess]
306 | memcpy(offset+(char*)tmpcfg, &opt, sizeof(char*)); /* FIXME: This causes a warning; should it be 'sizeof(char)', or do we need to have the warning suppressed? -bjk 2021.10.14 */
| ^~~~
src/dirwalk.c: In function 'tp_ftw':
src/dirwalk.c:348:2: warning: #warning Failed to see DT_UNKNOWN [-Wcpp]
348 | #warning Failed to see DT_UNKNOWN
| ^~~~~~~
src/get_fname.c: In function 'get_fname':
src/get_fname.c💯3: warning: 'dir' may be used uninitialized in this function [-Wmaybe-uninitialized]
100 | snprintf(f, sizeof(f),
| ^~~~~~~~~~~~~~~~~~~~~~
101 | "%s%c%s",
| ~~~~~~~~~
102 | dir, (*name) ? '/' : '\0', /* Some mkdir()'s don't like trailing slashes */
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103 | name);
| ~~~~~
magic/src/cartoon.c:178:99: warning: unused parameter 'last' [-Wunused-parameter]
178 | static void do_cartoon(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, SDL_Surface * last, int x, int y)
| ~~~~~~~~~~~~~~^~~~
More DEBUG output. Looking into having SDL_ttf open a font,
get its name, and then see whether SDL_Pango can load it.
(If not, fall back to SDL_ttf.)
That code is not working, and "#if 0"'d out, for the moment.
Known Issues
------------
- No printing support.
- No typing support using the OS virtual keyboard. iOS needs to be signalled
to bring up the virtual keyboard when the text tool is active. We also may
need to do some finagling to make IM work with the virtual keyboard.
- OS language detection doesn't work yet.
- Quitting doesn't close the app. It just displays a black screen until it is
force-closed.
- Need to include cross-compilation instructions.
Possible Issues
---------------
- No text display. This is likely an issue with how pango and related
libraries were cross-compiled rather than an issue with Tux Paint code. From
the error output it appears to be a font rendering issue.
- SVG integration couldn't be tested because RSVG library has not yet be
cross-compiled successfully.
- Only tested under the iOS Simulator (and not on an actual iOS device yet.)
Known Issues
------------
- No printing support.
- No typing support using the OS virtual keyboard. iOS needs to be signalled
to bring up the virtual keyboard when the text tool is active. We also may
need to do some finagling to make IM work with the virtual keyboard.
- OS language detection doesn't work yet.
- Quitting doesn't close the app. It just displays a black screen until it is
force-closed.
- Need to include cross-compilation instructions.
Possible Issues
---------------
- No text display. This is likely an issue with how pango and related
libraries were cross-compiled rather than an issue with Tux Paint code. From
the error output it appears to be a font rendering issue.
- SVG integration couldn't be tested because RSVG library has not yet be
cross-compiled successfully.
- Only tested under the iOS Simulator (and not on an actual iOS device yet.)
Wrapped some debug output in "#ifdef DEBUG" tests,
and made sure some warnings and errors were going to
STDERR, rather than STDOUT.
Motivation: Less noise while launching/using Tux Paint,
unless it matters.
Running Tux Paint under macOS in Korean mode (and some other languages) causes
it to crash, unless "load system fonts" option is also enabled. Some
investigation showed the issue occurs when num_font_families is 0 in fonts.c.
This change removes the assumption from the code that assumes num_font_families
has at least one record.