* src/pfr/pfrobjs.c (pfr_slot_load): Apply font matrix.
* src/cid/cidload.c: Remove parse_font_bbox code (already enclosed with #if 0 ... #endif). * src/type1/t1tokens.h: Handle /FontName. * src/type1/t1load.c (parse_font_name): Removed. Remove parse_font_bbox code (already enclosed with #if 0 ... #endif). * src/type42/t42parse.c (t42_parse_font_name): Removed. Remove t42_parse_font_bbox code (already enclosed with #if 0 ... #endif). (t42_keywords): Handle /FontName with T1_FIELD_KEY.
This commit is contained in:
parent
d5553d35f3
commit
a959c3c960
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,7 @@
|
||||||
|
2003-06-13 Detlef Würkner <TetiSoft@apg.lahn.de>
|
||||||
|
|
||||||
|
* src/pfr/pfrobjs.c (pfr_slot_load): Apply font matrix.
|
||||||
|
|
||||||
2003-06-13 Werner Lemberg <wl@gnu.org>
|
2003-06-13 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
* builds/dos/detect.mk: Test not only for `Dos' but for `DOS' also.
|
* builds/dos/detect.mk: Test not only for `Dos' but for `DOS' also.
|
||||||
|
@ -9,6 +13,19 @@
|
||||||
* builds/compiler/watcom.mk (LINK_LIBRARY): GNU Make for DOS doesn't
|
* builds/compiler/watcom.mk (LINK_LIBRARY): GNU Make for DOS doesn't
|
||||||
like a trailing semicolon; add a dummy command.
|
like a trailing semicolon; add a dummy command.
|
||||||
|
|
||||||
|
* src/cid/cidload.c: Remove parse_font_bbox code (already enclosed
|
||||||
|
with #if 0 ... #endif).
|
||||||
|
|
||||||
|
* src/type1/t1tokens.h: Handle /FontName.
|
||||||
|
* src/type1/t1load.c (parse_font_name): Removed.
|
||||||
|
Remove parse_font_bbox code (already enclosed with #if 0 ...
|
||||||
|
#endif).
|
||||||
|
|
||||||
|
* src/type42/t42parse.c (t42_parse_font_name): Removed.
|
||||||
|
Remove t42_parse_font_bbox code (already enclosed with #if 0 ...
|
||||||
|
#endif).
|
||||||
|
(t42_keywords): Handle /FontName with T1_FIELD_KEY.
|
||||||
|
|
||||||
2003-06-12 Werner Lemberg <wl@gnu.org>
|
2003-06-12 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
* include/freetype/internal/psaux.h (T1_FieldType): Add
|
* include/freetype/internal/psaux.h (T1_FieldType): Add
|
||||||
|
|
13
docs/TODO
13
docs/TODO
|
@ -9,5 +9,18 @@ not exactly bugs, but should be considered though:
|
||||||
the quality of AA text, but Monochrome and LCD hinting still suck. We
|
the quality of AA text, but Monochrome and LCD hinting still suck. We
|
||||||
need to do something about that.
|
need to do something about that.
|
||||||
|
|
||||||
|
* Add CIDCMap support to the CID driver.
|
||||||
|
|
||||||
|
* Add track kerning support to the Type1 and PFR driver and the API
|
||||||
|
(The degree of kerning, e.g. light, normal or tight, and
|
||||||
|
the glyph size has to be passed as parameter).
|
||||||
|
|
||||||
|
* Add kerning (AFM file) support to the CID driver.
|
||||||
|
|
||||||
|
* Possibly add support for reading PFM files.
|
||||||
|
|
||||||
|
* Is the anti-aliased glyphs feature of BDF also available in PCF format?
|
||||||
|
If yes, add support to the PCF driver.
|
||||||
|
|
||||||
|
|
||||||
--- end of TODO ---
|
--- end of TODO ---
|
||||||
|
|
|
@ -743,10 +743,11 @@ FT_BEGIN_HEADER
|
||||||
/* descender :: The face's descender is the vertical */
|
/* descender :: The face's descender is the vertical */
|
||||||
/* distance from the baseline to the */
|
/* distance from the baseline to the */
|
||||||
/* bottommost point of any glyph in the face. */
|
/* bottommost point of any glyph in the face. */
|
||||||
/* This field's value is *negative*, expressed */
|
/* This field's value is *negative* for values */
|
||||||
/* in font units. Some font designs use a */
|
/* below the baseline. It is expressed in */
|
||||||
/* value different from `bbox.yMin'. Only */
|
/* font units. Some font designs use a value */
|
||||||
/* relevant for scalable formats. */
|
/* different from `bbox.yMin'. Only relevant */
|
||||||
|
/* for scalable formats. */
|
||||||
/* */
|
/* */
|
||||||
/* height :: The face's height is the vertical distance */
|
/* height :: The face's height is the vertical distance */
|
||||||
/* from one baseline to the next when writing */
|
/* from one baseline to the next when writing */
|
||||||
|
|
|
@ -142,27 +142,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
FT_CALLBACK_DEF( FT_Error )
|
|
||||||
parse_font_bbox( CID_Face face,
|
|
||||||
CID_Parser* parser )
|
|
||||||
{
|
|
||||||
FT_Fixed temp[4];
|
|
||||||
FT_BBox* bbox = &face->cid.font_bbox;
|
|
||||||
|
|
||||||
|
|
||||||
(void)cid_parser_to_fixed_array( parser, 4, temp, 0 );
|
|
||||||
bbox->xMin = FT_RoundFix( temp[0] );
|
|
||||||
bbox->yMin = FT_RoundFix( temp[1] );
|
|
||||||
bbox->xMax = FT_RoundFix( temp[2] );
|
|
||||||
bbox->yMax = FT_RoundFix( temp[3] );
|
|
||||||
|
|
||||||
return CID_Err_Ok; /* this is a callback function; */
|
|
||||||
/* we must return an error code */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( FT_Error )
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
parse_font_matrix( CID_Face face,
|
parse_font_matrix( CID_Face face,
|
||||||
CID_Parser* parser )
|
CID_Parser* parser )
|
||||||
|
@ -261,9 +240,6 @@
|
||||||
|
|
||||||
#include "cidtoken.h"
|
#include "cidtoken.h"
|
||||||
|
|
||||||
#if 0
|
|
||||||
T1_FIELD_CALLBACK( "FontBBox", parse_font_bbox )
|
|
||||||
#endif
|
|
||||||
T1_FIELD_CALLBACK( "FDArray", parse_fd_array )
|
T1_FIELD_CALLBACK( "FDArray", parse_fd_array )
|
||||||
T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix )
|
T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix )
|
||||||
|
|
||||||
|
|
|
@ -354,6 +354,21 @@
|
||||||
metrics->vertBearingX = 0;
|
metrics->vertBearingX = 0;
|
||||||
metrics->vertBearingY = 0;
|
metrics->vertBearingY = 0;
|
||||||
|
|
||||||
|
/* Apply the font matrix, if any. */
|
||||||
|
/* TODO: Test existing fonts with unusual matrix */
|
||||||
|
/* whether we have to adjust Units per EM. */
|
||||||
|
{
|
||||||
|
FT_Matrix font_matrix;
|
||||||
|
|
||||||
|
|
||||||
|
font_matrix.xx = face->log_font.matrix[0] << 8;
|
||||||
|
font_matrix.yx = face->log_font.matrix[1] << 8;
|
||||||
|
font_matrix.xy = face->log_font.matrix[2] << 8;
|
||||||
|
font_matrix.yy = face->log_font.matrix[3] << 8;
|
||||||
|
|
||||||
|
FT_Outline_Transform( outline, &font_matrix );
|
||||||
|
}
|
||||||
|
|
||||||
/* scale when needed */
|
/* scale when needed */
|
||||||
if ( scaling )
|
if ( scaling )
|
||||||
{
|
{
|
||||||
|
|
|
@ -842,71 +842,6 @@
|
||||||
/* the `/Encoding', `/Subrs', and `/CharStrings' */
|
/* the `/Encoding', `/Subrs', and `/CharStrings' */
|
||||||
/* dictionaries */
|
/* dictionaries */
|
||||||
|
|
||||||
static void
|
|
||||||
parse_font_name( T1_Face face,
|
|
||||||
T1_Loader loader )
|
|
||||||
{
|
|
||||||
T1_Parser parser = &loader->parser;
|
|
||||||
FT_Error error;
|
|
||||||
FT_Memory memory = parser->root.memory;
|
|
||||||
FT_PtrDist len;
|
|
||||||
FT_Byte* cur;
|
|
||||||
FT_Byte* cur2;
|
|
||||||
FT_Byte* limit;
|
|
||||||
|
|
||||||
|
|
||||||
if ( face->type1.font_name )
|
|
||||||
/* with synthetic fonts, it's possible we get here twice */
|
|
||||||
return;
|
|
||||||
|
|
||||||
T1_Skip_Spaces( parser );
|
|
||||||
|
|
||||||
cur = parser->root.cursor;
|
|
||||||
limit = parser->root.limit;
|
|
||||||
|
|
||||||
if ( cur >= limit - 1 || *cur != '/' )
|
|
||||||
return;
|
|
||||||
|
|
||||||
cur++;
|
|
||||||
cur2 = cur;
|
|
||||||
while ( cur2 < limit && is_name_char( *cur2 ) )
|
|
||||||
cur2++;
|
|
||||||
|
|
||||||
len = cur2 - cur;
|
|
||||||
if ( len > 0 )
|
|
||||||
{
|
|
||||||
if ( FT_ALLOC( face->type1.font_name, len + 1 ) )
|
|
||||||
{
|
|
||||||
parser->root.error = error;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
FT_MEM_COPY( face->type1.font_name, cur, len );
|
|
||||||
face->type1.font_name[len] = '\0';
|
|
||||||
}
|
|
||||||
parser->root.cursor = cur2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
static void
|
|
||||||
parse_font_bbox( T1_Face face,
|
|
||||||
T1_Loader loader )
|
|
||||||
{
|
|
||||||
T1_Parser parser = &loader->parser;
|
|
||||||
FT_Fixed temp[4];
|
|
||||||
FT_BBox* bbox = &face->type1.font_bbox;
|
|
||||||
|
|
||||||
|
|
||||||
(void)T1_ToFixedArray( parser, 4, temp, 0 );
|
|
||||||
bbox->xMin = FT_RoundFix( temp[0] );
|
|
||||||
bbox->yMin = FT_RoundFix( temp[1] );
|
|
||||||
bbox->xMax = FT_RoundFix( temp[2] );
|
|
||||||
bbox->yMax = FT_RoundFix( temp[3] );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_font_matrix( T1_Face face,
|
parse_font_matrix( T1_Face face,
|
||||||
T1_Loader loader )
|
T1_Loader loader )
|
||||||
|
@ -1498,10 +1433,6 @@
|
||||||
#include "t1tokens.h"
|
#include "t1tokens.h"
|
||||||
|
|
||||||
/* now add the special functions... */
|
/* now add the special functions... */
|
||||||
T1_FIELD_CALLBACK( "FontName", parse_font_name )
|
|
||||||
#if 0
|
|
||||||
T1_FIELD_CALLBACK( "FontBBox", parse_font_bbox )
|
|
||||||
#endif
|
|
||||||
T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix )
|
T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix )
|
||||||
T1_FIELD_CALLBACK( "Encoding", parse_encoding )
|
T1_FIELD_CALLBACK( "Encoding", parse_encoding )
|
||||||
T1_FIELD_CALLBACK( "Subrs", parse_subrs )
|
T1_FIELD_CALLBACK( "Subrs", parse_subrs )
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
#undef T1CODE
|
#undef T1CODE
|
||||||
#define T1CODE T1_FIELD_LOCATION_FONT_DICT
|
#define T1CODE T1_FIELD_LOCATION_FONT_DICT
|
||||||
|
|
||||||
|
T1_FIELD_KEY ( "FontName", font_name )
|
||||||
T1_FIELD_NUM_P ( "PaintType", paint_type )
|
T1_FIELD_NUM_P ( "PaintType", paint_type )
|
||||||
T1_FIELD_NUM ( "FontType", font_type )
|
T1_FIELD_NUM ( "FontType", font_type )
|
||||||
T1_FIELD_FIXED_P( "StrokeWidth", stroke_width )
|
T1_FIELD_FIXED_P( "StrokeWidth", stroke_width )
|
||||||
|
|
|
@ -33,16 +33,6 @@
|
||||||
#define FT_COMPONENT trace_t42
|
#define FT_COMPONENT trace_t42
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
t42_parse_font_name( T42_Face face,
|
|
||||||
T42_Loader loader );
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
static void
|
|
||||||
t42_parse_font_bbox( T42_Face face,
|
|
||||||
T42_Loader loader );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
t42_parse_font_matrix( T42_Face face,
|
t42_parse_font_matrix( T42_Face face,
|
||||||
T42_Loader loader );
|
T42_Loader loader );
|
||||||
|
@ -82,6 +72,7 @@
|
||||||
#undef T1CODE
|
#undef T1CODE
|
||||||
#define T1CODE T1_FIELD_LOCATION_FONT_DICT
|
#define T1CODE T1_FIELD_LOCATION_FONT_DICT
|
||||||
|
|
||||||
|
T1_FIELD_KEY ( "FontName", font_name )
|
||||||
T1_FIELD_NUM_P ( "PaintType", paint_type )
|
T1_FIELD_NUM_P ( "PaintType", paint_type )
|
||||||
T1_FIELD_NUM ( "FontType", font_type )
|
T1_FIELD_NUM ( "FontType", font_type )
|
||||||
T1_FIELD_FIXED_P( "StrokeWidth", stroke_width )
|
T1_FIELD_FIXED_P( "StrokeWidth", stroke_width )
|
||||||
|
@ -93,10 +84,6 @@
|
||||||
|
|
||||||
T1_FIELD_BBOX("FontBBox", xMin )
|
T1_FIELD_BBOX("FontBBox", xMin )
|
||||||
|
|
||||||
T1_FIELD_CALLBACK( "FontName", t42_parse_font_name )
|
|
||||||
#if 0
|
|
||||||
T1_FIELD_CALLBACK( "FontBBox", t42_parse_font_bbox )
|
|
||||||
#endif
|
|
||||||
T1_FIELD_CALLBACK( "FontMatrix", t42_parse_font_matrix )
|
T1_FIELD_CALLBACK( "FontMatrix", t42_parse_font_matrix )
|
||||||
T1_FIELD_CALLBACK( "Encoding", t42_parse_encoding )
|
T1_FIELD_CALLBACK( "Encoding", t42_parse_encoding )
|
||||||
T1_FIELD_CALLBACK( "CharStrings", t42_parse_charstrings )
|
T1_FIELD_CALLBACK( "CharStrings", t42_parse_charstrings )
|
||||||
|
@ -258,66 +245,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
t42_parse_font_name( T42_Face face,
|
|
||||||
T42_Loader loader )
|
|
||||||
{
|
|
||||||
T42_Parser parser = &loader->parser;
|
|
||||||
FT_Error error;
|
|
||||||
FT_Memory memory = parser->root.memory;
|
|
||||||
FT_Int len;
|
|
||||||
FT_Byte* cur;
|
|
||||||
FT_Byte* cur2;
|
|
||||||
FT_Byte* limit;
|
|
||||||
|
|
||||||
|
|
||||||
T1_Skip_Spaces( parser );
|
|
||||||
|
|
||||||
cur = parser->root.cursor;
|
|
||||||
limit = parser->root.limit;
|
|
||||||
|
|
||||||
if ( cur >= limit - 1 ||
|
|
||||||
( *cur != '/' && *cur != '(') )
|
|
||||||
return;
|
|
||||||
|
|
||||||
cur++;
|
|
||||||
cur2 = cur;
|
|
||||||
while ( cur2 < limit && t42_is_alpha( *cur2 ) )
|
|
||||||
cur2++;
|
|
||||||
|
|
||||||
len = (FT_Int)( cur2 - cur );
|
|
||||||
if ( len > 0 )
|
|
||||||
{
|
|
||||||
if ( FT_ALLOC( face->type1.font_name, len + 1 ) )
|
|
||||||
{
|
|
||||||
parser->root.error = error;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
FT_MEM_COPY( face->type1.font_name, cur, len );
|
|
||||||
face->type1.font_name[len] = '\0';
|
|
||||||
}
|
|
||||||
parser->root.cursor = cur2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
static void
|
|
||||||
t42_parse_font_bbox( T42_Face face,
|
|
||||||
T42_Loader loader )
|
|
||||||
{
|
|
||||||
T42_Parser parser = &loader->parser;
|
|
||||||
FT_BBox* bbox = &face->type1.font_bbox;
|
|
||||||
|
|
||||||
|
|
||||||
bbox->xMin = T1_ToInt( parser );
|
|
||||||
bbox->yMin = T1_ToInt( parser );
|
|
||||||
bbox->xMax = T1_ToInt( parser );
|
|
||||||
bbox->yMax = T1_ToInt( parser );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
t42_parse_font_matrix( T42_Face face,
|
t42_parse_font_matrix( T42_Face face,
|
||||||
T42_Loader loader )
|
T42_Loader loader )
|
||||||
|
|
Loading…
Reference in New Issue