diff --git a/src/pk/module.mk b/src/pk/module.mk index df9fe1113..a0fa35a08 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/vf/module.mk b/src/vf/module.mk new file mode 100644 index 000000000..005d45f3c --- /dev/null +++ b/src/vf/module.mk @@ -0,0 +1,22 @@ +# +# FreeType 2 VF Font module definition +# + + +# 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. + +FTMODULE_H_COMMANDS += VF_DRIVER + +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 000000000..8d5501190 --- /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 000000000..5190aa916 --- /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 + +#include "vflib.c" +#include "vfdrivr.c" + + +/* END */ diff --git a/src/vf/vf.h b/src/vf/vf.h new file mode 100644 index 000000000..dcf1e0585 --- /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 +#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 000000000..8e4c958e2 --- /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 + +#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 000000000..96693fb57 --- /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 +#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 000000000..9dd0eec4c --- /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 000000000..ec492292f --- /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 + +#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 */