Author Topic: harfbuzz (TeX Live)  (Read 2260 times)

Mentore

  • Full Member
  • ***
  • Posts: 226
  • Karma: +11/-0
    • View Profile
harfbuzz (TeX Live)
« on: October 16, 2024, 02:08:41 pm »
Hello all,
I'm in the process of compiling the latest version of TeX live for OS/2.
I just stopped with a really strange error (make log attached) regarding namespaces and I can't wrap my head around it.
Searching this forum for harfbuzz I found it in the wonderful Qt6 development thread from the GOAT, Paul Smedley, so the question is:
is harfbuzz somehow available under OS/2? Or, on a second instance, is it possible to work around this (for me) never seen problem?

I feel we could use a new TeX version...

Thanks all
Mentore

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5098
  • Karma: +117/-1
    • View Profile
Re: harfbuzz (TeX Live)
« Reply #1 on: October 16, 2024, 05:30:05 pm »
As far as I know, harfbuzz has always simply compiled. Programs do change, the harfbuzz in the Mozilla tree doesn't have hb-ot-face.hh but it is relatively old. Don't have the Qt source handy here.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2288
  • Karma: +176/-0
    • View Profile
Re: harfbuzz (TeX Live)
« Reply #2 on: October 16, 2024, 09:59:33 pm »
Looking at https://github.com/psmedley/qt6-base-os2/tree/main/src/3rdparty/harfbuzz-ng it seems there were no OS/2 specific patches.

Something rings a bell about harfbuzz failing to build at some point, can you post the error you're getting and a link to the source?

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5098
  • Karma: +117/-1
    • View Profile
Re: harfbuzz (TeX Live)
« Reply #3 on: October 17, 2024, 01:00:56 am »
Mentore posted the error already. Harfbuzz is at hrafbuzz.org. Guess they've moved to Meson for building otherwise I'd try

Steven Levine

  • Newbie
  • *
  • Posts: 48
  • Karma: +10/-0
    • View Profile
Re: harfbuzz (TeX Live)
« Reply #4 on: October 17, 2024, 03:05:18 am »
This is the first time I have looked at this code, so I could easily be way offbase.

As I read the code, in Paul repo, while there may be no OS/2 specific patches, the there is OS/2 specific code.

I suspect the error is because OS2 has been defined in some header and the code does not expect this.  Here's a testcase that generates a similar error

#define HB_OT_TABLE(Namespace, Type) namespace Namespace { struct Type; }
#define OS2 4.5
namespace OT { struct OS2; }

compile this with g++ -c.


Dave Yeo

  • Hero Member
  • *****
  • Posts: 5098
  • Karma: +117/-1
    • View Profile
Re: harfbuzz (TeX Live)
« Reply #5 on: October 17, 2024, 04:35:44 am »
Possibly related to freetype2's TT_OS2 struct?
Harfbuzz is used along with freeetype2 and fontconfig, it does fine spacing between fonts and heights of ascenders and descenders or similar. Important in some Indian scripts and perhaps some Middle Eastern scripts.

The Mozilla harfbuzz does have this to quiet some stderr spamming, from hb-private.hh
Code: [Select]
#ifndef HB_INTERNAL
# if !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__OS2__)
#  define HB_INTERNAL __attribute__((__visibility__("hidden")))
# else
#  define HB_INTERNAL
# endif
#endif

Mentore

  • Full Member
  • ***
  • Posts: 226
  • Karma: +11/-0
    • View Profile
Re: harfbuzz (TeX Live)
« Reply #6 on: October 17, 2024, 10:00:26 am »
Mentore posted the error already. Harfbuzz is at hrafbuzz.org. Guess they've moved to Meson for building otherwise I'd try

Right you are David. I was thinking about porting Meson, but it seems a lot of work. Still I intend to give it a try.
In the meantime harfbuzz is still buildable with the old CMake stuff.

Mentore

Mentore

  • Full Member
  • ***
  • Posts: 226
  • Karma: +11/-0
    • View Profile
Re: harfbuzz (TeX Live)
« Reply #7 on: October 17, 2024, 10:01:35 am »
Possibly related to freetype2's TT_OS2 struct?
Harfbuzz is used along with freeetype2 and fontconfig, it does fine spacing between fonts and heights of ascenders and descenders or similar. Important in some Indian scripts and perhaps some Middle Eastern scripts.

The Mozilla harfbuzz does have this to quiet some stderr spamming, from hb-private.hh
Code: [Select]
#ifndef HB_INTERNAL
# if !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__OS2__)
#  define HB_INTERNAL __attribute__((__visibility__("hidden")))
# else
#  define HB_INTERNAL
# endif
#endif

This may be useful. Gonna try today as soon as I have time.
Mentore

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2288
  • Karma: +176/-0
    • View Profile
Re: harfbuzz (TeX Live)
« Reply #8 on: October 17, 2024, 10:25:07 am »
Mentore posted the error already. Harfbuzz is at hrafbuzz.org. Guess they've moved to Meson for building otherwise I'd try
Dug  - missed the attachment. The source at https://github.com/harfbuzz/harfbuzz still has a cmakelists.txt so will take a look

Mentore

  • Full Member
  • ***
  • Posts: 226
  • Karma: +11/-0
    • View Profile
Re: harfbuzz (TeX Live)
« Reply #9 on: October 17, 2024, 10:26:18 am »
Possibly related to freetype2's TT_OS2 struct?
Harfbuzz is used along with freeetype2 and fontconfig, it does fine spacing between fonts and heights of ascenders and descenders or similar. Important in some Indian scripts and perhaps some Middle Eastern scripts.

The Mozilla harfbuzz does have this to quiet some stderr spamming, from hb-private.hh
Code: [Select]
#ifndef HB_INTERNAL
# if !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__OS2__)
#  define HB_INTERNAL __attribute__((__visibility__("hidden")))
# else
#  define HB_INTERNAL
# endif
#endif

This may be useful. Gonna try today as soon as I have time.
Mentore

Didn't find this header in the current source tree, but I got a hint and #undef-ined OS2 from CFLAGS and CPPFLAGS.
Built without errors, just some warnings.

Will let you know how far I reach in TeX.

Mentore

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2288
  • Karma: +176/-0
    • View Profile
Re: harfbuzz (TeX Live)
« Reply #10 on: October 17, 2024, 10:43:53 am »
Yeah was about to ask what your CFLAGS are :) good stuff for working it out.

Mentore

  • Full Member
  • ***
  • Posts: 226
  • Karma: +11/-0
    • View Profile
Re: harfbuzz (TeX Live)
« Reply #11 on: October 17, 2024, 12:12:07 pm »
Yeah was about to ask what your CFLAGS are :) good stuff for working it out.

Thanks Paul, indeed I should have thought about it before :)
by the way: harfbuzz compiled OK, I'm trying to build TeX Live. Fingers crossed...

TeLLie

  • Full Member
  • ***
  • Posts: 241
  • Karma: +12/-0
    • View Profile
Re: harfbuzz (TeX Live)
« Reply #12 on: October 17, 2024, 06:49:22 pm »
Hi Mentore

Iirc Has Ko a port from meson

Just wonder did you port Harfbuzz static or shared ?

Greetz Tellie

Mentore

  • Full Member
  • ***
  • Posts: 226
  • Karma: +11/-0
    • View Profile
Re: harfbuzz (TeX Live)
« Reply #13 on: October 18, 2024, 10:20:34 am »
Hi Mentore

Iirc Has Ko a port from meson

Ah that's good! I didn't know it. Great job, Dave!

Quote
Just wonder did you port Harfbuzz static or shared ?

Greetz Tellie

Usually I build only static libraries - I'm not sure where I read it's best not to build shared libraries.
I'll give it a try, I think - by the way I'll put my work on HobbesArchive ASAP.

(In the meantime I almost completed TeX Live! Hope I'll have it done the next week.)

Mentore