Re: [ft-devel] About errors in gf driver.
> > >> > I have found that `ftview' is not allocating > >> > `handle->current_font->num_indices' correctly for the gf driver, > >> > [...] > >> > >> As a rule of thumb: The error is most certainly not in `ftview' but > >> in your code. It is *very* unlikely that `ftview' works for all > >> formats but GF... > > > > I did not mean that the error was in ftview, but I wanted to know > > where the driver was failing to allocate proper values in ftview. > > I have no idea. You should single-step through the code with a > debugger... – at least this is what I would do. > Ok. > > Yes, I was working on it, as I did `make devel; make', but could not > > figure out why this was not working, I thought first I give a try to > > learn it and then ask for doubts. > > Well, we are six weeks after starting the project – this seems rather > a long time for learning... > > Also, I am not well acquainted with valgrind, so I was learning it > > first and then I was going to reply you. > > Actually, there is nothing to learn except calling it! The produced > output is almost self-explanatory IMHO. > Ok. > >> BTW, what simple program are you using to check whether the GF > >> module works? > > > > No, I am not using them. I am directly using ftview to check for > > its working. > > This is not optimal, since `ftview' uses the caching code, making > everything a bit more complicated (as you have already notived). I > strongly suggest to use a small program derived from the tutorial's > `example1.c' program. Then you can do two debugger sessions in > parallel, one opening a PCF file, say, the other one opening a GF > file. It should then quickly become obvious where the problems in > your code are. > Ok. This is nice. Thank you -- Parth ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] About errors in gf driver.
>> > I have found that `ftview' is not allocating >> > `handle->current_font->num_indices' correctly for the gf driver, >> > [...] >> >> As a rule of thumb: The error is most certainly not in `ftview' but >> in your code. It is *very* unlikely that `ftview' works for all >> formats but GF... > > I did not mean that the error was in ftview, but I wanted to know > where the driver was failing to allocate proper values in ftview. I have no idea. You should single-step through the code with a debugger... – at least this is what I would do. > Yes, I was working on it, as I did `make devel; make', but could not > figure out why this was not working, I thought first I give a try to > learn it and then ask for doubts. Well, we are six weeks after starting the project – this seems rather a long time for learning... > Also, I am not well acquainted with valgrind, so I was learning it > first and then I was going to reply you. Actually, there is nothing to learn except calling it! The produced output is almost self-explanatory IMHO. >> BTW, what simple program are you using to check whether the GF >> module works? > > No, I am not using them. I am directly using ftview to check for > its working. This is not optimal, since `ftview' uses the caching code, making everything a bit more complicated (as you have already notived). I strongly suggest to use a small program derived from the tutorial's `example1.c' program. Then you can do two debugger sessions in parallel, one opening a PCF file, say, the other one opening a GF file. It should then quickly become obvious where the problems in your code are. Werner ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] About errors in gf driver.
> > >> This means that your gf driver did not initialize num_glyphs in FT_Face. >> > > I checked in FTDemo_Install_Font it is properly allocating face->num_glyphs > in FT_Face. Can there be any other possibilities? > > > Most people allocate arrays in memory and initialize variables. > How many glyphs are in your font? > 128 > How does the failure in ftview looks like? > No, there is no error in ftview, I wanted to know what can be the reasons that the driver is not allocating it properly like possible error sources in the driver code. Thanks. -- Parth ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] About errors in gf driver.
> > [commit 11969d558505c338f29b83bbac4d572fb85b3f2b] > > Sorry for the delay in answering your questions; I was abroad without > the ability to update the git repository. > > > I have found that `ftview' is not allocating > > `handle->current_font->num_indices' correctly for the gf driver, > > [...] > > As a rule of thumb: The error is most certainly not in `ftview' but in > your code. It is *very* unlikely that `ftview' works for all formats > but GF... > I did not mean that the error was in ftview, but I wanted to know where the driver was failing to allocate proper values in ftview. > Attached you can find small fixes to make output of the first `make' > call prettier, and to allow `make devel; make' actually work. I've > also attached the log output of `make devel'; as you can see there are > zillions of warnings that you still have to take care of – if I > remember correctly, I advised you to use `make devel; make' for > development, and it is not clear to me why you didn't follow this > advice... Yes, I was working on it, as I did `make devel; make', but could not figure out why this was not working, I thought first I give a try to learn it and then ask for doubts. Also, I am not well acquainted with valgrind, so I was learning it first and then I was going to reply you. At least you should have analyzed what it does and transfer > the used compiler flags to your build environment. > My bad, really sorry for this, I was in the zeal of moving ahead and as the program was compiling and I ignored those flags. I will fix those asap. Thanks. > After fixing those buglets I compiled the demo programs, and the call > > ftview 20 cmr10.2602gf > > crashed immediately. Running with valgrind gives > > Conditional jump or move depends on uninitialised value(s) > at 0x47D79D: gf_free_font (gflib.c:466) > by 0x47D962: GF_Face_Done (gfdrivr.c:145) > by 0x414CA0: open_face (ftobjs.c:1404) > by 0x416971: ft_open_face_internal (ftobjs.c:2447) > by 0x414D53: FT_New_Face (ftobjs.c:1438) > by 0x40AB1B: FTDemo_Install_Font (ftcommon.c:396) > by 0x408B7C: main (ftview.c:1887) > > Use of uninitialised value of size 8 > at 0x47D7A3: gf_free_font (gflib.c:468) > by 0x47D962: GF_Face_Done (gfdrivr.c:145) > by 0x414CA0: open_face (ftobjs.c:1404) > by 0x416971: ft_open_face_internal (ftobjs.c:2447) > by 0x414D53: FT_New_Face (ftobjs.c:1438) > by 0x40AB1B: FTDemo_Install_Font (ftcommon.c:396) > by 0x408B7C: main (ftview.c:1887) > > Invalid read of size 8 > at 0x47D7A3: gf_free_font (gflib.c:468) > by 0x47D962: GF_Face_Done (gfdrivr.c:145) > by 0x414CA0: open_face (ftobjs.c:1404) > by 0x416971: ft_open_face_internal (ftobjs.c:2447) > by 0x414D53: FT_New_Face (ftobjs.c:1438) > by 0x40AB1B: FTDemo_Install_Font (ftcommon.c:396) > by 0x408B7C: main (ftview.c:1887) >Address 0x20008 is not stack'd, malloc'd or (recently) free'd > > So you have to find out why this happens. Note that the problem > happens with *any* file not recognized by other drivers as a font. > Yes I will work on it. For example, you can say > > ftview 20 make.log > > to trigger the bug... > > If I remember correctly I also advised you to add calls to the various > `FT_TRACEX' macros, which both helps you and the user in debugging > issues. Now is the time to do that! > Ok. > BTW, what simple program are you using to check whether the GF module > works? For example, have you adapted > > https://www.freetype.org/freetype2/docs/tutorial/example1.c > > to your needs? Please post it. > No, I am not using them. I am directly using ftview to check for its working. > You should work hard to resolve those issues. Second evaluation is > coming soon... > Yes! I will :-) Thanks. ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] About errors in gf driver.
[commit 11969d558505c338f29b83bbac4d572fb85b3f2b] Sorry for the delay in answering your questions; I was abroad without the ability to update the git repository. > I have found that `ftview' is not allocating > `handle->current_font->num_indices' correctly for the gf driver, > [...] As a rule of thumb: The error is most certainly not in `ftview' but in your code. It is *very* unlikely that `ftview' works for all formats but GF... Attached you can find small fixes to make output of the first `make' call prettier, and to allow `make devel; make' actually work. I've also attached the log output of `make devel'; as you can see there are zillions of warnings that you still have to take care of – if I remember correctly, I advised you to use `make devel; make' for development, and it is not clear to me why you didn't follow this advice... At least you should have analyzed what it does and transfer the used compiler flags to your build environment. After fixing those buglets I compiled the demo programs, and the call ftview 20 cmr10.2602gf crashed immediately. Running with valgrind gives Conditional jump or move depends on uninitialised value(s) at 0x47D79D: gf_free_font (gflib.c:466) by 0x47D962: GF_Face_Done (gfdrivr.c:145) by 0x414CA0: open_face (ftobjs.c:1404) by 0x416971: ft_open_face_internal (ftobjs.c:2447) by 0x414D53: FT_New_Face (ftobjs.c:1438) by 0x40AB1B: FTDemo_Install_Font (ftcommon.c:396) by 0x408B7C: main (ftview.c:1887) Use of uninitialised value of size 8 at 0x47D7A3: gf_free_font (gflib.c:468) by 0x47D962: GF_Face_Done (gfdrivr.c:145) by 0x414CA0: open_face (ftobjs.c:1404) by 0x416971: ft_open_face_internal (ftobjs.c:2447) by 0x414D53: FT_New_Face (ftobjs.c:1438) by 0x40AB1B: FTDemo_Install_Font (ftcommon.c:396) by 0x408B7C: main (ftview.c:1887) Invalid read of size 8 at 0x47D7A3: gf_free_font (gflib.c:468) by 0x47D962: GF_Face_Done (gfdrivr.c:145) by 0x414CA0: open_face (ftobjs.c:1404) by 0x416971: ft_open_face_internal (ftobjs.c:2447) by 0x414D53: FT_New_Face (ftobjs.c:1438) by 0x40AB1B: FTDemo_Install_Font (ftcommon.c:396) by 0x408B7C: main (ftview.c:1887) Address 0x20008 is not stack'd, malloc'd or (recently) free'd So you have to find out why this happens. Note that the problem happens with *any* file not recognized by other drivers as a font. For example, you can say ftview 20 make.log to trigger the bug... If I remember correctly I also advised you to add calls to the various `FT_TRACEX' macros, which both helps you and the user in debugging issues. Now is the time to do that! BTW, what simple program are you using to check whether the GF module works? For example, have you adapted https://www.freetype.org/freetype2/docs/tutorial/example1.c to your needs? Please post it. You should work hard to resolve those issues. Second evaluation is coming soon... Werner diff --git a/include/freetype/internal/fttrace.h b/include/freetype/internal/fttrace.h index 78b731cab..f59a06ed8 100644 --- a/include/freetype/internal/fttrace.h +++ b/include/freetype/internal/fttrace.h @@ -116,6 +116,9 @@ FT_TRACE_DEF( pcfread ) FT_TRACE_DEF( bdfdriver ) FT_TRACE_DEF( bdflib ) + /* GF font components */ +FT_TRACE_DEF( gfdriver ) + /* PFR font component */ FT_TRACE_DEF( pfr ) diff --git a/src/gf/module.mk b/src/gf/module.mk index b64a9370d..1eb534671 100644 --- a/src/gf/module.mk +++ b/src/gf/module.mk @@ -16,7 +16,7 @@ FTMODULE_H_COMMANDS += GF_DRIVER define GF_DRIVER $(OPEN_DRIVER) FT_Driver_ClassRec, gf_driver_class $(CLOSE_DRIVER) -$(ECHO_DRIVER)gf $(ECHO_DRIVER_DESC)gf TeX's bitmap fonts$(ECHO_DRIVER_DONE) +$(ECHO_DRIVER)gf$(ECHO_DRIVER_DESC)METAFONT bitmap fonts$(ECHO_DRIVER_DONE) endef # EOF gcc -ansi -pedantic -I/home/wl/git/freetype/freetype2.parth/src/gf -I/home/wl/git/freetype/freetype2.parth/objs -I/home/wl/git/freetype/freetype2.parth/devel -I/home/wl/git/freetype/freetype2.parth/include -I/usr/local/include/harfbuzz -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -g -O0 -Wall -W -Wundef -Wshadow -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wno-long-long -Wnested-externs -Wstrict-prototypes -DFT2_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="" -o /home/wl/git/freetype/freetype2.parth/objs/gf.o /home/wl/git/freetype/freetype2.parth/src/gf/gf.c In file included from /home/wl/git/freetype/freetype2.parth/src/gf/gflib.c:22:0, from /home/wl/git/freetype/freetype2.parth/src/gf/gf.c:23: /home/wl/git/freetype/freetype2.parth/src/gf/gflib.c: In function ‘gf_read_uintn’: /home/wl/git/freetype/freetype2.parth/include/freetype/internal/ftstream.h:304:19: warning: value computed is not used [-Wunused-value] error != FT_Err_Ok ) ^ /home/wl/git/freetype/freetype2.parth/include/freetype/internal/ftstream.h:306:35: note: in
Re: [ft-devel] About errors in gf driver.
>> >> This means that your gf driver did not initialize num_glyphs in FT_Face. > > I checked in FTDemo_Install_Font it is properly allocating face->num_glyphs > in FT_Face. Can there be any other possibilities? Most people allocate arrays in memory and initialize variables. How many glyphs are in your font? How does the failure in ftview looks like? Did you use gdb?___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] About errors in gf driver.
> > > I have found that `ftview' is not allocating > `handle->current_font->num_indices' correctly for the gf driver > > This means that your gf driver did not initialize num_glyphs in FT_Face. > I checked in FTDemo_Install_Font it is properly allocating face->num_glyphs in FT_Face. Can there be any other possibilities? > Also, I think I am missing out on the understanding about the > > idea of cache in FT. Please help me with this. > > Do not worry about it. It will work once you fixed errors like the one > above and ftview displays glyphs. > Ok . Thanks -- Parth ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] About errors in gf driver.
On Sun, Jul 1, 2018 at 8:52 AM Parth Wazurkar wrote: > I have found that `ftview' is not allocating > `handle->current_font->num_indices' correctly for the gf driver This means that your gf driver did not initialize num_glyphs in FT_Face. > Also, I think I am missing out on the understanding about the > idea of cache in FT. Please help me with this. Do not worry about it. It will work once you fixed errors like the one above and ftview displays glyphs. ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
[ft-devel] About errors in gf driver.
Hi all, I have found that `ftview' is not allocating `handle->current_font->num_indices' correctly for the gf driver, which is causing errors in the `Render_All' function in ftview. Please give me any idea about the possible source of this error, which can help me. Also, I think I am missing out on the understanding about the idea of cache in FT. Please help me with this. Also, have you tested the gf driver? Did you find any direct errors, which needs to be addressed first, please let me know? Thank you -- Parth ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel