2012-05-23 15:59:26 +00:00
|
|
|
diff --git a/gfx/ots/include/opentype-sanitiser.h b/gfx/ots/include/opentype-sanitiser.h
|
|
|
|
--- a/gfx/ots/include/opentype-sanitiser.h
|
|
|
|
+++ b/gfx/ots/include/opentype-sanitiser.h
|
|
|
|
@@ -1,15 +1,35 @@
|
|
|
|
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef OPENTYPE_SANITISER_H_
|
|
|
|
#define OPENTYPE_SANITISER_H_
|
|
|
|
|
|
|
|
+#if defined(_WIN32) || defined(__CYGWIN__)
|
|
|
|
+ #define OTS_DLL_IMPORT __declspec(dllimport)
|
|
|
|
+ #define OTS_DLL_EXPORT __declspec(dllexport)
|
|
|
|
+#else
|
|
|
|
+ #if __GNUC__ >= 4
|
|
|
|
+ #define OTS_DLL_IMPORT __attribute__((visibility ("default")))
|
|
|
|
+ #define OTS_DLL_EXPORT __attribute__((visibility ("default")))
|
|
|
|
+ #endif
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifdef OTS_DLL
|
|
|
|
+ #ifdef OTS_DLL_EXPORTS
|
|
|
|
+ #define OTS_API OTS_DLL_EXPORT
|
|
|
|
+ #else
|
|
|
|
+ #define OTS_API OTS_DLL_IMPORT
|
|
|
|
+ #endif
|
|
|
|
+#else
|
|
|
|
+ #define OTS_API
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#include <stdlib.h>
|
|
|
|
typedef signed char int8_t;
|
|
|
|
typedef unsigned char uint8_t;
|
|
|
|
typedef short int16_t;
|
|
|
|
typedef unsigned short uint16_t;
|
|
|
|
typedef int int32_t;
|
|
|
|
typedef unsigned int uint32_t;
|
2014-10-09 07:43:30 +00:00
|
|
|
@@ -187,17 +207,17 @@ class OTSStream {
|
2014-01-31 15:09:09 +00:00
|
|
|
|
2014-08-23 14:12:00 +00:00
|
|
|
enum TableAction {
|
|
|
|
TABLE_ACTION_DEFAULT, // Use OTS's default action for that table
|
|
|
|
TABLE_ACTION_SANITIZE, // Sanitize the table, potentially droping it
|
|
|
|
TABLE_ACTION_PASSTHRU, // Serialize the table unchanged
|
|
|
|
TABLE_ACTION_DROP // Drop the table
|
|
|
|
};
|
2014-01-31 15:09:09 +00:00
|
|
|
|
2014-06-05 15:09:00 +00:00
|
|
|
-class OTSContext {
|
|
|
|
+class OTS_API OTSContext {
|
|
|
|
public:
|
2014-08-23 14:12:00 +00:00
|
|
|
OTSContext() {}
|
2014-11-17 15:24:05 +00:00
|
|
|
virtual ~OTSContext() {}
|
2012-05-23 15:59:26 +00:00
|
|
|
|
2014-08-23 14:12:00 +00:00
|
|
|
// Process a given OpenType file and write out a sanitised version
|
|
|
|
// output: a pointer to an object implementing the OTSStream interface. The
|
|
|
|
// sanitisied output will be written to this. In the even of a failure,
|
|
|
|
// partial output may have been written.
|
2014-10-09 07:43:30 +00:00
|
|
|
@@ -222,13 +242,13 @@ class OTSContext {
|
|
|
|
// For backward compatibility - remove once Chrome switches over to the new API.
|
|
|
|
bool Process(OTSStream *output, const uint8_t *input, size_t length);
|
|
|
|
|
|
|
|
// Force to disable debug output even when the library is compiled with
|
|
|
|
// -DOTS_DEBUG.
|
|
|
|
void DisableDebugOutput();
|
|
|
|
|
|
|
|
// Enable WOFF2 support(experimental).
|
|
|
|
-void EnableWOFF2();
|
|
|
|
+void OTS_API EnableWOFF2();
|
|
|
|
|
|
|
|
} // namespace ots
|
|
|
|
|
|
|
|
#endif // OPENTYPE_SANITISER_H_
|