[vf] Initialise vf driver files and Makefiles.

This commit is contained in:
Parth Wazurkar 2018-07-10 15:18:45 +05:30
parent e67b502c14
commit f9d1ea429b
9 changed files with 492 additions and 1 deletions

View File

@ -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

22
src/vf/module.mk Normal file
View File

@ -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

70
src/vf/rules.mk Normal file
View File

@ -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

27
src/vf/vf.c Normal file
View File

@ -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 */

38
src/vf/vf.h Normal file
View File

@ -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 */

179
src/vf/vfdrivr.c Normal file
View File

@ -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 */

56
src/vf/vfdrivr.h Normal file
View File

@ -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 */

40
src/vf/vferror.h Normal file
View File

@ -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 */

59
src/vf/vflib.c Normal file
View File

@ -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 */