[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] Problem with Type 42 incremental downloading font
From: |
Taek Kwan(TK) Lee |
Subject: |
[ft-devel] Problem with Type 42 incremental downloading font |
Date: |
Thu, 10 Nov 2005 10:10:20 -0500 |
I accidentally press send button with unfinished docuemnt a while ago.
This one is the finished one. Please ignore the other one.
------------------------------
In case of Type 42 Incremental downloading, 'glyf' and 'loca' table do
not present in the font data by Adobe specification. However, by
setting parameter and providing incremental interface, Freetype should
be able to print it.
T42_Face_Init( )/t42objs.c calls FT_New_Memory_Face( ) to load font
Type42 font data , and then FT_New_Memory_Face( ) calls FT_Open_Face(
). Because FT_New_Memory_Face( ) does not pass the parameter
information(specifically incremental interface information) to
FT_Open_Face( ), TT_Load_Glyph( ) / ttgload.c tried to load 'glyf'
table and cause error.
The following code section might fix this:
----------------------------------------------
In t42objs.c:
FT_LOCAL_DEF( FT_Error )
T42_Face_Init( FT_Stream stream,
T42_Face face,
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params )
{
....................
/* Load the TTF font embedded in the T42 font */
error = FT_New_Memory_Face( FT_FACE_LIBRARY( face ),
face->ttf_data,
face->ttf_size,
0,
&face->ttf_face,
num_params,
params);
------------------------------------------------------------
In ftobjs.c:
FT_EXPORT_DEF( FT_Error )
FT_New_Memory_Face( FT_Library library,
const FT_Byte* file_base,
FT_Long file_size,
FT_Long face_index,
FT_Face *aface,
FT_Int num_params,
FT_Parameter* params)
{
FT_Open_Args args;
/* test for valid `library' and `face' delayed to FT_Open_Face() */
if ( !file_base )
return FT_Err_Invalid_Argument;
args.flags = FT_OPEN_MEMORY;
if(num_params){
args.flags |= FT_OPEN_PARAMS;
args.num_params = num_params;
args.params = params;
}
args.memory_base = file_base;
args.memory_size = file_size;
return FT_Open_Face( library, &args, face_index, aface );
}
---------------------------------------------------------------------
In freetype.h
FT_EXPORT_DEF( FT_Error )
FT_New_Memory_Face( FT_Library library,
const FT_Byte* file_base,
FT_Long file_size,
FT_Long face_index,
FT_Face *aface,
FT_Int num_params,
FT_Parameter* params);
------------------------------
TK
Re: [ft-devel] Problem with Type 42 incremental downloading font, Taek Kwan(TK) Lee, 2005/11/21
RE: [ft-devel] Problem with Type 42 incremental downloading font, Turner, David, 2005/11/22