Re: [ft-devel] FreeType version 2.2.1 released
On Mon, 5 Jun 2006, David Turner wrote: Werner LEMBERG a �crit : Testing the patch, I'm getting another crash for a Type1 font: [...] Seems like ft_face-available_sizes is NULL. I don't have time to follow the thread -- is it necessary to do something on the FreeType side (either code or documentation)? Can you provide a patch in case we should fix something? no, it's ok, the patch I provided had just a little bug, but I think that this had been corrected. Correct. However, I cannot reproduce the warning message that Matthias and James are reporting. James, did you get more info yet? Do you guys need an updated patch with the fix, or had this been integrated in the CVS already ? I don't think this has been integrated. Regards, - David Turner - The FreeType Project (www.freetype.org) --behdad http://behdad.org/ Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill -- Dan Bern, New American Language ___ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] FreeType version 2.2.1 released
Testing the patch, I'm getting another crash for a Type1 font: [...] Seems like ft_face-available_sizes is NULL. I don't have time to follow the thread -- is it necessary to do something on the FreeType side (either code or documentation)? Can you provide a patch in case we should fix something? Werner ___ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] FreeType version 2.2.1 released
On Thu, 18 May 2006, Matthias Clasen wrote: On Wed, 2006-05-17 at 19:40 -0400, James Cloos wrote: Changing line 194 of your patch from: if ( strike_index != 0xU ) to if ( strike_index != 0xU ft_face-available_sizes != NULL) avoids a NULL dereference in FT_Do_SBit_Metrics() in ftfuncs.c. After that change I can't crash xfs, but any ttf font (sfnt/glyf font) showns only odd glyphs in a 16bit encoding such as iso10646-1. 8bit encodings work fine, as do type1 fonts. Testing the patch, I'm getting another crash for a Type1 font: #0 0x003ea427 in FT_Do_SBit_Metrics (ft_face=0x8a394c8, ft_size=0x8a21328, strike_index=0, glyph_index=0, metrics_return=0xbff4d58c, sbitchk_incomplete_but_exist=0xbff4d588) at ftfuncs.c:989 #1 0x003ea60a in FreeTypeRasteriseGlyph (idx=0, flags=1, tgp=0x8a3fa00, instance=0x8a21210, hasMetrics=0) at ftfuncs.c:1128 #2 0x003e9834 in FreeTypeInstanceGetGlyph (idx=0, flags=1, g=0xbff4d768, instance=0x8a21210) at ftfuncs.c:711 #3 0x003f1143 in FreeTypeLoadXFont (fileName=0xbff4de43 /usr/share/X11/fonts/Type1/UTBI.pfa, vals=0xbff4ddd4, xf=0x0, info=0xbff4eaec, bmfmt=0xbff4d974, entry=0x89680c0) at ftfuncs.c:3458 #4 0x003f1dcd in FreeTypeGetInfoScalable (fpe=0x8929a08, info=0xbff4eaec, entry=0x89680c0, fontName=0xbff4de38, fileName=0xbff4de43 /usr/share/X11/fonts/Type1/UTBI.pfa, vals=0xbff4ddd4) at ftfuncs.c:3874 #5 0x003e569a in FontFileListOneFontWithInfo (client=0x8a03900, fpe=0x8929a08, namep=0xbff4eaa8, namelenp=0xbff4eaa4, pFontInfo=0xbff4eb4c) at fontfile.c:1010 #6 0x003e57bf in FontFileListNextFontWithInfo (client=0x8a03900, fpe=0x8929a08, namep=0xbff4eb58, namelenp=0xbff4eb54, pFontInfo=0xbff4eb4c, numFonts=0xbff4eb50, private=0x8a26070) at fontfile.c:1048 #7 0x0805057b in init_fs_handlers () #8 0x08050d1f in init_fs_handlers () #9 0x0804d640 in set_font_authorizations () #10 0x0804dddf in set_font_authorizations () #11 0x080525f6 in init_fs_handlers () #12 0x00126724 in __libc_start_main () from /lib/libc.so.6 #13 0x0804a451 in ?? () Seems like ft_face-available_sizes is NULL. --behdad http://behdad.org/ Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill -- Dan Bern, New American Language ___ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] FreeType version 2.2.1 released
Hello everyone, here's attached a small patch to libXfont-X11R7.0-1.0.0 that I've just written to let the library compile with 2.2 I still consider the patch experimental, for the following reasons: - first of all, I could only _compile_ and install libXfont with it. I have no idea of how to quickly test the changes, and clearly don't have the time to rebuild the whole X.Org server. - the patch doesn't disable features. Most of what was done by the original code can be performed with the public API (yeaaah, just like most rogue clients anyway ;-) the only difference is the way the bitmap character sizes are computed in the function FreeTypeOpenInstance function. The old code tested an internal font table flag that is, as far as I know, always set in TrueType fonts. Also, I really don't understand why the test was here in the first place, since it only relates to internal computations needed by the bytecode interpreter. I'd appreciate if someone could test this patch and inform me of any problems with it. If it works well, we'll add it to our list of rogue patches. Regards, - David Turner - The FreeType Project (www.freetype.org) [EMAIL PROTECTED] a écrit : Hi, On Tue, 16 May 2006 13:19:33 -0400 Matthias Clasen [EMAIL PROTECTED] wrote: We looked at updating freetype to 2.2.1 in Fedora recently, but discovered that libXfont still depends on the internal freetype headers (in the X 7.1 release candidate). So I wondered if anybody has a libXfont patch. There is none on the list of rogue clients... I think Turner is aware of libXfont issue. I was working to fix libXfont but not finished, see http://lists.gnu.org/archive/html/freetype-devel/2006-02/msg00098.html At least, I can't have a time to restart the work until 2006/06/18. Too late? oops. Regards, mpsuzuki ___ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel *** Information contained in this email message is confidential and may be privileged, and is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the [EMAIL PROTECTED] and destroy the original message. *** diff -ubrN libXfont-X11R7.0-1.0.0/src/FreeType/ftfuncs.c libXfont-X11R7.0-1.0.0-new/src/FreeType/ftfuncs.c --- libXfont-X11R7.0-1.0.0/src/FreeType/ftfuncs.c 2005-10-23 20:32:05.0 +0200 +++ libXfont-X11R7.0-1.0.0-new/src/FreeType/ftfuncs.c 2006-05-17 13:50:17.527499000 +0200 @@ -54,10 +54,7 @@ #include FT_TYPE1_TABLES_H #include FT_XFREE86_H #include FT_BBOX_H -#include FT_INTERNAL_TRUETYPE_TYPES_H #include FT_TRUETYPE_TAGS_H -#include FT_INTERNAL_SFNT_H -#include FT_INTERNAL_STREAM_H /* * If you want to use FT_Outline_Get_CBox instead of * FT_Outline_Get_BBox, define here. @@ -123,6 +120,46 @@ }; +/* read 2-byte value from a SFNT table */ +static FT_UShort +sfnt_get_ushort( FT_Face face, + FT_ULongtable_tag, + FT_ULongtable_offset ) +{ + FT_Bytebuff[2]; + FT_ULong len = sizeof(buff); + FT_UShort result = 0; + + if ( !FT_Load_Sfnt_Table( face, table_tag, table_offset, buff, len ) ); +result = (FT_UShort)( (buff[0] 8) | buff[1] ); + + return result; +} + +#define sfnt_get_short(f,t,o) ((FT_Short)sfnt_get_ushort((f),(t),(o))) + + +#if 0 +static FT_ULong +sfnt_get_ulong( FT_Face face, +FT_ULong table_tag, +FT_ULong table_offset ) +{ + FT_Bytebuff[4]; + FT_ULong len = sizeof(buff); + FT_UShort result = 0; + + if ( !FT_Load_Sfnt_Table( face, table_tag, table_offset, buff, len ); +result = ((FT_ULong)buff[0] 24) | ((FT_ULong)buff[1] 16) | + ((FT_ULong)buff[2] 8) | (FT_ULong)buff[3]; + + return result; +} +#endif + + + + static int ftypeInitP = 0; /* is the engine initialised? */ FT_Library ftypeLibrary; @@ -211,6 +248,10 @@ if(maxp maxp-maxContours == 0) face-bitmap = 1; } + +face-num_hmetrics = (FT_UInt) sfnt_get_ushort( face-face, +TTAG_hhea, 34 ); + /* Insert face in hashtable and return it */ face-next = faceTable[bucket]; faceTable[bucket] = face; @@ -462,6 +503,29 @@ } if( FT_IS_SFNT( face-face ) ) { +#if 1 +FT_F26Dot6 tt_char_width, tt_char_height, tt_dim_x, tt_dim_y; +FT_UInt nn; + +instance-strike_index=0xU; + +
Re: [ft-devel] FreeType version 2.2.1 released
David == David Turner [EMAIL PROTECTED] writes: David here's attached a small patch to libXfont-X11R7.0-1.0.0 that I've just David written to let the library compile with 2.2 I'm giving it a test now. I should have a report back by the end of the day. -JimC -- James H. Cloos, Jr. [EMAIL PROTECTED] ___ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] FreeType version 2.2.1 released
I compiled libXfont-1.1.0 with your patch and then xfs-1.0.2 (the X Font Sever) against that. Both are also against freetype-2.2.1. I did these via the gentoo ebuilds (hacking the libXfont ebuild to add your patch), so I'll have to recompile to get better debugging, but running the xfs under gdb, and using: fslsfonts -l -m -u -server unix/:7100 I was able to segv xfs. Gdb reports this: ,(gdb xfs; run -nodaemon) | Program received signal SIGSEGV, Segmentation fault. | 0xb7ebedea in FT_Do_SBit_Metrics () from /usr/lib/libXfont.so.1 | (gdb) where | #0 0xb7ebedea in FT_Do_SBit_Metrics () from /usr/lib/libXfont.so.1 | #1 0xb7ec0018 in FreeTypeRasteriseGlyph () from /usr/lib/libXfont.so.1 | #2 0xb7ec0505 in FreeTypeInstanceGetGlyph () from /usr/lib/libXfont.so.1 | #3 0xb7ec3995 in FreeTypeLoadXFont () from /usr/lib/libXfont.so.1 | #4 0xb7ec65e5 in FreeTypeGetInfoScalable () from /usr/lib/libXfont.so.1 | #5 0xb7ebc6b2 in FontFileListNextFontWithInfo () from /usr/lib/libXfont.so.1 | #6 0x080517cf in do_list_fonts_with_info () | #7 0x08051f7a in StartListFontsWithInfo () | #8 0x0804dd3e in ProcListFontsWithXInfo () | #9 0x0804e5c4 in Dispatch () | #10 0x080524fc in main () ` FT_Do_SBit_Metrics looks like this in your patch: ,(from ftfuncs.c) | FT_Do_SBit_Metrics( FT_Face ft_face, FT_Size ft_size, FT_ULong strike_index, | FT_UShort glyph_index, FT_Glyph_Metrics *metrics_return, | int *sbitchk_incomplete_but_exist ) | { | #if 1 | if ( strike_index != 0xU ) | { | FT_Error error; | FT_Bitmap_Size* sz = ft_face-available_sizes[strike_index]; | | error = FT_Set_Pixel_Sizes( ft_face, sz-x_ppem/64, sz-y_ppem/64 ); | if ( !error ) | { | error = FT_Load_Glyph( ft_face, glyph_index, FT_LOAD_SBITS_ONLY ); | if ( !error ) | { | if ( metrics_return != NULL ) | *metrics_return = ft_face-glyph-metrics; | | return 0; | } | } | } | return -1; | #endif | } ` I'm re-compiling now with -ggdb. -JimC ___ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] FreeType version 2.2.1 released
We looked at updating freetype to 2.2.1 in Fedora recently, but discovered that libXfont still depends on the internal freetype headers (in the X 7.1 release candidate). So I wondered if anybody has a libXfont patch. There is none on the list of rogue clients... Matthias ___ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] FreeType version 2.2.1 released
Hi, On Tue, 16 May 2006 13:19:33 -0400 Matthias Clasen [EMAIL PROTECTED] wrote: We looked at updating freetype to 2.2.1 in Fedora recently, but discovered that libXfont still depends on the internal freetype headers (in the X 7.1 release candidate). So I wondered if anybody has a libXfont patch. There is none on the list of rogue clients... I think Turner is aware of libXfont issue. I was working to fix libXfont but not finished, see http://lists.gnu.org/archive/html/freetype-devel/2006-02/msg00098.html At least, I can't have a time to restart the work until 2006/06/18. Too late? oops. Regards, mpsuzuki ___ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel
[ft-devel] FreeType version 2.2.1 released
FreeType 2.2.1 has been released. It is available from http://savannah.nongnu.org/download/freetype/ or http://sourceforge.net/project/showfiles.php?group_id=3157 The latter site also holds older versions of the FreeType library. See below for the relevant snippet from the CHANGES file. Enjoy! Werner -- FreeType 2 is a software font engine that is designed to be small, efficient, highly customizable, and portable while capable of producing high-quality output (glyph images) of most vector and bitmap font formats. Note that FreeType 2 is a font service and doesn't provide APIs to perform higher-level features, like text layout or graphics processing (e.g., colored text rendering, `hollowing', etc.). However, it greatly simplifies these tasks by providing a simple, easy to use, and uniform interface to access the content of font files. FreeType 2 is released under two open-source licenses: our own BSD-like FreeType License and the GPL. It can thus be used by any kind of projects, be they proprietary or not. -- CHANGES BETWEEN 2.2.1 and 2.2 I. IMPORTANT BUG FIXES - Various integer overflows have been fixed. - PFB fonts with MacOS resource fork weren't handled correctly on non-MacOS platforms. == CHANGES BETWEEN 2.2 and 2.1.10 (not released officially) I. IMPORTANT BUG FIXES - Vertical metrics for SFNT fonts were incorrect sometimes. - The FT_HAS_KERNING macro always returned 0. - CFF OpenType fonts didn't return correct vertical metrics for glyphs with outlines. - If FreeType was compiled without hinters, all font formats based on PS outlines weren't scaled correctly. II. IMPORTANT CHANGES - Version 2.2 no longer exposes its internals, this is, the header files located in the `include/freetype/internal' directory of the source package are not copied anymore by the `make install' command. Consequently, a number of rogue clients which directly access FreeType's internal functions and structures won't compile without modification. We provide patches for most of those rogue clients. See the following page for more information: http://www.freetype.org/freetype2/patches/rogue-patches.html Note that, as a convenience to our Unix desktop users, version 2.2 is *binary* compatible with FreeType 2.1.7, which means that installing this release on an existing distribution shall not break any working desktop. - FreeType's build mechanism has been redesigned. With GNU make it is now sufficient in most cases to edit two files: `modules.cfg', to select the library components, and the configuration file `include/freetype/config/ftoption.h' (which can be copied to the objects directory). Removing unused module directories toprevent its compilationand editing `include/freetype/config/ftmodule.h' is no longer necessary. - The LIGHT hinting algorithm produces more pleasant results. Also, using the FT_LOAD_TARGET_LIGHT flags within FT_Load_Glyph always forces auto-hinting, as a special exception. This allows you to experiment with it even if you have enabled the TrueType bytecode interpreter in your build. - The auto hinter now employs a new algorithm for CJK fonts, based on Akito Hirai's patch. Note that this only works for fonts with a Unicode charmap at the moment. - The following callback function types have changed slightly (by adding the `const' keyword where appropriate): FT_Outline_MoveToFunc FT_Outline_LineToFunc FT_Outline_ConicToFunc FT_Outline_CubicToFunc FT_SpanFunc FT_Raster_RenderFunc FT_Glyph_TransformFunc FT_Renderer_RenderFunc FT_Renderer_TransformFunc Note that this doesn't affect binary backward compatibility. - On MacOS, new APIs have been added as replacements for legacy APIs: `FT_New_Face_From_FSRef' for `FT_New_Face_From_FSSpec', and `FT_GetFile_From_Mac_ATS_Name' for `FT_GetFile_From_Mac_Name'. Legacy APIs are still available, if FreeType is built without disabling them. - A new API `FT_Select_Size' has been added to select a bitmap strike by its index. Code using other functions to select bitmap strikes should be updated to use this function. - A new API `FT_Get_SubGlyph_Info' has been added to retrieve subglyph data. This can be used by rogue clients which used to access the internal headers to get the corresponding data.