19 #include FT_INTERNAL_DEBUG_H 20 #include FT_INTERNAL_STREAM_H 21 #include FT_TRUETYPE_TAGS_H 27 #ifndef FT_CONFIG_OPTION_OLD_INTERNALS 34 #include FT_INTERNAL_DEBUG_H 35 #include FT_INTERNAL_STREAM_H 36 #include FT_TRUETYPE_TAGS_H 49 #define FT_COMPONENT trace_ttsbit 98 line_incr = target->
pitch;
99 line_buff = target->
buffer;
102 line_buff -= line_incr * ( target->
rows - 1 );
104 line_buff += ( x_offset >> 3 ) + y_offset * line_incr;
120 for ( height = source_height; height > 0; height-- )
149 cur[0] |= (
FT_Byte)( val >> shift );
150 cur[1] |= (
FT_Byte)( val << space );
160 }
while ( count >= 0 );
182 cur[0] |= (
FT_Byte)( val >> shift );
185 cur[1] |= (
FT_Byte)( val << space );
198 line_buff += line_incr;
206 #define FT_STRUCTURE TT_SBit_MetricsRec 302 for ( n = 0; n <
count; n++ )
355 error =
FT_THROW( Invalid_File_Format );
363 size_elem = large ? 4 : 2;
369 for ( n = 0; n < num_glyphs; n++ )
378 error = Load_SBit_Const_Metrics( range, stream );
382 error = Load_SBit_Range_Codes( range, stream, 1 );
386 error = Load_SBit_Const_Metrics( range, stream );
388 error = Load_SBit_Range_Codes( range, stream, 0 );
392 error =
FT_THROW( Invalid_File_Format );
429 #define FT_STRUCTURE TT_SBit_LineMetricsRec 452 #define FT_STRUCTURE TT_SBit_StrikeRec 475 face->num_sbit_strikes = 0;
494 if ( version != 0x00020000L ||
495 num_strikes >= 0x10000L )
497 FT_ERROR((
"tt_face_load_sbit_strikes: invalid table version\n" ));
498 error =
FT_THROW( Invalid_File_Format );
507 face->num_sbit_strikes = num_strikes;
582 error = Load_SBit_Range( range, stream );
621 for ( ; strike < strike_limit; strike++ )
629 for ( ; range < range_limit; range++ )
642 face->num_sbit_strikes = 0;
663 if ( strike_index >= face->num_sbit_strikes )
664 return FT_THROW( Invalid_Argument );
666 strike = face->sbit_strikes + strike_index;
708 find_sbit_range(
FT_UInt glyph_index,
728 for ( ; range < range_limit; range++ )
784 return FT_THROW( Invalid_Argument );
817 tt_find_sbit_image(
TT_Face face,
828 if ( !face->sbit_strikes ||
829 ( face->num_sbit_strikes <= strike_index ) )
832 strike = &face->sbit_strikes[strike_index];
834 error = find_sbit_range( glyph_index, strike,
835 arange, aglyph_offset );
849 return FT_THROW( Invalid_Argument );
900 #define FT_STRUCTURE TT_SBit_SmallMetricsRec 944 return FT_THROW( Invalid_File_Format );
1000 line_len = map->
pitch;
1003 for ( count = 0; count < rows; count++ )
1009 for ( ; cur <
limit; cur++ )
1019 if ( count >= rows )
1028 ( rows - count ) * line_len );
1046 for ( count = 0; count < rows; count++ )
1049 FT_Byte* limit = line + line_len;
1052 for ( ; cur <
limit; cur++ )
1079 limit = line + rows * line_len;
1081 for ( ; line <
limit; line += line_len )
1082 if ( line[0] & 0x80 )
1087 limit = line + rows * line_len;
1089 for ( ; line <
limit; line += line_len )
1097 for ( n = 8; n <
width; n += 8 )
1103 cur[0] = (
FT_Byte)( old | ( val >> 7 ) );
1115 }
while ( map->
width > 0 );
1132 limit = line + rows * line_len;
1133 mask = (
FT_Byte)( 0x80 >> ( right & 7 ) );
1135 for ( ; line <
limit; line += line_len )
1136 if ( line[0] & mask )
1143 }
while ( map->
width > 0 );
1170 if ( x_offset < 0 || x_offset + metrics->width > map->
width ||
1171 y_offset < 0 || y_offset + metrics->height > map->
rows )
1173 error =
FT_THROW( Invalid_Argument );
1182 FT_Int line_bits = pix_bits * glyph_width;
1187 switch ( image_format )
1198 line_length = ( glyph_width + 7 ) >> 3;
1201 line_length = ( glyph_width + 3 ) >> 2;
1204 line_length = ( glyph_width + 1 ) >> 1;
1207 line_length = glyph_width;
1210 glyph_size = glyph_height * line_length;
1218 line_bits = glyph_width * pix_bits;
1219 glyph_size = ( glyph_height * line_bits + 7 ) >> 3;
1223 return FT_THROW( Invalid_File_Format );
1233 blit_sbit( map, (
FT_Byte*)stream->
cursor, line_bits, pad_bytes,
1234 x_offset * pix_bits, y_offset, metrics->
height );
1265 error = tt_load_sbit_metrics( stream, range, metrics );
1303 return FT_THROW( Invalid_File_Format );
1324 return Load_SBit_Single( map, x_offset, y_offset, strike->
bit_depth,
1330 error =
FT_THROW( Invalid_Stream_Skip );
1339 return FT_THROW( Invalid_File_Format );
1354 count = num_components;
1359 for ( comp = components; count > 0; count--, comp++ )
1369 count = num_components;
1371 for ( ; count > 0; count--, comp++ )
1387 error = Load_SBit_Image( strike,
1460 error = tt_find_sbit_image( face, glyph_index, strike_index,
1461 &range, &strike, &glyph_offset );
1475 error = Load_SBit_Image( strike, range, ebdt_pos, glyph_offset,
1476 face->
root.
glyph, 0, 0, stream, metrics, 0 );
1481 if ( strike->
flags & 1 )
1498 crop_bitmap( map, metrics );
GLint GLint GLsizei GLsizei height
for(n=1;n< outline->n_points;n++)
GLint GLint GLsizei GLsizei GLsizei depth
return FT_THROW(Missing_Property)
GLsizei GLsizei GLchar * source
GLenum GLenum GLuint components
GLint GLint GLsizei width
tt_face_set_sbit_strike(TT_Face face, FT_Size_Request req, FT_ULong *astrike_index)
#define FT_READ_USHORT(var)
TT_Loader_GotoTableFunc goto_table
TT_SBit_LineMetricsRec hori
tt_face_load_sbit_image(TT_Face face, FT_ULong strike_index, FT_UInt glyph_index, FT_UInt load_flags, FT_Stream stream, FT_Bitmap *map, TT_SBit_MetricsRec *metrics)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLenum GLuint GLint GLenum face
#define FT_ERROR(varformat)
TT_SBit_LineMetricsRec vert
#define FT_STREAM_READ_FIELDS(fields, object)
FT_Match_Size(FT_Face face, FT_Size_Request req, FT_Bool ignore_width, FT_ULong *size_index)
#define FT_STREAM_SKIP(distance)
#define FT_FRAME_USHORT(f)
#define FT_LOAD_CROP_BITMAP
ft_glyphslot_alloc_bitmap(FT_GlyphSlot slot, FT_ULong size)
#define FT_READ_ULONG(var)
TT_SBit_MetricsRec metrics
FT_BEGIN_HEADER tt_face_load_eblc(TT_Face face, FT_Stream stream)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
#define FT_NEW_ARRAY(ptr, count)
#define FT_STREAM_SEEK(position)
TT_SBit_Range sbit_ranges
#define FT_FRAME_ULONG(f)
#define FT_FRAME_SKIP_LONG
tt_face_free_eblc(TT_Face face)
GLuint GLuint GLsizei count
#define FT_FRAME_ENTER(size)
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
#define FT_MEM_MOVE(dest, source, count)
#define FT_FRAME_START(size)
tt_face_load_strike_metrics(TT_Face face, FT_ULong strike_index, FT_Size_Metrics *metrics)