Tue 10 Feb 2009 08:51:36 AM UTC, comment #10:
Tested OK
|
Mon 09 Feb 2009 10:21:01 PM UTC, comment #9:
OK, found the problem. Should be fixed now. Please test.
|
Mon 09 Feb 2009 12:33:10 PM UTC, comment #8:
Sry, I was confused and combined two bugs into one :s.
If you want to reproduce this error you can use ftdump to dump the attached sample file. If you do this you'll see that the EM size, bounding box, ... is 0. However if you apply the fix I proposed you get the actual values from the font 1000, (-240,-206):(1252,945),...
This is why the font causes issues later on in our code.
|
Mon 09 Feb 2009 08:26:57 AM UTC, comment #7:
The only thing special we do with freetype in our own build is override the file IO calls to accept UTF8 path names.
GPathName and GBuffer are our own classes but i don't think this should cause any problems.
The complete call is:
FT_Error
GFFactoryFont::CreateFace( const GPathName& inData,
int32_t inFace,
FT_Face& outFace )
{
GBuffer thePath;
inData
.GetCrossPlatformString()
.GetBuffer( thePath, GENCUTF8 );
outFace = 0;
FT_Error theError = FT_New_Face( mLibrary, (const char*)thePath.GetPtr(), inFace, &outFace );
....
after this call theError is not 0.
I'll try to reproduce it with only the freetype2/ft2demos code and add a better usable snippet. But i'm having some trouble upgrading my automake on mac.
|
Mon 09 Feb 2009 08:18:01 AM UTC, comment #6:
I've just used a different program linked to FreeType, and
it fails too (since I don't have the sources I can't debug
this further). Apparently, it depends how FT_New_Face is
called, and the demo programs don't cover this problematic
case.
So I really need a compilable code snippet to find out the
problem.
|
Mon 09 Feb 2009 08:00:08 AM UTC, comment #5:
Please follow README.CVS.
Alternatively, say `make devel; make'.
It's very mysterious that `FT_New_Face' fails.
|
Mon 09 Feb 2009 07:38:39 AM UTC, comment #4:
I only call FT_New_Face, this call already returns an error.
I tried the CVS version in our code and it still fails. However I couldn't build the cvs version the normal way: cd <directory>;./configure;make . So i couldn't test it with ftview.
What extra steps do i need to build from the CVS version (compared to when you download the zip file containing the sources)?
|
Sun 08 Feb 2009 09:12:45 AM UTC, comment #3:
I can't repeat the problem with ftview, using the current CVS.
The font loads just fine without any errors.
Please provide a compilable code snippet which exhibits the
problem (this is, what you do differently compared to ftview).
|
Fri 06 Feb 2009 09:45:59 AM UTC, comment #2:
I attached a sample file containing a subsetted truetype font.
This font was extracted from a pdf. The pdf only uses a space character (which has an empty glyph). But when we try to extract the outline we get an error from freetype. I believe freetype should return the empty glyph instead of failing to parse the font.
|
Fri 06 Feb 2009 09:10:03 AM UTC, comment #1:
The patch you suggest is exactly what I want to avoid, this is,
making `glyf' a special case in tt_face_lookup_table.
Can you post a sample font together with some code so that I
can debug the problem in more detail? I assume that a fix should
be straightforward.
|
Thu 05 Feb 2009 09:47:38 AM UTC, original submission:
ttload.cpp, tt_face_lookup_table ignores empty 'glyf' tables. However it possible to have an empty 'glyf' table (for example in subsetted fonts that only have the 'space' character left).
If you parse a font with an empty 'glyf' table you get infinite results for the glyph metrics because this call is used to determine if the font is an outline font or a bitmap font.
This bug was already submitted in #25010 for 2.3.7, but it still is an issue in 2.3.8.
proposed fix:
/* For compatibility with Windows, we consider */
/* zero-length tables the same as missing tables. */
if ( entry->Tag == tag ) {
if ( entry->Length != 0 )
{
FT_TRACE4(( "found table.\n" ));
return entry;
}
#ifdef FT_DEBUG_LEVEL_TRACE
zero_length = TRUE;
#endif
}
should be replaced by:
/* For compatibility with Windows, we consider */
/* zero-length tables the same as missing tables. */
if ( entry->Tag == tag ) {
if ( entry->Length != 0 || tag == TTAG_glyf )
{
FT_TRACE4(( "found table.\n" ));
return entry;
}
#ifdef FT_DEBUG_LEVEL_TRACE
zero_length = TRUE;
#endif
}
|