Re: Modern font features, hacky patch

2012-11-03 Thread Khaled Hosny
On Sun, Oct 28, 2012 at 09:37:05AM +0100, Matúš Kukan wrote:
 On 28 October 2012 02:59, Khaled Hosny khaledho...@eglug.org wrote:
  Realizing that I might not get around fixing basic issues with HarfBuzz
  integration anytime soon, I'm attaching preliminary patches I've for any
  one interested in them.
 
 You set ENABLE_HARFBUZZ as TRUE / empty but use in vcl:
 ifneq ($(ENABLE_HARFBUZZ),NO) - always true

Thank you, I copied the librsvg conditional below it blindly :) A fixed
patch is attached.

Regards,
 Khaled
From 987dc147c6e86b213ddb2f914414decafe09abe4 Mon Sep 17 00:00:00 2001
From: Khaled Hosny khaledho...@eglug.org
Date: Sun, 28 Oct 2012 01:31:11 +0200
Subject: [PATCH 1/2] Add HarfBuzz support to the build system

Not used yet, and no support for local build either.

Change-Id: I7121fbe66e57eaa6be0e58451acf9a2ea7b50f59
---
 RepositoryExternal.mk |   23 +++
 config_host.mk.in |3 +++
 configure.ac  |   27 +++
 vcl/Library_vcl.mk|9 +
 4 files changed, 62 insertions(+)

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index ca87908..c5188a7 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -1530,6 +1530,29 @@ gb_LinkTarget__use_pixbuf :=
 
 endif # SYSTEM_GDKPIXBUF
 
+ifeq ($(ENABLE_HARFBUZZ),TRUE)
+
+define gb_LinkTarget__use_harfbuzz
+$(call gb_LinkTarget_set_include,$(1),\
+	$$(INCLUDE) \
+	$(HARFBUZZ_CFLAGS) \
+)
+
+$(call gb_LinkTarget_add_libs,$(1),\
+	$(HARFBUZZ_LIBS) \
+)
+
+endef
+
+else # !ENABLE_HARFBUZZ
+
+define gb_LinkTarget__use_harfbuzz
+
+endef
+
+endif # ENABLE_HARFBUZZ
+
+
 ifeq ($(SYSTEM_DB),YES)
 
 define gb_LinkTarget__use_berkeleydb
diff --git a/config_host.mk.in b/config_host.mk.in
index 0317bef..00d2bcb 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -143,6 +143,7 @@ export ENABLE_GSTREAMER_0_10=@ENABLE_GSTREAMER_0_10@
 export ENABLE_GTK3=@ENABLE_GTK3@
 export ENABLE_GTK=@ENABLE_GTK@
 export ENABLE_GTK_PRINT=@ENABLE_GTK_PRINT@
+export ENABLE_HARFBUZZ=@ENABLE_HARFBUZZ@
 export ENABLE_HEADLESS=@ENABLE_HEADLESS@
 export ENABLE_TDEAB=@ENABLE_TDEAB@
 export ENABLE_TDE=@ENABLE_TDE@
@@ -237,6 +238,8 @@ export GUIBASE=@GUIBASE@
 export GUIBASE_FOR_BUILD=@GUIBASE_FOR_BUILD@
 export GUI_FOR_BUILD=@GUI_FOR_BUILD@
 export GXX_INCLUDE_PATH=@GXX_INCLUDE_PATH@
+export HARFBUZZ_CFLAGS=@HARFBUZZ_CFLAGS@
+export HARFBUZZ_LIBS=@HARFBUZZ_LIBS@
 export HAVE_CXX0X=@HAVE_CXX0X@
 export HAVE_GCC_AVX=@HAVE_GCC_AVX@
 export HAVE_GCC_BUILTIN_ATOMIC=@HAVE_GCC_BUILTIN_ATOMIC@
diff --git a/configure.ac b/configure.ac
index 9a9689a..d2e81a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -885,6 +885,11 @@ AC_ARG_ENABLE(gio,
 [Determines whether to use the GIO support.]),
 ,enable_gio=no)
 
+AC_ARG_ENABLE(harfbuzz,
+AS_HELP_STRING([--enable-harfbuzz],
+[Determines whether to use HarfBuzz text layout engine.]),
+,enable_harfbuzz=no)
+
 AC_ARG_ENABLE(telepathy,
 AS_HELP_STRING([--enable-telepathy],
 [Determines whether to enable Telepathy for collaboration.]),
@@ -9595,6 +9600,28 @@ AC_SUBST([GTK_PRINT_LIBS])
 
 
 dnl ===
+dnl Check whether the HarfBuzz libraries are available.
+dnl ===
+
+ENABLE_HARFBUZZ=
+HARFBUZZ_CFLAGS=
+HARFBUZZ_LIBS=
+
+AC_MSG_CHECKING([whether to enable HarfBuzz support])
+if test $_os != WINNT -a $_os != Darwin -a $enable_harfbuzz = yes; then
+ENABLE_HARFBUZZ=TRUE
+AC_MSG_RESULT([yes])
+PKG_CHECK_MODULES( HARFBUZZ, harfbuzz = 0.9.3 )
+else
+AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(ENABLE_HARFBUZZ)
+AC_SUBST(HARFBUZZ_CFLAGS)
+AC_SUBST(HARFBUZZ_LIBS)
+
+
+dnl ===
 dnl Check whether the Telepathy libraries are available.
 dnl ===
 
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 1ff3339..c6e5256 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -315,6 +315,15 @@ $(eval $(call gb_Library_use_external,vcl,graphite))
 
 endif
 
+ifeq ($(ENABLE_HARFBUZZ),TRUE)
+$(eval $(call gb_Library_add_defs,vcl,\
+-DENABLE_HARFBUZZ \
+))
+
+$(eval $(call gb_Library_use_externals,vcl,harfbuzz))
+
+endif
+
 ifneq ($(ENABLE_LIBRSVG),NO)
 $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/components/rasterizer_rsvg \
-- 
1.7.9.5

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Modern font features, hacky patch

2012-10-28 Thread Matúš Kukan
On 28 October 2012 02:59, Khaled Hosny khaledho...@eglug.org wrote:
 Realizing that I might not get around fixing basic issues with HarfBuzz
 integration anytime soon, I'm attaching preliminary patches I've for any
 one interested in them.

You set ENABLE_HARFBUZZ as TRUE / empty but use in vcl:
ifneq ($(ENABLE_HARFBUZZ),NO) - always true
Otherwise the first one looks good and I can't decide about the second one.
Maybe someone will just push them and correct this small problem.

Best,
Matus
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Modern font features, hacky patch

2012-10-27 Thread Khaled Hosny
On Fri, Sep 07, 2012 at 06:43:26PM +0200, Khaled Hosny wrote:
 On Fri, Sep 07, 2012 at 05:18:46PM +0100, Caolán McNamara wrote:
  On Sat, 2012-07-21 at 18:20 +0200, Khaled Hosny wrote:
   Here is a very crude, WIP patch. It adds --enable-harfbuzz configure
   option, plus some (very broken) harfbuzz layout code, but I can't get
   the ENABLE_HARFBUZZ to propagate in and thus can't do any testing
   because the code is never compiled. I appreciate any insights on how to
   get this to work.
  
  You need to put harfbuzz in the gb_Library_use_externals section of
  Library_vcl.mk (or whichever is the right .mk file in vcl)
  
  It would be nice to get this feature in as a compile time option for
  experimenting with.
 
 I’ve some code that more or less works (as in displaying some text), but
 it crashes like hell, I'm yet to figure out what is going on (I think
 I've to override more members of ServerFontLayout to make things saner).

Realizing that I might not get around fixing basic issues with HarfBuzz
integration anytime soon, I'm attaching preliminary patches I've for any
one interested in them. So far LTR text works fine, RTL horizontal
offsets (e.g. kerning) seems to be applied in the wrong direction,
probably the same old issue with ICU that we band aided a while ago,
which seems to be because of (Generic)SalLayout::AdjustLayout and
::Justify doing tricks with glyph advances and offsets (I've hard time
wrapping my head around all this SalLayout, GenericSalLayout,
MultiSalLayout etc. we really should consolidate this stuff now that we
have only one shaping path on *nix).

Regards,
 Khaled
From 6a05198fcf86af5d8898430077705920b71ff64b Mon Sep 17 00:00:00 2001
From: Khaled Hosny khaledho...@eglug.org
Date: Sun, 28 Oct 2012 01:31:11 +0200
Subject: [PATCH 1/2] Add HarfBuzz support to the build system

Not used yet, and no support for local build either.

Change-Id: I7121fbe66e57eaa6be0e58451acf9a2ea7b50f59
---
 RepositoryExternal.mk |   23 +++
 config_host.mk.in |3 +++
 configure.ac  |   27 +++
 vcl/Library_vcl.mk|9 +
 4 files changed, 62 insertions(+)

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index e08beec..22aa2a0 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -1498,6 +1498,29 @@ gb_LinkTarget__use_pixbuf :=
 
 endif # SYSTEM_GDKPIXBUF
 
+ifeq ($(ENABLE_HARFBUZZ),TRUE)
+
+define gb_LinkTarget__use_harfbuzz
+$(call gb_LinkTarget_set_include,$(1),\
+	$$(INCLUDE) \
+	$(HARFBUZZ_CFLAGS) \
+)
+
+$(call gb_LinkTarget_add_libs,$(1),\
+	$(HARFBUZZ_LIBS) \
+)
+
+endef
+
+else # !ENABLE_HARFBUZZ
+
+define gb_LinkTarget__use_harfbuzz
+
+endef
+
+endif # ENABLE_HARFBUZZ
+
+
 ifeq ($(SYSTEM_DB),YES)
 
 define gb_LinkTarget__use_berkeleydb
diff --git a/config_host.mk.in b/config_host.mk.in
index 9a5fbfd..8322624 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -145,6 +145,7 @@ export ENABLE_GSTREAMER_0_10=@ENABLE_GSTREAMER_0_10@
 export ENABLE_GTK3=@ENABLE_GTK3@
 export ENABLE_GTK=@ENABLE_GTK@
 export ENABLE_GTK_PRINT=@ENABLE_GTK_PRINT@
+export ENABLE_HARFBUZZ=@ENABLE_HARFBUZZ@
 export ENABLE_HEADLESS=@ENABLE_HEADLESS@
 export ENABLE_TDEAB=@ENABLE_TDEAB@
 export ENABLE_TDE=@ENABLE_TDE@
@@ -240,6 +241,8 @@ export GUIBASE=@GUIBASE@
 export GUIBASE_FOR_BUILD=@GUIBASE_FOR_BUILD@
 export GUI_FOR_BUILD=@GUI_FOR_BUILD@
 export GXX_INCLUDE_PATH=@GXX_INCLUDE_PATH@
+export HARFBUZZ_CFLAGS=@HARFBUZZ_CFLAGS@
+export HARFBUZZ_LIBS=@HARFBUZZ_LIBS@
 export HAVE_CXX0X=@HAVE_CXX0X@
 export HAVE_GCC_AVX=@HAVE_GCC_AVX@
 export HAVE_GCC_BUILTIN_ATOMIC=@HAVE_GCC_BUILTIN_ATOMIC@
diff --git a/configure.ac b/configure.ac
index 6f654a2..a260cc4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -886,6 +886,11 @@ AC_ARG_ENABLE(gio,
 [Determines whether to use the GIO support.]),
 ,enable_gio=no)
 
+AC_ARG_ENABLE(harfbuzz,
+AS_HELP_STRING([--enable-harfbuzz],
+[Determines whether to use HarfBuzz text layout engine.]),
+,enable_harfbuzz=no)
+
 AC_ARG_ENABLE(telepathy,
 AS_HELP_STRING([--enable-telepathy],
 [Determines whether to enable Telepathy for collaboration.]),
@@ -9582,6 +9587,28 @@ AC_SUBST([GTK_PRINT_LIBS])
 
 
 dnl ===
+dnl Check whether the HarfBuzz libraries are available.
+dnl ===
+
+ENABLE_HARFBUZZ=
+HARFBUZZ_CFLAGS=
+HARFBUZZ_LIBS=
+
+AC_MSG_CHECKING([whether to enable HarfBuzz support])
+if test $_os != WINNT -a $_os != Darwin -a $enable_harfbuzz = yes; then
+ENABLE_HARFBUZZ=TRUE
+AC_MSG_RESULT([yes])
+PKG_CHECK_MODULES( HARFBUZZ, harfbuzz = 0.9.3 )
+else
+AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(ENABLE_HARFBUZZ)
+AC_SUBST(HARFBUZZ_CFLAGS)
+AC_SUBST(HARFBUZZ_LIBS)
+
+
+dnl ===
 dnl Check whether the Telepathy libraries are available.
 dnl 

Re: Modern font features, hacky patch

2012-09-07 Thread Caolán McNamara
On Sat, 2012-07-21 at 18:20 +0200, Khaled Hosny wrote:
 Here is a very crude, WIP patch. It adds --enable-harfbuzz configure
 option, plus some (very broken) harfbuzz layout code, but I can't get
 the ENABLE_HARFBUZZ to propagate in and thus can't do any testing
 because the code is never compiled. I appreciate any insights on how to
 get this to work.

You need to put harfbuzz in the gb_Library_use_externals section of
Library_vcl.mk (or whichever is the right .mk file in vcl)

It would be nice to get this feature in as a compile time option for
experimenting with.

C.

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Modern font features, hacky patch

2012-09-07 Thread Khaled Hosny
On Fri, Sep 07, 2012 at 05:18:46PM +0100, Caolán McNamara wrote:
 On Sat, 2012-07-21 at 18:20 +0200, Khaled Hosny wrote:
  Here is a very crude, WIP patch. It adds --enable-harfbuzz configure
  option, plus some (very broken) harfbuzz layout code, but I can't get
  the ENABLE_HARFBUZZ to propagate in and thus can't do any testing
  because the code is never compiled. I appreciate any insights on how to
  get this to work.
 
 You need to put harfbuzz in the gb_Library_use_externals section of
 Library_vcl.mk (or whichever is the right .mk file in vcl)
 
 It would be nice to get this feature in as a compile time option for
 experimenting with.

I’ve some code that more or less works (as in displaying some text), but
it crashes like hell, I'm yet to figure out what is going on (I think
I've to override more members of ServerFontLayout to make things saner).

Regards,
 Khaled
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Modern font features, hacky patch

2012-07-21 Thread Khaled Hosny
On Sat, Jul 21, 2012 at 03:08:20AM +0200, Khaled Hosny wrote:
 On Fri, Mar 30, 2012 at 03:27:39PM +0100, Caolán McNamara wrote:
  On Fri, 2012-03-30 at 16:13 +0200, Khaled Hosny wrote:
   If there is interest in this, I can try implementing optional HarfBuzz
   support next to ICU so we can experiment more with this (though I'm not
   the best person to do this, but I can try).
  
  Can't hurt to give it a go anyway. Even epic failure can point the next
  person in the right way to go. Yeah lacking Indic shaping would be a
  problem for right now.
 
 Indic scripts are supported now (git master, not released yet), and
 given HarfBuzz track record, it should even be better than ICU layout
 engine which is essentially put on ventilator (pun intended), so now is
 a good time to experiment, but I didn't manage to try doing it yet.

Here is a very crude, WIP patch. It adds --enable-harfbuzz configure
option, plus some (very broken) harfbuzz layout code, but I can't get
the ENABLE_HARFBUZZ to propagate in and thus can't do any testing
because the code is never compiled. I appreciate any insights on how to
get this to work.

Regards,
 Khaled
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 26676a7..4e0fc20 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -1110,6 +1110,29 @@ endef
 endif # ENABLE_TELEPATHY
 
 
+ifeq ($(ENABLE_HARFBUZZ),TRUE)
+
+define gb_LinkTarget__use_harfbuzz
+$(call gb_LinkTarget_set_include,$(1),\
+	$$(INCLUDE) \
+	$(HARFBUZZ_CFLAGS) \
+)
+
+$(call gb_LinkTarget_add_libs,$(1),\
+	$(HARFBUZZ_LIBS) \
+)
+
+endef
+
+else # !ENABLE_HARFBUZZ
+
+define gb_LinkTarget__use_harfbuzz
+
+endef
+
+endif # ENABLE_HARFBUZZ
+
+
 ifeq ($(SYSTEM_DB),YES)
 
 define gb_LinkTarget__use_berkeleydb
diff --git a/config_host.mk.in b/config_host.mk.in
index 5e24730..3f3bf1f 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -116,6 +116,7 @@ export ENABLE_GSTREAMER=@ENABLE_GSTREAMER@
 export ENABLE_GTK3=@ENABLE_GTK3@
 export ENABLE_GTK=@ENABLE_GTK@
 export ENABLE_GTK_PRINT=@ENABLE_GTK_PRINT@
+export ENABLE_HARFBUZZ=@ENABLE_HARFBUZZ@
 export ENABLE_HEADLESS=@ENABLE_HEADLESS@
 export ENABLE_TDEAB=@ENABLE_TDEAB@
 export ENABLE_TDE=@ENABLE_TDE@
@@ -199,6 +200,8 @@ export GUIBASE=@GUIBASE@
 export GUIBASE_FOR_BUILD=@GUIBASE_FOR_BUILD@
 export GUI_FOR_BUILD=@GUI_FOR_BUILD@
 export GXX_INCLUDE_PATH=@GXX_INCLUDE_PATH@
+export HARFBUZZ_FLAGS=@HARFBUZZ_CFLAGS@
+export HARFBUZZ_LIBS=@HARFBUZZ_LIBS@
 export HAVE_CXX0X=@HAVE_CXX0X@
 export HAVE_GCC_AVX=@HAVE_GCC_AVX@
 export HAVE_GCC_GGDB2=@HAVE_GCC_GGDB2@
diff --git a/configure.in b/configure.in
index 980a2fb..86334ce 100644
--- a/configure.in
+++ b/configure.in
@@ -796,6 +796,11 @@ AC_ARG_ENABLE(gio,
 [Determines whether to use the GIO support.]),
 ,enable_gio=no)
 
+AC_ARG_ENABLE(harfbuzz,
+AS_HELP_STRING([--enable-harfbuzz],
+[Determines whether to use HarfBuzz text layout engine.]),
+,enable_harfbuzz=no)
+
 AC_ARG_ENABLE(telepathy,
 AS_HELP_STRING([--enable-telepathy],
 [Determines whether to enable Telepathy for collaboration.]),
@@ -8969,6 +8974,28 @@ AC_SUBST([GTK_PRINT_LIBS])
 
 
 dnl ===
+dnl Check whether the HarfBuzz libraries are available.
+dnl ===
+
+ENABLE_HARFBUZZ=
+HARFBUZZ_CFLAGS=
+HARFBUZZ_LIBS=
+
+AC_MSG_CHECKING([whether to enable HarfBuzz support])
+if test $_os != WINNT -a $_os != Darwin -a $enable_harfbuzz = yes; then
+ENABLE_HARFBUZZ=TRUE
+AC_MSG_RESULT([yes])
+PKG_CHECK_MODULES( HARFBUZZ, harfbuzz = 0.9.0 )
+else
+AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(ENABLE_HARFBUZZ)
+AC_SUBST(HARFBUZZ_CFLAGS)
+AC_SUBST(HARFBUZZ_LIBS)
+
+
+dnl ===
 dnl Check whether the Telepathy libraries are available.
 dnl ===
 
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index cd6b96c..be327e2 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -35,9 +35,14 @@
 #include sal/alloca.h
 #include rtl/instance.hxx
 
+#ifdef ENABLE_HARFBUZZ
+#include hb-ft.h
+#include hb-icu.h
+#else
 #include layout/LayoutEngine.h
 #include layout/LEFontInstance.h
 #include layout/LEScripts.h
+#endif // ENABLE_HARFBUZZ
 
 #include unicode/uscript.h
 #include unicode/ubidi.h
@@ -156,6 +161,99 @@ bool ServerFontLayoutEngine::operator()( ServerFontLayout rLayout, ImplLayoutAr
 return true;
 }
 
+#ifdef ENABLE_HARFBUZZ
+class HbLayoutEngine : public ServerFontLayoutEngine
+{
+private:
+
+public:
+HbLayoutEngine( ServerFont );
+virtual ~HbLayoutEngine();
+
+virtual booloperator()( ServerFontLayout, ImplLayoutArgs );
+};
+
+HbLayoutEngine::HbLayoutEngine( ServerFont rServerFont )
+:   mrServerFont( rFont )
+{}
+

Re: Modern font features, hacky patch

2012-07-21 Thread Norbert Thiebaud
On Sat, Jul 21, 2012 at 11:20 AM, Khaled Hosny khaledho...@eglug.org wrote:
 On Sat, Jul 21, 2012 at 03:08:20AM +0200, Khaled Hosny wrote:
 On Fri, Mar 30, 2012 at 03:27:39PM +0100, Caolán McNamara wrote:
  On Fri, 2012-03-30 at 16:13 +0200, Khaled Hosny wrote:
   If there is interest in this, I can try implementing optional HarfBuzz
   support next to ICU so we can experiment more with this (though I'm not
   the best person to do this, but I can try).
 
  Can't hurt to give it a go anyway. Even epic failure can point the next
  person in the right way to go. Yeah lacking Indic shaping would be a
  problem for right now.

 Indic scripts are supported now (git master, not released yet), and
 given HarfBuzz track record, it should even be better than ICU layout
 engine which is essentially put on ventilator (pun intended), so now is
 a good time to experiment, but I didn't manage to try doing it yet.

 Here is a very crude, WIP patch. It adds --enable-harfbuzz configure
 option, plus some (very broken) harfbuzz layout code, but I can't get
 the ENABLE_HARFBUZZ to propagate in and thus can't do any testing
 because the code is never compiled. I appreciate any insights on how to
 get this to work.

oh... if you want it as a define too accessible for sources (and not
just makefile level define)
you need
SCPDEFS=$SCPDEFS -DENABLE_HARFUZZ
 in configure.in arount where you set ENABLE_HARFUZZ=YESS

Norbert
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Modern font features, hacky patch

2012-07-21 Thread Khaled Hosny
On Sat, Jul 21, 2012 at 09:51:09PM +0200, Matúš Kukan wrote:
 On 21 July 2012 18:20, Khaled Hosny khaledho...@eglug.org wrote:
  Here is a very crude, WIP patch. It adds --enable-harfbuzz configure
  option, plus some (very broken) harfbuzz layout code, but I can't get
  the ENABLE_HARFBUZZ to propagate in and thus can't do any testing
  because the code is never compiled. I appreciate any insights on how to
  get this to work.
 
 +export HARFBUZZ_FLAGS=@HARFBUZZ_CFLAGS@
 should be
 +export HARFBUZZ_CFLAGS=@HARFBUZZ_CFLAGS@
 
 You want to add:
 +$(call gb_LinkTarget_add_defs,$(1),\
 +-DENABLE_HARFBUZZ \
 +)
 into RepositoryExternal.mk
 and use it as
 +$(eval $(call gb_Library_use_externals,vcl,harfbuzz))
 in vcl/Library_vcl.mk

I tried this already but didn't work, now I why, thanks.

Regards,
 Khaled
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Modern font features, hacky patch

2012-07-20 Thread Khaled Hosny
On Fri, Mar 30, 2012 at 03:27:39PM +0100, Caolán McNamara wrote:
 On Fri, 2012-03-30 at 16:13 +0200, Khaled Hosny wrote:
  If there is interest in this, I can try implementing optional HarfBuzz
  support next to ICU so we can experiment more with this (though I'm not
  the best person to do this, but I can try).
 
 Can't hurt to give it a go anyway. Even epic failure can point the next
 person in the right way to go. Yeah lacking Indic shaping would be a
 problem for right now.

Indic scripts are supported now (git master, not released yet), and
given HarfBuzz track record, it should even be better than ICU layout
engine which is essentially put on ventilator (pun intended), so now is
a good time to experiment, but I didn't manage to try doing it yet.

Regards,
 Khaled
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Modern font features, hacky patch

2012-03-30 Thread Caolán McNamara
On Fri, 2012-03-30 at 11:39 +0200, Steve White wrote:
 Basic features
 ==
 (Background reading: search for typographic features, font feature
 registry, layout tag registry.)
 
 Some features that really ought to be activated most of the time, in
 most scripts
 * ligatures for Latin and most alphabetic scripts
 * localized replacement (based on text language, region)
 * pair kerning
 * mark positioning

So, I asked Steve to post to the list, so I could dump some experimental
code to a wider audience with its context

Lets put graphite aside for a moment, its something of a red herring
really for a lot of these things. 

If we look at 
https://bugs.freedesktop.org/show_bug.cgi?id=31821
I've a patch there that shows that a lot of our woes with otf fonts is
probably a simple bug/lack of implementation in out ServerFont::GetTable
that it doesn't handle OpenType. freetype does it fine, but we're not
using freetype to get the tables, but parsing them outselves.

Patch at fdo#31821 
a) hacks in using freetype to get the tables (does anyone know if there
a freetype api to just get the offset of a table and not a full copy of
it ?, we've already mmapped the file so we don't need to copy them)
b) hacks in using the icu layout engine for all text, and not just for
CTL text. I wonder if its just a performance reason that we have out own
simple font engine for the non-CTL case ?
c) overrides IcuFontFromServerFont::mapCharToGlyph to not filter out the
zero width joiner glyphs before applying the gsub table. The icu Indic
layout engine doesn't filter it, not sure why the non-Indic ones *do*
filter it.

So, I reckon we should continue to refactor out font handling code to
remove various custom ttf/otf parsing and try and use more of the
freetype apis so that LibreOffice gets to know about GSUB etc tables in
opentype fonts, and maybe look into removing the simple font layout
engine and just use the icu one for all fonts. 

C.

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Modern font features, hacky patch

2012-03-30 Thread Khaled Hosny
On Fri, Mar 30, 2012 at 01:11:59PM +0100, Caolán McNamara wrote:
 On Fri, 2012-03-30 at 11:39 +0200, Steve White wrote:
  Basic features
  ==
  (Background reading: search for typographic features, font feature
  registry, layout tag registry.)
  
  Some features that really ought to be activated most of the time, in
  most scripts
  * ligatures for Latin and most alphabetic scripts
  * localized replacement (based on text language, region)
  * pair kerning
  * mark positioning
 
 So, I asked Steve to post to the list, so I could dump some experimental
 code to a wider audience with its context
 
 Lets put graphite aside for a moment, its something of a red herring
 really for a lot of these things. 
 
 If we look at 
 https://bugs.freedesktop.org/show_bug.cgi?id=31821
 I've a patch there that shows that a lot of our woes with otf fonts is
 probably a simple bug/lack of implementation in out ServerFont::GetTable
 that it doesn't handle OpenType. freetype does it fine, but we're not
 using freetype to get the tables, but parsing them outselves.
 
 Patch at fdo#31821 
 a) hacks in using freetype to get the tables (does anyone know if there
 a freetype api to just get the offset of a table and not a full copy of
 it ?, we've already mmapped the file so we don't need to copy them)
 b) hacks in using the icu layout engine for all text, and not just for
 CTL text. I wonder if its just a performance reason that we have out own
 simple font engine for the non-CTL case ?
 c) overrides IcuFontFromServerFont::mapCharToGlyph to not filter out the
 zero width joiner glyphs before applying the gsub table. The icu Indic
 layout engine doesn't filter it, not sure why the non-Indic ones *do*
 filter it.
 
 So, I reckon we should continue to refactor out font handling code to
 remove various custom ttf/otf parsing and try and use more of the
 freetype apis so that LibreOffice gets to know about GSUB etc tables in
 opentype fonts, and maybe look into removing the simple font layout
 engine and just use the icu one for all fonts. 

For a while now I had the idea that we should move away from ICU layout
engine (which is pretty dead and serious bugs aren't fixed anymore), and
replace it with HarfBuzz, but HarfBuzz's Indic support is not finished
(Arabic and simple scripts are fine) and I'm waiting for its next
release for that. HarfBuzz is more active, more developer friendly
(though under documented at the moment) and its code base have been
widely used in free software applications (more tested) and is the most
feature rich free OpenType implementation. HarfBuzz would make it much
simpler to implement many of the points raised above, which would be
near impossible with ICU layout engine.

But regardless of the layout engine we use, this only affects
non-Windows non-Mac platforms, while on Windows we use Uniscribe and on
Mac we use, the now deprecated, ATSUI, which is IMHO another limitation
that we should get rid of and move to a unified text layout engine in
all platforms (which would solve lack of OpenType support on Mac).
Firefox have been doing that lately, and IMO it has the best typographic
support of all browsers.

If there is interest in this, I can try implementing optional HarfBuzz
support next to ICU so we can experiment more with this (though I'm not
the best person to do this, but I can try).

Regards,
 Khaled
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Modern font features, hacky patch

2012-03-30 Thread Caolán McNamara
On Fri, 2012-03-30 at 16:13 +0200, Khaled Hosny wrote:
 But regardless of the layout engine we use, this only affects
 non-Windows non-Mac platforms, while on Windows we use Uniscribe and on
 Mac we use, the now deprecated, ATSUI, which is IMHO another limitation
 that we should get rid of

I can't really speak for the other platforms unfortunately. They need
platform-specific love.

 If there is interest in this, I can try implementing optional HarfBuzz
 support next to ICU so we can experiment more with this (though I'm not
 the best person to do this, but I can try).

Can't hurt to give it a go anyway. Even epic failure can point the next
person in the right way to go. Yeah lacking Indic shaping would be a
problem for right now.

C.

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice