Enable HarfBuzz by default
HarfBuzz integration should be functional now, so to give it more wider testing it is made now a required dependency on non-Windows non-Mac OSs. By default text layout is now done by HarfBuzz but ICU LayoutEngine is kept as a fallback and can be enabled with SAL_USE_ICULE env variable. After 4.1.x is branched, ICU LayoutEngine should be removed completely. Change-Id: I4fe3beeaf6092f33dd436906c11b83aeafdfbd5d
This commit is contained in:
@@ -1,6 +0,0 @@
|
|||||||
#ifndef CONFIG_HARFBUZZ_H
|
|
||||||
#define CONFIG_HARFBUZZ_H
|
|
||||||
|
|
||||||
#define ENABLE_HARFBUZZ 0
|
|
||||||
|
|
||||||
#endif
|
|
@@ -720,11 +720,6 @@ AC_ARG_ENABLE(graphite,
|
|||||||
[Enables the compilation of Graphite smart font rendering.])
|
[Enables the compilation of Graphite smart font rendering.])
|
||||||
)
|
)
|
||||||
|
|
||||||
AC_ARG_ENABLE(harfbuzz,
|
|
||||||
AS_HELP_STRING([--enable-harfbuzz],
|
|
||||||
[Determines whether to use HarfBuzz text layout engine.])
|
|
||||||
)
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(fetch-external,
|
AC_ARG_ENABLE(fetch-external,
|
||||||
AS_HELP_STRING([--disable-fetch-external],
|
AS_HELP_STRING([--disable-fetch-external],
|
||||||
[Disables fetching external tarballs from web sources.])
|
[Disables fetching external tarballs from web sources.])
|
||||||
@@ -8482,10 +8477,9 @@ dnl ===================================================================
|
|||||||
dnl HarfBuzz
|
dnl HarfBuzz
|
||||||
dnl ===================================================================
|
dnl ===================================================================
|
||||||
AC_MSG_CHECKING([whether to enable HarfBuzz support])
|
AC_MSG_CHECKING([whether to enable HarfBuzz support])
|
||||||
if test "$_os" != "WINNT" -a "$_os" != "Darwin" && test "$enable_harfbuzz" = "" -o "$enable_harfbuzz" != "no"; then
|
if test "$_os" != "WINNT" -a "$_os" != "Darwin"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
ENABLE_HARFBUZZ="TRUE"
|
ENABLE_HARFBUZZ="TRUE"
|
||||||
AC_DEFINE(ENABLE_HARFBUZZ)
|
|
||||||
libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz >= 0.9.10])
|
libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz >= 0.9.10])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
@@ -11978,7 +11972,6 @@ AC_CONFIG_HEADERS([config_host/config_clang.h])
|
|||||||
AC_CONFIG_HEADERS([config_host/config_features.h])
|
AC_CONFIG_HEADERS([config_host/config_features.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_global.h])
|
AC_CONFIG_HEADERS([config_host/config_global.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_graphite.h])
|
AC_CONFIG_HEADERS([config_host/config_graphite.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_harfbuzz.h])
|
|
||||||
AC_CONFIG_HEADERS([config_host/config_lgpl.h])
|
AC_CONFIG_HEADERS([config_host/config_lgpl.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_kde4.h])
|
AC_CONFIG_HEADERS([config_host/config_kde4.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_mingw.h])
|
AC_CONFIG_HEADERS([config_host/config_mingw.h])
|
||||||
|
@@ -17,7 +17,6 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config_harfbuzz.h>
|
|
||||||
#include <gcach_ftyp.hxx>
|
#include <gcach_ftyp.hxx>
|
||||||
#include <sallayout.hxx>
|
#include <sallayout.hxx>
|
||||||
#include <salgdi.hxx>
|
#include <salgdi.hxx>
|
||||||
@@ -31,10 +30,9 @@
|
|||||||
#include <sal/alloca.h>
|
#include <sal/alloca.h>
|
||||||
#include <rtl/instance.hxx>
|
#include <rtl/instance.hxx>
|
||||||
|
|
||||||
#if ENABLE_HARFBUZZ
|
|
||||||
#include <harfbuzz/hb-icu.h>
|
#include <harfbuzz/hb-icu.h>
|
||||||
#include <harfbuzz/hb-ot.h>
|
#include <harfbuzz/hb-ot.h>
|
||||||
#endif
|
|
||||||
#include <layout/LayoutEngine.h>
|
#include <layout/LayoutEngine.h>
|
||||||
#include <layout/LEFontInstance.h>
|
#include <layout/LEFontInstance.h>
|
||||||
#include <layout/LELanguages.h>
|
#include <layout/LELanguages.h>
|
||||||
@@ -50,10 +48,7 @@
|
|||||||
ServerFontLayout::ServerFontLayout( ServerFont& rFont )
|
ServerFontLayout::ServerFontLayout( ServerFont& rFont )
|
||||||
: mrServerFont( rFont )
|
: mrServerFont( rFont )
|
||||||
{
|
{
|
||||||
bUseHarfBuzz = false;
|
bUseHarfBuzz = (getenv("SAL_USE_ICULE") == NULL);
|
||||||
#if ENABLE_HARFBUZZ
|
|
||||||
bUseHarfBuzz = (getenv("SAL_USE_HARFBUZZ") != NULL);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerFontLayout::DrawText( SalGraphics& rSalGraphics ) const
|
void ServerFontLayout::DrawText( SalGraphics& rSalGraphics ) const
|
||||||
@@ -208,7 +203,6 @@ static bool needNextCode(sal_Unicode cChar)
|
|||||||
return lcl_CharIsJoiner(cChar) || U16_IS_TRAIL(cChar);
|
return lcl_CharIsJoiner(cChar) || U16_IS_TRAIL(cChar);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_HARFBUZZ
|
|
||||||
static hb_blob_t *getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData)
|
static hb_blob_t *getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData)
|
||||||
{
|
{
|
||||||
char pTagName[5];
|
char pTagName[5];
|
||||||
@@ -537,7 +531,6 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif // ENABLE_HARFBUZZ
|
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
// bridge to ICU LayoutEngine
|
// bridge to ICU LayoutEngine
|
||||||
@@ -1214,12 +1207,10 @@ ServerFontLayoutEngine* ServerFont::GetLayoutEngine(bool bUseHarfBuzz)
|
|||||||
{
|
{
|
||||||
// find best layout engine for font, platform, script and language
|
// find best layout engine for font, platform, script and language
|
||||||
if (!mpLayoutEngine) {
|
if (!mpLayoutEngine) {
|
||||||
#if ENABLE_HARFBUZZ
|
|
||||||
if (bUseHarfBuzz)
|
if (bUseHarfBuzz)
|
||||||
mpLayoutEngine = new HbLayoutEngine(*this);
|
mpLayoutEngine = new HbLayoutEngine(*this);
|
||||||
else
|
else
|
||||||
#endif
|
mpLayoutEngine = new IcuLayoutEngine(*this);
|
||||||
mpLayoutEngine = new IcuLayoutEngine(*this);
|
|
||||||
}
|
}
|
||||||
return mpLayoutEngine;
|
return mpLayoutEngine;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user