freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] parthw-pk-vf f9d1ea4 2/2: [vf] Initialise vf driver files an


From: Parth Wazurkar
Subject: [freetype2] parthw-pk-vf f9d1ea4 2/2: [vf] Initialise vf driver files and Makefiles.
Date: Tue, 10 Jul 2018 05:49:53 -0400 (EDT)

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

    [vf] Initialise vf driver files and Makefiles.
---
 src/pk/module.mk         |   2 +-
 src/{pk => vf}/module.mk |  10 +--
 src/vf/rules.mk          |  70 ++++++++++++++++++
 src/vf/vf.c              |  27 +++++++
 src/vf/vf.h              |  38 ++++++++++
 src/vf/vfdrivr.c         | 179 +++++++++++++++++++++++++++++++++++++++++++++++
 src/vf/vfdrivr.h         |  56 +++++++++++++++
 src/vf/vferror.h         |  40 +++++++++++
 src/vf/vflib.c           |  59 ++++++++++++++++
 9 files changed, 475 insertions(+), 6 deletions(-)

diff --git a/src/pk/module.mk b/src/pk/module.mk
index df9fe11..a0fa35a 100644
--- a/src/pk/module.mk
+++ b/src/pk/module.mk
@@ -14,7 +14,7 @@
 
 FTMODULE_H_COMMANDS += PK_DRIVER
 
-define GF_DRIVER
+define PK_DRIVER
 $(OPEN_DRIVER) FT_Driver_ClassRec, pk_driver_class $(CLOSE_DRIVER)
 $(ECHO_DRIVER)pk        $(ECHO_DRIVER_DESC)METAFONT bitmap 
fonts$(ECHO_DRIVER_DONE)
 endef
diff --git a/src/pk/module.mk b/src/vf/module.mk
similarity index 65%
copy from src/pk/module.mk
copy to src/vf/module.mk
index df9fe11..005d45f 100644
--- a/src/pk/module.mk
+++ b/src/vf/module.mk
@@ -1,5 +1,5 @@
 #
-# FreeType 2 PK Font module definition
+# FreeType 2 VF Font module definition
 #
 
 
@@ -12,11 +12,11 @@
 # indicate that you have read the license and understand and accept it
 # fully.
 
-FTMODULE_H_COMMANDS += PK_DRIVER
+FTMODULE_H_COMMANDS += VF_DRIVER
 
-define GF_DRIVER
-$(OPEN_DRIVER) FT_Driver_ClassRec, pk_driver_class $(CLOSE_DRIVER)
-$(ECHO_DRIVER)pk        $(ECHO_DRIVER_DESC)METAFONT bitmap 
fonts$(ECHO_DRIVER_DONE)
+define VF_DRIVER
+$(OPEN_DRIVER) FT_Driver_ClassRec, vf_driver_class $(CLOSE_DRIVER)
+$(ECHO_DRIVER)vf        $(ECHO_DRIVER_DESC)METAFONT bitmap 
fonts$(ECHO_DRIVER_DONE)
 endef
 
 # EOF
diff --git a/src/vf/rules.mk b/src/vf/rules.mk
new file mode 100644
index 0000000..8d55011
--- /dev/null
+++ b/src/vf/rules.mk
@@ -0,0 +1,70 @@
+#
+# FreeType 2 PK driver configuration rules
+#
+
+
+# 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.
+
+
+# pk driver directory
+#
+PK_DIR := $(SRC_DIR)/pk
+
+
+PK_COMPILE := $(CC) $(ANSIFLAGS)                            \
+                     $I$(subst /,$(COMPILER_SEP),$(PK_DIR)) \
+                     $(INCLUDE_FLAGS)                        \
+                     $(FT_CFLAGS)
+
+
+# pk driver sources (i.e., C files)
+#
+PK_DRV_SRC :=  $(PK_DIR)/pklib.c \
+               $(PK_DIR)/pkdrivr.c
+
+
+# pk driver headers
+#
+PK_DRV_H :=  $(PK_DIR)/pk.h \
+             $(PK_DIR)/pkdrivr.h \
+             $(PK_DIR)/pkerror.h
+
+# pk driver object(s)
+#
+#   PK_DRV_OBJ_M is used during `multi' builds
+#   PK_DRV_OBJ_S is used during `single' builds
+#
+PK_DRV_OBJ_M := $(PK_DRV_SRC:$(PK_DIR)/%.c=$(OBJ_DIR)/%.$O)
+PK_DRV_OBJ_S := $(OBJ_DIR)/pk.$O
+
+# pk driver source file for single build
+#
+PK_DRV_SRC_S := $(PK_DIR)/pk.c
+
+
+# pk driver - single object
+#
+$(PK_DRV_OBJ_S): $(PK_DRV_SRC_S) $(PK_DRV_SRC) $(FREETYPE_H) $(PK_DRV_H)
+       $(PK_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PK_DRV_SRC_S))
+
+
+# pk driver - multiple objects
+#
+$(OBJ_DIR)/%.$O: $(PK_DIR)/%.c $(FREETYPE_H) $(PK_DRV_H)
+       $(PK_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
+
+
+# update main driver object lists
+#
+DRV_OBJS_S += $(PK_DRV_OBJ_S)
+DRV_OBJS_M += $(PK_DRV_OBJ_M)
+
+
+# EOF
diff --git a/src/vf/vf.c b/src/vf/vf.c
new file mode 100644
index 0000000..5190aa9
--- /dev/null
+++ b/src/vf/vf.c
@@ -0,0 +1,27 @@
+/****************************************************************************
+ *
+ * vf.c
+ *
+ *   FreeType font driver for TeX's VF FONT files.
+ *
+ * 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.
+ *
+ */
+
+
+#define FT_MAKE_OPTION_SINGLE_OBJECT
+
+#include <ft2build.h>
+
+#include "vflib.c"
+#include "vfdrivr.c"
+
+
+/* END */
diff --git a/src/vf/vf.h b/src/vf/vf.h
new file mode 100644
index 0000000..dcf1e05
--- /dev/null
+++ b/src/vf/vf.h
@@ -0,0 +1,38 @@
+/****************************************************************************
+ *
+ * vf.h
+ *
+ *   FreeType font driver for TeX's VF FONT files.
+ *
+ * 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 VF_H_
+#define VF_H_
+
+#include <ft2build.h>
+#include FT_INTERNAL_OBJECTS_H
+#include FT_INTERNAL_STREAM_H
+#include FT_SYSTEM_H
+
+
+FT_BEGIN_HEADER
+
+/* TO-DO */
+
+FT_END_HEADER
+
+
+#endif /* VF_H_ */
+
+
+/* END */
diff --git a/src/vf/vfdrivr.c b/src/vf/vfdrivr.c
new file mode 100644
index 0000000..8e4c958
--- /dev/null
+++ b/src/vf/vfdrivr.c
@@ -0,0 +1,179 @@
+/****************************************************************************
+ *
+ * vfdrivr.c
+ *
+ *   FreeType font driver for TeX's VF FONT files.
+ *
+ * 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.
+ *
+ */
+
+#include <ft2build.h>
+
+#include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_STREAM_H
+#include FT_INTERNAL_OBJECTS_H
+#include FT_TRUETYPE_IDS_H
+#include FT_SERVICE_FONT_FORMAT_H
+
+
+#include "vf.h"
+#include "vfdrivr.h"
+#include "vferror.h"
+
+
+  /**************************************************************************
+   *
+   * The macro FT_COMPONENT is used in trace mode.  It is an implicit
+   * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
+   * messages during execution.
+   */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_vfdriver
+
+
+  typedef struct  VF_CMapRec_
+  {
+    FT_CMapRec        cmap;
+    /* TO-DO */
+  } VF_CMapRec, *VF_CMap;
+
+
+  FT_CALLBACK_DEF( FT_Error )
+  vf_cmap_init(  FT_CMap     vfcmap,
+                 FT_Pointer  init_data )
+  {
+    /* TO-DO */
+    return FT_Err_Ok;
+  }
+
+
+  FT_CALLBACK_DEF( void )
+  vf_cmap_done( FT_CMap  vfcmap )
+  {
+    /* TO-DO */
+  }
+
+
+  FT_CALLBACK_DEF( FT_UInt )
+  vf_cmap_char_index(  FT_CMap    vfcmap,
+                       FT_UInt32  char_code )
+  {
+    /* TO-DO */
+    return gindex;
+  }
+
+  FT_CALLBACK_DEF( FT_UInt )
+  vf_cmap_char_next(  FT_CMap    vfcmap,
+                       FT_UInt32  *achar_code )
+  {
+    /* To-DO */
+    return gindex;
+  }
+
+
+  static
+  const FT_CMap_ClassRec  vf_cmap_class =
+  {
+    sizeof ( VF_CMapRec ),
+    vf_cmap_init,
+    vf_cmap_done,
+    vf_cmap_char_index,
+    vf_cmap_char_next,
+
+    NULL, NULL, NULL, NULL, NULL
+  };
+
+
+  FT_CALLBACK_DEF( void )
+  VF_Face_Done( FT_Face        vfface )         /* VF_Face */
+  {
+    /* TO-DO */
+  }
+
+
+  FT_CALLBACK_DEF( FT_Error )
+  VF_Face_Init(   FT_Stream      stream,
+                  FT_Face        vfface,         /* VF_Face */
+                  FT_Int         face_index,
+                  FT_Int         num_params,
+                  FT_Parameter*  params )
+  {
+    /* TO-DO */
+  }
+
+  FT_CALLBACK_DEF( FT_Error )
+  VF_Size_Select(  FT_Size   size,
+                   FT_ULong  strike_index )
+  {
+    /* TO-DO */
+  }
+
+  FT_CALLBACK_DEF( FT_Error )
+  VF_Size_Request( FT_Size          size,
+                   FT_Size_Request  req )
+  {
+    /* TO-DO */
+  }
+
+
+
+  FT_CALLBACK_DEF( FT_Error )
+  VF_Glyph_Load(   FT_GlyphSlot  slot,
+                   FT_Size       size,
+                   FT_UInt       glyph_index,
+                   FT_Int32      load_flags )
+  {
+    /* TO-DO */
+  }
+
+
+   FT_CALLBACK_TABLE_DEF
+  const FT_Driver_ClassRec  vf_driver_class =
+  {
+    {
+      FT_MODULE_FONT_DRIVER         |
+      FT_MODULE_DRIVER_NO_OUTLINES,
+      sizeof ( FT_DriverRec ),
+
+      "vf",
+      0x10000L,
+      0x20000L,
+
+      NULL,                                                                    
        /* module-specific interface */
+
+      NULL,                     /* FT_Module_Constructor  module_init   */
+      NULL,                     /* FT_Module_Destructor   module_done   */
+      NULL                                                                     
/* FT_Module_Requester    get_interface */
+    },
+
+    sizeof ( VF_FaceRec ),
+    sizeof ( FT_SizeRec ),
+    sizeof ( FT_GlyphSlotRec ),
+
+    VF_Face_Init,               /* FT_Face_InitFunc  init_face */
+    VF_Face_Done,               /* FT_Face_DoneFunc  done_face */
+    NULL,                       /* FT_Size_InitFunc  init_size */
+    NULL,                       /* FT_Size_DoneFunc  done_size */
+    NULL,                       /* FT_Slot_InitFunc  init_slot */
+    NULL,                       /* FT_Slot_DoneFunc  done_slot */
+
+    VF_Glyph_Load,              /* FT_Slot_LoadFunc  load_glyph */
+
+    NULL,                       /* FT_Face_GetKerningFunc   get_kerning  */
+    NULL,                       /* FT_Face_AttachFunc       attach_file  */
+    NULL,                       /* FT_Face_GetAdvancesFunc  get_advances */
+
+    VF_Size_Request,           /* FT_Size_RequestFunc  request_size */
+    VF_Size_Select             /* FT_Size_SelectFunc   select_size  */
+  };
+
+
+/* END */
diff --git a/src/vf/vfdrivr.h b/src/vf/vfdrivr.h
new file mode 100644
index 0000000..96693fb
--- /dev/null
+++ b/src/vf/vfdrivr.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+ *
+ * vfdrivr.h
+ *
+ *   FreeType font driver for TeX's VF FONT files.
+ *
+ * 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 VFDRIVR_H_
+#define VFDRIVR_H_
+
+#include <ft2build.h>
+#include FT_INTERNAL_DRIVER_H
+
+#include "vf.h"
+
+
+FT_BEGIN_HEADER
+
+  typedef struct VF_BitmapRec_
+  {
+    FT_UInt              bbx_width, bbx_height;
+    FT_UInt              off_x, off_y;
+    FT_UInt              mv_x,  mv_y;
+    FT_Byte              *bitmap;
+    FT_UInt              raster;
+
+  } VF_BitmapRec, *VF_Bitmap;
+
+  typedef struct  VF_FaceRec_
+  {
+    FT_FaceRec        root;
+    /* TO-DO */
+  } VF_FaceRec, *VF_Face;
+
+
+  FT_EXPORT_VAR( const FT_Driver_ClassRec )  vf_driver_class;
+
+
+FT_END_HEADER
+
+
+#endif /* VFDRIVR_H_ */
+
+
+/* END */
diff --git a/src/vf/vferror.h b/src/vf/vferror.h
new file mode 100644
index 0000000..9dd0eec
--- /dev/null
+++ b/src/vf/vferror.h
@@ -0,0 +1,40 @@
+/****************************************************************************
+ *
+ * vferror.h
+ *
+ *   FreeType font driver for TeX's VF FONT files.
+ *
+ * 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.
+ *
+ */
+
+  /**************************************************************************
+   *
+   * This file is used to define the VF error enumeration constants.
+   *
+   */
+
+#ifndef VFERROR_H_
+#define VFERROR_H_
+
+#include FT_MODULE_ERRORS_H
+
+#undef FTERRORS_H_
+
+#undef  FT_ERR_PREFIX
+#define FT_ERR_PREFIX  VF_Err_
+#define FT_ERR_BASE    FT_Mod_Err_VF
+
+#include FT_ERRORS_H
+
+#endif /* VFERROR_H_ */
+
+
+/* END */
diff --git a/src/vf/vflib.c b/src/vf/vflib.c
new file mode 100644
index 0000000..ec49229
--- /dev/null
+++ b/src/vf/vflib.c
@@ -0,0 +1,59 @@
+/****************************************************************************
+ *
+ * vflib.c
+ *
+ *   FreeType font driver for TeX's VF FONT files.
+ *
+ * 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.
+ *
+ */
+
+#include <ft2build.h>
+
+#include FT_FREETYPE_H
+#include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_STREAM_H
+#include FT_INTERNAL_OBJECTS_H
+#include FT_SYSTEM_H
+#include FT_CONFIG_CONFIG_H
+#include FT_ERRORS_H
+#include FT_TYPES_H
+
+#include "vf.h"
+#include "vfdrivr.h"
+#include "vferror.h"
+
+
+  /**************************************************************************
+   *
+   * The macro FT_COMPONENT is used in trace mode.  It is an implicit
+   * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
+   * messages during execution.
+   */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_vflib
+
+  /**************************************************************************
+   *
+   * VF font utility functions.
+   *
+   */
+
+   /* TO-DO */
+
+  /**************************************************************************
+   *
+   * API.
+   *
+   */
+
+   /* TO-DO */
+
+/* END */



reply via email to

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