diff --git a/aqua/LyX/Portfile b/aqua/LyX/Portfile index ec484532aca..624c520aa1e 100644 --- a/aqua/LyX/Portfile +++ b/aqua/LyX/Portfile @@ -93,6 +93,12 @@ variant qt4 conflicts qt5 description {Use Qt4} { --with-version-suffix=-${branch} \ --with-qt-dir=${prefix}/libexec/qt4 \ --disable-qt5 + + # QRawFont is supposed to work, but does not: + # GuiFontMetrics.cpp:127:9: error: 'QRawFont' was not declared in this scope; did you mean 'QFont'? + # Anyway, it seems to have issues in Qt4: + # https://stackoverflow.com/questions/12597595/qrawfontfromfont-not-working-correctly + patchfiles-append patch-GuiFontMetrics.cpp.diff } variant qt5 conflicts qt4 description {Use Qt5} { @@ -117,6 +123,7 @@ variant qt5 conflicts qt4 description {Use Qt5} { # error: '-fobjc-exceptions' is required to enable Objective-C exception syntax if {[string match *gcc* ${configure.compiler}]} { + # This must be set in pre-configure: pre-configure { configure.objcflags-append \ -fobjc-exceptions diff --git a/aqua/LyX/files/patch-GuiFontMetrics.cpp.diff b/aqua/LyX/files/patch-GuiFontMetrics.cpp.diff new file mode 100644 index 00000000000..301693c9bd1 --- /dev/null +++ b/aqua/LyX/files/patch-GuiFontMetrics.cpp.diff @@ -0,0 +1,19 @@ +--- src/frontends/qt4/GuiFontMetrics.cpp ++++ src/frontends/qt4/GuiFontMetrics.cpp 2024-08-30 20:05:29.000000000 +0800 +@@ -122,6 +122,8 @@ + breakat_cache_(cache_metrics_breakat_size), + qtextlayout_cache_(cache_metrics_qtextlayout_size) + { ++// For w/e reason QRawFont is not recognized, despite its header being included. ++#ifndef __APPLE__ + // Determine italic slope + double const defaultSlope = tan(qDegreesToRadians(19.0)); + QRawFont raw = QRawFont::fromFont(font); +@@ -137,6 +139,7 @@ + slope_ = -tan(qDegreesToRadians(angle)); + LYXERR(Debug::FONT, "Italic slope: " << slope_); + } ++#endif + } + +