[tfm] Initialised TFM driver files.

* src/tfm : Added all the driver source files and makefiles.
This commit is contained in:
Parth Wazurkar 2018-06-24 00:33:43 +05:30
parent 5147064e1b
commit 1338d517c4
9 changed files with 464 additions and 0 deletions

0
src/tfm/README Normal file
View File

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

@ -0,0 +1,22 @@
#
# FreeType 2 GF 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 += TFM_DRIVER
define TFM_DRIVER
$(OPEN_DRIVER) FT_Driver_ClassRec, tfm_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)tfm $(ECHO_DRIVER_DESC)tfm TeX's bitmap fonts$(ECHO_DRIVER_DONE)
endef
# EOF

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

@ -0,0 +1,70 @@
#
# FreeType 2 TFM 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.
# tfm driver directory
#
TFM_DIR := $(SRC_DIR)/tfm
TFM_COMPILE := $(CC) $(ANSIFLAGS) \
$I$(subst /,$(COMPILER_SEP),$(TFM_DIR)) \
$(INCLUDE_FLAGS) \
$(FT_CFLAGS)
# tfm driver sources (i.e., C files)
#
TFM_DRV_SRC := $(TFM_DIR)/tfmlib.c \
$(TFM_DIR)/tfmdrivr.c
# tfm driver headers
#
TFM_DRV_H := $(TFM_DIR)/tfm.h \
$(TFM_DIR)/tfmdrivr.h \
$(TFM_DIR)/tfmerror.h
# tfm driver object(s)
#
# TFM_DRV_OBJ_M is used during `multi' builds
# TFM_DRV_OBJ_S is used during `single' builds
#
TFM_DRV_OBJ_M := $(TFM_DRV_SRC:$(TFM_DIR)/%.c=$(OBJ_DIR)/%.$O)
TFM_DRV_OBJ_S := $(OBJ_DIR)/tfm.$O
# tfm driver source file for single build
#
TFM_DRV_SRC_S := $(TFM_DIR)/tfm.c
# tfm driver - single object
#
$(TFM_DRV_OBJ_S): $(TFM_DRV_SRC_S) $(TFM_DRV_SRC) $(FREETYPE_H) $(TFM_DRV_H)
$(TFM_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(TFM_DRV_SRC_S))
# tfm driver - multiple objects
#
$(OBJ_DIR)/%.$O: $(TFM_DIR)/%.c $(FREETYPE_H) $(TFM_DRV_H)
$(TFM_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
# update main driver object lists
#
DRV_OBJS_S += $(TFM_DRV_OBJ_S)
DRV_OBJS_M += $(TFM_DRV_OBJ_M)
# EOF

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

@ -0,0 +1,27 @@
/****************************************************************************
*
* tfm.c
*
* FreeType font driver for TeX's TFM 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 "tfmlib.c"
#include "tfmdrivr.c"
/* END */

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

@ -0,0 +1,38 @@
/****************************************************************************
*
* tfm.h
*
* FreeType font driver for TeX's TFM 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 TFM_H_
#define TFM_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 /* TFM_H_ */
/* END */

176
src/tfm/tfmdrivr.c Normal file
View File

@ -0,0 +1,176 @@
/****************************************************************************
*
* tfmdrivr.c
*
* FreeType font driver for TeX's TFM 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 "tfm.h"
#include "tfmdrivr.h"
#include "tfmerror.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_tfmdriver
typedef struct TFM_CMapRec_
{
FT_CMapRec cmap;
/* TO-DO */
} TFM_CMapRec, *TFM_CMap;
FT_CALLBACK_DEF( FT_Error )
tfm_cmap_init( FT_CMap tfmcmap,
FT_Pointer init_data )
{
/* TO-DO */
}
FT_CALLBACK_DEF( void )
tfm_cmap_done( FT_CMap tfmcmap )
{
/* TO-DO */
}
FT_CALLBACK_DEF( FT_UInt )
tfm_cmap_char_index( FT_CMap tfmcmap,
FT_UInt32 char_code )
{
/* TO-DO */
}
FT_CALLBACK_DEF( FT_UInt )
tfm_cmap_char_next( FT_CMap tfmcmap,
FT_UInt32 *achar_code )
{
/* TO-DO */
}
static
const FT_CMap_ClassRec tfm_cmap_class =
{
sizeof ( TFM_CMapRec ),
tfm_cmap_init,
tfm_cmap_done,
tfm_cmap_char_index,
tfm_cmap_char_next,
NULL, NULL, NULL, NULL, NULL
};
FT_CALLBACK_DEF( void )
TFM_Face_Done( FT_Face tfmface ) /* TFM_Face */
{
/* TO-DO */
}
FT_CALLBACK_DEF( FT_Error )
TFM_Face_Init( FT_Stream stream,
FT_Face tfmface, /* TFM_Face */
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params )
{
/* TO-DO */
}
FT_CALLBACK_DEF( FT_Error )
TFM_Size_Select( FT_Size size,
FT_ULong strike_index )
{
/* TO-DO */
}
FT_CALLBACK_DEF( FT_Error )
TFM_Size_Request( FT_Size size,
FT_Size_Request req )
{
/* TO-DO */
}
FT_CALLBACK_DEF( FT_Error )
TFM_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 tfm_driver_class =
{
{
FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_NO_OUTLINES,
sizeof ( FT_DriverRec ),
"tfm",
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 ( TFM_FaceRec ),
sizeof ( FT_SizeRec ),
sizeof ( FT_GlyphSlotRec ),
TFM_Face_Init, /* FT_Face_InitFunc init_face */
TFM_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 */
TFM_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 */
TFM_Size_Request, /* FT_Size_RequestFunc request_size */
TFM_Size_Select /* FT_Size_SelectFunc select_size */
};
/* END */

46
src/tfm/tfmdrivr.h Normal file
View File

@ -0,0 +1,46 @@
/****************************************************************************
*
* tfmdrivr.h
*
* FreeType font driver for TeX's TFM 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 TFMDRIVR_H_
#define TFMDRIVR_H_
#include <ft2build.h>
#include FT_INTERNAL_DRIVER_H
#include "tfm.h"
FT_BEGIN_HEADER
typedef struct TFM_FaceRec_
{
FT_FaceRec root;
/* TO-DO */
} TFM_FaceRec, *TFM_Face;
FT_EXPORT_VAR( const FT_Driver_ClassRec ) tfm_driver_class;
FT_END_HEADER
#endif /* TFMDRIVR_H_ */
/* END */

40
src/tfm/tfmerror.h Normal file
View File

@ -0,0 +1,40 @@
/****************************************************************************
*
* gferror.h
*
* FreeType font driver for TeX's GF 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 GF error enumeration constants.
*
*/
#ifndef GFERROR_H_
#define GFERROR_H_
#include FT_MODULE_ERRORS_H
#undef FTERRORS_H_
#undef FT_ERR_PREFIX
#define FT_ERR_PREFIX GF_Err_
#define FT_ERR_BASE FT_Mod_Err_GF
#include FT_ERRORS_H
#endif /* GFERROR_H_ */
/* END */

45
src/tfm/tfmlib.c Normal file
View File

@ -0,0 +1,45 @@
/****************************************************************************
*
* tfmlib.c
*
* FreeType font driver for TeX's TFM 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 "tfm.h"
#include "tfmdrivr.h"
#include "tfmerror.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_tfmlib
/* TO-DO */
/* END */