Discussion:
[ft] FreeType Debugging
Ammar ul hassan
2017-06-15 04:55:49 UTC
Permalink
HI!

1) I am trying to debug the Type1 driver by printing some error messages
using FT_ERROR MACRO. I have defined both #define FT_DEBUG_LEVEL_ERROR,
#define FT_DEBUG_LEVEL_TRACE MACROS in ftoption.h to use FT_ERROR.

I am printing some messages after the header formats are checked i.e. after
this line of code
error = check_type1_format( stream, "%!PS-AdobeFont", 14 ); Like this
FT_ERROR(( "This is a Type1 file \n" ));

For testing i have created a client application which takes the name of
type1 font and prints the text on screen by applying that font style (which
means that type1 driver will be invoked ). But its not printing any
message, but application is working perfectly using FreeType.

2) I tried another way for debugging by writing to an external text file
the same text message after the same line of code but it didn't work. So is
it possible to create and write to external files i.e. outside FreeType?
Werner LEMBERG
2017-06-15 06:09:27 UTC
Permalink
Post by Ammar ul hassan
1) I am trying to debug the Type1 driver by printing some error
messages using FT_ERROR MACRO. I have defined both #define
FT_DEBUG_LEVEL_ERROR, #define FT_DEBUG_LEVEL_TRACE MACROS in
ftoption.h to use FT_ERROR.
OK.
Post by Ammar ul hassan
For testing i have created a client application which takes the name
of type1 font and prints the text on screen by applying that font
style (which means that type1 driver will be invoked ). But its not
printing any message, but application is working perfectly using
FreeType.
Which platform? On Unix-like systems, tracing and error messages are
sent to stderr. On Windows, GUI applications can't emit data to
stderr, AFAIK. You should rather use `builds/windows/ftdebug.c'.
Post by Ammar ul hassan
2) I tried another way for debugging by writing to an external text
file the same text message after the same line of code but it
didn't work. So is it possible to create and write to external
files i.e. outside FreeType?
By default, FreeType doesn't have support for such a feature. In most
cases it is fully sufficient to redirect stderr to a file. On the
other hand you can certainly replace the `ftdebug.c' component with
something else.


Werner
Werner LEMBERG
2017-06-16 09:19:45 UTC
Permalink
On Unix-like systems, tracing and error messages are sent to stderr
I tried to compile the Freetype by putting some messages through
fprintf like putting this fprintf( stderr, "File cannot be opened
\n" ); under some obvious code which always runs, but i couldn't see
the output on screen.
Well, *this* is definitely a problem on your side that you have to
solve. Are you sure that you are linking to the right FreeType
library version?
One thing to make the picture clear to you my application which
prints any type1 or truetype styled font on screen uses Xft to show
output. [...]
I can't help here, but you might try the FreeType demo programs to
check whether your extra debugging messages do appear on stderr.
Is there any direct test program which i can use to test type1 font
driver and print my error messages on terminal?
Try the FreeType demo programs (ftview, ftstring, etc.).


Werner
Ammar ul hassan
2017-06-16 09:24:47 UTC
Permalink
Post by Werner LEMBERG
Try the FreeType demo programs (ftview, ftstring, etc.).
Thanks i will look into them.
Post by Werner LEMBERG
On Unix-like systems, tracing and error messages are sent to stderr
I tried to compile the Freetype by putting some messages through
fprintf like putting this fprintf( stderr, "File cannot be opened
\n" ); under some obvious code which always runs, but i couldn't see
the output on screen.
Well, *this* is definitely a problem on your side that you have to
solve. Are you sure that you are linking to the right FreeType
library version?
One thing to make the picture clear to you my application which
prints any type1 or truetype styled font on screen uses Xft to show
output. [...]
I can't help here, but you might try the FreeType demo programs to
check whether your extra debugging messages do appear on stderr.
Is there any direct test program which i can use to test type1 font
driver and print my error messages on terminal?
Try the FreeType demo programs (ftview, ftstring, etc.).
Werner
Loading...