Re: [ft] Freetype FT_Request_Size() crashes
I will check. Regards, mpsuzuki Werner LEMBERG wrote (2012/06/12 14:49): [Forwarding to the list since I don't use Windows. Anyone interested in looking into this?] Werner == From: Paul Dean aquawic...@hotmail.com Subject: RE: [ft] Freetype FT_Request_Size() crashes Date: Mon, 11 Jun 2012 17:40:24 -0500 I'm still tearing out my hair on this one. It seems SDL 2.0 is conflicting with freetype. I know a few sloppy fixes on windows. I can't for the life of me figure out how to get them to get along on Mac or android. My windows sloppy fixes do not fix MAC or Android. I've decided to create a minimal SDL 2.0 / Freetype 2.4.9 project for windows that will reproduce this crash. The debug version on windows will work but the release build will show the crash. The only thing the project requires is Cmake and Visual C++ 2008 or higher. No other dependencies needed. Just cmake and compile. http://aquawicket.com/FreetypeBug.zip ___ Freetype mailing list Freetype@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype ___ Freetype mailing list Freetype@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype
Re: [ft-devel] $BEz$(P%;(B: wrong glyph image of Calibri.ttf
thanks,another question,is there 64bit freetype2 lib officially release?I build a 64bit lib locally, but crash at running time in my application. AFAIK, FreeType builds just fine as 64bit. Can you debug the problem? Werner ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] PDF text rendering error
OK, please let us work with same testing program. I guess you're working for the proprietary software and you cannot disclose the source to me (and I think I don't have appropriate developer environment even if you can disclose the source). Thus, I will make a patch generating many trace messages, and a small CUI program just checking if the font is found to be tricky. Is it acceptable? Please check if you can build FT2 library with debug/trace functions, while I'm writing a patch for debugging. Regards, mpsuzuki Johnson Y. Yan wrote: Toshiya-san, I apply your patch, but still render error, : (. If the way i call the function is wrong? FT_Load_Glyph(FtFace, gid, FT_LOAD_NO_BITMAP). Johnson Y. Yan 发件人: suzuki toshiya 发送时间: 2012-06-11 16:38:11 收件人: Johnson Y. Yan 抄送: freetype-devel 主题: Re: [ft-devel] PDF text rendering error Attached is my proposal to fix this issue, please try. In my case (Debian GNU/Linux xpdf-3.02-11), using the patched freetype library by LD_PRELOAD, xpdf shows readable result (without patch, the result is unreadable). Regards, mpsuzuki suzuki toshiya wrote: Johnson Y. Yan wrote (2012/06/11 16:03): Werner and Toshiya-san, I put the font as a tricky font to deal with. static const char trick_names[TRICK_NAMES_COUNT] [TRICK_NAMES_MAX_CHARACTERS + 1] = { DFKaiSho-SB, /* dfkaisb.ttf */ DFKaiShu, DFKai-SB,/* kaiu.ttf */ HuaTianKaiTi?, /* htkt2.ttf */ HuaTianSongTi?, /* htst3.ttf */ MingLiU, /* mingliu.ttf mingliu.ttc */ PMingLiU,/* mingliu.ttc */ MingLi43,/* mingli.ttf */ BKLGIB+FA this is the embeded font in th document. }; it still render error. . Including the randomization prefix to the tricky font name list is bad idea. I opened the embeded font use font lab, found the gid = 2134 is like this, please see the attach bitmap, some of lines form a 0 area areas, then fill the area(have no area), Does freetype made special processing? Johnson Y. Yan 发件人: Werner LEMBERG 发送时间: 2012-06-11 12:55:42 收件人: yinsen_yan 抄送: freetype-devel; mpsuzuki 主题: Re: PDF text rendering error Do you mean the font must be rendered use TT_CONFIG_OPTION_BYTECODE_INTERPRETER? No, the FreeType *library* must be built with it: Edit ftoption.h to set this flag, then recompile. Additionally, hinting must be enabled for this font, this is, FT_LOAD_NO_SCALE doesn't work here. Normally, those steps are (more or less) handled automatically by FreeType, since we maintain a list of `tricky' font like the one you have encountered in the PDF; see file `ttobjs.c'. The subsetted font in question, however, which identifies itself as BKLGIB+FA-RoundGothicB FA 丸ゴシックB and FA-RoundGothicB are trademarks of NEC Office Systems,Ltd. isn't in this list; for the NEC FA fonts (and others), a second mechanism is used which doesn't work with subsetted fonts. Toshiya-san, any ideas? Werner ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] PDF text rendering error
Toshiya-san, thanks for your patience, I build freetype 2.4.9 with vc6,I merged your patch and make sure this is a tricky font. I can debug into: tt_check_trickyness( FT_Face face ) { if ( !face ) return FALSE; /* For first, check the face name for quick check. */ if ( face-family_name tt_check_trickyness_family( face-family_name ) ) return TRUE; /* Type42 fonts may lack `name' tables, we thus try to identify */ /* tricky fonts by checking the checksums of Type42-persistent */ /* sfnt tables (`cvt', `fpgm', and `prep'). */ if ( tt_check_trickyness_sfnt_ids( (TT_Face)face ) ) return TRUE; return FALSE; } and tt_check_trickyness_sfnt_ids return TRUE; but render result still error(I sent in 11/6/2012 ).I don't know what reason is. please see my test code, you can use the embeded font 1_BKLGIB+FA.ttf i sent yesterday to test: extern C int g_bRecordBI = 0; DWORD gid = 2134; void CTestDlg::OnTestFreetype() { UpdateData(); CModuleMgr mm; CString csFilter(_T(OpenType (*.ttf,*.ttc,*.otf)|*.ttf;*.ttc;*.otf| Type1 (*.pfa,*.pfb)|*.pfa;*.pfb| CFF (*.cff)|*.cff| All files (*.*)|*.*||)); CFileDialog fd(TRUE, NULL, NULL, OFN_FILEMUSTEXIST|OFN_LONGNAMES|OFN_PATHMUSTEXIST, csFilter, this); if (fd.DoModal() == IDOK){ FT_Library library; FT_Init_FreeType(library); CString csFile = fd.GetPathName(); IFileRead *pFileRead = CreateFileRead((LPCTSTR)csFile); DWORD dwFileSize = (DWORD)pFileRead-GetSize(); BYTE* pBuffer = Alloc(BYTE, dwFileSize); pFileRead-ReadBlock(pBuffer, 0, dwFileSize); pFileRead-Release(); FT_Face face; int error = FT_New_Memory_Face(library, pBuffer, dwFileSize, 0, face); ASSERT(error == 0); error = FT_Set_Pixel_Sizes(face, 0, 64); ASSERT(error == 0); FT_Matrix matrix; matrix.xx = (long)(32.f /64 * 65536);//22215;//32.f /64 * 65536; matrix.xy = 0; matrix.yx = 0; matrix.yy = (long)(32.f /64 * 65536);//23616;//32.f /64 * 65536; FT_Set_Transform(face, matrix, NULL); ASSERT(error == 0); int load_flags = FT_LOAD_NO_BITMAP ; DEBUG1(CTestDlg::OnTestFreetype -- Start Load Glyph --); g_bRecordBI = 1; // Change flag error = FT_Load_Glyph(face, gid, load_flags); g_bRecordBI = 0; DEBUG1(CTestDlg::OnTestFreetype -- End Load Glyph --); ASSERT(error == 0); int render_mode = FT_RENDER_MODE_NORMAL; error = FT_Render_Glyph(face, render_mode); ASSERT(error == 0); FT_GlyphSlot slot = face-glyph; int left = slot-bitmap_left; int top = slot-bitmap_top; int pixel_width = slot-bitmap.width; int pixel_height = slot-bitmap.rows; int stride = slot-bitmap.pitch; int type = slot-bitmap.pixel_mode; BYTE*buffer = slot-bitmap.buffer; CFX_DIBitmap bitmap; BOOL ret = bitmap.Create(pixel_width, pixel_height, FXDIB_8bppRgb); ASSERT(ret); int row, col; for (row = 0; row pixel_height; row ++) { BYTE* pDestBuf = (BYTE*)bitmap.GetScanline(row); BYTE* pSrcBuf= buffer+row*stride; for (col = 0; col pixel_width; col ++) { *pDestBuf++ = ~*pSrcBuf++; } } CDC *pDC = GetDC(); CFX_WindowsDevice wd(pDC-GetSafeHdc()); wd.SetDIBits(bitmap, 0, 0); ReleaseDC(pDC); FT_Done_Face(face); FT_Done_FreeType(library); if (pBuffer) Free(pBuffer); } } Johnson Y. Yan 发件人: suzuki toshiya 发送时间: 2012-06-12 18:33:24 收件人: Johnson Y. Yan 抄送: freetype-devel 主题: Re: [ft-devel] PDF text rendering error OK, please let us work with same testing program. I guess you're working for the proprietary software and you cannot disclose the source to me (and I think I don't have appropriate developer environment even if you can disclose the source). Thus, I will make a patch generating many trace messages, and a small CUI program just checking if the font is found to be tricky. Is it acceptable? Please check if you can build FT2 library with debug/trace functions, while I'm writing a patch for debugging. Regards, mpsuzuki Johnson Y. Yan wrote: Toshiya-san, I apply your patch, but still render error, : (. If the way i call the function is wrong? FT_Load_Glyph(FtFace, gid, FT_LOAD_NO_BITMAP). Johnson Y. Yan 发件人: suzuki toshiya 发送时间: 2012-06-11 16:38:11 收件人: Johnson Y. Yan 抄送: freetype-devel 主题: Re: [ft-devel] PDF text rendering error Attached is my proposal to fix this issue, please try. In my case (Debian GNU/Linux xpdf-3.02-11), using the patched freetype library by LD_PRELOAD, xpdf shows readable result (without patch, the result is unreadable). Regards, mpsuzuki suzuki toshiya wrote: Johnson Y. Yan wrote (2012/06/11 16:03): Werner and Toshiya-san, I put the font as a tricky font to deal with. static const char trick_names[TRICK_NAMES_COUNT] [TRICK_NAMES_MAX_CHARACTERS + 1] = { DFKaiSho-SB, /* dfkaisb.ttf */ DFKaiShu, DFKai-SB,/* kaiu.ttf */ HuaTianKaiTi?, /* htkt2.ttf */ HuaTianSongTi?, /* htst3.ttf */ MingLiU, /* mingliu.ttf mingliu.ttc */
[ft-devel] FW: PDF text rendering error
From: harend...@hotmail.com To: yinsen_...@foxitsoftware.com Subject: RE: [ft-devel] PDF text rendering error Date: Tue, 12 Jun 2012 16:19:32 + please see my test code, you can use the embeded font 1_BKLGIB+FA.ttf i sent yesterday to test: ** Not possible to test anything with the font you sent (Fontlab, fontforge, TTX). try to see other glyphs ! - Maybe see font source using fontlab (like you seem to use from your image), try to seefont validation (nodes to extrems, correct direction, remove overlaps) before all- The image you sent is exactly what it's obtained during font convertion PS to TTF without direction changeor bold mode from regular with bad directions. ** Is your font is: http://www.nec.co.jp/csr/en/report2009/cs/ud/ud01.html at Universal Design Fonts ? Regards Hirwen HARENDAL ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] PDF text rendering error
If you make the compiler include the header files by compiler flags written in project file, please post project file too. Uh, oh, a C or C++ snippet should always be compilable on the *command line*, even on Windows! This is the only way to get something portable, more or less. Werner ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] FW: PDF text rendering error
embeded font 1_BKLGIB+FA.ttf i sent yesterday to test: ** Not possible to test anything with the font you sent (Fontlab, ** fontforge, TTX). try to see other glyphs ! The font is OK. As I've mentioned before, it is *not* possible to edit this font with FontLab or FontForge! You need a special editor to handle those rare fonts which use bytecode to scale and shift subglyphs. - Maybe see font source using fontlab (like you seem to use from your image), try to seefont validation (nodes to extrems, correct direction, remove overlaps) before all This is completely useless with this font. ** http://www.nec.co.jp/csr/en/report2009/cs/ud/ud01.html at Universal ** Design Fonts ? Yes, the font looks similar. No idea whether this is still a `tricky' font, or whether the font designer has decided to `expand' the subglyphs. For example, I have an old version of Microsoft's `mingtiu.ttc' (version 3.21 from 2001, having a size of 8MByte) which is similar to the BKLGIB+FA.ttf font. A more recent one, version 7 from 2008 (delivered with Windows 7, having a size of 31MByte), is a `normal' TTC. Werner ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] FW: PDF text rendering error
Werner, please excuse my emphasis The font is OK. As I've mentioned before, it is *not* possible to edit this font with FontLab or FontForge! ** No smoke without fire... Sorry, but St Thomas was one of my students :-) You need a special editor to handle those rare fonts which use bytecode to scale and shift subglyphs. ** A special font editor in 1995-1998, have you got a name, I'm intersting? ** http://www.nec.co.jp/csr/en/report2009/cs/ud/ud01.html at Universal ** Design Fonts ? Yes, the font looks similar. No idea whether this is still a `tricky' font, or whether the font designer has decided to `expand' the subglyphs. ** It's still tricky to work with CJK fonts, in general, but that can't explain the result of the font file attached, except the fact that the interpreter is very confused by the glyphs datas. Is this due to the use of the bytecode to scale subglyphs only ?I'm not sure.On the other hand, I don't think you'd be surprised by the poor quality of some commercial fonts that I was asked to rework. Hirwen___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel