freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] parthw-cleaned 5d2f941 3/6: [tfm] Add new `tfm' auxiliary mo


From: Parth Wazurkar
Subject: [freetype2] parthw-cleaned 5d2f941 3/6: [tfm] Add new `tfm' auxiliary module.
Date: Thu, 26 Jul 2018 16:16:32 -0400 (EDT)

branch: parthw-cleaned
commit 5d2f9417626a7f067704098befb21410a32d8a84
Author: Parth Wazurkar <address@hidden>
Commit: Parth Wazurkar <address@hidden>

    [tfm] Add new `tfm' auxiliary module.
    
    * include/freetype/internal/tfm.h:
      - Add TFM_FontInfoRec to accomodate TFM metric data.
      - Define TFM_ParserRec to parse the metric data from
        input `tfm' file.
      - Define TFM_ServiceRec to provide functions to do it.
---
 include/freetype/internal/internal.h |   2 +
 include/freetype/internal/tfm.h      | 138 +++++++++++++++++++++++++++++++++++
 2 files changed, 140 insertions(+)

diff --git a/include/freetype/internal/internal.h 
b/include/freetype/internal/internal.h
index 8261043..c24be48 100644
--- a/include/freetype/internal/internal.h
+++ b/include/freetype/internal/internal.h
@@ -50,6 +50,8 @@
 #define FT_INTERNAL_CFF_TYPES_H           <freetype/internal/cfftypes.h>
 #define FT_INTERNAL_CFF_OBJECTS_TYPES_H   <freetype/internal/cffotypes.h>
 
+#define FT_INTERNAL_TFM_H                 <freetype/internal/tfm.h>
+
 
 #if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */
 
diff --git a/include/freetype/internal/tfm.h b/include/freetype/internal/tfm.h
new file mode 100644
index 0000000..7289e67
--- /dev/null
+++ b/include/freetype/internal/tfm.h
@@ -0,0 +1,138 @@
+/****************************************************************************
+ *
+ * tfm.h
+ *
+ *   Auxiliary functions and data structures related to TFM metric files
+ *   (specification).
+ *
+ * Copyright 1996-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 TFM_H_
+#define TFM_H_
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_OBJECTS_H
+#include FT_INTERNAL_HASH_H
+#include FT_INTERNAL_TRUETYPE_TYPES_H
+
+
+
+FT_BEGIN_HEADER
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*************************************************************************/
+  /***                                                                   ***/
+  /***                                                                   ***/
+  /***                TFM FONT INFORMATION STRUCTURES                    ***/
+  /***                                                                   ***/
+  /***                                                                   ***/
+  /*************************************************************************/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  typedef struct  TFM_FontInfoRec_
+  {
+    /* Font Info */
+    FT_ULong       cs;
+    /* Metrics */
+    FT_ULong       ds;
+    FT_UInt        design_size;
+    FT_UInt        slant;
+    FT_UInt        begin_char, end_char;
+    FT_Long        *width, *height, *depth;
+    /* Font bounding box */
+    FT_UInt        font_bbx_w, font_bbx_h;
+    FT_UInt        font_bbx_xoff, font_bbx_yoff;
+
+  } TFM_FontInfoRec, *TFM_FontInfo;
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                            TFM PARSER                         *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  typedef struct TFM_ParserRec_*  TFM_Parser;
+
+  /**************************************************************************
+   *
+   * @struct:
+   *   TFM_ParserRec
+   *
+   * @description:
+   *   An TFM_Parser is a parser for the TFM files.
+   *
+   * @fields:
+   *   memory ::
+   *     The object used for memory operations (alloc and
+   *     realloc).
+   *
+   *   stream ::
+   *     This is an FT_Stream object.
+   *
+   *   FontInfo ::
+   *     The result will be stored here.
+   */
+  typedef struct  TFM_ParserRec_
+  {
+    FT_Memory     memory;
+    FT_Stream     stream;
+
+    TFM_FontInfo  FontInfo;
+
+    void*         user_data;  /* To be checked for compatibility */
+
+  } TFM_ParserRec;
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                        TFM Module Interface                   *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  typedef struct  TFM_ServiceRec_
+  {
+    FT_Error
+    (*init)( TFM_Parser  parser,
+             FT_Memory   memory,
+             FT_Stream   stream );
+
+    FT_Error
+    (*parse_metrics)( TFM_Parser  parser );
+
+    FT_Error
+    (*parse_kern)( TFM_Parser  parser );
+
+    void
+    (*done)( TFM_Parser  parser );
+
+  } TFM_ServiceRec, *TFM_Service;
+
+  /* backward compatible type definition */
+  typedef TFM_ServiceRec   TFM_Interface;
+
+
+FT_END_HEADER
+
+#endif /* PSAUX_H_ */
+
+
+/* END */



reply via email to

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