harfbuzz icon indicating copy to clipboard operation
harfbuzz copied to clipboard

[Feature request] Add Pango build for Windows

Open afalkenhahn opened this issue 2 years ago • 8 comments

I appreciate that there's an archive that contains Win32/Win64 builds of HarfBuzz along with all dependencies. May I suggest that you also add a Win32/Win64 build of Pango to that archive? I think that would make life easier for lots of people and it looks like all of Pango's dependencies are already in that archive so it probably wouldn't be too much work to add Pango itself as well.

afalkenhahn avatar Jun 22 '23 17:06 afalkenhahn

While it seems out of scope for us, I see the convenience of having that. I'm not sure how easy or hard it would be with Pango's meson build system. If someone wants to volunteer, we'll definitely consider it.

behdad avatar Jun 22 '23 20:06 behdad

Who builds those Win32/Win64 binaries of HarfBuzz that are available for download? I think it would be quite trivial to add a Pango build because AFAICS HarfBuzz uses the meson build system as well so Pango could probably be built out of the box on the machine that's currently used for building HarfBuzz and all its dependencies...

afalkenhahn avatar Jun 23 '23 12:06 afalkenhahn

@khaledhosny would know, but I think they are built automatically when a release is made, by the github CI.

AFAICS HarfBuzz uses the meson build system as well

For the windows builds I think we are still using the autotools build system:

https://github.com/harfbuzz/harfbuzz/blob/main/mingw-configure.sh

We are cross-compiling using mingw32. So if you can figure out the magic to make Pango do the same, we can ship it.

behdad avatar Jun 23 '23 13:06 behdad

We build automatically with every CI build, but publish on GitHub only when cutting releases.

Building on CI machines is PITA and I’m not super thrilled to add more things to build, in fact we try very hard to build as less dependencies as possible to avoid random breakages that are bound to happen the more code we build.

I think it should be possible for someone to make a GitHub repository that specifically builds Pango binary and publishes them, or take the issue to Python repository that I think already do Windows builds on CI and can possibly make these binaries available somehow.

khaledhosny avatar Jun 23 '23 14:06 khaledhosny

Maybe this: https://github.com/wingtk/gvsbuild

behdad avatar Jun 23 '23 14:06 behdad

Maybe this: https://github.com/wingtk/gvsbuild

Yes, that looks promising for building it myself without too much hassle but of course it's not of much use for end users. For end users it would be very convenient if I could just point them to somewhere where they can download Pango binaries for Windows and since the HarfBuzz archive that is provided for download seems to contain all Pango dependencies already I think it would make very much sense to add Pango to it as well. It's like the last piece in the puzzle missing in that archive IMHO.

afalkenhahn avatar Jun 24 '23 10:06 afalkenhahn

I appreciate that there's an archive that contains Win32/Win64 builds of HarfBuzz along with all dependencies. May I suggest that you also add a Win32/Win64 build of Pango to that archive? I think that would make life easier for lots of people and it looks like all of Pango's dependencies are already in that archive so it probably wouldn't be too much work to add Pango itself as well.

He shouldn't comment because I'm not the creator of harfbuzz. Pango 1.51.0 has plugin for harfbuzz in pango-font.h. Problem is that to activate fonts under Windows 10. I had to remove HAVE_FREETYPE, HAVE_FONTCONFIG and add HAVE_CAIRO_WIN32. Then ex. librsvg starts to read fonts installed in Windows or inform about their absence.

ffplay_rsvg.exe gvariant-byte-boundaries.svg

** (process:10756): WARNING **: 06:19:18.300: couldn't load font "DejaVu Sans Mono Not-Rotated 5.0791015625", falling back to "Sans Not-Rotated 5.0791015625", expect ugly output.

Latest ffmpeg patch for harfbuzz. Displaying subtitles. Here the font directory must be specified. However forget about displaying libass subtitles with harfbuzz, freetype, fontconfig. https://github.com/FFmpeg/FFmpeg/commit/1eeb59a2099479eeead8cdc0d4586443fb301a8a

ffplay_rsvg.exe "video.mp4" -vf "drawtext=fontsize=30:fontfile=Arial.ttf:text='hello world':x=if(eq(mod(t,30),0),rand(0,(w-text_w)),x):y=if(eq(mod(t,30),0),rand(0,(h-text_h)),y)"

Jamaika1 avatar Jun 26 '23 14:06 Jamaika1

you can look at what i wrote for the dependencies of Enlightenment : https://github.com/vtorri/ewpi I think that you can tweak it easily I think to build what ever package you want, with its dependencies. There is also an NSIS file that you can also modify if you want an NSIS installer for harfbuzz and its dependencies

vtorri avatar Sep 09 '23 03:09 vtorri