parent
3959431aab
commit
1316b813fd
8 changed files with 491 additions and 0 deletions
@ -0,0 +1,22 @@ |
||||
#
|
||||
# FreeType 2 PK 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 += PK_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) |
||||
endef |
||||
|
||||
# EOF
|
@ -0,0 +1,27 @@ |
||||
/****************************************************************************
|
||||
* |
||||
* pk.c |
||||
* |
||||
* FreeType font driver for TeX's PK 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 "pklib.c" |
||||
#include "pkdrivr.c" |
||||
|
||||
|
||||
/* END */ |
@ -0,0 +1,38 @@ |
||||
/****************************************************************************
|
||||
* |
||||
* pk.h |
||||
* |
||||
* FreeType font driver for TeX's PK 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 PK_H_ |
||||
#define PK_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 /* PK_H_ */ |
||||
|
||||
|
||||
/* END */ |
@ -0,0 +1,179 @@ |
||||
/****************************************************************************
|
||||
* |
||||
* pkdrivr.c |
||||
* |
||||
* FreeType font driver for TeX's PK 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 "pk.h" |
||||
#include "pkdrivr.h" |
||||
#include "pkerror.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_pkdriver |
||||
|
||||
|
||||
typedef struct PK_CMapRec_ |
||||
{ |
||||
FT_CMapRec cmap; |
||||
/* TO-DO */ |
||||
} PK_CMapRec, *PK_CMap; |
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error ) |
||||
pk_cmap_init( FT_CMap pkcmap, |
||||
FT_Pointer init_data ) |
||||
{ |
||||
/* TO-DO */ |
||||
return FT_Err_Ok; |
||||
} |
||||
|
||||
|
||||
FT_CALLBACK_DEF( void ) |
||||
pk_cmap_done( FT_CMap pkcmap ) |
||||
{ |
||||
/* TO-DO */ |
||||
} |
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_UInt ) |
||||
pk_cmap_char_index( FT_CMap pkcmap, |
||||
FT_UInt32 char_code ) |
||||
{ |
||||
/* TO-DO */ |
||||
return gindex; |
||||
} |
||||
|
||||
FT_CALLBACK_DEF( FT_UInt ) |
||||
pk_cmap_char_next( FT_CMap pkcmap, |
||||
FT_UInt32 *achar_code ) |
||||
{ |
||||
/* To-DO */ |
||||
return gindex; |
||||
} |
||||
|
||||
|
||||
static |
||||
const FT_CMap_ClassRec pk_cmap_class = |
||||
{ |
||||
sizeof ( PK_CMapRec ), |
||||
pk_cmap_init, |
||||
pk_cmap_done, |
||||
pk_cmap_char_index, |
||||
pk_cmap_char_next, |
||||
|
||||
NULL, NULL, NULL, NULL, NULL |
||||
}; |
||||
|
||||
|
||||
FT_CALLBACK_DEF( void ) |
||||
PK_Face_Done( FT_Face pkface ) /* PK_Face */ |
||||
{ |
||||
/* TO-DO */ |
||||
} |
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error ) |
||||
PK_Face_Init( FT_Stream stream, |
||||
FT_Face pkface, /* PK_Face */ |
||||
FT_Int face_index, |
||||
FT_Int num_params, |
||||
FT_Parameter* params ) |
||||
{ |
||||
/* TO-DO */ |
||||
} |
||||
|
||||
FT_CALLBACK_DEF( FT_Error ) |
||||
PK_Size_Select( FT_Size size, |
||||
FT_ULong strike_index ) |
||||
{ |
||||
/* TO-DO */ |
||||
} |
||||
|
||||
FT_CALLBACK_DEF( FT_Error ) |
||||
PK_Size_Request( FT_Size size, |
||||
FT_Size_Request req ) |
||||
{ |
||||
/* TO-DO */ |
||||
} |
||||
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error ) |
||||
PK_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 pk_driver_class = |
||||
{ |
||||
{ |
||||
FT_MODULE_FONT_DRIVER | |
||||
FT_MODULE_DRIVER_NO_OUTLINES, |
||||
sizeof ( FT_DriverRec ), |
||||
|
||||
"pk", |
||||
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 ( PK_FaceRec ), |
||||
sizeof ( FT_SizeRec ), |
||||
sizeof ( FT_GlyphSlotRec ), |
||||
|
||||
PK_Face_Init, /* FT_Face_InitFunc init_face */ |
||||
PK_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 */ |
||||
|
||||
PK_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 */ |
||||
|
||||
PK_Size_Request, /* FT_Size_RequestFunc request_size */ |
||||
PK_Size_Select /* FT_Size_SelectFunc select_size */ |
||||
}; |
||||
|
||||
|
||||
/* END */ |
@ -0,0 +1,56 @@ |
||||
/****************************************************************************
|
||||
* |
||||
* pkdrivr.h |
||||
* |
||||
* FreeType font driver for TeX's PK 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 PKDRIVR_H_ |
||||
#define PKDRIVR_H_ |
||||
|
||||
#include <ft2build.h> |
||||
#include FT_INTERNAL_DRIVER_H |
||||
|
||||
#include "pk.h" |
||||
|
||||
|
||||
FT_BEGIN_HEADER |
||||
|
||||
typedef struct PK_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; |
||||
|
||||
} PK_BitmapRec, *PK_Bitmap; |
||||
|
||||
typedef struct PK_FaceRec_ |
||||
{ |
||||
FT_FaceRec root; |
||||
/* TO-DO */ |
||||
} PK_FaceRec, *PK_Face; |
||||
|
||||
|
||||
FT_EXPORT_VAR( const FT_Driver_ClassRec ) pk_driver_class; |
||||
|
||||
|
||||
FT_END_HEADER |
||||
|
||||
|
||||
#endif /* PKDRIVR_H_ */ |
||||
|
||||
|
||||
/* END */ |
@ -0,0 +1,40 @@ |
||||
/****************************************************************************
|
||||
* |
||||
* pkerror.h |
||||
* |
||||
* FreeType font driver for TeX's PK 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 PK error enumeration constants. |
||||
* |
||||
*/ |
||||
|
||||
#ifndef PKERROR_H_ |
||||
#define PKERROR_H_ |
||||
|
||||
#include FT_MODULE_ERRORS_H |
||||
|
||||
#undef FTERRORS_H_ |
||||
|
||||
#undef FT_ERR_PREFIX |
||||
#define FT_ERR_PREFIX PK_Err_ |
||||
#define FT_ERR_BASE FT_Mod_Err_PK |
||||
|
||||
#include FT_ERRORS_H |
||||
|
||||
#endif /* PKERROR_H_ */ |
||||
|
||||
|
||||
/* END */ |
@ -0,0 +1,59 @@ |
||||
/****************************************************************************
|
||||
* |
||||
* pklib.c |
||||
* |
||||
* FreeType font driver for TeX's PK 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 "pk.h" |
||||
#include "pkdrivr.h" |
||||
#include "pkerror.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_pklib |
||||
|
||||
/**************************************************************************
|
||||
* |
||||
* PK font utility functions. |
||||
* |
||||
*/ |
||||
|
||||
/* TO-DO */ |
||||
|
||||
/**************************************************************************
|
||||
* |
||||
* API. |
||||
* |
||||
*/ |
||||
|
||||
/* TO-DO */ |
||||
|
||||
/* END */ |
@ -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
|
Loading…
Reference in new issue