bugThe FreeType Project - Bugs: bug #19586, Incorrect behaviour

 
 

bug #19586: Incorrect behaviour

Submitted by:  None
Submitted on:  Fri 13 Apr 2007 02:59:36 AM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: InvalidPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 13 Apr 2007 07:14:53 AM UTC, comment #1:

I can't reproduce this. The code below returns

FT_New_Memory_Face returns 0
FT_Set_Char_Size returns 0
face->glyph.bitmap.rows == 17
face->glyph.bitmap.width == 15

as expected.

I've used the current CVS of FreeType; valgrind
doesn't report any problem either.

------------------------------------------------------

#include <stdio.h>

#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H

#define FONT_NAME "arial.ttf" // version 3.00
#define FONT_SIZE 367112

int
main (void)
{
unsigned char translate[FONT_SIZE];
FILE *f;

FT_UInt ttt;
FT_Library library;
FT_Error error = 0;
FT_Face face;
FT_Glyph glyph;

f = fopen(FONT_NAME, "r");
fread(translate, FONT_SIZE, 1, f);

FT_Init_FreeType(&library);

error = FT_New_Memory_Face(library, FT_Byte*)translate,
FONT_SIZE, 0, &face);
printf("FT_New_Memory_Face returns %d\n", error);

error = FT_Set_Char_Size(face, 24 << 6, 24 << 6, 72, 72);
printf("FT_Set_Char_Size returns %d\n", error);

ttt = FT_Get_Char_Index(face, 'C');

error = FT_Load_Glyph(face, ttt, FT_LOAD_RENDER);

FT_Get_Glyph(face->glyph, &glyph);
printf("face->glyph.bitmap.rows == %d\n",
face->glyph->bitmap.rows);
printf("face->glyph.bitmap.width == %d\n",
face->glyph->bitmap.width);

return 0;
}

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Fri 13 Apr 2007 02:59:36 AM UTC, original submission:

I'm so sorry about my submitting yesterday for it's not particular.

the FreeType version is 2.3.4 and the font is arial.ttf.

the call code below:

extern unsigned char translate[311636];//Arial
FT_ULong ch;
FT_UInt ttt;
FT_Library library;
FT_Error error = 0;
FT_Face face;

FT_Init_FreeType( &library );

//the font is arial.ttf and the error =0.
error = FT_New_Memory_Face( library, (FT_Byte*)translate, 311636, 0, &face );

//here error = 0;
error = FT_Set_Char_Size(face, (24) << 6, (24) << 6, 72, 72 );

ttt = FT_Get_Char_Index( face, 'C' );

//the following error code returned 0x40
error = FT_Load_Glyph( face, ttt, FT_LOAD_RENDER );
//-------------------------------------------------

FT_Get_Glyph(face->glyph, &glyph);
printf("face->glyph.bitmap.rows == %d\r\n", face->glyph->bitmap.rows);
printf("face->glyph.bitmap.width == %d\r\n", face->glyph->bitmap.width);
.
.
.

I think the value of "face->glyph.bitmap.width = 16" is correct, but the value of "face->glyph.bitmap.rows = 15727634" is abnormal.

/***************************************************************/
the function:TT_Load_Simple_Glyph( TT_Loader load )
sometimes did not evaluate the member of "outline" a right value.

for example: the uppercase letter 'C'.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 13 Apr 2007 07:14:53 AM UTCwlStatusNone=>Invalid
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1