freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] parthw-pk-vf 46d2e1b 2/7: [tfm] Define `tfm_module_class' an


From: Parth Wazurkar
Subject: [freetype2] parthw-pk-vf 46d2e1b 2/7: [tfm] Define `tfm_module_class' and `tfm_interface'.
Date: Thu, 20 Dec 2018 13:06:36 -0500 (EST)

branch: parthw-pk-vf
commit 46d2e1bd654f9985644eff7b8a406b6599c52e1c
Author: Parth Wazurkar <address@hidden>
Commit: Parth Wazurkar <address@hidden>

    [tfm] Define `tfm_module_class' and `tfm_interface'.
    
    * src/tfm/tfmmod.c: Do it.
---
 include/freetype/internal/fttrace.h |  3 +++
 src/tfm/tfmerr.h                    | 42 +++++++++++++++++++++++++++++++
 src/tfm/tfmmod.c                    | 50 +++++++++++++++++++++++++++++++++++++
 src/tfm/tfmmod.h                    | 39 +++++++++++++++++++++++++++++
 4 files changed, 134 insertions(+)

diff --git a/include/freetype/internal/fttrace.h 
b/include/freetype/internal/fttrace.h
index f99f094..3c7f0ec 100644
--- a/include/freetype/internal/fttrace.h
+++ b/include/freetype/internal/fttrace.h
@@ -120,6 +120,9 @@ FT_TRACE_DEF( bdflib )
 FT_TRACE_DEF( pkdriver )
 FT_TRACE_DEF( pklib )
 
+  /* TFM helper module components */
+FT_TRACE_DEF( tfmobjs )
+
   /* PFR font component */
 FT_TRACE_DEF( pfr )
 
diff --git a/src/tfm/tfmerr.h b/src/tfm/tfmerr.h
new file mode 100644
index 0000000..0a1e8f8
--- /dev/null
+++ b/src/tfm/tfmerr.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+ *
+ * tfmerr.h
+ *
+ *   FreeType auxiliary TFM module error codes (specification only).
+ *
+ * Copyright 2001-2018 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT.  By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+  /**************************************************************************
+   *
+   * This file is used to define the TFM auxiliary module error enumeration
+   * constants.
+   *
+   */
+
+#ifndef TFMERR_H_
+#define TFMERR_H_
+
+#include FT_MODULE_ERRORS_H
+
+#undef FTERRORS_H_
+
+#undef  FT_ERR_PREFIX
+#define FT_ERR_PREFIX  TFM_Err_
+#define FT_ERR_BASE    FT_Mod_Err_TFM
+
+#include FT_ERRORS_H
+
+#endif /* TFMERR_H_ */
+
+
+/* END */
diff --git a/src/tfm/tfmmod.c b/src/tfm/tfmmod.c
new file mode 100644
index 0000000..9f2aaf9
--- /dev/null
+++ b/src/tfm/tfmmod.c
@@ -0,0 +1,50 @@
+/****************************************************************************
+ *
+ * tfmmod.c
+ *
+ *   FreeType auxiliary TFM module.
+ *
+ * Copyright 2000-2018 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT.  By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+#include <ft2build.h>
+#include "tfmmod.h"
+
+
+  static
+  const TFM_Interface  tfm_interface =
+  {
+    tfm_init,           /* init          */
+    tfm_parse_metrics,  /* parse metrics */
+    tfm_parse_kerns,    /* parse kerns   */
+    tfm_close,          /* done          */
+  };
+
+
+  FT_CALLBACK_TABLE_DEF
+  const FT_Module_Class  tfm_module_class =
+  {
+    0,
+    sizeof ( FT_ModuleRec ),
+    "tfm",
+    0x20000L,
+    0x20000L,
+
+    &tfm_interface,   /* module-specific interface */
+
+    (FT_Module_Constructor)NULL,  /* module_init   */
+    (FT_Module_Destructor) NULL,  /* module_done   */
+    (FT_Module_Requester)  NULL   /* get_interface */
+  };
+
+
+/* END */
diff --git a/src/tfm/tfmmod.h b/src/tfm/tfmmod.h
new file mode 100644
index 0000000..f1fec8f
--- /dev/null
+++ b/src/tfm/tfmmod.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+ *
+ * tfmmod.h
+ *
+ *   FreeType auxiliary TFM module.
+ *
+ * Copyright 2000-2018 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT.  By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+#ifndef TFMMOD_H_
+#define TFMMOD_H_
+
+
+#include <ft2build.h>
+#include FT_MODULE_H
+
+#include FT_INTERNAL_TFM_H
+
+FT_BEGIN_HEADER
+
+
+  FT_EXPORT_VAR( const FT_Module_Class )  tfm_driver_class;
+
+
+FT_END_HEADER
+
+#endif /* TFMMOD_H_ */
+
+
+/* END */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]