include/vcl/embeddedfontshelper.hxx |5 -
include/xmloff/xmltoken.hxx |1
vcl/Library_vcl.mk|1
vcl/source/gdi/embeddedfontshelper.cxx| 63 ++--
vcl/source/gdi/pdfwriter_impl.cxx |6 +
xmloff/source/core/xmltoken.cxx |1
xmloff/source/style/XMLFontStylesContext.cxx | 67 +-
xmloff/source/style/XMLFontStylesContext_impl.hxx | 33 ++
8 files changed, 165 insertions(+), 12 deletions(-)
New commits:
commit 5ce50b8d171c9d86d2175dd35b1e7ef23255e895
Author: Brennan Vincent brenn...@email.arizona.edu
Date: Sat Oct 5 16:50:24 2013 -0700
Respect svg:font-face-format element.
Call libeot to parse font if value embedded-opentype is found.
Change-Id: I03a072fd4db47d151a3934e959ad17c1e24fcf09
Reviewed-on: https://gerrit.libreoffice.org/6144
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
diff --git a/include/vcl/embeddedfontshelper.hxx
b/include/vcl/embeddedfontshelper.hxx
index 2250aa3..b02431e 100644
--- a/include/vcl/embeddedfontshelper.hxx
+++ b/include/vcl/embeddedfontshelper.hxx
@@ -44,10 +44,11 @@ public:
@param fontName name of the font (e.g. 'Times New Roman')
@param extra additional text to use for name (e.g. to distinguish
regular from bold, italic,...), ? for unique
@param key key to xor the data with, from the start until the key's
length (not repeated)
+ @param eot whether the data is compressed in Embedded OpenType format
*/
static bool addEmbeddedFont( com::sun::star::uno::Reference
com::sun::star::io::XInputStream stream,
const OUString fontName, const char* extra,
-std::vector unsigned char key = std::vector unsigned char ());
+std::vector unsigned char key = std::vector unsigned char (),
bool eot = false);
/**
Returns an URL for a file where to store contents of a given temporary
font.
@@ -75,7 +76,7 @@ public:
@param size size of the font data
@param rights type of operation to be allowed for the font
*/
-static bool sufficientFontRights( const void* data, long size, FontRights
rights );
+static bool sufficientTTFRights( const void* data, long size, FontRights
rights );
/**
Removes all temporary fonts in the path used by
fileUrlForTemporaryFont().
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 33f2bee..bb585c6 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -2482,6 +2482,7 @@ namespace xmloff { namespace token {
XML_FONT_FACE,
XML_FONT_FACE_SRC,
XML_FONT_FACE_URI,
+XML_FONT_FACE_FORMAT,
XML_FONT_ADORNMENTS,
XML_INCH,
XML_SPACE_AFTER,
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index fd24589..38cf55a 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -58,6 +58,7 @@ $(eval $(call gb_Library_use_custom_headers,vcl,\
$(eval $(call gb_Library_use_externals,vcl,\
jpeg \
nss3 \
+ libeot \
))
$(eval $(call gb_Library_use_libraries,vcl,\
diff --git a/vcl/source/gdi/embeddedfontshelper.cxx
b/vcl/source/gdi/embeddedfontshelper.cxx
index 3460f78..c3101df 100644
--- a/vcl/source/gdi/embeddedfontshelper.cxx
+++ b/vcl/source/gdi/embeddedfontshelper.cxx
@@ -18,16 +18,29 @@
#include vcl/svapp.hxx
#include boost/scoped_ptr.hpp
+#include boost/shared_ptr.hpp
#include fontsubset.hxx
#include outdev.h
#include outfont.hxx
#include salgdi.hxx
+#include config_eot.h
+
+#if ENABLE_EOT
+extern C
+{
+namespace libeot
+{
+#include libeot.h
+} // namespace libeot
+} // extern C
+#endif
+
using namespace com::sun::star;
using namespace vcl;
static void clearDir( const OUString path )
-{
+{
osl::Directory dir( path );
if( dir.reset() == osl::Directory::E_None )
{
@@ -53,7 +66,7 @@ void EmbeddedFontsHelper::clearTemporaryFontFiles()
}
bool EmbeddedFontsHelper::addEmbeddedFont( uno::Reference io::XInputStream
stream, const OUString fontName,
-const char* extra, std::vector unsigned char key )
+const char* extra, std::vector unsigned char key, bool eot )
{
OUString fileUrl = EmbeddedFontsHelper::fileUrlForTemporaryFont( fontName,
extra );
osl::File file( fileUrl );
@@ -78,7 +91,8 @@ bool EmbeddedFontsHelper::addEmbeddedFont( uno::Reference
io::XInputStream st
pos read keyPos key.size();
++pos )
buffer[ pos ] ^= key[ keyPos++ ];
-if( read 0 )
+// if eot, don't write the file out yet, since we need to unpack it
first.
+if( !eot read 0 )
{
sal_uInt64 writtenTotal = 0;
while( writtenTotal read )
@@ -92,13 +106,50 @@ bool EmbeddedFontsHelper::addEmbeddedFont( uno::Reference
io::XInputStream st