Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building from source #26

Open
alexmyczko opened this issue May 11, 2023 · 1 comment
Open

Building from source #26

alexmyczko opened this issue May 11, 2023 · 1 comment

Comments

@alexmyczko
Copy link

alexmyczko commented May 11, 2023

When trying to build from source, on Debian sid I get this output:

$ cd build
$ mkdir svgs    # this is not documented anywhere
$ ./gen_glyphs.sh
Step 1Program root: /usr
Failed to find NameList: TT
Internal Error: Invalid 2nd order spline in SplineRefigure2

Maybe a build script/system would be good?

ah much better after replacing all python3.8 with python3.11 and pip install python-gegl

@leukimi
Copy link

leukimi commented Oct 31, 2024

On Ubuntu 24.04 it is pretty difficult to run the build scripts.

The main issue is to get a gimp AppImage to work with python interpreter and Gegl. The closest working gimp with python interpreter is the Flatpak gimp version, but it is missing Gegl-0.4.typelib which is found in DEB package gir1.2-gegl-0.4.

The Ubuntu 24.04 gimp does not have python2 nor python-fu.

Rumors say that gimp 3.00 is supposed to have python-fu.

Here are some notes on what I tried on Ubuntu 24.04:

mkdir $HOME/src
cd $HOME/src
git clone https://github.com/ctrlcctrlv/TT2020.git
cd TT2020/build
mkdir svgs pngs styleR

sudo apt-get install gegl python3-pip python3-virtualenv parallel fontforge python3-fontforge gimp-python inkscape gir1.2-gegl-0.4

# Ubuntu 24.04 blocks easy install of pip packages
# https://linuxways.net/ubuntu/install-pip-use-on-ubuntu-24-04/

sudo mkdir /home/tt2020
sudo virtualenv --system-site-packages /home/tt2020

# Fix permissions
sudo chown -R $USER /home/tt2020

# Activate virtual environment tt2020
source /home/tt2020/bin/activate

# activating a virtualenv gives you a shell function named:
#     deactivate
# to exit the virtual environment

pip3 install python-gegl

# Download GIMP_AppImage-release-2.10.8-withplugins-x86_64.AppImage from https://github.com/aferrero2707/gimp-appimage/releases
# This appimage does not seem to have gegl functionality.

PREVIOUSDIR=$(pwd)
cd $(xdg-user-dir DOWNLOAD)
GIMP_APPIMAGE="GIMP_AppImage-release-2.10.8-withplugins-x86_64.AppImage"
wget "https://github.com/aferrero2707/gimp-appimage/releases/download/continuous/$GIMP_APPIMAGE"
chmod +x "$(xdg-user-dir DOWNLOAD)/$GIMP_APPIMAGE"
cd "$PREVIOUSDIR"

# Flatpak gimp has python-fu
# flatpak install gimp

# Style R is supposed to mimic uneven stroke speed resulting in something similar bold as Style E when hit hard and a half as bold font when the stroke is weaker.

cp styleE.sh styleR.sh
cp styleE.py styleR.py

# Change styleR.sh to:
# ALT="$3" SEED=$((100000+$2+($4-1))) GIMPIMAGE="$1" /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=gimp-2.10 --file-forwarding org.gimp.GIMP -idf --batch-interpreter=python-fu-eval -b - < styleR.py

# One idea to simulate uneven strokes is to change line 28 in styleR.py to:
# gauss_factor = random.randrange(10, 40, 5)
# pdb.plug_in_gauss(im, im.active_drawable, gauss_factor, gauss_factor, 0)

# Change line 44:
# pdb.gimp_brightness_contrast(new_mask, 47, 84)
# to:
# pdb.gimp_brightness_contrast(new_mask, round(gauss_factor/40*47), round(gauss_factor/40*84))

# Patches
sed -i "s|/home/fred/Downloads|$(xdg-user-dir DOWNLOAD)|g" styleR.sh
sed -i "s|styleE\.py|styleR.py|g" styleR.sh
sed -i "s|/usr/local/lib/python3\.8|/home/tt2020/lib/python3.12|g" list_glyphs.py
sed -i "s|/usr/local/lib/python3\.8|/home/tt2020/lib/python3.12|g" export_glyph.py
sed -i "s|/usr/local/lib/python3\.8|/home/tt2020/lib/python3.12|g" gen_cell_noise.py

# gen_glyphs.sh needs some adjustment. Change line 5 to:
# ls svgs/* | parallel --progress 'inkscape -z {} --export-png=pngs/{/.}.png -d 600'

./gen_glyphs.sh

# Directory svgs and pngs should now have 482 files each

./gen_style.sh R 1 9

# The script will typically fail in "gen_cell_noise.py"

# python-gegl module is believed to work with python3, but has not been tested.

I think I need help to get it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants