How to use GDI+ or equivalent on Linux?

Hello, I'm using the latest version of OBS on Linux Mint 22. Unfortunately FreeType does not have all the required features that I need and have gotten used to on Windows. Currently what I've needed that's missing is:
  • Alignment (both horizontal AND vertical - neither are available)
  • Differing outline sizes (outlines do exist but the size is fixed)
  • Custom text extents (both horizontal AND vertical - only width is available)
I tried to install libgdiplus after finding an old thread about it but I didn't know how to use it with OBS even though it seemed to be installed on my system just fine (not entirely sure though). I also tried to run Windows OBS under Wine, but that instantly crashed and is not even supported.

Unfortunately the above features are non-negotiable, so I cannot just use FreeType. I'm mostly looking for a way to get those features though, so if there is a fork or another library I can use with all of the above, that would also work. Additionally I might switch to another distro like Arch soon so a distro-agnostic solution would be best, but is not required.

Any help is appreciated, thanks a lot.
 

Tuna

Member
If there is an API compatible libgdiplus available on Linux you would have to compile the obs-text plugin for Linux and link to that library. This sounds like development work.
 
If there is an API compatible libgdiplus available on Linux
The libgdiplus page says it is an API.
you would have to compile the obs-text plugin for Linux and link to that library.
Let me get this correct: compile this, with line 10 in CMakeLists.txt pointing to my install of libgdiplus, by following these instructions for Linux, then add the plugin to OBS how you would normally.

(In case this doesn't work, I'm happy for anyone to suggest text libraries/plugins that they know work with OBS and provide the features I listed in the OP.)
 
@throwaway1234567890a - you'll find that this is more work than first glance. libgdiplus (https://gitlab.winehq.org/mono/libgdiplus) is a C implementation; while the obs-text plugin within OBS is intended to build against C++ headers from the original (Windows) GDI+. So you'll need to patch up some differences there, first.
Unfortunately then I have no idea what I'm doing as I have never used C or C++ before.

When trying to compile obs-text as-is following the quick start guide (except the pig-config tool could not be found, so I just skipped it), it just says
Code:
Unknown CMake command "set_target_properties_obs".
even after using the helpers.cmake from the real OBS repository. Do I have to build the entire OBS project just to have this one plugin point to another library?
 
Unfortunately then I have no idea what I'm doing as I have never used C or C++ before.

When trying to compile obs-text as-is following the quick start guide (except the pig-config tool could not be found, so I just skipped it), it just says
Code:
Unknown CMake command "set_target_properties_obs".
even after using the helpers.cmake from the real OBS repository. Do I have to build the entire OBS project just to have this one plugin point to another library?
To do this; you'll have to learn a bit of C, C++, and CMake. If you don't have the bandwidth - probably best to put in a feature request with the OBS team, see: https://ideas.obsproject.com/ (do _not_ post feature requests to GitHub, as per their instructions).

You don't _need_ the entire OBS project, but the build scripts for plugins that are distributed with OBS are not designed to be built by themselves. Two options seem to be:
  1. Build OBS with your own modifications to obs-text and the build scripts, or;
  2. Start with the OBS plugin template, bring in the source code from OBS, and build a new (external) plugin.
That still leaves you with the problem that the original plugin is not written with the C library in mind - so there's directives like namespace that simply won't compile (because they're missing from the C header entirely).
 
Top