Extending Tux Paint バージョン 0.9.36 Copyright © 2002-2025 by various contributors; AUTHORS.txt 参照. https://tuxpaint.org/ 2025年6月 8日 +-----------------------------------------+ | 目次 | |-----------------------------------------| | * Where Files Go | | + Standard Files | | + Personal Files | | * Brushes | | + Brush Descriptive Text | | + Brush Options | | * はんこ | | + Stamp Images | | + Stamp Descriptive Text | | + Stamp Sound Effects | | + Stamp Descriptive Sound | | + Stamp Options | | + Pre-Mirrored and Flipped Stamps | | * フォント | | + System Fonts | | + FontConfig | | * 'Starters' | | + Coloring-Book Style Starters | | + Scene-Style Starters | | + Starter Options | | * 'Templates' | | + Template Options | | * Translations | | * Alternative Input Methods | | * 画面キーボード | | * Magic Tools | +-----------------------------------------+ If you wish to add or change things like Brushes, Starters, Rubber Stamps, and other content used by Tux Paint, you can do so fairly easily by simply adding, changing, or removing files where Tux Paint looks for them. 💡 Note: You'll need to re-launch Tux Paint for the changes to take effect. Where Files Go ### Standard Files ### Tux Paint looks for its various data files in its 'data' directory. → Linux and Unix ← Where this directory goes depends on what value was set for "DATA_PREFIX" when Tux Paint was built. See 'Install documentation' for details. By default, though, the directory is: /usr/local/share/tuxpaint/ If you installed from a package, it is more likely to be: /usr/share/tuxpaint/ → Windows ← Tux Paint looks for a directory called 'data' in the same directory as the executable. This is the directory that the installer used when installing Tux Paint e.g.: C:\Program Files\TuxPaint\data → macOS ← Tux Paint stores its data files inside the "Tux Paint" application icon (which is actually a special kind of folder on macOS & Mac OS X before it). The following steps explain how to get to the folders within it: 1. Bring up a 'context' menu by holding the [Control] key and clicking the Tux Paint icon the in Finder. (If you have a mouse with more than one button, you can simply right-click the icon.) 2. Select "Show Contents" from the menu that appears. A new Finder window will appear with a folder inside called "Contents". 3. Open the "Contents" folder and open the "Resources" folder found inside. 4. There, you will find various sub-folders, such as "starters", "stamps", "brushes", etc. Adding new content to these folders will make the content available to any user that launches this copy (icon) of Tux Paint. 💡 Note: If you install a newer version of Tux Paint and replace or discard the old version, you will lose changes made by following the instructions above, so keep backups of your new content (stamps, brushes, etc.). Tux Paint also looks for files in a "TuxPaint" folder that you can place in your system's "Application Support" folder (found under "Library" at the root of your filesystem): /Library/Application Support/TuxPaint/data/ When you upgrade to a newer version of Tux Paint, the contents of this "TuxPaint" folder will stay the same, and remain accessible by all users of Tux Paint. ### Personal Files ### You can also create brushes, stamps, 'starters', templates, and fonts in your own user account directory (folder) for Tux Paint to find. → Windows ← Your personal Tux Paint folder is stored in your personal "Application Data". For example, on newer Windows: C:\Users\ユーザー名\AppData\Roaming\TuxPaint\ → macOS ← Your personal Tux Paint folder is stored in your personal "Application Support" folder: /Users/ユーザー名/Library/Application Support/TuxPaint/ → Linux and Unix ← Your personal Tux Paint files go into a 'hidden directory' found in your account's home directory: "/home/ユーザー名/.tuxpaint/". Don't forget the period (".") before the "tuxpaint"! To add your own brushes, stamps, 'starters,' templates, and fonts, create subdirectories under your personal Tux Paint directory named "brushes", "stamps ", "starters", "templates", "fonts", respectively. (For example, if you created a brush named "flower.png", you would put it in "/home/ユーザー名/.tuxpaint/brushes/" under Linux or Unix.) Brushes The brushes used for drawing with the 'Paint' and 'Lines' tools in Tux Paint are simply PNG image files. The alpha (transparency) of the PNG image is used to determine the shape of the brush, which means that the shape can be 'anti-aliased' and even partially-transparent! Greyscale pixels in the brush PNG will be drawn using the currently-selected color in Tux Paint. Color pixels will be tinted. ### Brush Descriptive Text ### Tux Paint will display descriptive text when a brush is selected. These are placed in plain text files with the same name as the PNG, but with a ".txt" filename extension. (e.g., "brush.png"'s description is stored in "brush.txt" in the same directory.) The first line of the text file will be used as the US English description of the brush's image. It must be encoded in UTF-8. → Localization Support ← Additional lines can be added to the text file to provide translations of the description, to be displayed when Tux Paint is running in a different locale (like French or Spanish). The beginning of the line should correspond to the language code of the language in question (e.g., "fr" for French, and "zh_TW" for Traditional Chinese), followed by ".utf8=" and the translated description (Unicode, encoded in UTF-8). For Tux Paint developers: There are scripts in the "brushes-po" directory for converting the text files to PO format (and back) for easy translation to different languages. Therefore you should never add or change translations in the ".txt" files directly. If no translation is available for the language Tux Paint is currently running in, the US English text is used. → Windows のユーザー ← Use NotePad or WordPad to edit/create these files. Be sure to save them as plain-text, and make sure they have a ".txt" extension at the end of the filename. ### Brush Options ### Aside from a graphical shape, brushes can also be given other attributes. To do this, you need to create a 'data file' for the brush. A brush's data file is simply a plain ASCII text file containing the options for the brush. The file has the same name as the PNG image, but a ".dat" extension. (e.g., "brush.png"'s data file is the text file "brush.dat", found in the same directory.) → ブラシの描画間隔 ← You may specify the spacing for brushes — that is, how frequently they are drawn across the length of a line or stroke. By default, the spacing will be the brush's height, divided by 4. Add a line containing the line "spacing=N" to the brush's data file, where "N" is the spacing you want for the brush. (The lower the number, the more often the brush is drawn.) → Animated Brushes ← Brushes may be animated. As the brush is used, each frame of the animation is drawn in sequence. Lay each frame out across a wide PNG image. For example, if the brush is 30x30 and there are 5 frames, the image should be 150x30. Add a line containing the line "frames=N" to the brush's data file, where " N" is the number of frames in the brush. ⚙ Note: If you'd rather the frames be flipped through randomly, rather than sequentially, also add a line containing "random" to the brush's data file. → Directional Brushes ← Brushes may be configured to draw a different shape based on the direction of the line or brush stroke. Different shapes will be drawn depending on which of the eight compass directions the brush is moving — up (aka North), up/right (aka Northeast), right (aka East), down/right (aka Southeast), etc.). A ninth "center" shape is used when there's no motion (e.g., simply clicking/tapping and releasing the "Paint" tool, without dragging). The directional shapes are divided into a 3x3 square in a PNG image. For example, if your brush is 30x30, the image should be 90x90, and each of the direction's shapes placed in a 3x3 grid. Add a line containing the word "directional" to the brush's data file. → Rotating Brushes ← Brushes may be configured to rotate based on the angle of the line or brush stroke. (Unlike Directional Brushes, described above, only a single brush shape may be provided. Add a line containing the word "rotate" to the brush's data file. → Chaotic Brushes ← Brushes may be configured to continuously choose a random direction as you draw with them. Add a line containing the word "chaotic" to the brush's data file. → Animated Directional, Rotating, or Chaotic Brushes ← You may mix both animated and either directional, rotating, or chaotic features into one brush. Use both options desired ("frames=N" and " directional", "rotate", or "chaotic"), in separate lines in the brush's ".dat" file. For directional brushes, lay the brush out so that each 3x3 set of directional shapes are laid out across a wide PNG image. For example, if the brush is 30x30 and there are 5 frames, it would be 450x90. (The leftmost 150x90 pixels of the image represent the 9 direction shapes for the first frame, for example.) Place the brush image PNGs (and any data text files) in the "brushes" directory. 💡 Note: If your new brushes all come out as solid squares or rectangles, it's because you forgot to use alpha transparency! See the 'PNG documentation' in Tux Paint for more information and tips. はんこ All stamp-related files go in the "stamps" directory. It's useful to create subdirectories and sub-subdirectories there to organize the stamps. (For example, you can have a "holidays" folder with "halloween" and "christmas" sub-folders.) ### Stamp Images ### Rubber Stamps in Tux Paint can be made up of a number of separate files. The one file that is required is, of course, the picture itself. Stamps may be either PNG bitmap images or SVG vector images. They can be full-color or greyscale. The alpha (transparency) channel of PNGs is used to determine the actual shape of the picture (otherwise you'll stamp a large rectangle on your drawings). PNGs can be any size, and Tux Paint (by default) provides a set of sizing buttons to let the user scale the stamp up (larger) and down (smaller). SVGs are vector-based, and will be scaled appropriately for the canvas size being used in Tux Paint. 💡 Note: If your new PNG-based stamps all come out as solid squares or rectangles, it's because you forgot to use alpha transparency! See the 'PNG documentation' in Tux Paint for more information and tips. 💡 Note: If your new SVG stamps seem to have a lot of whitespace, make sure the SVG 'document' is no larger than the shape(s) within. If they are being clipped, make sure the 'document' is large enough to contain the shape(s). See the 'SVG documentation' in Tux Paint for more information and tips. ⚙ Advanced Users: The 'Advanced Stamps How-To' document describes, in detail, how to make PNG images which will scale perfectly when used as stamps in Tux Paint. ### Stamp Descriptive Text ### Tux Paint will display descriptive text when a stamp is selected. These are placed in plain text files with the same name as the PNG or SVG, but with a ".txt" filename extension. (e.g., "stamp.png"'s description is stored in "stamp.txt" in the same directory.) The first line of the text file will be used as the US English description of the stamp's image. It must be encoded in UTF-8. → Localization Support ← Additional lines can be added to the text file to provide translations of the description, to be displayed when Tux Paint is running in a different locale (like French or Spanish). The beginning of the line should correspond to the language code of the language in question (e.g., "fr" for French, and "zh_TW" for Traditional Chinese), followed by ".utf8=" and the translated description (Unicode, encoded in UTF-8). For Tux Paint developers: There are scripts in the "po" directory for converting the text files to PO format (and back) for easy translation to different languages. Therefore you should never add or change translations in the ".txt" files directly. If no translation is available for the language Tux Paint is currently running in, the US English text is used. → Windows のユーザー ← Use NotePad or WordPad to edit/create these files. Be sure to save them as plain-text, and make sure they have a ".txt" extension at the end of the filename. ### Stamp Sound Effects ### Tux Paint can play a sound effect when a stamp is selected. For example, the sound of a duck quaking when selecting a duck, or a brief piece of music when a musical instrument is chosen. Files may be in "WAVE (".wav")" or "OGG Vorbis (".ogg")" formats, and are given same name as the PNG or SVG image. (e.g., "stamp.svg"'s sound effect is the sound file "stamp.ogg" in the same directory.) → Localization Support ← For sounds for different locales (e.g., if the sound is someone saying a word, and you want translated versions of the word said), also create WAV or OGG files with the locale's label in the filename, in the form: "stamp_LOCALE.EXT" The sound effect that will be played when the stamp corresponding to the image file "stamp.png" is selected, and when Tux Paint is using the Spanish locale, would be "stamp_es.wav". Under the French locale, it would be "stamp_fr.wav". Under the Brazilian Portuguese locale, "stamp_pt_BR.wav". And so on... If no localized sound effect can be loaded, Tux Paint will attempt to load the 'default' sound file. (e.g., "stamp.wav") 💡 Note: Also consider using descriptive sounds; see 'Stamp Descriptive Sound', below. ### Stamp Descriptive Sound ### Tux Paint can also play a descriptive sound when a stamp is selected. For example, the sound of someone saying the word "duck" when selecting a duck, or the name of a musical instrument when one is chosen. Files may be in "WAVE (".wav")" or "OGG Vorbis (".ogg")" formats, and are given same name as the PNG or SVG image, with "_desc" at the end. (e.g., "stamp.svg"'s descriptive sound is the sound file "stamp_desc.ogg" in the same directory.) → Localization Support ← For descriptive sounds for different locales, also create WAV or OGG files with both "_desc" and the locale's label in the filename, in the form: "stamp_desc_LOCALE.EXT" The descriptive sound that will be played when the stamp corresponding to the image file "stamp.png" is selected, and when Tux Paint is using the Spanish locale, would be "stamp_desc_es.wav". Under the French locale, it would be "stamp_desc_fr.wav". Under the Brazilian Portuguese locale, "stamp_desc_pt_BR.wav". And so on... If no localized descriptive sound can be loaded, Tux Paint will attempt to load the 'default' sound file. (e.g., "stamp_desc.wav") ### Stamp Options ### Aside from a graphical shape, a textual description, a sound effect, and a descriptive sound, stamps can also be given other attributes. To do this, you need to create a 'data file' for the stamp. A stamp's data file is simply a plain ASCII text file containing the options for the stamp. The file has the same name as the PNG or SVG image, but a ".dat" extension. (e.g., "stamp.png"'s data file is the text file "stamp.dat", found in the same directory.) → Colored Stamps ← Stamps can be made to be either "colorable" or "tintable." → Colorable ← "Colorable" stamps they work much like brushes - you pick the stamp to get the shape, and then pick the color you want it to be. (Symbol stamps, like the mathematical and musical ones, are an example.) Nothing about the original image is used except the transparency (from "alpha" channel). The color of the stamp comes out solid. Add a line containing the word "colorable" to the stamp's data file. → Tinted ← "Tinted" stamps are similar to "colorable" ones, except the details of the original image are kept. (To put it technically, the original image is used, but its hue is changed, based on the currently-selected color.) Add a line containing the word "tintable" to the stamp's data file. → Tinting Options: ← Depending on the contents of your stamp, you might want to have Tux Paint use one of a number of methods when tinting it. Add one of the following lines to the stamp's data file: → Normal tinter — "tinter=normal" (the default) ← This is the normal tinting mode. First, the primary hue of the stamp is determined. (For example, a picture of a flower with a stem will have the petal color seen as the primary hue of the overall image.) Next, the most highly saturated part of the picture is found. With "normal tinter", the range of hue used to do this starts out within ±18° of the pimary hue found in step 1. (If none can be found, it widens the range by 50% and tries again.) Finally, the image is tinted. Anything falling within 50% of the range (e.g., ±27°) is altered to have the hue of the color chosen by the user. → Narrow tinter — "tinter=narrow" ← This like the "normal" option described above, but starts a narrower hue range of ±6°. Anything found within 50% of the range (e.g. ±9°) is tinted. If too much of your stamp is being tinted, try this option. → 'Any hue' tinter — "tinter=anyhue" ← This remaps all hues in the stamp. It works similarly to the "anyhue" and "narrow" options described above, but the hue range is ±180°. → Vector tinter — "tinter=vector" ← This maps 'black through white' to 'black through destination'. → Unalterable Stamps ← By default, a stamp can be flipped upside down, shown as a mirror image, or both. This is done using the control buttons below the stamp selector, at the lower right side of the screen in Tux Paint. Sometimes, it doesn't make sense for a stamp to be flippable or mirrored; for example, stamps of letters or numbers. Sometimes stamps are symmetrical, so letting the user flip or mirror them isn't useful. To prevent a stamp from being flipped vertically, add the option "noflip" to the stamp's data file. To prevent a stamp from being mirrored horizontally, add the option " nomirror" to the stamp's data file. → スタンプの初期サイズ ← By default, Tux Paint assumes that your stamp is sized appropriately for unscaled display on a 608x472 canvas. This was the original Tux Paint canvas size, provided by a 640x480 screen. Tux Paint will then adjust the stamp according to the current canvas size and, if enabled, the user's stamp size controls. If your stamp would be too big or too small, you can specify a scale factor. If your stamp would be 2.5 times as wide (or tall) as it should be, add one of the following options, which represent the same adjustment, to the stamp's data file. (An equals sign, "=", may be included after the word "scale".) o "scale 40%" o "scale 5/2" o "scale 2.5" o "scale 2:5" → Windows のユーザー ← Use NotePad or WordPad to edit/create these files. Be sure to save them as plain-text, and make sure they have a ".dat" extension at the end of the filename. ### Pre-Mirrored and Flipped Stamps ### In some cases, you may wish to provide a pre-drawn version of a stamp's mirror-image, flipped image, or even both. For example, imagine a picture of a fire truck with the words "Fire Department" written across the side. You probably do not want that text to appear backwards when the image is flipped! To create a mirrored version of a stamp that you want Tux Paint to use, rather than mirroring one on its own, simply create a second ".png" or ".svg" graphics file with the same name, except with "_mirror" before the filename extension. For example, for the stamp "stamp.png" you would create another file named "stamp_mirror.png", which will be used when the stamp is mirrored (rather than using a backwards version of "stamp.png"). You may also provide a pre-flipped image with "_flip" in the name, and/or an image that is both mirrored and flipped, by naming it "_mirror_flip". 💡 Note: If the user flips and mirrors an image, and a pre-drawn "_mirror_flip" doesn't exist, but either "_flip" or "_mirror" does, it will be used, and mirrored or flipped, respectively. フォント The fonts used by Tux Paint are TrueType Fonts (TTF). Simply place them in the "fonts" directory. When using the 'Text' and 'Label' tools, Tux Paint will present the font in the 'Letters' selector at the right, along with options to enable bold and/or italics, and change the size. ### System Fonts ### Tux Paint checks a number of standard Operating System locations for fonts that the 'Text' and 'Label' tools might be able to use (unless the "--nosysfonts" option is set). The locations vary, depending on operating system. * Windows + The location specified by the "Fonts" option of the "Software\Microsoft \Windows\CurrentVersion\Explorer\Shell Folders" Windows Registry key. + If the above fails, then "C:\WINDOWS\FONTS". + The location specified by the "Local AppData" option of the "Software\ Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" Windows Registry key. The path "\Microsoft\Windows\Fonts" is appended to that location. * macOS + /System/Library/Fonts + /Library/Fonts + /usr/share/fonts + /usr/X11R6/lib/X11/fonts + The "Library/Fonts" folder in the user's home folder. * Android + /system/fonts * Haiku The locations found by asking Haiku's "Storage Kit" to find the directories on the "/boot" volume for: + B_SYSTEM_FONTS_DIRECTORY + B_SYSTEM_NONPACKAGED_FONTS_DIRECTORY + B_USER_FONTS_DIRECTORY + B_USER_NONPACKAGED_FONTS_DIRECTORY * Linux/etc. + /usr/share/feh/fonts + /usr/share/fonts + /usr/X11R6/lib/X11/fonts + /usr/share/texmf/fonts + /usr/share/grace/fonts/type1 + /usr/share/hatman/fonts + /usr/share/icewm/themes/jim-mac + /usr/share/vlc/skins2/fonts + /usr/share/xplanet/fonts ### FontConfig ### Tux Paint utilizes FontConfig to find additional system-wide and user-specific fonts that the 'Text' and 'Label' tools might be able to use (unless the "--nosysfonts" option is set). It does this by looking for FontConfig configuration files ("fonts.conf") in various locations. * Windows + The "etc/fonts/fonts.conf" file included with Tux Paint. * macOS + The path specified by the "FONTCONFIG_PATH" environment variable, if set. * Haiku + /boot/system/settings/fonts/fonts.conf * Linux/etc. + The path specified by the "FONTCONFIG_PATH" environment variable, if set. + If the above fails, then "/etc/fonts/fonts.conf". + The path specified by the "XDG_CONFIG_HOME" environment variable, if set. There, it looks for the file "fontconfig/fonts.conf". + If the above fails, then "$HOME/.config/fontconfig/fonts.conf". Each FontConfig configuration file ("fonts.conf") is examined for "