From: Bob D. <bd...@si...> - 2006-01-12 00:20:46
|
Hey, Patch looks good so far! You probably want to update from CVS, I've been playing in RPDF a little. I made some gchar * GStrings for speed improvement. In general, RLIB is now 2x faster with some of the speedups I made over the past few days. One of the worst things it was doing was doing a getlocale on every format! That's quite expensive because it has to do a getenv. We probably don't want to check for ttf2pt1 on rpdf_new because that would be expensive. We probably only want to check for it once if we are actually going to embed fonts. We also might want to be able to cache the results of ttf2pt1 in some sorta binary form to load from in order to optionally speed up internal font loading. Maybe provide some sorta utility w/ RLIB to do it. In general you are headed in the right direction and it looks good. How far do you plan on taking this? Is your plan to only support fixed width fonts in RLIB or were you thinking about variable width fonts? Thanks! - Bob On Thu, 2006-01-12 at 00:56 +0100, Zoltan Boszormenyi wrote: > Hi, > > Bob Doan írta: > > >Hi Zoltan, > > > >I like GNOME-VFS as a solution. If we add support for gnome-vfs we > >could probably make use of it in other File IO places. > > > >It would have to be a compile time option and a fallback to flat files > >(as you say) > > > >- Bob > > > > just a heads up, that I am progressing. :-) > I have done the following: > - a little configure.in and Makefile.am magic to detect and use GNOME-VFS, > it can be disabled manually > - reordered rpdf_set_font() a little, so it finds already used fonts first, > It will implicitely use rpdf_add_font() if it doesn't find the given > font name and encoding among the builtins. > - rpdf_object_append() returns the current object#, > it is needed for embedding fonts, as objects cross-referenced by each > other > - struct _rpdf_fonts gained two new members, stream and stream_length > - GNOME-VFS is used for reading in the file and detecting the MIME type, > so I can distinguish between TrueType and Type1 fonts, when only a > font name > is given, or normal file operations are used and the .ttf and .pfb > suffixes > are checked for if full path is given for the file. > > And it doesn't crash. :-) > > The font binaries already appear in the PDF, but XPDF complains > about them and doesn't use them. But it doesn't crash, so the structures > are correct but details are missing. :-) > > You will need to have ttf2pt1 on the system, it will be used to > extract the font metrics from the font file, e.g. rpdf_text_width() will > need it. > I think I will detect its presence in rpdf_new(), if not found, font > embedding will be > runtime disabled. > > Would you like to see the patch in this incomplete/non-working state? > > Best regards, > Zoltán Böszörményi -- Bob Doan <bd...@si...> |