In order to access system fonts, you will need to write a bunch of Mac-Specific platform code (similar to what exists for Win, IIRC). The code used to exist in PoDoFo, but was removed.
Leonard On 2/18/16, 10:08 AM, "Peter Petrov" <pe...@pdf3d.com> wrote: >Yes, I've patched a little PoDoFo and podofotxt2pdf. Main idea is to use >directly Freetype library like that: > > FT_Library library = document.GetFontLibrary(); > FT_Face face = 0; > FT_Error error = FT_New_Face( library, fileName.GetString(), 0, >&face ); // where fileName is direct file path to .TTF font > > if(!error && face) > { >.... > >and podofotxt2pdf was able to produce PDF document with Annabelle inside. > >But the problem still exists: >I would like to load, use and embed fonts by their family names. >Use fonts which are installed in the system. >For instance, user of my program can specify 'Arial' or 'Al Nile' font >family name (not actual file name of font) and my program should work >correctly. >So, it is functional of "FontManager", enumerate fonts, get font >information from its family name, etc. > >Yes, I agree that libfreetype is installed on Mac OSX by default. >But libfontconfig is not installed. > > >On 18.02.2016 17:32, Peter Petrov wrote: >> On 18.02.2016 14:45, zyx wrote: >>> Hi, >>> it's freetype library, which is used for manipulation of fonts. My >>> Windows build doesn't have fontconfig, and it can embed "any" TTF font >>> provided by GDI. >>> >>> I think this is the case when it's better to try than to guess. Mac >>> builds can work differently, and I do not use Mac, thus it's up to you >>> to give it a try without the fontconfig. My personal understanding of >>> the fontconfig is that it's used for easier searching for fonts "on the >>> disk", but I can be wrong here. Thus, try your application with PoDoFo >>> being built without the fontconfig and you'll see whether it'll have >>> any issues or not. >>> >>> Bye, >>> zyx >>> >> I've built podofo 0.9.3 on Mac with PODOFO_NO_FONTMANAGER=ON CMake variable. >> It was built fine. >> >> I'm trying to run podofotxt2pdf example program with hello_text.txt >> (which just contains "Hello World" text): >> ./podofotxt2pdf ./hello_text.txt out.pdf >> >> and I see output that font Arial is not found: >> CRITICAL: No path was found for the specified fontname: Arial >> Error 2 occured! >> >> PoDoFo encounter an error. Error: 2 ePdfError_InvalidHandle >> Error Description: A NULL handle was passed, but initialized >> data was expected. >> Callstack: >> #0 Error Source: >> ...full_path.../podofo-0.9.3/tools/podofotxt2pdf/podofotxt2pdf.cpp:76 >> >> Also, I tried other font names which are installed onto my system (I'm >> sure, for instance, Annabelle, it could be viewed by Font Book application): >> ./podofotxt2pdf ./hello_text.txt out_ann.pdf -fontname Annabelle >> >> ... the same error. >> I can use only base14 fonts, like that: >> ./podofotxt2pdf ./hello_text.txt out_ann.pdf -fontname Courier >> works fine. >> >> Do you think that using font directly from .ttf file could solve this >> problem? >> (In this case I should modify podofotxt2pdf.cpp source file) >> > > >-- >Cheers, >Peter, VTSL Support Team > > >------------------------------------------------------------------------------ >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