Of course!
To be honest, I have a bit of a bias against Delphi components. I try to avoid them if possible. That's why I decided to go with a C++ integration approach.
First, we'll fetch the Skia source code from Git and compile it ourselves.
Create a folder and open a terminal in it.
git clone https://github.com/google/skia.git --depth=1
Since I didn't want to clone the full history of the repository, I used `--depth=1`, but that's up to personal preference.
Next,
cd skia
python3 tools/git-sync-deps
bin/gn gen out/so --args='
is_official_build=true
is_component_build=true
skia_use_gl=true
skia_use_freetype=true
skia_use_fontconfig=true
target_os="linux"
cc="clang"
cxx="clang++"
extra_ldflags = ["-static-libstdc++", "-static-libgcc"]
'
ninja -C out/so
To catch any possible errors, run the commands one by one instead of using a script.
If everything went well, there should be a `libskia.so` file in the `out/so` directory.
You can extract the attached zip file and copy the `core` and `ui` folders next to the `skia` directory.
Now, the project structure will look like this:
LazSkiaTest
- core // C++ side goes here
- skia // Skia source and compiled files go here
- ui // Pascal side that brings everything together
In `core/Pkgs/lib.skia_test/Dev/Main.cpp`, specify the path to a font file at line 91.
Then go into the core folder and run the following command.
This is a Make setup I personally use in my own projects — feel free to modify or use it however you like.
Now, go into the `ui` folder and open the project.
It should be working at this point.
I’ve also included a screenshot in the attachment.
Good luck to everyone!