Hi The fix is probably unsafe, but still I have the following questions(just out of curiosity)
Before the call to GetFontFromCollection , two Microsoft functions , CreateFontIndirect() and GetFontData are called in order. Of these the first function will give ok only if it can find font with characteristics provided(font name, style etc), and then we have to pass GetFontData function also. So can't we be pretty much sure we have the font we wanted? ,Currently we go only by name in GetFontFromCollection(as you mentioned). If we also check for bold italic etc, wont this give problems in future? Because for some fonts italic or bold version may not be available, so we will get the regular font instead(I think this is the desired functionality). If we tag this as failure here wont it be a problem? Are there similar verification done for TTF fonts? Thanks and Regards -----Original Message----- From: dennis [mailto:dennis.v...@dots.de] Sent: Wednesday, February 10, 2016 1:22 PM To: podofo-users@lists.sourceforge.net Subject: Re: [Podofo-users] TTC Font Support As i said, a colleague of mine will provide a patch in (hoepfully) short time. Just setting if(true) is not going to solve the problem. You cant even be sure if you have the right font if you always copy the buffer... Second: the functionalty was build so that it could be refactored to reconize bold, italic etc. (it doesnt care about those attributes atm it only goes by name). But well, if your fix fixes your problem for the moment, just remember to update if podofo has a new version ;-) Am 09.02.2016 um 17:15 schrieb Jaseem Ali K T: > Hi Thanks all for your inputs > > I debugged the issue and the problem was found to be in the function > GetFontFromCollection. > For fonts like MS Gothic we are not getting inside the following condition > if(platformID == 0 && languageID == 0) > > It seems that in name table such fonts don't have an entry with platform > ID=0(Unicode platform). > I observed that mainly this part of code is used extract information like > fontfamily, fontstyle etc and later to verify if we have the correct font. > (I guess the same information can be obtained from platform ID 3 encoding ID > 1 or something else) > (are such verification done for ttf fonts?) > > So I removed the verification part , ie if(isMatchingFont) was set to > if(true), so the buffer will be created for all fonts . > > Now all ttc fonts are working fine. I hope proper fix will be released in the > next release > > Thanks and regards > Ali > > -----Original Message----- > From: dennis [mailto:dennis.v...@dots.de] > Sent: Monday, February 01, 2016 1:08 PM > To: podofo-users@lists.sourceforge.net > Subject: Re: [Podofo-users] TTC Font Support > > Hi, (guy who implemented ttc support here). > The problem is, the std::equal_range function call in pdf fontcache. (or > better the constructor of TFontCacheElement) > > Meiro for example has a japanese name, thus the pdfstring will be converted > into unicode (which is horribly buggy in podofo... with endless loops and > such). > > Look at the CreateFontObject function in PdfFontCache. In there a > TFontCacheElement is created. > In the GetFont there is an std::equal_range call which uses a constructor of > TFontCacheElement (here is the first buggy part). > > Just create the element beforehand like in CreateFontObject and then do the > equal range call with the element (you "skip" the constructor which is buggy > for unicode strings). > This should fix your problem. > > If it doesnt you need to wait like 2 weeks xD. I have a patch but its not > ready yet... > > Second buggy part (and that was my mistake...) is in GetFontFromCollection > function in pdfFontCache. This needs some more rework. > > Which is kinda too complicated to describe in an email (patch is in the > working dont worry ;D ) > > The problem is, that we first check the language id against the systemLCID or > we check against english. This tends to give problems on systems with > languagePacks installed which have a different "character" > set then their native installation. (e.g. english system -> Japanese language > pack, russian system -> german languagePack etc). > > Greetings, > Dennis > > > > Am 29.01.2016 um 15:34 schrieb zyx: >> On Fri, 2016-01-29 at 13:29 +0000, Jaseem Ali K T wrote: >>> Does PoDoFo support ttc fonts? >>> >> Hi, >> PoDoFo doesn't support fonts, it's the freetype library which operates >> with font files. If the freetype library can open a ttc font, then >> PoDoFo should not have any issue with it. >> >> I see that PdfFontFactory::GetFontType() recognizes "ttc" extension >> and returns an ePdfFontType_TrueType. The best if you can step with a >> debugger and see what exactly failed when you called the CreateFont() >> function. >> >> It can also depend on your version of PoDoFo, which you didn't mention. >> The latest stable version is 0.9.3. >> Bye, >> zyx >> > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + > Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor > end-to-end web transactions and take corrective actions now Troubleshoot > faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > Podofo-users mailing list > Podofo-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/podofo-users > > > ::DISCLAIMER:: > ---------------------------------------------------------------------------------------------------------------------------------------------------- > > The contents of this e-mail and any attachment(s) are confidential and > intended for the named recipient(s) only. > E-mail transmission is not guaranteed to be secure or error-free as > information could be intercepted, corrupted, > lost, destroyed, arrive late or incomplete, or may contain viruses in > transmission. The e mail and its contents > (with or without referred errors) shall therefore not attach any liability on > the originator or HCL or its affiliates. > Views or opinions, if any, presented in this email are solely those of the > author and may not necessarily reflect the > views or opinions of HCL or its affiliates. Any form of reproduction, > dissemination, copying, disclosure, modification, > distribution and / or publication of this message without the prior written > consent of authorized representative of > HCL is strictly prohibited. If you have received this email in error please > delete it and notify the sender immediately. > Before opening any email and/or attachments, please check them for viruses > and other defects. > > ---------------------------------------------------------------------------------------------------------------------------------------------------- > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > Podofo-users mailing list > Podofo-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/podofo-users ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users