freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] GSoC status update.


From: Parth Wazurkar
Subject: Re: [ft-devel] GSoC status update.
Date: Mon, 16 Jul 2018 15:23:55 +0530


>>> I've still not found time to have a closer look at the issue, sorry
>>> (still on vacation more or less).  Please try to debug it by
>>> yourself also – I can only assist, since it's actually your job to
>>> find the bug...
>>
>> Yes, I am working on it.  If you could just give me a lead like
>> where should I look upon and like possible sources of errors, it
>> will be great help.
>
> I'm quite sure this is not a problem of `ftview'.  Similarly, I'm
> quite sure it is not a problem of FreeType's caching code either.

I've now done some debugging:

  gdb --args /home/wl/git/freetype/freetype2-demos.parth/bin/ftstring 20 cmr10.600gf
  (gdb) r
  Program received signal SIGSEGV, Segmentation fault.
  0x00007ffff6817ea6 in __strcmp_ssse3 () from /lib64/libc.so.6
  (gdb) up
  #1  0x00000000004088af in my_face_requester (face_id=0x762110,
      lib=0x747df0, request_data=0x0, aface=0x770118) at src/ftcommon.c:239
  239           if ( !strcmp( format, "Type 1" ) )
  (gdb) p format
  $1 = 0x0
  (gdb) l
  234         if ( !error )
  235         {
  236           const char*  format = FT_Get_Font_Format( *aface );
  237
  238
  239           if ( !strcmp( format, "Type 1" ) )
  240           {
  241             char   orig[5];
  242             char*  suffix        = (char*)strrchr( font->filepathname, '.' );
  243             int    has_extension = suffix                                &&

This clearly shows that the problem is in `FT_Get_Font_Format'; this
function returns zero which looks very fishy according to its
documentation.

  (gdb) b FT_Get_Font_Format
  (gdb) r
  Breakpoint 1, FT_Get_Font_Format (face=0x7703c0) at
    /home/wl/git/freetype/freetype2.parth/src/base/ftfntfmt.c:30
  30          const char*  result = NULL;
  (gdb) n
  33          if ( face )
  (gdb)
  34            FT_FACE_FIND_SERVICE( face, result, FONT_FORMAT );
  (gdb)
  36          return result;
  (gdb) p result
  $2 = 0x0

Obviously, there is a problem with the `FONT_FORMAT' service in the GF
driver; let's check the winfnt driver for comparison.

  cd winfonts
  git grep FONT_FORMAT
    winfnt.c:#include FT_SERVICE_FONT_FORMAT_H
    winfnt.c:    { FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_WINFNT },

  cd gf
  git grep FONT_FORMAT
    gfdrivr.c:#include FT_SERVICE_FONT_FORMAT_H

Ouch, the service is completely missing...

Tadaa!

Have a look into `include/freetype/internal/services/svfntfmt.h'.

Yes! indeed! Thank you so much for that.


Please tell me why you wasn't able to identify the problem by
yourself! 

Actually, I thought that these services are not a regular part of the module
and are defined only if there are functions of the driver required outside the
driver, so I did not define them. But, I was unaware that the services are
used by the demo program. As I was first debugging with `ftview' and I was
going function by function to debug it and I was stuck at the `FTC' functions.
Then when you told to debug through `ftstring', I thought to do it later
as I was in middle of learning about the `vf' fonts.
 
Perhaps there is some missing documentation or a missing
explanatory comment in the code...

Now `ftview' displays the gf glyphs too!
I am attaching a screenshot of the output from `ftview' and `ftstring'!
[...]
Attaching a cropped image.

Attachment: gf_ftstring_output.png
Description: PNG image


reply via email to

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