Commit graph

2860 commits

Author SHA1 Message Date
Bill Kendrick
c7f1e0a257 Mend a minor compiler warning 2023-06-15 16:52:11 -07:00
Bill Kendrick
38b9dc657f More info in fonts.c re: locale fonts (fallbacks) 2023-06-13 22:08:33 -07:00
Bill Kendrick
104c27086b Bump some file update dates! 2023-06-13 00:27:50 -07:00
Bill Kendrick
0437b898ca Allow primary & fallback locale fonts to be specified
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.
2023-06-13 00:25:49 -07:00
Bill Kendrick
0bfc8c18c1 Looks like SDL2_Pango can find our fonts now
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.
2023-06-12 23:51:07 -07:00
Bill Kendrick
794ea691e8 WIP Trying to get SDL_Pango (& FontConfig) to see our locale fonts 2023-06-12 22:13:19 -07:00
Mark Kim
fcba197c90 default font for Korean 2023-06-13 00:00:20 -04:00
Mark Kim
d6dbd39231 Set FONTCONFIG_PATH before --listfonts on macOS
Also, search more system folders for fonts on macOS.
2023-06-10 16:20:47 -04:00
Bill Kendrick
1d212475b9 More locale font defaults
Based on what we have as plain TTF files in the repo,
and what's available in Ubuntu.
2023-06-08 01:28:20 -07:00
Bill Kendrick
3c8f25e6e9 Ability to specify fonts on a per-locale basis
Add to the list found in `src/fonts.c` (use language IDs
found in `src/i18n.h`, e.g. "LANG_DE" for German).
h/t Shin-ichi for the suggestion

Closes https://sourceforge.net/p/tuxpaint/feature-requests/240/
2023-06-08 00:40:43 -07:00
Bill Kendrick
1f623cbe36 Finished exported template deletion feature 2023-06-08 00:08:07 -07:00
Bill Kendrick
375c079b85 Some clean-up of new strip_quotes() 2023-06-06 22:18:19 -07:00
dolphin6k
ab7567f2c0 Strip quotes around option argument. 2023-06-07 09:56:03 +09:00
Bill Kendrick
596c6ea0cc TODO/FIXME re: uifont stuff
h/t Shin-ichi for help with this
2023-06-04 16:21:20 -07:00
Bill Kendrick
65f3c805d1 Better debug & warning output re: wordexp() shell expansion 2023-06-03 14:17:03 -07:00
Bill Kendrick
fe33acc716 Don't crash on un-wordexp()'able arguments!
We run shell expansion on configuration arguments,
e.g. `printcommand`, but it would crash if the config
file's input was not quoted, e.g.

  printcommand=pstopdf - - > $HOME/print.pdf

Now echo'ing an error to stderr and moving on.
Be sure to quote, e.g.

  printcommand="pstopdf - - > $HOME/print.pdf"
2023-06-03 14:10:13 -07:00
Bill Kendrick
0e359a1fba tuxpaint --listfonts -- sort the results 2023-06-01 23:48:19 -07:00
Bill Kendrick
1cf2fa245d --listfonts option to show all font families Pango finds 2023-06-01 23:31:04 -07:00
Bill Kendrick
34b0760aea WIP Ability to Erase persoanl templates from New
Sync docs
2023-06-01 22:48:56 -07:00
Bill Kendrick
4c757c2a36 WIP Beginning work on "Erase" exported templates via "New" 2023-06-01 22:19:07 -07:00
Bill Kendrick
6755d67937 Sync docs to grab "--noerase" option documentation 2023-06-01 21:44:45 -07:00
Bill Kendrick
437802252b "--noerase" option to disable Open->Erase option
Will also be used to remove the New->Erase option we plan
to add, to allow deletion of exported templates.

WIP - Need to update docs.
2023-06-01 21:29:24 -07:00
Bill Kendrick
1b6ee72e87 "uifont" option: tell us what we wanted & what we got
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.)
2023-06-01 00:20:41 -07:00
Bill Kendrick
ba9c5b30e8 Doc'ing 0.9.31 changes so far, in appdata XML file 2023-05-29 13:33:10 -07:00
Bill Kendrick
83c4cbc676 WIP New "--uifont" option to specify UI font
If not specified, or "default" is specified (e.g., to override
a higher-up config file setting), it will fallback to what we
have #define'd in fonts.h as PANGO_DEFAULT_FONT, "DejaVu Sans".

It appears to fallback to this (or a reasonable fascimile) if
the font specified by the "uifont" option doesn't exist
(e.g., "tuxpaint --uifont=ABCD1234").

For https://sourceforge.net/p/tuxpaint/feature-requests/146/
2023-05-29 13:13:58 -07:00
Bill Kendrick
b4a550a6e1 Add --[no]templateexport to --help output 2023-05-29 12:43:11 -07:00
Bill Kendrick
8ba1313c21 POT/PO after adding new Template creation feature 2023-05-29 10:52:10 -07:00
Bill Kendrick
65378f6fdd Ability to disable Template creation from Open dialog 2023-05-29 10:50:55 -07:00
Bill Kendrick
33394f397b Template export: test image dimensions & file CRC
Final couple of tests to let us avoid creating a template that's
identical to one that already exists.  All told, we test the
following (and the first thing that matches causes us to stop
testing that template, and move on to the next, as it appears
to not be identical to the saved image, in its current state)

 + filename prefix (based on saved image's filename)
 + file size
 + image dimensions
 + image contents (via CRC)
2023-05-27 15:40:30 -07:00
Bill Kendrick
e578de2c6b Template export: Test file sizes, too
Avoid exporting a saved picture to a new template if one already
exists with both the same filename prefix, and now also identical
file sizes (in bytes).

Bugfix - The export function was always dumping chunks that
were the size of the input buffer, which means the final chunk
(which will frequently be smaller) will contain garbage data
beyond the end.
2023-05-27 14:17:48 -07:00
Bill Kendrick
785401d68e WIP Disallow creation of duplicate templates...
...based on saved files.  So far, only looking for identical
template prefix (which is based on the save file's filename).

Next will be to check other fingerprints, in case the saved file
changed after an earlier template was created.
2023-05-27 13:09:05 -07:00
Bill Kendrick
9537efd987 export_pict(), use some enums for args & return values 2023-05-27 12:46:01 -07:00
Bill Kendrick
269355a99c Ensure {datadir}/templates exists when making template
Example

  mkdir /tmp/tp
  tuxpaint --datadir /tmp/tp

without this fix, choosing "Template" (make a new templat)
from "Open" dialog would result in an error, since
`/tmp/tp/templates` did not exist.

We now `mkdir()` it.  This requires, of course, that the
directory specified by `--datadir` _itself_ exists.  (We will
not attempt to create anything higher up.)
2023-05-27 12:07:47 -07:00
Bill Kendrick
10092ece0e Starter/Template thumbnails: use DIR_DATA, not DIR_SAVE
Places where we attempt to save thumbnails of starters & templates
was trying to `mkdir()` a `.thumbs/` subdirectory in non-existent
`starters/` and `templates/` subdirectories of the "savedir"
location; should be the "datadir" one.

To replicate

  mkdir -p /tmp/tp/starters
  cp SOMEFILE.png /tmp/tp/starters
  tuxpaint --datadir /tmp/tp

then click "New"; observer the warning

  Error: Couldn't save thumbnail of saved image!
  /tmp/tp/starters/.thumbs/SOMEFILE.png
  The error that occurred was:
  No such file or directory
2023-05-27 11:55:55 -07:00
Bill Kendrick
7b6f04ac1d Problem loading templates from overridden 'datadir'
When specifying "datadir", Tux Paint's "New" dialog
was able to present templates found in that directory,
but would attempt to load from whatever the user's
"savedir" was, instead.

h/t Giancarlo Orru for reporting the bug.
2023-05-27 11:51:03 -07:00
Bill Kendrick
955c39c053 WIP Ability to copy saved drawing into a new template
https://sourceforge.net/p/tuxpaint/feature-requests/236/
2023-05-25 23:20:32 -07:00
Bill Kendrick
313555f6a1 Wrapped up initial stab at fuzzy erasers 2023-05-22 23:02:31 -07:00
Bill Kendrick
065060de03 More work on fuzzy eraser; better behavior w/ Ctrl-Z & -R 2023-05-22 22:24:47 -07:00
Bill Kendrick
d31bc814e6 WIP - Fuzzy erasers
Also, mend scroll button / interaction bug in Eraser selector.
2023-05-22 00:33:52 -07:00
Bill Kendrick
d8f3adc2e7 Bump version to 0.9.31; credit new Russian translator
h/t Olesya
2023-05-20 11:22:45 -07:00
Olesya Gerasimenko
4ccfea64f2 Update Russian translation 2023-05-19 16:18:25 +03:00
Bill Kendrick
eb8f4be7fd Makefile: Set version to 0.9.30-rc1
And appdate.xml -- bump date.
2023-05-14 13:14:24 -07:00
Bill Kendrick
2d99a823f2 fix location for tuxpaint.cfg on Haiku
Unclear why when I `git pull` in master, I'm not seeing
https://sourceforge.net/p/tuxpaint/tuxpaint/ci/b48cb438239e47ebce3c6b84f5aff2d7d906d3ba/
so just replicating it (plus adding entry to docs/CHANGES.txt).
2023-05-12 00:19:22 -07:00
Bill Kendrick
8e9a51d478 Define & use NUM_ERASER_SIZES
...everywhere "NUM_ERASERS / 2" was being used
2023-05-10 23:20:05 -07:00
Bill Kendrick
a58f1f64b5 pick_best_scape() is now always included (even when building with NOSVG)
Was failing to compile on Haiku for Luc (apparently building with
no SVG support), since I started using that function outside of
SVG-related places.

Also, to continue being able to compile on Linux with no SVG support --
 * Always use SDL_TRUE & SDL_FALSE, not TRUE & FALSE
 * Always link tuxpaint with "-lm"

Finally, verbose version info ("tuxpaint --verbose-version") now states which
SVG build (new RSVG or old Cairo)
2023-05-09 23:44:39 -07:00
Bill Kendrick
3ae4517a08 Mend compiler warning (don't cast ceil() to (int)) 2023-05-04 23:36:04 -07:00
Bill Kendrick
3f5bc2b554 thumbnail2() - ceil() the new_x & new_y calculations
I noticed that buttonsize=90 or =91 would end up with UI buttons
images ere one pixel smaller (89x89 or 90x90, respectively) than
expected, hence they layout would end up with one row and one
column of unused pixels between them.  Any button content (e.g.
stamp thumbnails) that might render into the full size would end
up leaving garbage pixels behind.

Applying ceil() to the new_x and new_y (but then making sure they do
not exceed the requested max_x and max_y) calculated sizes inside the
thumbnail2() function.  (We do not simply use max_x and max_y directly,
because we are usually trying to maintain the original image's aspect
ratio.)
2023-05-04 23:29:39 -07:00
Bill Kendrick
aa2235c8ba Reduce max button size; account for new stamp control row
...for rotation button added in 0.9.29
2023-05-04 22:43:59 -07:00
dolphin6k
11b6dc1b27 Updated Japanese
Many magic label to be word-wrapped
2023-05-04 09:05:21 +09:00
Pere Pujal i Carabantes
3743a15673 printf -> DEBUG_PRINTF Shapes tool output filled my terminal. 2023-05-03 20:41:34 +02:00