freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Problems in GF_Glyph_Load function.


From: Parth Wazurkar
Subject: Re: [ft-devel] Problems in GF_Glyph_Load function.
Date: Sun, 8 Jul 2018 02:10:03 +0530

>> > While debugging through the `GF_Glyph_Load' function in
>> > `gfdrivr.c', I found out that the typecasting of `FT_Face' into
>> > `GF_Face' is not working properly.  In, `GF_Face gf =
>> > (GF_Face)FT_SIZE_FACE( size );', when I extract the `gf_glyph'
>> > element from `gf', it is unable to return the glyph bitmap table.
>> > Can anyone please point out where the error can be.
>>
>> Obviously, the size object doesn't contain the right GF_Face
>> object.
>
> But, then this way works for bdf and winfont. Why is it so?

I guess there is a buglet somewhere...

I checked through gdb, it shows that the address of `GF_Face' does not change
and is the same as returned by `FT_SIZE_FACE', Can there be any
other problem? please help.
Here is the output of gdb...

                                                   
Breakpoint 1, main (argc=3, argv=0x7fffffffdb78) at ftexample.c:72
72    {
(gdb) watch -l face
Hardware watchpoint 2: -location face
(gdb) c
Continuing.
Hi I am here1
Hi I am here2
FT_Open_Face: Requesting face 0
FT_Stream_Open: opened `cmr10.600gf' (24148 bytes) successfully
TTF driver
  SFNT driver
  not a font using the SFNT container format
Type 1 driver
  not a Type 1 font
CFF driver
  SFNT driver
  not a font using the SFNT container format
  not a CFF font header
CID driver
  not a CID-keyed font
PFR driver
  not a PFR font
Type 42 driver
  not a Type42 font
Windows FNT driver
  not a Windows FNT file
PCF driver
  ... try gzip stream
  ... try LZW stream
  ... try Bzip2 stream
  not a PCF file
BDF driver
  not a BDF file
GF driver
gf_load_font: GF_ID(131) found gf_load_font: GF_POST_POST(249) found
gf_load_font: GF Postamble found
gf_load_font: Allocated bitmap table
  number of glyphs: allocated 128 go->code_min is 0 and go->code_max is 255
FT_Open_Face: New face object, adding to list
FT_Open_Face: Creating glyph slot
FT_New_GlyphSlot: Creating new slot object
FT_New_GlyphSlot: Return 0x0
FT_Open_Face: Creating size object

Hardware watchpoint 2: -location face

Old value = (struct FT_FaceRec_ *) 0x7
New value = (struct FT_FaceRec_ *) 0x5555557a9360
0x00007ffff7b22c8d in ft_open_face_internal (library=0x5555557a84c0, address@hidden0x7fffffffd990, face_index=0,
    aface=0x7fffffffda28, test_mac_fonts=test_mac_fonts@entry=1 '\001') at /home/parth/freetype-devel/src/base/ftobjs.c:2623
2623          *aface = face;
(gdb) c
Continuing.
FT_Open_Face: Return 0x0
Hi I am here3 face->num_glyphs is 128
FT_Request_Size (gf driver):
  x scale: 0 (0.000000)
  y scale: 0 (0.000000)
  ascender: 0.000000
  descender: 0.000000
  height: 0.000000
  max advance: 0.000000
  x ppem: 0
  y ppem: 0
Hi I am here
Hi I am here in transform
HI I am here in FT_Load_Char and glyph_index1 is 65
HI I am here in FT_Load_Char and glyph_index2 is 65
Hi I reached GF_Load_Glyph gf is 0x5555557a9360 face is 0x5555557a9360 /* In FT_SIZE_FACE */
GF_Glyph_Load: glyph index 65
invalid glyph index
go->code_min is 0 and go->code_max is 0 /* here go->code_max should be 255 if the GF_Face is properly extracted */
                                                                                                                                                                                                                                                                                                                                                           
FT_Done_Library: close faces for type42
FT_Done_Library: close faces for truetype
FT_Done_Library: close faces for type1
FT_Done_Library: close faces for cff
FT_Done_Library: close faces for t1cid
FT_Done_Library: close faces for pfr
FT_Done_Library: close faces for type42
FT_Done_Library: close faces for winfonts
FT_Done_Library: close faces for pcf
FT_Done_Library: close faces for bdf
FT_Done_Library: close faces for gf

Hardware watchpoint 2: -location face

Old value = (struct FT_FaceRec_ *) 0x5555557a9360
New value = (struct FT_FaceRec_ *) 0x0
0x00007ffff73b5872 in __GI___call_tls_dtors () at cxa_thread_atexit_impl.c:145
145    cxa_thread_atexit_impl.c: No such file or directory.
(gdb) Quit
(gdb)

I found the buglet, it was in `gf_free_font' function. Now, it is properly allocating the
`bitmap' and glyph metrics, but `ftexample' is not showing the image of the glyph.
I am not able to figure out why is it not showing an image. Can you point out some
possible error? Please help.
This is the output from `ftexample':

FT_Request_Size (gf driver):
  x scale: 0 (0.000000)
  y scale: 0 (0.000000)
  ascender: 0.000000
  descender: 0.000000
  height: 0.000000
  max advance: 0.000000
  x ppem: 0
  y ppem: 0
Hi I am here
Hi I am here in transform
GF_Glyph_Load: glyph index 65
FT_Load_Glyph: index 65, flags 0x4
  x advance: 6.343750
  y advance: 2.953125
  linear x advance: 0.000000
  linear y advance: 0.000000
  bitmap 7x7, monochrome bitmap (mode 1)

Thank you

Parth

reply via email to

[Prev in Thread] Current Thread [Next in Thread]