21#include FT_INTERNAL_DEBUG_H
22#include FT_INTERNAL_STREAM_H
27#define FT_COMPONENT trace_pfr
89 if ( (
n & 7 ) == reload )
108 else if (
mask == 0 )
169 }
while (
count == 0 );
187 else if (
mask == 0 )
195 reload = ( --
count <= 0 );
234 }
while (
count == 0 );
252 else if (
mask == 0 )
260 reload = ( --
count <= 0 );
313 " number of bitmap records too large,\n"
315 " thus ignoring all bitmaps in this strike\n" ));
316 *
flags &= ~PFR_BITMAP_VALID_CHARCODES;
321 for (
p =
base;
p < lim;
p += char_len )
331 " bitmap records are not sorted,\n"
333 " thus ignoring all bitmaps in this strike\n" ));
334 *
flags &= ~PFR_BITMAP_VALID_CHARCODES;
367 if ( char_code <
code )
369 else if ( char_code >
code )
431 ypos = ( (
FT_Char)(
b << 4 ) ) >> 4;
468 xsize = (
b >> 4 ) & 0xF;
519 *aformat =
flags >> 2;
527 FT_ERROR((
"pfr_load_bitmap_metrics: invalid glyph data\n" ));
594 character = &phys->chars[glyph_index];
602 strike = phys->strikes;
603 for (
n = 0;
n < phys->num_strikes;
n++ )
605 if ( strike->x_ppm == (
FT_UInt)
size->root.metrics.x_ppem &&
606 strike->y_ppm == (
FT_UInt)
size->root.metrics.y_ppem )
613 return FT_THROW( Invalid_Argument );
640 character->char_code,
663 if ( phys->metrics_resolution != phys->outline_resolution )
665 (
FT_Long)phys->outline_resolution,
666 (
FT_Long)phys->metrics_resolution );
668 glyph->root.linearHoriAdvance =
advance;
674 (
FT_Long)phys->metrics_resolution );
713 if ( ( (
FT_ULong)xsize * ysize + 7 ) / 8 > gps_size )
717 if ( (
FT_ULong)xsize * ysize > 15 * gps_size )
721 if ( (
FT_ULong)xsize * ysize > 255 * ( ( gps_size + 1 ) / 2 ) )
725 FT_ERROR((
"pfr_slot_load_bitmap: invalid image type\n" ));
732 FT_ERROR((
"pfr_slot_load_bitmap: invalid bitmap dimensions\n" ));
748 FT_TRACE1((
"huge bitmap glyph %dx%d over FT_GlyphSlot\n",
755 glyph->root.format = FT_GLYPH_FORMAT_BITMAP;
760 glyph->root.bitmap.width = xsize;
761 glyph->root.bitmap.rows = ysize;
762 glyph->root.bitmap.pitch = (
FT_Int)( xsize + 7 ) >> 3;
766 glyph->root.metrics.width = (
FT_Pos)xsize << 6;
767 glyph->root.metrics.height = (
FT_Pos)ysize << 6;
768 glyph->root.metrics.horiBearingX = xpos * 64;
769 glyph->root.metrics.horiBearingY = ypos * 64;
771 glyph->root.metrics.vertBearingX = - glyph->root.metrics.width >> 1;
772 glyph->root.metrics.vertBearingY = 0;
773 glyph->root.metrics.vertAdvance =
size->root.metrics.height;
776 glyph->root.bitmap_left = (
FT_Int)xpos;
795 &glyph->root.bitmap );
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
static unsigned char buff[32768]
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
#define FT_TRACE0(varformat)
#define FT_ERROR(varformat)
#define FT_TRACE1(varformat)
FT_BEGIN_HEADER typedef signed long FT_Pos
ft_glyphslot_alloc_bitmap(FT_GlyphSlot slot, FT_ULong size)
#define FT_FRAME_ENTER(size)
#define FT_STREAM_SEEK(position)
#define FT_PEEK_USHORT(p)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLuint GLuint GLsizei count
GLenum GLuint GLint GLenum face
GLboolean GLboolean GLboolean b
static PROTOCOLDATA * pdata
#define PFR_NEXT_ULONG(p)
#define PFR_NEXT_SHORT(p)
#define PFR_NEXT_USHORT(p)
typedefFT_BEGIN_HEADER struct PFR_FaceRec_ * PFR_Face
struct PFR_BitWriter_ * PFR_BitWriter
static void pfr_bitwriter_decode_rle2(PFR_BitWriter writer, FT_Byte *p, FT_Byte *limit)
pfr_slot_load_bitmap(PFR_Slot glyph, PFR_Size size, FT_UInt glyph_index, FT_Bool metrics_only)
struct PFR_BitWriter_ PFR_BitWriterRec
static FT_Error pfr_load_bitmap_bits(FT_Byte *p, FT_Byte *limit, FT_UInt format, FT_Bool decreasing, FT_Bitmap *target)
static void pfr_bitwriter_init(PFR_BitWriter writer, FT_Bitmap *target, FT_Bool decreasing)
static FT_Error pfr_load_bitmap_metrics(FT_Byte **pdata, FT_Byte *limit, FT_Long scaled_advance, FT_Long *axpos, FT_Long *aypos, FT_UInt *axsize, FT_UInt *aysize, FT_Long *aadvance, FT_UInt *aformat)
static void pfr_bitwriter_decode_bytes(PFR_BitWriter writer, FT_Byte *p, FT_Byte *limit)
static void pfr_bitwriter_decode_rle1(PFR_BitWriter writer, FT_Byte *p, FT_Byte *limit)
static void pfr_lookup_bitmap_data(FT_Byte *base, FT_Byte *limit, FT_UInt count, FT_UInt *flags, FT_UInt char_code, FT_ULong *found_offset, FT_ULong *found_size)
#define PFR_BITMAP_VALID_CHARCODES
#define PFR_BITMAP_2BYTE_CHARCODE
#define PFR_FLAG_INVERT_BITMAP
#define PFR_BITMAP_2BYTE_SIZE
#define PFR_BITMAP_3BYTE_OFFSET
#define PFR_BITMAP_CHARCODES_VALIDATED