Commit graph

48 commits

Author SHA1 Message Date
Mark Kim
39cc096ece iOS port initial commit
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.)
2021-03-21 23:01:49 -04:00
Bill Kendrick
91505fae8e Debug output clean-up
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.
2020-04-02 22:15:13 -07:00
begasus
e5c3cdfcf5 Haiku fixes 2019-09-06 13:45:56 +02:00
Mark K. Kim
93c1ad5dc3 Fix crash when there are 0 font families.
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.
2018-06-26 01:28:43 -04:00
Bill Kendrick
9144ebd705 More function documentation 2018-05-17 00:30:48 -07:00
Mark K. Kim
472bf79bb9 Trying again... 2017-11-27 01:02:41 -05:00
Bill Kendrick
da81a5f32a Compiler warning cleanup in fonts.c
* Use and show error on nice() return value, when appropriate.
 * Remove (comment out, for now) a function that could never be called.
2017-10-15 14:43:20 -07:00
Bill Kendrick
b693003b14 Remove some unused funcs & declarations
Removing more unused functions, and moving a declaration in fonts.h
to fonts.c, since it's not used externally (reliable_read()).
2017-10-15 14:38:52 -07:00
Bill Kendrick
81ff48ccbc indent fonts.c fonts.h 2017-10-15 10:53:55 -07:00
William Kendrick
40a1221114 Ignoring ".pfb" (PostScript 'Printer Font Binary') fonts, to avoid crashes. 2014-04-19 18:36:26 +00:00
William Kendrick
913275e144 * Removed some outdated bug-workaround-code from 2007.
* Made problemFonts[] not-Apple-specific
 * Added a description to TuxPaint_Font struct
 * Added debugging to show when a font is being closed
   (currently causing crashes with some fonts, on Win7 with
   Tux Paint 0.9.22beta01 and Kubuntu 14.04 with CVS)
2014-04-19 18:04:55 +00:00
William Kendrick
0b27bec2e8 * Squelching a lot of debugging output, unless DEBUG is #define'd
* Added "--joystick-dev" option, for specifying which joystick device
   Tux Paint should listen to
   * "--joystick-dev list" is now used to list the available devices
 * Cleaned up some 'usage' output
2014-03-30 07:23:20 +00:00
William Kendrick
e990b48de7 Large bundle of OS X tweaks by Eric P. (basis of the 10.9-compatible
pre-release made in Dec. 2013):
 * Fix OS X 10.9 issue of current directory set by Finder
   to something else than folder where app bundle resides.
 * Some Mac OS X build / project changes & updates.
 * Adjustments to Mac OS X fontconfig config file, to avoid warnings
   and make things more robust.
 * Updates to some #include's to catch up with newer library revisions.
 * Tweaks to pixel read/write on Apple.
 * Introduction of 'intprt_t' casting to avoid warnings on x64.
 * Some additional debugging output.
 * Logging stderr & stdout to /tmp/tuxpaint.log
Untested (I don't have a Mac!)
2014-03-19 23:39:17 +00:00
Scott McCreary
134b478155 Removed B_COMMON_FONTS_DIRECTORY since it's been dropped in Haiku 2013-11-05 06:09:34 +00:00
Scott McCreary
f36c28fab7 Find the font directories on Haiku. This was left off a previous patch somehow. 2010-09-09 15:42:31 +00:00
William Kendrick
be2b5537b3 * Exposing load_user_fonts() and some other font.c functions,
even when FORKED_FONTS is not set.
* No longer undef'ing SDL_thread stuff when FORKED_FONTS is
  used if we're ALSO not using SDL_Pango, since that now
  uses a thread to let fontconfig generate its cache, and
  still let Tux Paint be responsive to the OS and user.
  (SF.net bug #2944951)
* Spawning a thread and rendering a dummy string with SDL_Pango,
  to allow fontconfig to generate its cache.
  (SF.net bug #2944951)
* Setting up 'busy' mouse cursor (watch-shaped) earlier
  (so it can happen while fontconfig cache thread runs).
* Not spawning forked font scanner (FORKED_FONTS) as early, so
  fontconfig can generate its cache first.
  (I wasn't sure if calling an SDL_thread after a fork()
  occured was safe or not; admittedly, I discovered that
  SDL_thread spawning wasn't working due to the re-#defines
  of those functions when FORKED_FONTS was set; see above.)

All of this only tested on Ubuntu 9.04.  Forced disabling of FORKED_FONTS
by editing fonts.h, and Tux Paint still worked (it just took longer at
the splash screen while the fonts were loaded).  Needs testing on various
Windows, Mac OS X and BeOS.
2010-04-27 22:04:43 +00:00
William Kendrick
7b31b7549d Patch collection from Volker Grabsch to help Tux Paint cross-compile for Windows:
* Solve the 'FIXME: "finddir" ...' (The trick is to use "=" instead of ":=". That way, $(beos_PREFIX) will only be evaluated when it is actually used.)
* include "shlwapi.h" instead of "Shlwapi.h" (Otherwise, compiling for Windows will fail on a case sensitive file system. (e.g. a Unix file system when cross compiling))
* use FILENAME_MAX instead of NAME_MAX (FILENAME_MAX is more portable than NAME_MAX. Also, recent MinGW versions don't support NAME_MAX anymore.)
* Exposing font_thread_aborted via extern [tweak to Volker's patch which removed a logic test, which is probably not what we want]
* include parse.h (and thus compiler.h) after <stdio.h> (This ensures that the perror() macro of compiler.h won't confuse the perror() function declaration of <stdio.h>.)
* fix another compiling error about undefined variables (The tuxpaint.c uses printcommand/altprintcommand/papersize even when they aren't defined, i.e. when libpaper is not used. This patch solves the issue by using "#ifdef PAPER_H")
* call show_available_papersizes() only when libpaper is used
* permit cross compiling by using Make variables instead of hard-coded tools

Documented scottmc's Haiku improvements.
2010-02-25 07:06:13 +00:00
William Kendrick
cdc7b62d11 Fixed syntax error; can compile without Pango again. 2010-02-02 23:46:03 +00:00
William Kendrick
68ead6a3d0 indent -bli0 -nip -npsl -npcs -l120 -lc120 -nprs 2010-02-02 23:42:06 +00:00
William Kendrick
6e6ee1f8a3 Trying to get it to build without Pango. 2010-02-02 23:40:53 +00:00
Scott McCreary
3f7b0bd972 Added support for building tuxpaint on Haiku 2009-12-08 08:38:30 +00:00
Albert Cahalan
e3a971194c options working fairly well 2009-11-23 07:45:24 +00:00
Albert Cahalan
3d15a468cd lots of functions made static (some had to be moved) 2009-11-22 23:17:35 +00:00
Albert Cahalan
f296909c75 have to reset y_nudge if wiping out lang/locale 2009-11-21 11:30:19 +00:00
Albert Cahalan
0045bbad98 i18n stuff belongs in i18n.c 2009-11-21 10:14:56 +00:00
Albert Cahalan
dd90d90624 savedir/datadir neatened up 2009-11-21 09:44:11 +00:00
Albert Cahalan
9a00845f50 moving more code past start of font scanning 2009-11-16 08:54:48 +00:00
William Kendrick
d1e86ed445 Casting fix seems to be preventing crashing. 2009-06-06 18:22:00 +00:00
William Kendrick
0bdbefcda7 Added copyright/license to source files that lacked it. 2009-06-03 20:46:07 +00:00
William Kendrick
f063d9f4fc fixme question 2009-06-01 16:44:09 +00:00
William Kendrick
a219080838 Skipping locale-specific fonts, unless we're in that locale.
Providing option to load all locale fonts anyway (the old behavior).
Renaming zh_tw.ttf to zh_TW.ttf.
2009-06-01 04:02:40 +00:00
Mark K. Kim
4cabed88a6 Improved support for detecting missing dependencies:
- Added libpaper-dev package checking.

- Previously, SDL_Pango's bug forced Tux Paint to include a customized
  version of SDL_Pango.h in its distribution, so we couldn't tell if
  SDL_Pango was installed in the system by including SDL_Pango.h.  We made
  a new workaround for SDL_Pango's bug that does not require Tux Paint to
  include SDL_Pango.h, so now we can check for SDL_Pango installation.

- Makefile now includes a check for gettext installation and will not
  fail when attempting to generate .mo files or install .mo files.  Instead,
  Makefile will now display a warning and skip the .mo file generation and
  installation steps.

Many thanks to Arunodai Vudem for the patches.
2008-05-25 02:30:45 +00:00
Martin Fuhrer
1bd1c7233f Mac OS X font loading fix: Skip over system font "AppleMyungjo.ttf" which causes TTF_OpenFont() to crash. 2008-02-07 04:11:04 +00:00
William Kendrick
adf56ef7e9 tp-magic-config man moved to (1)
Magic tool documentation now split into separate files, and referenced
(as a directory) from README, so that users can find docs to any additional
tools (ones not included by default with Tux Paint) that are installed.
Added new --datadir option, to separate path to brushes/stamps/etc. from that of saved files.
Improved docs on where savedir default is.
Made sure --help, man tuxpaint, and OPTIONS docs all covered all command-line options.
Noted SDL_Pango makes locale-specific fonts unnecessary.
Added "--plugindocprefix" option to tp-magic-config, for where docs should go.
Improved plugin API documentation.
Improved layout of man pages a little.
2007-08-02 21:04:42 +00:00
William Kendrick
40200798d8 turn plugin junk into a struct
sorting magic tools by (localized) name
emboss now keeps color
minor fixups
2007-07-20 18:37:36 +00:00
William Kendrick
c4b3e49215 Added ripples magic.
Added (not finished) (new) sparkles magic.
Fixed printf localization bug in postscript printing.
Got Text tool working when Pango is used.
2007-07-18 20:13:08 +00:00
William Kendrick
21ea42f38f Attempting to debug/fix SDL_Pango stuff.
Added icon for Kalidescope magic tool.
Added Canada map starter.
Added Japan map starter.
Improved comments near gettext() calls to improve POT and PO files.
Regenerated PO files and POT file.
Added .cvsignore to make sure tp_magic_api.h (which is generated) isn't noticed.
2007-07-17 18:41:16 +00:00
William Kendrick
0eecea9581 Magic compiles silenced.
Attempted Text tool font load under pango.
Made pango optional.
TuxPaint_Font is aware of both panfgo contexts & sdl_ttf ttf fonts.
2007-07-13 18:18:20 +00:00
William Kendrick
095ba8efb3 Began adding support for using SDL_Pango, a wrapper to Pango,
a library for layout and rendering of text, with an emphasis on
internationalization.  (The hope is to improve support for languages
that SDL_ttf doesn't support well; e.g., Arabic and Telegu.)

TTF_Font structs and some functions were replaced by a new
TuxPaint_Font struct and function, which wraps around either TTF_Font
or SDLPango_Context, depending on whether SDL_Pango is being used.
Note: STILL NEEDS WORK!
2007-07-12 18:43:18 +00:00
William Kendrick
bccb269062 New starters: 10x10 grid & 20x20 grid
Reordered font-loading to happen after locale switch occurs, to
pick up font-organizing string translations (e.g., "Aa", "qx", etc.).
Attempting to help address issue of Latin-only fonts being available
in non-Latin locales -- seemed to help with Norwegian.
Czech translation update.
Russian README documentation
2007-06-06 18:31:54 +00:00
William Kendrick
d451169a83 Got stamp category switching working/ 2007-05-16 07:14:08 +00:00
Albert Cahalan
19b0c3d33d make multiply/divide key (on OLPC XO keyboard) work 2007-03-29 05:06:45 +00:00
Martin Fuhrer
83b00e8f60 Mac OS X update - Standard Mac font paths will now be used during attempt to TTF fonts at startup. (eg. Foreign fonts can now be placed in /Library/Fonts or ~/Library/Fonts, alongside all the other standard Mac fonts) 2006-10-19 01:34:32 +00:00
Martin Fuhrer
3189f07863 Mac OS X updates. 2006-10-14 03:55:34 +00:00
William Kendrick
7716a05281 Ran source code through "indent -nbfda -npcs -npsl -bli0". 2006-08-27 21:00:52 +00:00
John Popplewell
f482a789f6 Fix to make font sizing work. 2006-02-20 06:14:12 +00:00
John Popplewell
2982961f38 Various fixes for win32, mostly as a result of the splits. 2006-02-20 04:12:27 +00:00
William Kendrick
e964eb17a0 More splits from "tuxpaint.c":
+ "debug.h": Defines whether debugging printf() calls should be enabled.
  + "dirwalk.c/h": Callback functions for recursive directory traversal.
  + "fonts.c/h": Font loading/grouping/discarding variables and functions.
  + "get_fname.c/h": Functions for constructing preferred file paths.
2006-02-19 08:02:39 +00:00