summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS2
-rw-r--r--COPYING340
-rw-r--r--ChangeLog10
-rw-r--r--INSTALL182
-rw-r--r--Makefile.am1
-rw-r--r--Makefile.in361
-rw-r--r--NEWS0
-rw-r--r--README0
-rw-r--r--TODO46
-rw-r--r--aclocal.m4127
-rw-r--r--config.h.in116
-rwxr-xr-xconfigure3369
-rw-r--r--configure.in62
-rwxr-xr-xinstall-sh251
-rw-r--r--lib/Makefile.am3
-rw-r--r--lib/Makefile.in181
-rw-r--r--lib/example/box.c305
-rw-r--r--lib/example/jpegtest.c124
-rw-r--r--lib/example/shape1.c86
-rw-r--r--lib/example/texbox.c367
-rw-r--r--lib/example/texbox_ac.c374
-rw-r--r--lib/example/transtest.c350
-rw-r--r--lib/log.c252
-rw-r--r--lib/log.h39
-rw-r--r--lib/modules/swfbits.c152
-rw-r--r--lib/modules/swfbutton.c92
-rw-r--r--lib/modules/swfcgi.c179
-rw-r--r--lib/modules/swfdump.c131
-rw-r--r--lib/modules/swfobject.c59
-rw-r--r--lib/modules/swfshape.c523
-rw-r--r--lib/modules/swftext.c503
-rw-r--r--lib/modules/swftools.c260
-rw-r--r--lib/rfxswf.c809
-rw-r--r--lib/rfxswf.h439
-rwxr-xr-xmissing190
-rwxr-xr-xmkinstalldirs40
-rw-r--r--pdf2swf/Makefile.am10
-rw-r--r--pdf2swf/Makefile.in467
-rw-r--r--pdf2swf/SWFOutputDev.cc1104
-rw-r--r--pdf2swf/SWFOutputDev.h17
-rw-r--r--pdf2swf/args.h63
-rw-r--r--pdf2swf/fonts/FontDataBase16
-rw-r--r--pdf2swf/fonts/Makefile.am31
-rw-r--r--pdf2swf/fonts/Makefile.in202
-rw-r--r--pdf2swf/fonts/d050000l.afm226
-rw-r--r--pdf2swf/fonts/d050000l.pfbbin0 -> 45955 bytes
-rw-r--r--pdf2swf/fonts/n019003l.afm1341
-rw-r--r--pdf2swf/fonts/n019003l.pfbbin0 -> 36026 bytes
-rw-r--r--pdf2swf/fonts/n019004l.afm1341
-rw-r--r--pdf2swf/fonts/n019004l.pfbbin0 -> 35941 bytes
-rw-r--r--pdf2swf/fonts/n019023l.afm1341
-rw-r--r--pdf2swf/fonts/n019023l.pfbbin0 -> 38314 bytes
-rw-r--r--pdf2swf/fonts/n019024l.afm1341
-rw-r--r--pdf2swf/fonts/n019024l.pfbbin0 -> 39013 bytes
-rw-r--r--pdf2swf/fonts/n021003l.afm1341
-rw-r--r--pdf2swf/fonts/n021003l.pfbbin0 -> 46026 bytes
-rw-r--r--pdf2swf/fonts/n021004l.afm1341
-rw-r--r--pdf2swf/fonts/n021004l.pfbbin0 -> 44729 bytes
-rw-r--r--pdf2swf/fonts/n021023l.afm1341
-rw-r--r--pdf2swf/fonts/n021023l.pfbbin0 -> 45458 bytes
-rw-r--r--pdf2swf/fonts/n021024l.afm1341
-rw-r--r--pdf2swf/fonts/n021024l.pfbbin0 -> 44656 bytes
-rw-r--r--pdf2swf/fonts/n022003l.afm1341
-rw-r--r--pdf2swf/fonts/n022003l.pfbbin0 -> 45758 bytes
-rw-r--r--pdf2swf/fonts/n022004l.afm1341
-rw-r--r--pdf2swf/fonts/n022004l.pfbbin0 -> 50493 bytes
-rw-r--r--pdf2swf/fonts/n022023l.afm1341
-rw-r--r--pdf2swf/fonts/n022023l.pfbbin0 -> 44404 bytes
-rw-r--r--pdf2swf/fonts/n022024l.afm1341
-rw-r--r--pdf2swf/fonts/n022024l.pfbbin0 -> 51527 bytes
-rw-r--r--pdf2swf/fonts/s050000l.afm213
-rw-r--r--pdf2swf/fonts/s050000l.pfbbin0 -> 33709 bytes
-rw-r--r--pdf2swf/pdf2swf.137
-rw-r--r--pdf2swf/pdf2swf.cc249
-rw-r--r--pdf2swf/spline.cc140
-rw-r--r--pdf2swf/spline.h36
-rw-r--r--pdf2swf/swfoutput.cc594
-rw-r--r--pdf2swf/swfoutput.h68
-rw-r--r--pdf2swf/swfoutput_x11.cc249
-rw-r--r--pdf2swf/xpdf/Array.cc51
-rw-r--r--pdf2swf/xpdf/Array.h53
-rw-r--r--pdf2swf/xpdf/Catalog.cc301
-rw-r--r--pdf2swf/xpdf/Catalog.h73
-rw-r--r--pdf2swf/xpdf/CompactFontInfo.h464
-rw-r--r--pdf2swf/xpdf/Decrypt.cc304
-rw-r--r--pdf2swf/xpdf/Decrypt.h49
-rw-r--r--pdf2swf/xpdf/Dict.cc88
-rw-r--r--pdf2swf/xpdf/Dict.h69
-rw-r--r--pdf2swf/xpdf/Error.cc50
-rw-r--r--pdf2swf/xpdf/Error.h26
-rw-r--r--pdf2swf/xpdf/FontEncoding.cc143
-rw-r--r--pdf2swf/xpdf/FontEncoding.h64
-rw-r--r--pdf2swf/xpdf/FontFile.cc1633
-rw-r--r--pdf2swf/xpdf/FontFile.h117
-rw-r--r--pdf2swf/xpdf/FontInfo.h2068
-rw-r--r--pdf2swf/xpdf/FormWidget.cc129
-rw-r--r--pdf2swf/xpdf/FormWidget.h65
-rw-r--r--pdf2swf/xpdf/GString.cc223
-rw-r--r--pdf2swf/xpdf/GString.h95
-rw-r--r--pdf2swf/xpdf/Gfx.cc2107
-rw-r--r--pdf2swf/xpdf/Gfx.h234
-rw-r--r--pdf2swf/xpdf/GfxFont.cc1018
-rw-r--r--pdf2swf/xpdf/GfxFont.h240
-rw-r--r--pdf2swf/xpdf/GfxState.cc2271
-rw-r--r--pdf2swf/xpdf/GfxState.h937
-rw-r--r--pdf2swf/xpdf/Lexer.cc468
-rw-r--r--pdf2swf/xpdf/Lexer.h72
-rw-r--r--pdf2swf/xpdf/Link.cc630
-rw-r--r--pdf2swf/xpdf/Link.h336
-rw-r--r--pdf2swf/xpdf/Makefile.am11
-rw-r--r--pdf2swf/xpdf/Makefile.in330
-rw-r--r--pdf2swf/xpdf/Object.cc220
-rw-r--r--pdf2swf/xpdf/Object.h300
-rw-r--r--pdf2swf/xpdf/OutputDev.cc93
-rw-r--r--pdf2swf/xpdf/OutputDev.h140
-rw-r--r--pdf2swf/xpdf/PDFDoc.cc251
-rw-r--r--pdf2swf/xpdf/PDFDoc.h125
-rw-r--r--pdf2swf/xpdf/Page.cc245
-rw-r--r--pdf2swf/xpdf/Page.h114
-rw-r--r--pdf2swf/xpdf/Params.cc87
-rw-r--r--pdf2swf/xpdf/Params.h37
-rw-r--r--pdf2swf/xpdf/Parser.cc209
-rw-r--r--pdf2swf/xpdf/Parser.h56
-rw-r--r--pdf2swf/xpdf/StdFontInfo.h546
-rw-r--r--pdf2swf/xpdf/Stream-CCITT.h459
-rw-r--r--pdf2swf/xpdf/Stream.cc3449
-rw-r--r--pdf2swf/xpdf/Stream.h723
-rw-r--r--pdf2swf/xpdf/XRef.cc592
-rw-r--r--pdf2swf/xpdf/XRef.h112
-rw-r--r--pdf2swf/xpdf/config.h115
-rw-r--r--pdf2swf/xpdf/gfile.cc643
-rw-r--r--pdf2swf/xpdf/gfile.h132
-rw-r--r--pdf2swf/xpdf/gmem.c203
-rw-r--r--pdf2swf/xpdf/gmem.h54
-rw-r--r--pdf2swf/xpdf/gtypes.h29
-rw-r--r--release.in167
-rw-r--r--src/Makefile.am13
-rw-r--r--src/Makefile.in383
-rw-r--r--src/args.h63
-rw-r--r--src/bitio.c187
-rw-r--r--src/bitio.h51
-rw-r--r--src/combine.c398
-rw-r--r--src/combine.h14
-rw-r--r--src/flash.c528
-rw-r--r--src/flash.h196
-rw-r--r--src/reloc.c285
-rw-r--r--src/reloc.h14
-rw-r--r--src/settings.h26
-rw-r--r--src/swfcombine.183
-rw-r--r--src/swfcombine.c431
-rw-r--r--src/swfdump.123
-rw-r--r--src/swfdump.c109
-rw-r--r--src/swfstrings.124
-rw-r--r--src/swfstrings.c54
-rw-r--r--src/types.h33
-rw-r--r--stamp-h.in1
156 files changed, 56875 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 00000000..5e531905
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,2 @@
+Matthias Kramm <kramm@quiss.org>
+Rainer Böhme <rainer@reflex-studio.de>
diff --git a/COPYING b/COPYING
new file mode 100644
index 00000000..d60c31a9
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 00000000..6a80a3b5
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,10 @@
+0.0.1: initial release
+0.0.2:
+ * pdf2swf: Added support for pdf bitmaps, clipping, state saving/restoring, colors,
+ solid fill and line width.
+ * swfcombine: Added stacking option (-t)
+ * swfcombine: Small bugfixes with the command line options
+ * rfxswf-lib: some bugfixes concerning sprites and cgi
+ * swfstrings: New: Allows extraction of text from swf files
+ * swfdump: New: Dumps swf file information. (Only the bare essentials, though)
+
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 00000000..b42a17ac
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,182 @@
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 00000000..53d88405
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = lib src pdf2swf pdf2swf
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 00000000..e0de14be
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,361 @@
+# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AWK = @AWK@
+CC = @CC@
+CPP = @CPP@
+CXX = @CXX@
+EXEEXT = @EXEEXT@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+SUBDIRS = lib src pdf2swf pdf2swf
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = release
+DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
+Makefile.am Makefile.in NEWS TODO aclocal.m4 config.h.in configure \
+configure.in install-sh missing mkinstalldirs release.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): configure.in
+ cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+config.h: stamp-h
+ @if test ! -f $@; then \
+ rm -f stamp-h; \
+ $(MAKE) stamp-h; \
+ else :; fi
+stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES= CONFIG_HEADERS=config.h \
+ $(SHELL) ./config.status
+ @echo timestamp > stamp-h 2> /dev/null
+$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
+ @if test ! -f $@; then \
+ rm -f $(srcdir)/stamp-h.in; \
+ $(MAKE) $(srcdir)/stamp-h.in; \
+ else :; fi
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+ -rm -f config.h
+
+maintainer-clean-hdr:
+release: $(top_builddir)/config.status release.in
+ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ test "$$subdir" = "." && dot_seen=yes; \
+ done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) dist
+ -rm -rf $(distdir)
+ @banner="$(distdir).tar.gz is ready for distribution"; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+ for subdir in $(SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+ done
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+all-recursive-am: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+install-exec-am:
+install-exec: install-exec-recursive
+
+install-data-am:
+install-data: install-data-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am:
+uninstall: uninstall-recursive
+all-am: Makefile config.h
+all-redirect: all-recursive-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
+
+distclean: distclean-recursive
+ -rm -f config.status
+
+maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
+ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f config.status
+
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+install-data-recursive uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/README
diff --git a/TODO b/TODO
new file mode 100644
index 00000000..6468d2d9
--- /dev/null
+++ b/TODO
@@ -0,0 +1,46 @@
+Priorities:
+1. Make the swfs that pdf2swf generates smaller
+2. Make pdf2swf faster
+3. General improvements
+4. Make pdf2swf cope with more complex pdfs
+5. Do some sample swfs for swfcombine
+6. Cleanups in rfxswf-lib.
+
+Make the swfs pdf2swf generates smaller:
+
+ * At the moment, the output of pdf2swf is a bunch of
+ polygons. Try using seperate shapes for each character,
+ and packing all shapes of a page in a font.
+
+Make pdf2swf cope with more complex pdfs:
+
+ The following pdf properties are not yet dealt with:
+ * Links
+ * dashed lines
+ * (type 3 and truetype fonts)
+
+Make pdf2swf faster:
+
+ * Embedded fonts which are used more than once are also converted more
+ than once. Implement a font cache, like the one in xpdf. (font->getID().num
+ seems to be unique for every font)
+
+Do some sample swfs for swfcombine:
+
+ * Some swf for displaying other swfs frame by frame (e.g. with next/previous
+ buttons) would be very handy for swfs generated by pdf2swf
+
+General Improvements:
+
+ * temporary file name generation is broken: pdf2swf/pdf2swf.cc, pdf2swf/xpdf/gfile.cc
+ * fix memory leaks
+ * rfxswf: modules/swfshape doesn't allow changing to fillstyle 0
+ * big jpegs sometimes have wrong colors
+ * write manpages for swfstrings and swfdump
+ * --version should work in all tools.
+
+Cleanups in rfxswf-lib:
+
+ * LPTAGs etc. should be TAG*s
+ * function names should have a prefix (rfxswf_ or swflib_ or sth.)
+ * GetMatrix should be named GetMATRIX, as it gets a MATRIX datatype. Same for CXFORM etc.
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 00000000..af170a3a
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,127 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4-p4
+
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN(AM_SANITY_CHECK,
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "[$]*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "[$]*" != "X $srcdir/configure conftestfile" \
+ && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "[$]2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN(AM_MISSING_PROG,
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT(found)
+else
+ $1="$3/missing $2"
+ AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN(AM_CONFIG_HEADER,
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated. We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+ case " <<$>>CONFIG_HEADERS " in
+ *" <<$>>am_file "*<<)>>
+ echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+ ;;
+ esac
+ am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
+
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 00000000..b7a1e4d2
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,116 @@
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Define if you don't have vprintf but do have _doprnt. */
+#undef HAVE_DOPRNT
+
+/* Define if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define if you have the vprintf function. */
+#undef HAVE_VPRINTF
+
+/* Define as __inline if that's what the C compiler calls it. */
+#undef inline
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef off_t
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+#undef size_t
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if your <sys/time.h> declares struct tm. */
+#undef TM_IN_SYS_TIME
+
+/* Define if you have the getcwd function. */
+#undef HAVE_GETCWD
+
+/* Define if you have the getpagesize function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define if you have the putenv function. */
+#undef HAVE_PUTENV
+
+/* Define if you have the socket function. */
+#undef HAVE_SOCKET
+
+/* Define if you have the strcspn function. */
+#undef HAVE_STRCSPN
+
+/* Define if you have the strdup function. */
+#undef HAVE_STRDUP
+
+/* Define if you have the strerror function. */
+#undef HAVE_STRERROR
+
+/* Define if you have the strstr function. */
+#undef HAVE_STRSTR
+
+/* Define if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the <jpeglib.h> header file. */
+#undef HAVE_JPEGLIB_H
+
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if you have the <math.h> header file. */
+#undef HAVE_MATH_H
+
+/* Define if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have the <ndir.h> header file. */
+#undef HAVE_NDIR_H
+
+/* Define if you have the <sys/dir.h> header file. */
+#undef HAVE_SYS_DIR_H
+
+/* Define if you have the <sys/ndir.h> header file. */
+#undef HAVE_SYS_NDIR_H
+
+/* Define if you have the <t1lib.h> header file. */
+#undef HAVE_T1LIB_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the <zlib.h> header file. */
+#undef HAVE_ZLIB_H
+
+/* Define if you have the X11 library (-lX11). */
+#undef HAVE_LIBX11
+
+/* Define if you have the jpeg library (-ljpeg). */
+#undef HAVE_LIBJPEG
+
+/* Define if you have the m library (-lm). */
+#undef HAVE_LIBM
+
+/* Define if you have the pthread library (-lpthread). */
+#undef HAVE_LIBPTHREAD
+
+/* Define if you have the t1 library (-lt1). */
+#undef HAVE_LIBT1
+
+/* Define if you have the z library (-lz). */
+#undef HAVE_LIBZ
+
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION
+
diff --git a/configure b/configure
new file mode 100755
index 00000000..aed6b06d
--- /dev/null
+++ b/configure
@@ -0,0 +1,3369 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+ --with-x use the X Window System"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=pdf2swf/swfoutput.h
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:558: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:611: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "$*" != "X $srcdir/configure conftestfile" \
+ && test "$*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+ fi
+
+ test "$2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+ program_transform_name=
+else
+ # Double any \ or $. echo might interpret backslashes.
+ cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+ program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+ rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:668: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+PACKAGE=swftools
+
+VERSION=pre0.0.2
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:714: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+ ACLOCAL=aclocal
+ echo "$ac_t""found" 1>&6
+else
+ ACLOCAL="$missing_dir/missing aclocal"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:727: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+ AUTOCONF=autoconf
+ echo "$ac_t""found" 1>&6
+else
+ AUTOCONF="$missing_dir/missing autoconf"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:740: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake
+ echo "$ac_t""found" 1>&6
+else
+ AUTOMAKE="$missing_dir/missing automake"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:753: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+ AUTOHEADER=autoheader
+ echo "$ac_t""found" 1>&6
+else
+ AUTOHEADER="$missing_dir/missing autoheader"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:766: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+ MAKEINFO=makeinfo
+ echo "$ac_t""found" 1>&6
+else
+ MAKEINFO="$missing_dir/missing makeinfo"
+ echo "$ac_t""missing" 1>&6
+fi
+
+
+if test "$program_transform_name" = s,x,x,; then
+ program_transform_name=
+else
+ # Double any \ or $. echo might interpret backslashes.
+ cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+ program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+ rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+
+ echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:800: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 805 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_cygwin=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+ echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:833: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 838 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:864: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
+else
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+
+export CFLAGS
+CFLAGS="-O2 -fomit-frame-pointer"
+export CXXFLAGS
+CXXFLAGS="-O2 -fomit-frame-pointer"
+ for ac_prog in mawk gawk nawk awk
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:904: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_AWK="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+AWK="$ac_cv_prog_AWK"
+if test -n "$AWK"; then
+ echo "$ac_t""$AWK" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$AWK" && break
+done
+
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:936: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:966: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_prog_rejected=no
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1017: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1049: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 1060 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:1065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1091: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:1096: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1124: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+
+ echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1156: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 1171 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 1188 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 1205 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+ for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1240: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CXX="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CXX="$ac_cv_prog_CXX"
+if test -n "$CXX"; then
+ echo "$ac_t""$CXX" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CXX" && break
+done
+test -n "$CXX" || CXX="gcc"
+
+
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1272: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+
+ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 1283 "configure"
+#include "confdefs.h"
+
+int main(){return(0);}
+EOF
+if { (eval echo configure:1288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cxx_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cxx_cross=no
+ else
+ ac_cv_prog_cxx_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cxx_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
+if test $ac_cv_prog_cxx_works = no; then
+ { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1314: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
+cross_compiling=$ac_cv_prog_cxx_cross
+
+echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
+echo "configure:1319: checking whether we are using GNU C++" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.C <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1328: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gxx=yes
+else
+ ac_cv_prog_gxx=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gxx" 1>&6
+
+if test $ac_cv_prog_gxx = yes; then
+ GXX=yes
+else
+ GXX=
+fi
+
+ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ac_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS=
+echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
+echo "configure:1347: checking whether ${CXX-g++} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.cc
+if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
+ ac_cv_prog_cxx_g=yes
+else
+ ac_cv_prog_cxx_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS="$ac_save_CXXFLAGS"
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1381: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:1409: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+ # Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:1447: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+ echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1500: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+ echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
+echo "configure:1522: checking for sin in -lm" >&5
+ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1530 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char sin();
+
+int main() {
+sin()
+; return 0; }
+EOF
+if { (eval echo configure:1541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lm $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+echo "Error: Math library not found.";exit
+fi
+
+ echo $ac_n "checking for jpeg_write_raw_data in -ljpeg""... $ac_c" 1>&6
+echo "configure:1570: checking for jpeg_write_raw_data in -ljpeg" >&5
+ac_lib_var=`echo jpeg'_'jpeg_write_raw_data | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ljpeg $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1578 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char jpeg_write_raw_data();
+
+int main() {
+jpeg_write_raw_data()
+; return 0; }
+EOF
+if { (eval echo configure:1589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo jpeg | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-ljpeg $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+echo "Error: The jpeg library jpeglib is required.";exit
+fi
+
+ echo $ac_n "checking for crc32 in -lz""... $ac_c" 1>&6
+echo "configure:1618: checking for crc32 in -lz" >&5
+ac_lib_var=`echo z'_'crc32 | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lz $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1626 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char crc32();
+
+int main() {
+crc32()
+; return 0; }
+EOF
+if { (eval echo configure:1637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo z | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lz $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+echo "Error: The zlib compressiong handling library is required.";exit
+fi
+
+ echo $ac_n "checking for T1_LoadFont in -lt1""... $ac_c" 1>&6
+echo "configure:1666: checking for T1_LoadFont in -lt1" >&5
+ac_lib_var=`echo t1'_'T1_LoadFont | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lt1 $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1674 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char T1_LoadFont();
+
+int main() {
+T1_LoadFont()
+; return 0; }
+EOF
+if { (eval echo configure:1685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo t1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lt1 $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+echo "Error: the T1lib truetype handling library is required.";exit
+fi
+
+ echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
+echo "configure:1714: checking for pthread_create in -lpthread" >&5
+ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lpthread $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1722 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_create();
+
+int main() {
+pthread_create()
+; return 0; }
+EOF
+if { (eval echo configure:1733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lpthread $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking for XFlush in -lX11""... $ac_c" 1>&6
+echo "configure:1761: checking for XFlush in -lX11" >&5
+ac_lib_var=`echo X11'_'XFlush | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lX11 $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1769 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char XFlush();
+
+int main() {
+XFlush()
+; return 0; }
+EOF
+if { (eval echo configure:1780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo X11 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lX11 $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+
+
+
+ # If we find X, set shell vars x_includes and x_libraries to the
+# paths, otherwise set no_x=yes.
+# Uses ac_ vars as temps to allow command line to override cache and checks.
+# --without-x overrides everything else, but does not touch the cache.
+echo $ac_n "checking for X""... $ac_c" 1>&6
+echo "configure:1816: checking for X" >&5
+
+# Check whether --with-x or --without-x was given.
+if test "${with_x+set}" = set; then
+ withval="$with_x"
+ :
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+ # The user explicitly disabled X.
+ have_x=disabled
+else
+ if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+ # Both variables are already set.
+ have_x=yes
+ else
+if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=NO ac_x_libraries=NO
+rm -fr conftestdir
+if mkdir conftestdir; then
+ cd conftestdir
+ # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+ cat > Imakefile <<'EOF'
+acfindx:
+ @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+EOF
+ if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+ # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+ eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+ # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+ for ac_extension in a so sl; do
+ if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+ test -f $ac_im_libdir/libX11.$ac_extension; then
+ ac_im_usrlibdir=$ac_im_libdir; break
+ fi
+ done
+ # Screen out bogus values from the imake configuration. They are
+ # bogus both because they are the default anyway, and because
+ # using them would break gcc on systems where it needs fixed includes.
+ case "$ac_im_incroot" in
+ /usr/include) ;;
+ *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
+ esac
+ case "$ac_im_usrlibdir" in
+ /usr/lib | /lib) ;;
+ *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
+ esac
+ fi
+ cd ..
+ rm -fr conftestdir
+fi
+
+if test "$ac_x_includes" = NO; then
+ # Guess where to find include files, by looking for this one X11 .h file.
+ test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+
+ # First, try using that file with no special directory specified.
+cat > conftest.$ac_ext <<EOF
+#line 1878 "configure"
+#include "confdefs.h"
+#include <$x_direct_test_include>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ # Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ for ac_dir in \
+ /usr/X11/include \
+ /usr/X11R6/include \
+ /usr/X11R5/include \
+ /usr/X11R4/include \
+ \
+ /usr/include/X11 \
+ /usr/include/X11R6 \
+ /usr/include/X11R5 \
+ /usr/include/X11R4 \
+ \
+ /usr/local/X11/include \
+ /usr/local/X11R6/include \
+ /usr/local/X11R5/include \
+ /usr/local/X11R4/include \
+ \
+ /usr/local/include/X11 \
+ /usr/local/include/X11R6 \
+ /usr/local/include/X11R5 \
+ /usr/local/include/X11R4 \
+ \
+ /usr/X386/include \
+ /usr/x386/include \
+ /usr/XFree86/include/X11 \
+ \
+ /usr/include \
+ /usr/local/include \
+ /usr/unsupported/include \
+ /usr/athena/include \
+ /usr/local/x11r5/include \
+ /usr/lpp/Xamples/include \
+ \
+ /usr/openwin/include \
+ /usr/openwin/share/include \
+ ; \
+ do
+ if test -r "$ac_dir/$x_direct_test_include"; then
+ ac_x_includes=$ac_dir
+ break
+ fi
+ done
+fi
+rm -f conftest*
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+ # Check for the libraries.
+
+ test -z "$x_direct_test_library" && x_direct_test_library=Xt
+ test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+ # See if we find them without any special options.
+ # Don't add to $LIBS permanently.
+ ac_save_LIBS="$LIBS"
+ LIBS="-l$x_direct_test_library $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1952 "configure"
+#include "confdefs.h"
+
+int main() {
+${x_direct_test_function}()
+; return 0; }
+EOF
+if { (eval echo configure:1959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
+ /usr/X11/lib \
+ /usr/X11R6/lib \
+ /usr/X11R5/lib \
+ /usr/X11R4/lib \
+ \
+ /usr/lib/X11 \
+ /usr/lib/X11R6 \
+ /usr/lib/X11R5 \
+ /usr/lib/X11R4 \
+ \
+ /usr/local/X11/lib \
+ /usr/local/X11R6/lib \
+ /usr/local/X11R5/lib \
+ /usr/local/X11R4/lib \
+ \
+ /usr/local/lib/X11 \
+ /usr/local/lib/X11R6 \
+ /usr/local/lib/X11R5 \
+ /usr/local/lib/X11R4 \
+ \
+ /usr/X386/lib \
+ /usr/x386/lib \
+ /usr/XFree86/lib/X11 \
+ \
+ /usr/lib \
+ /usr/local/lib \
+ /usr/unsupported/lib \
+ /usr/athena/lib \
+ /usr/local/x11r5/lib \
+ /usr/lpp/Xamples/lib \
+ /lib/usr/lib/X11 \
+ \
+ /usr/openwin/lib \
+ /usr/openwin/share/lib \
+ ; \
+do
+ for ac_extension in a so sl; do
+ if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+ ac_x_libraries=$ac_dir
+ break 2
+ fi
+ done
+done
+fi
+rm -f conftest*
+fi # $ac_x_libraries = NO
+
+if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
+ # Didn't find X anywhere. Cache the known absence of X.
+ ac_cv_have_x="have_x=no"
+else
+ # Record where we found X for the cache.
+ ac_cv_have_x="have_x=yes \
+ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+fi
+fi
+ fi
+ eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+ echo "$ac_t""$have_x" 1>&6
+ no_x=yes
+else
+ # If each of the values was on the command line, it overrides each guess.
+ test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+ test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+ # Update the cache value to reflect the command line values.
+ ac_cv_have_x="have_x=yes \
+ ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+ echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
+fi
+
+ ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
+echo "configure:2050: checking for $ac_hdr that defines DIR" >&5
+if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2055 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_hdr>
+int main() {
+DIR *dirp = 0;
+; return 0; }
+EOF
+if { (eval echo configure:2063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ ac_header_dirent=$ac_hdr; break
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
+echo "configure:2088: checking for opendir in -ldir" >&5
+ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldir $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2096 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:2107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -ldir"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
+echo "configure:2129: checking for opendir in -lx" >&5
+ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lx $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2137 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:2148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -lx"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+ echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:2171: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2176 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2184: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ ac_cv_header_stdc=yes
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 2201 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 2219 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+ :
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2240 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:2251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+ for ac_hdr in math.h fcntl.h limits.h malloc.h unistd.h memory.h zlib.h jpeglib.h t1lib.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2278: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2283 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+
+
+
+ echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:2319: checking for working const" >&5
+if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2324 "configure"
+#include "confdefs.h"
+
+int main() {
+
+/* Ultrix mips cc rejects this. */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this. */
+char const *const *ccp;
+char **p;
+/* NEC SVR4.0.2 mips cc rejects this. */
+struct point {int x, y;};
+static struct point const zero = {0,0};
+/* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in an arm
+ of an if-expression whose if-part is not a constant expression */
+const char *g = "string";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+}
+{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+}
+{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+}
+{ /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+}
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:2373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_const=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_c_const=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+ cat >> confdefs.h <<\EOF
+#define const
+EOF
+
+fi
+
+ echo $ac_n "checking for inline""... $ac_c" 1>&6
+echo "configure:2394: checking for inline" >&5
+if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat > conftest.$ac_ext <<EOF
+#line 2401 "configure"
+#include "confdefs.h"
+
+int main() {
+} $ac_kw foo() {
+; return 0; }
+EOF
+if { (eval echo configure:2408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$ac_cv_c_inline" 1>&6
+case "$ac_cv_c_inline" in
+ inline | yes) ;;
+ no) cat >> confdefs.h <<\EOF
+#define inline
+EOF
+ ;;
+ *) cat >> confdefs.h <<EOF
+#define inline $ac_cv_c_inline
+EOF
+ ;;
+esac
+
+ echo $ac_n "checking for off_t""... $ac_c" 1>&6
+echo "configure:2434: checking for off_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2439 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_off_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_off_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_off_t" 1>&6
+if test $ac_cv_type_off_t = no; then
+ cat >> confdefs.h <<\EOF
+#define off_t long
+EOF
+
+fi
+
+ echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:2467: checking for size_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2472 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_size_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_size_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_size_t" 1>&6
+if test $ac_cv_type_size_t = no; then
+ cat >> confdefs.h <<\EOF
+#define size_t unsigned
+EOF
+
+fi
+
+ echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
+echo "configure:2500: checking whether struct tm is in sys/time.h or time.h" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2505 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <time.h>
+int main() {
+struct tm *tp; tp->tm_sec;
+; return 0; }
+EOF
+if { (eval echo configure:2513: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_struct_tm=time.h
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_struct_tm=sys/time.h
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_struct_tm" 1>&6
+if test $ac_cv_struct_tm = sys/time.h; then
+ cat >> confdefs.h <<\EOF
+#define TM_IN_SYS_TIME 1
+EOF
+
+fi
+
+
+ echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
+echo "configure:2535: checking for 8-bit clean memcmp" >&5
+if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_memcmp_clean=no
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2543 "configure"
+#include "confdefs.h"
+
+main()
+{
+ char c0 = 0x40, c1 = 0x80, c2 = 0x81;
+ exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
+}
+
+EOF
+if { (eval echo configure:2553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_func_memcmp_clean=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_func_memcmp_clean=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
+test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
+
+ for ac_hdr in unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2574: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2579 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in getpagesize
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2613: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2618 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+echo $ac_n "checking for working mmap""... $ac_c" 1>&6
+echo "configure:2666: checking for working mmap" >&5
+if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_mmap_fixed_mapped=no
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2674 "configure"
+#include "confdefs.h"
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+ Here is a matrix of mmap possibilities:
+ mmap private not fixed
+ mmap private fixed at somewhere currently unmapped
+ mmap private fixed at somewhere already mapped
+ mmap shared not fixed
+ mmap shared fixed at somewhere currently unmapped
+ mmap shared fixed at somewhere already mapped
+ For private mappings, we should verify that changes cannot be read()
+ back from the file, nor mmap's back from the file at a different
+ address. (There have been systems where private was not correctly
+ implemented like the infamous i386 svr4.0, and systems where the
+ VM page cache was not coherent with the filesystem buffer cache
+ like early versions of FreeBSD and possibly contemporary NetBSD.)
+ For shared mappings, we should conversely verify that changes get
+ propogated back to all the places they're supposed to be.
+
+ Grep wants private fixed already mapped.
+ The main things grep needs to know about mmap are:
+ * does it exist and is it safe to write into the mmap'd area
+ * how to use it (BSD variants) */
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+
+/* This mess was copied from the GNU getpagesize.h. */
+#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+
+/* Assume that all systems that can run configure have sys/param.h. */
+# ifndef HAVE_SYS_PARAM_H
+# define HAVE_SYS_PARAM_H 1
+# endif
+
+# ifdef _SC_PAGESIZE
+# define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+# ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# ifdef EXEC_PAGESIZE
+# define getpagesize() EXEC_PAGESIZE
+# else /* no EXEC_PAGESIZE */
+# ifdef NBPG
+# define getpagesize() NBPG * CLSIZE
+# ifndef CLSIZE
+# define CLSIZE 1
+# endif /* no CLSIZE */
+# else /* no NBPG */
+# ifdef NBPC
+# define getpagesize() NBPC
+# else /* no NBPC */
+# ifdef PAGESIZE
+# define getpagesize() PAGESIZE
+# endif /* PAGESIZE */
+# endif /* no NBPC */
+# endif /* no NBPG */
+# endif /* no EXEC_PAGESIZE */
+# else /* no HAVE_SYS_PARAM_H */
+# define getpagesize() 8192 /* punt totally */
+# endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+#ifdef __cplusplus
+extern "C" { void *malloc(unsigned); }
+#else
+char *malloc();
+#endif
+
+int
+main()
+{
+ char *data, *data2, *data3;
+ int i, pagesize;
+ int fd;
+
+ pagesize = getpagesize();
+
+ /*
+ * First, make a file with some known garbage in it.
+ */
+ data = malloc(pagesize);
+ if (!data)
+ exit(1);
+ for (i = 0; i < pagesize; ++i)
+ *(data + i) = rand();
+ umask(0);
+ fd = creat("conftestmmap", 0600);
+ if (fd < 0)
+ exit(1);
+ if (write(fd, data, pagesize) != pagesize)
+ exit(1);
+ close(fd);
+
+ /*
+ * Next, try to mmap the file at a fixed address which
+ * already has something else allocated at it. If we can,
+ * also make sure that we see the same garbage.
+ */
+ fd = open("conftestmmap", O_RDWR);
+ if (fd < 0)
+ exit(1);
+ data2 = malloc(2 * pagesize);
+ if (!data2)
+ exit(1);
+ data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+ if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_FIXED, fd, 0L))
+ exit(1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data2 + i))
+ exit(1);
+
+ /*
+ * Finally, make sure that changes to the mapped area
+ * do not percolate back to the file as seen by read().
+ * (This is a bug on some variants of i386 svr4.0.)
+ */
+ for (i = 0; i < pagesize; ++i)
+ *(data2 + i) = *(data2 + i) + 1;
+ data3 = malloc(pagesize);
+ if (!data3)
+ exit(1);
+ if (read(fd, data3, pagesize) != pagesize)
+ exit(1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data3 + i))
+ exit(1);
+ close(fd);
+ unlink("conftestmmap");
+ exit(0);
+}
+
+EOF
+if { (eval echo configure:2814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_func_mmap_fixed_mapped=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_MMAP 1
+EOF
+
+fi
+
+ echo $ac_n "checking for vprintf""... $ac_c" 1>&6
+echo "configure:2837: checking for vprintf" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2842 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char vprintf(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char vprintf();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_vprintf) || defined (__stub___vprintf)
+choke me
+#else
+vprintf();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_vprintf=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_vprintf=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_VPRINTF 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test "$ac_cv_func_vprintf" != yes; then
+echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
+echo "configure:2889: checking for _doprnt" >&5
+if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2894 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char _doprnt(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char _doprnt();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub__doprnt) || defined (__stub____doprnt)
+choke me
+#else
+_doprnt();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func__doprnt=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func__doprnt=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_DOPRNT 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+ for ac_func in getcwd putenv socket strcspn strdup strerror strstr
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2944: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2949 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "./release Makefile lib/Makefile src/Makefile pdf2swf/Makefile pdf2swf/xpdf/Makefile pdf2swf/fonts/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@EXEEXT@%$EXEEXT%g
+s%@AWK@%$AWK%g
+s%@CC@%$CC%g
+s%@CPP@%$CPP%g
+s%@CXX@%$CXX%g
+s%@RANLIB@%$RANLIB%g
+s%@LN_S@%$LN_S%g
+s%@HAVE_UNISTD_H@%$HAVE_UNISTD_H%g
+s%@LIBOBJS@%$LIBOBJS%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"./release Makefile lib/Makefile src/Makefile pdf2swf/Makefile pdf2swf/xpdf/Makefile pdf2swf/fonts/Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ case "$ac_given_INSTALL" in
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS="config.h"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/configure.in b/configure.in
new file mode 100644
index 00000000..04e6f447
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,62 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(pdf2swf/swfoutput.h)
+AM_INIT_AUTOMAKE(swftools, pre0.0.2)
+AC_ARG_PROGRAM
+
+dnl Checks for system services
+ AC_CYGWIN
+ AC_EXEEXT
+
+export CFLAGS
+CFLAGS="-O2 -fomit-frame-pointer"
+export CXXFLAGS
+CXXFLAGS="-O2 -fomit-frame-pointer"
+dnl Checks for programs.
+ AC_PROG_AWK
+ AC_PROG_CC
+ AC_PROG_CPP
+ AC_PROG_CXX
+ AC_PROG_RANLIB
+ AC_PROG_MAKE_SET
+ AC_PROG_INSTALL
+ AC_PROG_LN_S
+
+dnl Checks for libraries.
+ AC_CHECK_LIB(m, sin,, echo "Error: Math library not found.";exit)
+ AC_CHECK_LIB(jpeg, jpeg_write_raw_data,, echo "Error: The jpeg library jpeglib is required.";exit)
+ AC_CHECK_LIB(z, crc32,, echo "Error: The zlib compressiong handling library is required.";exit)
+ AC_CHECK_LIB(t1, T1_LoadFont,,echo "Error: the T1lib truetype handling library is required.";exit)
+dnl do we need those?
+ AC_CHECK_LIB(pthread, pthread_create)
+ AC_CHECK_LIB(X11, XFlush)
+
+dnl Checks for header files.
+AM_CONFIG_HEADER(config.h)
+ AC_PATH_X
+dnl AC_PATH_XTRA
+ AC_HEADER_DIRENT
+ AC_HEADER_STDC
+ AC_CHECK_HEADERS(math.h fcntl.h limits.h malloc.h unistd.h memory.h zlib.h jpeglib.h t1lib.h)
+
+AC_SUBST(HAVE_UNISTD_H)
+AC_SUBST(EXEEXT)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+ AC_C_INLINE
+ AC_TYPE_OFF_T
+ AC_TYPE_SIZE_T
+ AC_STRUCT_TM
+dnl AC_CHECK_TYPE(uchar,unsigned char)
+dnl AC_CHECK_TYPE(schar,signed char)
+dnl AC_CHECK_TYPE(word,unsigned short int)
+dnl AC_CHECK_TYPE(sword,unsigned short int)
+dnl AC_CHECK_TYPE(uint,unsigned long int)
+
+dnl Checks for library functions.
+ AC_FUNC_MEMCMP
+ AC_FUNC_MMAP
+ AC_FUNC_VPRINTF
+ AC_CHECK_FUNCS(getcwd putenv socket strcspn strdup strerror strstr)
+
+AC_OUTPUT(./release Makefile lib/Makefile src/Makefile pdf2swf/Makefile pdf2swf/xpdf/Makefile pdf2swf/fonts/Makefile)
diff --git a/install-sh b/install-sh
new file mode 100755
index 00000000..e9de2384
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,251 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff --git a/lib/Makefile.am b/lib/Makefile.am
new file mode 100644
index 00000000..1e2da91b
--- /dev/null
+++ b/lib/Makefile.am
@@ -0,0 +1,3 @@
+all:
+ gcc -c rfxswf.c
+ gcc -c log.c
diff --git a/lib/Makefile.in b/lib/Makefile.in
new file mode 100644
index 00000000..0a7c957f
--- /dev/null
+++ b/lib/Makefile.in
@@ -0,0 +1,181 @@
+# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AWK = @AWK@
+CC = @CC@
+CPP = @CPP@
+CXX = @CXX@
+EXEEXT = @EXEEXT@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = lib
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu lib/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+all:
+ gcc -c rfxswf.c
+ gcc -c log.c
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/lib/example/box.c b/lib/example/box.c
new file mode 100644
index 00000000..5b10d4b4
--- /dev/null
+++ b/lib/example/box.c
@@ -0,0 +1,305 @@
+
+// linux/gcc: cc box.c ../rfxswf.c -funsigned-char -o box -lm; cp box /home/www/cgi-bin/box
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <math.h>
+#include "../rfxswf.h"
+
+// Box
+
+#define BANNER_TEXT "reflex"
+#define ID_FONT 2000
+#define ID_BANNER 2001
+#define ID_HIGHLIGHT 2002
+#define ID_BUTTON 2003
+
+#define a 200
+int sX[] = { a,-a, a,-a, a,-a, a,-a};
+int sY[] = { a, a,-a,-a, a, a,-a,-a};
+int sZ[] = { a, a, a, a,-a,-a,-a,-a};
+#undef a
+
+int dX[8];
+int dY[8];
+
+int sin_[512],cos_[512];
+
+void calcTables()
+{ int i;
+ double d;
+ for (i=0;i<512;i++)
+ { d = ((double)i)/128*3.14159;
+ sin_[i] = (int)(sin(d)*256);
+ cos_[i] = (int)(cos(d)*256);
+ }
+}
+
+void ShapeSquare(LPTAG t,LPSHAPE s,int p1,int p2,int p3,int p4,int dx,int dy)
+{
+ // Hidden-Line-Check
+ if (((dX[p2]-dX[p1])*(dY[p3]-dY[p1])-(dX[p3]-dX[p1])*(dY[p2]-dY[p1]))<0) return;
+
+ ShapeSetMove(t,s,dX[p1]+dx,dY[p1]+dy);
+ ShapeSetLine(t,s,dX[p2]-dX[p1],dY[p2]-dY[p1]);
+ ShapeSetLine(t,s,dX[p3]-dX[p2],dY[p3]-dY[p2]);
+ ShapeSetLine(t,s,dX[p4]-dX[p3],dY[p4]-dY[p3]);
+ ShapeSetLine(t,s,dX[p1]-dX[p4],dY[p1]-dY[p4]);
+}
+
+
+void mapBox(int xw,int yw,int zw)
+{ int i;
+ int x1,y1,z1,x2,y2,z2,x3,y3,z3;
+ int y,x,z;
+
+ xw &= 255;
+ yw &= 255;
+ zw &= 255;
+
+ for (i=0;i<8;i++)
+ { x = sX[i];
+ y = sY[i];
+ z = sZ[i];
+
+ y1 = ( y*cos_[xw]- z*sin_[xw])>>8;
+ z1 = ( y*sin_[xw]+ z*cos_[xw])>>8;
+ x1 = x;
+
+ x2 = (x1*cos_[yw]+z1*sin_[yw])>>8;
+ y2 = y1;
+
+ x3 = (x2*cos_[zw]-y2*sin_[zw])>>8;
+ y3 = (x2*sin_[zw]+y2*cos_[zw])>>8;
+ z3 = (z1*cos_[yw]-x1*sin_[yw])>>8;
+
+ dX[i] = x3*4000/(z3+950);
+ dY[i] = y3*4000/(z3+950);
+
+ }
+}
+
+int main (int argc,char ** argv)
+{ SWF swf;
+ LPTAG t;
+ RGBA rgb;
+ SRECT r;
+ LPSHAPE s;
+ S32 width = 800,height = 800;
+ U8 gbits,abits;
+ LPSWFFONT font;
+ FONTUSAGE use;
+ CXFORM cx1,cx2;
+ MATRIX m;
+
+ int f,i,j,frame;
+
+/* f = open("Arial.efont",O_RDONLY);
+ if (f>=0)
+ { if (FAILED(FontImport(f,&font)))
+ { fprintf(stderr,"Font import failed\n");
+ close(f);
+ return -1;
+ }
+ }
+ else
+ { fprintf(stderr,"Font not found\n");
+ return -1;
+ }
+ close(f);
+
+ FontSetID(font,ID_FONT);
+ FontInitUsage(&use);
+ FontUse(&use,BANNER_TEXT);
+ FontReduce(font,&use);*/
+
+ calcTables();
+
+ memset(&swf,0x00,sizeof(SWF));
+
+ swf.FileVersion = 4;
+ swf.FrameRate = 0x4000;
+ swf.MovieSize.xmax = 4*width;
+ swf.MovieSize.ymax = 4*height;
+
+ swf.FirstTag = InsertTag(NULL,ST_SETBACKGROUNDCOLOR);
+ t = swf.FirstTag;
+
+ rgb.r = 0xff;
+ rgb.g = 0xff;
+ rgb.b = 0xff;
+ SetRGB(t,&rgb);
+
+ t = InsertTag(t,ST_DEFINEFONT);
+
+ FontSetDefine(t,font);
+
+ t = InsertTag(t,ST_DEFINEFONTINFO);
+
+ FontSetInfo(t,font);
+
+ t = InsertTag(t,ST_DEFINETEXT);
+
+ SetU16(t,ID_BANNER); // ID
+
+ r.xmin = 0;
+ r.ymin = 0;
+ r.xmax = 400;
+ r.ymax = 400;
+ SetRect(t,&r);
+
+ SetMatrix(t,NULL);
+
+ TextCountBits(font,BANNER_TEXT,80,&gbits,&abits);
+
+ SetU8(t,gbits);
+ SetU8(t,abits);
+
+ rgb.r = 0xc0;
+ rgb.g = 0xc0;
+ rgb.b = 0xc0;
+
+ TextSetInfoRecord(t,font,height/4,&rgb,0,200);
+ TextSetCharRecord(t,font,BANNER_TEXT,80,gbits,abits);
+
+ SetU8(t,0);
+
+ t = InsertTag(t,ST_DEFINETEXT);
+
+ SetU16(t,ID_HIGHLIGHT); // ID
+
+ r.xmin = 0;
+ r.ymin = 0;
+ r.xmax = 800;
+ r.ymax = 400;
+ SetRect(t,&r);
+
+ SetMatrix(t,NULL);
+
+ TextCountBits(font,BANNER_TEXT,80,&gbits,&abits);
+
+ SetU8(t,gbits);
+ SetU8(t,abits);
+
+ rgb.r = 0x20;
+ rgb.g = 0x20;
+ rgb.b = 0x20;
+
+ TextSetInfoRecord(t,font,height/4,&rgb,0,200);
+ TextSetCharRecord(t,font,BANNER_TEXT,80,gbits,abits);
+
+ SetU8(t,0);
+
+ t = InsertTag(t,ST_DEFINEBUTTON);
+
+ GetMatrix(NULL,&m);
+
+ m.tx = 3*width;
+ m.ty = 7*height/2;
+
+ SetU16(t,ID_BUTTON); // ID
+ ButtonSetRecord(t,BS_UP,ID_BANNER,1,&m,NULL);
+ ButtonSetRecord(t,BS_DOWN|BS_HIT|BS_OVER,ID_HIGHLIGHT,1,&m,NULL);
+ SetU8(t,0); // End of Button Records
+ SetU8(t,0); // End of Action Records
+
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+
+ ObjectPlace(t,ID_BUTTON,1,NULL,NULL,NULL);
+
+ GetCXForm(NULL,&cx1,1);
+ GetCXForm(NULL,&cx2,1);
+
+// cx1.a1 = -(0x40*1);
+// cx2.a1 = -(0x40*2);
+
+ cx1.r1 = cx1.g1 = 0x80;
+ cx2.r1 = cx2.g1 = 0xc0;
+
+
+
+ for (frame=0;frame<256;frame+=2)
+ { int id = frame +1;
+
+ t = InsertTag(t,ST_DEFINESHAPE);
+
+ NewShape(&s);
+ rgb.r = rgb.g = 0x00; rgb.b = 0xff;
+ j = ShapeAddLineStyle(s,40,&rgb);
+
+ SetU16(t,id); // ID
+
+ r.xmin = 0;
+ r.ymin = 0;
+ r.xmax = 4*width;
+ r.ymax = 4*height;
+
+ SetRect(t,&r);
+
+ SetShapeStyles(t,s);
+ ShapeCountBits(s,NULL,NULL);
+ SetShapeBits(t,s);
+
+ ShapeSetAll(t,s,0,0,j,0,0);
+
+ mapBox(frame,frame,frame>>1);
+
+ ShapeSquare(t,s,0,2,3,1,2*width,2*height);
+ ShapeSquare(t,s,4,5,7,6,2*width,2*height);
+ ShapeSquare(t,s,0,4,6,2,2*width,2*height);
+ ShapeSquare(t,s,1,3,7,5,2*width,2*height);
+ ShapeSquare(t,s,0,1,5,4,2*width,2*height);
+ ShapeSquare(t,s,2,6,7,3,2*width,2*height);
+
+ ShapeSetEnd(t);
+ }
+
+ for (frame=0;frame<256;frame+=2)
+ { int id = frame +1;
+ int id2 = ((frame-2)&255)+1;
+ int id3 = ((frame-4)&255)+1;
+
+ if (frame)
+ { t = InsertTag(t,ST_REMOVEOBJECT2); SetU16(t,2); // depth
+ t = InsertTag(t,ST_REMOVEOBJECT2); SetU16(t,3); // depth
+ t = InsertTag(t,ST_REMOVEOBJECT2); SetU16(t,4); // depth
+ }
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+
+ ObjectPlace(t,id,4,NULL,NULL,NULL);
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+
+ ObjectPlace(t,id2,3,NULL,&cx1,NULL);
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+
+ ObjectPlace(t,id3,2,NULL,&cx2,NULL);
+
+
+ t = InsertTag(t,ST_SHOWFRAME);
+ }
+
+
+
+ t = InsertTag(t,ST_END);
+
+// WriteCGI(&swf);
+
+
+ f = open("shape1.swf",O_RDWR|O_CREAT|O_TRUNC);
+ if FAILED(WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n");
+ close(f);
+
+ FreeTags(&swf);
+
+#ifdef __NT__
+ system("start ..\\shape1.swf");
+#endif
+
+ return 0;
+}
+
+
diff --git a/lib/example/jpegtest.c b/lib/example/jpegtest.c
new file mode 100644
index 00000000..76eb1ea6
--- /dev/null
+++ b/lib/example/jpegtest.c
@@ -0,0 +1,124 @@
+// linux/gcc cc jpegtest.c ../rfxswf.c -funsigned-char -o jpegtest -lm -ljpeg; cp jpegtest /home/www/cgi-bin/jpegtest
+
+#include <stdio.h>
+#include <math.h>
+#include "../rfxswf.h"
+
+#define WIDTH 256
+#define HEIGHT 256
+#define QUALITY 85
+
+#define ID_BITS 1
+#define ID_SHAPE 2
+
+int main ( int argc, char ** argv)
+{ SWF swf;
+ LPTAG t;
+ RGBA rgb;
+ LPSHAPE s;
+ MATRIX m;
+ SRECT r;
+ LPJPEGBITS jpeg;
+
+ int ls; // line style
+ int fs; // fill style
+ int frame;
+
+ memset(&swf,0x00,sizeof(SWF));
+
+ swf.FileVersion = 4;
+ swf.FrameRate = 0x1800;
+ swf.MovieSize.xmax = 20*WIDTH;
+ swf.MovieSize.ymax = 20*HEIGHT;
+
+ swf.FirstTag = InsertTag(NULL,ST_SETBACKGROUNDCOLOR);
+ t = swf.FirstTag;
+
+ rgb.r = 0xff;
+ rgb.b = 0xff;
+ rgb.g = 0xff;
+ SetRGB(t,&rgb);
+
+ t = InsertTag(t,ST_DEFINEBITSJPEG2);
+
+ SetU16(t,ID_BITS);
+ SetJPEGBits(t,"eye.jpg",QUALITY);
+
+/* jpeg = SetJPEGBitsStart(t,WIDTH,HEIGHT,QUALITY);
+ { int y;
+ for (y=0;y<HEIGHT;y++)
+ { U8 scanline[3*WIDTH];
+ int x,p = 0;
+ for (x=0;x<WIDTH;x++)
+ { scanline[p++] = x; // R
+ scanline[p++] = y; // G
+ scanline[p++] = 0x80; // B
+ }
+ SetJPEGBitsLine(jpeg,scanline);
+ }
+ }
+ SetJPEGBitsFinish(jpeg);
+*/
+
+for (frame=0;frame<64;frame++)
+{
+ t = InsertTag(t,ST_DEFINESHAPE);
+
+ NewShape(&s);
+ rgb.b = rgb.g = rgb.r = 0x00;
+ ls = ShapeAddLineStyle(s,40,&rgb);
+ rgb.b = 0xff;
+ // fs = ShapeAddSolidFillStyle(s,&rgb);
+ //
+ GetMatrix(NULL,&m);
+ m.sy = m.sx = (int)(cos(((float)(frame))/32*3.141)*0x80000);
+ m.r0 = (int)(sin(((float)(frame))/32*3.141)*0x80000);
+ m.r1 = -m.r0;
+
+ fs = ShapeAddBitmapFillStyle(s,&m,ID_BITS,0);
+
+ SetU16(t,ID_SHAPE+frame); // ID
+
+ r.xmin = 0;
+ r.ymin = 0;
+ r.xmax = 10*WIDTH;
+ r.ymax = 10*HEIGHT;
+
+ SetRect(t,&r);
+
+ SetShapeStyles(t,s);
+ ShapeCountBits(s,NULL,NULL);
+ SetShapeBits(t,s);
+
+ ShapeSetAll(t,s,0,0,ls,fs,0);
+
+ ShapeSetLine(t,s,10*WIDTH,0);
+ ShapeSetLine(t,s,-10*WIDTH,10*HEIGHT);
+// ShapeSetLine(t,s,-10*WIDTH,-10*WIDTH);
+ ShapeSetLine(t,s,0,-10*HEIGHT);
+ ShapeSetEnd(t);
+
+ if (frame)
+ { t = InsertTag(t,ST_REMOVEOBJECT2); SetU16(t,1);
+ t = InsertTag(t,ST_REMOVEOBJECT2); SetU16(t,2);
+ }
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+ ObjectPlace(t,ID_SHAPE+frame,1,NULL,NULL,NULL);
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+ GetMatrix(NULL,&m);
+ m.tx = m.ty = 10*WIDTH+frame*10;
+ m.sx = m.sy = 0xfffeffff;
+ ObjectPlace(t,ID_SHAPE+frame,2,&m,NULL,NULL);
+
+
+ t = InsertTag(t,ST_SHOWFRAME);
+}
+
+ t = InsertTag(t,ST_END);
+
+ WriteCGI(&swf);
+ FreeTags(&swf);
+ return 0;
+}
diff --git a/lib/example/shape1.c b/lib/example/shape1.c
new file mode 100644
index 00000000..5a7da4e7
--- /dev/null
+++ b/lib/example/shape1.c
@@ -0,0 +1,86 @@
+#include <stdio.h>
+#include <fcntl.h>
+#include <math.h>
+#include "../rfxswf.h"
+
+
+int main (int argc,char ** argv)
+{ SWF swf;
+ LPTAG t;
+ RGBA rgb;
+ SRECT r;
+ LPSHAPE s;
+ S32 width=300,height = 300;
+
+ int f,i,j;
+
+ memset(&swf,0x00,sizeof(SWF));
+
+ swf.FileVersion = 4;
+ swf.FrameRate = 0x1900;
+ swf.MovieSize.xmax = 20*width;
+ swf.MovieSize.ymax = 20*height;
+
+ swf.FirstTag = InsertTag(NULL,ST_SETBACKGROUNDCOLOR);
+ t = swf.FirstTag;
+
+ rgb.r = 0xff;
+ rgb.g = 0xff;
+ rgb.b = 0xff;
+ SetRGB(t,&rgb);
+
+ t = InsertTag(t,ST_DEFINESHAPE);
+
+ NewShape(&s);
+ rgb.b = rgb.g = 0x00;
+ j = ShapeAddLineStyle(s,40,&rgb);
+ rgb.r = 0; rgb.b = 0xff;
+ ShapeAddLineStyle(s,40,&rgb);
+
+ SetU16(t,1); // ID
+
+ r.xmin = 0;
+ r.ymin = 0;
+ r.xmax = 4*width;
+ r.ymax = 4*height;
+
+ SetRect(t,&r);
+
+ SetShapeStyles(t,s);
+ ShapeCountBits(s,NULL,NULL);
+ SetShapeBits(t,s);
+
+ ShapeSetAll(t,s,0,0,j,0,0);
+// ShapeSetCurve(t,s,4*width,0,0,4*height);
+ ShapeSetLine(t,s,4*width,4*height);
+ ShapeSetStyle(t,s,2,0,0);
+ for (i=1;i<10;i++)
+ ShapeSetCircle(t,s,4*width,4*height,i*width/2,i*height/2);
+ ShapeSetEnd(t);
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+
+ ObjectPlace(t,1,1,NULL,NULL,NULL);
+
+ t = InsertTag(t,ST_SHOWFRAME);
+
+ t = InsertTag(t,ST_END);
+
+// WriteCGI(&swf);
+
+
+ f = open("shape1.swf",O_WRONLY|O_CREAT, 0777);
+// f = 1;
+ if FAILED(WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n");
+ close(f);
+
+ FreeTags(&swf);
+
+#ifdef __NT__
+ system("start ..\\shape1.swf");
+#endif
+
+ return 0;
+}
+
+
diff --git a/lib/example/texbox.c b/lib/example/texbox.c
new file mode 100644
index 00000000..7685e5bb
--- /dev/null
+++ b/lib/example/texbox.c
@@ -0,0 +1,367 @@
+
+// linux/gcc: cc texbox.c ../rfxswf.c -funsigned-char -o texbox -lm -ljpeg; cp texbox /home/www/cgi-bin/texbox
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <math.h>
+#include "../rfxswf.h"
+
+// Box
+
+#define BANNER_TEXT "reflex"
+#define QUALITY 80
+#define ID_FONT 2000
+#define ID_BANNER 2001
+#define ID_HIGHLIGHT 2002
+#define ID_BUTTON 2003
+#define ID_BITMAP 2004
+#define ID_SHAPE 2005
+#define ID_SHAPE2 2006
+
+#define a 200
+int sX[] = { a,-a, a,-a, a,-a, a,-a};
+int sY[] = { a, a,-a,-a, a, a,-a,-a};
+int sZ[] = { a, a, a, a,-a,-a,-a,-a};
+#undef a
+
+#define PRECISION 16
+
+int SHADE = 1;
+
+int dX[8];
+int dY[8];
+int square_visible[6] = {0,0,0,0,0,0};
+int square_depth[6][2] = {{2,3},{4,5},{6,7},{8,9},{10,11},{12,13}};
+int square_light[6] = {0,0,64,64,-64,-64};
+
+int sin_[512],cos_[512];
+
+void calcTables()
+{ int i;
+ double d;
+ for (i=0;i<512;i++)
+ { d = ((double)i)/128*3.14159;
+ sin_[i] = (int)(sin(d)*(1<<PRECISION));
+ cos_[i] = (int)(cos(d)*(1<<PRECISION));
+ }
+}
+
+LPTAG MapSquare(LPTAG t,int dx0,int dy0,int p1,int p2,int p3,int p4,int dx,int dy,int square)
+{ MATRIX m;
+ CXFORM cx;
+
+ if (SHADE)
+ { GetCXForm(NULL,&cx,1);
+ cx.r1 = cx.b1 = cx.g1 = square_light[square];
+ }
+
+ if (((dX[p2]-dX[p1])*(dY[p3]-dY[p1])-(dX[p3]-dX[p1])*(dY[p2]-dY[p1]))<0)
+ { if (square_visible[square])
+ { t = InsertTag(t,ST_REMOVEOBJECT2); SetU16(t,square_depth[square][0]);
+ t = InsertTag(t,ST_REMOVEOBJECT2); SetU16(t,square_depth[square][1]);
+ }
+ square_visible[square] = 0;
+ return t;
+ }
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+
+ MatrixMapTriangle(&m,dx0,dy0,dX[p1]+dx,dY[p1]+dy,
+ dX[p2]+dx,dY[p2]+dy,
+ dX[p4]+dx,dY[p4]+dy);
+
+ if (!square_visible[square])
+ ObjectPlace(t,ID_SHAPE,square_depth[square][0],&m,SHADE?&cx:NULL,NULL);
+ else
+ ObjectMove(t,square_depth[square][0],&m,SHADE?&cx:NULL);
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+
+ MatrixMapTriangle(&m,dx0,dy0,dX[p3]+dx,dY[p3]+dy,
+ dX[p4]+dx,dY[p4]+dy,
+ dX[p2]+dx,dY[p2]+dy);
+
+ if (!square_visible[square])
+ ObjectPlace(t,ID_SHAPE2,square_depth[square][1],&m,SHADE?&cx:NULL,NULL);
+ else
+ ObjectMove(t,square_depth[square][1],&m,SHADE?&cx:NULL);
+
+ square_visible[square] = 1;
+
+ return t;
+}
+
+void mapBox(int xw,int yw,int zw)
+{ int i;
+ int x1,y1,z1,x2,y2,z2,x3,y3,z3;
+ int y,x,z;
+
+ xw &= 255;
+ yw &= 255;
+ zw &= 255;
+
+ for (i=0;i<8;i++)
+ { x = sX[i];
+ y = sY[i];
+ z = sZ[i];
+
+ y1 = ( y*cos_[xw]- z*sin_[xw])>>PRECISION;
+ z1 = ( y*sin_[xw]+ z*cos_[xw])>>PRECISION;
+ x1 = x;
+
+ x2 = (x1*cos_[yw]+z1*sin_[yw])>>PRECISION;
+ y2 = y1;
+
+ x3 = (x2*cos_[zw]-y2*sin_[zw])>>PRECISION;
+ y3 = (x2*sin_[zw]+y2*cos_[zw])>>PRECISION;
+ z3 = (z1*cos_[yw]-x1*sin_[yw])>>PRECISION;
+
+ dX[i] = x3*4000/(z3+950);
+ dY[i] = y3*4000/(z3+950);
+
+ }
+}
+
+void mapLights(int xw,int yw,int zw)
+{ int i;
+ int x1,y1,z1,x2,y2,z2,x3,y3,z3;
+
+ int y[] = {0,0,0,0,256,-256};
+ int x[] = {0,0,256,-256,0,0};
+ int z[] = {256,-256,0,0,0,0};
+
+ int lz = 256; // lightvector
+ int lx = 200, ly = 200;
+
+ for (i=0;i<6;i++)
+ { y1 = (y[i]*cos_[xw]-z[i]*sin_[xw])>>PRECISION;
+ z1 = (y[i]*sin_[xw]+z[i]*cos_[xw])>>PRECISION;
+ x1 = x[i];
+
+ x2 = (x1*cos_[yw]+z1*sin_[yw])>>PRECISION;
+ y2 = y1;
+ z2 = (z1*cos_[yw]-x1*sin_[yw])>>PRECISION;
+
+ x3 = (x2*cos_[zw]-y2*sin_[zw])>>PRECISION;
+ y3 = (x2*sin_[zw]+y2*cos_[zw])>>PRECISION;
+ z3 = z2;
+
+ square_light[i] = -128-((x3*lx + y3*ly + z3*lz)>>9);
+ }
+}
+
+
+int main (int argc,char ** argv)
+{ SWF swf;
+ LPTAG t;
+ RGBA rgb;
+ SRECT r;
+ LPSHAPE s;
+ S32 width = 800,height = 800;
+ U8 gbits,abits;
+ int fs,ls; // line & fillstyle
+ LPSWFFONT font;
+ FONTUSAGE use;
+ LPJPEGBITS jpeg;
+ MATRIX m;
+
+ int f,i,j,frame;
+
+ f = open("Arial.efont",O_RDONLY);
+ if (f>=0)
+ { if (FAILED(FontImport(f,&font)))
+ { fprintf(stderr,"Font import failed\n");
+ close(f);
+ return -1;
+ }
+ }
+ else
+ { fprintf(stderr,"Font not found\n");
+ return -1;
+ }
+ close(f);
+
+ FontSetID(font,ID_FONT);
+ FontInitUsage(&use);
+ FontUse(&use,BANNER_TEXT);
+ FontReduce(font,&use);
+
+ calcTables();
+
+ memset(&swf,0x00,sizeof(SWF));
+
+ swf.FileVersion = 4;
+ swf.FrameRate = 0x4000;
+ swf.MovieSize.xmax = 4*width;
+ swf.MovieSize.ymax = 4*height;
+
+ swf.FirstTag = InsertTag(NULL,ST_SETBACKGROUNDCOLOR);
+ t = swf.FirstTag;
+
+ rgb.r = 0xff;
+ rgb.g = 0xff;
+ rgb.b = 0xff;
+ SetRGB(t,&rgb);
+
+ t = InsertTag(t,ST_DEFINEFONT);
+
+ FontSetDefine(t,font);
+
+ t = InsertTag(t,ST_DEFINEFONTINFO);
+
+ FontSetInfo(t,font);
+
+ t = InsertTag(t,ST_DEFINETEXT);
+
+ SetU16(t,ID_BANNER); // ID
+
+ r.xmin = 0;
+ r.ymin = 0;
+ r.xmax = 400;
+ r.ymax = 400;
+ SetRect(t,&r);
+
+ SetMatrix(t,NULL);
+
+ TextCountBits(font,BANNER_TEXT,80,&gbits,&abits);
+
+ SetU8(t,gbits);
+ SetU8(t,abits);
+
+ rgb.r = 0xc0;
+ rgb.g = 0xc0;
+ rgb.b = 0xc0;
+
+ TextSetInfoRecord(t,font,height/4,&rgb,0,200);
+ TextSetCharRecord(t,font,BANNER_TEXT,80,gbits,abits);
+
+ SetU8(t,0);
+
+ t = InsertTag(t,ST_DEFINETEXT);
+
+ SetU16(t,ID_HIGHLIGHT); // ID
+
+ r.xmin = 0; r.ymin = 0; r.xmax = 800; r.ymax = 400;
+ SetRect(t,&r);
+
+ SetMatrix(t,NULL);
+ TextCountBits(font,BANNER_TEXT,80,&gbits,&abits);
+
+ SetU8(t,gbits);
+ SetU8(t,abits);
+
+ rgb.r = 0x20;
+ rgb.g = 0x20;
+ rgb.b = 0x20;
+
+ TextSetInfoRecord(t,font,height/4,&rgb,0,200);
+ TextSetCharRecord(t,font,BANNER_TEXT,80,gbits,abits);
+
+ SetU8(t,0);
+
+ t = InsertTag(t,ST_DEFINEBUTTON);
+
+ GetMatrix(NULL,&m);
+
+ m.tx = 3*width;
+ m.ty = 7*height/2;
+
+ SetU16(t,ID_BUTTON); // ID
+ ButtonSetRecord(t,BS_UP,ID_BANNER,1,&m,NULL);
+ ButtonSetRecord(t,BS_DOWN|BS_HIT|BS_OVER,ID_HIGHLIGHT,1,&m,NULL);
+ SetU8(t,0); // End of Button Records
+ SetU8(t,0); // End of Action Records
+
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+
+ ObjectPlace(t,ID_BUTTON,1,NULL,NULL,NULL);
+
+ t = InsertTag(t,ST_DEFINEBITSJPEG2);
+
+ SetU16(t,ID_BITMAP);
+ SetJPEGBits(t,"eye.jpg",QUALITY);
+
+ t = InsertTag(t,ST_DEFINESHAPE);
+
+ NewShape(&s);
+ rgb.b = rgb.g = rgb.r = 0x00;
+ ls = ShapeAddLineStyle(s,10,&rgb);
+ rgb.b = 0xff;
+
+ m.tx = m.ty = 0;
+ m.r0 = m.r1 = 0;
+ m.sx = m.sy = width<<8;
+
+ fs = ShapeAddBitmapFillStyle(s,&m,ID_BITMAP,0);
+
+ SetU16(t,ID_SHAPE); // ID
+
+ r.xmin = 0; r.ymin = 0;
+ r.xmax = 2*width; r.ymax = 2*height;
+ SetRect(t,&r);
+
+ SetShapeHeader(t,s);
+ ShapeSetAll(t,s,width,0,0,fs,0);
+ ShapeSetLine(t,s,-width,height);
+ ShapeSetStyle(t,s,ls,fs,0);
+ ShapeSetLine(t,s,0,-height);
+ ShapeSetLine(t,s,width,0);
+ ShapeSetEnd(t);
+
+ ShapeFree(s);
+
+ t = InsertTag(t,ST_DEFINESHAPE);
+
+ NewShape(&s);
+ rgb.b = rgb.g = rgb.r = 0x00;
+ ls = ShapeAddLineStyle(s,10,&rgb);
+ rgb.b = 0xff;
+
+ m.tx = m.ty = 0;
+ m.r0 = m.r1 = 0;
+ m.sx = m.sy = -(width<<8);
+
+ fs = ShapeAddBitmapFillStyle(s,&m,ID_BITMAP,0);
+
+ SetU16(t,ID_SHAPE2); // ID
+
+ r.xmin = 0; r.ymin = 0;
+ r.xmax = 2*width; r.ymax = 2*height;
+ SetRect(t,&r);
+
+ SetShapeHeader(t,s);
+ ShapeSetAll(t,s,width,0,0,fs,0);
+ ShapeSetLine(t,s,-width,height);
+ ShapeSetStyle(t,s,ls,fs,0);
+ ShapeSetLine(t,s,0,-height);
+ ShapeSetLine(t,s,width,0);
+ ShapeSetEnd(t);
+
+ ShapeFree(s);
+
+ for (frame=0;frame<256;frame++)
+ { int dc = 3; // whitespace correction
+
+ mapBox(frame<<1,frame<<1,frame);
+ if (SHADE) mapLights(frame<<1,frame<<1,frame);
+
+ t = MapSquare(t,width-dc,height-dc,0,2,3,1,2*width,2*height,0);
+ t = MapSquare(t,width-dc,height-dc,4,5,7,6,2*width,2*height,1);
+ t = MapSquare(t,width-dc,height-dc,0,4,6,2,2*width,2*height,2);
+ t = MapSquare(t,width-dc,height-dc,1,3,7,5,2*width,2*height,3);
+ t = MapSquare(t,width-dc,height-dc,0,1,5,4,2*width,2*height,4);
+ t = MapSquare(t,width-dc,height-dc,2,6,7,3,2*width,2*height,5);
+
+ t = InsertTag(t,ST_SHOWFRAME);
+ }
+
+
+ t = InsertTag(t,ST_END);
+
+ WriteCGI(&swf);
+ FreeTags(&swf);
+ return 0;
+}
+
+
diff --git a/lib/example/texbox_ac.c b/lib/example/texbox_ac.c
new file mode 100644
index 00000000..c94ec367
--- /dev/null
+++ b/lib/example/texbox_ac.c
@@ -0,0 +1,374 @@
+
+// linux/gcc: cc texbox_ac.c ../rfxswf.c -funsigned-char -o texbox -lmingac -lm -ljpeg; cp texbox /home/www/cgi-bin/texbox
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <math.h>
+#include "../rfxswf.h"
+#include "../mingac.h" // Action Compiler of MING library
+
+// Box
+
+#define BANNER_TEXT "reflex"
+#define QUALITY 80
+#define ID_FONT 2000
+#define ID_BANNER 2001
+#define ID_HIGHLIGHT 2002
+#define ID_BUTTON 2003
+#define ID_BITMAP 2004
+#define ID_SHAPE 2005
+#define ID_SHAPE2 2006
+
+#define a 200
+int sX[] = { a,-a, a,-a, a,-a, a,-a};
+int sY[] = { a, a,-a,-a, a, a,-a,-a};
+int sZ[] = { a, a, a, a,-a,-a,-a,-a};
+#undef a
+
+#define PRECISION 16
+
+int SHADE = 1;
+
+int dX[8];
+int dY[8];
+int square_visible[6] = {0,0,0,0,0,0};
+int square_depth[6][2] = {{2,3},{4,5},{6,7},{8,9},{10,11},{12,13}};
+int square_light[6] = {0,0,64,64,-64,-64};
+
+int sin_[512],cos_[512];
+
+void calcTables()
+{ int i;
+ double d;
+ for (i=0;i<512;i++)
+ { d = ((double)i)/128*3.14159;
+ sin_[i] = (int)(sin(d)*(1<<PRECISION));
+ cos_[i] = (int)(cos(d)*(1<<PRECISION));
+ }
+}
+
+LPTAG MapSquare(LPTAG t,int dx0,int dy0,int p1,int p2,int p3,int p4,int dx,int dy,int square)
+{ MATRIX m;
+ CXFORM cx;
+
+ if (SHADE)
+ { GetCXForm(NULL,&cx,1);
+ cx.r1 = cx.b1 = cx.g1 = square_light[square];
+ }
+
+ if (((dX[p2]-dX[p1])*(dY[p3]-dY[p1])-(dX[p3]-dX[p1])*(dY[p2]-dY[p1]))<0)
+ { if (square_visible[square])
+ { t = InsertTag(t,ST_REMOVEOBJECT2); SetU16(t,square_depth[square][0]);
+ t = InsertTag(t,ST_REMOVEOBJECT2); SetU16(t,square_depth[square][1]);
+ }
+ square_visible[square] = 0;
+ return t;
+ }
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+
+ MatrixMapTriangle(&m,dx0,dy0,dX[p1]+dx,dY[p1]+dy,
+ dX[p2]+dx,dY[p2]+dy,
+ dX[p4]+dx,dY[p4]+dy);
+
+ if (!square_visible[square])
+ ObjectPlace(t,ID_SHAPE,square_depth[square][0],&m,SHADE?&cx:NULL,NULL);
+ else
+ ObjectMove(t,square_depth[square][0],&m,SHADE?&cx:NULL);
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+
+ MatrixMapTriangle(&m,dx0,dy0,dX[p3]+dx,dY[p3]+dy,
+ dX[p4]+dx,dY[p4]+dy,
+ dX[p2]+dx,dY[p2]+dy);
+
+ if (!square_visible[square])
+ ObjectPlace(t,ID_SHAPE2,square_depth[square][1],&m,SHADE?&cx:NULL,NULL);
+ else
+ ObjectMove(t,square_depth[square][1],&m,SHADE?&cx:NULL);
+
+ square_visible[square] = 1;
+
+ return t;
+}
+
+void mapBox(int xw,int yw,int zw)
+{ int i;
+ int x1,y1,z1,x2,y2,z2,x3,y3,z3;
+ int y,x,z;
+
+ xw &= 255;
+ yw &= 255;
+ zw &= 255;
+
+ for (i=0;i<8;i++)
+ { x = sX[i];
+ y = sY[i];
+ z = sZ[i];
+
+ y1 = ( y*cos_[xw]- z*sin_[xw])>>PRECISION;
+ z1 = ( y*sin_[xw]+ z*cos_[xw])>>PRECISION;
+ x1 = x;
+
+ x2 = (x1*cos_[yw]+z1*sin_[yw])>>PRECISION;
+ y2 = y1;
+
+ x3 = (x2*cos_[zw]-y2*sin_[zw])>>PRECISION;
+ y3 = (x2*sin_[zw]+y2*cos_[zw])>>PRECISION;
+ z3 = (z1*cos_[yw]-x1*sin_[yw])>>PRECISION;
+
+ dX[i] = x3*4000/(z3+950);
+ dY[i] = y3*4000/(z3+950);
+
+ }
+}
+
+void mapLights(int xw,int yw,int zw)
+{ int i;
+ int x1,y1,z1,x2,y2,z2,x3,y3,z3;
+
+ int y[] = {0,0,0,0,256,-256};
+ int x[] = {0,0,256,-256,0,0};
+ int z[] = {256,-256,0,0,0,0};
+
+ int lz = 256; // lightvector
+ int lx = 200, ly = 200;
+
+ for (i=0;i<6;i++)
+ { y1 = (y[i]*cos_[xw]-z[i]*sin_[xw])>>PRECISION;
+ z1 = (y[i]*sin_[xw]+z[i]*cos_[xw])>>PRECISION;
+ x1 = x[i];
+
+ x2 = (x1*cos_[yw]+z1*sin_[yw])>>PRECISION;
+ y2 = y1;
+ z2 = (z1*cos_[yw]-x1*sin_[yw])>>PRECISION;
+
+ x3 = (x2*cos_[zw]-y2*sin_[zw])>>PRECISION;
+ y3 = (x2*sin_[zw]+y2*cos_[zw])>>PRECISION;
+ z3 = z2;
+
+ square_light[i] = -128-((x3*lx + y3*ly + z3*lz)>>9);
+ }
+}
+
+
+int main (int argc,char ** argv)
+{ SWF swf;
+ LPTAG t;
+ RGBA rgb;
+ SRECT r;
+ LPSHAPE s;
+ S32 width = 800,height = 800;
+ U8 gbits,abits;
+ int fs,ls; // line & fillstyle
+ LPSWFFONT font;
+ FONTUSAGE use;
+ LPJPEGBITS jpeg;
+ MATRIX m;
+
+ int f,i,j,frame;
+
+ InitCompiler(AC_DEFAULT);
+
+ f = open("Arial.efont",O_RDONLY);
+ if (f>=0)
+ { if (FAILED(FontImport(f,&font)))
+ { fprintf(stderr,"Font import failed\n");
+ close(f);
+ return -1;
+ }
+ }
+ else
+ { fprintf(stderr,"Font not found\n");
+ return -1;
+ }
+ close(f);
+
+ FontSetID(font,ID_FONT);
+ FontInitUsage(&use);
+ FontUse(&use,BANNER_TEXT);
+ FontReduce(font,&use);
+
+ calcTables();
+
+ memset(&swf,0x00,sizeof(SWF));
+
+ swf.FileVersion = 4;
+ swf.FrameRate = 0x4000;
+ swf.MovieSize.xmax = 4*width;
+ swf.MovieSize.ymax = 4*height;
+
+ swf.FirstTag = InsertTag(NULL,ST_SETBACKGROUNDCOLOR);
+ t = swf.FirstTag;
+
+ rgb.r = 0xff;
+ rgb.g = 0xff;
+ rgb.b = 0xff;
+ SetRGB(t,&rgb);
+
+ t = InsertTag(t,ST_DEFINEFONT);
+
+ FontSetDefine(t,font);
+
+ t = InsertTag(t,ST_DEFINEFONTINFO);
+
+ FontSetInfo(t,font);
+
+ t = InsertTag(t,ST_DEFINETEXT);
+
+ SetU16(t,ID_BANNER); // ID
+
+ r.xmin = 0;
+ r.ymin = 0;
+ r.xmax = 400;
+ r.ymax = 400;
+ SetRect(t,&r);
+
+ SetMatrix(t,NULL);
+
+ TextCountBits(font,BANNER_TEXT,80,&gbits,&abits);
+
+ SetU8(t,gbits);
+ SetU8(t,abits);
+
+ rgb.r = 0xc0;
+ rgb.g = 0xc0;
+ rgb.b = 0xc0;
+
+ TextSetInfoRecord(t,font,height/4,&rgb,0,200);
+ TextSetCharRecord(t,font,BANNER_TEXT,80,gbits,abits);
+
+ SetU8(t,0);
+
+ t = InsertTag(t,ST_DEFINETEXT);
+
+ SetU16(t,ID_HIGHLIGHT); // ID
+
+ r.xmin = 0; r.ymin = 0; r.xmax = 800; r.ymax = 400;
+ SetRect(t,&r);
+
+ SetMatrix(t,NULL);
+ TextCountBits(font,BANNER_TEXT,80,&gbits,&abits);
+
+ SetU8(t,gbits);
+ SetU8(t,abits);
+
+ rgb.r = 0x20;
+ rgb.g = 0x20;
+ rgb.b = 0x20;
+
+ TextSetInfoRecord(t,font,height/4,&rgb,0,200);
+ TextSetCharRecord(t,font,BANNER_TEXT,80,gbits,abits);
+
+ SetU8(t,0);
+
+ t = InsertTag(t,ST_DEFINEBUTTON);
+
+ GetMatrix(NULL,&m);
+
+ m.tx = 3*width;
+ m.ty = 7*height/2;
+
+ SetU16(t,ID_BUTTON); // ID
+ ButtonSetRecord(t,BS_UP,ID_BANNER,1,&m,NULL);
+ ButtonSetRecord(t,BS_DOWN|BS_HIT|BS_OVER,ID_HIGHLIGHT,1,&m,NULL);
+ SetU8(t,0); // End of Button Records
+
+ ActionCompile(t,"if (status==1) { status = 0; stop();} else { status=1; play();}");
+
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+
+ ObjectPlace(t,ID_BUTTON,1,NULL,NULL,NULL);
+
+ t = InsertTag(t,ST_DEFINEBITSJPEG2);
+
+ SetU16(t,ID_BITMAP);
+ SetJPEGBits(t,"eye.jpg",QUALITY);
+
+ t = InsertTag(t,ST_DEFINESHAPE);
+
+ NewShape(&s);
+ rgb.b = rgb.g = rgb.r = 0x00;
+ ls = ShapeAddLineStyle(s,10,&rgb);
+ rgb.b = 0xff;
+
+ m.tx = m.ty = 0;
+ m.r0 = m.r1 = 0;
+ m.sx = m.sy = width<<8;
+
+ fs = ShapeAddBitmapFillStyle(s,&m,ID_BITMAP,0);
+
+ SetU16(t,ID_SHAPE); // ID
+
+ r.xmin = 0; r.ymin = 0;
+ r.xmax = 2*width; r.ymax = 2*height;
+ SetRect(t,&r);
+
+ SetShapeHeader(t,s);
+ ShapeSetAll(t,s,width,0,0,fs,0);
+ ShapeSetLine(t,s,-width,height);
+ ShapeSetStyle(t,s,ls,fs,0);
+ ShapeSetLine(t,s,0,-height);
+ ShapeSetLine(t,s,width,0);
+ ShapeSetEnd(t);
+
+ ShapeFree(s);
+
+ t = InsertTag(t,ST_DEFINESHAPE);
+
+ NewShape(&s);
+ rgb.b = rgb.g = rgb.r = 0x00;
+ ls = ShapeAddLineStyle(s,10,&rgb);
+ rgb.b = 0xff;
+
+ m.tx = m.ty = 0;
+ m.r0 = m.r1 = 0;
+ m.sx = m.sy = -(width<<8);
+
+ fs = ShapeAddBitmapFillStyle(s,&m,ID_BITMAP,0);
+
+ SetU16(t,ID_SHAPE2); // ID
+
+ r.xmin = 0; r.ymin = 0;
+ r.xmax = 2*width; r.ymax = 2*height;
+ SetRect(t,&r);
+
+ SetShapeHeader(t,s);
+ ShapeSetAll(t,s,width,0,0,fs,0);
+ ShapeSetLine(t,s,-width,height);
+ ShapeSetStyle(t,s,ls,fs,0);
+ ShapeSetLine(t,s,0,-height);
+ ShapeSetLine(t,s,width,0);
+ ShapeSetEnd(t);
+
+ ShapeFree(s);
+
+ for (frame=0;frame<256;frame++)
+ { int dc = 3; // whitespace correction
+
+ mapBox(frame<<1,frame<<1,frame);
+ if (SHADE) mapLights(frame<<1,frame<<1,frame);
+
+ t = MapSquare(t,width-dc,height-dc,0,2,3,1,2*width,2*height,0);
+ t = MapSquare(t,width-dc,height-dc,4,5,7,6,2*width,2*height,1);
+ t = MapSquare(t,width-dc,height-dc,0,4,6,2,2*width,2*height,2);
+ t = MapSquare(t,width-dc,height-dc,1,3,7,5,2*width,2*height,3);
+ t = MapSquare(t,width-dc,height-dc,0,1,5,4,2*width,2*height,4);
+ t = MapSquare(t,width-dc,height-dc,2,6,7,3,2*width,2*height,5);
+
+ t = InsertTag(t,ST_SHOWFRAME);
+ }
+ /*
+ t = InsertTag(t,ST_DOACTION);
+
+ ActionCompile(t,"stop();");
+ */
+ t = InsertTag(t,ST_END);
+
+ WriteCGI(&swf);
+ FreeTags(&swf);
+ return 0;
+}
+
+
diff --git a/lib/example/transtest.c b/lib/example/transtest.c
new file mode 100644
index 00000000..647a615f
--- /dev/null
+++ b/lib/example/transtest.c
@@ -0,0 +1,350 @@
+
+// linux/gcc: cc transtest.c ../rfxswf.c -funsigned-char -o transtest -lm -ljpeg; cp transtest /home/www/cgi-bin/transtest
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <math.h>
+#include "../rfxswf.h"
+
+// Box
+
+#define BANNER_TEXT "reflex"
+#define QUALITY 80
+#define ID_FONT 2000
+#define ID_BANNER 2001
+#define ID_HIGHLIGHT 2002
+#define ID_BUTTON 2003
+#define ID_BITMAP 2004
+#define ID_SHAPE 2005
+
+#define a 200
+int sX[] = { a,-a, a,-a, a,-a, a,-a};
+int sY[] = { a, a,-a,-a, a, a,-a,-a};
+int sZ[] = { a, a, a, a,-a,-a,-a,-a};
+#undef a
+
+int dX[8];
+int dY[8];
+
+int sin_[512],cos_[512];
+
+void calcTables()
+{ int i;
+ double d;
+ for (i=0;i<512;i++)
+ { d = ((double)i)/128*3.14159;
+ sin_[i] = (int)(sin(d)*256);
+ cos_[i] = (int)(cos(d)*256);
+ }
+}
+
+void ShapeSquare(LPTAG t,LPSHAPE s,int p1,int p2,int p3,int p4,int dx,int dy)
+{
+ // Hidden-Line-Check
+ if (((dX[p2]-dX[p1])*(dY[p3]-dY[p1])-(dX[p3]-dX[p1])*(dY[p2]-dY[p1]))<0) return;
+
+ ShapeSetMove(t,s,dX[p1]+dx,dY[p1]+dy);
+ ShapeSetLine(t,s,dX[p2]-dX[p1],dY[p2]-dY[p1]);
+ ShapeSetLine(t,s,dX[p3]-dX[p2],dY[p3]-dY[p2]);
+ ShapeSetLine(t,s,dX[p4]-dX[p3],dY[p4]-dY[p3]);
+ ShapeSetLine(t,s,dX[p1]-dX[p4],dY[p1]-dY[p4]);
+}
+
+
+void mapBox(int xw,int yw,int zw)
+{ int i;
+ int x1,y1,z1,x2,y2,z2,x3,y3,z3;
+ int y,x,z;
+
+ xw &= 255;
+ yw &= 255;
+ zw &= 255;
+
+ for (i=0;i<8;i++)
+ { x = sX[i];
+ y = sY[i];
+ z = sZ[i];
+
+ y1 = ( y*cos_[xw]- z*sin_[xw])>>8;
+ z1 = ( y*sin_[xw]+ z*cos_[xw])>>8;
+ x1 = x;
+
+ x2 = (x1*cos_[yw]+z1*sin_[yw])>>8;
+ y2 = y1;
+
+ x3 = (x2*cos_[zw]-y2*sin_[zw])>>8;
+ y3 = (x2*sin_[zw]+y2*cos_[zw])>>8;
+ z3 = (z1*cos_[yw]-x1*sin_[yw])>>8;
+
+ dX[i] = x3*4000/(z3+950);
+ dY[i] = y3*4000/(z3+950);
+
+ }
+}
+
+
+#define S64 long long
+SFIXED SP(SFIXED a1,SFIXED a2,SFIXED b1,SFIXED b2)
+{ S64 a;
+ a = (S64)a1*(S64)b1+(S64)a2*(S64)b2;
+ return (SFIXED)(a>>16);
+}
+SFIXED QFIX(int zaehler,int nenner) // bildet Quotient von zwei INTs in SFIXED
+{ S64 z = zaehler<<16;
+ S64 a = z/(S64)nenner;
+ return (SFIXED)a;
+}
+#undef S64
+
+LPMATRIX MatrixJoin(LPMATRIX d,LPMATRIX s1,LPMATRIX s2)
+{
+ if (!d) return NULL;
+ if (!s1) return (s2)?(LPMATRIX)memcpy(d,s2,sizeof(MATRIX)):NULL;
+ if (!s2) return (LPMATRIX)memcpy(d,s1,sizeof(MATRIX));
+
+ d->tx = s1->tx + s2->tx;
+ d->ty = s1->ty + s2->ty;
+
+ d->sx = SP(s1->sx,s1->r1,s2->sx,s2->r0);
+ d->sy = SP(s1->r0,s1->sy,s2->r1,s2->sy);
+ d->r0 = SP(s1->r0,s1->sy,s2->sx,s2->r0);
+ d->r1 = SP(s1->sx,s1->r1,s2->r1,s2->sy);
+
+ //DumpMatrix(NULL,d);
+
+ return d;
+}
+
+LPMATRIX MatrixMapTriangle(LPMATRIX m,int dx,int dy,int x0,int y0,
+ int x1,int y1,int x2,int y2)
+{ int dx1 = x1 - x0;
+ int dy1 = y1 - y0;
+ int dx2 = x2 - x0;
+ int dy2 = y2 - y0;
+
+ if (!m) return NULL;
+ if ((!dx)||(!dy)) return NULL; // check DIV by zero
+
+ m->tx = x0;
+ m->ty = y0;
+ m->sx = QFIX(dx1,dx);
+ m->sy = QFIX(dy2,dy);
+ m->r0 = QFIX(dy1,dx);
+ m->r1 = QFIX(dx2,dy);
+
+ return m;
+}
+
+int main (int argc,char ** argv)
+{ SWF swf;
+ LPTAG t;
+ RGBA rgb;
+ SRECT r;
+ LPSHAPE s;
+ S32 width = 800,height = 800;
+ U8 gbits,abits;
+ int fs,ls; // line & fillstyle
+ LPSWFFONT font;
+ FONTUSAGE use;
+ LPJPEGBITS jpeg;
+ MATRIX m;
+
+ int f,i,j,frame;
+
+ f = open("Arial.efont",O_RDONLY);
+ if (f>=0)
+ { if (FAILED(FontImport(f,&font)))
+ { fprintf(stderr,"Font import failed\n");
+ close(f);
+ return -1;
+ }
+ }
+ else
+ { fprintf(stderr,"Font not found\n");
+ return -1;
+ }
+ close(f);
+
+ FontSetID(font,ID_FONT);
+ FontInitUsage(&use);
+ FontUse(&use,BANNER_TEXT);
+ FontReduce(font,&use);
+
+ calcTables();
+
+ memset(&swf,0x00,sizeof(SWF));
+
+ swf.FileVersion = 4;
+ swf.FrameRate = 0x4000;
+ swf.MovieSize.xmax = 4*width;
+ swf.MovieSize.ymax = 4*height;
+
+ swf.FirstTag = InsertTag(NULL,ST_SETBACKGROUNDCOLOR);
+ t = swf.FirstTag;
+
+ rgb.r = 0xff;
+ rgb.g = 0xff;
+ rgb.b = 0xff;
+ SetRGB(t,&rgb);
+
+ t = InsertTag(t,ST_DEFINEFONT);
+
+ FontSetDefine(t,font);
+
+ t = InsertTag(t,ST_DEFINEFONTINFO);
+
+ FontSetInfo(t,font);
+
+ t = InsertTag(t,ST_DEFINETEXT);
+
+ SetU16(t,ID_BANNER); // ID
+
+ r.xmin = 0;
+ r.ymin = 0;
+ r.xmax = 400;
+ r.ymax = 400;
+ SetRect(t,&r);
+
+ SetMatrix(t,NULL);
+
+ TextCountBits(font,BANNER_TEXT,80,&gbits,&abits);
+
+ SetU8(t,gbits);
+ SetU8(t,abits);
+
+ rgb.r = 0xc0;
+ rgb.g = 0xc0;
+ rgb.b = 0xc0;
+
+ TextSetInfoRecord(t,font,height/4,&rgb,0,200);
+ TextSetCharRecord(t,font,BANNER_TEXT,80,gbits,abits);
+
+ SetU8(t,0);
+
+ t = InsertTag(t,ST_DEFINETEXT);
+
+ SetU16(t,ID_HIGHLIGHT); // ID
+
+ r.xmin = 0;
+ r.ymin = 0;
+ r.xmax = 800;
+ r.ymax = 400;
+ SetRect(t,&r);
+
+ SetMatrix(t,NULL);
+
+ TextCountBits(font,BANNER_TEXT,80,&gbits,&abits);
+
+ SetU8(t,gbits);
+ SetU8(t,abits);
+
+ rgb.r = 0x20;
+ rgb.g = 0x20;
+ rgb.b = 0x20;
+
+ TextSetInfoRecord(t,font,height/4,&rgb,0,200);
+ TextSetCharRecord(t,font,BANNER_TEXT,80,gbits,abits);
+
+ SetU8(t,0);
+
+ t = InsertTag(t,ST_DEFINEBUTTON);
+
+ GetMatrix(NULL,&m);
+
+ m.tx = 3*width;
+ m.ty = 7*height/2;
+
+ SetU16(t,ID_BUTTON); // ID
+ ButtonSetRecord(t,BS_UP,ID_BANNER,1,&m,NULL);
+ ButtonSetRecord(t,BS_DOWN|BS_HIT|BS_OVER,ID_HIGHLIGHT,1,&m,NULL);
+ SetU8(t,0); // End of Button Records
+ SetU8(t,0); // End of Action Records
+
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+
+ ObjectPlace(t,ID_BUTTON,1,NULL,NULL,NULL);
+
+ t = InsertTag(t,ST_DEFINEBITSJPEG2);
+
+ SetU16(t,ID_BITMAP);
+ SetJPEGBits(t,"eye.jpg",QUALITY);
+
+ t = InsertTag(t,ST_DEFINESHAPE);
+
+ NewShape(&s);
+ rgb.b = rgb.g = rgb.r = 0x00;
+ // ls = ShapeAddLineStyle(s,40,&rgb);
+ ls = 0;
+ rgb.b = 0xff;
+
+ fs = ShapeAddBitmapFillStyle(s,&m,ID_BITMAP,0);
+
+ SetU16(t,ID_SHAPE); // ID
+
+ r.xmin = 0;
+ r.ymin = 0;
+ r.xmax = 2*width;
+ r.ymax = 2*height;
+
+ SetRect(t,&r);
+
+ SetShapeHeader(t,s);
+
+ ShapeSetAll(t,s,0,0,ls,fs,0);
+ ShapeSetLine(t,s,width,0);
+ ShapeSetLine(t,s,-width,height);
+ ShapeSetLine(t,s,0,-height);
+ ShapeSetEnd(t);
+
+ ShapeFree(s);
+
+
+ for (frame=0;frame<64;frame++)
+ { /*MATRIX m1,m2;
+
+ m1.sy = m1.sx = (int)(cos(((float)(frame))/32*3.141)*0x10000);
+ m1.r0 = (int)(sin(((float)(frame))/32*3.141)*0x10000);
+ m1.r1 = -m1.r0;
+ m1.tx = width+frame*4; m1.ty = height;
+
+ m2.sy = m2.sx = (int)(cos(((float)(64-frame))/32*3.141)*0x10000);
+ m2.r0 = (int)(sin(((float)(64-frame))/32*3.141)*0x10000);
+ m2.r1 = -m2.r0;
+ m2.tx = width; m2.ty = height;
+
+ MatrixJoin(&m,&m1,&m2); */
+
+ int dx0 = width; // Konstanten der Shapes
+ int dy0 = width;
+
+ int px0 = 2*width; // Zielpunkte des Mappings
+ int py0 = 2*width;
+
+ int px1 = 3*width;
+ int py1 = 2*width-frame*4;
+
+ int px2 = 2*width-frame*8;
+ int py2 = 3*width;
+
+ MatrixMapTriangle(&m,dx0,dy0,px0,py0,px1,py1,px2,py2);
+
+ t = InsertTag(t,ST_PLACEOBJECT2);
+
+ if (!frame)
+ ObjectPlace(t,ID_SHAPE,1,&m,NULL,NULL);
+ else
+ ObjectMove(t,1,&m,NULL);
+
+ t = InsertTag(t,ST_SHOWFRAME);
+ }
+
+
+ t = InsertTag(t,ST_END);
+
+ WriteCGI(&swf);
+ FreeTags(&swf);
+ return 0;
+}
+
+
diff --git a/lib/log.c b/lib/log.c
new file mode 100644
index 00000000..6c705ee1
--- /dev/null
+++ b/lib/log.c
@@ -0,0 +1,252 @@
+/* log.c
+ Logging facilities for displaying information on screen, as well as
+ (optional) storing it to a file and transmitting it over the network.
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#ifdef __NT__
+#include "stdafx.h"
+#include <string.h>
+#include <winsock2.h>
+#include <stdlib.h>
+#include <malloc.h>
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+#else
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <unistd.h>
+#endif
+
+#include "log.h"
+
+#define LOGLEVEL_FATAL 0
+#define LOGLEVEL_ERROR 1
+#define LOGLEVEL_WARNING 2
+#define LOGLEVEL_NOTICE 3
+#define LOGLEVEL_VERBOSE 4
+#define LOGLEVEL_DEBUG 5
+
+int screenloglevel;
+int fileloglevel;
+int socketloglevel;
+FILE *logFile = 0;
+#ifdef __NT__
+SOCKET logSocket;
+#else
+int logSocket = 0;
+#endif
+
+char bLogToSock = 0;
+
+void initlogSocket(char* servAddr, char* logPort);
+
+void initLog(char* pLogName, int fileloglevel, char* servAddr, char* logPort, int serverlevel, int screenlevel)
+{
+ screenloglevel = screenlevel;
+ fileloglevel = fileloglevel;
+ socketloglevel = screenlevel;
+ logFile = NULL;
+ bLogToSock = 0;
+
+ if (pLogName && fileloglevel>=0)
+ logFile = fopen(pLogName, "a+");
+ bLogToSock = (servAddr && logPort && (serverlevel>=0));
+ if(bLogToSock)
+ initlogSocket(servAddr, logPort);
+}
+
+void initlogSocket(char* servAddr, char* logPort)
+{
+#ifndef __NT__
+ bLogToSock = 0;
+#else
+ // init winsock
+ // check and prepare WinSock DLL
+ WORD wVersionRequested = MAKEWORD( 2, 2 );
+ WSADATA wsaData;
+ if ( WSAStartup(wVersionRequested, &wsaData) != 0 )
+ {
+ bLogToSock = false;
+ return;
+ }
+ // Confirm that the WinSock DLL supports 2.2.
+ // Note that if the DLL supports versions greater
+ // than 2.2 in addition to 2.2, it will still return
+ // 2.2 in wVersion since that is the version we
+ // requested.
+
+ if ( LOBYTE( wsaData.wVersion ) != 2 || HIBYTE( wsaData.wVersion ) != 2 )
+ {
+ bLogToSock = false;
+ return;
+ }
+
+ struct hostent *hp;
+ hp = gethostbyname(servAddr);
+ if (hp == NULL) // we don't know who this host is
+ {
+ bLogToSock = false;
+ return;
+ }
+
+ // connect socket
+ sockaddr_in SocketAddress;
+
+ memset(&SocketAddress, 0, sizeof(SocketAddress));
+ memcpy((char*)&SocketAddress.sin_addr, hp->h_addr, hp->h_length); // set address
+ SocketAddress.sin_family = hp->h_addrtype;
+ SocketAddress.sin_port = htons((u_short)atoi(logPort));
+
+ logSocket = socket(hp->h_addrtype, SOCK_STREAM, 0);
+ if (logSocket == INVALID_SOCKET)
+ {
+ bLogToSock = false;
+ return;
+ }
+
+ // try to connect to the specified socket
+ if ( connect(logSocket, (struct sockaddr*)&SocketAddress, sizeof (SocketAddress)) == SOCKET_ERROR) {
+ bLogToSock = false;
+ return;
+ }
+ bLogToSock = true;
+#endif
+}
+
+void exitLog()
+{
+ // close socket communication
+ if(bLogToSock)
+#ifndef __NT__
+ close(logSocket);
+#else
+ closesocket(logSocket);
+#endif
+ // close file
+ if(logFile != NULL)
+ fclose(logFile);
+}
+
+
+static char * logimportance[]= {"Fatal","Error","Warning","Notice","Verbose","Debug"};
+static int loglevels=6;
+static char * logimportance2[]= {" ","FATAL ","ERROR ","WARNING","NOTICE ","VERBOSE","DEBUG "};
+void log(char* logString)
+{
+ char timebuffer[32];
+ char* logBuffer;
+ char dbuffer[9];
+ char tbuffer[9];
+ int level;
+ char*lt;
+ char*gt;
+ int l;
+
+ logBuffer = (char*)malloc (strlen(logString) + 24 + 15);
+#ifndef __NT__
+ {
+ /*time_t t = time(0);
+ tm*t2 = localtime(t);
+ strftime(dbuffer, 8, "%m %d", t2);
+ strftime(tbuffer, 8, "%m %d", t2);
+ dbuffer[0]=0; //FIXME
+ tbuffer[0]=0;*/
+ time_t t = time(0);
+ char* a = ctime(&t);
+ int l = strlen(a);
+ while(a[l-1] == 13 || a[l-1] == 10)
+ l--;
+ a[l]=0;
+ sprintf(timebuffer, "%s", a);
+ }
+#else
+ _strdate( dbuffer );
+ _strtime( tbuffer );
+ sprintf(timebuffer, "%s - %s",dbuffer,tbuffer);
+#endif
+
+ // search for <level> field
+ level = -1;
+ lt=strchr(logString, '<');
+ gt=strchr(logString, '>');
+ if(lt && gt && lt<gt)
+ {
+ int t;
+ for(t=0;t<loglevels;t++)
+ {
+#ifndef __NT__
+ if(!strncasecmp(lt+1,logimportance[t],strlen(logimportance[t])))
+#else
+ if(!strnicmp(lt+1,logimportance[t],strlen(logimportance[t])))
+#endif
+ {
+ logString = gt+1;
+ while(logString[0]==' ') logString ++;
+ level = t;
+ break;
+ }
+ }
+ }
+
+// sprintf(logBuffer, "%s: %s %s", timebuffer, logimportance2[level + 1],logString);
+ sprintf(logBuffer, "%s %s", logimportance2[level + 1],logString);
+
+ // we always do exactly one newline.
+
+ l=strlen(logBuffer)-1;
+ while((logBuffer[l]==13 || logBuffer[l]==10) && l>=0)
+ {
+ logBuffer[l]=0;
+ l--;
+ }
+
+ if (level <= screenloglevel)
+ {
+ printf("%s\n", logBuffer);
+ fflush(stdout);
+ }
+
+ if (level <= fileloglevel)
+ {
+ if (logFile != NULL)
+ {
+ fprintf(logFile, "%s\n", logBuffer);
+ fflush(logFile);
+ }
+ }
+
+ if (level <= socketloglevel)
+ {
+ if (bLogToSock)
+ {
+ // send data
+#ifndef __NT__
+ write(logSocket, logBuffer, strlen(logBuffer));
+#else
+ send(logSocket, logBuffer, strlen(logBuffer), 0);
+#endif
+ }
+ }
+ free (logBuffer);
+}
+
+void logf(const char* pszFormat, ...)
+{
+ char buf[1024];
+ va_list arglist;
+ va_start(arglist, pszFormat);
+ buf[0] = 0;
+ vsprintf(&buf[strlen(buf)], pszFormat, arglist);
+ va_end(arglist);
+ strcat(buf, "\n");
+ log(buf);
+}
+
diff --git a/lib/log.h b/lib/log.h
new file mode 100644
index 00000000..e3fbc2dc
--- /dev/null
+++ b/lib/log.h
@@ -0,0 +1,39 @@
+/* log.h
+ Header file for log.c.
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#ifndef __log_h__
+#define __log_h__
+
+#ifdef __NT__
+#include "stdafx.h"
+#include <time.h>
+#include <windef.h>
+#else
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+#endif
+
+#define LOGLEVEL_FATAL 0
+#define LOGLEVEL_ERROR 1
+#define LOGLEVEL_WARNING 2
+#define LOGLEVEL_NOTICE 3
+#define LOGLEVEL_VERBOSE 4
+#define LOGLEVEL_DEBUG 5
+
+extern int screenloglevel;
+extern int socketloglevel;
+extern int fileloglevel;
+
+extern void initLog(char* pLogDir, int fileloglevel, char* servAddr, char* logPort, int serverloglevel, int screenloglevel);
+extern void log(char* logString);
+extern void logf(const char* logFormat, ...);
+extern void exitLog(void);
+
+#endif // __log_h__
diff --git a/lib/modules/swfbits.c b/lib/modules/swfbits.c
new file mode 100644
index 00000000..05b21fb6
--- /dev/null
+++ b/lib/modules/swfbits.c
@@ -0,0 +1,152 @@
+/* swfbits.c
+
+ Bitmap functions (needs libjpeg)
+
+ Extension module for the rfxswf library.
+ Part of the swftools package.
+
+ Copyright (c) 2000, 2001 Rainer Böhme <rfxswf@reflex-studio.de>
+
+ This file is distributed under the GPL, see file COPYING for details
+
+*/
+
+#ifdef _JPEGLIB_INCLUDED_
+#define OUTBUFFER_SIZE 32768
+
+typedef struct _JPEGDESTMGR
+{ struct jpeg_destination_mgr mgr;
+ LPTAG t;
+ JOCTET * buffer;
+ struct jpeg_compress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+} JPEGDESTMGR, * LPJPEGDESTMGR;
+
+// Destination manager callbacks
+
+void swf_init_destination(j_compress_ptr cinfo)
+{ LPJPEGDESTMGR dmgr = (LPJPEGDESTMGR)cinfo->dest;
+ dmgr->buffer = (JOCTET*)malloc(OUTBUFFER_SIZE);
+ dmgr->mgr.next_output_byte = dmgr->buffer;
+ dmgr->mgr.free_in_buffer = OUTBUFFER_SIZE;
+}
+
+boolean swf_empty_output_buffer(j_compress_ptr cinfo)
+{ LPJPEGDESTMGR dmgr = (LPJPEGDESTMGR)cinfo->dest;
+ SetBlock(dmgr->t,
+ (U8*)dmgr->buffer,
+ OUTBUFFER_SIZE-dmgr->mgr.free_in_buffer);
+ dmgr->mgr.next_output_byte = dmgr->buffer;
+ dmgr->mgr.free_in_buffer = OUTBUFFER_SIZE;
+}
+
+void swf_term_destination(j_compress_ptr cinfo)
+{ LPJPEGDESTMGR dmgr = (LPJPEGDESTMGR)cinfo->dest;
+ swf_empty_output_buffer(cinfo);
+ free(dmgr->buffer);
+ dmgr->mgr.free_in_buffer = 0;
+}
+
+LPJPEGBITS SetJPEGBitsStart(LPTAG t,int width,int height,int quality)
+{
+ LPJPEGDESTMGR jpeg;
+
+ // redirect compression lib output to local SWF Tag structure
+
+ jpeg = (LPJPEGDESTMGR)malloc(sizeof(JPEGDESTMGR));
+ if (!jpeg) return NULL;
+
+ memset(jpeg,0x00,sizeof(JPEGDESTMGR));
+ jpeg->cinfo.err = jpeg_std_error(&jpeg->jerr);
+
+ jpeg_create_compress(&jpeg->cinfo);
+
+ jpeg->mgr.init_destination = swf_init_destination;
+ jpeg->mgr.empty_output_buffer = swf_empty_output_buffer;
+ jpeg->mgr.term_destination = swf_term_destination;
+
+ jpeg->t = t;
+
+ jpeg->cinfo.dest = (struct jpeg_destination_mgr *)jpeg;
+
+ // init compression
+
+ jpeg->cinfo.image_width = width;
+ jpeg->cinfo.image_height = height;
+ jpeg->cinfo.input_components = 3;
+ jpeg->cinfo.in_color_space = JCS_RGB;
+
+ jpeg_set_defaults(&jpeg->cinfo);
+ jpeg_set_quality(&jpeg->cinfo,quality,TRUE);
+
+ // write tables to SWF
+
+ jpeg_write_tables(&jpeg->cinfo);
+
+ // compess image to SWF
+
+ jpeg_suppress_tables(&jpeg->cinfo, TRUE);
+ jpeg_start_compress(&jpeg->cinfo, FALSE);
+
+ return (LPJPEGBITS)jpeg;
+}
+
+int SetJPEGBitsLines(LPJPEGBITS jpegbits,U8 ** data,int n)
+{ LPJPEGDESTMGR jpeg = (LPJPEGDESTMGR)jpegbits;
+ if (!jpeg) return -1;
+ jpeg_write_scanlines(&jpeg->cinfo,data,n);
+ return 0;
+}
+
+int SetJPEGBitsLine(LPJPEGBITS jpegbits,U8 * data)
+{ return SetJPEGBitsLines(jpegbits,&data,1);
+}
+
+int SetJPEGBitsFinish(LPJPEGBITS jpegbits)
+{ LPJPEGDESTMGR jpeg = (LPJPEGDESTMGR)jpegbits;
+ if (!jpeg) return -1;
+ jpeg_finish_compress(&jpeg->cinfo);
+ free(jpeg);
+ return 0;
+}
+
+int SetJPEGBits(LPTAG t,char * fname,int quality)
+{ struct jpeg_decompress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+ LPJPEGBITS out;
+ FILE * f;
+ U8 * scanline;
+
+ cinfo.err = jpeg_std_error(&jerr);
+ jpeg_create_decompress(&cinfo);
+
+ if ((f=fopen(fname,"rb"))==NULL) return -1;
+
+
+ jpeg_stdio_src(&cinfo,f);
+ jpeg_read_header(&cinfo, TRUE);
+ jpeg_start_decompress(&cinfo);
+
+ out = SetJPEGBitsStart(t,cinfo.output_width,cinfo.output_height,quality);
+ scanline = (U8*)malloc(4*cinfo.output_width);
+
+ if (scanline)
+ { int y;
+ U8 * js = scanline;
+ for (y=0;y<cinfo.output_height;y++)
+ { jpeg_read_scanlines(&cinfo,&js,1);
+ SetJPEGBitsLines(out,(U8**)&js,1);
+ }
+ }
+
+ SetJPEGBitsFinish(out);
+ jpeg_finish_decompress(&cinfo);
+ fclose(f);
+
+ return 0;
+}
+
+#undef OUTBUFFER_SIZE
+#endif
+
+// insert zlib/PNG functions here
diff --git a/lib/modules/swfbutton.c b/lib/modules/swfbutton.c
new file mode 100644
index 00000000..23bd3c77
--- /dev/null
+++ b/lib/modules/swfbutton.c
@@ -0,0 +1,92 @@
+/* swfbutton.c
+
+ Button functions
+
+ Extension module for the rfxswf library.
+ Part of the swftools package.
+
+ Copyright (c) 2000, 2001 Rainer Böhme <rfxswf@reflex-studio.de>
+
+ This file is distributed under the GPL, see file COPYING for details
+
+*/
+
+int ButtonSetRecord(LPTAG t,U8 state,U16 id,U16 layer,LPMATRIX m,LPCXFORM cx)
+
+{ SetU8(t,state);
+ SetU16(t,id);
+ SetU16(t,layer);
+ SetMatrix(t,m);
+// SetCXForm(t,cx,0);
+ return 0;
+}
+
+int ButtonSetCondition(LPTAG t,U16 condition)
+{ SetU16(t,0); // dummy for Action Offset -> later set by ButtonPostProcess
+ SetU16(t,condition);
+ return 0;
+}
+
+int ButtonSetFlags(LPTAG t,U8 flags)
+{ if (GetTagID(t)==ST_DEFINEBUTTON2)
+ { SetU8(t,flags);
+ SetU16(t,0); // dummy for Action Offset -> later set by ButtonPostProcess
+ }
+ return 0;
+}
+
+void SetButtonOffset(LPTAG t,U32 offsetpos)
+{ U32 now = GetTagPos(t);
+ U16 diff = now-offsetpos;
+ SetTagPos(t,offsetpos);
+ t->data[t->pos++] = (U8)(diff&0xff);
+ t->data[t->pos++] = (U8)(diff>>8);
+ SetTagPos(t,now);
+}
+
+int ButtonPostProcess(LPTAG t,int anz_action)
+{ if (GetTagID(t)==ST_DEFINEBUTTON2)
+ { U32 oldTagPos;
+ U32 offsetpos;
+
+ oldTagPos = GetTagPos(t);
+
+ // scan DefineButton2 Record
+
+ GetU16(t); // Character ID
+ GetU8(t); // Flags;
+
+ offsetpos = GetTagPos(t); // first offset
+ GetU16(t);
+
+ while (GetU8(t)) // state -> parse ButtonRecord
+ { GetU16(t); // id
+ GetU16(t); // layer
+ GetMatrix(t,NULL); // matrix
+ // evtl.: CXForm
+ }
+
+ SetButtonOffset(t,offsetpos);
+
+ while(anz_action)
+ { U8 a;
+
+ offsetpos = GetTagPos(t); // offset
+ GetU16(t);
+
+ GetU16(t); // condition
+
+ while (a=GetU8(t)) // skip action records
+ { if (a&0x80)
+ { U16 l = GetU16(t);
+ GetBlock(t,NULL,l);
+ }
+ }
+
+ if (--anz_action) SetButtonOffset(t,offsetpos);
+ }
+
+ SetTagPos(t,oldTagPos);
+ }
+ return 0;
+}
diff --git a/lib/modules/swfcgi.c b/lib/modules/swfcgi.c
new file mode 100644
index 00000000..98e5f032
--- /dev/null
+++ b/lib/modules/swfcgi.c
@@ -0,0 +1,179 @@
+/* swfcgi.c
+
+ Parse CGI parameters
+
+ Partly adopted from Steven Grimm's uncgi tool and library.
+
+ Extension module for the rfxswf library.
+ Part of the swftools package.
+
+ Copyright (c) 2001 Rainer Böhme <rfxswf@reflex-studio.de>
+
+ This file is distributed under the GPL, see file COPYING for details
+
+*/
+
+
+#define ishex(x) (((x) >= '0' && (x) <= '9') || ((x) >= 'a' && (x) <= 'f') || ((x) >= 'A' && (x) <= 'F'))
+
+#define PREFIX "WWW_"
+
+static int htoi(unsigned char * s)
+{ int value;
+ char c;
+
+ c = s[0];
+ if (isupper(c)) c = tolower(c);
+ value = (c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10) * 16;
+
+ c = s[1];
+ if (isupper(c)) c = tolower(c);
+ value += c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10;
+
+ return (value);
+}
+
+static void url_unescape(unsigned char * s)
+{ unsigned char *dest = s;
+
+ while (s[0])
+ { if (s[0] == '+') dest[0] = ' ';
+ else
+ { if (s[0] == '%' && ishex(s[1]) && ishex(s[2]))
+ { dest[0] = (unsigned char) htoi(s + 1);
+ s += 2;
+ }
+ else dest[0] = s[0];
+ }
+ s++;dest++;
+ }
+ dest[0] = 0;
+}
+
+static void cgienv(unsigned char * var)
+{ unsigned char *buf, *c, *s, *t, *oldval = NULL, *newval;
+ int despace = 0, got_cr = 0;
+
+ // fprintf(stderr,"%s\n",var);
+ url_unescape(var);
+ // fprintf(stderr,"%s\n",var);
+
+
+ buf = (unsigned char*)malloc(strlen(var) + sizeof(PREFIX) + 2);
+ if (!buf) return;
+
+ strcpy(buf, PREFIX);
+ if (var[0] == '_')
+ { strcpy(&buf[sizeof(PREFIX)-1], &var[1]);
+ despace = 1;
+ }
+ else strcpy(&buf[sizeof(PREFIX)-1], var);
+
+ for (c = buf; c[0] ; c++)
+ { if (c[0] == '.') c[0] = '_';
+ if (c[0] == '=') break;
+ }
+ if (!c[0]) c[1] = 0;
+ c[0] = 0;
+
+ if (despace && c[1])
+ { for (s = c+1; s[0] && isspace(s[0]); s++);
+ t = c + 1;
+ while (s[0])
+ { if (s[0] == '\r')
+ { got_cr = 1;
+ s++;
+ continue;
+ }
+ if (got_cr)
+ { if (s[0] != '\n')
+ *t++ = '\n';
+ got_cr = 0;
+ }
+ *t++ = *s++;
+ }
+ while (t > c && isspace(*--t));
+ t[1] = 0;
+ }
+
+ if ((oldval = getenv(buf)))
+ { newval = (unsigned char*)malloc(strlen(oldval) + strlen(buf) + strlen(&c[1]) + 3);
+ if (!newval) return;
+
+ c[0] = '=';
+ sprintf(newval, "%s#%s", buf, oldval);
+ c[0] = 0;
+
+ oldval -= strlen(buf) + 1; // skip past VAR=
+ }
+ else
+ { c[0] = '=';
+ newval = buf;
+ }
+
+ putenv(newval);
+
+ if (oldval)
+ { free(oldval);
+ free(buf);
+ }
+}
+
+static void scanquery(char * q)
+{ char *next = q;
+ if (!q) return;
+
+ while (next)
+ { next = strchr(q, '&');
+ if (next) next[0] = 0;
+ cgienv(q);
+ if (next)
+ { next[0] = '&';
+ q = next+1;
+ }
+ }
+}
+
+char * postread()
+{ char * buf = NULL;
+ int size = 0, sofar = 0, got;
+
+ buf = getenv("CONTENT_TYPE");
+ if ((!buf) || strcmp(buf, "application/x-www-form-urlencoded")) return NULL;
+
+ buf = getenv("CONTENT_LENGTH");
+ if (!buf) return NULL;
+
+ size = atoi(buf);
+ buf = (unsigned char*)malloc(size + 1);
+ if (buf)
+ { do
+ { got = fread(buf + sofar, 1, size - sofar, stdin);
+ sofar += got;
+ } while (got && sofar < size);
+ buf[sofar] = 0;
+ }
+
+ return buf;
+}
+
+void uncgi()
+{ char *query, *dupquery, *method;
+
+ query = getenv("QUERY_STRING");
+ if ((query) && strlen(query))
+ { dupquery = strdup(query);
+ scanquery(dupquery);
+ free(dupquery);
+ }
+
+ method = getenv("REQUEST_METHOD");
+ if ((method) && ! strcmp(method, "POST"))
+ { query = postread();
+ if ((query)&&(query[0]!=0)) scanquery(query);
+ free(query);
+ }
+
+}
+
+#undef ishex
diff --git a/lib/modules/swfdump.c b/lib/modules/swfdump.c
new file mode 100644
index 00000000..12b3fdfe
--- /dev/null
+++ b/lib/modules/swfdump.c
@@ -0,0 +1,131 @@
+/* swfdump.c
+
+ Dump / debug functions
+
+ Extension module for the rfxswf library.
+ Part of the swftools package.
+
+ Copyright (c) 2001 Rainer Böhme <rfxswf@reflex-studio.de>
+
+ This file is distributed under the GPL, see file COPYING for details
+
+*/
+
+void DumpHeader(FILE * f,LPSWF swf)
+{ if (!f) f = stderr;
+ fprintf(f,"File size\t%u\n",swf->FileSize);
+ fprintf(f,"Movie width\t%u\n",(swf->MovieSize.xmax - swf->MovieSize.xmin)/20);
+ fprintf(f,"Movie height\t%u\n",(swf->MovieSize.ymax - swf->MovieSize.ymin)/20);
+ fprintf(f,"Frame rate\t%u.%u\n",swf->FrameRate>>8,swf->FrameRate&0xff);
+ fprintf(f,"Frame count\t%u\n",swf->FrameCount);
+}
+
+void DumpMatrix(FILE * f,LPMATRIX m)
+{ if (!f) f = stderr;
+ fprintf(f,"[%08x][%08x]\n",m->sx,m->r1);
+ fprintf(f,"[%08x][%08x]\n",m->r0,m->sy);
+ fprintf(f," %08x, %08x\n",m->tx,m->ty);
+}
+
+void DumpTag(FILE * f,LPTAG t)
+{ int i;
+ if (!f) f = stderr;
+ for (i=0;i<t->len;i++)
+ { if (!(i&15)) fprintf(f,"\n");
+ fprintf(f,"%02x ",t->data[i]);
+ }
+ fprintf(f,"\n");
+}
+
+char* getTagName(TAG*tag)
+{
+ switch(tag->id)
+ {
+ case ST_END:
+ return "END";
+ case ST_SHOWFRAME:
+ return "SHOWFRAME";
+ case ST_DEFINESHAPE:
+ return "DEFINESHAPE";
+ case ST_FREECHARACTER:
+ return "FREECHARACTER";
+ case ST_PLACEOBJECT:
+ return "PLACEOBJECT";
+ case ST_REMOVEOBJECT:
+ return "REMOVEOBJECT";
+ case ST_DEFINEBITS:
+ return "DEFINEBITS";
+ case ST_DEFINEBUTTON:
+ return "DEFINEBUTTON";
+ case ST_JPEGTABLES:
+ return "JPEGTABLES";
+ case ST_SETBACKGROUNDCOLOR:
+ return "SETBACKGROUNDCOLOR";
+ case ST_DEFINEFONT:
+ return "DEFINEFONT";
+ case ST_DEFINETEXT:
+ return "DEFINETEXT";
+ case ST_DOACTION:
+ return "DOACTION";
+ case ST_DEFINEFONTINFO:
+ return "DEFINEFONTINFO";
+ case ST_DEFINESOUND:
+ return "DEFINESOUND";
+ case ST_STARTSOUND:
+ return "STARTSOUND";
+ case ST_DEFINEBUTTONSOUND:
+ return "DEFINEBUTTONSOUND";
+ case ST_SOUNDSTREAMHEAD:
+ return "SOUNDSTREAMHEAD";
+ case ST_SOUNDSTREAMBLOCK:
+ return "SOUNDSTREAMBLOCK";
+ case ST_DEFINEBITSLOSSLESS:
+ return "DEFINEBITSLOSSLESS";
+ case ST_DEFINEBITSJPEG2:
+ return "DEFINEBITSJPEG2";
+ case ST_DEFINESHAPE2:
+ return "DEFINESHAPE2";
+ case ST_DEFINEBUTTONCXFORM:
+ return "DEFINEBUTTONCXFORM";
+ case ST_PROTECT:
+ return "PROTECT";
+ case ST_PLACEOBJECT2:
+ return "PLACEOBJECT2";
+ case ST_REMOVEOBJECT2:
+ return "REMOVEOBJECT2";
+ case ST_DEFINESHAPE3:
+ return "DEFINESHAPE3";
+ case ST_DEFINETEXT2:
+ return "DEFINETEXT2";
+ case ST_DEFINEBUTTON2:
+ return "DEFINEBUTTON2";
+ case ST_DEFINEBITSJPEG3:
+ return "DEFINEBITSJPEG3";
+ case ST_DEFINEBITSLOSSLESS2:
+ return "DEFINEBITSLOSSLESS2";
+ case ST_DEFINESPRITE:
+ return "DEFINESPRITE";
+ case ST_NAMECHARACTER:
+ return "NAMECHARACTER";
+ case ST_SERIALNUMBER:
+ return "SERIALNUMBER";
+ case ST_GENERATORTEXT:
+ return "GENERATORTEXT";
+ case ST_FRAMELABEL:
+ return "FRAMELABEL";
+ case ST_SOUNDSTREAMHEAD2:
+ return "SOUNDSTREAMHEAD2";
+ case ST_DEFINEMORPHSHAPE:
+ return "DEFINEMORPHSHAPE";
+ case ST_DEFINEFONT2:
+ return "DEFINEFONT2";
+ case ST_TEMPLATECOMMAND:
+ return "TEMPLATECOMMAND";
+ case ST_GENERATOR3:
+ return "GENERATOR3";
+ case ST_EXTERNALFONT:
+ return "EXTERNALFONT";
+ case ST_REFLEX:
+ return "REFLEX";
+ }
+}
diff --git a/lib/modules/swfobject.c b/lib/modules/swfobject.c
new file mode 100644
index 00000000..132f1169
--- /dev/null
+++ b/lib/modules/swfobject.c
@@ -0,0 +1,59 @@
+/* swfobject.c
+
+ Object place and move routines
+
+ Extension module for the rfxswf library.
+ Part of the swftools package.
+
+ Copyright (c) 2001 Rainer Böhme <rfxswf@reflex-studio.de>
+
+ This file is distributed under the GPL, see file COPYING for details
+
+*/
+
+#define PF_MOVE 0x01
+#define PF_CHAR 0x02
+#define PF_MATRIX 0x04
+#define PF_CXFORM 0x08
+#define PF_RATIO 0x10
+#define PF_NAME 0x20
+#define PF_CLIPACTION 0x40
+
+int ObjectPlace(LPTAG t,U16 id,U16 depth,LPMATRIX m,LPCXFORM cx,U8 * name)
+{ U8 flags;
+ if (!t) return -1;
+
+ flags = (id?PF_CHAR:0)|(m?PF_MATRIX:0)|(cx?PF_CXFORM:0)|(name?PF_NAME:0)|((m||cx)&&(!id)?PF_MOVE:0);
+
+ SetU8(t,flags);
+ SetU16(t,depth);
+ if (flags&PF_CHAR) SetU16(t,id);
+ if (flags&PF_MATRIX) SetMatrix(t,m);
+ if (flags&PF_CXFORM) SetCXForm(t,cx,(cx->a0!=256)||(cx->a1));
+ if (flags&PF_RATIO) SetU16(t,0);
+ if (flags&PF_NAME) SetString(t,name);
+
+ return 0;
+}
+
+int PlaceObject(LPTAG t,U16 id,U16 depth,LPMATRIX m,LPCXFORM cx,U8 * name, U16 clipaction)
+{ U8 flags;
+ if (!t) return -1;
+
+ flags = (id?PF_CHAR:0)|(m?PF_MATRIX:0)|(cx?PF_CXFORM:0)|(name?PF_NAME:0)|
+ ((m||cx)&&(!id)?PF_MOVE:0)|(clipaction?PF_CLIPACTION:0);
+
+ SetU8(t,flags);
+ SetU16(t,depth);
+ if (flags&PF_CHAR) SetU16(t,id);
+ if (flags&PF_MATRIX) SetMatrix(t,m);
+ if (flags&PF_CXFORM) SetCXForm(t,cx,(cx->a0!=256)||(cx->a1));
+ if (flags&PF_RATIO) SetU16(t,0);
+ if (flags&PF_NAME) SetString(t,name);
+ if (flags&PF_CLIPACTION) SetU16(t, clipaction);
+ return 0;
+}
+
+int ObjectMove(LPTAG t,U16 depth,LPMATRIX m,LPCXFORM cx)
+{ return ObjectPlace(t,0,depth,m,cx,NULL);
+}
diff --git a/lib/modules/swfshape.c b/lib/modules/swfshape.c
new file mode 100644
index 00000000..c09f30d9
--- /dev/null
+++ b/lib/modules/swfshape.c
@@ -0,0 +1,523 @@
+/* swfshape.c
+
+ shape functions
+
+ Extension module for the rfxswf library.
+ Part of the swftools package.
+
+ Copyright (c) 2001 Rainer Böhme <rfxswf@reflex-studio.de>
+
+ This file is distributed under the GPL, see file COPYING for details
+
+*/
+
+#define SF_MOVETO 0x01
+#define SF_FILL0 0x02
+#define SF_FILL1 0x04
+#define SF_LINE 0x08
+#define SF_NEWSTYLE 0x10
+
+#define FILL_SOLID 0x00
+#define FILL_LINEAR 0x10 // Gradient
+#define FILL_RADIAL 0x12
+#define FILL_TILED 0x40 // Bitmap
+#define FILL_CLIPPED 0x41
+
+void ShapeFree(LPSHAPE s)
+{ if (s)
+ { if (s->linestyle.data) free(s->linestyle.data);
+ s->linestyle.data = NULL;
+ s->linestyle.n = 0;
+ if (s->fillstyle.data) free(s->fillstyle.data);
+ s->fillstyle.data = NULL;
+ s->fillstyle.n = 0;
+ if (s->data) free(s->data);
+ s->data = NULL;
+ }
+ free(s);
+}
+
+int NewShape(LPSHAPE * s)
+{ LPSHAPE sh;
+ if (!s) return -1;
+ sh = (LPSHAPE)malloc(sizeof(SHAPE)); s[0] = sh;
+ if (sh) memset(sh,0x00,sizeof(SHAPE));
+ return sh?0:-1;
+}
+
+int GetSimpleShape(LPTAG t,LPSHAPE * s) // without Linestyle/Fillstyle Record
+{ LPSHAPE sh;
+ int bitl, len;
+ int end;
+ U32 pos;
+
+ if (FAILED(NewShape(s))) return -1;
+ sh = s[0];
+
+ ResetBitmask(t);
+ sh->bits.fill = (U16)GetBits(t,4);
+ sh->bits.line = (U16)GetBits(t,4);
+ bitl = 0; end = 0; pos = GetTagPos(t);
+
+ while (!end)
+ { int edge = GetBits(t,1); bitl+=1;
+ if (edge)
+ { bitl+=1;
+ if (GetBits(t,1)) // Line
+ { U16 nbits = GetBits(t,4)+2;
+ bitl+=5;
+
+ if (GetBits(t,1)) // x/y Line
+ { GetBits(t,nbits);
+ GetBits(t,nbits);
+ bitl+=nbits*2;
+ }
+ else // hline/vline
+ { GetBits(t,nbits+1);
+ bitl+=nbits+1;
+ }
+ }
+ else // Curve
+ { U16 nbits = GetBits(t,4)+2;
+ bitl+=4;
+
+ GetBits(t,nbits);
+ GetBits(t,nbits);
+ GetBits(t,nbits);
+ GetBits(t,nbits);
+
+ bitl+=4*nbits;
+ }
+ }
+ else
+ { U16 flags = GetBits(t,5); bitl+=5;
+ if (flags)
+ {
+ if (flags&SF_MOVETO)
+ { U16 nbits = GetBits(t,5); bitl+=5;
+ GetBits(t,nbits);
+ GetBits(t,nbits);
+ bitl+=2*nbits;
+ }
+
+ if (flags&SF_FILL0)
+ { GetBits(t,sh->bits.fill);
+ bitl+=sh->bits.fill;
+ }
+
+ if (flags&SF_FILL1)
+ { GetBits(t,sh->bits.fill);
+ bitl+=sh->bits.fill;
+ }
+
+ if (flags&SF_LINE)
+ { GetBits(t,sh->bits.line);
+ bitl+=sh->bits.line;
+ }
+
+ if (flags&SF_NEWSTYLE)
+ { fprintf(stderr,"Can't process extended styles in shape.\n");
+ }
+ }
+ else end = 1;
+ }
+ }
+ SetTagPos(t,pos);
+ len = (bitl+7)/8;
+
+ if (sh->data) free(sh->data);
+ sh->data = (U8*)malloc(len);
+
+ if (sh->data)
+ { sh->bitlen = bitl;
+ GetBlock(t,sh->data,len);
+ }
+ else return -1;
+
+ return len;
+}
+
+int SetSimpleShape(LPTAG t,LPSHAPE s) // without Linestyle/Fillstyle Record
+{ int l;
+
+ if (!s) return -1;
+ l = (s->bitlen+7)/8;
+
+ if (t)
+ { ResetBitcount(t);
+
+ SetBits(t,s->bits.fill,4);
+ SetBits(t,s->bits.line,4);
+ SetBlock(t,s->data,l);
+
+ ResetBitcount(t);
+ }
+ return l+1;
+}
+
+int SetFillStyle(LPTAG t,LPFILLSTYLE f)
+{ if ((!t)||(!f)) return -1;
+ SetU8(t,f->type);
+
+ // no gradients yet!
+
+ switch (f->type)
+ { case FILL_SOLID:
+ if (GetTagID(t)!=ST_DEFINESHAPE3) SetRGB(t,&f->color);
+ else SetRGBA(t,&f->color);
+ break;
+
+ case FILL_TILED:
+ case FILL_CLIPPED:
+ SetU16(t,f->id_bitmap);
+ SetMatrix(t,&f->m);
+ break;
+ }
+
+ return 0;
+}
+
+int SetLineStyle(LPTAG t,LPLINESTYLE l)
+{ if ((!l)||(!t)) return -1;
+ SetU16(t,l->width);
+
+ if (GetTagID(t)!=ST_DEFINESHAPE3) SetRGB(t,&l->color);
+ else SetRGBA(t,&l->color);
+
+ return 0;
+}
+
+int SetShapeStyleCount(LPTAG t,U16 n)
+{ if (n>254)
+ { SetU8(t,0xff);
+ SetU16(t,n);
+ return 3;
+ }
+ else
+ { SetU8(t,n);
+ return 1;
+ }
+}
+
+int SetShapeStyles(LPTAG t,LPSHAPE s)
+{ int i,l;
+ if (!s) return -1;
+
+ l = 0;
+ l += SetShapeStyleCount(t,s->fillstyle.n);
+
+ for (i=0;i<s->fillstyle.n;i++)
+ l+=SetFillStyle(t,&s->fillstyle.data[i]);
+
+ l += SetShapeStyleCount(t,s->linestyle.n);
+
+ for (i=0;i<s->linestyle.n;i++)
+ l+=SetLineStyle(t,&s->linestyle.data[i]);
+
+ return l;
+}
+
+int ShapeCountBits(LPSHAPE s,U8 * fbits,U8 * lbits)
+{ if (!s) return -1;
+
+ s->bits.fill = CountBits(s->fillstyle.n,0);
+ s->bits.line = CountBits(s->linestyle.n,0);
+
+ if (fbits) fbits[0] = s->bits.fill;
+ if (lbits) lbits[0] = s->bits.line;
+
+ return 0;
+}
+
+int SetShapeBits(LPTAG t,LPSHAPE s)
+{ if ((!t)||(!s)) return -1;
+ ResetBitcount(t);
+ SetBits(t,s->bits.fill,4);
+ SetBits(t,s->bits.line,4);
+ return 0;
+}
+
+int SetShapeHeader(LPTAG t,LPSHAPE s)
+{ int res;
+ res = SetShapeStyles(t,s);
+ if (res>=0) res = ShapeCountBits(s,NULL,NULL);
+ if (res>=0) res = SetShapeBits(t,s);
+ return res;
+}
+
+int ShapeExport(int handle,LPSHAPE s) // without Linestyle/Fillstyle Record
+{ int l;
+ if (!s) return 0;
+
+ l = sizeof(SHAPE);
+
+ if (handle>=0)
+ if (write(handle,s,sizeof(SHAPE))!=sizeof(SHAPE)) return -1;
+
+ // Fillstyle, Linestyle ...
+
+ if (s->data)
+ { int ll = (s->bitlen+7)/8;
+ l+=ll;
+ if (handle>=0)
+ if (write(handle,s->data,ll)!=ll) return -1;
+ }
+
+ return l;
+}
+
+int ShapeImport(int handle,LPSHAPE * shape)
+{ LPSHAPE s;
+
+ if (handle<0) return -1;
+
+ s = (LPSHAPE)malloc(sizeof(SHAPE)); shape[0] = s;
+ if (!s) return -1;
+
+ if (read(handle,s,sizeof(SHAPE))!=sizeof(SHAPE))
+ { shape[0] = NULL;
+ free(s);
+ return -1;
+ }
+
+ if (s->data)
+ { int ll = (s->bitlen+7)/8;
+ s->data = (U8*)malloc(ll);
+ if (!s->data)
+ { shape[0] = NULL;
+ free(s);
+ return -1;
+ }
+ if (read(handle,s->data,ll)!=ll)
+ { free(s->data);
+ free(s);
+ shape[0] = NULL;
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int ShapeAddFillStyle(LPSHAPE s,U8 type,LPMATRIX m,LPRGBA color,U16 id_bitmap)
+{ RGBA def_c;
+ MATRIX def_m;
+
+ // handle defaults
+
+ if (!s) return -1;
+ if (!color)
+ { color = &def_c;
+ def_c.a = 0xff;
+ def_c.r = def_c.g = def_c.b = 0;
+ }
+ if (!m)
+ { m = &def_m;
+ GetMatrix(NULL,m);
+ }
+
+ // handle memory
+
+ if (s->fillstyle.data)
+ { LPFILLSTYLE new = (LPFILLSTYLE)realloc(s->fillstyle.data,(s->fillstyle.n+1)*sizeof(FILLSTYLE));
+ if (!new) return -1;
+ s->fillstyle.data = new;
+ }
+ else
+ { s->fillstyle.data = (LPFILLSTYLE)malloc(sizeof(FILLSTYLE));
+ s->fillstyle.n = 0;
+ if (!s->fillstyle.data) return -1;
+ }
+
+ // set fillstyle (no gradients yet!)
+
+ s->fillstyle.data[s->fillstyle.n].type = type;
+ s->fillstyle.data[s->fillstyle.n].id_bitmap = id_bitmap;
+ memcpy(&s->fillstyle.data[s->fillstyle.n].m,m,sizeof(MATRIX));
+ memcpy(&s->fillstyle.data[s->fillstyle.n].color,color,sizeof(RGBA));
+
+ return (++s->fillstyle.n);
+}
+
+int ShapeAddSolidFillStyle(LPSHAPE s,LPRGBA color)
+{ return ShapeAddFillStyle(s,FILL_SOLID,NULL,color,0);
+}
+
+int ShapeAddBitmapFillStyle(LPSHAPE s,LPMATRIX m,U16 id_bitmap,int clip)
+{ return ShapeAddFillStyle(s,clip?FILL_CLIPPED:FILL_TILED,m,NULL,id_bitmap);
+}
+
+int ShapeAddLineStyle(LPSHAPE s,U16 width,LPRGBA color)
+{ RGBA def;
+ if (!s) return -1;
+ if (!color)
+ { color = &def;
+ def.a = 0xff;
+ def.r = def.g = def.b = 0;
+ }
+ if (s->linestyle.data)
+ { LPLINESTYLE new = (LPLINESTYLE)realloc(s->linestyle.data,(s->linestyle.n+1)*sizeof(LINESTYLE));
+ if (!new) return -1;
+ s->linestyle.data = new;
+ }
+ else
+ { s->linestyle.data = (LPLINESTYLE)malloc(sizeof(LINESTYLE));
+ s->linestyle.n = 0;
+ if (!s->linestyle.data) return -1;
+ }
+
+ s->linestyle.data[s->linestyle.n].width = width;
+ memcpy(&s->linestyle.data[s->linestyle.n].color,color,sizeof(RGBA));
+
+ return (++s->linestyle.n);
+}
+
+int ShapeSetMove(LPTAG t,LPSHAPE s,S32 x,S32 y)
+{ U8 b;
+ if (!t) return -1;
+ SetBits(t,0,1);
+ SetBits(t,SF_MOVETO,5);
+
+ b = CountBits(x,0);
+ b = CountBits(y,b);
+
+ SetBits(t,b,5);
+ SetBits(t,x,b);
+ SetBits(t,y,b);
+
+ if (s)
+ { s->px = x;
+ s->py = y;
+ }
+ return 0;
+}
+
+int ShapeSetStyle(LPTAG t,LPSHAPE s,U16 line,U16 fill0,U16 fill1)
+{ if ((!t)||(!s)) return -1;
+
+ SetBits(t,0,1);
+ SetBits(t,(line?SF_LINE:0)|(fill0?SF_FILL0:0)|(fill1?SF_FILL1:0),5);
+
+ if (fill0) SetBits(t,fill0,s->bits.fill);
+ if (fill1) SetBits(t,fill1,s->bits.fill);
+ if (line) SetBits(t,line ,s->bits.line);
+
+ return 0;
+}
+
+/* TODO: sometimes we want to set fillstyle 0, as that's the empty fill
+ used for line drawings. At the moment, we can't, as 0 fill be considered
+ nonexistent and therefore not set.
+ these defines are a workaround (they also reduce the maximal number of
+ fill styles to 32768)
+ */
+#define FILL_RESET 0x8000
+#define LINE_RESET 0x8000
+int ShapeSetAll(LPTAG t,LPSHAPE s,S32 x,S32 y,U16 line,U16 fill0,U16 fill1)
+{ U8 b;
+ if ((!t)||(!s)) return -1;
+
+ SetBits(t,0,1);
+ SetBits(t,SF_MOVETO|(line?SF_LINE:0)|(fill0?SF_FILL0:0)|(fill1?SF_FILL1:0),5);
+
+ b = CountBits(x,0);
+ b = CountBits(y,b);
+ SetBits(t,b,5);
+ SetBits(t,x,b);
+ SetBits(t,y,b);
+ s->px = x;
+ s->py = y;
+
+ if (fill0) SetBits(t,fill0,s->bits.fill);
+ if (fill1) SetBits(t,fill1,s->bits.fill);
+ if (line) SetBits(t,line ,s->bits.line);
+
+ return 0;
+}
+
+int ShapeSetEnd(LPTAG t)
+{ if (!t) return -1;
+ SetBits(t,0,6);
+ return 0;
+}
+
+int ShapeSetLine(LPTAG t,LPSHAPE s,S32 x,S32 y)
+{ U8 b;
+ if (!t) return -1;
+ SetBits(t,3,2); // Straight Edge
+
+ if ((!s)||(s->px!=x)||(s->py!=y))
+ { b = CountBits(x,2);
+ b = CountBits(y,b);
+ SetBits(t,b-2,4);
+ SetBits(t,1,1);
+ SetBits(t,x,b);
+ SetBits(t,y,b);
+ if (s)
+ { s->px += x;
+ s->py += y;
+ }
+ return 0;
+ }
+
+ if (s->px==x)
+ { b = CountBits(y,2);
+ SetBits(t,b-2,4);
+ SetBits(t,1,2);
+ SetBits(t,y,b);
+ s->py += y;
+ }
+ else
+ { b = CountBits(x,2);
+ SetBits(t,b-2,4);
+ SetBits(t,0,2);
+ SetBits(t,x,b);
+ s->px += x;
+ }
+ return 0;
+}
+
+int ShapeSetCurve(LPTAG t,LPSHAPE s,S32 x,S32 y,S32 ax,S32 ay)
+{ U8 b;
+ if (!t) return -1;
+
+ SetBits(t,2,2);
+
+ b = CountBits(ax,2);
+ b = CountBits(ay,b);
+ b = CountBits(x,b);
+ b = CountBits(y,b);
+
+ SetBits(t,b-2,4);
+ SetBits(t,x,b);
+ SetBits(t,y,b);
+ SetBits(t,ax,b);
+ SetBits(t,ay,b);
+
+ if (s)
+ { s->px += x+ax;
+ s->py += y+ay;
+ }
+ return 0;
+}
+
+int ShapeSetCircle(LPTAG t,LPSHAPE s,S32 x,S32 y,S32 rx,S32 ry)
+{ double C1 = 0.2930;
+ double C2 = 0.4140;
+ double begin = 0.7070;
+
+ if (!t) return -1;
+
+ ShapeSetMove(t,s,x+begin*rx,y+begin*ry);
+ ShapeSetCurve(t,s, -C1*rx, C1*ry, -C2*rx, 0);
+ ShapeSetCurve(t,s, -C2*rx, 0, -C1*rx, -C1*ry);
+ ShapeSetCurve(t,s, -C1*rx, -C1*ry, 0, -C2*ry);
+ ShapeSetCurve(t,s, 0, -C2*ry, C1*rx, -C1*ry);
+ ShapeSetCurve(t,s, C1*rx, -C1*ry, C2*rx, 0);
+ ShapeSetCurve(t,s, C2*rx, 0, C1*rx, C1*ry);
+ ShapeSetCurve(t,s, C1*rx, C1*ry, 0, C2*ry);
+ ShapeSetCurve(t,s, 0, C2*ry, -C1*rx, C1*ry);
+
+ return 0;
+}
+
diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c
new file mode 100644
index 00000000..3c9eb076
--- /dev/null
+++ b/lib/modules/swftext.c
@@ -0,0 +1,503 @@
+/* swftext.c
+
+ Text and font routines
+
+ Extension module for the rfxswf library.
+ Part of the swftools package.
+
+ Copyright (c) 2001 Rainer Böhme <rfxswf@reflex-studio.de>
+
+ This file is distributed under the GPL, see file COPYING for details
+
+*/
+
+#define TF_TEXTCONTROL 0x80
+#define TF_HASFONT 0x08
+#define TF_HASCOLOR 0x04
+#define TF_HASYOFFSET 0x02
+#define TF_HASXOFFSET 0x01
+
+#define FF_WIDECODES 0x01
+#define FF_BOLD 0x02
+#define FF_ITALIC 0x04
+#define FF_ANSI 0x08
+#define FF_SHIFTJIS 0x10
+#define FF_UNICODE 0x20
+
+int FontEnumerate(LPSWF swf,void (*FontCallback) (U16,U8*))
+{ int n;
+ LPTAG t;
+ if (!swf) return -1;
+ t = swf->FirstTag;
+ n = 0;
+
+ while (t)
+ { if (GetTagID(t)==ST_DEFINEFONTINFO)
+ { n++;
+ if (FontCallback)
+ { U16 id;
+ int l;
+ U8 s[257];
+ SaveTagPos(t);
+ SetTagPos(t,0);
+
+ id = GetU16(t);
+ l = GetU8(t);
+ GetBlock(t,s,l);
+ s[l] = 0;
+
+ (FontCallback)(id,s);
+
+ RestoreTagPos(t);
+ }
+ }
+ t = NextTag(t);
+ }
+ return n;
+}
+
+int FontExtract_DefineFont(int id,LPSWFFONT f,LPTAG t,LPSHAPE * shapes)
+{ U16 fid;
+ SaveTagPos(t);
+ SetTagPos(t,0);
+
+ fid = GetU16(t);
+ if ((!id)||(id==fid))
+ { U16 ofs[MAX_CHAR_PER_FONT];
+ int n,i;
+
+ id = fid;
+ f->id = fid;
+
+ ofs[0] = GetU16(t);
+ n = ofs[0]/2;
+
+ for (i=1;i<n;i++) if (i<MAX_CHAR_PER_FONT) ofs[i] = GetU16(t); else GetU16(t);
+ for (i=0;i<n;i++) if (i<MAX_CHAR_PER_FONT) GetSimpleShape(t,&shapes[i]);
+
+ }
+
+ RestoreTagPos(t);
+ return id;
+}
+
+int FontExtract_DefineFontInfo(int id,LPSWFFONT f,LPTAG t,LPSHAPE * shapes)
+{ U16 fid;
+ SaveTagPos(t);
+ SetTagPos(t,0);
+
+ fid = GetU16(t);
+ if (fid==id)
+ { U8 l = GetU8(t);
+ int i;
+
+ if (l)
+ { if (f->name) free(f->name);
+ f->name = (U8*)malloc(l+1);
+ if (f->name)
+ { GetBlock(t,f->name,l);
+ f->name[l] = 0;
+ }
+ else
+ { RestoreTagPos(t);
+ return -1;
+ }
+ }
+ f->flags = GetU8(t);
+
+ i = 0;
+ while (shapes[i])
+ { U16 code = ((f->flags&FF_WIDECODES)?GetU16(t):GetU8(t))%MAX_CHAR_PER_FONT;
+
+ f->glyph[code].shape = shapes[i];
+ f->glyph[code].gid = i;
+ if (i<MAX_CHAR_PER_FONT) f->codes[i] = code;
+
+ i++;
+ }
+ }
+
+ RestoreTagPos(t);
+ return id;
+}
+
+#define FEDTJ_PRINT 0x01
+#define FEDTJ_MODIFY 0x02
+
+int FontExtract_DefineText(int id,LPSWFFONT f,LPTAG t,int jobs)
+{ U16 cid;
+ SRECT r;
+ MATRIX m;
+ U8 gbits, abits, flags;
+ int fid;
+
+ fid = 0;
+
+ SaveTagPos(t);
+ SetTagPos(t,0);
+
+ cid = GetU16(t);
+ GetRect(t,&r);
+ GetMatrix(t,&m);
+ gbits = GetU8(t);
+ abits = GetU8(t);
+
+ flags = GetU8(t);
+
+ while(flags)
+ { if (flags&TF_TEXTCONTROL)
+ { if (flags&TF_HASFONT) fid = GetU16(t);
+ if (flags&TF_HASCOLOR)
+ { GetU8(t); // rgb
+ GetU8(t);
+ GetU8(t);
+ if (GetTagID(t)==ST_DEFINETEXT2) GetU8(t);
+ }
+ if (flags&TF_HASXOFFSET) GetS16(t);
+ if (flags&TF_HASYOFFSET) GetS16(t);
+ if (flags&TF_HASFONT) GetU16(t);
+ }
+ else
+ { int i;
+ for (i=0;i<flags;i++)
+ { int glyph;
+ int adv;
+ glyph = GetBits(t,gbits);
+ adv = GetBits(t,abits);
+ if (id==fid) // mitlesen ?
+ { int code = f->codes[glyph];
+ if (jobs&FEDTJ_PRINT) printf("%c",code);
+ if (jobs&FEDTJ_MODIFY)
+ /*if (f->glyph[code].advance)*/ f->glyph[code].advance = adv;
+ }
+ }
+ if ((id==fid)&&(jobs&FEDTJ_PRINT)) printf("\n");
+ }
+ flags = GetU8(t);
+ }
+
+ RestoreTagPos(t);
+ return id;
+}
+
+int FontExtract(LPSWF swf,int id,LPSWFFONT * font)
+{ LPTAG t;
+ LPSWFFONT f;
+ LPSHAPE shapes[MAX_CHAR_PER_FONT];
+
+ if ((!swf)||(!font)) return -1;
+
+ f = (LPSWFFONT)malloc(sizeof(SWFFONT)); font[0] = f;
+ if (!f) return -1;
+
+ memset(shapes,0x00,sizeof(shapes));
+ memset(f,0x00,sizeof(SWFFONT));
+
+ t = swf->FirstTag;
+
+ while (t)
+ { int nid = 0;
+ switch (GetTagID(t))
+ { case ST_DEFINEFONT:
+ nid = FontExtract_DefineFont(id,f,t,shapes);
+ break;
+
+ case ST_DEFINEFONTINFO:
+ nid = FontExtract_DefineFontInfo(id,f,t,shapes);
+ break;
+
+ case ST_DEFINETEXT:
+ case ST_DEFINETEXT2:
+ nid = FontExtract_DefineText(id,f,t,FEDTJ_MODIFY);
+ break;
+ }
+ if (nid>0) id = nid;
+ t = NextTag(t);
+ }
+ return 0;
+}
+
+int FontIsItalic(LPSWFFONT f) { return f->flags&FF_ITALIC; }
+int FontIsBold(LPSWFFONT f) { return f->flags&FF_BOLD; }
+
+int FontSetID(LPSWFFONT f,U16 id) { if (!f) return -1; f->id = id; return 0; }
+
+int FontReduce(LPSWFFONT f,LPFONTUSAGE use)
+{ int i,j;
+ if ((!f)||(!use)) return -1;
+
+ memset(&f->codes,0x00,sizeof(f->codes));
+
+ j = 0;
+ for (i=0;i<MAX_CHAR_PER_FONT;i++)
+ if (f->glyph[i].shape)
+ { if (use->code[i])
+ { f->glyph[i].gid = j;
+ f->codes[j] = i;
+ j++;
+ }
+ else
+ { ShapeFree(f->glyph[i].shape);
+ f->glyph[i].shape = 0;
+ f->glyph[i].gid = 0;
+ f->glyph[i].advance = 0;
+ }
+ } else f->glyph[i].gid = 0;
+
+ return j;
+}
+
+int FontInitUsage(LPFONTUSAGE use)
+{ if (!use) return -1;
+ memset(&use->code,0x00,sizeof(use->code));
+ return 0;
+}
+
+int FontUse(LPFONTUSAGE use,U8 * s)
+{ if ((!use)||(!s)) return -1;
+ while (s[0])
+ { use->code[s[0]] = 1;
+ s++;
+ }
+ return 0;
+}
+
+int FontSetDefine(LPTAG t,LPSWFFONT f)
+{ U16 ofs[MAX_CHAR_PER_FONT];
+ int p,i,j;
+
+ if ((!t)||(!f)) return -1;
+ ResetBitcount(t);
+ SetU16(t,f->id);
+
+ p = 0; j = 0;
+ for (i=0;i<MAX_CHAR_PER_FONT;i++)
+ if (f->glyph[i].shape)
+ { ofs[j++] = p;
+ p+=SetSimpleShape(NULL,f->glyph[i].shape);
+ }
+
+ for (i=0;i<j;i++) SetU16(t,ofs[i]+j*2);
+
+ for (i=0;i<MAX_CHAR_PER_FONT;i++)
+ if (f->glyph[i].shape)
+ SetSimpleShape(t,f->glyph[i].shape);
+
+ ResetBitcount(t);
+ return 0;
+}
+
+int FontSetInfo(LPTAG t,LPSWFFONT f)
+{ int l,i;
+ if ((!t)||(!f)) return -1;
+ ResetBitcount(t);
+ SetU16(t,f->id);
+ l = strlen(f->name); if (l>255) l = 255;
+ SetU8(t,l);
+ SetBlock(t,f->name,l);
+ SetU8(t,f->flags&0xfe); // no Wide-Codes
+
+ for (i=0;i<MAX_CHAR_PER_FONT;i++)
+ if (f->glyph[i].shape)
+ SetU8(t,i);
+
+ return 0;
+}
+
+int FontExport(int handle,LPSWFFONT f)
+{ int l;
+ int i;
+ if (!f) return 0;
+
+ l = sizeof(SWFFONT);
+ if (handle>=0)
+ if (write(handle,f,sizeof(SWFFONT))!=sizeof(SWFFONT)) return -1;
+
+ if (f->name)
+ { U16 ln = strlen(f->name);
+ l+=2+ln;
+ if (handle>=0)
+ { if (write(handle,&ln,2)!=2) return -1;
+ if (write(handle,f->name,ln)!=ln) return -1;
+ }
+ }
+
+ if (f->layout)
+ { l+=sizeof(SWFLAYOUT);
+ if (handle>=0)
+ if (write(handle,f->layout,sizeof(SWFLAYOUT))!=sizeof(SWFLAYOUT)) return -1;
+ if (f->layout->kerning.data)
+ { l+=f->layout->kerning.count*4;
+ if (handle>=0)
+ if (write(handle,f->layout->kerning.data,f->layout->kerning.count*4)!=f->layout->kerning.count*4) return -1;
+ }
+ }
+
+ for (i=0;i<MAX_CHAR_PER_FONT;i++)
+ { if (f->glyph[i].shape)
+ { int ll = ShapeExport(handle,f->glyph[i].shape);
+ if (ll<0) return -1;
+ l+=ll;
+ }
+ }
+
+ return l;
+}
+
+int FontImport(int handle,LPSWFFONT * font)
+{ LPSWFFONT f;
+ int layout;
+ int i = 0;
+
+ if ((!font)||(handle<0)) return -1;
+
+ f = (LPSWFFONT)malloc(sizeof(SWFFONT)); font[0] = f;
+ if (!f) return -1;
+
+ memset(f,0x00,sizeof(SWFFONT));
+
+ if (read(handle,f,sizeof(SWFFONT))!=sizeof(SWFFONT)) goto fehler;
+
+ layout = (f->layout)?1:0; // avoid illegal free()
+ f->layout = NULL;
+
+ if (f->name)
+ { U16 ln;
+ f->name = NULL;
+ if (read(handle,&ln,2)!=2) goto fehler;
+ f->name = (U8*)malloc(ln+1);
+ if (!f->name) goto fehler;
+ if (read(handle,f->name,ln)!=ln) goto fehler;
+ f->name[ln] = 0;
+ }
+
+ if (f->layout)
+ { f->layout = (LPSWFLAYOUT)malloc(sizeof(SWFLAYOUT));
+ if (!f->layout) goto fehler;
+ if (read(handle,f->layout,sizeof(SWFLAYOUT))!=sizeof(SWFLAYOUT)) goto fehler;
+ if (f->layout->kerning.data)
+ { int l = f->layout->kerning.count*4;
+ f->layout->kerning.data = (U8*)malloc(l);
+ if (!f->layout->kerning.data) goto fehler;
+ if (read(handle,f->layout->kerning.data,l)!=l) goto fehler;
+ }
+ }
+
+ for (i=0;i<MAX_CHAR_PER_FONT;i++)
+ { if (f->glyph[i].shape)
+ { if (ShapeImport(handle,&f->glyph[i].shape)<0) goto fehler;
+ }
+ }
+
+ f->id = 0;
+
+ return 0;
+
+fehler:
+ if (f) for (;i<MAX_CHAR_PER_FONT;i++) f->glyph[i].shape = NULL;
+ FontFree(f);
+ font[0] = NULL;
+ return -1;
+}
+
+int TextPrintDefineText(LPTAG t,LPSWFFONT f)
+{ int id = GetTagID(t);
+ if ((id==ST_DEFINETEXT)||(id==ST_DEFINETEXT2)) FontExtract_DefineText(f->id,f,t,FEDTJ_PRINT);
+ else return -1;
+ return 0;
+}
+
+void LayoutFree(LPSWFLAYOUT l)
+{ if (l)
+ { if (l->kerning.data) free(l->kerning.data);
+ l->kerning.data = NULL;
+ }
+ free(l);
+}
+
+void FontFree(LPSWFFONT f)
+{ if (f)
+ { int i;
+
+ if (f->name) free(f->name);
+ if (f->layout) LayoutFree(f->layout);
+
+ f->name = NULL;
+ f->layout = NULL;
+
+ for (i=0;i<MAX_CHAR_PER_FONT;i++)
+ if (f->glyph[i].shape)
+ { ShapeFree(f->glyph[i].shape);
+ f->glyph[i].shape = NULL;
+ }
+ }
+ free(f);
+}
+
+int TextSetInfoRecord(LPTAG t,LPSWFFONT font,U16 size,LPRGBA color,S16 dx,S16 dy)
+{ U8 flags;
+ if (!t) return -1;
+
+ flags = TF_TEXTCONTROL|(font?TF_HASFONT:0)|(color?TF_HASCOLOR:0)|(dx?TF_HASXOFFSET:0)|(dy?TF_HASYOFFSET:0);
+
+ SetU8(t,flags);
+ if (font) SetU16(t,font->id);
+ if (color)
+ { if (GetTagID(t)==ST_DEFINETEXT2) SetRGBA(t,color);
+ else SetRGB(t,color);
+ }
+ if (dx) SetS16(t,dx);
+ if (dy) SetS16(t,dy);
+ if (font) SetU16(t,size);
+
+ return 0;
+}
+
+int TextCountBits(LPSWFFONT font,U8 * s,int scale,U8 * gbits,U8 * abits)
+{ U16 g,a;
+ if ((!s)||(!font)||((!gbits)&&(!abits))) return -1;
+ g = a = 0;
+
+ while(s[0])
+ { g = CountBits(font->glyph[s[0]].gid,g);
+ a = CountBits((((U32)font->glyph[s[0]].advance)*scale)/100,a);
+ s++;
+ }
+
+ if (gbits) gbits[0] = (U8)g;
+ if (abits) abits[0] = (U8)a;
+
+ return 0;
+}
+
+int TextSetCharRecord(LPTAG t,LPSWFFONT font,U8 * s,int scale,U8 gbits,U8 abits)
+{ int l,i;
+
+ if ((!t)||(!font)||(!s)) return -1;
+
+ l = strlen(s);
+ if (l>0x7f) l = 0x7f;
+ SetU8(t,l);
+
+ for (i=0;i<l;i++)
+ { SetBits(t,font->glyph[s[i]].gid,gbits);
+ SetBits(t,(((U32)font->glyph[s[i]].advance)*scale)/100,abits);
+ }
+
+ ResetBitcount(t);
+ return 0;
+}
+
+U32 TextGetWidth(LPSWFFONT font,U8 * s,int scale)
+{ U32 res = 0;
+
+ if (font&&s)
+ { while (s[0])
+ { res += font->glyph[s[0]].advance;
+ s++;
+ }
+ if (scale) res = (res*scale)/100;
+ }
+
+ return res;
+}
diff --git a/lib/modules/swftools.c b/lib/modules/swftools.c
new file mode 100644
index 00000000..7f3865b0
--- /dev/null
+++ b/lib/modules/swftools.c
@@ -0,0 +1,260 @@
+/* swftools.c
+
+ Math and matrix functions, misc tools
+
+ Extension module for the rfxswf library.
+ Part of the swftools package.
+
+ Copyright (c) 2000, 2001 Rainer Böhme <rfxswf@reflex-studio.de>
+
+ This file is distributed under the GPL, see file COPYING for details
+
+*/
+
+// Matrix & Math tools for SWF files
+
+#define S64 long long
+SFIXED SP(SFIXED a1,SFIXED a2,SFIXED b1,SFIXED b2)
+{ S64 a;
+ a = (S64)a1*(S64)b1+(S64)a2*(S64)b2;
+ return (SFIXED)(a>>16);
+}
+SFIXED QFIX(int zaehler,int nenner) // bildet Quotient von zwei INTs in SFIXED
+{ S64 z = zaehler<<16;
+ S64 a = z/(S64)nenner;
+ return (SFIXED)a;
+}
+#undef S64
+
+LPMATRIX MatrixJoin(LPMATRIX d,LPMATRIX s1,LPMATRIX s2)
+{
+ if (!d) return NULL;
+ if (!s1) return (s2)?(LPMATRIX)memcpy(d,s2,sizeof(MATRIX)):NULL;
+ if (!s2) return (LPMATRIX)memcpy(d,s1,sizeof(MATRIX));
+
+ d->tx = s1->tx + s2->tx;
+ d->ty = s1->ty + s2->ty;
+
+ d->sx = SP(s1->sx,s1->r1,s2->sx,s2->r0);
+ d->sy = SP(s1->r0,s1->sy,s2->r1,s2->sy);
+ d->r0 = SP(s1->r0,s1->sy,s2->sx,s2->r0);
+ d->r1 = SP(s1->sx,s1->r1,s2->r1,s2->sy);
+
+ //DumpMatrix(NULL,d);
+
+ return d;
+}
+
+LPMATRIX MatrixMapTriangle(LPMATRIX m,int dx,int dy,int x0,int y0,
+ int x1,int y1,int x2,int y2)
+{ int dx1 = x1 - x0;
+ int dy1 = y1 - y0;
+ int dx2 = x2 - x0;
+ int dy2 = y2 - y0;
+
+ if (!m) return NULL;
+ if ((!dx)||(!dy)) return NULL; // check DIV by zero
+
+ m->tx = x0;
+ m->ty = y0;
+ m->sx = QFIX(dx1,dx);
+ m->sy = QFIX(dy2,dy);
+ m->r0 = QFIX(dy1,dx);
+ m->r1 = QFIX(dx2,dy);
+
+ return m;
+}
+
+U16 GetDefineID(LPTAG t)
+// up to SWF 4.0
+{ U32 oldTagPos;
+ U16 id = 0;
+
+ oldTagPos = GetTagPos(t);
+ SetTagPos(t,0);
+
+ switch (GetTagID(t))
+ { case ST_DEFINESHAPE:
+ case ST_DEFINESHAPE2:
+ case ST_DEFINESHAPE3:
+ case ST_DEFINEMORPHSHAPE:
+ case ST_DEFINEBITS:
+ case ST_DEFINEBITSJPEG2:
+ case ST_DEFINEBITSJPEG3:
+ case ST_DEFINEBITSLOSSLESS:
+ case ST_DEFINEBITSLOSSLESS2:
+ case ST_DEFINEBUTTON:
+ case ST_DEFINEBUTTON2:
+ case ST_DEFINEBUTTONCXFORM:
+ case ST_DEFINEBUTTONSOUND:
+ case ST_DEFINEFONT:
+ case ST_DEFINEFONT2:
+ case ST_DEFINEFONTINFO:
+ case ST_DEFINETEXT:
+ case ST_DEFINETEXT2:
+ case ST_DEFINESOUND:
+ case ST_DEFINESPRITE:
+ id = GetU16(t);
+ break;
+ }
+
+ SetTagPos(t,oldTagPos);
+
+ return id;
+}
+
+U16 GetPlaceID(LPTAG t)
+// up to SWF 4.0
+{ U32 oldTagPos;
+ U16 id = 0;
+
+ oldTagPos = GetTagPos(t);
+ SetTagPos(t,0);
+
+ switch (GetTagID(t))
+ { case ST_PLACEOBJECT:
+ case ST_REMOVEOBJECT:
+ case ST_STARTSOUND:
+ id = GetU16(t);
+ break;
+
+ case ST_PLACEOBJECT2:
+ { U8 flags = GetU8(t);
+ U16 d = GetU16(t);
+ id = (flags&PF_CHAR)?GetU16(t):id;
+ } break;
+
+ }
+
+ SetTagPos(t,oldTagPos);
+
+ return id;
+}
+
+int definingtagids[] =
+{ST_DEFINESHAPE,
+ ST_DEFINESHAPE2,
+ ST_DEFINESHAPE3,
+ ST_DEFINEMORPHSHAPE,
+ ST_DEFINEFONT,
+ ST_DEFINEFONT2,
+ ST_DEFINETEXT,
+ ST_DEFINETEXT2,
+ ST_DEFINEEDITTEXT,
+ ST_DEFINEBITS,
+ ST_DEFINEBITSJPEG2,
+ ST_DEFINEBITSJPEG3,
+ ST_DEFINEBITSLOSSLESS,
+ ST_DEFINEBITSLOSSLESS2,
+ ST_DEFINEMOVIE,
+ ST_DEFINESPRITE,
+ ST_DEFINEBUTTON,
+ ST_DEFINEBUTTON2,
+ ST_DEFINESOUND,
+ -1
+};
+
+// tags which may be used inside a sprite definition
+int spritetagids[] =
+{ST_SHOWFRAME,
+ ST_PLACEOBJECT,
+ ST_PLACEOBJECT2,
+ ST_REMOVEOBJECT,
+ ST_REMOVEOBJECT2, //?
+ ST_DOACTION,
+ ST_STARTSOUND,
+ ST_FRAMELABEL,
+ ST_SOUNDSTREAMHEAD,
+ ST_SOUNDSTREAMHEAD2,
+ ST_SOUNDSTREAMBLOCK,
+ ST_END,
+ -1
+};
+
+char isAllowedSpriteTag (TAG*tag)
+{
+ int id = tag->id;
+ int t=0;
+ while(spritetagids[t]>=0)
+ {
+ if(spritetagids[t] == id)
+ return 1;
+ t++;
+ }
+ return 0;
+}
+
+char isDefiningTag (TAG*tag)
+{
+ int id = tag->id;
+ int t=0;
+ while(definingtagids[t]>=0)
+ {
+ if(definingtagids[t] == id)
+ return 1;
+ t++;
+ }
+ return 0;
+}
+
+U16 GetDepth(LPTAG t)
+// up to SWF 4.0
+{
+ U16 depth = 0;
+ U32 oldTagPos;
+ oldTagPos = GetTagPos(t);
+ SetTagPos(t,0);
+
+ switch (GetTagID(t))
+ { case ST_PLACEOBJECT:
+ case ST_REMOVEOBJECT:
+ GetU16(t); //id
+ depth = GetU16(t);
+ break;
+ case ST_REMOVEOBJECT2:
+ depth = GetU16(t);
+ break;
+ case ST_PLACEOBJECT2:
+ { U8 flags = GetU8(t);
+ depth = GetU16(t);
+ } break;
+ }
+ SetTagPos(t,oldTagPos);
+ return depth;
+}
+
+char* GetName(LPTAG t)
+{
+ char* name = 0;
+ U32 oldTagPos;
+ MATRIX m;
+ CXFORM c;
+ oldTagPos = GetTagPos(t);
+ SetTagPos(t,0);
+ switch(GetTagID(t))
+ {
+ case ST_FRAMELABEL:
+ name = GetTagPosPtr(t);
+ break;
+ case ST_PLACEOBJECT2: {
+ U8 flags = GetU8(t);
+ GetU16(t); //depth;
+ if(flags&PF_CHAR)
+ GetU16(t); //id
+ if(flags&PF_MATRIX)
+ GetMatrix(t, &m);
+ if(flags&PF_CXFORM)
+ GetCXForm(t, &c, 1);
+ if(flags&PF_RATIO)
+ GetU16(t);
+ if(flags&PF_NAME) {
+ ResetBitmask(t);
+ name = GetTagPosPtr(t);
+ }
+ }
+ break;
+ }
+ SetTagPos(t,oldTagPos);
+ return name;
+}
+
diff --git a/lib/rfxswf.c b/lib/rfxswf.c
new file mode 100644
index 00000000..2912350f
--- /dev/null
+++ b/lib/rfxswf.c
@@ -0,0 +1,809 @@
+/* rfxswf.c
+
+ Library for creating and reading SWF files or parts of it.
+ There's a module directory which provides some extended functionality.
+ Most modules are included at the bottom of this file.
+
+ Part of the swftools package.
+
+ Copyright (c) 2000, 2001 Rainer Böhme <rfxswf@reflex-studio.de>
+
+ This file is distributed under the GPL, see file COPYING for details
+
+*/
+
+#include "rfxswf.h"
+
+#include <jpeglib.h>
+#define _JPEGLIB_INCLUDED_
+
+// Win32 support may be broken since it was only tested in an older version for Watcom C
+#ifdef __NT__
+# include <io.h>
+# include <malloc.h>
+# include <string.h>
+# ifdef DEBUG_RFXSWF
+# include <stdio.h>
+# endif
+#else
+#endif
+
+// internal constants
+
+#define MALLOC_SIZE 128
+#define INSERT_RFX_TAG
+
+#define MEMSIZE(l) (((l/MALLOC_SIZE)+1)*MALLOC_SIZE)
+
+// inline wrapper functions
+
+LPTAG NextTag(LPTAG t) { return t->next; }
+LPTAG PrevTag(LPTAG t) { return t->prev; }
+int GetFrameNo(LPTAG t) { return t->frame; }
+U16 GetTagID(LPTAG t) { return t->id; }
+U32 GetDataSize(LPTAG t) { return t->len; }
+U32 GetTagPos(LPTAG t) { return t->pos; }
+U8* GetTagPosPtr(LPTAG t) { return &t->data[t->pos]; }
+
+// Basic Data Access Functions
+
+#define ResetBitmask(tag) if (tag->bitmask) { tag->pos++; tag->bitmask = 0; }
+#define ResetBitcount(tag) if (tag->bitcount) { tag->bitcount = 0; }
+
+// for future purpose: avoid high level lib functions to change tagpos/bitcount
+
+#define SaveTagPos(tag)
+#define RestoreTagPos(tag)
+
+void SetTagPos(LPTAG t,U32 pos)
+{ ResetBitmask(t);
+ if (pos<=t->len) t->pos = pos;
+ #ifdef DEBUG_RFXSWF
+ else fprintf(stderr,"SetTagPos() out of bounds: TagID = %i\n",t->id);
+ #endif
+}
+
+U8 GetU8(LPTAG t)
+{ ResetBitmask(t);
+ #ifdef DEBUG_RFXSWF
+ if (t->pos>=t->len)
+ { fprintf(stderr,"GetU8() out of bounds: TagID = %i\n",t->id);
+ return 0;
+ }
+ #endif
+ return t->data[t->pos++];
+}
+
+U16 GetU16(LPTAG t)
+{ U16 res;
+ ResetBitmask(t);
+ #ifdef DEBUG_RFXSWF
+ if (t->pos>(t->len-2))
+ { fprintf(stderr,"GetU16() out of bounds: TagID = %i\n",t->id);
+ return 0;
+ }
+ #endif
+ res = t->data[t->pos] | (t->data[t->pos+1]<<8);
+ t->pos+=2;
+ return res;
+}
+
+U32 GetU32(LPTAG t)
+{ U32 res;
+ ResetBitmask(t);
+ #ifdef DEBUG_RFXSWF
+ if (t->pos>(t->len-4))
+ { fprintf(stderr,"GetU32() out of bounds: TagID = %i\n",t->id);
+ return 0;
+ }
+ #endif
+ res = t->data[t->pos] | (t->data[t->pos+1]<<8) |
+ (t->data[t->pos+2]<<16) | (t->data[t->pos+3]<<24);
+ t->pos+=4;
+ return res;
+}
+
+int GetBlock(LPTAG t,U8 * b,int l)
+// returns number of bytes written (<=l)
+// b = NULL -> skip data
+{ ResetBitmask(t);
+ if ((t->len-t->pos)<l) l=t->len-t->pos;
+ if (b && l) memcpy(b,&t->data[t->pos],l);
+ t->pos+=l;
+ return l;
+}
+
+int SetBlock(LPTAG t,U8 * b,int l)
+// Appends Block to the end of Tagdata, returns size
+{ U32 newlen = t->len + l;
+ ResetBitcount(t);
+ if (newlen>t->memsize)
+ { U32 newmem = MEMSIZE(newlen);
+ U8 * newdata = (U8*)((t->data)?realloc(t->data,newmem):malloc(newmem));
+ if (!newdata)
+ {
+ #ifdef DEBUG_RFXSWF
+ fprintf(stderr,"Fatal Error: malloc()/realloc() failed.\n");
+ #endif
+ return 0;
+ }
+ t->memsize = newmem;
+ t->data = newdata;
+ }
+ if (b) memcpy(&t->data[t->len],b,l);
+ else memset(&t->data[t->len],0x00,l);
+ t->len+=l;
+ return l;
+}
+
+int SetU8(LPTAG t,U8 v)
+{ ResetBitcount(t);
+ if ((t->len+1)>t->memsize) return (SetBlock(t,&v,1)==1)?0:-1;
+ t->data[t->len++] = v;
+ return 0;
+}
+
+int SetU16(LPTAG t,U16 v)
+{ U8 a[2];
+ a[0] = v&0xff;
+ a[1] = v>>8;
+
+ ResetBitcount(t);
+ if ((t->len+2)>t->memsize) return (SetBlock(t,a,2)==2)?0:-1;
+ t->data[t->len++] = a[0];
+ t->data[t->len++] = a[1];
+ return 0;
+}
+
+int SetU32(LPTAG t,U32 v)
+{ U8 a[4];
+ a[0] = v&0xff; // to ensure correct handling of non-intel byteorder
+ a[1] = (v>>8)&0xff;
+ a[2] = (v>>16)&0xff;
+ a[3] = (v>>24)&0xff;
+
+ ResetBitcount(t);
+ if ((t->len+4)>t->memsize) return (SetBlock(t,a,4)==4)?0:-1;
+ t->data[t->len++] = a[0];
+ t->data[t->len++] = a[1];
+ t->data[t->len++] = a[2];
+ t->data[t->len++] = a[3];
+ return 0;
+}
+
+U32 GetBits(LPTAG t,int nbits)
+{ U32 res = 0;
+ if (!nbits) return 0;
+ if (!t->bitmask) t->bitmask = 0x80;
+ while (nbits)
+ { res<<=1;
+ if (t->data[t->pos]&t->bitmask) res|=1;
+ t->bitmask>>=1;
+ nbits--;
+ if (!t->bitmask)
+ { if (nbits) t->bitmask = 0x80;
+ #ifdef DEBUG_RFXSWF
+ if (t->pos>=t->len)
+ { fprintf(stderr,"GetBits() out of bounds: TagID = %i\n",t->id);
+ return res;
+ }
+ #endif
+ t->pos++;
+ }
+ }
+ return res;
+}
+
+S32 GetSBits(LPTAG t,int nbits)
+{ U32 res = GetBits(t,nbits);
+ if (res&(1<<(nbits-1))) res|=(0xffffffff<<nbits);
+ return (S32)res;
+}
+
+int SetBits(LPTAG t,U32 v,int nbits)
+{ U32 bm = 1<<(nbits-1);
+
+ while (nbits)
+ { if (!t->bitcount)
+ { if (FAILED(SetU8(t,0))) return -1;
+ t->bitcount = 0x80;
+ }
+ if (v&bm) t->data[t->len-1] |= t->bitcount;
+ bm>>=1;
+ t->bitcount>>=1;
+ nbits--;
+ }
+ return 0;
+}
+
+// Advanced Data Access Functions
+
+int SetRGB(LPTAG t,LPRGBA col)
+{ if (!t) return -1;
+ if (col)
+ { SetU8(t,col->r);
+ SetU8(t,col->g);
+ SetU8(t,col->b);
+ } else SetBlock(t,NULL,3);
+ return 0;
+}
+
+int SetRGBA(LPTAG t,LPRGBA col)
+{ if (!t) return -1;
+ if (col)
+ { SetU8(t,col->r);
+ SetU8(t,col->g);
+ SetU8(t,col->b);
+ SetU8(t,col->a);
+ } else SetBlock(t,NULL,4);
+ return 0;
+}
+
+int CountBits(U32 v,int nbits)
+{ int n = 33;
+ U32 m = 0x80000000;
+ if (!v) n = 0; else
+ if (v&m)
+ { while (v&m)
+ { n--;
+ m>>=1;
+ if (!m) break;
+ }
+ }
+ else
+ { while (!(v&m))
+ { n--;
+ m>>=1;
+ if (!m) break;
+ }
+ }
+ return (n>nbits)?n:nbits;
+}
+
+int GetRect(LPTAG t,LPSRECT r)
+{ int nbits;
+ SRECT dummy;
+ if (!r) r = &dummy;
+ nbits = (int) GetBits(t,5);
+ r->xmin = GetSBits(t,nbits);
+ r->xmax = GetSBits(t,nbits);
+ r->ymin = GetSBits(t,nbits);
+ r->ymax = GetSBits(t,nbits);
+ return 0;
+}
+
+int SetRect(LPTAG t,LPSRECT r)
+{ int nbits;
+
+ nbits = CountBits(r->xmin,0);
+ nbits = CountBits(r->xmax,nbits);
+ nbits = CountBits(r->ymin,nbits);
+ nbits = CountBits(r->ymax,nbits);
+
+ SetBits(t,nbits,5);
+ SetBits(t,r->xmin,nbits);
+ SetBits(t,r->xmax,nbits);
+ SetBits(t,r->ymin,nbits);
+ SetBits(t,r->ymax,nbits);
+
+ return 0;
+}
+
+int GetMatrix(LPTAG t,LPMATRIX m)
+{ MATRIX dummy;
+ int nbits;
+
+ if (!m) m = &dummy;
+
+ if (!t)
+ { m->sx = m->sy = 0x10000;
+ m->r0 = m->r1 = 0;
+ m->tx = m->ty = 0;
+ return -1;
+ }
+
+ ResetBitmask(t);
+
+ if (GetBits(t,1))
+ { nbits = GetBits(t,5);
+ m->sx = GetSBits(t,nbits);
+ m->sy = GetSBits(t,nbits);
+ }
+ else m->sx = m->sy = 0x10000;
+
+ if (GetBits(t,1))
+ { nbits = GetBits(t,5);
+ m->r0 = GetSBits(t,nbits);
+ m->r1 = GetSBits(t,nbits);
+ }
+ else m->r0 = m->r1 = 0x0;
+
+ nbits = GetBits(t,5);
+ m->tx = GetSBits(t,nbits);
+ m->ty = GetSBits(t,nbits);
+
+ return 0;
+}
+
+int SetMatrix(LPTAG t,LPMATRIX m)
+{ int nbits;
+ MATRIX ma;
+
+ if (!m)
+ { m = &ma;
+ ma.sx = ma.sy = 0x10000;
+ ma.r0 = ma.r1 = 0;
+ ma.tx = ma.ty = 0;
+ }
+
+ ResetBitcount(t);
+
+ if ((m->sx==0x10000)&&(m->sy==0x10000)) SetBits(t,0,1);
+ else
+ { SetBits(t,1,1);
+ nbits = CountBits(m->sx,0);
+ nbits = CountBits(m->sy,nbits);
+ SetBits(t,nbits,5);
+ SetBits(t,m->sx,nbits);
+ SetBits(t,m->sy,nbits);
+ }
+
+ if ((!m->r0)&&(!m->r1)) SetBits(t,0,1);
+ else
+ { SetBits(t,1,1);
+ nbits = CountBits(m->r0,0);
+ nbits = CountBits(m->r1,nbits);
+ SetBits(t,nbits,5);
+ SetBits(t,m->r0,nbits);
+ SetBits(t,m->r1,nbits);
+ }
+
+ nbits = CountBits(m->tx,0);
+ nbits = CountBits(m->ty,nbits);
+ SetBits(t,nbits,5);
+ SetBits(t,m->tx,nbits);
+ SetBits(t,m->ty,nbits);
+
+ return 0;
+}
+
+int GetCXForm(LPTAG t,LPCXFORM cx,U8 alpha) //FIXME: alpha should be type bool
+{ CXFORM cxf;
+ int hasadd;
+ int hasmul;
+ int nbits;
+
+ if (!cx) cx = &cxf;
+
+ cx->a0 = cx->r0 = cx->g0 = cx->b0 = 256;
+ cx->a1 = cx->r1 = cx->g1 = cx->b1 = 0;
+
+ if (!t) return 0;
+
+ ResetBitmask(t);
+ hasadd = GetBits(t,1);
+ hasmul = GetBits(t,1);
+ nbits = GetBits(t,4);
+
+ if (hasmul)
+ { cx->r0 = (S16)GetSBits(t,nbits);
+ cx->g0 = (S16)GetSBits(t,nbits);
+ cx->b0 = (S16)GetSBits(t,nbits);
+ if (alpha)
+ cx->a0 = (S16)GetSBits(t,nbits);
+ }
+
+ if (hasadd)
+ { cx->r1 = (S16)GetSBits(t,nbits);
+ cx->g1 = (S16)GetSBits(t,nbits);
+ cx->b1 = (S16)GetSBits(t,nbits);
+ if (alpha)
+ cx->a1 = (S16)GetSBits(t,nbits);
+ }
+
+ return 0;
+}
+
+int SetCXForm(LPTAG t,LPCXFORM cx,U8 alpha)
+{ CXFORM cxf;
+ int hasadd;
+ int hasmul;
+ int nbits;
+
+ if (!cx)
+ { cx = &cxf;
+ cx->a0 = cx->r0 = cx->g0 = cx->b0 = 256;
+ cx->a1 = cx->r1 = cx->g1 = cx->b1 = 0;
+ }
+
+ if (!alpha)
+ { cx->a0 = 256;
+ cx->a1 = 0;
+ }
+
+ nbits = 0;
+
+ hasmul = (cx->a0!=256)||(cx->r0!=256)||(cx->g0!=256)||(cx->b0!=256);
+ hasadd = cx->a1|cx->r1|cx->g1|cx->b1;
+
+ if (hasmul)
+ { if (alpha) nbits = CountBits((S32)cx->a0,nbits);
+ nbits = CountBits((S32)cx->r0,nbits);
+ nbits = CountBits((S32)cx->g0,nbits);
+ nbits = CountBits((S32)cx->b0,nbits);
+ }
+
+ if (hasadd)
+ { if (alpha) nbits = CountBits((S32)cx->a1,nbits);
+ nbits = CountBits((S32)cx->r1,nbits);
+ nbits = CountBits((S32)cx->g1,nbits);
+ nbits = CountBits((S32)cx->b1,nbits);
+ }
+
+ ResetBitcount(t);
+ SetBits(t,hasadd?1:0,1);
+ SetBits(t,hasmul?1:0,1);
+ SetBits(t,nbits,4);
+
+ if (hasmul)
+ { SetBits(t,cx->r0,nbits);
+ SetBits(t,cx->g0,nbits);
+ SetBits(t,cx->b0,nbits);
+ if (alpha) SetBits(t,cx->a0,nbits);
+ }
+
+ if (hasadd)
+ { SetBits(t,cx->r1,nbits);
+ SetBits(t,cx->g1,nbits);
+ SetBits(t,cx->b1,nbits);
+ if (alpha) SetBits(t,cx->a1,nbits);
+ }
+
+ return 0;
+}
+
+int GetPoint(LPTAG t,LPSPOINT p) { return 0; }
+int SetPoint(LPTAG t,LPSPOINT p) { return 0; }
+
+// Tag List Manipulating Functions
+
+int RFXSWF_UpdateFrame(LPTAG t,S8 delta)
+// returns number of frames
+{ int res = -1;
+ while (t)
+ { t->frame+=delta;
+ res = t->frame;
+ t = t->next;
+ }
+ return res;
+}
+
+#define UpdateFrame(a,b) RFXSWF_UpdateFrame(a,b)
+
+LPTAG InsertTag(LPTAG after,U16 id) // updates frames, if nescessary
+{ LPTAG t;
+
+ t = (LPTAG)malloc(sizeof(TAG));
+ if (t)
+ { memset(t,0x00,sizeof(TAG));
+ t->id = id;
+
+ if (after)
+ { t->frame = after->frame;
+ t->prev = after;
+ t->next = after->next;
+ after->next = t;
+ if (t->next) t->next->prev = t;
+
+ if (id==ST_SHOWFRAME) UpdateFrame(t->next,+1);
+ }
+ }
+ return t;
+}
+
+int DeleteTag(LPTAG t)
+{ if (!t) return -1;
+
+ if (t->id==ST_SHOWFRAME) UpdateFrame(t->next,-1);
+
+ if (t->prev) t->prev->next = t->next;
+ if (t->next) t->next->prev = t->prev;
+
+ if (t->data) free(t->data);
+ free(t);
+ return 0;
+}
+
+LPTAG RFXSWF_ReadTag(int handle,LPTAG prev)
+{ LPTAG t;
+ U16 raw;
+ U32 len;
+ int id;
+
+ if (read(handle,&raw,2)!=2) return NULL;
+
+ len = raw&0x3f;
+ id = raw>>6;
+
+ if (len==0x3f)
+ { if (read(handle,&len,4)!=4) return NULL;
+ }
+
+ if (id==ST_DEFINESPRITE) len = 2*sizeof(U16);
+ // Sprite handling fix: Flaten sprite tree
+
+ t = (LPTAG)malloc(sizeof(TAG));
+
+ if (!t)
+ {
+ #ifdef DEBUG_RFXSWF
+ fprintf(stderr,"Fatal Error: malloc()/realloc() failed.\n");
+ #endif
+ return NULL;
+ }
+
+ memset(t,0x00,sizeof(TAG));
+
+ t->len = len;
+ t->id = id;
+
+ if (t->len)
+ { t->data = (U8*)malloc(t->len);
+ if (!t->data)
+ {
+ #ifdef DEBUG_RFXSWF
+ fprintf(stderr,"Fatal Error: malloc()/realloc() failed.\n");
+ #endif
+ return NULL;
+ }
+ t->memsize = t->len;
+ if (read(handle,t->data,t->len)!=t->len) return NULL;
+ }
+
+ if (prev)
+ { t->frame = prev->frame+((prev->id==ST_SHOWFRAME)?1:0);
+ t->prev = prev;
+ prev->next = t;
+ }
+
+ return t;
+}
+
+int DefineSprite_GetRealSize(LPTAG t);
+
+int RFXSWF_WriteTag(int handle,LPTAG t)
+// returns tag length in bytes (incl. Header), -1 = Error
+// handle = -1 -> no output
+{ U16 raw[3];
+ U32 len;
+ int short_tag;
+
+ if (!t) return -1;
+
+ len = (t->id==ST_DEFINESPRITE)?DefineSprite_GetRealSize(t):t->len;
+
+ short_tag = len<0x3f;
+
+ if (handle>=0)
+ { if (short_tag)
+ { raw[0] = len|((t->id&0x3ff)<<6);
+ if (write(handle,raw,2)!=2)
+ {
+ #ifdef DEBUG_RFXSWF
+ fprintf(stderr,"WriteTag() failed: Short Header.\n");
+ #endif
+ return -1;
+ }
+ }
+ else
+ { raw[0] = (t->id<<6)|0x3f;
+ raw[1] = (U16)(len&0xffff);
+ raw[2] = (U16)(len>>16);
+ if (write(handle,raw,6)!=6)
+ {
+ #ifdef DEBUG_RFXSWF
+ fprintf(stderr,"WriteTag() failed: Long Header.\n");
+ #endif
+ return -1;
+ }
+ }
+
+ if (t->data)
+ { if (write(handle,t->data,t->len)!=t->len)
+ {
+ #ifdef DEBUG_RFXSWF
+ fprintf(stderr,"WriteTag() failed: Data.\n");
+ #endif
+ return -1;
+ }
+ }
+ #ifdef DEBUG_RFXSWF
+ else if (t->len) fprintf(stderr,"WriteTag(): Tag Data Error, id=%i\n",t->id);
+ #endif
+ }
+
+ return t->len+(short_tag?2:6);
+}
+
+int DefineSprite_GetRealSize(LPTAG t)
+// Sprite Handling: Helper function to pack DefineSprite-Tag
+{ U32 len = t->len;
+ do
+ { t = NextTag(t);
+ if (t->id!=ST_DEFINESPRITE) len += RFXSWF_WriteTag(-1,t);
+ else t = NULL;
+ } while (t&&(t->id!=ST_END));
+ return len;
+}
+
+#define ReadTag(a,b) RFXSWF_ReadTag(a,b)
+#define WriteTag(a,b) RFXSWF_WriteTag(a,b)
+
+// Movie Functions
+
+int ReadSWF(int handle,LPSWF swf) // Reads SWF to memory (malloc'ed), returns length or <0 if fails
+{
+ if (!swf) return -1;
+ memset(swf,0x00,sizeof(SWF));
+
+ { char b[32]; // Header lesen
+ TAG t1;
+ LPTAG t;
+
+ memset(&t1,0x00,sizeof(TAG));
+
+ if ((t1.len=read(handle,b,32))<21) return -1;
+ t1.data = (U8*)b;
+
+ if (GetU8(&t1)!=(U8)'F') return -1;
+ if (GetU8(&t1)!=(U8)'W') return -1;
+ if (GetU8(&t1)!=(U8)'S') return -1;
+
+ swf->FileVersion = GetU8(&t1);
+ swf->FileSize = GetU32(&t1);
+ GetRect(&t1,&swf->MovieSize);
+ swf->FrameRate = GetU16(&t1);
+ swf->FrameCount = GetU16(&t1);
+
+ GetU8(&t1);
+ lseek(handle,GetTagPos(&t1)-1,SEEK_SET);
+
+ // Tags lesen und verketten
+ t = &t1;
+ while (t) t = ReadTag(handle,t);
+ swf->FirstTag = t1.next;
+ t1.next->prev = NULL;
+ }
+
+ return 0;
+}
+int WriteSWF(int handle,LPSWF swf) // Writes SWF to file, returns length or <0 if fails
+{ U32 len;
+ LPTAG t;
+
+ if (!swf) return -1;
+
+ // Insert REFLEX Tag
+
+#ifdef INSERT_RFX_TAG
+
+ if (NextTag(swf->FirstTag))
+ if (GetTagID(NextTag(swf->FirstTag))!=ST_REFLEX)
+ SetBlock(InsertTag(swf->FirstTag,ST_REFLEX),"rfx",3);
+
+#endif // INSERT_RFX_TAG
+
+ // Count Frames + File Size
+
+ len = 0;
+ t = swf->FirstTag;
+ swf->FrameCount = 0;
+
+ while(t)
+ { len += WriteTag(-1,t);
+ if (t->id==ST_SHOWFRAME) swf->FrameCount++;
+ t = NextTag(t);
+ }
+
+ { TAG t1;
+ char b[64];
+ U32 l;
+
+ memset(&t1,0x00,sizeof(TAG));
+ t1.data = (U8*)b;
+ t1.memsize = 64;
+
+ SetU8(&t1,'F');
+ SetU8(&t1,'W');
+ SetU8(&t1,'S');
+ SetU8(&t1,swf->FileVersion);
+
+ SetU32(&t1,0); // Keep space for filesize
+ SetRect(&t1,&swf->MovieSize);
+ SetU16(&t1,swf->FrameRate);
+ SetU16(&t1,swf->FrameCount);
+
+ l = GetDataSize(&t1);
+ swf->FileSize = l+len;
+ t1.len = 4; // bad & ugly trick !
+ SetU32(&t1,swf->FileSize);
+
+ if (handle>=0)
+ {
+ int ret = write(handle,b,l);
+ if (ret!=l)
+ {
+ #ifdef DEBUG_RFXSWF
+ printf("ret:%d (fd:%d)\n",ret, handle);
+ perror("write:");
+ fprintf(stderr,"WriteSWF() failed: Header.\n");
+ #endif
+ return -1;
+ }
+
+ t = swf->FirstTag;
+ while (t)
+ { if (WriteTag(handle,t)<0) return -1;
+ t = NextTag(t);
+ }
+ }
+ }
+ return (int)swf->FileSize;
+}
+
+int WriteCGI(LPSWF swf)
+{ int len;
+ char s[1024];
+
+ len = WriteSWF(-1,swf);
+
+ if (len<0) return -1;
+
+ sprintf(s,"Content-type: application/x-shockwave-flash\n"\
+ "Accept-Ranges: bytes\n"\
+ "Content-Length: %lu\n"\
+ "Expires: Thu, 13 Apr 2000 23:59:59 GMT\n"\
+ "\n",len);
+
+ write(fileno(stdout),s,strlen(s));
+ return WriteSWF(fileno(stdout),swf);
+}
+
+void FreeTags(LPSWF swf) // Frees all malloc'ed memory for tags
+{ LPTAG t = swf->FirstTag;
+
+ while (t)
+ { LPTAG tnew = t->next;
+ if (t->data) free(t->data);
+ free(t);
+ t = tnew;
+ }
+}
+
+// include advanced functions
+
+#ifdef __NT__
+
+#include "modules\swfdump.c"
+#include "modules\swfshape.c"
+#include "modules\swftext.c"
+#include "modules\swfobject.c"
+#include "modules\swfbutton.c"
+#include "modules\swfbits.c"
+#include "modules\swftools.c"
+#include "modules\swfcgi.c"
+
+#else
+
+#include "modules/swfdump.c"
+#include "modules/swfshape.c"
+#include "modules/swftext.c"
+#include "modules/swfobject.c"
+#include "modules/swfbutton.c"
+#include "modules/swfbits.c"
+#include "modules/swftools.c"
+#include "modules/swfcgi.c"
+
+#endif
+
+
diff --git a/lib/rfxswf.h b/lib/rfxswf.h
new file mode 100644
index 00000000..ca6316ad
--- /dev/null
+++ b/lib/rfxswf.h
@@ -0,0 +1,439 @@
+/* rfxswf.h
+
+ Headers for rfxswf.c and modules
+
+ Part of the swftools package.
+
+ Copyright (c) 2000, 2001 Rainer Böhme <rfxswf@reflex-studio.de>
+
+ This file is distributed under the GPL, see file COPYING for details
+
+*/
+
+#ifndef __RFX_SWF_INCLUDED__
+#define __RFX_SWF_INCLUDED__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "../config.h"
+
+#define DEBUG_RFXSWF
+
+// SWF Types
+
+typedef unsigned long U32;
+typedef signed long S32;
+typedef unsigned short U16;
+typedef signed short S16;
+typedef unsigned char U8;
+typedef signed char S8;
+typedef signed long SFIXED;
+typedef signed long SCOORD;
+
+// Basic Structures
+
+typedef struct _SPOINT
+{ SCOORD x;
+ SCOORD y;
+} SPOINT, * LPSPOINT;
+
+typedef struct _RGBA
+{ U8 r;
+ U8 g;
+ U8 b;
+ U8 a;
+} RGBA, * LPRGBA;
+
+typedef struct _SRECT
+{ SCOORD xmin;
+ SCOORD ymin;
+ SCOORD xmax;
+ SCOORD ymax;
+} SRECT, * LPSRECT;
+
+typedef struct _MATRIX
+{ SFIXED sx; // factor x
+ SFIXED sy;
+ SFIXED r0; // rotation
+ SFIXED r1;
+ SCOORD tx; // delta x
+ SCOORD ty;
+} MATRIX, * LPMATRIX;
+
+typedef struct _CXFORM
+{ S16 a0, a1;
+ S16 r0, r1;
+ S16 g0, g1;
+ S16 b0, b1;
+} CXFORM, * LPCXFORM;
+
+typedef struct _TAG // NEVER access a Tag-Struct directly !
+{ U16 id;
+ U32 len;
+ U8 * data;
+
+ int frame;
+
+ struct _TAG * next;
+ struct _TAG * prev;
+
+ U32 memsize; // to minimize realloc() calls
+ U32 pos; // for Get/Set-Access
+ U8 bitmask; // for Bit-Manipulating Functions [read]
+ U8 bitcount; // [write]
+} TAG, * LPTAG;
+
+typedef struct _SWF
+{ U8 FileVersion;
+ U32 FileSize; // valid after load and save
+ SRECT MovieSize;
+ U16 FrameRate;
+ U16 FrameCount; // valid after load and save
+ LPTAG FirstTag;
+} SWF, * LPSWF;
+
+// Basic Functions
+
+int ReadSWF(int handle,LPSWF swf); // Reads SWF to memory (malloc'ed), returns length or <0 if fails
+int WriteSWF(int handle,LPSWF swf); // Writes SWF to file, returns length or <0 if fails
+int WriteCGI(LPSWF swf); // Outputs SWF with valid CGI header to stdout
+void FreeTags(LPSWF swf); // Frees all malloc'ed memory for swf
+
+LPTAG InsertTag(LPTAG after,U16 id); // updates frames, if necessary
+int DeleteTag(LPTAG t);
+
+void SetTagPos(LPTAG t,U32 pos); // resets Bitcount
+U32 GetTagPos(LPTAG t);
+U8* GetTagPosPtr(LPTAG t);
+
+LPTAG NextTag(LPTAG t);
+LPTAG PrevTag(LPTAG t);
+
+int GetFrameNo(LPTAG t);
+U16 GetTagID(LPTAG t);
+U32 GetDataSize(LPTAG t);
+
+U32 GetBits(LPTAG t,int nbits);
+S32 GetSBits(LPTAG t,int nbits);
+int SetBits(LPTAG t,U32 v,int nbits);
+
+int GetBlock(LPTAG t,U8 * b,int l); // resets Bitcount
+int SetBlock(LPTAG t,U8 * b,int l);
+
+U8 GetU8(LPTAG t); // resets Bitcount
+U16 GetU16(LPTAG t);
+U32 GetU32(LPTAG t);
+
+int SetU8(LPTAG t,U8 v); // resets Bitcount
+int SetU16(LPTAG t,U16 v);
+int SetU32(LPTAG t,U32 v);
+
+int GetPoint(LPTAG t,LPSPOINT p); // resets Bitcount
+int GetRect(LPTAG t,LPSRECT r);
+int GetMatrix(LPTAG t,LPMATRIX m);
+int GetCXForm(LPTAG t,LPCXFORM cx,U8 alpha);
+
+int SetPoint(LPTAG t,LPSPOINT p); // resets Bitcount
+int SetRect(LPTAG t,LPSRECT r);
+int SetMatrix(LPTAG t,LPMATRIX m);
+int SetCXForm(LPTAG t,LPCXFORM cx,U8 alpha);
+int SetRGB(LPTAG t,LPRGBA col);
+int SetRGBA(LPTAG t,LPRGBA col);
+
+// Function Macros
+
+#define GetS8(tag) ((S8)GetU8(tag))
+#define GetS16(tag) ((S16)GetU16(tag))
+#define GetS32(tag) ((S32)GetU32(tag))
+#define GetCoord(tag) ((SCOORD)GetU32(tag))
+#define GetFixed(tag) ((SFIXED)GetU32(tag))
+
+#define SetS8(tag,v) SetU8(tag,(U8)v)
+#define SetS16(tag,v) SetU16(tag,(U16)v)
+#define SetS32(tag,v) SetU32(tag,(U32)v)
+#define SetCoord(tag,v) SetU32(tag,(U32)v)
+#define SetFixed(tag,v) SetU32(tag,(U32)v)
+#define SetString(t,s) SetBlock(t,s,strlen(s)+1)
+
+#define FAILED(b) ((b)<0)
+#define SUCCEDED(b) ((b)>=0)
+
+// Tag IDs (adopted from J. C. Kessels' Form2Flash)
+
+#define ST_END 0
+#define ST_SHOWFRAME 1
+#define ST_DEFINESHAPE 2
+#define ST_FREECHARACTER 3
+#define ST_PLACEOBJECT 4
+#define ST_REMOVEOBJECT 5
+#define ST_DEFINEBITS 6
+#define ST_DEFINEBUTTON 7
+#define ST_JPEGTABLES 8
+#define ST_SETBACKGROUNDCOLOR 9
+#define ST_DEFINEFONT 10
+#define ST_DEFINETEXT 11
+#define ST_DOACTION 12
+#define ST_DEFINEFONTINFO 13
+#define ST_DEFINESOUND 14 /* Event sound tags. */
+#define ST_STARTSOUND 15
+#define ST_DEFINEBUTTONSOUND 17
+#define ST_SOUNDSTREAMHEAD 18
+#define ST_SOUNDSTREAMBLOCK 19
+#define ST_DEFINEBITSLOSSLESS 20 /* A bitmap using lossless zlib compression. */
+#define ST_DEFINEBITSJPEG2 21 /* A bitmap using an internal JPEG compression table. */
+#define ST_DEFINESHAPE2 22
+#define ST_DEFINEBUTTONCXFORM 23
+#define ST_PROTECT 24 /* This file should not be importable for editing. */
+#define ST_PLACEOBJECT2 26 /* The new style place w/ alpha color transform and name. */
+#define ST_REMOVEOBJECT2 28 /* A more compact remove object that omits the character tag (just depth). */
+#define ST_DEFINESHAPE3 32 /* A shape V3 includes alpha values. */
+#define ST_DEFINETEXT2 33 /* A text V2 includes alpha values. */
+#define ST_DEFINEBUTTON2 34 /* A button V2 includes color transform, alpha and multiple actions */
+#define ST_DEFINEBITSJPEG3 35 /* A JPEG bitmap with alpha info. */
+#define ST_DEFINEBITSLOSSLESS2 36 /* A lossless bitmap with alpha info. */
+#define ST_DEFINEEDITTEXT 37
+#define ST_DEFINEMOVIE 38
+#define ST_DEFINESPRITE 39 /* Define a sequence of tags that describe the behavior of a sprite. */
+#define ST_NAMECHARACTER 40 /* Name a character definition, character id and a string, (used for buttons, bitmaps, sprites and sounds). */
+#define ST_SERIALNUMBER 41
+#define ST_GENERATORTEXT 42 /* contains an id */
+#define ST_FRAMELABEL 43 /* A string label for the current frame. */
+#define ST_SOUNDSTREAMHEAD2 45 /* For lossless streaming sound, should not have needed this... */
+#define ST_DEFINEMORPHSHAPE 46 /* A morph shape definition */
+#define ST_DEFINEFONT2 48
+#define ST_TEMPLATECOMMAND 49
+#define ST_GENERATOR3 51
+#define ST_EXTERNALFONT 52
+
+#define ST_REFLEX 777 /* to identify generator software */
+
+// Advanced Funtions
+
+// swfdump.c
+
+void DumpHeader(FILE * f,LPSWF swf);
+void DumpMatrix(FILE * f,LPMATRIX m);
+void DumpTag(FILE * f,LPTAG t);
+char* getTagName(TAG*tag);
+
+// swfshape.c
+
+typedef struct _LINESTYLE
+{ U16 width;
+ RGBA color;
+} LINESTYLE, * LPLINESTYLE;
+
+typedef struct _FILLSTYLE
+{ U8 type;
+ RGBA color;
+ MATRIX m;
+ U16 id_bitmap;
+} FILLSTYLE, * LPFILLSTYLE;
+
+typedef struct _SHAPE // NEVER access a Shape-Struct directly !
+{
+ struct
+ { LPLINESTYLE data;
+ U16 n;
+ } linestyle;
+ // note: changes of shape structure
+ struct // lead to incompatible .efont formats
+ { LPFILLSTYLE data;
+ U16 n;
+ } fillstyle;
+
+ S32 px;
+ S32 py;
+
+ struct
+ { U16 fill;
+ U16 line;
+ } bits;
+
+ U8 * data;
+ U32 bitlen; // length of data in bits
+} SHAPE, * LPSHAPE;
+
+// Shapes
+
+int NewShape(LPSHAPE * s);
+void ShapeFree(LPSHAPE s);
+
+int GetSimpleShape(LPTAG t,LPSHAPE * s); // without Linestyle/Fillstyle Record
+int SetSimpleShape(LPTAG t,LPSHAPE s); // without Linestyle/Fillstyle Record
+
+int ShapeAddLineStyle(LPSHAPE s,U16 width,LPRGBA color);
+int ShapeAddSolidFillStyle(LPSHAPE s,LPRGBA color);
+int ShapeAddBitmapFillStyle(LPSHAPE s,LPMATRIX m,U16 id_bitmap,int clip);
+
+int SetShapeStyles(LPTAG t,LPSHAPE s);
+int ShapeCountBits(LPSHAPE s,U8 * fbits,U8 * lbits);
+int SetShapeBits(LPTAG t,LPSHAPE s);
+int SetShapeHeader(LPTAG t,LPSHAPE s); // one call for upper three functions
+
+int ShapeSetMove(LPTAG t,LPSHAPE s,S32 x,S32 y);
+int ShapeSetStyle(LPTAG t,LPSHAPE s,U16 line,U16 fill0,U16 fill1);
+int ShapeSetAll(LPTAG t,LPSHAPE s,S32 x,S32 y,U16 line,U16 fill0,U16 fill1);
+
+int ShapeSetLine(LPTAG t,LPSHAPE s,S32 x,S32 y);
+int ShapeSetCurve(LPTAG t,LPSHAPE s,S32 x,S32 y,S32 ax,S32 ay);
+int ShapeSetCircle(LPTAG t,LPSHAPE s,S32 x,S32 y,S32 rx,S32 ry);
+int ShapeSetEnd(LPTAG t);
+
+
+// swffont.c
+
+// does not support wide characters !
+
+#define MAX_CHAR_PER_FONT 256
+
+typedef struct _SWFLAYOUT
+{ S16 ascent;
+ S16 descent;
+ S16 leading;
+ SRECT bounds[MAX_CHAR_PER_FONT];
+ struct
+ { U16 count;
+ U8 * data; // size = count*4 bytes
+ } kerning;
+} SWFLAYOUT, * LPSWFLAYOUT;
+
+typedef struct _SWFFONT
+{ U16 id;
+ U8 * name;
+ LPSWFLAYOUT layout;
+
+ U8 flags; // bold/italic/unicode/ansi ...
+
+ U16 codes[MAX_CHAR_PER_FONT];
+
+ struct
+ { U16 advance;
+ U16 gid; // Glyph-ID after DefineFont
+ LPSHAPE shape;
+ } glyph[MAX_CHAR_PER_FONT];
+} SWFFONT, * LPSWFFONT;
+
+typedef struct _FONTUSAGE
+{ U8 code[MAX_CHAR_PER_FONT];
+} FONTUSAGE, * LPFONTUSAGE;
+
+int FontEnumerate(LPSWF swf,void (*FontCallback) (U16,U8*));
+// -> void fontcallback(U16 id,U8 * name); returns number of defined fonts
+
+int FontExtract(LPSWF swf,int id,LPSWFFONT * f);
+// Fetches all available information from DefineFont, DefineFontInfo, DefineText, ...
+// id = FontID, id=0 -> Extract first Font
+
+int FontIsItalic(LPSWFFONT f);
+int FontIsBold(LPSWFFONT f);
+
+int FontSetID(LPSWFFONT f,U16 id);
+int FontReduce(LPSWFFONT f,LPFONTUSAGE use);
+
+int FontInitUsage(LPFONTUSAGE use);
+int FontUse(LPFONTUSAGE use,U8 * s);
+
+int FontSetDefine(LPTAG t,LPSWFFONT f);
+int FontSetInfo(LPTAG t,LPSWFFONT f);
+
+int FontExport(int handle,LPSWFFONT f);
+int FontImport(int handle,LPSWFFONT * f);
+
+void FontFree(LPSWFFONT f);
+
+U32 TextGetWidth(LPSWFFONT font,U8 * s,int scale);
+int TextCountBits(LPSWFFONT font,U8 * s,int scale,U8 * gbits,U8 * abits);
+
+int TextSetInfoRecord(LPTAG t,LPSWFFONT font,U16 size,LPRGBA color,S16 dx,S16 dy);
+int TextSetCharRecord(LPTAG t,LPSWFFONT font,U8 * s,int scale,U8 gbits,U8 abits);
+
+int TextPrintDefineText(LPTAG t,LPSWFFONT f);
+// Prints text defined in tag t with font f to stdout
+
+
+// swfobject.c
+
+// Always use ST_PLACEOBJECT2 !!!
+
+int ObjectPlace(LPTAG t,U16 id,U16 depth,LPMATRIX m,LPCXFORM cx,U8 * name);
+int PlaceObject(LPTAG t,U16 id,U16 depth,LPMATRIX m,LPCXFORM cx,U8 * name, U16 clipaction);
+int ObjectMove(LPTAG t,U16 depth,LPMATRIX m,LPCXFORM cx);
+
+// swfbutton.c
+
+// Button States
+
+#define BS_HIT 0x08
+#define BS_DOWN 0x04
+#define BS_OVER 0x02
+#define BS_UP 0x01
+
+// Button Conditions
+
+#define BC_OVERDOWN_IDLE 0x0100
+#define BC_IDLE_OVERDOWN 0x0080
+#define BC_OUTDOWN_IDLE 0x0040
+#define BC_OUTDOWN_OVERDOWN 0x0020
+#define BC_OVERDOWN_OUTDOWN 0x0010
+#define BC_OVERDOWN_OVERUP 0x0008
+#define BC_OVERUP_OVERDOWN 0x0004
+#define BC_OVERUP_IDLE 0x0002
+#define BC_IDLE_OVERUP 0x0001
+
+#define BC_KEY(c) (c<<9)
+
+#define BC_CURSORLEFT 0x0200
+#define BC_CURSORRIGHT 0x0400
+#define BC_POS1 0x0600
+#define BC_END 0x0800
+#define BC_INSERT 0x0a00
+#define BC_DELETE 0x0c00
+#define BC_BACKSPACE 0x1000
+#define BC_ENTER 0x1a00
+#define BC_CURSORUP 0x1c00
+#define BC_CURSORDOWN 0x1e00
+#define BC_PAGEUP 0x2000
+#define BC_PAGEDOWN 0x2200
+#define BC_TAB 0x2400
+#define BC_SPACE 0x4000
+
+// Button Flag
+
+#define BF_TRACKMENU 0x01
+
+int ButtonSetRecord(LPTAG t,U8 state,U16 id,U16 layer,LPMATRIX m,LPCXFORM cx);
+int ButtonSetCondition(LPTAG t,U16 condition); // for DefineButton2
+int ButtonSetFlags(LPTAG t,U8 flags); // necessary for DefineButton2
+int ButtonPostProcess(LPTAG t,int anz_action); // Set all offsets in DefineButton2-Tags (how many conditions to process)
+
+// swfbits.c
+
+typedef int * LPJPEGBITS; // cover libjpeg structures
+
+LPJPEGBITS SetJPEGBitsStart(LPTAG t,int width,int height,int quality);
+int SetJPEGBitsLines(LPJPEGBITS jpegbits,U8 ** data,int n);
+int SetJPEGBitsLine(LPJPEGBITS jpegbits,U8 * data);
+int SetJPEGBitsFinish(LPJPEGBITS jpegbits);
+
+int SetJPEGBits(LPTAG t,char * fname,int quality); // paste jpg file into swf stream
+
+// swftools.c
+
+char isDefiningTag(LPTAG t);
+char isAllowedSpriteTag(LPTAG t);
+U16 GetDefineID(LPTAG t);
+U16 GetPlaceID(LPTAG t); //PLACEOBJECT, PLACEOBJECT2 (sometimes), REMOVEOBJECT
+U16 GetDepth(LPTAG t); //PLACEOBJECT,PLACEOBJECT2,REMOVEOBJECT,REMOVEOBJECT2
+char* GetName(LPTAG t); //PLACEOBJECT2, FRAMELABEL
+LPMATRIX MatrixJoin(LPMATRIX d,LPMATRIX s1,LPMATRIX s2);
+LPMATRIX MatrixMapTriangle(LPMATRIX m,int dx,int dy,
+ int x0,int y0,int x1,int y1,int x2,int y2);
+
+
+// swfcgi.c
+
+void uncgi(); // same behaviour as Steven Grimm's uncgi-library
+
+#endif
diff --git a/missing b/missing
new file mode 100755
index 00000000..7789652e
--- /dev/null
+++ b/missing
@@ -0,0 +1,190 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+case "$1" in
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing - GNU libit 0.0"
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+ aclocal)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acinclude.m4' or \`configure.in'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`configure.in'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acconfig.h' or \`configure.in'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case "$f" in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f y.tab.h ]; then
+ echo >y.tab.h
+ fi
+ if [ ! -f y.tab.c ]; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f lex.yy.c ]; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+ fi
+ touch $file
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequirements for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755
index 00000000..cd392cdc
--- /dev/null
+++ b/mkinstalldirs
@@ -0,0 +1,40 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+# $Id: mkinstalldirs,v 1.1 2001/10/18 10:31:20 kramm Exp $
+
+errstatus=0
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here
diff --git a/pdf2swf/Makefile.am b/pdf2swf/Makefile.am
new file mode 100644
index 00000000..a88df65a
--- /dev/null
+++ b/pdf2swf/Makefile.am
@@ -0,0 +1,10 @@
+## Process this file with automake to produce Makefile.in
+SUBDIRS = xpdf fonts
+bin_PROGRAMS = pdf2swf
+LDADD =
+pdf2swf_SOURCES = pdf2swf.cc pdfswf.cc pdfswf.h swfoutput.cc swfoutput.h spline.cc spline.h
+pdf2swf_LDADD = ../lib/log.o ../lib/rfxswf.o xpdf/libpdf.a
+INCLUDES = -I../lib -I./xpdf
+man_MANS = pdf2swf.1
+CXXCOMPILE = $(CXX) -DDATADIR=\"$(pkgdatadir)\" $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+
diff --git a/pdf2swf/Makefile.in b/pdf2swf/Makefile.in
new file mode 100644
index 00000000..4d1f1798
--- /dev/null
+++ b/pdf2swf/Makefile.in
@@ -0,0 +1,467 @@
+# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AWK = @AWK@
+CC = @CC@
+CPP = @CPP@
+CXX = @CXX@
+EXEEXT = @EXEEXT@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+SUBDIRS = xpdf fonts
+bin_PROGRAMS = pdf2swf
+LDADD =
+pdf2swf_SOURCES = pdf2swf.cc pdfswf.cc pdfswf.h swfoutput.cc swfoutput.h spline.cc spline.h
+pdf2swf_LDADD = ../lib/log.o ../lib/rfxswf.o xpdf/libpdf.a
+INCLUDES = -I../lib -I./xpdf
+man_MANS = pdf2swf.1
+CXXCOMPILE = $(CXX) -DDATADIR=\"$(pkgdatadir)\" $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+bin_PROGRAMS = pdf2swf$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I..
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+pdf2swf_OBJECTS = pdf2swf.o pdfswf.o swfoutput.o spline.o
+pdf2swf_DEPENDENCIES = ../lib/log.o ../lib/rfxswf.o xpdf/libpdf.a
+pdf2swf_LDFLAGS =
+CXXFLAGS = @CXXFLAGS@
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+man1dir = $(mandir)/man1
+MANS = $(man_MANS)
+
+NROFF = nroff
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+DEP_FILES = .deps/pdf2swf.P .deps/pdfswf.P .deps/spline.P \
+.deps/swfoutput.P
+SOURCES = $(pdf2swf_SOURCES)
+OBJECTS = $(pdf2swf_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .cc .o .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu pdf2swf/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+mostlyclean-binPROGRAMS:
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+distclean-binPROGRAMS:
+
+maintainer-clean-binPROGRAMS:
+
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ list='$(bin_PROGRAMS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+pdf2swf$(EXEEXT): $(pdf2swf_OBJECTS) $(pdf2swf_DEPENDENCIES)
+ @rm -f pdf2swf$(EXEEXT)
+ $(CXXLINK) $(pdf2swf_LDFLAGS) $(pdf2swf_OBJECTS) $(pdf2swf_LDADD) $(LIBS)
+.cc.o:
+ $(CXXCOMPILE) -c $<
+
+install-man1:
+ $(mkinstalldirs) $(DESTDIR)$(man1dir)
+ @list='$(man1_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+ done
+
+uninstall-man1:
+ @list='$(man1_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+ rm -f $(DESTDIR)$(man1dir)/$$inst; \
+ done
+install-man: $(MANS)
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-man1
+uninstall-man:
+ @$(NORMAL_UNINSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) uninstall-man1
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ test "$$subdir" = "." && dot_seen=yes; \
+ done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = pdf2swf
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu pdf2swf/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+ for subdir in $(SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+ done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+ @echo '$(COMPILE) -c $<'; \
+ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
+
+%.lo: %.c
+ @echo '$(LTCOMPILE) -c $<'; \
+ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+
+%.o: %.cc
+ @echo '$(CXXCOMPILE) -c $<'; \
+ $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
+
+%.lo: %.cc
+ @echo '$(LTCXXCOMPILE) -c $<'; \
+ $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+install-exec-am: install-binPROGRAMS
+install-exec: install-exec-recursive
+
+install-data-am: install-man
+install-data: install-data-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am: uninstall-binPROGRAMS uninstall-man
+uninstall: uninstall-recursive
+all-am: Makefile $(PROGRAMS) $(MANS)
+all-redirect: all-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+ $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
+ mostlyclean-tags mostlyclean-depend mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am: clean-binPROGRAMS clean-compile clean-tags clean-depend \
+ clean-generic mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \
+ distclean-depend distclean-generic clean-am
+
+distclean: distclean-recursive
+
+maintainer-clean-am: maintainer-clean-binPROGRAMS \
+ maintainer-clean-compile maintainer-clean-tags \
+ maintainer-clean-depend maintainer-clean-generic \
+ distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+
+.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile install-man1 uninstall-man1 install-man \
+uninstall-man install-data-recursive uninstall-data-recursive \
+install-exec-recursive uninstall-exec-recursive installdirs-recursive \
+uninstalldirs-recursive all-recursive check-recursive \
+installcheck-recursive info-recursive dvi-recursive \
+mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir \
+mostlyclean-depend distclean-depend clean-depend \
+maintainer-clean-depend info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs-am installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc
new file mode 100644
index 00000000..766bd6be
--- /dev/null
+++ b/pdf2swf/SWFOutputDev.cc
@@ -0,0 +1,1104 @@
+/* pdfswf.cc
+ implements a pdf output device (OutputDev).
+
+ This file is part of swftools.
+
+ Swftools is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Swftools is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with swftools; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+//xpdf header files
+#include "GString.h"
+#include "gmem.h"
+#include "Object.h"
+#include "Stream.h"
+#include "Array.h"
+#include "Dict.h"
+#include "XRef.h"
+#include "Catalog.h"
+#include "Page.h"
+#include "PDFDoc.h"
+#include "Params.h"
+#include "Error.h"
+#include "config.h"
+#include "OutputDev.h"
+#include "GfxState.h"
+#include "GfxFont.h"
+#include "FontFile.h"
+//swftools header files
+#include "swfoutput.h"
+extern "C" {
+#include "../lib/log.h"
+}
+
+static char* filename = 0;
+
+static void printInfoString(Dict *infoDict, char *key, char *fmt);
+static void printInfoDate(Dict *infoDict, char *key, char *fmt);
+
+static char userPassword[33] = "";
+static GBool printVersion = gFalse;
+static GBool printHelp = gFalse;
+
+double fontsizes[] =
+{
+ 0.833,0.833,0.889,0.889,0.788,0.722,0.833,0.778,0.600,0.600,0.600,0.600,0.576,0.576,0.576,0.576
+};
+char*fontnames[]={
+"Helvetica",
+"Helvetica-Bold",
+"Helvetica-BoldOblique",
+"Helvetica-Oblique",
+"Times-Roman",
+"Times-Bold",
+"Times-BoldItalic",
+"Times-Italic",
+"Courier",
+"Courier-Bold",
+"Courier-BoldOblique",
+"Courier-Oblique",
+"Symbol",
+"Symbol",
+"Symbol",
+"Symbol",
+"ZapfDingBats"
+};
+
+struct mapping {
+ char*pdffont;
+ char*filename;
+ int id;
+} pdf2t1map[] ={
+{"Times-Roman", "n021003l.pfb"},
+{"Times-Italic", "n021023l.pfb"},
+{"Times-Bold", "n021004l.pfb"},
+{"Times-BoldItalic", "n021024l.pfb"},
+{"Helvetica", "n019003l.pfb"},
+{"Helvetica-Oblique", "n019023l.pfb"},
+{"Helvetica-Bold", "n019004l.pfb"},
+{"Helvetica-BoldOblique", "n019024l.pfb"},
+{"Courier", "n022003l.pfb"},
+{"Courier-Oblique", "n022023l.pfb"},
+{"Courier-Bold", "n022004l.pfb"},
+{"Courier-BoldOblique", "n022024l.pfb"},
+{"Symbol", "s050000l.pfb"},
+{"ZapfDingbats", "d050000l.pfb"}};
+
+static void printInfoString(Dict *infoDict, char *key, char *fmt) {
+ Object obj;
+ GString *s1, *s2;
+ int i;
+
+ if (infoDict->lookup(key, &obj)->isString()) {
+ s1 = obj.getString();
+ if ((s1->getChar(0) & 0xff) == 0xfe &&
+ (s1->getChar(1) & 0xff) == 0xff) {
+ s2 = new GString();
+ for (i = 2; i < obj.getString()->getLength(); i += 2) {
+ if (s1->getChar(i) == '\0') {
+ s2->append(s1->getChar(i+1));
+ } else {
+ delete s2;
+ s2 = new GString("<unicode>");
+ break;
+ }
+ }
+ printf(fmt, s2->getCString());
+ delete s2;
+ } else {
+ printf(fmt, s1->getCString());
+ }
+ }
+ obj.free();
+}
+
+static void printInfoDate(Dict *infoDict, char *key, char *fmt) {
+ Object obj;
+ char *s;
+
+ if (infoDict->lookup(key, &obj)->isString()) {
+ s = obj.getString()->getCString();
+ if (s[0] == 'D' && s[1] == ':') {
+ s += 2;
+ }
+ printf(fmt, s);
+ }
+ obj.free();
+}
+
+class GfxState;
+class GfxImageColorMap;
+
+class SWFOutputDev: public OutputDev {
+ struct swfoutput output;
+ int outputstarted;
+public:
+
+ // Constructor.
+ SWFOutputDev();
+
+ // Destructor.
+ virtual ~SWFOutputDev() ;
+
+ //----- get info about output device
+
+ // Does this device use upside-down coordinates?
+ // (Upside-down means (0,0) is the top left corner of the page.)
+ virtual GBool upsideDown();
+
+ // Does this device use drawChar() or drawString()?
+ virtual GBool useDrawChar();
+
+ //----- initialization and control
+
+ // Start a page.
+ virtual void startPage(int pageNum, GfxState *state) ;
+
+ //----- link borders
+ virtual void drawLink(Link *link, Catalog *catalog) ;
+
+ //----- save/restore graphics state
+ virtual void saveState(GfxState *state) ;
+ virtual void restoreState(GfxState *state) ;
+
+ //----- update graphics state
+
+ virtual void updateFont(GfxState *state);
+ virtual void updateFillColor(GfxState *state);
+ virtual void updateStrokeColor(GfxState *state);
+ virtual void updateLineWidth(GfxState *state);
+
+ virtual void updateAll(GfxState *state)
+ {
+ updateFont(state);
+ updateFillColor(state);
+ updateStrokeColor(state);
+ updateLineWidth(state);
+ };
+
+ //----- path painting
+ virtual void stroke(GfxState *state) ;
+ virtual void fill(GfxState *state) ;
+ virtual void eoFill(GfxState *state) ;
+
+ //----- path clipping
+ virtual void clip(GfxState *state) ;
+ virtual void eoClip(GfxState *state) ;
+
+ //----- text drawing
+ virtual void beginString(GfxState *state, GString *s) ;
+ virtual void endString(GfxState *state) ;
+ virtual void drawChar(GfxState *state, double x, double y,
+ double dx, double dy, Guchar c) ;
+ virtual void drawChar16(GfxState *state, double x, double y,
+ double dx, double dy, int c) ;
+
+ //----- image drawing
+ virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
+ int width, int height, GBool invert,
+ GBool inlineImg);
+ virtual void drawImage(GfxState *state, Object *ref, Stream *str,
+ int width, int height, GfxImageColorMap *colorMap,
+ GBool inlineImg);
+
+ private:
+ int clipping[32];
+ int clippos;
+
+ int setT1Font(char*name,FontEncoding*enc);
+ int initT1Font(int id, FontEncoding*encoding);
+ int t1id;
+};
+
+char mybuf[1024];
+char* gfxstate2str(GfxState *state)
+{
+ char*bufpos = mybuf;
+ GfxRGB rgb;
+ bufpos+=sprintf(bufpos,"CTM[%.3f/%.3f/%.3f/%.3f/%.3f/%.3f] ",
+ state->getCTM()[0],
+ state->getCTM()[1],
+ state->getCTM()[2],
+ state->getCTM()[3],
+ state->getCTM()[4],
+ state->getCTM()[5]);
+ if(state->getX1()!=0.0)
+ bufpos+=sprintf(bufpos,"X1-%.1f ",state->getX1());
+ if(state->getY1()!=0.0)
+ bufpos+=sprintf(bufpos,"Y1-%.1f ",state->getY1());
+ bufpos+=sprintf(bufpos,"X2-%.1f ",state->getX2());
+ bufpos+=sprintf(bufpos,"Y2-%.1f ",state->getY2());
+ bufpos+=sprintf(bufpos,"PW%.1f ",state->getPageWidth());
+ bufpos+=sprintf(bufpos,"PH%.1f ",state->getPageHeight());
+ /*bufpos+=sprintf(bufpos,"FC[%.1f/%.1f] ",
+ state->getFillColor()->c[0], state->getFillColor()->c[1]);
+ bufpos+=sprintf(bufpos,"SC[%.1f/%.1f] ",
+ state->getStrokeColor()->c[0], state->getFillColor()->c[1]);*/
+/* bufpos+=sprintf(bufpos,"FC[%.1f/%.1f/%.1f/%.1f/%.1f/%.1f/%.1f/%.1f]",
+ state->getFillColor()->c[0], state->getFillColor()->c[1],
+ state->getFillColor()->c[2], state->getFillColor()->c[3],
+ state->getFillColor()->c[4], state->getFillColor()->c[5],
+ state->getFillColor()->c[6], state->getFillColor()->c[7]);
+ bufpos+=sprintf(bufpos,"SC[%.1f/%.1f/%.1f/%.1f/%.1f/%.1f/%.1f/%.1f]",
+ state->getStrokeColor()->c[0], state->getFillColor()->c[1],
+ state->getStrokeColor()->c[2], state->getFillColor()->c[3],
+ state->getStrokeColor()->c[4], state->getFillColor()->c[5],
+ state->getStrokeColor()->c[6], state->getFillColor()->c[7]);*/
+ state->getFillRGB(&rgb);
+ if(rgb.r || rgb.g || rgb.b)
+ bufpos+=sprintf(bufpos,"FR[%.1f/%.1f/%.1f] ", rgb.r,rgb.g,rgb.b);
+ state->getStrokeRGB(&rgb);
+ if(rgb.r || rgb.g || rgb.b)
+ bufpos+=sprintf(bufpos,"SR[%.1f/%.1f/%.1f] ", rgb.r,rgb.g,rgb.b);
+ if(state->getFillColorSpace()->getNComps()>1)
+ bufpos+=sprintf(bufpos,"CS[[%d]] ",state->getFillColorSpace()->getNComps());
+ if(state->getStrokeColorSpace()->getNComps()>1)
+ bufpos+=sprintf(bufpos,"SS[[%d]] ",state->getStrokeColorSpace()->getNComps());
+ if(state->getFillPattern())
+ bufpos+=sprintf(bufpos,"FP%08x ", state->getFillPattern());
+ if(state->getStrokePattern())
+ bufpos+=sprintf(bufpos,"SP%08x ", state->getStrokePattern());
+
+ if(state->getFillOpacity()!=1.0)
+ bufpos+=sprintf(bufpos,"FO%.1f ", state->getFillOpacity());
+ if(state->getStrokeOpacity()!=1.0)
+ bufpos+=sprintf(bufpos,"SO%.1f ", state->getStrokeOpacity());
+
+ bufpos+=sprintf(bufpos,"LW%.1f ", state->getLineWidth());
+
+ double * dash;
+ int length;
+ double start;
+ state->getLineDash(&dash, &length, &start);
+ int t;
+ if(length)
+ {
+ bufpos+=sprintf(bufpos,"DASH%.1f[",start);
+ for(t=0;t<length;t++) {
+ bufpos+=sprintf(bufpos,"D%.1f",dash[t]);
+ }
+ bufpos+=sprintf(bufpos,"]");
+ }
+
+ if(state->getFlatness()!=1)
+ bufpos+=sprintf(bufpos,"F%d ", state->getFlatness());
+ if(state->getLineJoin()!=0)
+ bufpos+=sprintf(bufpos,"J%d ", state->getLineJoin());
+ if(state->getLineJoin()!=0)
+ bufpos+=sprintf(bufpos,"C%d ", state->getLineCap());
+ if(state->getLineJoin()!=0)
+ bufpos+=sprintf(bufpos,"ML%d ", state->getMiterLimit());
+
+ if(state->getFont() && state->getFont()->getName() && state->getFont()->getName()->getCString())
+ bufpos+=sprintf(bufpos,"F\"%s\" ",((state->getFont())->getName())->getCString());
+ bufpos+=sprintf(bufpos,"FS%.1f ", state->getFontSize());
+ bufpos+=sprintf(bufpos,"MAT[%.1f/%.1f/%.1f/%.1f/%.1f/%.1f] ", state->getTextMat()[0],state->getTextMat()[1],state->getTextMat()[2],
+ state->getTextMat()[3],state->getTextMat()[4],state->getTextMat()[5]);
+ if(state->getCharSpace())
+ bufpos+=sprintf(bufpos,"CS%.5f ", state->getCharSpace());
+ if(state->getWordSpace())
+ bufpos+=sprintf(bufpos,"WS%.5f ", state->getWordSpace());
+ if(state->getHorizScaling()!=1.0)
+ bufpos+=sprintf(bufpos,"SC%.1f ", state->getHorizScaling());
+ if(state->getLeading())
+ bufpos+=sprintf(bufpos,"L%.1f ", state->getLeading());
+ if(state->getRise())
+ bufpos+=sprintf(bufpos,"R%.1f ", state->getRise());
+ if(state->getRender())
+ bufpos+=sprintf(bufpos,"R%d ", state->getRender());
+ bufpos+=sprintf(bufpos,"P%08x ", state->getPath());
+ bufpos+=sprintf(bufpos,"CX%.1f ", state->getCurX());
+ bufpos+=sprintf(bufpos,"CY%.1f ", state->getCurY());
+ if(state->getLineX())
+ bufpos+=sprintf(bufpos,"LX%.1f ", state->getLineX());
+ if(state->getLineY())
+ bufpos+=sprintf(bufpos,"LY%.1f ", state->getLineY());
+ bufpos+=sprintf(bufpos," ");
+ return mybuf;
+}
+
+void dumpFontInfo(char*loglevel, GfxFont*font);
+int lastdumps[1024];
+int lastdumppos = 0;
+/* nr = 0 unknown
+ nr = 1 substituting
+ nr = 2 type 3
+ */
+void showFontError(GfxFont*font, int nr)
+{
+ Ref r=font->getID();
+ int t;
+ for(t=0;t<lastdumppos;t++)
+ if(lastdumps[t] == r.num)
+ break;
+ if(t < lastdumppos)
+ return;
+ if(lastdumppos<sizeof(lastdumps)/sizeof(int))
+ lastdumps[lastdumppos++] = r.num;
+ if(nr == 0)
+ logf("<error> The following font caused problems:");
+ else if(nr == 1)
+ logf("<error> The following font caused problems (substituting):");
+ else if(nr == 2)
+ logf("<error> This document contains Type 3 Fonts: (some text may be incorrectly displayed)");
+
+ dumpFontInfo("<error>", font);
+}
+
+void dumpFontInfo(char*loglevel, GfxFont*font)
+{
+ GString *gstr;
+ char*name;
+ gstr = font->getName();
+ Ref r=font->getID();
+ logf("%s=========== %s (ID:%d) ==========\n", loglevel, gstr?gstr->getCString():"(unknown font)", r.num);
+
+ gstr = font->getTag();
+ if(gstr)
+ logf("%sTag: %s\n", loglevel, gstr->getCString());
+ if(font->is16Bit()) logf("%sis 16 bit\n", loglevel);
+
+ GfxFontType type=font->getType();
+ switch(type) {
+ case fontUnknownType:
+ logf("%sType: unknown\n",loglevel);
+ break;
+ case fontType0:
+ logf("%sType: 0\n",loglevel);
+ break;
+ case fontType1:
+ logf("%sType: 1\n",loglevel);
+ break;
+ case fontType1C:
+ logf("%sType: 1C\n",loglevel);
+ break;
+ case fontType3:
+ logf("%sType: 3\n",loglevel);
+ break;
+ case fontTrueType:
+ logf("%sType: TrueType\n",loglevel);
+ break;
+ }
+ name = font->getEmbeddedFontName();
+ if(name)
+ logf("%sEmbedded name: %s\n",loglevel, name);
+
+ gstr = font->getExtFontFile();
+ if(gstr)
+ logf("%sExternal Font file: %s\n", loglevel, gstr->getCString());
+
+ // Get font descriptor flags.
+ if(font->isFixedWidth()) logf("%sis fixed width\n", loglevel);
+ if(font->isSerif()) logf("%sis serif\n", loglevel);
+ if(font->isSymbolic()) logf("%sis symbolic\n", loglevel);
+ if(font->isItalic()) logf("%sis italic\n", loglevel);
+ if(font->isBold()) logf("%sis bold\n", loglevel);
+}
+
+//void SWFOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg) {printf("void SWFOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg) \n");}
+//void SWFOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool inlineImg) {printf("void SWFOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool inlineImg) \n");}
+
+SWFOutputDev::SWFOutputDev()
+{
+ clippos = 0;
+ clipping[clippos] = 0;
+ outputstarted = 0;
+// printf("SWFOutputDev::SWFOutputDev() \n");
+};
+
+T1_OUTLINE* gfxPath_to_T1_OUTLINE(GfxState*state, GfxPath*path)
+{
+ int num = path->getNumSubpaths();
+ int s,t;
+ bezierpathsegment*start,*last;
+ bezierpathsegment*outline = start = new bezierpathsegment();
+ int cpos = 0;
+ double lastx=0,lasty=0;
+ for(t = 0; t < num; t++) {
+ GfxSubpath *subpath = path->getSubpath(t);
+ int subnum = subpath->getNumPoints();
+
+ for(s=0;s<subnum;s++) {
+ double nx,ny;
+ state->transform(subpath->getX(s),subpath->getY(s),&nx,&ny);
+ int x = (int)((nx-lastx)*0xffff);
+ int y = (int)((ny-lasty)*0xffff);
+ if(s==0)
+ {
+ last = outline;
+ outline->type = T1_PATHTYPE_MOVE;
+ outline->dest.x = x;
+ outline->dest.y = y;
+ outline->link = (T1_OUTLINE*)new bezierpathsegment();
+ outline = (bezierpathsegment*)outline->link;
+ cpos = 0;
+ lastx = nx;
+ lasty = ny;
+ }
+ else if(subpath->getCurve(s) && !cpos)
+ {
+ outline->B.x = x;
+ outline->B.y = y;
+ cpos = 1;
+ }
+ else if(subpath->getCurve(s) && cpos)
+ {
+ outline->C.x = x;
+ outline->C.y = y;
+ cpos = 2;
+ }
+ else
+ {
+ last = outline;
+ outline->dest.x = x;
+ outline->dest.y = y;
+ outline->type = cpos?T1_PATHTYPE_BEZIER:T1_PATHTYPE_LINE;
+ outline->link = 0;
+ outline->link = (T1_OUTLINE*)new bezierpathsegment();
+ outline = (bezierpathsegment*)outline->link;
+ cpos = 0;
+ lastx = nx;
+ lasty = ny;
+ }
+ }
+ }
+ last->link = 0;
+ return (T1_OUTLINE*)start;
+}
+/*----------------------------------------------------------------------------
+ * Primitive Graphic routines
+ *----------------------------------------------------------------------------*/
+
+void SWFOutputDev::stroke(GfxState *state)
+{
+ logf("<debug> %s stroke\n",gfxstate2str(state));
+ GfxPath * path = state->getPath();
+ struct swfmatrix m;
+ m.m11 = 1; m.m21 = 0; m.m22 = 1;
+ m.m21 = 0; m.m13 = 0; m.m23 = 0;
+ T1_OUTLINE*outline = gfxPath_to_T1_OUTLINE(state, path);
+ swfoutput_setdrawmode(&output, DRAWMODE_STROKE);
+ swfoutput_drawpath(&output, outline, &m);
+}
+void SWFOutputDev::fill(GfxState *state)
+{
+ logf("<debug> %s fill\n",gfxstate2str(state));
+ GfxPath * path = state->getPath();
+ struct swfmatrix m;
+ m.m11 = 1; m.m21 = 0; m.m22 = 1;
+ m.m21 = 0; m.m13 = 0; m.m23 = 0;
+ T1_OUTLINE*outline = gfxPath_to_T1_OUTLINE(state, path);
+ swfoutput_setdrawmode(&output, DRAWMODE_FILL);
+ swfoutput_drawpath(&output, outline, &m);
+}
+void SWFOutputDev::eoFill(GfxState *state)
+{
+ logf("<debug> %s eofill\n",gfxstate2str(state));
+ GfxPath * path = state->getPath();
+ struct swfmatrix m;
+ m.m11 = 1; m.m21 = 0; m.m22 = 1;
+ m.m21 = 0; m.m13 = 0; m.m23 = 0;
+ T1_OUTLINE*outline = gfxPath_to_T1_OUTLINE(state, path);
+ swfoutput_setdrawmode(&output, DRAWMODE_EOFILL);
+ swfoutput_drawpath(&output, outline, &m);
+}
+void SWFOutputDev::clip(GfxState *state)
+{
+ logf("<debug> %s clip\n",gfxstate2str(state));
+ GfxPath * path = state->getPath();
+ struct swfmatrix m;
+ m.m11 = 1; m.m21 = 0; m.m22 = 1;
+ m.m21 = 0; m.m13 = 0; m.m23 = 0;
+ T1_OUTLINE*outline = gfxPath_to_T1_OUTLINE(state, path);
+ swfoutput_startclip(&output, outline, &m);
+ clipping[clippos] = 1;
+}
+void SWFOutputDev::eoClip(GfxState *state)
+{
+ logf("<debug> %s eoclip\n",gfxstate2str(state));
+ GfxPath * path = state->getPath();
+ struct swfmatrix m;
+ m.m11 = 1; m.m21 = 0; m.m22 = 1;
+ m.m21 = 0; m.m13 = 0; m.m23 = 0;
+ T1_OUTLINE*outline = gfxPath_to_T1_OUTLINE(state, path);
+ swfoutput_startclip(&output, outline, &m);
+ clipping[clippos] = 1;
+}
+
+SWFOutputDev::~SWFOutputDev()
+{
+ swfoutput_destroy(&output);
+ outputstarted = 0;
+};
+GBool SWFOutputDev::upsideDown()
+{
+ logf("<debug> upsidedown?");
+ return gTrue;
+};
+GBool SWFOutputDev::useDrawChar()
+{
+ logf("<debug> usedrawchar?");
+ return gTrue;
+}
+
+void SWFOutputDev::beginString(GfxState *state, GString *s)
+{
+ double m11,m21,m12,m22;
+ logf("<debug> %s beginstring \"%s\"\n", gfxstate2str(state), s->getCString());
+ state->getFontTransMat(&m11, &m12, &m21, &m22);
+ m11 *= state->getHorizScaling();
+ m21 *= state->getHorizScaling();
+ swfoutput_setfontmatrix(&output,m11,-m12,m21,-m22);
+}
+
+int charcounter = 0;
+void SWFOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, Guchar c)
+{
+ logf("<debug> %s drawChar(%f,%f,%f,%f,'%c')\n",gfxstate2str(state), x,y,dx,dy,c);
+ // check for invisible text -- this is used by Acrobat Capture
+ if ((state->getRender() & 3) != 3)
+ {
+ FontEncoding*enc=state->getFont()->getEncoding();
+
+ double x1,y1;
+ x1 = x;
+ y1 = y;
+ state->transform(x, y, &x1, &y1);
+
+ swfoutput_drawchar(&output, x1, y1, c);
+ }
+}
+
+void SWFOutputDev::drawChar16(GfxState *state, double x, double y, double dx, double dy, int c)
+{
+ printf("<error> %s drawChar16(%f,%f,%f,%f,%08x)\n",gfxstate2str(state), x,y,dx,dy,c);
+ exit(1);
+}
+
+void SWFOutputDev::endString(GfxState *state)
+{
+ logf("<debug> %s endstring\n", gfxstate2str(state));
+}
+
+void SWFOutputDev::startPage(int pageNum, GfxState *state)
+{
+ double x1,y1,x2,y2;
+ logf("<debug> %s, startPage %d\n", gfxstate2str(state), pageNum);
+ logf("<notice> processing page %d", pageNum);
+
+ state->transform(state->getX1(),state->getY1(),&x1,&y1);
+ state->transform(state->getX2(),state->getY2(),&x2,&y2);
+ if(!outputstarted) {
+ swfoutput_init(&output, filename, abs((int)(x2-x1)),abs((int)(y2-y1)));
+ outputstarted = 1;
+ }
+ else
+ swfoutput_newpage(&output);
+}
+
+void SWFOutputDev::drawLink(Link *link, Catalog *catalog)
+{
+ logf("<debug> drawlink\n");
+ double x1, y1, x2, y2, w;
+ GfxRGB rgb;
+ swfcoord points[5];
+ int x, y;
+
+ link->getBorder(&x1, &y1, &x2, &y2, &w);
+ if (w > 0) {
+ rgb.r = 0;
+ rgb.g = 0;
+ rgb.b = 1;
+ cvtUserToDev(x1, y1, &x, &y);
+ points[0].x = points[4].x = x;
+ points[0].y = points[4].y = y;
+ cvtUserToDev(x2, y1, &x, &y);
+ points[1].x = x;
+ points[1].y = y;
+ cvtUserToDev(x2, y2, &x, &y);
+ points[2].x = x;
+ points[2].y = y;
+ cvtUserToDev(x1, y2, &x, &y);
+ points[3].x = x;
+ points[3].y = y;
+ //PDF: draw rect
+ LinkAction*action=link->getAction();
+ char*s;
+ switch(action->getKind())
+ {
+ case actionGoTo: {
+ LinkGoTo*l = (LinkGoTo*)action;
+ s = l->getNamedDest()->getCString();
+ }
+ break;
+ case actionGoToR: {
+ LinkGoToR*l = (LinkGoToR*)action;
+ s = l->getNamedDest()->getCString();
+ }
+ break;
+ case actionLaunch: {
+ LinkLaunch*l = (LinkLaunch*)action;
+ GString * str = new GString(l->getFileName());
+ str->append(l->getParams());
+ s = str->getCString();
+ }
+ break;
+ case actionURI: {
+ LinkURI*l = (LinkURI*)action;
+ s = l->getURI()->getCString();
+ }
+ break;
+ case actionNamed: {
+ LinkNamed*l = (LinkNamed*)action;
+ s = l->getName()->getCString();
+ }
+ break;
+ case actionUnknown: {
+ LinkUnknown*l = (LinkUnknown*)action;
+ s = "";
+ }
+ break;
+ }
+ logf("<verbose> link to \"%s\"\n", s);
+ }
+}
+
+void SWFOutputDev::saveState(GfxState *state) {
+ logf("<debug> %s saveState\n", gfxstate2str(state));
+ updateAll(state);
+ clippos ++;
+ clipping[clippos] = 0;
+};
+
+void SWFOutputDev::restoreState(GfxState *state) {
+ logf("<debug> %s restoreState\n", gfxstate2str(state));
+ updateAll(state);
+ if(clipping[clippos])
+ swfoutput_endclip(&output);
+ clippos--;
+}
+
+char type3Warning=0;
+
+int SWFOutputDev::setT1Font(char*name, FontEncoding*encoding)
+{
+ int i;
+
+ int id=-1;
+ int mapid=-1;
+ char*filename=0;
+ for(i=0;i<sizeof(pdf2t1map)/sizeof(mapping);i++)
+ {
+ if(!strcmp(name, pdf2t1map[i].pdffont))
+ {
+ filename = pdf2t1map[i].filename;
+ mapid = i;
+ }
+ }
+ if(filename)
+ for(i=0; i<T1_Get_no_fonts(); i++)
+ {
+ char*fontfilename = T1_GetFontFileName (i);
+ if(strstr(fontfilename, filename))
+ {
+ id = i;
+ pdf2t1map[i].id = mapid;
+ }
+ }
+ if(id<0)
+ return 0;
+
+ initT1Font(id, encoding);
+}
+
+int SWFOutputDev::initT1Font(int id, FontEncoding*encoding)
+{
+ int encStrSize;
+ char *encPtr;
+ int i;
+ T1_DeleteFont(id);
+ T1_LoadFont(id);
+ /* reencode the font:
+ * This is the only way to get the unmapped characters
+ * from t1lib
+ */
+ encStrSize = 0;
+ for (i = 0; i < 256 && i < encoding->getSize(); ++i) {
+ if (encoding->getCharName(i)) {
+ encStrSize += strlen(encoding->getCharName(i)) + 1;
+ }
+ }
+ char**enc = (char **)gmalloc(257 * sizeof(char *));
+ char*encStr = (char *)gmalloc(encStrSize * sizeof(char));
+ encPtr = encStr;
+ for (i = 0; i < 256 && i < encoding->getSize(); ++i) {
+ if (encoding->getCharName(i)) {
+ strcpy(encPtr, encoding->getCharName(i));
+ enc[i] = encPtr;
+ encPtr += strlen(encPtr) + 1;
+ } else {
+ enc[i] = ".notdef";
+ }
+ }
+ for (; i < 256; ++i) {
+ enc[i] = ".notdef";
+ }
+ enc[256] = "custom";
+ int ret=T1_ReencodeFont(id, enc);
+ t1id = id;
+ return 1;
+}
+
+void SWFOutputDev::updateLineWidth(GfxState *state)
+{
+ double width = state->getLineWidth();
+ swfoutput_setlinewidth(&output, width);
+}
+
+void SWFOutputDev::updateFillColor(GfxState *state)
+{
+ GfxRGB rgb;
+ double opaq = state->getFillOpacity();
+ state->getFillRGB(&rgb);
+
+ swfoutput_setfillcolor(&output, (char)(rgb.r*255), (char)(rgb.g*255),
+ (char)(rgb.b*255), (char)(opaq*255));
+}
+
+void SWFOutputDev::updateStrokeColor(GfxState *state)
+{
+ GfxRGB rgb;
+ double opaq = state->getStrokeOpacity();
+ state->getStrokeRGB(&rgb);
+
+ swfoutput_setstrokecolor(&output, (char)(rgb.r*255), (char)(rgb.g*255),
+ (char)(rgb.b*255), (char)(opaq*255));
+}
+
+void SWFOutputDev::updateFont(GfxState *state) {
+ double m11, m12, m21, m22;
+ char * fontname = 0;
+ GfxFont*gfxFont = state->getFont();
+ char * filename;
+
+ if (!gfxFont) {
+ return;
+ }
+ // look for Type 3 font
+ if (!type3Warning && gfxFont->getType() == fontType3) {
+ type3Warning = gTrue;
+ showFontError(gfxFont, 2);
+ }
+ //dumpFontInfo (gfxFont);
+
+
+ Ref embRef;
+ GBool embedded = gfxFont->getEmbeddedFontID(&embRef);
+ if(embedded) {
+ char*tmpFileName = NULL;
+ char*fileName = NULL;
+ FILE *f;
+ char *fontBuf;
+ int fontLen;
+ Type1CFontConverter *cvt;
+ Ref embRef;
+ Object refObj, strObj;
+ int c;
+ if (!gfxFont->is16Bit() &&
+ (gfxFont->getType() == fontType1 ||
+ gfxFont->getType() == fontType1C) &&
+ gfxFont->getEmbeddedFontID(&embRef)) {
+ tmpFileName = "tmpfont";
+ f = fopen(tmpFileName, "wb");
+ if (!f) {
+ logf("<error> Couldn't create temporary Type 1 font file");
+ return;
+ }
+ if (gfxFont->getType() == fontType1C) {
+ if (!(fontBuf = gfxFont->readEmbFontFile(&fontLen))) {
+ fclose(f);
+ logf("<error> Couldn't read embedded font file");
+ return ;
+ }
+ cvt = new Type1CFontConverter(fontBuf, fontLen, f);
+ cvt->convert();
+ delete cvt;
+ gfree(fontBuf);
+ } else {
+ gfxFont->getEmbeddedFontID(&embRef);
+ refObj.initRef(embRef.num, embRef.gen);
+ refObj.fetch(&strObj);
+ refObj.free();
+ strObj.streamReset();
+ while ((c = strObj.streamGetChar()) != EOF) {
+ fputc(c, f);
+ }
+ strObj.streamClose();
+ strObj.free();
+ }
+ fclose(f);
+ fileName = tmpFileName;
+ if(!fileName) {
+ logf("<error> Embedded font writer didn't create a file");
+ return ;
+ }
+ }
+ else {
+ showFontError(gfxFont,0);
+ return ;
+ }
+ t1id = T1_AddFont(fileName);
+ initT1Font(t1id, gfxFont->getEncoding());
+ } else {
+ fontname = NULL;
+ if(gfxFont->getName()) {
+ fontname = gfxFont->getName()->getCString();
+ //logf("<notice> Processing font %s", fontname);
+ }
+ if(!fontname || !setT1Font(state->getFont()->getName()->getCString(), gfxFont->getEncoding()))
+ { //substitute font
+ int index;
+ int code;
+ double w,w1,w2;
+ double*fm;
+ double v;
+ showFontError(gfxFont, 1);
+ if (!gfxFont->is16Bit()) {
+ if (gfxFont->isFixedWidth()) {
+ index = 8;
+ } else if (gfxFont->isSerif()) {
+ index = 4;
+ } else {
+ index = 0;
+ }
+ if (gfxFont->isBold())
+ index += 2;
+ if (gfxFont->isItalic())
+ index += 1;
+ fontname = fontnames[index];
+ // get width of 'm' in real font and substituted font
+ if ((code = gfxFont->getCharCode("m")) >= 0)
+ w1 = gfxFont->getWidth(code);
+ else
+ w1 = 0;
+ w2 = fontsizes[index];
+ if (gfxFont->getType() == fontType3) {
+ // This is a hack which makes it possible to substitute for some
+ // Type 3 fonts. The problem is that it's impossible to know what
+ // the base coordinate system used in the font is without actually
+ // rendering the font. This code tries to guess by looking at the
+ // width of the character 'm' (which breaks if the font is a
+ // subset that doesn't contain 'm').
+ if (w1 > 0 && (w1 > 1.1 * w2 || w1 < 0.9 * w2)) {
+ w1 /= w2;
+ m11 *= w1;
+ m12 *= w1;
+ m21 *= w1;
+ m22 *= w1;
+ }
+ fm = gfxFont->getFontMatrix();
+ v = (fm[0] == 0) ? 1 : (fm[3] / fm[0]);
+ m21 *= v;
+ m22 *= v;
+ } else if (!gfxFont->isSymbolic()) {
+ // if real font is substantially narrower than substituted
+ // font, reduce the font size accordingly
+ if (w1 > 0.01 && w1 < 0.9 * w2) {
+ w1 /= w2;
+ if (w1 < 0.8) {
+ w1 = 0.8;
+ }
+ m11 *= w1;
+ m12 *= w1;
+ m21 *= w1;
+ m22 *= w1;
+ }
+ }
+ }
+ if(fontname)
+ setT1Font(fontname, gfxFont->getEncoding());
+ }
+ }
+
+ swfoutput_setfont(&output,t1id);
+}
+
+void SWFOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
+ int width, int height, GBool invert,
+ GBool inlineImg) {
+ FILE *fi;
+ int c;
+ char fileName[128];
+ double x1,y1,x2,y2,x3,y3,x4,y4;
+ state->transform(0, 1, &x1, &y1);
+ state->transform(0, 0, &x2, &y2);
+ state->transform(1, 0, &x3, &y3);
+ state->transform(1, 1, &x4, &y4);
+
+ if (str->getKind() == strDCT) {
+ sprintf(fileName, "/tmp/tmp%08x.jpg",lrand48());
+ logf("<notice> Found picture. Temporary storage is %s", fileName);
+ if (!(fi = fopen(fileName, "wb"))) {
+ logf("<error> Couldn't open temporary image file '%s'", fileName);
+ return;
+ }
+ str = ((DCTStream *)str)->getRawStream();
+ str->reset();
+ while ((c = str->getChar()) != EOF)
+ fputc(c, fi);
+ fclose(fi);
+ swfoutput_drawimagefile(&output, fileName, width, height, x1,y1,x2,y2,x3,y3,x4,y4);
+ } else {
+ logf("<notice> File contains pbm pictures.");
+ }
+}
+
+void SWFOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
+ int width, int height,
+ GfxImageColorMap *colorMap, GBool inlineImg) {
+ FILE *fi;
+ int c;
+ char fileName[128];
+ double x1,y1,x2,y2,x3,y3,x4,y4;
+ state->transform(0, 1, &x1, &y1);
+ state->transform(0, 0, &x2, &y2);
+ state->transform(1, 0, &x3, &y3);
+ state->transform(1, 1, &x4, &y4);
+
+ if (str->getKind() == strDCT &&
+ colorMap->getNumPixelComps() == 3) {
+ sprintf(fileName, "/tmp/tmp%08x.jpg", lrand48());
+ logf("<notice> Found picture. Temporary storage is %s", fileName);
+ if (!(fi = fopen(fileName, "wb"))) {
+ error(-1, "Couldn't open temporary image file '%s'", fileName);
+ return;
+ }
+ str = ((DCTStream *)str)->getRawStream();
+ str->reset();
+ while ((c = str->getChar()) != EOF)
+ fputc(c, fi);
+ fclose(fi);
+ swfoutput_drawimagefile(&output, fileName, width, height, x1,y1,x2,y2,x3,y3,x4,y4);
+ } else {
+ logf("<notice> File contains pbm pictures.");
+ }
+}
+
+PDFDoc*doc = 0;
+SWFOutputDev*output = 0;
+
+void pdfswf_init(char*filename, char*userPassword)
+{
+ GString *fileName = new GString(filename);
+ GString *userPW;
+ Object info;
+ // init error file
+ errorInit();
+
+ // read config file
+ initParams(xpdfConfigFile);
+
+ // open PDF file
+ xref = NULL;
+ if (userPassword && userPassword[0]) {
+ userPW = new GString(userPassword);
+ } else {
+ userPW = NULL;
+ }
+ doc = new PDFDoc(fileName, userPW);
+ if (userPW) {
+ delete userPW;
+ }
+ if (!doc->isOk()) {
+ exit(1);
+ }
+
+ // print doc info
+ doc->getDocInfo(&info);
+ if (info.isDict()) {
+ printInfoString(info.getDict(), "Title", "Title: %s\n");
+ printInfoString(info.getDict(), "Subject", "Subject: %s\n");
+ printInfoString(info.getDict(), "Keywords", "Keywords: %s\n");
+ printInfoString(info.getDict(), "Author", "Author: %s\n");
+ printInfoString(info.getDict(), "Creator", "Creator: %s\n");
+ printInfoString(info.getDict(), "Producer", "Producer: %s\n");
+ printInfoDate(info.getDict(), "CreationDate", "CreationDate: %s\n");
+ printInfoDate(info.getDict(), "ModDate", "ModDate: %s\n");
+ }
+ info.free();
+
+ // print page count
+ printf("Pages: %d\n", doc->getNumPages());
+
+ // print linearization info
+ printf("Linearized: %s\n", doc->isLinearized() ? "yes" : "no");
+
+ // print encryption info
+ printf("Encrypted: ");
+ if (doc->isEncrypted()) {
+ printf("yes (print:%s copy:%s change:%s addNotes:%s)\n",
+ doc->okToPrint() ? "yes" : "no",
+ doc->okToCopy() ? "yes" : "no",
+ doc->okToChange() ? "yes" : "no",
+ doc->okToAddNotes() ? "yes" : "no");
+ /*ERROR: This pdf is encrypted, and disallows copying.
+ Due to the DMCA, paragraph 1201, (2) A-C, circumventing
+ a technological measure that efficively controls access to
+ a protected work is violating American law.
+ See www.eff.org for more information about DMCA issues.
+ */
+ if(!doc->okToCopy()) {
+ printf("PDF disallows copying. Bailing out.\n");
+ exit(1); //bail out
+ }
+ if(!doc->okToChange() || !doc->okToAddNotes())
+ swfoutput_setprotected();
+ }
+ else {
+ printf("no\n");
+ }
+
+
+ output = new SWFOutputDev();
+}
+
+void pdfswf_setoutputfilename(char*_filename)
+{
+ filename = _filename;
+}
+
+void pdfswf_convertpage(int page)
+{
+ doc->displayPage((OutputDev*)output, page, /*zoom*/100, /*rotate*/0, /*doLinks*/(int)1);
+}
+
+int pdfswf_numpages()
+{
+ return doc->getNumPages();
+}
+
+void pdfswf_close()
+{
+ delete doc;
+ delete output;
+
+ freeParams();
+ // check for memory leaks
+ Object::memCheck(stderr);
+ gMemReport(stderr);
+}
+
diff --git a/pdf2swf/SWFOutputDev.h b/pdf2swf/SWFOutputDev.h
new file mode 100644
index 00000000..c6a6f491
--- /dev/null
+++ b/pdf2swf/SWFOutputDev.h
@@ -0,0 +1,17 @@
+/* pdfswf.h
+ Header file for pdfswf.cc.
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#ifndef __pdf_h__
+#define __pdf_h__
+void pdfswf_init(char*filename, char*userPassword) ;
+void pdfswf_setoutputfilename(char*filename);
+int pdfswf_numpages();
+void pdfswf_convertpage(int page) ;
+void pdfswf_close();
+#endif //__pdf_h__
diff --git a/pdf2swf/args.h b/pdf2swf/args.h
new file mode 100644
index 00000000..a5699df4
--- /dev/null
+++ b/pdf2swf/args.h
@@ -0,0 +1,63 @@
+/* args.h
+ Routines to simplify argument handling
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#ifndef __args_h__
+#define __args_h__
+
+extern int args_callback_option(char*,char*);
+extern int args_callback_longoption(char*,char*);
+extern int args_callback_command(char*,char*);
+extern void args_callback_usage(char*name);
+
+int argn;
+char**argv;
+
+void processargs(int argn2,char**argv2)
+{
+ int t;
+ if(argn2==1)
+ {
+ args_callback_usage(argv2[0]);
+ exit(1);
+ }
+ for(t=1;t<argn2;t++)
+ {
+ char*next;
+ if(t<argn2-1) next=argv2[t+1];
+ else next=0;
+
+ if(argv2[t][0]=='-')
+ {
+ if(argv2[t][1]=='-')
+ {
+ if(!strcmp(&argv2[t][2],"help"))
+ {
+ args_callback_usage(argv2[0]);
+ exit(1);
+ }
+ t+=args_callback_longoption(&argv2[t][2],next);
+ }
+ else
+ {
+ if(strchr("?h",argv2[t][1]))
+ {
+ args_callback_usage(argv2[0]);
+ exit(1);
+ }
+ t+=args_callback_option(&argv2[t][1],next);
+ }
+ }
+ else
+ {
+ t+=args_callback_command(argv2[t],next);
+ }
+ }
+}
+
+#endif //__args_h__
diff --git a/pdf2swf/fonts/FontDataBase b/pdf2swf/fonts/FontDataBase
new file mode 100644
index 00000000..a3c7bb6d
--- /dev/null
+++ b/pdf2swf/fonts/FontDataBase
@@ -0,0 +1,16 @@
+14
+n021003l.afm
+n021023l.afm
+n021004l.afm
+n021024l.afm
+n019003l.afm
+n019023l.afm
+n019004l.afm
+n019024l.afm
+n022003l.afm
+n022023l.afm
+n022004l.afm
+n022024l.afm
+s050000l.afm
+d050000l.afm
+
diff --git a/pdf2swf/fonts/Makefile.am b/pdf2swf/fonts/Makefile.am
new file mode 100644
index 00000000..d7b338e4
--- /dev/null
+++ b/pdf2swf/fonts/Makefile.am
@@ -0,0 +1,31 @@
+## Process this file with automake to produce Makefile.in
+pkgdata_DATA = \
+ FontDataBase \
+ n021003l.pfb \
+ n021023l.pfb \
+ n021004l.pfb \
+ n021024l.pfb \
+ n019003l.pfb \
+ n019023l.pfb \
+ n019004l.pfb \
+ n019024l.pfb \
+ n022003l.pfb \
+ n022023l.pfb \
+ n022004l.pfb \
+ n022024l.pfb \
+ s050000l.pfb \
+ d050000l.pfb \
+ n021003l.afm \
+ n021023l.afm \
+ n021004l.afm \
+ n021024l.afm \
+ n019003l.afm \
+ n019023l.afm \
+ n019004l.afm \
+ n019024l.afm \
+ n022003l.afm \
+ n022023l.afm \
+ n022004l.afm \
+ n022024l.afm \
+ s050000l.afm \
+ d050000l.afm
diff --git a/pdf2swf/fonts/Makefile.in b/pdf2swf/fonts/Makefile.in
new file mode 100644
index 00000000..35d68c1e
--- /dev/null
+++ b/pdf2swf/fonts/Makefile.in
@@ -0,0 +1,202 @@
+# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ../..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AWK = @AWK@
+CC = @CC@
+CPP = @CPP@
+CXX = @CXX@
+EXEEXT = @EXEEXT@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+pkgdata_DATA = FontDataBase n021003l.pfb n021023l.pfb n021004l.pfb n021024l.pfb n019003l.pfb n019023l.pfb n019004l.pfb n019024l.pfb n022003l.pfb n022023l.pfb n022004l.pfb n022024l.pfb s050000l.pfb d050000l.pfb n021003l.afm n021023l.afm n021004l.afm n021024l.afm n019003l.afm n019023l.afm n019004l.afm n019024l.afm n022003l.afm n022023l.afm n022004l.afm n022024l.afm s050000l.afm d050000l.afm
+
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../../config.h
+CONFIG_CLEAN_FILES =
+DATA = $(pkgdata_DATA)
+
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu pdf2swf/fonts/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+install-pkgdataDATA: $(pkgdata_DATA)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
+ @list='$(pkgdata_DATA)'; for p in $$list; do \
+ if test -f $(srcdir)/$$p; then \
+ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p"; \
+ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p; \
+ else if test -f $$p; then \
+ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p"; \
+ $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \
+ fi; fi; \
+ done
+
+uninstall-pkgdataDATA:
+ @$(NORMAL_UNINSTALL)
+ list='$(pkgdata_DATA)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(pkgdatadir)/$$p; \
+ done
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = pdf2swf/fonts
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu pdf2swf/fonts/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am: install-pkgdataDATA
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-pkgdataDATA
+uninstall: uninstall-am
+all-am: Makefile $(DATA)
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: uninstall-pkgdataDATA install-pkgdataDATA tags distdir info-am \
+info dvi-am dvi check check-am installcheck-am installcheck \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/pdf2swf/fonts/d050000l.afm b/pdf2swf/fonts/d050000l.afm
new file mode 100644
index 00000000..98735a0a
--- /dev/null
+++ b/pdf2swf/fonts/d050000l.afm
@@ -0,0 +1,226 @@
+StartFontMetrics 3.0
+Comment Copyright URW Software, Copyright 1997 by URW
+Comment Creation Date: 10/19/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName Dingbats
+FullName Dingbats
+FamilyName Dingbats
+Weight Regular
+ItalicAngle 0.0
+IsFixedPitch false
+UnderlinePosition -72
+UnderlineThickness 36
+Version 001.005
+Notice URW Software, Copyright 1997 by URW
+EncodingScheme FontSpecific
+FontBBox -1 -143 981 819
+CapHeight 691
+XHeight 567
+Descender -143
+Ascender 691
+StartCharMetrics 203
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 974 ; N a1 ; B 35 71 939 617 ;
+C 34 ; WX 961 ; N a2 ; B 35 81 927 611 ;
+C 35 ; WX 974 ; N a202 ; B 35 69 939 615 ;
+C 36 ; WX 980 ; N a3 ; B 35 0 945 691 ;
+C 37 ; WX 719 ; N a4 ; B 34 138 685 566 ;
+C 38 ; WX 789 ; N a5 ; B 35 -13 755 707 ;
+C 39 ; WX 790 ; N a119 ; B 35 -14 755 706 ;
+C 40 ; WX 791 ; N a118 ; B 35 -13 761 705 ;
+C 41 ; WX 690 ; N a117 ; B 35 137 655 556 ;
+C 42 ; WX 960 ; N a11 ; B 35 122 925 568 ;
+C 43 ; WX 939 ; N a12 ; B 35 133 904 559 ;
+C 44 ; WX 549 ; N a13 ; B 29 -10 516 706 ;
+C 45 ; WX 855 ; N a14 ; B 33 59 820 632 ;
+C 46 ; WX 911 ; N a15 ; B 35 51 876 641 ;
+C 47 ; WX 933 ; N a16 ; B 35 141 899 550 ;
+C 48 ; WX 911 ; N a105 ; B 35 49 876 636 ;
+C 49 ; WX 945 ; N a17 ; B 35 139 909 550 ;
+C 50 ; WX 974 ; N a18 ; B 35 103 938 588 ;
+C 51 ; WX 755 ; N a19 ; B 34 -14 721 706 ;
+C 52 ; WX 846 ; N a20 ; B 36 -14 811 706 ;
+C 53 ; WX 762 ; N a21 ; B 35 0 727 692 ;
+C 54 ; WX 761 ; N a22 ; B 35 0 727 692 ;
+C 55 ; WX 571 ; N a23 ; B -1 -69 572 660 ;
+C 56 ; WX 677 ; N a24 ; B 36 -14 642 705 ;
+C 57 ; WX 763 ; N a25 ; B 35 0 728 694 ;
+C 58 ; WX 760 ; N a26 ; B 35 0 726 691 ;
+C 59 ; WX 759 ; N a27 ; B 35 0 725 690 ;
+C 60 ; WX 754 ; N a28 ; B 35 0 720 685 ;
+C 61 ; WX 494 ; N a6 ; B 35 0 460 691 ;
+C 62 ; WX 552 ; N a7 ; B 35 0 517 691 ;
+C 63 ; WX 537 ; N a8 ; B 35 0 503 691 ;
+C 64 ; WX 577 ; N a9 ; B 35 96 542 595 ;
+C 65 ; WX 692 ; N a10 ; B 35 -14 657 702 ;
+C 66 ; WX 786 ; N a29 ; B 35 -13 751 705 ;
+C 67 ; WX 788 ; N a30 ; B 35 -14 752 703 ;
+C 68 ; WX 788 ; N a31 ; B 35 -14 753 705 ;
+C 69 ; WX 790 ; N a32 ; B 35 -14 756 707 ;
+C 70 ; WX 793 ; N a33 ; B 35 -13 759 705 ;
+C 71 ; WX 794 ; N a34 ; B 35 -14 759 705 ;
+C 72 ; WX 816 ; N a35 ; B 35 -13 782 707 ;
+C 73 ; WX 823 ; N a36 ; B 35 2 787 719 ;
+C 74 ; WX 789 ; N a37 ; B 35 -13 754 706 ;
+C 75 ; WX 841 ; N a38 ; B 35 -14 807 706 ;
+C 76 ; WX 823 ; N a39 ; B 35 -12 789 706 ;
+C 77 ; WX 833 ; N a40 ; B 35 -14 798 706 ;
+C 78 ; WX 816 ; N a41 ; B 35 -13 782 705 ;
+C 79 ; WX 831 ; N a42 ; B 35 -13 796 707 ;
+C 80 ; WX 923 ; N a43 ; B 35 -13 888 706 ;
+C 81 ; WX 744 ; N a44 ; B 35 0 710 691 ;
+C 82 ; WX 723 ; N a45 ; B 35 0 688 691 ;
+C 83 ; WX 749 ; N a46 ; B 35 0 714 691 ;
+C 84 ; WX 790 ; N a47 ; B 34 -15 756 706 ;
+C 85 ; WX 792 ; N a48 ; B 35 -14 758 705 ;
+C 86 ; WX 695 ; N a49 ; B 35 -16 661 706 ;
+C 87 ; WX 776 ; N a50 ; B 35 -7 741 698 ;
+C 88 ; WX 768 ; N a51 ; B 35 -7 734 699 ;
+C 89 ; WX 792 ; N a52 ; B 35 -1 757 720 ;
+C 90 ; WX 759 ; N a53 ; B 35 0 725 693 ;
+C 91 ; WX 707 ; N a54 ; B 35 -11 672 704 ;
+C 92 ; WX 708 ; N a55 ; B 35 -14 672 704 ;
+C 93 ; WX 682 ; N a56 ; B 35 -3 647 694 ;
+C 94 ; WX 701 ; N a57 ; B 35 -13 666 708 ;
+C 95 ; WX 826 ; N a58 ; B 35 -18 791 716 ;
+C 96 ; WX 815 ; N a59 ; B 35 -16 780 705 ;
+C 97 ; WX 789 ; N a60 ; B 35 -14 754 704 ;
+C 98 ; WX 789 ; N a61 ; B 35 -14 754 704 ;
+C 99 ; WX 707 ; N a62 ; B 33 0 674 717 ;
+C 100 ; WX 687 ; N a63 ; B 36 0 651 688 ;
+C 101 ; WX 696 ; N a64 ; B 35 0 661 693 ;
+C 102 ; WX 689 ; N a65 ; B 35 0 655 681 ;
+C 103 ; WX 786 ; N a66 ; B 34 -14 751 703 ;
+C 104 ; WX 787 ; N a67 ; B 35 -15 752 704 ;
+C 105 ; WX 713 ; N a68 ; B 35 -13 678 709 ;
+C 106 ; WX 791 ; N a69 ; B 35 -14 756 707 ;
+C 107 ; WX 785 ; N a70 ; B 36 -14 751 701 ;
+C 108 ; WX 791 ; N a71 ; B 35 -14 757 708 ;
+C 109 ; WX 873 ; N a72 ; B 35 -13 838 705 ;
+C 110 ; WX 761 ; N a73 ; B 35 0 726 691 ;
+C 111 ; WX 762 ; N a74 ; B 35 0 727 691 ;
+C 112 ; WX 762 ; N a203 ; B 35 0 727 691 ;
+C 113 ; WX 759 ; N a75 ; B 35 0 725 691 ;
+C 114 ; WX 759 ; N a204 ; B 35 0 725 691 ;
+C 115 ; WX 892 ; N a76 ; B 35 0 858 706 ;
+C 116 ; WX 892 ; N a77 ; B 35 -14 858 691 ;
+C 117 ; WX 788 ; N a78 ; B 35 -14 754 705 ;
+C 118 ; WX 784 ; N a79 ; B 35 -14 749 705 ;
+C 119 ; WX 438 ; N a81 ; B 35 -14 403 705 ;
+C 120 ; WX 138 ; N a82 ; B 35 0 104 691 ;
+C 121 ; WX 277 ; N a83 ; B 35 0 242 691 ;
+C 122 ; WX 415 ; N a84 ; B 35 0 380 691 ;
+C 123 ; WX 392 ; N a97 ; B 35 263 357 705 ;
+C 124 ; WX 392 ; N a98 ; B 34 262 357 705 ;
+C 125 ; WX 668 ; N a99 ; B 35 263 633 707 ;
+C 126 ; WX 668 ; N a100 ; B 36 261 634 705 ;
+C 161 ; WX 732 ; N a101 ; B 35 -143 697 805 ;
+C 162 ; WX 544 ; N a102 ; B 56 -14 488 705 ;
+C 163 ; WX 544 ; N a103 ; B 34 -14 508 704 ;
+C 164 ; WX 910 ; N a104 ; B 35 40 875 651 ;
+C 165 ; WX 667 ; N a106 ; B 35 -13 633 706 ;
+C 166 ; WX 760 ; N a107 ; B 35 -13 726 705 ;
+C 167 ; WX 760 ; N a108 ; B 0 121 758 570 ;
+C 168 ; WX 776 ; N a112 ; B 35 0 741 705 ;
+C 169 ; WX 595 ; N a111 ; B 34 -14 560 705 ;
+C 170 ; WX 694 ; N a110 ; B 35 -14 659 704 ;
+C 171 ; WX 626 ; N a109 ; B 34 0 591 705 ;
+C 172 ; WX 788 ; N a120 ; B 35 -13 754 706 ;
+C 173 ; WX 788 ; N a121 ; B 35 -13 754 706 ;
+C 174 ; WX 788 ; N a122 ; B 35 -13 754 706 ;
+C 175 ; WX 788 ; N a123 ; B 35 -14 754 705 ;
+C 176 ; WX 788 ; N a124 ; B 35 -13 754 706 ;
+C 177 ; WX 788 ; N a125 ; B 35 -13 754 706 ;
+C 178 ; WX 788 ; N a126 ; B 35 -13 754 706 ;
+C 179 ; WX 788 ; N a127 ; B 35 -13 754 706 ;
+C 180 ; WX 788 ; N a128 ; B 35 -13 754 706 ;
+C 181 ; WX 788 ; N a129 ; B 35 -13 754 706 ;
+C 182 ; WX 788 ; N a130 ; B 35 -13 754 706 ;
+C 183 ; WX 788 ; N a131 ; B 35 -13 754 706 ;
+C 184 ; WX 788 ; N a132 ; B 35 -13 754 706 ;
+C 185 ; WX 788 ; N a133 ; B 35 -13 754 706 ;
+C 186 ; WX 788 ; N a134 ; B 35 -13 754 706 ;
+C 187 ; WX 788 ; N a135 ; B 35 -13 754 706 ;
+C 188 ; WX 788 ; N a136 ; B 35 -13 754 706 ;
+C 189 ; WX 788 ; N a137 ; B 35 -13 754 706 ;
+C 190 ; WX 788 ; N a138 ; B 35 -13 754 706 ;
+C 191 ; WX 788 ; N a139 ; B 35 -13 754 706 ;
+C 192 ; WX 788 ; N a140 ; B 35 -13 754 706 ;
+C 193 ; WX 788 ; N a141 ; B 35 -13 754 706 ;
+C 194 ; WX 788 ; N a142 ; B 35 -13 754 706 ;
+C 195 ; WX 788 ; N a143 ; B 35 -13 754 706 ;
+C 196 ; WX 788 ; N a144 ; B 35 -13 754 706 ;
+C 197 ; WX 788 ; N a145 ; B 35 -13 754 706 ;
+C 198 ; WX 788 ; N a146 ; B 35 -13 754 706 ;
+C 199 ; WX 788 ; N a147 ; B 35 -13 754 706 ;
+C 200 ; WX 788 ; N a148 ; B 35 -13 754 706 ;
+C 201 ; WX 788 ; N a149 ; B 35 -13 754 706 ;
+C 202 ; WX 788 ; N a150 ; B 35 -13 755 706 ;
+C 203 ; WX 788 ; N a151 ; B 34 -13 754 706 ;
+C 204 ; WX 788 ; N a152 ; B 34 -13 754 706 ;
+C 205 ; WX 788 ; N a153 ; B 35 -13 754 706 ;
+C 206 ; WX 788 ; N a154 ; B 35 -13 754 706 ;
+C 207 ; WX 788 ; N a155 ; B 35 -13 754 706 ;
+C 208 ; WX 788 ; N a156 ; B 35 -13 754 706 ;
+C 209 ; WX 788 ; N a157 ; B 35 -13 754 706 ;
+C 210 ; WX 788 ; N a158 ; B 35 -13 754 706 ;
+C 211 ; WX 788 ; N a159 ; B 35 -13 754 706 ;
+C 212 ; WX 894 ; N a160 ; B 35 58 860 634 ;
+C 213 ; WX 838 ; N a161 ; B 35 151 803 537 ;
+C 214 ; WX 1016 ; N a163 ; B 34 151 981 537 ;
+C 215 ; WX 458 ; N a164 ; B 35 -128 422 819 ;
+C 216 ; WX 748 ; N a196 ; B 35 94 698 597 ;
+C 217 ; WX 924 ; N a165 ; B 35 140 890 551 ;
+C 218 ; WX 748 ; N a192 ; B 35 94 698 597 ;
+C 219 ; WX 918 ; N a166 ; B 35 167 884 526 ;
+C 220 ; WX 927 ; N a167 ; B 35 28 892 664 ;
+C 221 ; WX 928 ; N a168 ; B 35 129 891 562 ;
+C 222 ; WX 928 ; N a169 ; B 35 129 893 561 ;
+C 223 ; WX 834 ; N a170 ; B 35 154 799 537 ;
+C 224 ; WX 873 ; N a171 ; B 35 97 838 594 ;
+C 225 ; WX 828 ; N a172 ; B 35 104 791 588 ;
+C 226 ; WX 924 ; N a173 ; B 35 82 889 610 ;
+C 227 ; WX 924 ; N a162 ; B 35 82 889 610 ;
+C 228 ; WX 917 ; N a174 ; B 35 4 882 688 ;
+C 229 ; WX 930 ; N a175 ; B 35 83 896 608 ;
+C 230 ; WX 931 ; N a176 ; B 35 84 896 608 ;
+C 231 ; WX 463 ; N a177 ; B 35 -100 429 790 ;
+C 232 ; WX 883 ; N a178 ; B 35 70 848 621 ;
+C 233 ; WX 836 ; N a179 ; B 35 43 802 648 ;
+C 234 ; WX 836 ; N a193 ; B 35 43 802 648 ;
+C 235 ; WX 867 ; N a180 ; B 35 101 832 589 ;
+C 236 ; WX 867 ; N a199 ; B 35 101 832 591 ;
+C 237 ; WX 696 ; N a181 ; B 35 44 661 651 ;
+C 238 ; WX 696 ; N a200 ; B 35 44 661 646 ;
+C 239 ; WX 874 ; N a182 ; B 35 75 840 613 ;
+C 241 ; WX 874 ; N a201 ; B 35 75 840 613 ;
+C 242 ; WX 760 ; N a183 ; B 35 1 725 690 ;
+C 243 ; WX 946 ; N a184 ; B 35 159 911 532 ;
+C 244 ; WX 771 ; N a197 ; B 34 36 736 655 ;
+C 245 ; WX 865 ; N a185 ; B 35 209 830 483 ;
+C 246 ; WX 771 ; N a194 ; B 34 36 736 655 ;
+C 247 ; WX 888 ; N a198 ; B 34 -18 853 711 ;
+C 248 ; WX 967 ; N a186 ; B 35 123 932 568 ;
+C 249 ; WX 888 ; N a195 ; B 34 -20 853 710 ;
+C 250 ; WX 831 ; N a187 ; B 35 113 796 578 ;
+C 251 ; WX 873 ; N a188 ; B 36 116 838 576 ;
+C 252 ; WX 927 ; N a189 ; B 35 149 891 542 ;
+C 253 ; WX 970 ; N a190 ; B 35 75 931 615 ;
+C 254 ; WX 918 ; N a191 ; B 34 99 884 592 ;
+C -1 ; WX 334 ; N a95 ; B 35 0 299 691 ;
+C -1 ; WX 234 ; N a88 ; B 35 -14 199 705 ;
+C -1 ; WX 234 ; N a87 ; B 35 -14 199 705 ;
+C -1 ; WX 410 ; N a86 ; B 35 0 375 691 ;
+C -1 ; WX 410 ; N a206 ; B 35 0 375 691 ;
+C -1 ; WX 509 ; N a85 ; B 35 0 475 691 ;
+C -1 ; WX 334 ; N a96 ; B 35 0 299 691 ;
+C -1 ; WX 276 ; N a91 ; B 35 0 242 691 ;
+C -1 ; WX 317 ; N a94 ; B 35 0 283 691 ;
+C -1 ; WX 317 ; N a93 ; B 35 0 283 691 ;
+C -1 ; WX 390 ; N a90 ; B 35 -14 355 705 ;
+C -1 ; WX 390 ; N a89 ; B 35 -14 356 705 ;
+C -1 ; WX 276 ; N a92 ; B 35 0 242 691 ;
+C -1 ; WX 509 ; N a205 ; B 35 0 475 691 ;
+C -1 ; WX 278 ; N .notdef ; B 0 0 0 0 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/pdf2swf/fonts/d050000l.pfb b/pdf2swf/fonts/d050000l.pfb
new file mode 100644
index 00000000..4a3c386d
--- /dev/null
+++ b/pdf2swf/fonts/d050000l.pfb
Binary files differ
diff --git a/pdf2swf/fonts/n019003l.afm b/pdf2swf/fonts/n019003l.afm
new file mode 100644
index 00000000..36133a42
--- /dev/null
+++ b/pdf2swf/fonts/n019003l.afm
@@ -0,0 +1,1341 @@
+StartFontMetrics 3.0
+Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development
+Comment Creation Date: 12/22/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName NimbusSanL-Regu
+FullName Nimbus Sans L Regular
+FamilyName Nimbus Sans L
+Weight Regular
+ItalicAngle 0.0
+IsFixedPitch false
+UnderlinePosition -151
+UnderlineThickness 50
+Version 1.05
+Notice (URW)++,Copyright 1999 by (URW)++ Design & Development
+EncodingScheme AdobeStandardEncoding
+FontBBox -174 -285 1001 953
+CapHeight 729
+XHeight 524
+Descender -218
+Ascender 729
+StartCharMetrics 316
+C 32 ; WX 278 ; N space ; B 191 0 191 0 ;
+C 33 ; WX 278 ; N exclam ; B 124 0 208 729 ;
+C 34 ; WX 355 ; N quotedbl ; B 52 464 305 709 ;
+C 35 ; WX 556 ; N numbersign ; B 14 -20 542 697 ;
+C 36 ; WX 556 ; N dollar ; B 26 -126 518 770 ;
+C 37 ; WX 889 ; N percent ; B 29 -20 859 709 ;
+C 38 ; WX 667 ; N ampersand ; B 52 -23 637 709 ;
+C 39 ; WX 221 ; N quoteright ; B 64 497 157 729 ;
+C 40 ; WX 333 ; N parenleft ; B 73 -212 291 729 ;
+C 41 ; WX 333 ; N parenright ; B 38 -212 256 729 ;
+C 42 ; WX 389 ; N asterisk ; B 40 441 343 729 ;
+C 43 ; WX 584 ; N plus ; B 50 -10 534 474 ;
+C 44 ; WX 278 ; N comma ; B 87 -147 192 104 ;
+C 45 ; WX 333 ; N hyphen ; B 46 240 284 312 ;
+C 46 ; WX 278 ; N period ; B 87 0 191 104 ;
+C 47 ; WX 278 ; N slash ; B -8 -20 284 729 ;
+C 48 ; WX 556 ; N zero ; B 43 -23 507 709 ;
+C 49 ; WX 556 ; N one ; B 102 0 347 709 ;
+C 50 ; WX 556 ; N two ; B 34 0 511 709 ;
+C 51 ; WX 556 ; N three ; B 32 -23 506 709 ;
+C 52 ; WX 556 ; N four ; B 28 0 520 709 ;
+C 53 ; WX 556 ; N five ; B 35 -23 513 709 ;
+C 54 ; WX 556 ; N six ; B 43 -23 513 709 ;
+C 55 ; WX 556 ; N seven ; B 46 0 520 709 ;
+C 56 ; WX 556 ; N eight ; B 37 -23 513 709 ;
+C 57 ; WX 556 ; N nine ; B 38 -23 509 709 ;
+C 58 ; WX 278 ; N colon ; B 110 0 214 524 ;
+C 59 ; WX 278 ; N semicolon ; B 110 -147 215 524 ;
+C 60 ; WX 584 ; N less ; B 45 -9 534 474 ;
+C 61 ; WX 584 ; N equal ; B 50 111 534 353 ;
+C 62 ; WX 584 ; N greater ; B 50 -9 539 474 ;
+C 63 ; WX 556 ; N question ; B 77 0 509 741 ;
+C 64 ; WX 1015 ; N at ; B 34 -142 951 741 ;
+C 65 ; WX 667 ; N A ; B 17 0 653 729 ;
+C 66 ; WX 667 ; N B ; B 79 0 623 729 ;
+C 67 ; WX 722 ; N C ; B 48 -23 677 741 ;
+C 68 ; WX 722 ; N D ; B 89 0 667 729 ;
+C 69 ; WX 667 ; N E ; B 90 0 613 729 ;
+C 70 ; WX 611 ; N F ; B 90 0 579 729 ;
+C 71 ; WX 778 ; N G ; B 44 -23 709 741 ;
+C 72 ; WX 722 ; N H ; B 83 0 644 729 ;
+C 73 ; WX 278 ; N I ; B 100 0 194 729 ;
+C 74 ; WX 500 ; N J ; B 17 -23 426 729 ;
+C 75 ; WX 667 ; N K ; B 79 0 658 729 ;
+C 76 ; WX 556 ; N L ; B 80 0 533 729 ;
+C 77 ; WX 833 ; N M ; B 75 0 761 729 ;
+C 78 ; WX 722 ; N N ; B 76 0 646 729 ;
+C 79 ; WX 778 ; N O ; B 38 -23 742 741 ;
+C 80 ; WX 667 ; N P ; B 91 0 617 729 ;
+C 81 ; WX 778 ; N Q ; B 38 -59 742 741 ;
+C 82 ; WX 722 ; N R ; B 93 0 679 729 ;
+C 83 ; WX 667 ; N S ; B 48 -23 621 741 ;
+C 84 ; WX 611 ; N T ; B 21 0 593 729 ;
+C 85 ; WX 722 ; N U ; B 85 -23 645 729 ;
+C 86 ; WX 667 ; N V ; B 30 0 645 729 ;
+C 87 ; WX 944 ; N W ; B 22 0 929 729 ;
+C 88 ; WX 667 ; N X ; B 22 0 649 729 ;
+C 89 ; WX 667 ; N Y ; B 13 0 661 729 ;
+C 90 ; WX 611 ; N Z ; B 28 0 583 729 ;
+C 91 ; WX 278 ; N bracketleft ; B 64 -212 250 729 ;
+C 92 ; WX 278 ; N backslash ; B -8 -20 284 729 ;
+C 93 ; WX 278 ; N bracketright ; B 23 -212 209 729 ;
+C 94 ; WX 469 ; N asciicircum ; B 44 329 425 709 ;
+C 95 ; WX 556 ; N underscore ; B -22 -176 578 -126 ;
+C 96 ; WX 222 ; N quoteleft ; B 65 477 158 709 ;
+C 97 ; WX 556 ; N a ; B 42 -23 535 539 ;
+C 98 ; WX 556 ; N b ; B 54 -23 523 729 ;
+C 99 ; WX 500 ; N c ; B 31 -23 477 539 ;
+C 100 ; WX 556 ; N d ; B 26 -23 495 729 ;
+C 101 ; WX 556 ; N e ; B 40 -23 513 539 ;
+C 102 ; WX 278 ; N f ; B 18 0 258 732 ;
+C 103 ; WX 556 ; N g ; B 29 -218 489 539 ;
+C 104 ; WX 556 ; N h ; B 70 0 486 729 ;
+C 105 ; WX 222 ; N i ; B 66 0 150 729 ;
+C 106 ; WX 222 ; N j ; B -18 -218 153 729 ;
+C 107 ; WX 500 ; N k ; B 58 0 502 729 ;
+C 108 ; WX 222 ; N l ; B 68 0 152 729 ;
+C 109 ; WX 833 ; N m ; B 70 0 762 539 ;
+C 110 ; WX 556 ; N n ; B 70 0 487 539 ;
+C 111 ; WX 556 ; N o ; B 36 -23 510 539 ;
+C 112 ; WX 556 ; N p ; B 54 -218 523 539 ;
+C 113 ; WX 556 ; N q ; B 26 -218 495 539 ;
+C 114 ; WX 333 ; N r ; B 69 0 321 539 ;
+C 115 ; WX 500 ; N s ; B 34 -23 459 539 ;
+C 116 ; WX 278 ; N t ; B 14 -23 254 668 ;
+C 117 ; WX 556 ; N u ; B 65 -23 482 524 ;
+C 118 ; WX 500 ; N v ; B 10 0 486 524 ;
+C 119 ; WX 722 ; N w ; B 6 0 708 524 ;
+C 120 ; WX 500 ; N x ; B 17 0 473 524 ;
+C 121 ; WX 500 ; N y ; B 20 -218 478 524 ;
+C 122 ; WX 500 ; N z ; B 31 0 457 524 ;
+C 123 ; WX 334 ; N braceleft ; B 43 -212 276 729 ;
+C 124 ; WX 260 ; N bar ; B 100 -212 160 729 ;
+C 125 ; WX 334 ; N braceright ; B 29 -212 262 729 ;
+C 126 ; WX 584 ; N asciitilde ; B 75 268 508 438 ;
+C 161 ; WX 333 ; N exclamdown ; B 121 -205 205 524 ;
+C 162 ; WX 556 ; N cent ; B 52 -120 510 628 ;
+C 163 ; WX 556 ; N sterling ; B 26 -23 535 729 ;
+C 164 ; WX 167 ; N fraction ; B -174 -20 336 709 ;
+C 165 ; WX 556 ; N yen ; B 11 0 545 709 ;
+C 166 ; WX 556 ; N florin ; B 11 -212 542 738 ;
+C 167 ; WX 556 ; N section ; B 43 -213 506 729 ;
+C 168 ; WX 556 ; N currency ; B 67 133 489 551 ;
+C 169 ; WX 191 ; N quotesingle ; B 48 464 142 709 ;
+C 170 ; WX 333 ; N quotedblleft ; B 48 477 299 709 ;
+C 171 ; WX 556 ; N guillemotleft ; B 98 106 455 438 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 91 106 243 438 ;
+C 173 ; WX 333 ; N guilsinglright ; B 85 106 239 438 ;
+C 174 ; WX 500 ; N fi ; B 12 0 436 732 ;
+C 175 ; WX 500 ; N fl ; B 17 0 430 732 ;
+C 177 ; WX 556 ; N endash ; B -5 240 561 312 ;
+C 178 ; WX 556 ; N dagger ; B 38 -177 513 709 ;
+C 179 ; WX 556 ; N daggerdbl ; B 38 -177 513 709 ;
+C 180 ; WX 278 ; N periodcentered ; B 87 302 211 427 ;
+C 182 ; WX 537 ; N paragraph ; B 48 -177 522 729 ;
+C 183 ; WX 350 ; N bullet ; B 50 220 300 470 ;
+C 184 ; WX 222 ; N quotesinglbase ; B 64 -128 158 104 ;
+C 185 ; WX 333 ; N quotedblbase ; B 47 -128 300 104 ;
+C 186 ; WX 333 ; N quotedblright ; B 49 477 302 709 ;
+C 187 ; WX 556 ; N guillemotright ; B 98 106 451 438 ;
+C 188 ; WX 1000 ; N ellipsis ; B 115 0 885 104 ;
+C 189 ; WX 1000 ; N perthousand ; B 9 -22 993 738 ;
+C 191 ; WX 611 ; N questiondown ; B 95 -217 528 524 ;
+C 193 ; WX 333 ; N grave ; B 22 592 231 740 ;
+C 194 ; WX 333 ; N acute ; B 92 592 301 740 ;
+C 195 ; WX 333 ; N circumflex ; B 20 591 307 741 ;
+C 196 ; WX 333 ; N tilde ; B 5 613 319 717 ;
+C 197 ; WX 333 ; N macron ; B 28 631 302 701 ;
+C 198 ; WX 333 ; N breve ; B 15 597 316 732 ;
+C 199 ; WX 333 ; N dotaccent ; B 115 612 219 716 ;
+C 200 ; WX 333 ; N dieresis ; B 30 612 296 715 ;
+C 202 ; WX 333 ; N ring ; B 79 579 255 754 ;
+C 203 ; WX 333 ; N cedilla ; B 39 -214 287 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B -35 590 348 740 ;
+C 206 ; WX 333 ; N ogonek ; B 57 -205 265 0 ;
+C 207 ; WX 333 ; N caron ; B 19 591 306 741 ;
+C 208 ; WX 1000 ; N emdash ; B -9 240 1001 312 ;
+C 225 ; WX 1000 ; N AE ; B 11 0 950 729 ;
+C 227 ; WX 370 ; N ordfeminine ; B 37 303 333 742 ;
+C 232 ; WX 556 ; N Lslash ; B 0 0 552 729 ;
+C 233 ; WX 778 ; N Oslash ; B 30 -23 744 755 ;
+C 234 ; WX 1000 ; N OE ; B 43 -20 959 741 ;
+C 235 ; WX 365 ; N ordmasculine ; B 40 303 324 742 ;
+C 241 ; WX 889 ; N ae ; B 34 -23 845 539 ;
+C 245 ; WX 278 ; N dotlessi ; B 94 0 178 524 ;
+C 248 ; WX 222 ; N lslash ; B 0 0 212 729 ;
+C 249 ; WX 611 ; N oslash ; B 18 -30 529 539 ;
+C 250 ; WX 944 ; N oe ; B 40 -23 899 539 ;
+C 251 ; WX 611 ; N germandbls ; B 126 -20 566 729 ;
+C -1 ; WX 722 ; N Udieresis ; B 85 -23 645 914 ;
+C -1 ; WX 722 ; N Uacute ; B 85 -23 645 939 ;
+C -1 ; WX 667 ; N Scedilla ; B 45 -214 621 741 ;
+C -1 ; WX 611 ; N Tcaron ; B 21 0 593 940 ;
+C -1 ; WX 667 ; N Scaron ; B 48 -23 621 940 ;
+C -1 ; WX 722 ; N Rcaron ; B 93 0 679 940 ;
+C -1 ; WX 722 ; N Racute ; B 93 0 679 939 ;
+C -1 ; WX 667 ; N Sacute ; B 48 -23 621 939 ;
+C -1 ; WX 778 ; N Otilde ; B 38 -23 742 916 ;
+C -1 ; WX 556 ; N ucircumflex ; B 65 -23 482 741 ;
+C -1 ; WX 778 ; N Ohungarumlaut ; B 38 -23 742 939 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 85 -23 645 939 ;
+C -1 ; WX 666 ; N Yacute ; B 13 0 661 939 ;
+C -1 ; WX 722 ; N Eth ; B 20 0 667 729 ;
+C -1 ; WX 722 ; N Dcroat ; B 20 0 667 729 ;
+C -1 ; WX 611 ; N Zacute ; B 28 0 583 939 ;
+C -1 ; WX 722 ; N Uring ; B 85 -23 645 953 ;
+C -1 ; WX 556 ; N gbreve ; B 29 -218 489 732 ;
+C -1 ; WX 556 ; N eogonek ; B 40 -204 514 539 ;
+C -1 ; WX 556 ; N edotaccent ; B 40 -23 513 716 ;
+C -1 ; WX 556 ; N ecaron ; B 40 -23 513 741 ;
+C -1 ; WX 722 ; N Ugrave ; B 85 -23 645 939 ;
+C -1 ; WX 666 ; N Thorn ; B 91 0 616 729 ;
+C -1 ; WX 556 ; N eacute ; B 40 -23 513 740 ;
+C -1 ; WX 556 ; N edieresis ; B 40 -23 513 715 ;
+C -1 ; WX 635 ; N dcaron ; B 26 -23 648 729 ;
+C -1 ; WX 500 ; N ccedilla ; B 31 -214 477 539 ;
+C -1 ; WX 500 ; N ccaron ; B 31 -23 477 741 ;
+C -1 ; WX 500 ; N cacute ; B 31 -23 477 740 ;
+C -1 ; WX 556 ; N aogonek ; B 43 -205 596 539 ;
+C -1 ; WX 556 ; N aring ; B 42 -23 535 754 ;
+C -1 ; WX 556 ; N atilde ; B 42 -23 535 717 ;
+C -1 ; WX 556 ; N abreve ; B 42 -23 535 732 ;
+C -1 ; WX 556 ; N egrave ; B 40 -23 513 740 ;
+C -1 ; WX 556 ; N agrave ; B 42 -23 535 740 ;
+C -1 ; WX 556 ; N aacute ; B 42 -23 535 740 ;
+C -1 ; WX 556 ; N adieresis ; B 42 -23 535 715 ;
+C -1 ; WX 722 ; N Uogonek ; B 85 -205 645 729 ;
+C -1 ; WX 556 ; N ugrave ; B 65 -23 482 740 ;
+C -1 ; WX 556 ; N uacute ; B 65 -23 482 740 ;
+C -1 ; WX 556 ; N udieresis ; B 65 -23 482 715 ;
+C -1 ; WX 308 ; N tcaron ; B 14 -23 321 800 ;
+C -1 ; WX 500 ; N scommaaccent ; B 34 -285 459 539 ;
+C -1 ; WX 611 ; N Zcaron ; B 28 0 583 940 ;
+C -1 ; WX 556 ; N ecircumflex ; B 40 -23 513 741 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 85 -23 645 940 ;
+C -1 ; WX 556 ; N acircumflex ; B 42 -23 535 741 ;
+C -1 ; WX 611 ; N Zdotaccent ; B 28 0 583 915 ;
+C -1 ; WX 500 ; N scaron ; B 34 -23 459 741 ;
+C -1 ; WX 667 ; N Amacron ; B 17 0 653 900 ;
+C -1 ; WX 500 ; N sacute ; B 34 -23 459 740 ;
+C -1 ; WX 611 ; N Tcommaaccent ; B 21 -285 593 729 ;
+C -1 ; WX 667 ; N Ydieresis ; B 13 0 661 914 ;
+C -1 ; WX 555 ; N thorn ; B 54 -218 522 714 ;
+C -1 ; WX 667 ; N Emacron ; B 90 0 613 900 ;
+C -1 ; WX 778 ; N Ograve ; B 38 -23 742 939 ;
+C -1 ; WX 778 ; N Oacute ; B 38 -23 742 939 ;
+C -1 ; WX 778 ; N Odieresis ; B 38 -23 742 914 ;
+C -1 ; WX 722 ; N Ntilde ; B 76 0 646 916 ;
+C -1 ; WX 722 ; N Ncaron ; B 76 0 646 940 ;
+C -1 ; WX 722 ; N Nacute ; B 76 0 646 939 ;
+C -1 ; WX 556 ; N Lcaron ; B 80 0 533 729 ;
+C -1 ; WX 556 ; N Lacute ; B 70 0 533 939 ;
+C -1 ; WX 278 ; N Idotaccent ; B 92 0 196 915 ;
+C -1 ; WX 333 ; N racute ; B 69 0 331 740 ;
+C -1 ; WX 278 ; N Icircumflex ; B -1 0 286 940 ;
+C -1 ; WX 556 ; N ohungarumlaut ; B 36 -23 526 740 ;
+C -1 ; WX 556 ; N otilde ; B 36 -23 510 717 ;
+C -1 ; WX 556 ; N Euro ; B 2 -23 543 709 ;
+C -1 ; WX 556 ; N ocircumflex ; B 36 -23 510 741 ;
+C -1 ; WX 351 ; N onesuperior ; B 61 284 222 709 ;
+C -1 ; WX 351 ; N twosuperior ; B 19 284 326 709 ;
+C -1 ; WX 351 ; N threesuperior ; B 16 270 322 709 ;
+C -1 ; WX 278 ; N Igrave ; B 1 0 210 939 ;
+C -1 ; WX 278 ; N Iacute ; B 71 0 280 939 ;
+C -1 ; WX 278 ; N Imacron ; B 20 0 274 900 ;
+C -1 ; WX 278 ; N Iogonek ; B 66 -204 234 729 ;
+C -1 ; WX 278 ; N Idieresis ; B 9 0 275 907 ;
+C -1 ; WX 778 ; N Gbreve ; B 44 -23 709 931 ;
+C -1 ; WX 722 ; N Umacron ; B 85 -23 645 900 ;
+C -1 ; WX 667 ; N Kcommaaccent ; B 79 -285 658 729 ;
+C -1 ; WX 556 ; N ograve ; B 36 -23 510 740 ;
+C -1 ; WX 667 ; N Scommaaccent ; B 48 -285 621 741 ;
+C -1 ; WX 667 ; N Eogonek ; B 90 -205 652 729 ;
+C -1 ; WX 556 ; N oacute ; B 36 -23 510 740 ;
+C -1 ; WX 667 ; N Edotaccent ; B 90 0 613 915 ;
+C -1 ; WX 222 ; N iogonek ; B 25 -204 190 729 ;
+C -1 ; WX 556 ; N gcommaaccent ; B 29 -218 489 817 ;
+C -1 ; WX 556 ; N odieresis ; B 36 -23 510 715 ;
+C -1 ; WX 556 ; N ntilde ; B 70 0 487 717 ;
+C -1 ; WX 556 ; N ncaron ; B 70 0 487 741 ;
+C -1 ; WX 667 ; N Ecaron ; B 90 0 613 940 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 90 0 613 940 ;
+C -1 ; WX 500 ; N scedilla ; B 34 -214 459 539 ;
+C -1 ; WX 333 ; N rcaron ; B 48 0 335 741 ;
+C -1 ; WX 667 ; N Egrave ; B 90 0 613 939 ;
+C -1 ; WX 667 ; N Eacute ; B 90 0 613 939 ;
+C -1 ; WX 778 ; N Gcommaaccent ; B 44 -285 709 741 ;
+C -1 ; WX 722 ; N Rcommaaccent ; B 93 -285 679 729 ;
+C -1 ; WX 667 ; N Edieresis ; B 90 0 613 914 ;
+C -1 ; WX 556 ; N nacute ; B 70 0 487 740 ;
+C -1 ; WX 556 ; N uogonek ; B 65 -204 521 524 ;
+C -1 ; WX 556 ; N umacron ; B 65 -23 482 701 ;
+C -1 ; WX 722 ; N Dcaron ; B 89 0 667 940 ;
+C -1 ; WX 292 ; N lcaron ; B 68 0 305 729 ;
+C -1 ; WX 722 ; N Ccaron ; B 48 -23 677 940 ;
+C -1 ; WX 722 ; N Cacute ; B 48 -23 677 939 ;
+C -1 ; WX 722 ; N Ccedilla ; B 48 -214 677 741 ;
+C -1 ; WX 606 ; N degree ; B 151 383 454 686 ;
+C -1 ; WX 667 ; N Aogonek ; B 17 -205 692 729 ;
+C -1 ; WX 584 ; N minus ; B 40 197 544 267 ;
+C -1 ; WX 584 ; N multiply ; B 95 34 488 427 ;
+C -1 ; WX 584 ; N divide ; B 50 0 534 472 ;
+C -1 ; WX 667 ; N Aring ; B 17 0 653 953 ;
+C -1 ; WX 1000 ; N trademark ; B 63 292 938 729 ;
+C -1 ; WX 333 ; N rcommaaccent ; B 65 -285 321 539 ;
+C -1 ; WX 222 ; N lacute ; B 63 0 272 939 ;
+C -1 ; WX 556 ; N omacron ; B 36 -23 510 701 ;
+C -1 ; WX 667 ; N Atilde ; B 17 0 653 916 ;
+C -1 ; WX 278 ; N icircumflex ; B -7 0 280 741 ;
+C -1 ; WX 278 ; N igrave ; B -5 0 204 740 ;
+C -1 ; WX 556 ; N ncommaaccent ; B 70 -285 487 539 ;
+C -1 ; WX 222 ; N lcommaaccent ; B 63 -285 163 729 ;
+C -1 ; WX 584 ; N plusminus ; B 50 -11 534 623 ;
+C -1 ; WX 869 ; N onehalf ; B 61 -20 844 709 ;
+C -1 ; WX 869 ; N onequarter ; B 61 -20 849 709 ;
+C -1 ; WX 869 ; N threequarters ; B 16 -20 849 709 ;
+C -1 ; WX 278 ; N iacute ; B 65 0 274 740 ;
+C -1 ; WX 667 ; N Abreve ; B 17 0 653 931 ;
+C -1 ; WX 500 ; N kcommaaccent ; B 58 -285 502 729 ;
+C -1 ; WX 778 ; N Omacron ; B 38 -23 742 900 ;
+C -1 ; WX 222 ; N imacron ; B -16 0 231 701 ;
+C -1 ; WX 556 ; N emacron ; B 40 -23 513 701 ;
+C -1 ; WX 556 ; N amacron ; B 42 -23 535 701 ;
+C -1 ; WX 278 ; N tcommaaccent ; B 14 -285 254 668 ;
+C -1 ; WX 500 ; N ydieresis ; B 20 -218 478 715 ;
+C -1 ; WX 500 ; N zdotaccent ; B 31 0 457 716 ;
+C -1 ; WX 500 ; N zcaron ; B 31 0 457 741 ;
+C -1 ; WX 500 ; N zacute ; B 31 0 457 740 ;
+C -1 ; WX 500 ; N yacute ; B 20 -218 478 740 ;
+C -1 ; WX 556 ; N uhungarumlaut ; B 65 -23 530 740 ;
+C -1 ; WX 556 ; N eth ; B 36 -23 510 743 ;
+C -1 ; WX 556 ; N uring ; B 65 -23 482 754 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 38 -23 742 940 ;
+C -1 ; WX 333 ; N commaaccent ; B 116 -285 216 -60 ;
+C -1 ; WX 737 ; N copyright ; B -13 -22 751 742 ;
+C -1 ; WX 737 ; N registered ; B -13 -22 751 742 ;
+C -1 ; WX 667 ; N Acircumflex ; B 17 0 653 940 ;
+C -1 ; WX 278 ; N idieresis ; B 3 0 269 708 ;
+C -1 ; WX 489 ; N lozenge ; B 16 0 462 744 ;
+C -1 ; WX 711 ; N Delta ; B 10 0 701 729 ;
+C -1 ; WX 548 ; N notequal ; B 32 -25 516 486 ;
+C -1 ; WX 542 ; N radical ; B 7 -36 512 913 ;
+C -1 ; WX 667 ; N Agrave ; B 17 0 653 939 ;
+C -1 ; WX 667 ; N Aacute ; B 17 0 653 939 ;
+C -1 ; WX 584 ; N lessequal ; B 45 -11 534 639 ;
+C -1 ; WX 584 ; N greaterequal ; B 45 -11 534 639 ;
+C -1 ; WX 584 ; N logicalnot ; B 40 86 544 375 ;
+C -1 ; WX 711 ; N summation ; B 17 -97 694 760 ;
+C -1 ; WX 490 ; N partialdiff ; B 22 -15 458 750 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B 76 -285 646 729 ;
+C -1 ; WX 556 ; N dcroat ; B 26 -23 557 729 ;
+C -1 ; WX 260 ; N brokenbar ; B 100 -212 160 729 ;
+C -1 ; WX 556 ; N Lcommaaccent ; B 80 -285 533 729 ;
+C -1 ; WX 667 ; N Adieresis ; B 17 0 653 914 ;
+C -1 ; WX 556 ; N mu ; B 65 -220 544 524 ;
+C -1 ; WX 278 ; N .notdef ; B 191 0 191 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 998
+KPX A C -36
+KPX A Ccedilla -36
+KPX A G -35
+KPX A O -33
+KPX A Odieresis -33
+KPX A Q -32
+KPX A T -93
+KPX A U -37
+KPX A Uacute -37
+KPX A Ucircumflex -37
+KPX A Udieresis -37
+KPX A Ugrave -37
+KPX A V -75
+KPX A W -51
+KPX A Y -99
+KPX A a -4
+KPX A b 4
+KPX A c -11
+KPX A ccedilla -10
+KPX A comma 5
+KPX A d -8
+KPX A e -16
+KPX A g -10
+KPX A guillemotleft -44
+KPX A guilsinglleft -40
+KPX A hyphen -3
+KPX A o -13
+KPX A period 5
+KPX A q -8
+KPX A quotedblright -56
+KPX A quoteright -65
+KPX A t -16
+KPX A u -12
+KPX A v -31
+KPX A w -21
+KPX A y -34
+KPX Aacute C -36
+KPX Aacute G -35
+KPX Aacute O -33
+KPX Aacute Q -32
+KPX Aacute T -93
+KPX Aacute U -37
+KPX Aacute V -75
+KPX Aacute W -51
+KPX Aacute Y -99
+KPX Aacute a -4
+KPX Aacute b 4
+KPX Aacute c -11
+KPX Aacute comma 5
+KPX Aacute d -8
+KPX Aacute e -16
+KPX Aacute g -10
+KPX Aacute guillemotleft -44
+KPX Aacute guilsinglleft -40
+KPX Aacute hyphen -3
+KPX Aacute o -13
+KPX Aacute period 5
+KPX Aacute q -8
+KPX Aacute quoteright -65
+KPX Aacute t -16
+KPX Aacute u -12
+KPX Aacute v -31
+KPX Aacute w -21
+KPX Aacute y -34
+KPX Acircumflex C -36
+KPX Acircumflex G -35
+KPX Acircumflex O -33
+KPX Acircumflex Q -32
+KPX Acircumflex T -93
+KPX Acircumflex U -37
+KPX Acircumflex V -75
+KPX Acircumflex W -51
+KPX Acircumflex Y -99
+KPX Acircumflex comma 5
+KPX Acircumflex period 5
+KPX Adieresis C -36
+KPX Adieresis G -35
+KPX Adieresis O -33
+KPX Adieresis Q -32
+KPX Adieresis T -93
+KPX Adieresis U -37
+KPX Adieresis V -75
+KPX Adieresis W -51
+KPX Adieresis Y -99
+KPX Adieresis a -4
+KPX Adieresis b 4
+KPX Adieresis c -11
+KPX Adieresis comma 5
+KPX Adieresis d -8
+KPX Adieresis g -10
+KPX Adieresis guillemotleft -44
+KPX Adieresis guilsinglleft -40
+KPX Adieresis hyphen -3
+KPX Adieresis o -13
+KPX Adieresis period 5
+KPX Adieresis q -8
+KPX Adieresis quotedblright -56
+KPX Adieresis quoteright -65
+KPX Adieresis t -16
+KPX Adieresis u -12
+KPX Adieresis v -31
+KPX Adieresis w -21
+KPX Adieresis y -34
+KPX Agrave C -36
+KPX Agrave G -35
+KPX Agrave O -33
+KPX Agrave Q -32
+KPX Agrave T -93
+KPX Agrave U -37
+KPX Agrave V -75
+KPX Agrave W -51
+KPX Agrave Y -99
+KPX Agrave comma 5
+KPX Agrave period 5
+KPX Aring C -36
+KPX Aring G -35
+KPX Aring O -33
+KPX Aring Q -32
+KPX Aring T -93
+KPX Aring U -37
+KPX Aring V -75
+KPX Aring W -51
+KPX Aring Y -99
+KPX Aring a -4
+KPX Aring b 4
+KPX Aring c -11
+KPX Aring comma 5
+KPX Aring d -8
+KPX Aring e -16
+KPX Aring g -10
+KPX Aring guillemotleft -44
+KPX Aring guilsinglleft -40
+KPX Aring hyphen -3
+KPX Aring o -13
+KPX Aring period 5
+KPX Aring q -8
+KPX Aring quotedblright -56
+KPX Aring quoteright -65
+KPX Aring t -16
+KPX Aring u -12
+KPX Aring v -31
+KPX Aring w -21
+KPX Aring y -34
+KPX Atilde C -36
+KPX Atilde G -35
+KPX Atilde O -33
+KPX Atilde Q -32
+KPX Atilde T -93
+KPX Atilde U -37
+KPX Atilde V -75
+KPX Atilde W -51
+KPX Atilde Y -99
+KPX Atilde comma 5
+KPX Atilde period 5
+KPX B A -21
+KPX B AE -21
+KPX B Aacute -21
+KPX B Acircumflex -21
+KPX B Adieresis -21
+KPX B Aring -21
+KPX B Atilde -21
+KPX B O -7
+KPX B OE -5
+KPX B Oacute -7
+KPX B Ocircumflex -7
+KPX B Odieresis -7
+KPX B Ograve -7
+KPX B Oslash -1
+KPX B V -41
+KPX B W -25
+KPX B Y -44
+KPX C A -32
+KPX C AE -33
+KPX C Aacute -32
+KPX C Adieresis -32
+KPX C Aring -32
+KPX C H -12
+KPX C K -10
+KPX C O -8
+KPX C Oacute -8
+KPX C Odieresis -8
+KPX Ccedilla A -31
+KPX D A -42
+KPX D Aacute -42
+KPX D Acircumflex -42
+KPX D Adieresis -42
+KPX D Agrave -42
+KPX D Aring -42
+KPX D Atilde -42
+KPX D J -5
+KPX D T -45
+KPX D V -51
+KPX D W -29
+KPX D X -53
+KPX D Y -63
+KPX F A -69
+KPX F Aacute -69
+KPX F Acircumflex -69
+KPX F Adieresis -69
+KPX F Agrave -69
+KPX F Aring -69
+KPX F Atilde -69
+KPX F J -51
+KPX F O -22
+KPX F Odieresis -22
+KPX F a -33
+KPX F aacute -33
+KPX F adieresis -33
+KPX F ae -29
+KPX F aring -33
+KPX F comma -108
+KPX F e -24
+KPX F eacute -24
+KPX F hyphen -14
+KPX F i -10
+KPX F j -12
+KPX F o -21
+KPX F oacute -21
+KPX F odieresis -21
+KPX F oe -23
+KPX F oslash -21
+KPX F period -108
+KPX F r -35
+KPX F u -33
+KPX G A -6
+KPX G AE -3
+KPX G Aacute -6
+KPX G Acircumflex -6
+KPX G Adieresis -6
+KPX G Agrave -6
+KPX G Aring -6
+KPX G Atilde -6
+KPX G T -44
+KPX G V -50
+KPX G W -28
+KPX G Y -62
+KPX J A -32
+KPX J AE -31
+KPX J Adieresis -32
+KPX J Aring -32
+KPX K C -51
+KPX K G -51
+KPX K O -48
+KPX K OE -45
+KPX K Oacute -48
+KPX K Odieresis -48
+KPX K S -38
+KPX K T 20
+KPX K a -11
+KPX K adieresis -11
+KPX K ae -7
+KPX K aring -11
+KPX K e -32
+KPX K hyphen -47
+KPX K o -29
+KPX K oacute -29
+KPX K odieresis -29
+KPX K u -19
+KPX K udieresis -19
+KPX K y -62
+KPX L A 17
+KPX L AE 20
+KPX L Aacute 17
+KPX L Adieresis 17
+KPX L Aring 17
+KPX L C -41
+KPX L Ccedilla -37
+KPX L G -42
+KPX L O -41
+KPX L Oacute -41
+KPX L Ocircumflex -41
+KPX L Odieresis -41
+KPX L Ograve -41
+KPX L Otilde -41
+KPX L S -19
+KPX L T -105
+KPX L U -35
+KPX L Udieresis -35
+KPX L V -105
+KPX L W -68
+KPX L Y -121
+KPX L hyphen -125
+KPX L quotedblright -141
+KPX L quoteright -149
+KPX L u -7
+KPX L udieresis -7
+KPX L y -56
+KPX N A -9
+KPX N AE -6
+KPX N Aacute -9
+KPX N Adieresis -9
+KPX N Aring -9
+KPX N C -3
+KPX N Ccedilla -3
+KPX N G -2
+KPX N O 0
+KPX N Oacute 0
+KPX N Odieresis 0
+KPX N a -5
+KPX N aacute -5
+KPX N adieresis -5
+KPX N ae -2
+KPX N aring -5
+KPX N comma -7
+KPX N e 0
+KPX N eacute 0
+KPX N o 2
+KPX N oacute 2
+KPX N odieresis 2
+KPX N oslash 4
+KPX N period -7
+KPX N u 0
+KPX N udieresis 0
+KPX O A -35
+KPX O AE -39
+KPX O Aacute -35
+KPX O Adieresis -35
+KPX O Aring -35
+KPX O T -42
+KPX O V -45
+KPX O W -23
+KPX O X -46
+KPX O Y -59
+KPX Oacute A -35
+KPX Oacute T -42
+KPX Oacute V -45
+KPX Oacute W -23
+KPX Oacute Y -59
+KPX Ocircumflex T -42
+KPX Ocircumflex V -45
+KPX Ocircumflex Y -59
+KPX Odieresis A -35
+KPX Odieresis T -42
+KPX Odieresis V -45
+KPX Odieresis W -23
+KPX Odieresis X -46
+KPX Odieresis Y -59
+KPX Ograve T -42
+KPX Ograve V -45
+KPX Ograve Y -59
+KPX Oslash A -33
+KPX Otilde T -42
+KPX Otilde V -45
+KPX Otilde Y -59
+KPX P A -78
+KPX P AE -86
+KPX P Aacute -78
+KPX P Adieresis -78
+KPX P Aring -78
+KPX P J -78
+KPX P a -28
+KPX P aacute -28
+KPX P adieresis -28
+KPX P ae -24
+KPX P aring -28
+KPX P comma -135
+KPX P e -31
+KPX P eacute -31
+KPX P hyphen -40
+KPX P o -27
+KPX P oacute -27
+KPX P odieresis -27
+KPX P oe -28
+KPX P oslash -27
+KPX P period -135
+KPX R C -16
+KPX R Ccedilla -16
+KPX R G -15
+KPX R O -13
+KPX R OE -11
+KPX R Oacute -13
+KPX R Odieresis -13
+KPX R T -23
+KPX R U -17
+KPX R Udieresis -17
+KPX R V -39
+KPX R W -27
+KPX R Y -43
+KPX R a -15
+KPX R aacute -15
+KPX R adieresis -15
+KPX R ae -12
+KPX R aring -15
+KPX R e -12
+KPX R eacute -12
+KPX R hyphen -2
+KPX R o -9
+KPX R oacute -9
+KPX R odieresis -9
+KPX R oe -11
+KPX R u -9
+KPX R uacute -9
+KPX R udieresis -9
+KPX R y -8
+KPX S A -22
+KPX S AE -22
+KPX S Aacute -22
+KPX S Adieresis -22
+KPX S Aring -22
+KPX S T -28
+KPX S V -42
+KPX S W -28
+KPX S Y -48
+KPX S t -3
+KPX T A -95
+KPX T AE -97
+KPX T Aacute -95
+KPX T Acircumflex -95
+KPX T Adieresis -95
+KPX T Agrave -95
+KPX T Aring -95
+KPX T Atilde -95
+KPX T C -44
+KPX T G -45
+KPX T J -100
+KPX T O -42
+KPX T OE -35
+KPX T Oacute -42
+KPX T Ocircumflex -42
+KPX T Odieresis -42
+KPX T Ograve -42
+KPX T Oslash -41
+KPX T Otilde -42
+KPX T S -24
+KPX T V 12
+KPX T W 16
+KPX T Y 20
+KPX T a -100
+KPX T ae -97
+KPX T c -90
+KPX T colon -133
+KPX T comma -100
+KPX T e -95
+KPX T g -89
+KPX T guillemotleft -121
+KPX T guilsinglleft -117
+KPX T hyphen -77
+KPX T i -3
+KPX T j -5
+KPX T o -92
+KPX T oslash -87
+KPX T period -100
+KPX T r -92
+KPX T s -92
+KPX T semicolon -129
+KPX T u -91
+KPX T v -95
+KPX T w -93
+KPX T y -100
+KPX U A -36
+KPX U AE -39
+KPX U Aacute -36
+KPX U Acircumflex -36
+KPX U Adieresis -36
+KPX U Aring -36
+KPX U Atilde -36
+KPX U comma -27
+KPX U m -4
+KPX U n -4
+KPX U p 3
+KPX U period -25
+KPX U r -4
+KPX Uacute A -36
+KPX Uacute comma -27
+KPX Uacute m -4
+KPX Uacute n -4
+KPX Uacute p 3
+KPX Uacute period -25
+KPX Uacute r -4
+KPX Ucircumflex A -36
+KPX Udieresis A -36
+KPX Udieresis b 3
+KPX Udieresis comma -27
+KPX Udieresis m -4
+KPX Udieresis n -4
+KPX Udieresis p 3
+KPX Udieresis period -25
+KPX Udieresis r -4
+KPX Ugrave A -36
+KPX V A -71
+KPX V AE -78
+KPX V Aacute -71
+KPX V Acircumflex -71
+KPX V Adieresis -71
+KPX V Agrave -71
+KPX V Aring -71
+KPX V Atilde -71
+KPX V C -43
+KPX V G -42
+KPX V O -40
+KPX V Oacute -40
+KPX V Ocircumflex -40
+KPX V Odieresis -40
+KPX V Ograve -40
+KPX V Oslash -33
+KPX V Otilde -40
+KPX V S -35
+KPX V T 15
+KPX V a -59
+KPX V ae -55
+KPX V colon -66
+KPX V comma -89
+KPX V e -57
+KPX V g -50
+KPX V guillemotleft -83
+KPX V guilsinglleft -80
+KPX V hyphen -38
+KPX V i -5
+KPX V o -54
+KPX V oslash -50
+KPX V period -89
+KPX V r -42
+KPX V semicolon -66
+KPX V u -41
+KPX V y -20
+KPX W A -50
+KPX W AE -56
+KPX W Aacute -50
+KPX W Acircumflex -50
+KPX W Adieresis -50
+KPX W Agrave -50
+KPX W Aring -50
+KPX W Atilde -50
+KPX W C -23
+KPX W G -22
+KPX W O -20
+KPX W Oacute -20
+KPX W Ocircumflex -20
+KPX W Odieresis -20
+KPX W Ograve -20
+KPX W Oslash -13
+KPX W Otilde -20
+KPX W S -24
+KPX W T 19
+KPX W a -38
+KPX W ae -34
+KPX W colon -52
+KPX W comma -56
+KPX W e -32
+KPX W g -25
+KPX W guillemotleft -58
+KPX W guilsinglleft -54
+KPX W hyphen -13
+KPX W i -1
+KPX W o -29
+KPX W oslash -25
+KPX W period -56
+KPX W r -28
+KPX W semicolon -53
+KPX W u -28
+KPX W y -6
+KPX X C -48
+KPX X O -45
+KPX X Odieresis -45
+KPX X Q -44
+KPX X a -15
+KPX X e -36
+KPX X hyphen -51
+KPX X o -33
+KPX X u -24
+KPX X y -61
+KPX Y A -96
+KPX Y AE -103
+KPX Y Aacute -96
+KPX Y Acircumflex -96
+KPX Y Adieresis -96
+KPX Y Agrave -96
+KPX Y Aring -96
+KPX Y Atilde -96
+KPX Y C -58
+KPX Y G -58
+KPX Y O -56
+KPX Y Oacute -56
+KPX Y Ocircumflex -56
+KPX Y Odieresis -56
+KPX Y Ograve -56
+KPX Y Oslash -54
+KPX Y Otilde -56
+KPX Y S -41
+KPX Y T 23
+KPX Y a -88
+KPX Y ae -84
+KPX Y colon -87
+KPX Y comma -111
+KPX Y e -89
+KPX Y g -83
+KPX Y guillemotleft -123
+KPX Y guilsinglleft -119
+KPX Y hyphen -84
+KPX Y i 3
+KPX Y o -86
+KPX Y oslash -82
+KPX Y p -54
+KPX Y period -111
+KPX Y semicolon -88
+KPX Y u -63
+KPX Y v -36
+KPX Z v -33
+KPX Z y -38
+KPX a j -4
+KPX a quoteright -23
+KPX a v -21
+KPX a w -13
+KPX a y -26
+KPX aacute v -21
+KPX aacute w -13
+KPX aacute y -26
+KPX adieresis v -21
+KPX adieresis w -13
+KPX adieresis y -26
+KPX ae v -16
+KPX ae w -10
+KPX ae y -20
+KPX agrave v -21
+KPX agrave w -13
+KPX agrave y -26
+KPX aring v -21
+KPX aring w -13
+KPX aring y -26
+KPX b v -11
+KPX b w -3
+KPX b y -15
+KPX c h 1
+KPX c k 7
+KPX comma one -100
+KPX comma quotedblright -41
+KPX comma quoteright -50
+KPX e quoteright -18
+KPX e t -10
+KPX e v -15
+KPX e w -9
+KPX e x -27
+KPX e y -19
+KPX eacute v -15
+KPX eacute w -9
+KPX eacute y -19
+KPX ecircumflex v -15
+KPX ecircumflex w -9
+KPX ecircumflex y -19
+KPX eight four 1
+KPX eight one -48
+KPX eight seven -33
+KPX f a -9
+KPX f aacute -9
+KPX f adieresis -9
+KPX f ae -5
+KPX f aring -9
+KPX f e -15
+KPX f eacute -15
+KPX f f 22
+KPX f i -2
+KPX f j -4
+KPX f l -3
+KPX f o -10
+KPX f oacute -10
+KPX f odieresis -10
+KPX f oe -12
+KPX f oslash -9
+KPX f quoteright 0
+KPX f s 0
+KPX f t 24
+KPX five four 1
+KPX five one -76
+KPX five seven -26
+KPX four four 5
+KPX four one -84
+KPX four seven -56
+KPX g a -5
+KPX g adieresis -5
+KPX g ae -1
+KPX g aring -5
+KPX g e 0
+KPX g eacute 0
+KPX g l 0
+KPX g oacute 3
+KPX g odieresis 3
+KPX g r 0
+KPX guillemotright A -50
+KPX guillemotright AE -54
+KPX guillemotright Aacute -50
+KPX guillemotright Adieresis -50
+KPX guillemotright Aring -50
+KPX guillemotright T -126
+KPX guillemotright V -93
+KPX guillemotright W -66
+KPX guillemotright Y -133
+KPX guilsinglright A -44
+KPX guilsinglright AE -48
+KPX guilsinglright Aacute -44
+KPX guilsinglright Adieresis -44
+KPX guilsinglright Aring -44
+KPX guilsinglright T -121
+KPX guilsinglright V -88
+KPX guilsinglright W -60
+KPX guilsinglright Y -128
+KPX h quoteright -15
+KPX h y -18
+KPX hyphen A -7
+KPX hyphen AE -11
+KPX hyphen Aacute -7
+KPX hyphen Adieresis -7
+KPX hyphen Aring -7
+KPX hyphen T -80
+KPX hyphen V -46
+KPX hyphen W -19
+KPX hyphen Y -92
+KPX i T -7
+KPX i j -3
+KPX k a -2
+KPX k aacute -2
+KPX k adieresis -2
+KPX k ae 2
+KPX k aring -2
+KPX k comma 0
+KPX k e -21
+KPX k eacute -21
+KPX k g -16
+KPX k hyphen -41
+KPX k o -19
+KPX k oacute -19
+KPX k odieresis -19
+KPX k period 0
+KPX k s -3
+KPX k u -11
+KPX k udieresis -6
+KPX l v 0
+KPX l y -5
+KPX m p 5
+KPX m v -13
+KPX m w -7
+KPX m y -18
+KPX n T -96
+KPX n p 5
+KPX n quoteright -14
+KPX n v -13
+KPX n w -7
+KPX n y -18
+KPX nine four -3
+KPX nine one -43
+KPX nine seven -37
+KPX o T -99
+KPX o quoteright -21
+KPX o t -10
+KPX o v -18
+KPX o w -10
+KPX o x -27
+KPX o y -22
+KPX oacute v -18
+KPX oacute w -10
+KPX oacute y -22
+KPX ocircumflex t -10
+KPX odieresis t -10
+KPX odieresis v -18
+KPX odieresis w -10
+KPX odieresis x -27
+KPX odieresis y -22
+KPX ograve v -18
+KPX ograve w -10
+KPX ograve y -22
+KPX one comma -74
+KPX one eight -65
+KPX one five -67
+KPX one four -81
+KPX one nine -65
+KPX one one -118
+KPX one period -74
+KPX one seven -90
+KPX one six -62
+KPX one three -67
+KPX one two -69
+KPX one zero -62
+KPX p t -4
+KPX p y -16
+KPX period one -101
+KPX period quotedblright -41
+KPX period quoteright -51
+KPX q c 8
+KPX q u 4
+KPX quotedblbase A 30
+KPX quotedblbase AE 30
+KPX quotedblbase T -75
+KPX quotedblbase V -69
+KPX quotedblbase W -34
+KPX quotedblbase Y -91
+KPX quotedblleft A -52
+KPX quotedblleft AE -64
+KPX quotedblleft Aacute -52
+KPX quotedblleft Adieresis -52
+KPX quotedblleft Aring -52
+KPX quotedblleft T 9
+KPX quotedblleft V 15
+KPX quotedblleft W 27
+KPX quotedblleft Y 5
+KPX quotedblright A -53
+KPX quotedblright AE -66
+KPX quotedblright Aacute -53
+KPX quotedblright Adieresis -53
+KPX quotedblright Aring -53
+KPX quotedblright T 11
+KPX quotedblright V 15
+KPX quotedblright W 26
+KPX quotedblright Y 7
+KPX quoteleft A -67
+KPX quoteleft AE -79
+KPX quoteleft Aacute -67
+KPX quoteleft Adieresis -67
+KPX quoteleft Aring -67
+KPX quoteleft T -5
+KPX quoteleft V 0
+KPX quoteleft W 12
+KPX quoteleft Y -9
+KPX quoteright A -72
+KPX quoteright AE -85
+KPX quoteright Aacute -72
+KPX quoteright Adieresis -72
+KPX quoteright Aring -72
+KPX quoteright comma -60
+KPX quoteright d -20
+KPX quoteright o -26
+KPX quoteright period -60
+KPX quoteright r -18
+KPX quoteright s -18
+KPX quoteright t -7
+KPX quoteright v -2
+KPX quoteright w 2
+KPX quoteright y -6
+KPX r a -5
+KPX r aacute -5
+KPX r acircumflex -5
+KPX r adieresis -5
+KPX r ae -1
+KPX r agrave -5
+KPX r aring -5
+KPX r c -6
+KPX r ccedilla -9
+KPX r colon -22
+KPX r comma -69
+KPX r d -1
+KPX r e -11
+KPX r eacute -11
+KPX r ecircumflex -11
+KPX r egrave -11
+KPX r f 26
+KPX r g -4
+KPX r h 0
+KPX r hyphen -47
+KPX r i 1
+KPX r j 0
+KPX r k 6
+KPX r l 1
+KPX r m 0
+KPX r n 0
+KPX r o -6
+KPX r oacute -6
+KPX r ocircumflex -6
+KPX r odieresis -6
+KPX r oe -8
+KPX r ograve -6
+KPX r oslash -6
+KPX r p 8
+KPX r period -69
+KPX r q -3
+KPX r quoteright 1
+KPX r r 0
+KPX r s 4
+KPX r semicolon -22
+KPX r t 28
+KPX r u 2
+KPX r v 29
+KPX r w 31
+KPX r x 20
+KPX r y 24
+KPX r z 9
+KPX s quoteright -22
+KPX s t -3
+KPX seven colon -77
+KPX seven comma -119
+KPX seven eight -28
+KPX seven five -30
+KPX seven four -93
+KPX seven one -53
+KPX seven period -119
+KPX seven seven -4
+KPX seven six -40
+KPX seven three -23
+KPX seven two -28
+KPX six four 1
+KPX six one -43
+KPX six seven -30
+KPX t S -8
+KPX t a -1
+KPX t aacute -1
+KPX t adieresis -1
+KPX t ae 2
+KPX t aring -1
+KPX t colon -28
+KPX t e -14
+KPX t eacute -14
+KPX t h -3
+KPX t o -12
+KPX t oacute -12
+KPX t odieresis -12
+KPX t quoteright -1
+KPX t semicolon -28
+KPX three four -2
+KPX three one -49
+KPX three seven -33
+KPX two four -37
+KPX two one -36
+KPX two seven -25
+KPX u quoteright -8
+KPX v a -18
+KPX v aacute -18
+KPX v acircumflex -18
+KPX v adieresis -18
+KPX v ae -14
+KPX v agrave -18
+KPX v aring -18
+KPX v atilde -18
+KPX v c -16
+KPX v colon -23
+KPX v comma -69
+KPX v e -21
+KPX v eacute -21
+KPX v ecircumflex -21
+KPX v egrave -21
+KPX v g -14
+KPX v hyphen -12
+KPX v l 0
+KPX v o -17
+KPX v oacute -17
+KPX v odieresis -17
+KPX v ograve -17
+KPX v oslash -17
+KPX v period -69
+KPX v s -9
+KPX v semicolon -23
+KPX w a -15
+KPX w aacute -15
+KPX w acircumflex -15
+KPX w adieresis -15
+KPX w ae -11
+KPX w agrave -15
+KPX w aring -15
+KPX w atilde -15
+KPX w c -7
+KPX w colon -23
+KPX w comma -50
+KPX w e -12
+KPX w eacute -12
+KPX w ecircumflex -12
+KPX w egrave -12
+KPX w g -6
+KPX w hyphen -1
+KPX w l 0
+KPX w o -9
+KPX w oacute -9
+KPX w odieresis -9
+KPX w ograve -9
+KPX w oslash -6
+KPX w period -50
+KPX w s -5
+KPX w semicolon -23
+KPX x a -17
+KPX x c -23
+KPX x e -28
+KPX x eacute -28
+KPX x o -25
+KPX x q -20
+KPX y a -22
+KPX y aacute -22
+KPX y acircumflex -22
+KPX y adieresis -22
+KPX y ae -18
+KPX y agrave -22
+KPX y aring -22
+KPX y atilde -22
+KPX y c -19
+KPX y colon -27
+KPX y comma -70
+KPX y e -24
+KPX y eacute -24
+KPX y ecircumflex -24
+KPX y egrave -24
+KPX y g -17
+KPX y hyphen -14
+KPX y l -4
+KPX y o -20
+KPX y oacute -20
+KPX y odieresis -20
+KPX y ograve -20
+KPX y oslash -19
+KPX y period -70
+KPX y s -12
+KPX y semicolon -27
+KPX zero four -2
+KPX zero one -46
+KPX zero seven -39
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/pdf2swf/fonts/n019003l.pfb b/pdf2swf/fonts/n019003l.pfb
new file mode 100644
index 00000000..ff605552
--- /dev/null
+++ b/pdf2swf/fonts/n019003l.pfb
Binary files differ
diff --git a/pdf2swf/fonts/n019004l.afm b/pdf2swf/fonts/n019004l.afm
new file mode 100644
index 00000000..fe41636b
--- /dev/null
+++ b/pdf2swf/fonts/n019004l.afm
@@ -0,0 +1,1341 @@
+StartFontMetrics 3.0
+Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development
+Comment Creation Date: 12/22/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName NimbusSanL-Bold
+FullName Nimbus Sans L Bold
+FamilyName Nimbus Sans L
+Weight Bold
+ItalicAngle 0.0
+IsFixedPitch false
+UnderlinePosition -155
+UnderlineThickness 69
+Version 1.05
+Notice (URW)++,Copyright 1999 by (URW)++ Design & Development
+EncodingScheme AdobeStandardEncoding
+FontBBox -173 -307 1003 949
+CapHeight 729
+XHeight 540
+Descender -217
+Ascender 729
+StartCharMetrics 316
+C 32 ; WX 278 ; N space ; B 214 0 214 0 ;
+C 33 ; WX 333 ; N exclam ; B 112 0 262 726 ;
+C 34 ; WX 474 ; N quotedbl ; B 50 470 424 729 ;
+C 35 ; WX 556 ; N numbersign ; B 3 -32 553 697 ;
+C 36 ; WX 556 ; N dollar ; B 22 -126 527 763 ;
+C 37 ; WX 889 ; N percent ; B 22 -20 863 709 ;
+C 38 ; WX 722 ; N ampersand ; B 55 -23 694 723 ;
+C 39 ; WX 278 ; N quoteright ; B 66 469 201 729 ;
+C 40 ; WX 333 ; N parenleft ; B 40 -200 303 729 ;
+C 41 ; WX 333 ; N parenright ; B 22 -200 285 729 ;
+C 42 ; WX 389 ; N asterisk ; B 23 407 357 729 ;
+C 43 ; WX 584 ; N plus ; B 50 -10 533 473 ;
+C 44 ; WX 278 ; N comma ; B 64 -174 214 146 ;
+C 45 ; WX 333 ; N hyphen ; B 26 207 298 342 ;
+C 46 ; WX 278 ; N period ; B 64 0 214 146 ;
+C 47 ; WX 278 ; N slash ; B 2 -14 275 714 ;
+C 48 ; WX 556 ; N zero ; B 29 -23 517 724 ;
+C 49 ; WX 556 ; N one ; B 68 0 378 709 ;
+C 50 ; WX 556 ; N two ; B 30 0 515 724 ;
+C 51 ; WX 556 ; N three ; B 29 -23 516 724 ;
+C 52 ; WX 556 ; N four ; B 24 0 522 709 ;
+C 53 ; WX 556 ; N five ; B 27 -23 517 709 ;
+C 54 ; WX 556 ; N six ; B 32 -23 519 724 ;
+C 55 ; WX 556 ; N seven ; B 29 0 528 709 ;
+C 56 ; WX 556 ; N eight ; B 22 -23 525 724 ;
+C 57 ; WX 556 ; N nine ; B 28 -24 516 724 ;
+C 58 ; WX 333 ; N colon ; B 113 0 263 520 ;
+C 59 ; WX 333 ; N semicolon ; B 113 -174 263 520 ;
+C 60 ; WX 584 ; N less ; B 40 -10 529 474 ;
+C 61 ; WX 584 ; N equal ; B 50 52 534 411 ;
+C 62 ; WX 584 ; N greater ; B 40 -10 529 474 ;
+C 63 ; WX 611 ; N question ; B 64 0 556 744 ;
+C 64 ; WX 975 ; N at ; B 27 -138 947 745 ;
+C 65 ; WX 722 ; N A ; B 26 0 703 729 ;
+C 66 ; WX 722 ; N B ; B 82 0 666 729 ;
+C 67 ; WX 722 ; N C ; B 44 -23 685 741 ;
+C 68 ; WX 722 ; N D ; B 77 0 681 729 ;
+C 69 ; WX 667 ; N E ; B 79 0 624 729 ;
+C 70 ; WX 611 ; N F ; B 74 0 586 729 ;
+C 71 ; WX 778 ; N G ; B 42 -23 711 741 ;
+C 72 ; WX 722 ; N H ; B 68 0 657 729 ;
+C 73 ; WX 278 ; N I ; B 63 0 213 729 ;
+C 74 ; WX 556 ; N J ; B 24 -23 486 729 ;
+C 75 ; WX 722 ; N K ; B 74 0 717 729 ;
+C 76 ; WX 611 ; N L ; B 80 0 579 729 ;
+C 77 ; WX 833 ; N M ; B 66 0 776 729 ;
+C 78 ; WX 722 ; N N ; B 68 0 661 729 ;
+C 79 ; WX 778 ; N O ; B 40 -23 742 741 ;
+C 80 ; WX 667 ; N P ; B 76 0 633 729 ;
+C 81 ; WX 778 ; N Q ; B 43 -54 745 741 ;
+C 82 ; WX 722 ; N R ; B 80 0 677 729 ;
+C 83 ; WX 667 ; N S ; B 32 -23 633 741 ;
+C 84 ; WX 611 ; N T ; B 14 0 598 729 ;
+C 85 ; WX 722 ; N U ; B 76 -23 654 729 ;
+C 86 ; WX 667 ; N V ; B 24 0 647 729 ;
+C 87 ; WX 944 ; N W ; B 13 0 932 729 ;
+C 88 ; WX 667 ; N X ; B 22 0 653 729 ;
+C 89 ; WX 667 ; N Y ; B 27 0 650 729 ;
+C 90 ; WX 611 ; N Z ; B 30 0 578 729 ;
+C 91 ; WX 333 ; N bracketleft ; B 66 -200 308 729 ;
+C 92 ; WX 278 ; N backslash ; B -12 -14 289 714 ;
+C 93 ; WX 333 ; N bracketright ; B 18 -200 260 729 ;
+C 94 ; WX 584 ; N asciicircum ; B 61 270 522 695 ;
+C 95 ; WX 556 ; N underscore ; B -22 -189 578 -120 ;
+C 96 ; WX 278 ; N quoteleft ; B 67 469 202 729 ;
+C 97 ; WX 556 ; N a ; B 28 -23 524 549 ;
+C 98 ; WX 611 ; N b ; B 59 -23 575 729 ;
+C 99 ; WX 556 ; N c ; B 34 -23 522 549 ;
+C 100 ; WX 611 ; N d ; B 29 -23 545 729 ;
+C 101 ; WX 556 ; N e ; B 22 -23 525 549 ;
+C 102 ; WX 333 ; N f ; B 14 0 313 729 ;
+C 103 ; WX 611 ; N g ; B 34 -218 541 549 ;
+C 104 ; WX 611 ; N h ; B 67 0 541 729 ;
+C 105 ; WX 278 ; N i ; B 67 0 207 729 ;
+C 106 ; WX 278 ; N j ; B 4 -218 210 729 ;
+C 107 ; WX 556 ; N k ; B 59 0 548 729 ;
+C 108 ; WX 278 ; N l ; B 67 0 207 729 ;
+C 109 ; WX 889 ; N m ; B 60 0 824 549 ;
+C 110 ; WX 611 ; N n ; B 63 0 546 549 ;
+C 111 ; WX 611 ; N o ; B 35 -23 569 549 ;
+C 112 ; WX 611 ; N p ; B 58 -218 574 549 ;
+C 113 ; WX 611 ; N q ; B 28 -218 544 549 ;
+C 114 ; WX 389 ; N r ; B 63 0 370 549 ;
+C 115 ; WX 556 ; N s ; B 29 -23 520 549 ;
+C 116 ; WX 333 ; N t ; B 14 -23 301 674 ;
+C 117 ; WX 611 ; N u ; B 58 -23 541 540 ;
+C 118 ; WX 556 ; N v ; B 14 0 536 540 ;
+C 119 ; WX 778 ; N w ; B 5 0 766 540 ;
+C 120 ; WX 556 ; N x ; B 16 0 535 540 ;
+C 121 ; WX 556 ; N y ; B 9 -219 538 540 ;
+C 122 ; WX 500 ; N z ; B 21 0 468 540 ;
+C 123 ; WX 389 ; N braceleft ; B 37 -200 317 729 ;
+C 124 ; WX 280 ; N bar ; B 100 -200 180 729 ;
+C 125 ; WX 389 ; N braceright ; B 72 -200 352 729 ;
+C 126 ; WX 584 ; N asciitilde ; B 60 142 519 314 ;
+C 161 ; WX 333 ; N exclamdown ; B 66 -186 216 540 ;
+C 162 ; WX 556 ; N cent ; B 36 -124 522 634 ;
+C 163 ; WX 556 ; N sterling ; B 31 -23 537 715 ;
+C 164 ; WX 167 ; N fraction ; B -173 -20 337 715 ;
+C 165 ; WX 556 ; N yen ; B 5 0 552 704 ;
+C 166 ; WX 556 ; N florin ; B 21 -220 535 744 ;
+C 167 ; WX 556 ; N section ; B 33 -201 518 723 ;
+C 168 ; WX 556 ; N currency ; B 26 100 530 604 ;
+C 169 ; WX 238 ; N quotesingle ; B 50 470 188 729 ;
+C 170 ; WX 500 ; N quotedblleft ; B 71 469 433 729 ;
+C 171 ; WX 556 ; N guillemotleft ; B 88 72 468 481 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 83 72 250 481 ;
+C 173 ; WX 333 ; N guilsinglright ; B 80 72 247 481 ;
+C 174 ; WX 611 ; N fi ; B 9 0 548 729 ;
+C 175 ; WX 611 ; N fl ; B 12 0 546 729 ;
+C 177 ; WX 556 ; N endash ; B -9 207 557 311 ;
+C 178 ; WX 556 ; N dagger ; B 31 -194 523 709 ;
+C 179 ; WX 556 ; N daggerdbl ; B 28 -194 520 709 ;
+C 180 ; WX 278 ; N periodcentered ; B 64 169 188 292 ;
+C 182 ; WX 556 ; N paragraph ; B 19 -191 529 729 ;
+C 183 ; WX 350 ; N bullet ; B 50 175 300 425 ;
+C 184 ; WX 278 ; N quotesinglbase ; B 66 -135 201 125 ;
+C 185 ; WX 500 ; N quotedblbase ; B 72 -135 432 125 ;
+C 186 ; WX 500 ; N quotedblright ; B 73 469 440 729 ;
+C 187 ; WX 556 ; N guillemotright ; B 88 72 462 481 ;
+C 188 ; WX 1000 ; N ellipsis ; B 92 0 908 146 ;
+C 189 ; WX 1000 ; N perthousand ; B 11 -22 990 739 ;
+C 191 ; WX 611 ; N questiondown ; B 51 -204 544 540 ;
+C 193 ; WX 333 ; N grave ; B 17 607 213 757 ;
+C 194 ; WX 333 ; N acute ; B 121 607 317 757 ;
+C 195 ; WX 333 ; N circumflex ; B 8 607 326 757 ;
+C 196 ; WX 333 ; N tilde ; B -9 621 345 749 ;
+C 197 ; WX 333 ; N macron ; B 16 640 315 719 ;
+C 198 ; WX 333 ; N breve ; B 35 605 299 748 ;
+C 199 ; WX 333 ; N dotaccent ; B 112 621 222 743 ;
+C 200 ; WX 333 ; N dieresis ; B 18 621 314 743 ;
+C 202 ; WX 333 ; N ring ; B 77 590 257 770 ;
+C 203 ; WX 333 ; N cedilla ; B 27 -220 294 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B -44 610 340 757 ;
+C 206 ; WX 333 ; N ogonek ; B 45 -234 268 0 ;
+C 207 ; WX 333 ; N caron ; B 9 607 327 757 ;
+C 208 ; WX 1000 ; N emdash ; B -7 207 1003 311 ;
+C 225 ; WX 1000 ; N AE ; B 1 0 966 729 ;
+C 227 ; WX 370 ; N ordfeminine ; B 31 262 329 729 ;
+C 232 ; WX 611 ; N Lslash ; B 0 0 597 729 ;
+C 233 ; WX 778 ; N Oslash ; B 31 -39 755 749 ;
+C 234 ; WX 1000 ; N OE ; B 28 -23 970 741 ;
+C 235 ; WX 365 ; N ordmasculine ; B 23 262 343 729 ;
+C 241 ; WX 889 ; N ae ; B 27 -24 857 549 ;
+C 245 ; WX 278 ; N dotlessi ; B 67 0 207 540 ;
+C 248 ; WX 278 ; N lslash ; B 0 0 252 729 ;
+C 249 ; WX 611 ; N oslash ; B 11 -38 598 557 ;
+C 250 ; WX 944 ; N oe ; B 23 -23 920 549 ;
+C 251 ; WX 611 ; N germandbls ; B 67 -17 575 729 ;
+C -1 ; WX 722 ; N Udieresis ; B 76 -23 654 922 ;
+C -1 ; WX 722 ; N Uacute ; B 76 -23 654 936 ;
+C -1 ; WX 667 ; N Scedilla ; B 32 -220 633 741 ;
+C -1 ; WX 611 ; N Tcaron ; B 14 0 598 936 ;
+C -1 ; WX 667 ; N Scaron ; B 32 -23 633 936 ;
+C -1 ; WX 722 ; N Rcaron ; B 80 0 677 936 ;
+C -1 ; WX 722 ; N Racute ; B 80 0 677 936 ;
+C -1 ; WX 667 ; N Sacute ; B 32 -23 633 936 ;
+C -1 ; WX 778 ; N Otilde ; B 40 -23 742 928 ;
+C -1 ; WX 611 ; N ucircumflex ; B 58 -23 541 757 ;
+C -1 ; WX 778 ; N Ohungarumlaut ; B 40 -23 742 936 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 76 -23 654 936 ;
+C -1 ; WX 667 ; N Yacute ; B 27 0 650 936 ;
+C -1 ; WX 722 ; N Eth ; B 0 0 681 729 ;
+C -1 ; WX 722 ; N Dcroat ; B 0 0 681 729 ;
+C -1 ; WX 611 ; N Zacute ; B 30 0 578 936 ;
+C -1 ; WX 722 ; N Uring ; B 76 -23 654 949 ;
+C -1 ; WX 611 ; N gbreve ; B 34 -218 541 748 ;
+C -1 ; WX 556 ; N eogonek ; B 21 -234 525 549 ;
+C -1 ; WX 556 ; N edotaccent ; B 22 -23 525 743 ;
+C -1 ; WX 556 ; N ecaron ; B 22 -23 525 757 ;
+C -1 ; WX 722 ; N Ugrave ; B 76 -23 654 936 ;
+C -1 ; WX 667 ; N Thorn ; B 76 0 633 729 ;
+C -1 ; WX 556 ; N eacute ; B 22 -23 525 757 ;
+C -1 ; WX 556 ; N edieresis ; B 22 -23 525 743 ;
+C -1 ; WX 707 ; N dcaron ; B 29 -23 720 729 ;
+C -1 ; WX 556 ; N ccedilla ; B 34 -220 522 549 ;
+C -1 ; WX 556 ; N ccaron ; B 34 -23 522 757 ;
+C -1 ; WX 556 ; N cacute ; B 34 -23 522 757 ;
+C -1 ; WX 556 ; N aogonek ; B 28 -233 548 549 ;
+C -1 ; WX 556 ; N aring ; B 28 -23 524 770 ;
+C -1 ; WX 556 ; N atilde ; B 28 -23 524 749 ;
+C -1 ; WX 556 ; N abreve ; B 28 -23 524 748 ;
+C -1 ; WX 556 ; N egrave ; B 22 -23 525 757 ;
+C -1 ; WX 556 ; N agrave ; B 28 -23 524 757 ;
+C -1 ; WX 556 ; N aacute ; B 28 -23 524 757 ;
+C -1 ; WX 556 ; N adieresis ; B 28 -23 524 743 ;
+C -1 ; WX 722 ; N Uogonek ; B 76 -234 654 729 ;
+C -1 ; WX 611 ; N ugrave ; B 58 -23 541 757 ;
+C -1 ; WX 611 ; N uacute ; B 58 -23 541 757 ;
+C -1 ; WX 611 ; N udieresis ; B 58 -23 541 743 ;
+C -1 ; WX 385 ; N tcaron ; B 14 -23 398 829 ;
+C -1 ; WX 556 ; N scommaaccent ; B 29 -307 520 549 ;
+C -1 ; WX 611 ; N Zcaron ; B 30 0 578 936 ;
+C -1 ; WX 556 ; N ecircumflex ; B 22 -23 525 757 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 76 -23 654 936 ;
+C -1 ; WX 556 ; N acircumflex ; B 28 -23 524 757 ;
+C -1 ; WX 611 ; N Zdotaccent ; B 30 0 578 922 ;
+C -1 ; WX 556 ; N scaron ; B 29 -23 520 757 ;
+C -1 ; WX 722 ; N Amacron ; B 26 0 703 898 ;
+C -1 ; WX 556 ; N sacute ; B 29 -23 520 757 ;
+C -1 ; WX 611 ; N Tcommaaccent ; B 14 -307 598 729 ;
+C -1 ; WX 667 ; N Ydieresis ; B 27 0 650 922 ;
+C -1 ; WX 611 ; N thorn ; B 58 -218 574 729 ;
+C -1 ; WX 667 ; N Emacron ; B 79 0 624 898 ;
+C -1 ; WX 778 ; N Ograve ; B 40 -23 742 936 ;
+C -1 ; WX 778 ; N Oacute ; B 40 -23 742 936 ;
+C -1 ; WX 778 ; N Odieresis ; B 40 -23 742 922 ;
+C -1 ; WX 722 ; N Ntilde ; B 68 0 661 928 ;
+C -1 ; WX 722 ; N Ncaron ; B 68 0 661 936 ;
+C -1 ; WX 722 ; N Nacute ; B 68 0 661 936 ;
+C -1 ; WX 611 ; N Lcaron ; B 80 0 579 729 ;
+C -1 ; WX 611 ; N Lacute ; B 80 0 579 936 ;
+C -1 ; WX 278 ; N Idotaccent ; B 63 0 213 922 ;
+C -1 ; WX 389 ; N racute ; B 63 0 370 757 ;
+C -1 ; WX 278 ; N Icircumflex ; B -19 0 299 936 ;
+C -1 ; WX 611 ; N ohungarumlaut ; B 35 -23 569 757 ;
+C -1 ; WX 611 ; N otilde ; B 35 -23 569 749 ;
+C -1 ; WX 556 ; N Euro ; B 6 -23 546 724 ;
+C -1 ; WX 611 ; N ocircumflex ; B 35 -23 569 757 ;
+C -1 ; WX 351 ; N onesuperior ; B 40 284 242 709 ;
+C -1 ; WX 351 ; N twosuperior ; B 16 284 328 718 ;
+C -1 ; WX 351 ; N threesuperior ; B 15 271 329 718 ;
+C -1 ; WX 278 ; N Igrave ; B -10 0 213 936 ;
+C -1 ; WX 278 ; N Iacute ; B 63 0 290 936 ;
+C -1 ; WX 278 ; N Imacron ; B 2 0 274 898 ;
+C -1 ; WX 278 ; N Iogonek ; B 34 -233 237 729 ;
+C -1 ; WX 278 ; N Idieresis ; B -9 0 287 922 ;
+C -1 ; WX 778 ; N Gbreve ; B 42 -23 711 927 ;
+C -1 ; WX 722 ; N Umacron ; B 76 -23 654 898 ;
+C -1 ; WX 722 ; N Kcommaaccent ; B 74 -307 717 729 ;
+C -1 ; WX 611 ; N ograve ; B 35 -23 569 757 ;
+C -1 ; WX 667 ; N Scommaaccent ; B 32 -307 633 741 ;
+C -1 ; WX 667 ; N Eogonek ; B 79 -233 648 729 ;
+C -1 ; WX 611 ; N oacute ; B 35 -23 569 757 ;
+C -1 ; WX 667 ; N Edotaccent ; B 79 0 624 922 ;
+C -1 ; WX 278 ; N iogonek ; B 34 -233 231 729 ;
+C -1 ; WX 611 ; N gcommaaccent ; B 34 -218 541 853 ;
+C -1 ; WX 611 ; N odieresis ; B 35 -23 569 743 ;
+C -1 ; WX 611 ; N ntilde ; B 63 0 546 749 ;
+C -1 ; WX 611 ; N ncaron ; B 63 0 546 757 ;
+C -1 ; WX 667 ; N Ecaron ; B 79 0 624 936 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 79 0 624 936 ;
+C -1 ; WX 556 ; N scedilla ; B 29 -220 520 549 ;
+C -1 ; WX 389 ; N rcaron ; B 54 0 372 757 ;
+C -1 ; WX 667 ; N Egrave ; B 79 0 624 936 ;
+C -1 ; WX 667 ; N Eacute ; B 79 0 624 936 ;
+C -1 ; WX 778 ; N Gcommaaccent ; B 42 -307 711 741 ;
+C -1 ; WX 722 ; N Rcommaaccent ; B 80 -307 677 729 ;
+C -1 ; WX 667 ; N Edieresis ; B 79 0 624 922 ;
+C -1 ; WX 611 ; N nacute ; B 63 0 546 757 ;
+C -1 ; WX 611 ; N uogonek ; B 58 -233 564 540 ;
+C -1 ; WX 611 ; N umacron ; B 58 -23 541 719 ;
+C -1 ; WX 722 ; N Dcaron ; B 77 0 681 936 ;
+C -1 ; WX 369 ; N lcaron ; B 67 0 382 729 ;
+C -1 ; WX 722 ; N Ccaron ; B 44 -23 685 936 ;
+C -1 ; WX 722 ; N Cacute ; B 44 -23 685 936 ;
+C -1 ; WX 722 ; N Ccedilla ; B 44 -220 685 741 ;
+C -1 ; WX 606 ; N degree ; B 151 383 454 686 ;
+C -1 ; WX 722 ; N Aogonek ; B 26 -233 723 729 ;
+C -1 ; WX 584 ; N minus ; B 40 172 544 291 ;
+C -1 ; WX 584 ; N multiply ; B 79 18 505 444 ;
+C -1 ; WX 584 ; N divide ; B 50 -11 534 474 ;
+C -1 ; WX 722 ; N Aring ; B 26 0 703 949 ;
+C -1 ; WX 1000 ; N trademark ; B 71 273 929 729 ;
+C -1 ; WX 389 ; N rcommaaccent ; B 63 -307 370 549 ;
+C -1 ; WX 278 ; N lacute ; B 67 0 278 936 ;
+C -1 ; WX 611 ; N omacron ; B 35 -23 569 719 ;
+C -1 ; WX 722 ; N Atilde ; B 26 0 703 928 ;
+C -1 ; WX 278 ; N icircumflex ; B -19 0 299 757 ;
+C -1 ; WX 278 ; N igrave ; B -10 0 207 757 ;
+C -1 ; WX 611 ; N ncommaaccent ; B 63 -307 546 549 ;
+C -1 ; WX 278 ; N lcommaaccent ; B 67 -307 207 729 ;
+C -1 ; WX 584 ; N plusminus ; B 56 -16 527 608 ;
+C -1 ; WX 869 ; N onehalf ; B 40 -20 846 715 ;
+C -1 ; WX 869 ; N onequarter ; B 40 -20 850 715 ;
+C -1 ; WX 869 ; N threequarters ; B 15 -20 850 718 ;
+C -1 ; WX 278 ; N iacute ; B 67 0 290 757 ;
+C -1 ; WX 722 ; N Abreve ; B 26 0 703 927 ;
+C -1 ; WX 556 ; N kcommaaccent ; B 59 -307 548 729 ;
+C -1 ; WX 778 ; N Omacron ; B 40 -23 742 898 ;
+C -1 ; WX 278 ; N imacron ; B 7 0 266 719 ;
+C -1 ; WX 556 ; N emacron ; B 22 -23 525 719 ;
+C -1 ; WX 556 ; N amacron ; B 28 -23 524 719 ;
+C -1 ; WX 333 ; N tcommaaccent ; B 14 -307 301 674 ;
+C -1 ; WX 556 ; N ydieresis ; B 9 -219 538 743 ;
+C -1 ; WX 500 ; N zdotaccent ; B 21 0 468 743 ;
+C -1 ; WX 500 ; N zcaron ; B 21 0 468 757 ;
+C -1 ; WX 500 ; N zacute ; B 21 0 468 757 ;
+C -1 ; WX 556 ; N yacute ; B 9 -219 538 757 ;
+C -1 ; WX 611 ; N uhungarumlaut ; B 58 -23 559 757 ;
+C -1 ; WX 611 ; N eth ; B 35 -23 569 744 ;
+C -1 ; WX 611 ; N uring ; B 58 -23 541 770 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 40 -23 742 936 ;
+C -1 ; WX 333 ; N commaaccent ; B 112 -307 234 -60 ;
+C -1 ; WX 737 ; N copyright ; B -14 -22 751 743 ;
+C -1 ; WX 737 ; N registered ; B -14 -22 751 743 ;
+C -1 ; WX 722 ; N Acircumflex ; B 26 0 703 936 ;
+C -1 ; WX 278 ; N idieresis ; B -9 0 287 743 ;
+C -1 ; WX 489 ; N lozenge ; B 16 0 462 744 ;
+C -1 ; WX 729 ; N Delta ; B 8 0 721 729 ;
+C -1 ; WX 548 ; N notequal ; B 50 -69 534 528 ;
+C -1 ; WX 542 ; N radical ; B 7 -36 512 913 ;
+C -1 ; WX 722 ; N Agrave ; B 26 0 703 936 ;
+C -1 ; WX 722 ; N Aacute ; B 26 0 703 936 ;
+C -1 ; WX 584 ; N lessequal ; B 45 -10 534 639 ;
+C -1 ; WX 584 ; N greaterequal ; B 45 -10 534 639 ;
+C -1 ; WX 584 ; N logicalnot ; B 40 86 544 375 ;
+C -1 ; WX 711 ; N summation ; B 17 -96 694 760 ;
+C -1 ; WX 490 ; N partialdiff ; B 22 -15 458 750 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B 68 -307 661 729 ;
+C -1 ; WX 611 ; N dcroat ; B 29 -23 605 729 ;
+C -1 ; WX 280 ; N brokenbar ; B 100 -200 180 729 ;
+C -1 ; WX 611 ; N Lcommaaccent ; B 80 -307 579 729 ;
+C -1 ; WX 722 ; N Adieresis ; B 26 0 703 922 ;
+C -1 ; WX 611 ; N mu ; B 58 -220 573 540 ;
+C -1 ; WX 278 ; N .notdef ; B 214 0 214 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 998
+KPX A C -33
+KPX A Ccedilla -33
+KPX A G -35
+KPX A O -34
+KPX A Odieresis -34
+KPX A Q -35
+KPX A T -81
+KPX A U -32
+KPX A Uacute -32
+KPX A Ucircumflex -32
+KPX A Udieresis -32
+KPX A Ugrave -32
+KPX A V -66
+KPX A W -51
+KPX A Y -90
+KPX A a -1
+KPX A b -1
+KPX A c -14
+KPX A ccedilla -14
+KPX A comma 19
+KPX A d -13
+KPX A e -9
+KPX A g -14
+KPX A guillemotleft -43
+KPX A guilsinglleft -40
+KPX A hyphen 7
+KPX A o -16
+KPX A period 19
+KPX A q -12
+KPX A quotedblright -65
+KPX A quoteright -61
+KPX A t -18
+KPX A u -12
+KPX A v -37
+KPX A w -23
+KPX A y -35
+KPX Aacute C -33
+KPX Aacute G -35
+KPX Aacute O -34
+KPX Aacute Q -35
+KPX Aacute T -81
+KPX Aacute U -32
+KPX Aacute V -66
+KPX Aacute W -51
+KPX Aacute Y -90
+KPX Aacute a -1
+KPX Aacute b -1
+KPX Aacute c -14
+KPX Aacute comma 19
+KPX Aacute d -13
+KPX Aacute e -9
+KPX Aacute g -14
+KPX Aacute guillemotleft -43
+KPX Aacute guilsinglleft -40
+KPX Aacute hyphen 7
+KPX Aacute o -16
+KPX Aacute period 19
+KPX Aacute q -12
+KPX Aacute quoteright -61
+KPX Aacute t -18
+KPX Aacute u -12
+KPX Aacute v -37
+KPX Aacute w -23
+KPX Aacute y -35
+KPX Acircumflex C -33
+KPX Acircumflex G -35
+KPX Acircumflex O -34
+KPX Acircumflex Q -35
+KPX Acircumflex T -81
+KPX Acircumflex U -32
+KPX Acircumflex V -66
+KPX Acircumflex W -51
+KPX Acircumflex Y -90
+KPX Acircumflex comma 19
+KPX Acircumflex period 19
+KPX Adieresis C -33
+KPX Adieresis G -35
+KPX Adieresis O -34
+KPX Adieresis Q -35
+KPX Adieresis T -81
+KPX Adieresis U -32
+KPX Adieresis V -66
+KPX Adieresis W -51
+KPX Adieresis Y -90
+KPX Adieresis a -1
+KPX Adieresis b -1
+KPX Adieresis c -14
+KPX Adieresis comma 19
+KPX Adieresis d -13
+KPX Adieresis g -14
+KPX Adieresis guillemotleft -43
+KPX Adieresis guilsinglleft -40
+KPX Adieresis hyphen 7
+KPX Adieresis o -16
+KPX Adieresis period 19
+KPX Adieresis q -12
+KPX Adieresis quotedblright -65
+KPX Adieresis quoteright -61
+KPX Adieresis t -18
+KPX Adieresis u -12
+KPX Adieresis v -37
+KPX Adieresis w -23
+KPX Adieresis y -35
+KPX Agrave C -33
+KPX Agrave G -35
+KPX Agrave O -34
+KPX Agrave Q -35
+KPX Agrave T -81
+KPX Agrave U -32
+KPX Agrave V -66
+KPX Agrave W -51
+KPX Agrave Y -90
+KPX Agrave comma 19
+KPX Agrave period 19
+KPX Aring C -33
+KPX Aring G -35
+KPX Aring O -34
+KPX Aring Q -35
+KPX Aring T -81
+KPX Aring U -32
+KPX Aring V -66
+KPX Aring W -51
+KPX Aring Y -90
+KPX Aring a -1
+KPX Aring b -1
+KPX Aring c -14
+KPX Aring comma 19
+KPX Aring d -13
+KPX Aring e -9
+KPX Aring g -14
+KPX Aring guillemotleft -43
+KPX Aring guilsinglleft -40
+KPX Aring hyphen 7
+KPX Aring o -16
+KPX Aring period 19
+KPX Aring q -12
+KPX Aring quotedblright -65
+KPX Aring quoteright -61
+KPX Aring t -18
+KPX Aring u -12
+KPX Aring v -37
+KPX Aring w -23
+KPX Aring y -35
+KPX Atilde C -33
+KPX Atilde G -35
+KPX Atilde O -34
+KPX Atilde Q -35
+KPX Atilde T -81
+KPX Atilde U -32
+KPX Atilde V -66
+KPX Atilde W -51
+KPX Atilde Y -90
+KPX Atilde comma 19
+KPX Atilde period 19
+KPX B A -32
+KPX B AE -20
+KPX B Aacute -32
+KPX B Acircumflex -32
+KPX B Adieresis -32
+KPX B Aring -32
+KPX B Atilde -32
+KPX B O -11
+KPX B OE -2
+KPX B Oacute -11
+KPX B Ocircumflex -11
+KPX B Odieresis -11
+KPX B Ograve -11
+KPX B Oslash -5
+KPX B V -39
+KPX B W -27
+KPX B Y -51
+KPX C A -29
+KPX C AE -17
+KPX C Aacute -29
+KPX C Adieresis -29
+KPX C Aring -29
+KPX C H 5
+KPX C K 2
+KPX C O -6
+KPX C Oacute -6
+KPX C Odieresis -6
+KPX Ccedilla A -28
+KPX D A -37
+KPX D Aacute -37
+KPX D Acircumflex -37
+KPX D Adieresis -37
+KPX D Agrave -37
+KPX D Aring -37
+KPX D Atilde -37
+KPX D J 2
+KPX D T -17
+KPX D V -35
+KPX D W -20
+KPX D X -35
+KPX D Y -56
+KPX F A -63
+KPX F Aacute -63
+KPX F Acircumflex -63
+KPX F Adieresis -63
+KPX F Agrave -63
+KPX F Aring -63
+KPX F Atilde -63
+KPX F J -25
+KPX F O -16
+KPX F Odieresis -16
+KPX F a -15
+KPX F aacute -15
+KPX F adieresis -15
+KPX F ae -17
+KPX F aring -15
+KPX F comma -76
+KPX F e -7
+KPX F eacute -7
+KPX F hyphen 11
+KPX F i -7
+KPX F j -9
+KPX F o -14
+KPX F oacute -14
+KPX F odieresis -14
+KPX F oe -8
+KPX F oslash -15
+KPX F period -75
+KPX F r -27
+KPX F u -24
+KPX G A -8
+KPX G AE 4
+KPX G Aacute -8
+KPX G Acircumflex -8
+KPX G Adieresis -8
+KPX G Agrave -8
+KPX G Aring -8
+KPX G Atilde -8
+KPX G T -17
+KPX G V -36
+KPX G W -20
+KPX G Y -56
+KPX J A -32
+KPX J AE -20
+KPX J Adieresis -32
+KPX J Aring -32
+KPX K C -53
+KPX K G -55
+KPX K O -54
+KPX K OE -44
+KPX K Oacute -54
+KPX K Odieresis -54
+KPX K S -30
+KPX K T 13
+KPX K a -3
+KPX K adieresis -3
+KPX K ae 0
+KPX K aring -3
+KPX K e -25
+KPX K hyphen -44
+KPX K o -33
+KPX K oacute -33
+KPX K odieresis -33
+KPX K u -23
+KPX K udieresis -23
+KPX K y -65
+KPX L A 9
+KPX L AE 21
+KPX L Aacute 9
+KPX L Adieresis 9
+KPX L Aring 9
+KPX L C -26
+KPX L Ccedilla -26
+KPX L G -30
+KPX L O -29
+KPX L Oacute -29
+KPX L Ocircumflex -29
+KPX L Odieresis -29
+KPX L Ograve -29
+KPX L Otilde -29
+KPX L S -2
+KPX L T -95
+KPX L U -24
+KPX L Udieresis -24
+KPX L V -90
+KPX L W -68
+KPX L Y -112
+KPX L hyphen -12
+KPX L quotedblright -141
+KPX L quoteright -138
+KPX L u -7
+KPX L udieresis -7
+KPX L y -55
+KPX N A -5
+KPX N AE 7
+KPX N Aacute -5
+KPX N Adieresis -5
+KPX N Aring -5
+KPX N C 9
+KPX N Ccedilla 9
+KPX N G 8
+KPX N O 8
+KPX N Oacute 8
+KPX N Odieresis 8
+KPX N a 13
+KPX N aacute 13
+KPX N adieresis 13
+KPX N ae 13
+KPX N aring 13
+KPX N comma 15
+KPX N e 18
+KPX N eacute 18
+KPX N o 11
+KPX N oacute 11
+KPX N odieresis 11
+KPX N oslash 11
+KPX N period 16
+KPX N u 12
+KPX N udieresis 12
+KPX O A -37
+KPX O AE -26
+KPX O Aacute -37
+KPX O Adieresis -37
+KPX O Aring -37
+KPX O T -20
+KPX O V -36
+KPX O W -21
+KPX O X -36
+KPX O Y -59
+KPX Oacute A -37
+KPX Oacute T -20
+KPX Oacute V -36
+KPX Oacute W -21
+KPX Oacute Y -59
+KPX Ocircumflex T -20
+KPX Ocircumflex V -36
+KPX Ocircumflex Y -59
+KPX Odieresis A -37
+KPX Odieresis T -20
+KPX Odieresis V -36
+KPX Odieresis W -21
+KPX Odieresis X -36
+KPX Odieresis Y -59
+KPX Ograve T -20
+KPX Ograve V -36
+KPX Ograve Y -59
+KPX Oslash A -32
+KPX Otilde T -20
+KPX Otilde V -36
+KPX Otilde Y -59
+KPX P A -65
+KPX P AE -54
+KPX P Aacute -65
+KPX P Adieresis -65
+KPX P Aring -65
+KPX P J -44
+KPX P a -7
+KPX P aacute -7
+KPX P adieresis -7
+KPX P ae -8
+KPX P aring -7
+KPX P comma -94
+KPX P e -8
+KPX P eacute -8
+KPX P hyphen 0
+KPX P o -14
+KPX P oacute -14
+KPX P odieresis -14
+KPX P oe -8
+KPX P oslash -17
+KPX P period -94
+KPX R C -5
+KPX R Ccedilla -5
+KPX R G -6
+KPX R O -6
+KPX R OE 3
+KPX R Oacute -6
+KPX R Odieresis -6
+KPX R T 0
+KPX R U -4
+KPX R Udieresis -4
+KPX R V -26
+KPX R W -17
+KPX R Y -37
+KPX R a 0
+KPX R aacute 0
+KPX R adieresis 0
+KPX R ae 0
+KPX R aring 0
+KPX R e 2
+KPX R eacute 2
+KPX R hyphen 15
+KPX R o -4
+KPX R oacute -4
+KPX R odieresis -4
+KPX R oe 1
+KPX R u 0
+KPX R uacute 0
+KPX R udieresis 0
+KPX R y 5
+KPX S A -20
+KPX S AE -8
+KPX S Aacute -20
+KPX S Adieresis -20
+KPX S Aring -20
+KPX S T -5
+KPX S V -31
+KPX S W -17
+KPX S Y -43
+KPX S t 1
+KPX T A -87
+KPX T AE -75
+KPX T Aacute -87
+KPX T Acircumflex -87
+KPX T Adieresis -87
+KPX T Agrave -87
+KPX T Aring -87
+KPX T Atilde -87
+KPX T C -20
+KPX T G -22
+KPX T J -87
+KPX T O -22
+KPX T OE -11
+KPX T Oacute -22
+KPX T Ocircumflex -22
+KPX T Odieresis -22
+KPX T Ograve -22
+KPX T Oslash -23
+KPX T Otilde -22
+KPX T S 3
+KPX T V 18
+KPX T W 24
+KPX T Y 16
+KPX T a -73
+KPX T ae -73
+KPX T c -74
+KPX T colon -97
+KPX T comma -67
+KPX T e -69
+KPX T g -75
+KPX T guillemotleft -101
+KPX T guilsinglleft -98
+KPX T hyphen -48
+KPX T i -1
+KPX T j -3
+KPX T o -76
+KPX T oslash -73
+KPX T period -67
+KPX T r -71
+KPX T s -74
+KPX T semicolon -98
+KPX T u -72
+KPX T v -82
+KPX T w -77
+KPX T y -80
+KPX U A -34
+KPX U AE -22
+KPX U Aacute -34
+KPX U Acircumflex -34
+KPX U Adieresis -34
+KPX U Aring -34
+KPX U Atilde -34
+KPX U comma -7
+KPX U m 6
+KPX U n 5
+KPX U p 7
+KPX U period -4
+KPX U r 5
+KPX Uacute A -34
+KPX Uacute comma -7
+KPX Uacute m 6
+KPX Uacute n 5
+KPX Uacute p 7
+KPX Uacute period -4
+KPX Uacute r 5
+KPX Ucircumflex A -34
+KPX Udieresis A -34
+KPX Udieresis b 6
+KPX Udieresis comma -7
+KPX Udieresis m 6
+KPX Udieresis n 5
+KPX Udieresis p 7
+KPX Udieresis period -4
+KPX Udieresis r 5
+KPX Ugrave A -34
+KPX V A -71
+KPX V AE -59
+KPX V Aacute -71
+KPX V Acircumflex -71
+KPX V Adieresis -71
+KPX V Agrave -71
+KPX V Aring -71
+KPX V Atilde -71
+KPX V C -36
+KPX V G -38
+KPX V O -37
+KPX V Oacute -37
+KPX V Ocircumflex -37
+KPX V Odieresis -37
+KPX V Ograve -37
+KPX V Oslash -31
+KPX V Otilde -37
+KPX V S -21
+KPX V T 21
+KPX V a -47
+KPX V ae -48
+KPX V colon -65
+KPX V comma -69
+KPX V e -43
+KPX V g -49
+KPX V guillemotleft -74
+KPX V guilsinglleft -72
+KPX V hyphen -21
+KPX V i -5
+KPX V o -50
+KPX V oslash -48
+KPX V period -69
+KPX V r -34
+KPX V semicolon -67
+KPX V u -34
+KPX V y -10
+KPX W A -54
+KPX W AE -43
+KPX W Aacute -54
+KPX W Acircumflex -54
+KPX W Adieresis -54
+KPX W Agrave -54
+KPX W Aring -54
+KPX W Atilde -54
+KPX W C -20
+KPX W G -22
+KPX W O -21
+KPX W Oacute -21
+KPX W Ocircumflex -21
+KPX W Odieresis -21
+KPX W Ograve -21
+KPX W Oslash -15
+KPX W Otilde -21
+KPX W S -12
+KPX W T 25
+KPX W a -29
+KPX W ae -29
+KPX W colon -53
+KPX W comma -45
+KPX W e -24
+KPX W g -30
+KPX W guillemotleft -55
+KPX W guilsinglleft -53
+KPX W hyphen -3
+KPX W i -1
+KPX W o -31
+KPX W oslash -29
+KPX W period -45
+KPX W r -24
+KPX W semicolon -54
+KPX W u -23
+KPX W y 0
+KPX X C -34
+KPX X O -35
+KPX X Odieresis -35
+KPX X Q -37
+KPX X a -5
+KPX X e -25
+KPX X hyphen -27
+KPX X o -32
+KPX X u -25
+KPX X y -40
+KPX Y A -86
+KPX Y AE -74
+KPX Y Aacute -86
+KPX Y Acircumflex -86
+KPX Y Adieresis -86
+KPX Y Agrave -86
+KPX Y Aring -86
+KPX Y Atilde -86
+KPX Y C -52
+KPX Y G -54
+KPX Y O -54
+KPX Y Oacute -54
+KPX Y Ocircumflex -54
+KPX Y Odieresis -54
+KPX Y Ograve -54
+KPX Y Oslash -47
+KPX Y Otilde -54
+KPX Y S -29
+KPX Y T 22
+KPX Y a -66
+KPX Y ae -67
+KPX Y colon -81
+KPX Y comma -78
+KPX Y e -63
+KPX Y g -68
+KPX Y guillemotleft -98
+KPX Y guilsinglleft -96
+KPX Y hyphen -50
+KPX Y i -3
+KPX Y o -70
+KPX Y oslash -67
+KPX Y p -45
+KPX Y period -78
+KPX Y semicolon -83
+KPX Y u -48
+KPX Y v -27
+KPX Z v -11
+KPX Z y -9
+KPX a j -1
+KPX a quoteright -11
+KPX a v -19
+KPX a w -5
+KPX a y -17
+KPX aacute v -19
+KPX aacute w -5
+KPX aacute y -17
+KPX adieresis v -19
+KPX adieresis w -5
+KPX adieresis y -17
+KPX ae v -21
+KPX ae w -7
+KPX ae y -19
+KPX agrave v -19
+KPX agrave w -5
+KPX agrave y -17
+KPX aring v -19
+KPX aring w -5
+KPX aring y -17
+KPX b v -20
+KPX b w -7
+KPX b y -20
+KPX c h 0
+KPX c k 3
+KPX comma one -73
+KPX comma quotedblright -33
+KPX comma quoteright -30
+KPX e quoteright -12
+KPX e t -4
+KPX e v -19
+KPX e w -6
+KPX e x -21
+KPX e y -17
+KPX eacute v -19
+KPX eacute w -6
+KPX eacute y -17
+KPX ecircumflex v -19
+KPX ecircumflex w -6
+KPX ecircumflex y -17
+KPX eight four 10
+KPX eight one -23
+KPX eight seven -6
+KPX f a 1
+KPX f aacute 1
+KPX f adieresis 1
+KPX f ae 0
+KPX f aring 1
+KPX f e -3
+KPX f eacute -3
+KPX f f 21
+KPX f i -3
+KPX f j -6
+KPX f l -3
+KPX f o -9
+KPX f oacute -9
+KPX f odieresis -9
+KPX f oe -3
+KPX f oslash -9
+KPX f quoteright 10
+KPX f s -1
+KPX f t 21
+KPX five four 6
+KPX five one -29
+KPX five seven -10
+KPX four four 9
+KPX four one -50
+KPX four seven -28
+KPX g a 3
+KPX g adieresis 3
+KPX g ae 3
+KPX g aring 3
+KPX g e 8
+KPX g eacute 8
+KPX g l 0
+KPX g oacute 1
+KPX g odieresis 1
+KPX g r 1
+KPX guillemotright A -51
+KPX guillemotright AE -39
+KPX guillemotright Aacute -51
+KPX guillemotright Adieresis -51
+KPX guillemotright Aring -51
+KPX guillemotright T -108
+KPX guillemotright V -78
+KPX guillemotright W -60
+KPX guillemotright Y -111
+KPX guilsinglright A -46
+KPX guilsinglright AE -35
+KPX guilsinglright Aacute -46
+KPX guilsinglright Adieresis -46
+KPX guilsinglright Aring -46
+KPX guilsinglright T -104
+KPX guilsinglright V -74
+KPX guilsinglright W -56
+KPX guilsinglright Y -107
+KPX h quoteright -14
+KPX h y -21
+KPX hyphen A -1
+KPX hyphen AE 10
+KPX hyphen Aacute -1
+KPX hyphen Adieresis -1
+KPX hyphen Aring -1
+KPX hyphen T -57
+KPX hyphen V -27
+KPX hyphen W -9
+KPX hyphen Y -64
+KPX i T -4
+KPX i j -2
+KPX k a -2
+KPX k aacute -2
+KPX k adieresis -2
+KPX k ae 1
+KPX k aring -2
+KPX k comma 7
+KPX k e -15
+KPX k eacute -15
+KPX k g -21
+KPX k hyphen -25
+KPX k o -22
+KPX k oacute -22
+KPX k odieresis -22
+KPX k period 6
+KPX k s -10
+KPX k u -1
+KPX k udieresis -1
+KPX l v -5
+KPX l y -2
+KPX m p 6
+KPX m v -19
+KPX m w -6
+KPX m y -18
+KPX n T -80
+KPX n p 5
+KPX n quoteright -12
+KPX n v -20
+KPX n w -7
+KPX n y -19
+KPX nine four 4
+KPX nine one -21
+KPX nine seven -17
+KPX o T -84
+KPX o quoteright -17
+KPX o t -8
+KPX o v -23
+KPX o w -10
+KPX o x -25
+KPX o y -22
+KPX oacute v -23
+KPX oacute w -10
+KPX oacute y -22
+KPX ocircumflex t -8
+KPX odieresis t -8
+KPX odieresis v -23
+KPX odieresis w -10
+KPX odieresis x -25
+KPX odieresis y -22
+KPX ograve v -23
+KPX ograve w -10
+KPX ograve y -22
+KPX one comma -42
+KPX one eight -37
+KPX one five -43
+KPX one four -56
+KPX one nine -39
+KPX one one -85
+KPX one period -42
+KPX one seven -65
+KPX one six -37
+KPX one three -44
+KPX one two -47
+KPX one zero -34
+KPX p t -5
+KPX p y -20
+KPX period one -73
+KPX period quotedblright -32
+KPX period quoteright -29
+KPX q c 4
+KPX q u 4
+KPX quotedblbase A 12
+KPX quotedblbase AE 24
+KPX quotedblbase T -75
+KPX quotedblbase V -73
+KPX quotedblbase W -51
+KPX quotedblbase Y -92
+KPX quotedblleft A -68
+KPX quotedblleft AE -57
+KPX quotedblleft Aacute -68
+KPX quotedblleft Adieresis -68
+KPX quotedblleft Aring -68
+KPX quotedblleft T -2
+KPX quotedblleft V 6
+KPX quotedblleft W 16
+KPX quotedblleft Y -9
+KPX quotedblright A -69
+KPX quotedblright AE -57
+KPX quotedblright Aacute -69
+KPX quotedblright Adieresis -69
+KPX quotedblright Aring -69
+KPX quotedblright T 1
+KPX quotedblright V 7
+KPX quotedblright W 17
+KPX quotedblright Y -7
+KPX quoteleft A -73
+KPX quoteleft AE -62
+KPX quoteleft Aacute -73
+KPX quoteleft Adieresis -73
+KPX quoteleft Aring -73
+KPX quoteleft T -7
+KPX quoteleft V 2
+KPX quoteleft W 11
+KPX quoteleft Y -13
+KPX quoteright A -77
+KPX quoteright AE -66
+KPX quoteright Aacute -77
+KPX quoteright Adieresis -77
+KPX quoteright Aring -77
+KPX quoteright comma -46
+KPX quoteright d -27
+KPX quoteright o -30
+KPX quoteright period -45
+KPX quoteright r -15
+KPX quoteright s -22
+KPX quoteright t -4
+KPX quoteright v -5
+KPX quoteright w 1
+KPX quoteright y -3
+KPX r a 6
+KPX r aacute 6
+KPX r acircumflex 6
+KPX r adieresis 6
+KPX r ae 4
+KPX r agrave 6
+KPX r aring 6
+KPX r c 0
+KPX r ccedilla 0
+KPX r colon -27
+KPX r comma -57
+KPX r d 0
+KPX r e 4
+KPX r eacute 4
+KPX r ecircumflex 4
+KPX r egrave 4
+KPX r f 22
+KPX r g -2
+KPX r h -4
+KPX r hyphen -35
+KPX r i -4
+KPX r j -6
+KPX r k 0
+KPX r l -4
+KPX r m -1
+KPX r n -2
+KPX r o -1
+KPX r oacute -1
+KPX r ocircumflex -1
+KPX r odieresis -1
+KPX r oe 5
+KPX r ograve -1
+KPX r oslash -4
+KPX r p 0
+KPX r period -57
+KPX r q 1
+KPX r quoteright 14
+KPX r r -2
+KPX r s 3
+KPX r semicolon -27
+KPX r t 22
+KPX r u 0
+KPX r v 21
+KPX r w 26
+KPX r x 17
+KPX r y 23
+KPX r z 9
+KPX s quoteright -12
+KPX s t -1
+KPX seven colon -63
+KPX seven comma -88
+KPX seven eight -3
+KPX seven five -21
+KPX seven four -62
+KPX seven one -14
+KPX seven period -87
+KPX seven seven 9
+KPX seven six -13
+KPX seven three 0
+KPX seven two -4
+KPX six four 7
+KPX six one -21
+KPX six seven -3
+KPX t S 0
+KPX t a 6
+KPX t aacute 6
+KPX t adieresis 6
+KPX t ae 7
+KPX t aring 6
+KPX t colon -25
+KPX t e -3
+KPX t eacute -3
+KPX t h 2
+KPX t o -10
+KPX t oacute -10
+KPX t odieresis -10
+KPX t quoteright 4
+KPX t semicolon -25
+KPX three four 6
+KPX three one -27
+KPX three seven -10
+KPX two four -9
+KPX two one -16
+KPX two seven -3
+KPX u quoteright -2
+KPX v a -15
+KPX v aacute -15
+KPX v acircumflex -15
+KPX v adieresis -15
+KPX v ae -16
+KPX v agrave -15
+KPX v aring -15
+KPX v atilde -15
+KPX v c -20
+KPX v colon -32
+KPX v comma -51
+KPX v e -15
+KPX v eacute -15
+KPX v ecircumflex -15
+KPX v egrave -15
+KPX v g -21
+KPX v hyphen 0
+KPX v l -5
+KPX v o -22
+KPX v oacute -22
+KPX v odieresis -22
+KPX v ograve -22
+KPX v oslash -20
+KPX v period -50
+KPX v s -17
+KPX v semicolon -34
+KPX w a -7
+KPX w aacute -7
+KPX w acircumflex -7
+KPX w adieresis -7
+KPX w ae -8
+KPX w agrave -7
+KPX w aring -7
+KPX w atilde -7
+KPX w c -8
+KPX w colon -27
+KPX w comma -33
+KPX w e -3
+KPX w eacute -3
+KPX w ecircumflex -3
+KPX w egrave -3
+KPX w g -9
+KPX w hyphen 11
+KPX w l -1
+KPX w o -10
+KPX w oacute -10
+KPX w odieresis -10
+KPX w ograve -10
+KPX w oslash -8
+KPX w period -32
+KPX w s -9
+KPX w semicolon -29
+KPX x a -9
+KPX x c -22
+KPX x e -17
+KPX x eacute -17
+KPX x o -24
+KPX x q -20
+KPX y a -14
+KPX y aacute -14
+KPX y acircumflex -14
+KPX y adieresis -14
+KPX y ae -15
+KPX y agrave -14
+KPX y aring -14
+KPX y atilde -14
+KPX y c -21
+KPX y colon -31
+KPX y comma -51
+KPX y e -16
+KPX y eacute -16
+KPX y ecircumflex -16
+KPX y egrave -16
+KPX y g -21
+KPX y hyphen 0
+KPX y l -4
+KPX y o -22
+KPX y oacute -22
+KPX y odieresis -22
+KPX y ograve -22
+KPX y oslash -20
+KPX y period -50
+KPX y s -16
+KPX y semicolon -33
+KPX zero four 5
+KPX zero one -19
+KPX zero seven -10
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/pdf2swf/fonts/n019004l.pfb b/pdf2swf/fonts/n019004l.pfb
new file mode 100644
index 00000000..aec380a3
--- /dev/null
+++ b/pdf2swf/fonts/n019004l.pfb
Binary files differ
diff --git a/pdf2swf/fonts/n019023l.afm b/pdf2swf/fonts/n019023l.afm
new file mode 100644
index 00000000..0172d808
--- /dev/null
+++ b/pdf2swf/fonts/n019023l.afm
@@ -0,0 +1,1341 @@
+StartFontMetrics 3.0
+Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development
+Comment Creation Date: 12/22/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName NimbusSanL-ReguItal
+FullName Nimbus Sans L Regular Italic
+FamilyName Nimbus Sans L
+Weight Regular
+ItalicAngle -12.0
+IsFixedPitch false
+UnderlinePosition -151
+UnderlineThickness 50
+Version 1.05
+Notice (URW)++,Copyright 1999 by (URW)++ Design & Development
+EncodingScheme AdobeStandardEncoding
+FontBBox -178 -284 1108 953
+CapHeight 729
+XHeight 524
+Descender -213
+Ascender 729
+StartCharMetrics 316
+C 32 ; WX 278 ; N space ; B 213 0 213 0 ;
+C 33 ; WX 278 ; N exclam ; B 124 0 363 729 ;
+C 34 ; WX 355 ; N quotedbl ; B 177 464 455 709 ;
+C 35 ; WX 556 ; N numbersign ; B 54 -20 649 697 ;
+C 36 ; WX 556 ; N dollar ; B 69 -126 613 770 ;
+C 37 ; WX 889 ; N percent ; B 134 -20 895 709 ;
+C 38 ; WX 667 ; N ampersand ; B 83 -23 644 709 ;
+C 39 ; WX 222 ; N quoteright ; B 166 477 309 708 ;
+C 40 ; WX 333 ; N parenleft ; B 113 -213 446 729 ;
+C 41 ; WX 333 ; N parenright ; B -7 -213 325 729 ;
+C 42 ; WX 389 ; N asterisk ; B 169 438 471 729 ;
+C 43 ; WX 584 ; N plus ; B 92 -11 591 473 ;
+C 44 ; WX 278 ; N comma ; B 55 -150 214 103 ;
+C 45 ; WX 333 ; N hyphen ; B 97 240 351 312 ;
+C 46 ; WX 278 ; N period ; B 87 0 213 103 ;
+C 47 ; WX 278 ; N slash ; B -12 -20 434 729 ;
+C 48 ; WX 556 ; N zero ; B 98 -23 598 709 ;
+C 49 ; WX 556 ; N one ; B 208 0 498 709 ;
+C 50 ; WX 556 ; N two ; B 34 0 620 709 ;
+C 51 ; WX 556 ; N three ; B 71 -23 599 709 ;
+C 52 ; WX 556 ; N four ; B 63 0 573 709 ;
+C 53 ; WX 556 ; N five ; B 70 -23 629 709 ;
+C 54 ; WX 556 ; N six ; B 93 -23 611 709 ;
+C 55 ; WX 556 ; N seven ; B 137 0 671 709 ;
+C 56 ; WX 556 ; N eight ; B 74 -23 604 709 ;
+C 57 ; WX 556 ; N nine ; B 83 -23 599 709 ;
+C 58 ; WX 278 ; N colon ; B 110 0 326 524 ;
+C 59 ; WX 278 ; N semicolon ; B 78 -150 325 524 ;
+C 60 ; WX 584 ; N less ; B 87 -9 635 474 ;
+C 61 ; WX 584 ; N equal ; B 74 111 609 355 ;
+C 62 ; WX 584 ; N greater ; B 48 -9 596 474 ;
+C 63 ; WX 556 ; N question ; B 184 0 630 741 ;
+C 64 ; WX 1015 ; N at ; B 80 -142 1036 741 ;
+C 65 ; WX 667 ; N A ; B 17 0 653 729 ;
+C 66 ; WX 667 ; N B ; B 79 0 711 729 ;
+C 67 ; WX 722 ; N C ; B 112 -23 770 741 ;
+C 68 ; WX 722 ; N D ; B 89 0 759 729 ;
+C 69 ; WX 667 ; N E ; B 90 0 751 729 ;
+C 70 ; WX 611 ; N F ; B 90 0 734 729 ;
+C 71 ; WX 778 ; N G ; B 109 -23 809 741 ;
+C 72 ; WX 722 ; N H ; B 83 0 799 729 ;
+C 73 ; WX 278 ; N I ; B 100 0 349 729 ;
+C 74 ; WX 500 ; N J ; B 47 -23 581 729 ;
+C 75 ; WX 667 ; N K ; B 79 0 813 729 ;
+C 76 ; WX 556 ; N L ; B 80 0 551 729 ;
+C 77 ; WX 833 ; N M ; B 75 0 916 729 ;
+C 78 ; WX 722 ; N N ; B 76 0 801 729 ;
+C 79 ; WX 778 ; N O ; B 104 -23 828 741 ;
+C 80 ; WX 667 ; N P ; B 91 0 733 729 ;
+C 81 ; WX 778 ; N Q ; B 104 -59 828 741 ;
+C 82 ; WX 722 ; N R ; B 93 0 770 729 ;
+C 83 ; WX 667 ; N S ; B 89 -23 714 741 ;
+C 84 ; WX 611 ; N T ; B 158 0 748 729 ;
+C 85 ; WX 722 ; N U ; B 124 -23 800 729 ;
+C 86 ; WX 667 ; N V ; B 185 0 800 729 ;
+C 87 ; WX 944 ; N W ; B 177 0 1084 729 ;
+C 88 ; WX 667 ; N X ; B 22 0 794 729 ;
+C 89 ; WX 667 ; N Y ; B 168 0 816 729 ;
+C 90 ; WX 611 ; N Z ; B 28 0 737 729 ;
+C 91 ; WX 278 ; N bracketleft ; B 19 -213 405 729 ;
+C 92 ; WX 278 ; N backslash ; B 147 -20 280 729 ;
+C 93 ; WX 278 ; N bracketright ; B -23 -213 364 729 ;
+C 94 ; WX 469 ; N asciicircum ; B 115 329 496 709 ;
+C 95 ; WX 556 ; N underscore ; B -59 -176 551 -126 ;
+C 96 ; WX 222 ; N quoteleft ; B 163 477 308 709 ;
+C 97 ; WX 556 ; N a ; B 65 -23 568 539 ;
+C 98 ; WX 556 ; N b ; B 54 -23 588 729 ;
+C 99 ; WX 500 ; N c ; B 76 -23 554 539 ;
+C 100 ; WX 556 ; N d ; B 73 -23 650 729 ;
+C 101 ; WX 556 ; N e ; B 84 -23 580 539 ;
+C 102 ; WX 278 ; N f ; B 89 0 413 732 ;
+C 103 ; WX 556 ; N g ; B 32 -218 601 539 ;
+C 104 ; WX 556 ; N h ; B 70 0 574 729 ;
+C 105 ; WX 222 ; N i ; B 66 0 305 729 ;
+C 106 ; WX 222 ; N j ; B -65 -218 308 729 ;
+C 107 ; WX 500 ; N k ; B 58 0 584 729 ;
+C 108 ; WX 222 ; N l ; B 68 0 307 729 ;
+C 109 ; WX 833 ; N m ; B 71 0 852 539 ;
+C 110 ; WX 556 ; N n ; B 70 0 574 539 ;
+C 111 ; WX 556 ; N o ; B 80 -23 576 539 ;
+C 112 ; WX 556 ; N p ; B 7 -213 586 539 ;
+C 113 ; WX 556 ; N q ; B 71 -213 607 539 ;
+C 114 ; WX 333 ; N r ; B 69 0 436 539 ;
+C 115 ; WX 500 ; N s ; B 61 -23 520 539 ;
+C 116 ; WX 278 ; N t ; B 97 -23 366 668 ;
+C 117 ; WX 556 ; N u ; B 88 -23 594 524 ;
+C 118 ; WX 500 ; N v ; B 122 0 598 524 ;
+C 119 ; WX 722 ; N w ; B 118 0 820 524 ;
+C 120 ; WX 500 ; N x ; B 17 0 583 524 ;
+C 121 ; WX 500 ; N y ; B 8 -218 590 524 ;
+C 122 ; WX 500 ; N z ; B 31 0 557 524 ;
+C 123 ; WX 334 ; N braceleft ; B 91 -213 431 729 ;
+C 124 ; WX 260 ; N bar ; B 54 -212 315 729 ;
+C 125 ; WX 334 ; N braceright ; B -16 -213 324 729 ;
+C 126 ; WX 584 ; N asciitilde ; B 137 268 594 438 ;
+C 161 ; WX 333 ; N exclamdown ; B 76 -205 317 524 ;
+C 162 ; WX 556 ; N cent ; B 96 -120 585 628 ;
+C 163 ; WX 556 ; N sterling ; B 44 -23 628 729 ;
+C 164 ; WX 167 ; N fraction ; B -178 -20 486 709 ;
+C 165 ; WX 556 ; N yen ; B 100 0 696 709 ;
+C 166 ; WX 556 ; N florin ; B -32 -212 696 738 ;
+C 167 ; WX 556 ; N section ; B 63 -213 589 729 ;
+C 168 ; WX 556 ; N currency ; B 110 133 593 556 ;
+C 169 ; WX 191 ; N quotesingle ; B 173 464 292 709 ;
+C 170 ; WX 333 ; N quotedblleft ; B 146 477 449 709 ;
+C 171 ; WX 556 ; N guillemotleft ; B 147 106 548 438 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 140 106 336 438 ;
+C 173 ; WX 333 ; N guilsinglright ; B 109 106 307 438 ;
+C 174 ; WX 500 ; N fi ; B 83 0 591 732 ;
+C 175 ; WX 500 ; N fl ; B 88 0 585 732 ;
+C 177 ; WX 556 ; N endash ; B 46 240 628 312 ;
+C 178 ; WX 556 ; N dagger ; B 127 -177 620 709 ;
+C 179 ; WX 556 ; N daggerdbl ; B 51 -177 620 709 ;
+C 180 ; WX 278 ; N periodcentered ; B 166 192 293 295 ;
+C 182 ; WX 537 ; N paragraph ; B 145 -178 677 729 ;
+C 183 ; WX 350 ; N bullet ; B 120 220 376 470 ;
+C 184 ; WX 222 ; N quotesinglbase ; B 37 -128 180 103 ;
+C 185 ; WX 333 ; N quotedblbase ; B 20 -128 322 103 ;
+C 186 ; WX 333 ; N quotedblright ; B 150 477 452 708 ;
+C 187 ; WX 556 ; N guillemotright ; B 121 106 518 438 ;
+C 188 ; WX 1000 ; N ellipsis ; B 115 0 907 103 ;
+C 189 ; WX 1000 ; N perthousand ; B 93 -20 1024 738 ;
+C 191 ; WX 611 ; N questiondown ; B 86 -217 531 524 ;
+C 193 ; WX 333 ; N grave ; B 179 592 357 740 ;
+C 194 ; WX 333 ; N acute ; B 218 592 458 740 ;
+C 195 ; WX 333 ; N circumflex ; B 146 591 433 741 ;
+C 196 ; WX 333 ; N tilde ; B 130 611 471 719 ;
+C 197 ; WX 333 ; N macron ; B 160 627 450 696 ;
+C 198 ; WX 333 ; N breve ; B 165 594 471 729 ;
+C 199 ; WX 333 ; N dotaccent ; B 244 612 370 715 ;
+C 200 ; WX 333 ; N dieresis ; B 159 612 446 715 ;
+C 202 ; WX 333 ; N ring ; B 216 579 396 754 ;
+C 203 ; WX 333 ; N cedilla ; B 1 -214 264 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 91 590 505 740 ;
+C 206 ; WX 333 ; N ogonek ; B 35 -205 246 0 ;
+C 207 ; WX 333 ; N caron ; B 176 592 463 740 ;
+C 208 ; WX 1000 ; N emdash ; B 42 240 1068 312 ;
+C 225 ; WX 1000 ; N AE ; B 11 0 1087 729 ;
+C 227 ; WX 370 ; N ordfeminine ; B 107 303 441 742 ;
+C 232 ; WX 556 ; N Lslash ; B 75 0 570 729 ;
+C 233 ; WX 778 ; N Oslash ; B 32 -24 867 741 ;
+C 234 ; WX 1000 ; N OE ; B 101 -23 1108 741 ;
+C 235 ; WX 365 ; N ordmasculine ; B 114 303 452 742 ;
+C 241 ; WX 889 ; N ae ; B 59 -23 915 539 ;
+C 245 ; WX 278 ; N dotlessi ; B 94 0 290 527 ;
+C 248 ; WX 222 ; N lslash ; B 62 0 312 729 ;
+C 249 ; WX 611 ; N oslash ; B 19 -30 639 541 ;
+C 250 ; WX 944 ; N oe ; B 85 -23 966 539 ;
+C 251 ; WX 611 ; N germandbls ; B 126 -23 655 729 ;
+C -1 ; WX 722 ; N Udieresis ; B 124 -23 800 914 ;
+C -1 ; WX 722 ; N Uacute ; B 124 -23 800 939 ;
+C -1 ; WX 667 ; N Scedilla ; B 89 -214 714 741 ;
+C -1 ; WX 611 ; N Tcaron ; B 158 0 748 939 ;
+C -1 ; WX 667 ; N Scaron ; B 89 -23 714 939 ;
+C -1 ; WX 722 ; N Rcaron ; B 93 0 770 939 ;
+C -1 ; WX 722 ; N Racute ; B 93 0 770 939 ;
+C -1 ; WX 667 ; N Sacute ; B 89 -23 714 939 ;
+C -1 ; WX 778 ; N Otilde ; B 104 -23 828 918 ;
+C -1 ; WX 556 ; N ucircumflex ; B 88 -23 594 741 ;
+C -1 ; WX 778 ; N Ohungarumlaut ; B 104 -23 841 939 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 124 -23 806 939 ;
+C -1 ; WX 667 ; N Yacute ; B 168 0 816 939 ;
+C -1 ; WX 722 ; N Eth ; B 89 0 759 729 ;
+C -1 ; WX 722 ; N Dcroat ; B 89 0 759 729 ;
+C -1 ; WX 611 ; N Zacute ; B 28 0 737 939 ;
+C -1 ; WX 722 ; N Uring ; B 124 -23 800 953 ;
+C -1 ; WX 556 ; N gbreve ; B 32 -218 601 729 ;
+C -1 ; WX 556 ; N eogonek ; B 84 -205 580 539 ;
+C -1 ; WX 556 ; N edotaccent ; B 84 -23 580 715 ;
+C -1 ; WX 556 ; N ecaron ; B 84 -23 580 740 ;
+C -1 ; WX 722 ; N Ugrave ; B 124 -23 800 939 ;
+C -1 ; WX 667 ; N Thorn ; B 91 0 708 729 ;
+C -1 ; WX 556 ; N eacute ; B 84 -23 580 740 ;
+C -1 ; WX 556 ; N edieresis ; B 84 -23 580 715 ;
+C -1 ; WX 650 ; N dcaron ; B 73 -23 810 729 ;
+C -1 ; WX 500 ; N ccedilla ; B 76 -214 554 539 ;
+C -1 ; WX 500 ; N ccaron ; B 76 -23 563 740 ;
+C -1 ; WX 500 ; N cacute ; B 76 -23 575 740 ;
+C -1 ; WX 556 ; N aogonek ; B 65 -205 571 539 ;
+C -1 ; WX 556 ; N aring ; B 65 -23 568 754 ;
+C -1 ; WX 556 ; N atilde ; B 65 -23 583 719 ;
+C -1 ; WX 556 ; N abreve ; B 65 -23 582 729 ;
+C -1 ; WX 556 ; N egrave ; B 84 -23 580 740 ;
+C -1 ; WX 556 ; N agrave ; B 65 -23 568 740 ;
+C -1 ; WX 556 ; N aacute ; B 65 -23 570 740 ;
+C -1 ; WX 556 ; N adieresis ; B 65 -23 568 715 ;
+C -1 ; WX 722 ; N Uogonek ; B 124 -205 800 729 ;
+C -1 ; WX 556 ; N ugrave ; B 88 -23 594 740 ;
+C -1 ; WX 556 ; N uacute ; B 88 -23 594 740 ;
+C -1 ; WX 556 ; N udieresis ; B 88 -23 594 715 ;
+C -1 ; WX 319 ; N tcaron ; B 97 -23 492 801 ;
+C -1 ; WX 500 ; N scommaaccent ; B 61 -284 520 539 ;
+C -1 ; WX 611 ; N Zcaron ; B 28 0 737 939 ;
+C -1 ; WX 556 ; N ecircumflex ; B 84 -23 580 741 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 124 -23 800 940 ;
+C -1 ; WX 556 ; N acircumflex ; B 65 -23 568 741 ;
+C -1 ; WX 611 ; N Zdotaccent ; B 28 0 737 914 ;
+C -1 ; WX 500 ; N scaron ; B 61 -23 547 740 ;
+C -1 ; WX 667 ; N Amacron ; B 17 0 663 895 ;
+C -1 ; WX 500 ; N sacute ; B 61 -23 545 740 ;
+C -1 ; WX 611 ; N Tcommaaccent ; B 158 -284 748 729 ;
+C -1 ; WX 667 ; N Ydieresis ; B 168 0 816 914 ;
+C -1 ; WX 556 ; N thorn ; B 7 -213 586 729 ;
+C -1 ; WX 667 ; N Emacron ; B 90 0 751 895 ;
+C -1 ; WX 778 ; N Ograve ; B 104 -23 828 939 ;
+C -1 ; WX 778 ; N Oacute ; B 104 -23 828 939 ;
+C -1 ; WX 778 ; N Odieresis ; B 104 -23 828 914 ;
+C -1 ; WX 722 ; N Ntilde ; B 76 0 801 918 ;
+C -1 ; WX 722 ; N Ncaron ; B 76 0 801 939 ;
+C -1 ; WX 722 ; N Nacute ; B 76 0 801 939 ;
+C -1 ; WX 556 ; N Lcaron ; B 80 0 551 729 ;
+C -1 ; WX 556 ; N Lacute ; B 80 0 551 939 ;
+C -1 ; WX 278 ; N Idotaccent ; B 100 0 389 914 ;
+C -1 ; WX 333 ; N racute ; B 69 0 498 740 ;
+C -1 ; WX 278 ; N Icircumflex ; B 100 0 454 940 ;
+C -1 ; WX 556 ; N ohungarumlaut ; B 80 -23 683 740 ;
+C -1 ; WX 556 ; N otilde ; B 80 -23 583 719 ;
+C -1 ; WX 556 ; N Euro ; B 12 -22 636 709 ;
+C -1 ; WX 556 ; N ocircumflex ; B 80 -23 576 741 ;
+C -1 ; WX 390 ; N onesuperior ; B 205 284 393 709 ;
+C -1 ; WX 390 ; N twosuperior ; B 100 284 468 709 ;
+C -1 ; WX 390 ; N threesuperior ; B 123 270 455 709 ;
+C -1 ; WX 278 ; N Igrave ; B 100 0 378 939 ;
+C -1 ; WX 278 ; N Iacute ; B 100 0 479 939 ;
+C -1 ; WX 278 ; N Imacron ; B 100 0 458 895 ;
+C -1 ; WX 278 ; N Iogonek ; B 28 -205 349 729 ;
+C -1 ; WX 278 ; N Idieresis ; B 100 0 467 907 ;
+C -1 ; WX 778 ; N Gbreve ; B 109 -23 809 928 ;
+C -1 ; WX 722 ; N Umacron ; B 124 -23 800 895 ;
+C -1 ; WX 667 ; N Kcommaaccent ; B 79 -284 813 729 ;
+C -1 ; WX 556 ; N ograve ; B 80 -23 576 740 ;
+C -1 ; WX 667 ; N Scommaaccent ; B 89 -284 714 741 ;
+C -1 ; WX 667 ; N Eogonek ; B 90 -205 751 729 ;
+C -1 ; WX 556 ; N oacute ; B 80 -23 576 740 ;
+C -1 ; WX 667 ; N Edotaccent ; B 90 0 751 914 ;
+C -1 ; WX 222 ; N iogonek ; B 0 -205 305 729 ;
+C -1 ; WX 527 ; N gcommaaccent ; B 3 -218 572 813 ;
+C -1 ; WX 556 ; N odieresis ; B 80 -23 576 715 ;
+C -1 ; WX 556 ; N ntilde ; B 70 0 589 719 ;
+C -1 ; WX 556 ; N ncaron ; B 70 0 578 740 ;
+C -1 ; WX 667 ; N Ecaron ; B 90 0 751 939 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 90 0 751 940 ;
+C -1 ; WX 500 ; N scedilla ; B 61 -214 521 539 ;
+C -1 ; WX 333 ; N rcaron ; B 69 0 486 740 ;
+C -1 ; WX 667 ; N Egrave ; B 90 0 751 939 ;
+C -1 ; WX 667 ; N Eacute ; B 90 0 751 939 ;
+C -1 ; WX 778 ; N Gcommaaccent ; B 109 -284 809 741 ;
+C -1 ; WX 722 ; N Rcommaaccent ; B 93 -284 770 729 ;
+C -1 ; WX 667 ; N Edieresis ; B 90 0 751 914 ;
+C -1 ; WX 556 ; N nacute ; B 70 0 580 740 ;
+C -1 ; WX 556 ; N uogonek ; B 88 -205 594 524 ;
+C -1 ; WX 556 ; N umacron ; B 88 -23 594 696 ;
+C -1 ; WX 722 ; N Dcaron ; B 89 0 759 939 ;
+C -1 ; WX 307 ; N lcaron ; B 68 0 467 729 ;
+C -1 ; WX 722 ; N Ccaron ; B 112 -23 770 939 ;
+C -1 ; WX 722 ; N Cacute ; B 112 -23 770 939 ;
+C -1 ; WX 722 ; N Ccedilla ; B 112 -214 770 741 ;
+C -1 ; WX 606 ; N degree ; B 291 383 594 686 ;
+C -1 ; WX 667 ; N Aogonek ; B 17 -205 663 729 ;
+C -1 ; WX 584 ; N minus ; B 81 197 601 269 ;
+C -1 ; WX 584 ; N multiply ; B 113 34 568 427 ;
+C -1 ; WX 584 ; N divide ; B 92 0 591 462 ;
+C -1 ; WX 667 ; N Aring ; B 17 0 653 953 ;
+C -1 ; WX 1000 ; N trademark ; B 208 292 1096 729 ;
+C -1 ; WX 333 ; N rcommaaccent ; B 5 -284 436 539 ;
+C -1 ; WX 222 ; N lacute ; B 68 0 463 939 ;
+C -1 ; WX 556 ; N omacron ; B 80 -23 576 696 ;
+C -1 ; WX 667 ; N Atilde ; B 17 0 680 918 ;
+C -1 ; WX 278 ; N icircumflex ; B 94 0 406 741 ;
+C -1 ; WX 278 ; N igrave ; B 94 0 330 740 ;
+C -1 ; WX 556 ; N ncommaaccent ; B 70 -284 574 539 ;
+C -1 ; WX 222 ; N lcommaaccent ; B -1 -284 307 729 ;
+C -1 ; WX 584 ; N plusminus ; B 50 0 625 633 ;
+C -1 ; WX 947 ; N onehalf ; B 202 -20 965 709 ;
+C -1 ; WX 947 ; N onequarter ; B 205 -20 938 709 ;
+C -1 ; WX 947 ; N threequarters ; B 123 -20 938 709 ;
+C -1 ; WX 278 ; N iacute ; B 94 0 431 740 ;
+C -1 ; WX 667 ; N Abreve ; B 17 0 683 928 ;
+C -1 ; WX 500 ; N kcommaaccent ; B 58 -284 584 729 ;
+C -1 ; WX 778 ; N Omacron ; B 104 -23 828 895 ;
+C -1 ; WX 222 ; N imacron ; B 66 0 373 696 ;
+C -1 ; WX 556 ; N emacron ; B 84 -23 580 696 ;
+C -1 ; WX 556 ; N amacron ; B 65 -23 568 696 ;
+C -1 ; WX 278 ; N tcommaaccent ; B 55 -284 366 668 ;
+C -1 ; WX 500 ; N ydieresis ; B 8 -218 590 715 ;
+C -1 ; WX 500 ; N zdotaccent ; B 31 0 557 715 ;
+C -1 ; WX 500 ; N zcaron ; B 31 0 557 740 ;
+C -1 ; WX 500 ; N zacute ; B 31 0 557 740 ;
+C -1 ; WX 500 ; N yacute ; B 8 -218 590 740 ;
+C -1 ; WX 556 ; N uhungarumlaut ; B 88 -23 683 740 ;
+C -1 ; WX 556 ; N eth ; B 80 -23 576 743 ;
+C -1 ; WX 556 ; N uring ; B 88 -23 594 754 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 104 -23 828 940 ;
+C -1 ; WX 333 ; N commaaccent ; B 57 -284 205 -60 ;
+C -1 ; WX 737 ; N copyright ; B 55 -22 836 742 ;
+C -1 ; WX 737 ; N registered ; B 55 -22 836 742 ;
+C -1 ; WX 667 ; N Acircumflex ; B 17 0 653 940 ;
+C -1 ; WX 278 ; N idieresis ; B 94 0 419 708 ;
+C -1 ; WX 489 ; N lozenge ; B 16 0 462 744 ;
+C -1 ; WX 712 ; N Delta ; B 10 0 701 729 ;
+C -1 ; WX 584 ; N notequal ; B 74 2 609 480 ;
+C -1 ; WX 542 ; N radical ; B 102 -36 705 913 ;
+C -1 ; WX 667 ; N Agrave ; B 17 0 653 939 ;
+C -1 ; WX 667 ; N Aacute ; B 17 0 667 939 ;
+C -1 ; WX 584 ; N lessequal ; B 45 0 659 584 ;
+C -1 ; WX 584 ; N greaterequal ; B 56 0 626 584 ;
+C -1 ; WX 584 ; N logicalnot ; B 99 86 619 377 ;
+C -1 ; WX 711 ; N summation ; B -18 -97 760 762 ;
+C -1 ; WX 490 ; N partialdiff ; B 22 -15 458 750 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B 76 -284 801 729 ;
+C -1 ; WX 556 ; N dcroat ; B 73 -23 695 729 ;
+C -1 ; WX 260 ; N brokenbar ; B 54 -212 315 729 ;
+C -1 ; WX 556 ; N Lcommaaccent ; B 80 -284 551 729 ;
+C -1 ; WX 667 ; N Adieresis ; B 17 0 662 914 ;
+C -1 ; WX 556 ; N mu ; B 18 -220 593 524 ;
+C -1 ; WX 278 ; N .notdef ; B 213 0 213 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 998
+KPX A C -41
+KPX A Ccedilla -41
+KPX A G -41
+KPX A O -37
+KPX A Odieresis -37
+KPX A Q -38
+KPX A T -103
+KPX A U -42
+KPX A Uacute -42
+KPX A Ucircumflex -42
+KPX A Udieresis -42
+KPX A Ugrave -42
+KPX A V -81
+KPX A W -57
+KPX A Y -104
+KPX A a -16
+KPX A b -5
+KPX A c -16
+KPX A ccedilla -16
+KPX A comma -4
+KPX A d -14
+KPX A e -22
+KPX A g -17
+KPX A guillemotleft -51
+KPX A guilsinglleft -47
+KPX A hyphen -8
+KPX A o -19
+KPX A period -2
+KPX A q -15
+KPX A quotedblright -60
+KPX A quoteright -68
+KPX A t -22
+KPX A u -18
+KPX A v -40
+KPX A w -29
+KPX A y -44
+KPX Aacute C -42
+KPX Aacute G -42
+KPX Aacute O -38
+KPX Aacute Q -39
+KPX Aacute T -103
+KPX Aacute U -43
+KPX Aacute V -81
+KPX Aacute W -57
+KPX Aacute Y -104
+KPX Aacute a -16
+KPX Aacute b -6
+KPX Aacute c -17
+KPX Aacute comma -4
+KPX Aacute d -15
+KPX Aacute e -23
+KPX Aacute g -17
+KPX Aacute guillemotleft -51
+KPX Aacute guilsinglleft -48
+KPX Aacute hyphen -9
+KPX Aacute o -20
+KPX Aacute period -3
+KPX Aacute q -16
+KPX Aacute quoteright -68
+KPX Aacute t -23
+KPX Aacute u -20
+KPX Aacute v -40
+KPX Aacute w -29
+KPX Aacute y -44
+KPX Acircumflex C -41
+KPX Acircumflex G -41
+KPX Acircumflex O -37
+KPX Acircumflex Q -38
+KPX Acircumflex T -103
+KPX Acircumflex U -42
+KPX Acircumflex V -81
+KPX Acircumflex W -57
+KPX Acircumflex Y -104
+KPX Acircumflex comma -4
+KPX Acircumflex period -2
+KPX Adieresis C -42
+KPX Adieresis G -41
+KPX Adieresis O -38
+KPX Adieresis Q -39
+KPX Adieresis T -103
+KPX Adieresis U -43
+KPX Adieresis V -81
+KPX Adieresis W -57
+KPX Adieresis Y -104
+KPX Adieresis a -16
+KPX Adieresis b -5
+KPX Adieresis c -17
+KPX Adieresis comma -4
+KPX Adieresis d -14
+KPX Adieresis g -17
+KPX Adieresis guillemotleft -51
+KPX Adieresis guilsinglleft -48
+KPX Adieresis hyphen -8
+KPX Adieresis o -19
+KPX Adieresis period -3
+KPX Adieresis q -15
+KPX Adieresis quotedblright -60
+KPX Adieresis quoteright -68
+KPX Adieresis t -22
+KPX Adieresis u -19
+KPX Adieresis v -40
+KPX Adieresis w -29
+KPX Adieresis y -44
+KPX Agrave C -41
+KPX Agrave G -41
+KPX Agrave O -37
+KPX Agrave Q -38
+KPX Agrave T -103
+KPX Agrave U -42
+KPX Agrave V -81
+KPX Agrave W -57
+KPX Agrave Y -104
+KPX Agrave comma -4
+KPX Agrave period -2
+KPX Aring C -41
+KPX Aring G -41
+KPX Aring O -37
+KPX Aring Q -38
+KPX Aring T -103
+KPX Aring U -42
+KPX Aring V -81
+KPX Aring W -57
+KPX Aring Y -104
+KPX Aring a -16
+KPX Aring b -5
+KPX Aring c -16
+KPX Aring comma -4
+KPX Aring d -14
+KPX Aring e -22
+KPX Aring g -17
+KPX Aring guillemotleft -51
+KPX Aring guilsinglleft -47
+KPX Aring hyphen -8
+KPX Aring o -19
+KPX Aring period -2
+KPX Aring q -15
+KPX Aring quotedblright -60
+KPX Aring quoteright -68
+KPX Aring t -22
+KPX Aring u -18
+KPX Aring v -40
+KPX Aring w -29
+KPX Aring y -44
+KPX Atilde C -43
+KPX Atilde G -42
+KPX Atilde O -39
+KPX Atilde Q -40
+KPX Atilde T -103
+KPX Atilde U -44
+KPX Atilde V -81
+KPX Atilde W -57
+KPX Atilde Y -104
+KPX Atilde comma -4
+KPX Atilde period -4
+KPX B A -28
+KPX B AE -29
+KPX B Aacute -28
+KPX B Acircumflex -28
+KPX B Adieresis -28
+KPX B Aring -28
+KPX B Atilde -28
+KPX B O -14
+KPX B OE -11
+KPX B Oacute -14
+KPX B Ocircumflex -14
+KPX B Odieresis -14
+KPX B Ograve -14
+KPX B Oslash -2
+KPX B V -49
+KPX B W -27
+KPX B Y -56
+KPX C A -43
+KPX C AE -44
+KPX C Aacute -43
+KPX C Adieresis -43
+KPX C Aring -43
+KPX C H -22
+KPX C K -20
+KPX C O -18
+KPX C Oacute -18
+KPX C Odieresis -18
+KPX Ccedilla A -44
+KPX D A -50
+KPX D Aacute -50
+KPX D Acircumflex -50
+KPX D Adieresis -50
+KPX D Agrave -50
+KPX D Aring -50
+KPX D Atilde -50
+KPX D J -13
+KPX D T -56
+KPX D V -54
+KPX D W -31
+KPX D X -58
+KPX D Y -74
+KPX F A -78
+KPX F Aacute -78
+KPX F Acircumflex -78
+KPX F Adieresis -78
+KPX F Agrave -78
+KPX F Aring -78
+KPX F Atilde -78
+KPX F J -59
+KPX F O -30
+KPX F Odieresis -30
+KPX F a -45
+KPX F aacute -45
+KPX F adieresis -45
+KPX F ae -41
+KPX F aring -45
+KPX F comma -113
+KPX F e -33
+KPX F eacute -33
+KPX F hyphen -20
+KPX F i -19
+KPX F j -19
+KPX F o -30
+KPX F oacute -30
+KPX F odieresis -30
+KPX F oe -33
+KPX F oslash -30
+KPX F period -113
+KPX F r -44
+KPX F u -42
+KPX G A -14
+KPX G AE -11
+KPX G Aacute -14
+KPX G Acircumflex -14
+KPX G Adieresis -14
+KPX G Agrave -14
+KPX G Aring -14
+KPX G Atilde -14
+KPX G T -53
+KPX G V -53
+KPX G W -31
+KPX G Y -72
+KPX J A -39
+KPX J AE -39
+KPX J Adieresis -39
+KPX J Aring -39
+KPX K C -56
+KPX K G -57
+KPX K O -53
+KPX K OE -49
+KPX K Oacute -53
+KPX K Odieresis -53
+KPX K S -48
+KPX K T 14
+KPX K a -23
+KPX K adieresis -23
+KPX K ae -20
+KPX K aring -23
+KPX K e -46
+KPX K hyphen -53
+KPX K o -42
+KPX K oacute -42
+KPX K odieresis -42
+KPX K u -32
+KPX K udieresis -32
+KPX K y -76
+KPX L A 8
+KPX L AE 11
+KPX L Aacute 8
+KPX L Adieresis 8
+KPX L Aring 8
+KPX L C -52
+KPX L Ccedilla -51
+KPX L G -53
+KPX L O -51
+KPX L Oacute -51
+KPX L Ocircumflex -51
+KPX L Odieresis -51
+KPX L Ograve -51
+KPX L Otilde -51
+KPX L S -28
+KPX L T -112
+KPX L U -46
+KPX L Udieresis -46
+KPX L V -115
+KPX L W -77
+KPX L Y -128
+KPX L hyphen -140
+KPX L quotedblright -145
+KPX L quoteright -153
+KPX L u -17
+KPX L udieresis -17
+KPX L y -68
+KPX N A -19
+KPX N AE -16
+KPX N Aacute -19
+KPX N Adieresis -19
+KPX N Aring -19
+KPX N C -15
+KPX N Ccedilla -14
+KPX N G -14
+KPX N O -11
+KPX N Oacute -11
+KPX N Odieresis -11
+KPX N a -17
+KPX N aacute -17
+KPX N adieresis -17
+KPX N ae -13
+KPX N aring -17
+KPX N comma -15
+KPX N e -11
+KPX N eacute -11
+KPX N o -8
+KPX N oacute -8
+KPX N odieresis -8
+KPX N oslash -4
+KPX N period -15
+KPX N u -8
+KPX N udieresis -9
+KPX O A -43
+KPX O AE -47
+KPX O Aacute -43
+KPX O Adieresis -43
+KPX O Aring -43
+KPX O T -54
+KPX O V -48
+KPX O W -25
+KPX O X -52
+KPX O Y -71
+KPX Oacute A -43
+KPX Oacute T -54
+KPX Oacute V -48
+KPX Oacute W -25
+KPX Oacute Y -71
+KPX Ocircumflex T -54
+KPX Ocircumflex V -48
+KPX Ocircumflex Y -71
+KPX Odieresis A -43
+KPX Odieresis T -54
+KPX Odieresis V -48
+KPX Odieresis W -25
+KPX Odieresis X -52
+KPX Odieresis Y -71
+KPX Ograve T -54
+KPX Ograve V -48
+KPX Ograve Y -71
+KPX Oslash A -47
+KPX Otilde T -54
+KPX Otilde V -48
+KPX Otilde Y -71
+KPX P A -86
+KPX P AE -93
+KPX P Aacute -86
+KPX P Adieresis -86
+KPX P Aring -86
+KPX P J -85
+KPX P a -39
+KPX P aacute -39
+KPX P adieresis -39
+KPX P ae -35
+KPX P aring -39
+KPX P comma -138
+KPX P e -38
+KPX P eacute -38
+KPX P hyphen -45
+KPX P o -34
+KPX P oacute -34
+KPX P odieresis -34
+KPX P oe -38
+KPX P oslash -35
+KPX P period -138
+KPX R C -21
+KPX R Ccedilla -21
+KPX R G -21
+KPX R O -17
+KPX R OE -14
+KPX R Oacute -17
+KPX R Odieresis -17
+KPX R T -33
+KPX R U -21
+KPX R Udieresis -21
+KPX R V -49
+KPX R W -27
+KPX R Y -54
+KPX R a -21
+KPX R aacute -21
+KPX R adieresis -21
+KPX R ae -17
+KPX R aring -21
+KPX R e -16
+KPX R eacute -16
+KPX R hyphen -4
+KPX R o -13
+KPX R oacute -13
+KPX R odieresis -13
+KPX R oe -16
+KPX R u -13
+KPX R uacute -14
+KPX R udieresis -14
+KPX R y -16
+KPX S A -31
+KPX S AE -31
+KPX S Aacute -31
+KPX S Adieresis -31
+KPX S Aring -31
+KPX S T -38
+KPX S V -52
+KPX S W -31
+KPX S Y -58
+KPX S t -11
+KPX T A -104
+KPX T AE -106
+KPX T Aacute -104
+KPX T Acircumflex -104
+KPX T Adieresis -104
+KPX T Agrave -104
+KPX T Aring -104
+KPX T Atilde -104
+KPX T C -53
+KPX T G -55
+KPX T J -108
+KPX T O -50
+KPX T OE -44
+KPX T Oacute -50
+KPX T Ocircumflex -50
+KPX T Odieresis -50
+KPX T Ograve -50
+KPX T Oslash -42
+KPX T Otilde -50
+KPX T S -32
+KPX T V 2
+KPX T W 7
+KPX T Y 10
+KPX T a -107
+KPX T ae -104
+KPX T c -96
+KPX T colon -152
+KPX T comma -105
+KPX T e -102
+KPX T g -94
+KPX T guillemotleft -126
+KPX T guilsinglleft -123
+KPX T hyphen -82
+KPX T i -12
+KPX T j -12
+KPX T o -99
+KPX T oslash -94
+KPX T period -105
+KPX T r -98
+KPX T s -98
+KPX T semicolon -140
+KPX T u -98
+KPX T v -106
+KPX T w -103
+KPX T y -110
+KPX U A -45
+KPX U AE -48
+KPX U Aacute -45
+KPX U Acircumflex -45
+KPX U Adieresis -45
+KPX U Aring -45
+KPX U Atilde -45
+KPX U comma -35
+KPX U m -17
+KPX U n -16
+KPX U p -8
+KPX U period -32
+KPX U r -16
+KPX Uacute A -45
+KPX Uacute comma -35
+KPX Uacute m -17
+KPX Uacute n -16
+KPX Uacute p -8
+KPX Uacute period -32
+KPX Uacute r -16
+KPX Ucircumflex A -45
+KPX Udieresis A -44
+KPX Udieresis b -8
+KPX Udieresis comma -35
+KPX Udieresis m -17
+KPX Udieresis n -16
+KPX Udieresis p -8
+KPX Udieresis period -32
+KPX Udieresis r -16
+KPX Ugrave A -45
+KPX V A -77
+KPX V AE -84
+KPX V Aacute -77
+KPX V Acircumflex -77
+KPX V Adieresis -77
+KPX V Agrave -77
+KPX V Aring -77
+KPX V Atilde -77
+KPX V C -50
+KPX V G -50
+KPX V O -46
+KPX V Oacute -46
+KPX V Ocircumflex -46
+KPX V Odieresis -46
+KPX V Ograve -46
+KPX V Oslash -34
+KPX V Otilde -46
+KPX V S -44
+KPX V T 7
+KPX V a -71
+KPX V ae -66
+KPX V colon -76
+KPX V comma -94
+KPX V e -64
+KPX V g -57
+KPX V guillemotleft -88
+KPX V guilsinglleft -84
+KPX V hyphen -44
+KPX V i -14
+KPX V o -61
+KPX V oslash -57
+KPX V period -94
+KPX V r -51
+KPX V semicolon -75
+KPX V u -52
+KPX V y -28
+KPX W A -56
+KPX W AE -62
+KPX W Aacute -56
+KPX W Acircumflex -56
+KPX W Adieresis -56
+KPX W Agrave -56
+KPX W Aring -56
+KPX W Atilde -56
+KPX W C -30
+KPX W G -30
+KPX W O -26
+KPX W Oacute -26
+KPX W Ocircumflex -26
+KPX W Odieresis -26
+KPX W Ograve -26
+KPX W Oslash -14
+KPX W Otilde -26
+KPX W S -31
+KPX W T 11
+KPX W a -46
+KPX W ae -42
+KPX W colon -62
+KPX W comma -62
+KPX W e -39
+KPX W g -32
+KPX W guillemotleft -63
+KPX W guilsinglleft -60
+KPX W hyphen -19
+KPX W i -10
+KPX W o -36
+KPX W oslash -32
+KPX W period -62
+KPX W r -36
+KPX W semicolon -62
+KPX W u -36
+KPX W y -15
+KPX X C -53
+KPX X O -50
+KPX X Odieresis -50
+KPX X Q -51
+KPX X a -27
+KPX X e -51
+KPX X hyphen -57
+KPX X o -46
+KPX X u -36
+KPX X y -67
+KPX Y A -102
+KPX Y AE -108
+KPX Y Aacute -102
+KPX Y Acircumflex -102
+KPX Y Adieresis -102
+KPX Y Agrave -102
+KPX Y Aring -102
+KPX Y Atilde -102
+KPX Y C -68
+KPX Y G -69
+KPX Y O -64
+KPX Y Oacute -64
+KPX Y Ocircumflex -64
+KPX Y Odieresis -64
+KPX Y Ograve -64
+KPX Y Oslash -55
+KPX Y Otilde -64
+KPX Y S -49
+KPX Y T 15
+KPX Y a -100
+KPX Y ae -95
+KPX Y colon -97
+KPX Y comma -117
+KPX Y e -97
+KPX Y g -89
+KPX Y guillemotleft -128
+KPX Y guilsinglleft -124
+KPX Y hyphen -89
+KPX Y i -6
+KPX Y o -93
+KPX Y oslash -89
+KPX Y p -63
+KPX Y period -117
+KPX Y semicolon -97
+KPX Y u -73
+KPX Y v -48
+KPX Z v -44
+KPX Z y -44
+KPX a j -10
+KPX a quoteright -23
+KPX a v -26
+KPX a w -16
+KPX a y -33
+KPX aacute v -26
+KPX aacute w -16
+KPX aacute y -33
+KPX adieresis v -26
+KPX adieresis w -16
+KPX adieresis y -33
+KPX ae v -26
+KPX ae w -15
+KPX ae y -32
+KPX agrave v -26
+KPX agrave w -16
+KPX agrave y -33
+KPX aring v -26
+KPX aring w -16
+KPX aring y -33
+KPX b v -21
+KPX b w -10
+KPX b y -28
+KPX c h -7
+KPX c k -1
+KPX comma one -105
+KPX comma quotedblright -47
+KPX comma quoteright -55
+KPX e quoteright -20
+KPX e t -16
+KPX e v -26
+KPX e w -16
+KPX e x -35
+KPX e y -33
+KPX eacute v -26
+KPX eacute w -16
+KPX eacute y -33
+KPX ecircumflex v -26
+KPX ecircumflex w -16
+KPX ecircumflex y -33
+KPX eight four -6
+KPX eight one -55
+KPX eight seven -43
+KPX f a -20
+KPX f aacute -20
+KPX f adieresis -20
+KPX f ae -15
+KPX f aring -20
+KPX f e -21
+KPX f eacute -21
+KPX f f 12
+KPX f i -10
+KPX f j -11
+KPX f l -12
+KPX f o -18
+KPX f oacute -18
+KPX f odieresis -18
+KPX f oe -20
+KPX f oslash -16
+KPX f quoteright -8
+KPX f s -8
+KPX f t 16
+KPX five four -7
+KPX five one -83
+KPX five seven -32
+KPX four four -3
+KPX four one -88
+KPX four seven -65
+KPX g a -17
+KPX g adieresis -17
+KPX g ae -13
+KPX g aring -17
+KPX g e -11
+KPX g eacute -11
+KPX g l -8
+KPX g oacute -8
+KPX g odieresis -8
+KPX g r -9
+KPX guillemotright A -58
+KPX guillemotright AE -62
+KPX guillemotright Aacute -58
+KPX guillemotright Adieresis -58
+KPX guillemotright Aring -58
+KPX guillemotright T -132
+KPX guillemotright V -96
+KPX guillemotright W -68
+KPX guillemotright Y -137
+KPX guilsinglright A -52
+KPX guilsinglright AE -56
+KPX guilsinglright Aacute -52
+KPX guilsinglright Adieresis -52
+KPX guilsinglright Aring -52
+KPX guilsinglright T -126
+KPX guilsinglright V -90
+KPX guilsinglright W -62
+KPX guilsinglright Y -131
+KPX h quoteright -19
+KPX h y -31
+KPX hyphen A -12
+KPX hyphen AE -17
+KPX hyphen Aacute -12
+KPX hyphen Adieresis -12
+KPX hyphen Aring -12
+KPX hyphen T -86
+KPX hyphen V -51
+KPX hyphen W -24
+KPX hyphen Y -97
+KPX i T -16
+KPX i j -10
+KPX k a -14
+KPX k aacute -14
+KPX k adieresis -14
+KPX k ae -12
+KPX k aring -14
+KPX k comma -13
+KPX k e -33
+KPX k eacute -33
+KPX k g -26
+KPX k hyphen -49
+KPX k o -30
+KPX k oacute -30
+KPX k odieresis -30
+KPX k period -13
+KPX k s -14
+KPX k u -22
+KPX k udieresis -16
+KPX l v -11
+KPX l y -15
+KPX m p -3
+KPX m v -24
+KPX m w -14
+KPX m y -30
+KPX n T -103
+KPX n p -3
+KPX n quoteright -19
+KPX n v -24
+KPX n w -14
+KPX n y -31
+KPX nine four -12
+KPX nine one -55
+KPX nine seven -50
+KPX o T -106
+KPX o quoteright -23
+KPX o t -17
+KPX o v -27
+KPX o w -16
+KPX o x -35
+KPX o y -34
+KPX oacute v -27
+KPX oacute w -16
+KPX oacute y -34
+KPX ocircumflex t -17
+KPX odieresis t -17
+KPX odieresis v -27
+KPX odieresis w -16
+KPX odieresis x -35
+KPX odieresis y -34
+KPX ograve v -27
+KPX ograve w -16
+KPX ograve y -34
+KPX one comma -82
+KPX one eight -73
+KPX one five -72
+KPX one four -88
+KPX one nine -71
+KPX one one -125
+KPX one period -82
+KPX one seven -98
+KPX one six -71
+KPX one three -75
+KPX one two -78
+KPX one zero -71
+KPX p t -10
+KPX p y -28
+KPX period one -106
+KPX period quotedblright -48
+KPX period quoteright -56
+KPX q c -2
+KPX q u -5
+KPX quotedblbase A 21
+KPX quotedblbase AE 21
+KPX quotedblbase T -80
+KPX quotedblbase V -74
+KPX quotedblbase W -39
+KPX quotedblbase Y -96
+KPX quotedblleft A -58
+KPX quotedblleft AE -70
+KPX quotedblleft Aacute -58
+KPX quotedblleft Adieresis -58
+KPX quotedblleft Aring -58
+KPX quotedblleft T 1
+KPX quotedblleft V 10
+KPX quotedblleft W 22
+KPX quotedblleft Y -1
+KPX quotedblright A -60
+KPX quotedblright AE -72
+KPX quotedblright Aacute -60
+KPX quotedblright Adieresis -60
+KPX quotedblright Aring -60
+KPX quotedblright T 2
+KPX quotedblright V 9
+KPX quotedblright W 21
+KPX quotedblright Y -2
+KPX quoteleft A -74
+KPX quoteleft AE -86
+KPX quoteleft Aacute -74
+KPX quoteleft Adieresis -74
+KPX quoteleft Aring -74
+KPX quoteleft T -14
+KPX quoteleft V -5
+KPX quoteleft W 6
+KPX quoteleft Y -17
+KPX quoteright A -76
+KPX quoteright AE -88
+KPX quoteright Aacute -76
+KPX quoteright Adieresis -76
+KPX quoteright Aring -76
+KPX quoteright comma -68
+KPX quoteright d -25
+KPX quoteright o -31
+KPX quoteright period -68
+KPX quoteright r -24
+KPX quoteright s -23
+KPX quoteright t -14
+KPX quoteright v -10
+KPX quoteright w -5
+KPX quoteright y -14
+KPX r a -16
+KPX r aacute -16
+KPX r acircumflex -16
+KPX r adieresis -16
+KPX r ae -11
+KPX r agrave -16
+KPX r aring -16
+KPX r c -11
+KPX r ccedilla -11
+KPX r colon -31
+KPX r comma -77
+KPX r d -8
+KPX r e -17
+KPX r eacute -17
+KPX r ecircumflex -17
+KPX r egrave -17
+KPX r f 17
+KPX r g -8
+KPX r h -8
+KPX r hyphen -54
+KPX r i -6
+KPX r j -6
+KPX r k -2
+KPX r l -7
+KPX r m -9
+KPX r n -8
+KPX r o -14
+KPX r oacute -14
+KPX r ocircumflex -14
+KPX r odieresis -14
+KPX r oe -16
+KPX r ograve -14
+KPX r oslash -14
+KPX r p 0
+KPX r period -77
+KPX r q -10
+KPX r quoteright -6
+KPX r r -8
+KPX r s -4
+KPX r semicolon -30
+KPX r t 21
+KPX r u -7
+KPX r v 18
+KPX r w 21
+KPX r x 9
+KPX r y 15
+KPX r z 0
+KPX s quoteright -24
+KPX s t -15
+KPX seven colon -84
+KPX seven comma -123
+KPX seven eight -34
+KPX seven five -37
+KPX seven four -95
+KPX seven one -58
+KPX seven period -123
+KPX seven seven -11
+KPX seven six -44
+KPX seven three -29
+KPX seven two -31
+KPX six four -7
+KPX six one -52
+KPX six seven -40
+KPX t S -17
+KPX t a -10
+KPX t aacute -10
+KPX t adieresis -10
+KPX t ae -7
+KPX t aring -10
+KPX t colon -37
+KPX t e -22
+KPX t eacute -22
+KPX t h -14
+KPX t o -19
+KPX t oacute -19
+KPX t odieresis -19
+KPX t quoteright -7
+KPX t semicolon -36
+KPX three four -9
+KPX three one -57
+KPX three seven -45
+KPX two four -43
+KPX two one -45
+KPX two seven -38
+KPX u quoteright -14
+KPX v a -30
+KPX v aacute -30
+KPX v acircumflex -30
+KPX v adieresis -30
+KPX v ae -25
+KPX v agrave -30
+KPX v aring -30
+KPX v atilde -30
+KPX v c -22
+KPX v colon -32
+KPX v comma -76
+KPX v e -29
+KPX v eacute -29
+KPX v ecircumflex -29
+KPX v egrave -29
+KPX v g -20
+KPX v hyphen -19
+KPX v l -8
+KPX v o -25
+KPX v oacute -25
+KPX v odieresis -25
+KPX v ograve -25
+KPX v oslash -25
+KPX v period -76
+KPX v s -17
+KPX v semicolon -31
+KPX w a -26
+KPX w aacute -26
+KPX w acircumflex -26
+KPX w adieresis -26
+KPX w ae -22
+KPX w agrave -26
+KPX w aring -26
+KPX w atilde -26
+KPX w c -14
+KPX w colon -32
+KPX w comma -57
+KPX w e -20
+KPX w eacute -20
+KPX w ecircumflex -20
+KPX w egrave -20
+KPX w g -13
+KPX w hyphen -8
+KPX w l -8
+KPX w o -17
+KPX w oacute -17
+KPX w odieresis -17
+KPX w ograve -17
+KPX w oslash -14
+KPX w period -57
+KPX w s -14
+KPX w semicolon -31
+KPX x a -30
+KPX x c -30
+KPX x e -36
+KPX x eacute -36
+KPX x o -33
+KPX x q -28
+KPX y a -36
+KPX y aacute -36
+KPX y acircumflex -36
+KPX y adieresis -36
+KPX y ae -31
+KPX y agrave -36
+KPX y aring -36
+KPX y atilde -36
+KPX y c -28
+KPX y colon -40
+KPX y comma -80
+KPX y e -35
+KPX y eacute -35
+KPX y ecircumflex -35
+KPX y egrave -35
+KPX y g -26
+KPX y hyphen -24
+KPX y l -14
+KPX y o -31
+KPX y oacute -31
+KPX y odieresis -31
+KPX y ograve -31
+KPX y oslash -30
+KPX y period -80
+KPX y s -23
+KPX y semicolon -40
+KPX zero four -11
+KPX zero one -56
+KPX zero seven -50
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/pdf2swf/fonts/n019023l.pfb b/pdf2swf/fonts/n019023l.pfb
new file mode 100644
index 00000000..876cda87
--- /dev/null
+++ b/pdf2swf/fonts/n019023l.pfb
Binary files differ
diff --git a/pdf2swf/fonts/n019024l.afm b/pdf2swf/fonts/n019024l.afm
new file mode 100644
index 00000000..9433a322
--- /dev/null
+++ b/pdf2swf/fonts/n019024l.afm
@@ -0,0 +1,1341 @@
+StartFontMetrics 3.0
+Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development
+Comment Creation Date: 12/22/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName NimbusSanL-BoldItal
+FullName Nimbus Sans L Bold Italic
+FamilyName Nimbus Sans L
+Weight Bold
+ItalicAngle -12.0
+IsFixedPitch false
+UnderlinePosition -111
+UnderlineThickness 69
+Version 1.05
+Notice (URW)++,Copyright 1999 by (URW)++ Design & Development
+EncodingScheme AdobeStandardEncoding
+FontBBox -177 -309 1107 953
+CapHeight 729
+XHeight 540
+Descender -217
+Ascender 729
+StartCharMetrics 316
+C 32 ; WX 278 ; N space ; B 245 0 245 0 ;
+C 33 ; WX 333 ; N exclam ; B 112 0 417 726 ;
+C 34 ; WX 474 ; N quotedbl ; B 177 470 579 729 ;
+C 35 ; WX 556 ; N numbersign ; B 33 -32 660 697 ;
+C 36 ; WX 556 ; N dollar ; B 59 -126 628 763 ;
+C 37 ; WX 889 ; N percent ; B 129 -20 903 709 ;
+C 38 ; WX 722 ; N ampersand ; B 89 -23 720 723 ;
+C 39 ; WX 278 ; N quoteright ; B 165 469 356 729 ;
+C 40 ; WX 333 ; N parenleft ; B 84 -200 458 729 ;
+C 41 ; WX 333 ; N parenright ; B -21 -200 356 729 ;
+C 42 ; WX 389 ; N asterisk ; B 145 407 478 729 ;
+C 43 ; WX 584 ; N plus ; B 87 -10 596 473 ;
+C 44 ; WX 278 ; N comma ; B 27 -174 245 146 ;
+C 45 ; WX 333 ; N hyphen ; B 70 207 371 342 ;
+C 46 ; WX 278 ; N period ; B 64 0 245 146 ;
+C 47 ; WX 278 ; N slash ; B -1 -14 427 714 ;
+C 48 ; WX 556 ; N zero ; B 81 -23 614 724 ;
+C 49 ; WX 556 ; N one ; B 172 0 529 709 ;
+C 50 ; WX 556 ; N two ; B 30 0 628 724 ;
+C 51 ; WX 556 ; N three ; B 67 -23 613 724 ;
+C 52 ; WX 556 ; N four ; B 57 0 599 709 ;
+C 53 ; WX 556 ; N five ; B 59 -23 641 709 ;
+C 54 ; WX 556 ; N six ; B 85 -23 625 724 ;
+C 55 ; WX 556 ; N seven ; B 131 0 679 709 ;
+C 56 ; WX 556 ; N eight ; B 60 -23 620 724 ;
+C 57 ; WX 556 ; N nine ; B 68 -23 611 724 ;
+C 58 ; WX 333 ; N colon ; B 113 0 374 520 ;
+C 59 ; WX 333 ; N semicolon ; B 76 -174 374 520 ;
+C 60 ; WX 584 ; N less ; B 77 -10 630 474 ;
+C 61 ; WX 584 ; N equal ; B 61 52 622 412 ;
+C 62 ; WX 584 ; N greater ; B 38 -10 591 474 ;
+C 63 ; WX 611 ; N question ; B 168 0 672 744 ;
+C 64 ; WX 975 ; N at ; B 73 -137 1032 745 ;
+C 65 ; WX 722 ; N A ; B 26 0 703 729 ;
+C 66 ; WX 722 ; N B ; B 82 0 762 729 ;
+C 67 ; WX 722 ; N C ; B 107 -23 793 741 ;
+C 68 ; WX 722 ; N D ; B 77 0 776 729 ;
+C 69 ; WX 667 ; N E ; B 79 0 762 729 ;
+C 70 ; WX 611 ; N F ; B 74 0 741 729 ;
+C 71 ; WX 778 ; N G ; B 107 -23 819 741 ;
+C 72 ; WX 722 ; N H ; B 68 0 812 729 ;
+C 73 ; WX 278 ; N I ; B 63 0 368 729 ;
+C 74 ; WX 556 ; N J ; B 59 -23 641 729 ;
+C 75 ; WX 722 ; N K ; B 74 0 843 729 ;
+C 76 ; WX 611 ; N L ; B 80 0 606 729 ;
+C 77 ; WX 833 ; N M ; B 66 0 931 729 ;
+C 78 ; WX 722 ; N N ; B 68 0 816 729 ;
+C 79 ; WX 778 ; N O ; B 106 -23 828 741 ;
+C 80 ; WX 667 ; N P ; B 76 0 747 729 ;
+C 81 ; WX 778 ; N Q ; B 109 -54 831 741 ;
+C 82 ; WX 722 ; N R ; B 80 0 785 729 ;
+C 83 ; WX 667 ; N S ; B 76 -23 725 741 ;
+C 84 ; WX 611 ; N T ; B 142 0 753 729 ;
+C 85 ; WX 722 ; N U ; B 119 -23 809 729 ;
+C 86 ; WX 667 ; N V ; B 179 0 802 729 ;
+C 87 ; WX 944 ; N W ; B 168 0 1087 729 ;
+C 88 ; WX 667 ; N X ; B 22 0 802 729 ;
+C 89 ; WX 667 ; N Y ; B 182 0 805 729 ;
+C 90 ; WX 611 ; N Z ; B 30 0 733 729 ;
+C 91 ; WX 333 ; N bracketleft ; B 23 -200 463 729 ;
+C 92 ; WX 278 ; N backslash ; B 138 -23 285 709 ;
+C 93 ; WX 333 ; N bracketright ; B -25 -200 415 729 ;
+C 94 ; WX 584 ; N asciicircum ; B 119 270 580 695 ;
+C 95 ; WX 556 ; N underscore ; B -65 -145 550 -76 ;
+C 96 ; WX 278 ; N quoteleft ; B 167 469 357 729 ;
+C 97 ; WX 556 ; N a ; B 50 -23 578 549 ;
+C 98 ; WX 611 ; N b ; B 59 -23 640 729 ;
+C 99 ; WX 556 ; N c ; B 77 -23 597 549 ;
+C 100 ; WX 611 ; N d ; B 79 -23 700 729 ;
+C 101 ; WX 556 ; N e ; B 64 -23 591 549 ;
+C 102 ; WX 333 ; N f ; B 90 0 464 729 ;
+C 103 ; WX 611 ; N g ; B 26 -218 656 549 ;
+C 104 ; WX 611 ; N h ; B 67 0 629 729 ;
+C 105 ; WX 278 ; N i ; B 67 0 362 729 ;
+C 106 ; WX 278 ; N j ; B -43 -218 365 729 ;
+C 107 ; WX 556 ; N k ; B 59 0 651 729 ;
+C 108 ; WX 278 ; N l ; B 67 0 362 729 ;
+C 109 ; WX 889 ; N m ; B 60 0 911 549 ;
+C 110 ; WX 611 ; N n ; B 63 0 629 549 ;
+C 111 ; WX 611 ; N o ; B 82 -23 634 549 ;
+C 112 ; WX 611 ; N p ; B 11 -218 637 549 ;
+C 113 ; WX 611 ; N q ; B 72 -218 659 549 ;
+C 114 ; WX 389 ; N r ; B 63 0 487 549 ;
+C 115 ; WX 556 ; N s ; B 60 -23 589 549 ;
+C 116 ; WX 333 ; N t ; B 101 -23 414 674 ;
+C 117 ; WX 611 ; N u ; B 88 -23 656 540 ;
+C 118 ; WX 556 ; N v ; B 129 0 651 540 ;
+C 119 ; WX 778 ; N w ; B 120 0 881 540 ;
+C 120 ; WX 556 ; N x ; B 16 0 648 540 ;
+C 121 ; WX 556 ; N y ; B 37 -219 653 540 ;
+C 122 ; WX 500 ; N z ; B 21 0 575 540 ;
+C 123 ; WX 389 ; N braceleft ; B 84 -200 472 729 ;
+C 124 ; WX 280 ; N bar ; B 57 -200 335 729 ;
+C 125 ; WX 389 ; N braceright ; B 29 -200 419 729 ;
+C 126 ; WX 584 ; N asciitilde ; B 97 142 581 314 ;
+C 161 ; WX 333 ; N exclamdown ; B 26 -186 331 540 ;
+C 162 ; WX 556 ; N cent ; B 79 -124 598 634 ;
+C 163 ; WX 556 ; N sterling ; B 49 -23 629 715 ;
+C 164 ; WX 167 ; N fraction ; B -177 -20 489 715 ;
+C 165 ; WX 556 ; N yen ; B 107 0 702 704 ;
+C 166 ; WX 556 ; N florin ; B -21 -220 690 744 ;
+C 167 ; WX 556 ; N section ; B 56 -201 596 723 ;
+C 168 ; WX 556 ; N currency ; B 66 100 644 604 ;
+C 169 ; WX 238 ; N quotesingle ; B 177 470 343 729 ;
+C 170 ; WX 500 ; N quotedblleft ; B 171 469 588 729 ;
+C 171 ; WX 556 ; N guillemotleft ; B 135 72 571 481 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 128 72 351 481 ;
+C 173 ; WX 333 ; N guilsinglright ; B 96 72 319 481 ;
+C 174 ; WX 611 ; N fi ; B 85 0 703 729 ;
+C 175 ; WX 611 ; N fl ; B 88 0 701 729 ;
+C 177 ; WX 556 ; N endash ; B 35 207 624 311 ;
+C 178 ; WX 556 ; N dagger ; B 109 -194 626 709 ;
+C 179 ; WX 556 ; N daggerdbl ; B 35 -194 623 709 ;
+C 180 ; WX 278 ; N periodcentered ; B 143 182 270 282 ;
+C 182 ; WX 556 ; N paragraph ; B 121 -191 684 729 ;
+C 183 ; WX 350 ; N bullet ; B 111 175 367 425 ;
+C 184 ; WX 278 ; N quotesinglbase ; B 37 -135 228 125 ;
+C 185 ; WX 500 ; N quotedblbase ; B 37 -135 462 125 ;
+C 186 ; WX 500 ; N quotedblright ; B 173 469 595 729 ;
+C 187 ; WX 556 ; N guillemotright ; B 103 72 533 481 ;
+C 188 ; WX 1000 ; N ellipsis ; B 92 0 939 146 ;
+C 189 ; WX 1000 ; N perthousand ; B 72 -21 1021 739 ;
+C 191 ; WX 611 ; N questiondown ; B 52 -204 556 540 ;
+C 193 ; WX 333 ; N grave ; B 175 607 339 757 ;
+C 194 ; WX 333 ; N acute ; B 247 607 475 757 ;
+C 195 ; WX 333 ; N circumflex ; B 135 610 453 757 ;
+C 196 ; WX 333 ; N tilde ; B 117 622 500 744 ;
+C 197 ; WX 333 ; N macron ; B 150 642 467 722 ;
+C 198 ; WX 333 ; N breve ; B 188 611 455 754 ;
+C 199 ; WX 333 ; N dotaccent ; B 241 621 377 741 ;
+C 200 ; WX 333 ; N dieresis ; B 147 621 469 741 ;
+C 202 ; WX 333 ; N ring ; B 214 593 398 773 ;
+C 203 ; WX 333 ; N cedilla ; B -13 -220 270 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 82 610 498 757 ;
+C 206 ; WX 333 ; N ogonek ; B 23 -233 248 0 ;
+C 207 ; WX 333 ; N caron ; B 167 610 485 757 ;
+C 208 ; WX 1000 ; N emdash ; B 37 207 1070 311 ;
+C 225 ; WX 1000 ; N AE ; B 1 0 1104 729 ;
+C 227 ; WX 370 ; N ordfeminine ; B 96 262 451 729 ;
+C 232 ; WX 611 ; N Lslash ; B 54 0 624 729 ;
+C 233 ; WX 778 ; N Oslash ; B 34 -39 906 749 ;
+C 234 ; WX 1000 ; N OE ; B 90 -23 1107 741 ;
+C 235 ; WX 365 ; N ordmasculine ; B 92 262 471 729 ;
+C 241 ; WX 889 ; N ae ; B 54 -23 927 549 ;
+C 245 ; WX 278 ; N dotlessi ; B 67 0 322 540 ;
+C 248 ; WX 278 ; N lslash ; B 50 0 372 729 ;
+C 249 ; WX 611 ; N oslash ; B 12 -38 709 557 ;
+C 250 ; WX 944 ; N oe ; B 71 -23 986 549 ;
+C 251 ; WX 611 ; N germandbls ; B 67 -23 654 729 ;
+C -1 ; WX 722 ; N Udieresis ; B 119 -23 809 920 ;
+C -1 ; WX 722 ; N Uacute ; B 119 -23 809 936 ;
+C -1 ; WX 667 ; N Scedilla ; B 76 -220 725 741 ;
+C -1 ; WX 611 ; N Tcaron ; B 142 0 753 936 ;
+C -1 ; WX 667 ; N Scaron ; B 76 -23 725 936 ;
+C -1 ; WX 722 ; N Rcaron ; B 80 0 785 936 ;
+C -1 ; WX 722 ; N Racute ; B 80 0 785 936 ;
+C -1 ; WX 667 ; N Sacute ; B 76 -23 725 936 ;
+C -1 ; WX 778 ; N Otilde ; B 106 -23 828 923 ;
+C -1 ; WX 611 ; N ucircumflex ; B 88 -23 656 757 ;
+C -1 ; WX 778 ; N Ohungarumlaut ; B 106 -23 841 936 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 119 -23 809 936 ;
+C -1 ; WX 667 ; N Yacute ; B 182 0 805 936 ;
+C -1 ; WX 722 ; N Eth ; B 73 0 776 729 ;
+C -1 ; WX 722 ; N Dcroat ; B 73 0 776 729 ;
+C -1 ; WX 611 ; N Zacute ; B 30 0 733 936 ;
+C -1 ; WX 722 ; N Uring ; B 119 -23 809 953 ;
+C -1 ; WX 611 ; N gbreve ; B 26 -218 656 754 ;
+C -1 ; WX 556 ; N eogonek ; B 64 -233 591 549 ;
+C -1 ; WX 556 ; N edotaccent ; B 64 -23 591 741 ;
+C -1 ; WX 556 ; N ecaron ; B 64 -23 593 757 ;
+C -1 ; WX 722 ; N Ugrave ; B 119 -23 809 936 ;
+C -1 ; WX 667 ; N Thorn ; B 76 0 721 729 ;
+C -1 ; WX 556 ; N eacute ; B 64 -23 591 757 ;
+C -1 ; WX 556 ; N edieresis ; B 64 -23 591 741 ;
+C -1 ; WX 722 ; N dcaron ; B 79 -23 882 729 ;
+C -1 ; WX 556 ; N ccedilla ; B 77 -220 597 549 ;
+C -1 ; WX 556 ; N ccaron ; B 77 -23 607 757 ;
+C -1 ; WX 556 ; N cacute ; B 77 -23 597 757 ;
+C -1 ; WX 556 ; N aogonek ; B 50 -233 578 549 ;
+C -1 ; WX 556 ; N aring ; B 50 -23 578 773 ;
+C -1 ; WX 556 ; N atilde ; B 50 -23 612 744 ;
+C -1 ; WX 556 ; N abreve ; B 50 -23 578 754 ;
+C -1 ; WX 556 ; N egrave ; B 64 -23 591 757 ;
+C -1 ; WX 556 ; N agrave ; B 50 -23 578 757 ;
+C -1 ; WX 556 ; N aacute ; B 50 -23 587 757 ;
+C -1 ; WX 556 ; N adieresis ; B 50 -23 581 741 ;
+C -1 ; WX 722 ; N Uogonek ; B 119 -233 809 729 ;
+C -1 ; WX 611 ; N ugrave ; B 88 -23 656 757 ;
+C -1 ; WX 611 ; N uacute ; B 88 -23 656 757 ;
+C -1 ; WX 611 ; N udieresis ; B 88 -23 656 741 ;
+C -1 ; WX 404 ; N tcaron ; B 101 -23 578 829 ;
+C -1 ; WX 556 ; N scommaaccent ; B 60 -307 589 549 ;
+C -1 ; WX 611 ; N Zcaron ; B 30 0 733 936 ;
+C -1 ; WX 556 ; N ecircumflex ; B 64 -23 591 757 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 119 -23 809 936 ;
+C -1 ; WX 556 ; N acircumflex ; B 50 -23 578 757 ;
+C -1 ; WX 611 ; N Zdotaccent ; B 30 0 733 918 ;
+C -1 ; WX 556 ; N scaron ; B 60 -23 597 757 ;
+C -1 ; WX 722 ; N Amacron ; B 26 0 706 901 ;
+C -1 ; WX 556 ; N sacute ; B 60 -23 589 757 ;
+C -1 ; WX 611 ; N Tcommaaccent ; B 142 -307 753 729 ;
+C -1 ; WX 667 ; N Ydieresis ; B 182 0 805 920 ;
+C -1 ; WX 611 ; N thorn ; B 11 -218 637 729 ;
+C -1 ; WX 667 ; N Emacron ; B 79 0 762 901 ;
+C -1 ; WX 778 ; N Ograve ; B 106 -23 828 936 ;
+C -1 ; WX 778 ; N Oacute ; B 106 -23 828 936 ;
+C -1 ; WX 778 ; N Odieresis ; B 106 -23 828 920 ;
+C -1 ; WX 722 ; N Ntilde ; B 68 0 816 923 ;
+C -1 ; WX 722 ; N Ncaron ; B 68 0 816 936 ;
+C -1 ; WX 722 ; N Nacute ; B 68 0 816 936 ;
+C -1 ; WX 611 ; N Lcaron ; B 80 0 607 729 ;
+C -1 ; WX 611 ; N Lacute ; B 80 0 606 936 ;
+C -1 ; WX 278 ; N Idotaccent ; B 63 0 388 918 ;
+C -1 ; WX 389 ; N racute ; B 63 0 500 757 ;
+C -1 ; WX 278 ; N Icircumflex ; B 63 0 467 936 ;
+C -1 ; WX 611 ; N ohungarumlaut ; B 82 -23 710 757 ;
+C -1 ; WX 611 ; N otilde ; B 82 -23 639 744 ;
+C -1 ; WX 556 ; N Euro ; B 21 -23 648 724 ;
+C -1 ; WX 611 ; N ocircumflex ; B 82 -23 634 757 ;
+C -1 ; WX 444 ; N onesuperior ; B 210 284 438 709 ;
+C -1 ; WX 444 ; N twosuperior ; B 124 284 499 718 ;
+C -1 ; WX 444 ; N threesuperior ; B 147 271 490 718 ;
+C -1 ; WX 278 ; N Igrave ; B 63 0 368 936 ;
+C -1 ; WX 278 ; N Iacute ; B 63 0 489 936 ;
+C -1 ; WX 278 ; N Imacron ; B 63 0 466 901 ;
+C -1 ; WX 278 ; N Iogonek ; B 7 -233 368 729 ;
+C -1 ; WX 278 ; N Idieresis ; B 63 0 483 920 ;
+C -1 ; WX 778 ; N Gbreve ; B 107 -23 819 934 ;
+C -1 ; WX 722 ; N Umacron ; B 119 -23 809 901 ;
+C -1 ; WX 722 ; N Kcommaaccent ; B 74 -307 843 729 ;
+C -1 ; WX 611 ; N ograve ; B 82 -23 634 757 ;
+C -1 ; WX 667 ; N Scommaaccent ; B 76 -307 725 741 ;
+C -1 ; WX 667 ; N Eogonek ; B 79 -233 762 729 ;
+C -1 ; WX 611 ; N oacute ; B 82 -23 634 757 ;
+C -1 ; WX 667 ; N Edotaccent ; B 79 0 762 918 ;
+C -1 ; WX 268 ; N iogonek ; B 0 -233 351 729 ;
+C -1 ; WX 611 ; N gcommaaccent ; B 26 -218 656 854 ;
+C -1 ; WX 611 ; N odieresis ; B 82 -23 634 741 ;
+C -1 ; WX 611 ; N ntilde ; B 63 0 646 744 ;
+C -1 ; WX 611 ; N ncaron ; B 63 0 629 757 ;
+C -1 ; WX 667 ; N Ecaron ; B 79 0 762 936 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 79 0 762 936 ;
+C -1 ; WX 556 ; N scedilla ; B 60 -220 589 549 ;
+C -1 ; WX 389 ; N rcaron ; B 63 0 533 757 ;
+C -1 ; WX 667 ; N Egrave ; B 79 0 762 936 ;
+C -1 ; WX 667 ; N Eacute ; B 79 0 762 936 ;
+C -1 ; WX 778 ; N Gcommaaccent ; B 107 -307 819 741 ;
+C -1 ; WX 722 ; N Rcommaaccent ; B 80 -307 785 729 ;
+C -1 ; WX 667 ; N Edieresis ; B 79 0 762 920 ;
+C -1 ; WX 611 ; N nacute ; B 63 0 629 757 ;
+C -1 ; WX 611 ; N uogonek ; B 88 -233 656 540 ;
+C -1 ; WX 611 ; N umacron ; B 88 -23 656 722 ;
+C -1 ; WX 722 ; N Dcaron ; B 77 0 776 936 ;
+C -1 ; WX 384 ; N lcaron ; B 67 0 544 729 ;
+C -1 ; WX 722 ; N Ccaron ; B 107 -23 793 936 ;
+C -1 ; WX 722 ; N Cacute ; B 107 -23 793 936 ;
+C -1 ; WX 722 ; N Ccedilla ; B 107 -220 793 741 ;
+C -1 ; WX 606 ; N degree ; B 240 383 543 686 ;
+C -1 ; WX 722 ; N Aogonek ; B 26 -233 703 729 ;
+C -1 ; WX 584 ; N minus ; B 77 172 606 292 ;
+C -1 ; WX 584 ; N multiply ; B 102 18 582 444 ;
+C -1 ; WX 584 ; N divide ; B 77 0 606 462 ;
+C -1 ; WX 722 ; N Aring ; B 26 0 703 953 ;
+C -1 ; WX 1000 ; N trademark ; B 213 273 1087 729 ;
+C -1 ; WX 389 ; N rcommaaccent ; B 8 -307 487 549 ;
+C -1 ; WX 278 ; N lacute ; B 67 0 474 936 ;
+C -1 ; WX 611 ; N omacron ; B 82 -23 634 722 ;
+C -1 ; WX 722 ; N Atilde ; B 26 0 739 923 ;
+C -1 ; WX 278 ; N icircumflex ; B 67 0 426 757 ;
+C -1 ; WX 278 ; N igrave ; B 67 0 322 757 ;
+C -1 ; WX 611 ; N ncommaaccent ; B 63 -307 629 549 ;
+C -1 ; WX 278 ; N lcommaaccent ; B 11 -307 362 729 ;
+C -1 ; WX 584 ; N plusminus ; B 50 0 630 633 ;
+C -1 ; WX 1055 ; N onehalf ; B 210 -20 1050 715 ;
+C -1 ; WX 1055 ; N onequarter ; B 210 -20 1032 715 ;
+C -1 ; WX 1055 ; N threequarters ; B 147 -20 1032 718 ;
+C -1 ; WX 278 ; N iacute ; B 67 0 448 757 ;
+C -1 ; WX 722 ; N Abreve ; B 26 0 703 934 ;
+C -1 ; WX 556 ; N kcommaaccent ; B 59 -307 651 729 ;
+C -1 ; WX 778 ; N Omacron ; B 106 -23 828 901 ;
+C -1 ; WX 278 ; N imacron ; B 67 0 424 722 ;
+C -1 ; WX 556 ; N emacron ; B 64 -23 591 722 ;
+C -1 ; WX 556 ; N amacron ; B 50 -23 579 722 ;
+C -1 ; WX 333 ; N tcommaaccent ; B 62 -307 414 674 ;
+C -1 ; WX 556 ; N ydieresis ; B 37 -219 653 741 ;
+C -1 ; WX 500 ; N zdotaccent ; B 21 0 575 741 ;
+C -1 ; WX 500 ; N zcaron ; B 21 0 575 757 ;
+C -1 ; WX 500 ; N zacute ; B 21 0 575 757 ;
+C -1 ; WX 556 ; N yacute ; B 37 -219 653 757 ;
+C -1 ; WX 611 ; N uhungarumlaut ; B 88 -23 697 757 ;
+C -1 ; WX 611 ; N eth ; B 83 -23 633 744 ;
+C -1 ; WX 611 ; N uring ; B 88 -23 656 773 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 106 -23 828 936 ;
+C -1 ; WX 333 ; N commaaccent ; B 43 -307 217 -60 ;
+C -1 ; WX 737 ; N copyright ; B 54 -22 837 743 ;
+C -1 ; WX 737 ; N registered ; B 55 -22 837 743 ;
+C -1 ; WX 722 ; N Acircumflex ; B 26 0 703 936 ;
+C -1 ; WX 278 ; N idieresis ; B 67 0 442 741 ;
+C -1 ; WX 489 ; N lozenge ; B 95 0 541 744 ;
+C -1 ; WX 729 ; N Delta ; B 8 0 721 729 ;
+C -1 ; WX 584 ; N notequal ; B 61 -74 622 544 ;
+C -1 ; WX 542 ; N radical ; B 102 -36 705 913 ;
+C -1 ; WX 722 ; N Agrave ; B 26 0 703 936 ;
+C -1 ; WX 722 ; N Aacute ; B 26 0 714 936 ;
+C -1 ; WX 584 ; N lessequal ; B 35 0 657 624 ;
+C -1 ; WX 584 ; N greaterequal ; B 44 0 627 624 ;
+C -1 ; WX 584 ; N logicalnot ; B 103 86 632 376 ;
+C -1 ; WX 711 ; N summation ; B -18 -97 760 760 ;
+C -1 ; WX 490 ; N partialdiff ; B 22 -15 458 750 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B 68 -307 816 729 ;
+C -1 ; WX 611 ; N dcroat ; B 79 -23 746 729 ;
+C -1 ; WX 280 ; N brokenbar ; B 57 -200 335 729 ;
+C -1 ; WX 611 ; N Lcommaaccent ; B 80 -309 606 729 ;
+C -1 ; WX 722 ; N Adieresis ; B 26 0 708 920 ;
+C -1 ; WX 611 ; N mu ; B 11 -220 655 540 ;
+C -1 ; WX 278 ; N .notdef ; B 245 0 245 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 998
+KPX A C -36
+KPX A Ccedilla -36
+KPX A G -38
+KPX A O -37
+KPX A Odieresis -37
+KPX A Q -39
+KPX A T -91
+KPX A U -37
+KPX A Uacute -37
+KPX A Ucircumflex -37
+KPX A Udieresis -37
+KPX A Ugrave -37
+KPX A V -74
+KPX A W -57
+KPX A Y -96
+KPX A a -11
+KPX A b -10
+KPX A c -17
+KPX A ccedilla -17
+KPX A comma 9
+KPX A d -17
+KPX A e -10
+KPX A g -20
+KPX A guillemotleft -48
+KPX A guilsinglleft -44
+KPX A hyphen 2
+KPX A o -19
+KPX A period 13
+KPX A q -13
+KPX A quotedblright -71
+KPX A quoteright -67
+KPX A t -21
+KPX A u -17
+KPX A v -42
+KPX A w -28
+KPX A y -41
+KPX Aacute C -37
+KPX Aacute G -38
+KPX Aacute O -38
+KPX Aacute Q -40
+KPX Aacute T -91
+KPX Aacute U -38
+KPX Aacute V -74
+KPX Aacute W -57
+KPX Aacute Y -96
+KPX Aacute a -11
+KPX Aacute b -10
+KPX Aacute c -17
+KPX Aacute comma 9
+KPX Aacute d -17
+KPX Aacute e -11
+KPX Aacute g -20
+KPX Aacute guillemotleft -48
+KPX Aacute guilsinglleft -45
+KPX Aacute hyphen 2
+KPX Aacute o -20
+KPX Aacute period 12
+KPX Aacute q -14
+KPX Aacute quoteright -67
+KPX Aacute t -22
+KPX Aacute u -18
+KPX Aacute v -42
+KPX Aacute w -29
+KPX Aacute y -41
+KPX Acircumflex C -36
+KPX Acircumflex G -38
+KPX Acircumflex O -37
+KPX Acircumflex Q -39
+KPX Acircumflex T -91
+KPX Acircumflex U -37
+KPX Acircumflex V -74
+KPX Acircumflex W -57
+KPX Acircumflex Y -96
+KPX Acircumflex comma 9
+KPX Acircumflex period 13
+KPX Adieresis C -37
+KPX Adieresis G -38
+KPX Adieresis O -38
+KPX Adieresis Q -39
+KPX Adieresis T -91
+KPX Adieresis U -38
+KPX Adieresis V -74
+KPX Adieresis W -57
+KPX Adieresis Y -96
+KPX Adieresis a -11
+KPX Adieresis b -10
+KPX Adieresis c -17
+KPX Adieresis comma 9
+KPX Adieresis d -17
+KPX Adieresis g -20
+KPX Adieresis guillemotleft -48
+KPX Adieresis guilsinglleft -44
+KPX Adieresis hyphen 2
+KPX Adieresis o -20
+KPX Adieresis period 12
+KPX Adieresis q -13
+KPX Adieresis quotedblright -71
+KPX Adieresis quoteright -67
+KPX Adieresis t -22
+KPX Adieresis u -17
+KPX Adieresis v -42
+KPX Adieresis w -28
+KPX Adieresis y -41
+KPX Agrave C -36
+KPX Agrave G -38
+KPX Agrave O -37
+KPX Agrave Q -39
+KPX Agrave T -91
+KPX Agrave U -37
+KPX Agrave V -74
+KPX Agrave W -57
+KPX Agrave Y -96
+KPX Agrave comma 9
+KPX Agrave period 13
+KPX Aring C -36
+KPX Aring G -38
+KPX Aring O -37
+KPX Aring Q -39
+KPX Aring T -91
+KPX Aring U -37
+KPX Aring V -74
+KPX Aring W -57
+KPX Aring Y -96
+KPX Aring a -11
+KPX Aring b -10
+KPX Aring c -17
+KPX Aring comma 9
+KPX Aring d -17
+KPX Aring e -10
+KPX Aring g -20
+KPX Aring guillemotleft -48
+KPX Aring guilsinglleft -44
+KPX Aring hyphen 2
+KPX Aring o -19
+KPX Aring period 13
+KPX Aring q -13
+KPX Aring quotedblright -71
+KPX Aring quoteright -67
+KPX Aring t -21
+KPX Aring u -17
+KPX Aring v -42
+KPX Aring w -28
+KPX Aring y -41
+KPX Atilde C -38
+KPX Atilde G -40
+KPX Atilde O -39
+KPX Atilde Q -41
+KPX Atilde T -92
+KPX Atilde U -39
+KPX Atilde V -74
+KPX Atilde W -57
+KPX Atilde Y -96
+KPX Atilde comma 9
+KPX Atilde period 11
+KPX B A -41
+KPX B AE -30
+KPX B Aacute -41
+KPX B Acircumflex -41
+KPX B Adieresis -41
+KPX B Aring -41
+KPX B Atilde -41
+KPX B O -18
+KPX B OE -9
+KPX B Oacute -18
+KPX B Ocircumflex -18
+KPX B Odieresis -18
+KPX B Ograve -18
+KPX B Oslash -17
+KPX B V -46
+KPX B W -30
+KPX B Y -63
+KPX C A -34
+KPX C AE -23
+KPX C Aacute -34
+KPX C Adieresis -34
+KPX C Aring -34
+KPX C H -1
+KPX C K -4
+KPX C O -12
+KPX C Oacute -12
+KPX C Odieresis -12
+KPX Ccedilla A -34
+KPX D A -40
+KPX D Aacute -40
+KPX D Acircumflex -40
+KPX D Adieresis -40
+KPX D Agrave -40
+KPX D Aring -40
+KPX D Atilde -40
+KPX D J -4
+KPX D T -24
+KPX D V -37
+KPX D W -20
+KPX D X -40
+KPX D Y -62
+KPX F A -68
+KPX F Aacute -68
+KPX F Acircumflex -68
+KPX F Adieresis -68
+KPX F Agrave -68
+KPX F Aring -68
+KPX F Atilde -68
+KPX F J -33
+KPX F O -24
+KPX F Odieresis -24
+KPX F a -23
+KPX F aacute -23
+KPX F adieresis -23
+KPX F ae -26
+KPX F aring -23
+KPX F comma -84
+KPX F e -12
+KPX F eacute -12
+KPX F hyphen 4
+KPX F i -15
+KPX F j -17
+KPX F o -21
+KPX F oacute -21
+KPX F odieresis -21
+KPX F oe -16
+KPX F oslash -24
+KPX F period -82
+KPX F r -35
+KPX F u -32
+KPX G A -17
+KPX G AE -5
+KPX G Aacute -17
+KPX G Acircumflex -17
+KPX G Adieresis -17
+KPX G Agrave -17
+KPX G Aring -17
+KPX G Atilde -17
+KPX G T -28
+KPX G V -41
+KPX G W -25
+KPX G Y -65
+KPX J A -38
+KPX J AE -29
+KPX J Adieresis -38
+KPX J Aring -38
+KPX K C -59
+KPX K G -61
+KPX K O -60
+KPX K OE -51
+KPX K Oacute -60
+KPX K Odieresis -60
+KPX K S -45
+KPX K T 5
+KPX K a -17
+KPX K adieresis -17
+KPX K ae -17
+KPX K aring -17
+KPX K e -38
+KPX K hyphen -52
+KPX K o -45
+KPX K oacute -45
+KPX K odieresis -45
+KPX K u -35
+KPX K udieresis -35
+KPX K y -74
+KPX L A 0
+KPX L AE 12
+KPX L Aacute 0
+KPX L Adieresis 0
+KPX L Aring 0
+KPX L C -35
+KPX L Ccedilla -36
+KPX L G -40
+KPX L O -39
+KPX L Oacute -39
+KPX L Ocircumflex -39
+KPX L Odieresis -39
+KPX L Ograve -39
+KPX L Otilde -39
+KPX L S -14
+KPX L T -104
+KPX L U -35
+KPX L Udieresis -35
+KPX L V -102
+KPX L W -79
+KPX L Y -121
+KPX L hyphen -20
+KPX L quotedblright -147
+KPX L quoteright -143
+KPX L u -17
+KPX L udieresis -17
+KPX L y -64
+KPX N A -15
+KPX N AE -2
+KPX N Aacute -15
+KPX N Adieresis -15
+KPX N Aring -15
+KPX N C -1
+KPX N Ccedilla -1
+KPX N G -2
+KPX N O -2
+KPX N Oacute -2
+KPX N Odieresis -2
+KPX N a 5
+KPX N aacute 5
+KPX N adieresis 5
+KPX N ae 4
+KPX N aring 5
+KPX N comma 7
+KPX N e 10
+KPX N eacute 10
+KPX N o 1
+KPX N oacute 1
+KPX N odieresis 1
+KPX N oslash 2
+KPX N period 8
+KPX N u 4
+KPX N udieresis 4
+KPX O A -42
+KPX O AE -33
+KPX O Aacute -42
+KPX O Adieresis -42
+KPX O Aring -42
+KPX O T -32
+KPX O V -40
+KPX O W -24
+KPX O X -43
+KPX O Y -65
+KPX Oacute A -42
+KPX Oacute T -32
+KPX Oacute V -40
+KPX Oacute W -24
+KPX Oacute Y -65
+KPX Ocircumflex T -32
+KPX Ocircumflex V -40
+KPX Ocircumflex Y -65
+KPX Odieresis A -42
+KPX Odieresis T -32
+KPX Odieresis V -40
+KPX Odieresis W -24
+KPX Odieresis X -43
+KPX Odieresis Y -65
+KPX Ograve T -32
+KPX Ograve V -40
+KPX Ograve Y -65
+KPX Oslash A -34
+KPX Otilde T -32
+KPX Otilde V -40
+KPX Otilde Y -65
+KPX P A -71
+KPX P AE -62
+KPX P Aacute -71
+KPX P Adieresis -71
+KPX P Aring -71
+KPX P J -52
+KPX P a -14
+KPX P aacute -14
+KPX P adieresis -14
+KPX P ae -15
+KPX P aring -14
+KPX P comma -103
+KPX P e -13
+KPX P eacute -13
+KPX P hyphen -7
+KPX P o -22
+KPX P oacute -22
+KPX P odieresis -22
+KPX P oe -17
+KPX P oslash -26
+KPX P period -101
+KPX R C -12
+KPX R Ccedilla -12
+KPX R G -13
+KPX R O -13
+KPX R OE -3
+KPX R Oacute -13
+KPX R Odieresis -13
+KPX R T -12
+KPX R U -12
+KPX R Udieresis -12
+KPX R V -38
+KPX R W -22
+KPX R Y -50
+KPX R a -4
+KPX R aacute -4
+KPX R adieresis -4
+KPX R ae -5
+KPX R aring -4
+KPX R e 0
+KPX R eacute 0
+KPX R hyphen 10
+KPX R o -9
+KPX R oacute -9
+KPX R odieresis -9
+KPX R oe -4
+KPX R u -6
+KPX R uacute -6
+KPX R udieresis -6
+KPX R y -4
+KPX S A -26
+KPX S AE -14
+KPX S Aacute -26
+KPX S Adieresis -26
+KPX S Aring -26
+KPX S T -15
+KPX S V -36
+KPX S W -20
+KPX S Y -54
+KPX S t -4
+KPX T A -93
+KPX T AE -85
+KPX T Aacute -93
+KPX T Acircumflex -93
+KPX T Adieresis -93
+KPX T Agrave -93
+KPX T Aring -93
+KPX T Atilde -93
+KPX T C -29
+KPX T G -30
+KPX T J -95
+KPX T O -30
+KPX T OE -20
+KPX T Oacute -30
+KPX T Ocircumflex -30
+KPX T Odieresis -30
+KPX T Ograve -30
+KPX T Oslash -36
+KPX T Otilde -30
+KPX T S -7
+KPX T V 9
+KPX T W 15
+KPX T Y 7
+KPX T a -77
+KPX T ae -78
+KPX T c -79
+KPX T colon -104
+KPX T comma -75
+KPX T e -72
+KPX T g -79
+KPX T guillemotleft -107
+KPX T guilsinglleft -103
+KPX T hyphen -53
+KPX T i -9
+KPX T j -11
+KPX T o -81
+KPX T oslash -80
+KPX T period -73
+KPX T r -76
+KPX T s -81
+KPX T semicolon -105
+KPX T u -78
+KPX T v -91
+KPX T w -85
+KPX T y -89
+KPX U A -40
+KPX U AE -30
+KPX U Aacute -40
+KPX U Acircumflex -40
+KPX U Adieresis -40
+KPX U Aring -40
+KPX U Atilde -40
+KPX U comma -17
+KPX U m -3
+KPX U n -5
+KPX U p -3
+KPX U period -12
+KPX U r -5
+KPX Uacute A -40
+KPX Uacute comma -17
+KPX Uacute m -3
+KPX Uacute n -5
+KPX Uacute p -3
+KPX Uacute period -12
+KPX Uacute r -5
+KPX Ucircumflex A -40
+KPX Udieresis A -40
+KPX Udieresis b -4
+KPX Udieresis comma -17
+KPX Udieresis m -3
+KPX Udieresis n -5
+KPX Udieresis p -3
+KPX Udieresis period -12
+KPX Udieresis r -5
+KPX Ugrave A -40
+KPX V A -75
+KPX V AE -65
+KPX V Aacute -75
+KPX V Acircumflex -75
+KPX V Adieresis -75
+KPX V Agrave -75
+KPX V Aring -75
+KPX V Atilde -75
+KPX V C -43
+KPX V G -44
+KPX V O -44
+KPX V Oacute -44
+KPX V Ocircumflex -44
+KPX V Odieresis -44
+KPX V Ograve -44
+KPX V Oslash -42
+KPX V Otilde -44
+KPX V S -31
+KPX V T 12
+KPX V a -51
+KPX V ae -52
+KPX V colon -74
+KPX V comma -76
+KPX V e -46
+KPX V g -54
+KPX V guillemotleft -81
+KPX V guilsinglleft -77
+KPX V hyphen -26
+KPX V i -13
+KPX V o -56
+KPX V oslash -55
+KPX V period -74
+KPX V r -43
+KPX V semicolon -77
+KPX V u -42
+KPX V y -19
+KPX W A -59
+KPX W AE -50
+KPX W Aacute -59
+KPX W Acircumflex -59
+KPX W Adieresis -59
+KPX W Agrave -59
+KPX W Aring -59
+KPX W Atilde -59
+KPX W C -28
+KPX W G -29
+KPX W O -29
+KPX W Oacute -29
+KPX W Ocircumflex -29
+KPX W Odieresis -29
+KPX W Ograve -29
+KPX W Oslash -27
+KPX W Otilde -29
+KPX W S -22
+KPX W T 16
+KPX W a -34
+KPX W ae -34
+KPX W colon -61
+KPX W comma -53
+KPX W e -28
+KPX W g -36
+KPX W guillemotleft -63
+KPX W guilsinglleft -59
+KPX W hyphen -9
+KPX W i -9
+KPX W o -38
+KPX W oslash -37
+KPX W period -51
+KPX W r -33
+KPX W semicolon -63
+KPX W u -32
+KPX W y -9
+KPX X C -39
+KPX X O -40
+KPX X Odieresis -40
+KPX X Q -43
+KPX X a -17
+KPX X e -33
+KPX X hyphen -33
+KPX X o -43
+KPX X u -35
+KPX X y -48
+KPX Y A -91
+KPX Y AE -81
+KPX Y Aacute -91
+KPX Y Acircumflex -91
+KPX Y Adieresis -91
+KPX Y Agrave -91
+KPX Y Aring -91
+KPX Y Atilde -91
+KPX Y C -60
+KPX Y G -61
+KPX Y O -61
+KPX Y Oacute -61
+KPX Y Ocircumflex -61
+KPX Y Odieresis -61
+KPX Y Ograve -61
+KPX Y Oslash -58
+KPX Y Otilde -61
+KPX Y S -39
+KPX Y T 14
+KPX Y a -71
+KPX Y ae -71
+KPX Y colon -90
+KPX Y comma -85
+KPX Y e -66
+KPX Y g -73
+KPX Y guillemotleft -105
+KPX Y guilsinglleft -101
+KPX Y hyphen -55
+KPX Y i -11
+KPX Y o -76
+KPX Y oslash -74
+KPX Y p -53
+KPX Y period -84
+KPX Y semicolon -93
+KPX Y u -57
+KPX Y v -36
+KPX Z v -21
+KPX Z y -19
+KPX a j -7
+KPX a quoteright -14
+KPX a v -23
+KPX a w -10
+KPX a y -24
+KPX aacute v -23
+KPX aacute w -10
+KPX aacute y -24
+KPX adieresis v -23
+KPX adieresis w -10
+KPX adieresis y -24
+KPX ae v -21
+KPX ae w -7
+KPX ae y -23
+KPX agrave v -23
+KPX agrave w -10
+KPX agrave y -24
+KPX aring v -23
+KPX aring w -10
+KPX aring y -24
+KPX b v -23
+KPX b w -9
+KPX b y -25
+KPX c h -9
+KPX c k -5
+KPX comma one -79
+KPX comma quotedblright -39
+KPX comma quoteright -35
+KPX e quoteright -13
+KPX e t -9
+KPX e v -22
+KPX e w -9
+KPX e x -25
+KPX e y -25
+KPX eacute v -22
+KPX eacute w -9
+KPX eacute y -25
+KPX ecircumflex v -22
+KPX ecircumflex w -9
+KPX ecircumflex y -25
+KPX eight four 2
+KPX eight one -32
+KPX eight seven -15
+KPX f a -6
+KPX f aacute -6
+KPX f adieresis -6
+KPX f ae -6
+KPX f aring -6
+KPX f e -6
+KPX f eacute -6
+KPX f f 14
+KPX f i -13
+KPX f j -15
+KPX f l -13
+KPX f o -16
+KPX f oacute -16
+KPX f odieresis -16
+KPX f oe -11
+KPX f oslash -16
+KPX f quoteright 0
+KPX f s -10
+KPX f t 14
+KPX five four -3
+KPX five one -37
+KPX five seven -17
+KPX four four 0
+KPX four one -55
+KPX four seven -33
+KPX g a -3
+KPX g adieresis -3
+KPX g ae -4
+KPX g aring -3
+KPX g e 1
+KPX g eacute 1
+KPX g l -5
+KPX g oacute -8
+KPX g odieresis -8
+KPX g r -3
+KPX guillemotright A -56
+KPX guillemotright AE -46
+KPX guillemotright Aacute -56
+KPX guillemotright Adieresis -56
+KPX guillemotright Aring -56
+KPX guillemotright T -115
+KPX guillemotright V -84
+KPX guillemotright W -65
+KPX guillemotright Y -117
+KPX guilsinglright A -52
+KPX guilsinglright AE -42
+KPX guilsinglright Aacute -52
+KPX guilsinglright Adieresis -52
+KPX guilsinglright Aring -52
+KPX guilsinglright T -110
+KPX guilsinglright V -79
+KPX guilsinglright W -60
+KPX guilsinglright Y -113
+KPX h quoteright -15
+KPX h y -25
+KPX hyphen A -7
+KPX hyphen AE 2
+KPX hyphen Aacute -7
+KPX hyphen Adieresis -7
+KPX hyphen Aring -7
+KPX hyphen T -64
+KPX hyphen V -34
+KPX hyphen W -15
+KPX hyphen Y -71
+KPX i T -12
+KPX i j -7
+KPX k a -13
+KPX k aacute -13
+KPX k adieresis -13
+KPX k ae -15
+KPX k aring -13
+KPX k comma -3
+KPX k e -19
+KPX k eacute -19
+KPX k g -26
+KPX k hyphen -31
+KPX k o -28
+KPX k oacute -28
+KPX k odieresis -28
+KPX k period -3
+KPX k s -23
+KPX k u -8
+KPX k udieresis -8
+KPX l v -14
+KPX l y -11
+KPX m p -1
+KPX m v -23
+KPX m w -9
+KPX m y -23
+KPX n T -87
+KPX n p -2
+KPX n quoteright -15
+KPX n v -24
+KPX n w -11
+KPX n y -25
+KPX nine four -6
+KPX nine one -30
+KPX nine seven -23
+KPX o T -90
+KPX o quoteright -19
+KPX o t -13
+KPX o v -27
+KPX o w -13
+KPX o x -30
+KPX o y -29
+KPX oacute v -27
+KPX oacute w -13
+KPX oacute y -29
+KPX ocircumflex t -13
+KPX odieresis t -13
+KPX odieresis v -27
+KPX odieresis w -13
+KPX odieresis x -30
+KPX odieresis y -29
+KPX ograve v -27
+KPX ograve w -13
+KPX ograve y -29
+KPX one comma -51
+KPX one eight -47
+KPX one five -50
+KPX one four -70
+KPX one nine -47
+KPX one one -92
+KPX one period -49
+KPX one seven -72
+KPX one six -48
+KPX one three -53
+KPX one two -56
+KPX one zero -44
+KPX p t -10
+KPX p y -25
+KPX period one -80
+KPX period quotedblright -39
+KPX period quoteright -35
+KPX q c -3
+KPX q u -3
+KPX quotedblbase A 7
+KPX quotedblbase AE 19
+KPX quotedblbase T -79
+KPX quotedblbase V -77
+KPX quotedblbase W -54
+KPX quotedblbase Y -96
+KPX quotedblleft A -72
+KPX quotedblleft AE -64
+KPX quotedblleft Aacute -72
+KPX quotedblleft Adieresis -72
+KPX quotedblleft Aring -72
+KPX quotedblleft T -11
+KPX quotedblleft V 0
+KPX quotedblleft W 9
+KPX quotedblleft Y -15
+KPX quotedblright A -72
+KPX quotedblright AE -64
+KPX quotedblright Aacute -72
+KPX quotedblright Adieresis -72
+KPX quotedblright Aring -72
+KPX quotedblright T -7
+KPX quotedblright V 1
+KPX quotedblright W 11
+KPX quotedblright Y -14
+KPX quoteleft A -76
+KPX quoteleft AE -69
+KPX quoteleft Aacute -76
+KPX quoteleft Adieresis -76
+KPX quoteleft Aring -76
+KPX quoteleft T -15
+KPX quoteleft V -4
+KPX quoteleft W 5
+KPX quoteleft Y -20
+KPX quoteright A -80
+KPX quoteright AE -72
+KPX quoteright Aacute -80
+KPX quoteright Adieresis -80
+KPX quoteright Aring -80
+KPX quoteright comma -53
+KPX quoteright d -30
+KPX quoteright o -34
+KPX quoteright period -51
+KPX quoteright r -20
+KPX quoteright s -27
+KPX quoteright t -11
+KPX quoteright v -11
+KPX quoteright w -4
+KPX quoteright y -9
+KPX r a -1
+KPX r aacute -1
+KPX r acircumflex -1
+KPX r adieresis -1
+KPX r ae -2
+KPX r agrave -1
+KPX r aring -1
+KPX r c -6
+KPX r ccedilla -6
+KPX r colon -36
+KPX r comma -64
+KPX r d -5
+KPX r e 2
+KPX r eacute 2
+KPX r ecircumflex 2
+KPX r egrave 2
+KPX r f 15
+KPX r g -7
+KPX r h -12
+KPX r hyphen -40
+KPX r i -12
+KPX r j -13
+KPX r k -8
+KPX r l -12
+KPX r m -8
+KPX r n -10
+KPX r o -7
+KPX r oacute -7
+KPX r ocircumflex -7
+KPX r odieresis -7
+KPX r oe -2
+KPX r ograve -7
+KPX r oslash -12
+KPX r p -7
+KPX r period -63
+KPX r q -2
+KPX r quoteright 4
+KPX r r -10
+KPX r s -4
+KPX r semicolon -37
+KPX r t 15
+KPX r u -8
+KPX r v 12
+KPX r w 17
+KPX r x 7
+KPX r y 14
+KPX r z 2
+KPX s quoteright -12
+KPX s t -9
+KPX seven colon -71
+KPX seven comma -95
+KPX seven eight -10
+KPX seven five -28
+KPX seven four -70
+KPX seven one -21
+KPX seven period -94
+KPX seven seven 2
+KPX seven six -21
+KPX seven three -7
+KPX seven two -11
+KPX six four -1
+KPX six one -29
+KPX six seven -13
+KPX t S -9
+KPX t a -3
+KPX t aacute -3
+KPX t adieresis -3
+KPX t ae -5
+KPX t aring -3
+KPX t colon -41
+KPX t e -5
+KPX t eacute -5
+KPX t h -9
+KPX t o -15
+KPX t oacute -15
+KPX t odieresis -15
+KPX t quoteright -3
+KPX t semicolon -42
+KPX three four -2
+KPX three one -34
+KPX three seven -19
+KPX two four -16
+KPX two one -24
+KPX two seven -12
+KPX u quoteright -8
+KPX v a -21
+KPX v aacute -21
+KPX v acircumflex -21
+KPX v adieresis -21
+KPX v ae -21
+KPX v agrave -21
+KPX v aring -21
+KPX v atilde -21
+KPX v c -25
+KPX v colon -41
+KPX v comma -57
+KPX v e -18
+KPX v eacute -18
+KPX v ecircumflex -18
+KPX v egrave -18
+KPX v g -26
+KPX v hyphen -5
+KPX v l -12
+KPX v o -28
+KPX v oacute -28
+KPX v odieresis -28
+KPX v ograve -28
+KPX v oslash -28
+KPX v period -55
+KPX v s -25
+KPX v semicolon -43
+KPX w a -11
+KPX w aacute -11
+KPX w acircumflex -11
+KPX w adieresis -11
+KPX w ae -12
+KPX w agrave -11
+KPX w aring -11
+KPX w atilde -11
+KPX w c -12
+KPX w colon -36
+KPX w comma -38
+KPX w e -5
+KPX w eacute -5
+KPX w ecircumflex -5
+KPX w egrave -5
+KPX w g -13
+KPX w hyphen 7
+KPX w l -8
+KPX w o -15
+KPX w oacute -15
+KPX w odieresis -15
+KPX w ograve -15
+KPX w oslash -14
+KPX w period -36
+KPX w s -15
+KPX w semicolon -38
+KPX x a -22
+KPX x c -27
+KPX x e -20
+KPX x eacute -20
+KPX x o -30
+KPX x q -23
+KPX y a -20
+KPX y aacute -20
+KPX y acircumflex -20
+KPX y adieresis -20
+KPX y ae -20
+KPX y agrave -20
+KPX y aring -20
+KPX y atilde -20
+KPX y c -26
+KPX y colon -40
+KPX y comma -58
+KPX y e -19
+KPX y eacute -19
+KPX y ecircumflex -19
+KPX y egrave -19
+KPX y g -27
+KPX y hyphen -4
+KPX y l -11
+KPX y o -28
+KPX y oacute -28
+KPX y odieresis -28
+KPX y ograve -28
+KPX y oslash -27
+KPX y period -55
+KPX y s -24
+KPX y semicolon -43
+KPX zero four -3
+KPX zero one -29
+KPX zero seven -21
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/pdf2swf/fonts/n019024l.pfb b/pdf2swf/fonts/n019024l.pfb
new file mode 100644
index 00000000..47990408
--- /dev/null
+++ b/pdf2swf/fonts/n019024l.pfb
Binary files differ
diff --git a/pdf2swf/fonts/n021003l.afm b/pdf2swf/fonts/n021003l.afm
new file mode 100644
index 00000000..95759a53
--- /dev/null
+++ b/pdf2swf/fonts/n021003l.afm
@@ -0,0 +1,1341 @@
+StartFontMetrics 3.0
+Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development
+Comment Creation Date: 12/22/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName NimbusRomNo9L-Regu
+FullName Nimbus Roman No9 L Regular
+FamilyName Nimbus Roman No9 L
+Weight Regular
+ItalicAngle 0.0
+IsFixedPitch false
+UnderlinePosition -100
+UnderlineThickness 50
+Version 1.05
+Notice (URW)++,Copyright 1999 by (URW)++ Design & Development
+EncodingScheme AdobeStandardEncoding
+FontBBox -168 -281 1000 924
+CapHeight 662
+XHeight 450
+Descender -217
+Ascender 683
+StartCharMetrics 316
+C 32 ; WX 250 ; N space ; B 125 0 125 0 ;
+C 33 ; WX 333 ; N exclam ; B 130 -9 237 676 ;
+C 34 ; WX 408 ; N quotedbl ; B 77 431 331 676 ;
+C 35 ; WX 500 ; N numbersign ; B 5 0 496 662 ;
+C 36 ; WX 500 ; N dollar ; B 44 -87 457 727 ;
+C 37 ; WX 833 ; N percent ; B 61 -13 772 676 ;
+C 38 ; WX 778 ; N ampersand ; B 42 -13 750 676 ;
+C 39 ; WX 333 ; N quoteright ; B 79 433 218 676 ;
+C 40 ; WX 333 ; N parenleft ; B 48 -177 304 676 ;
+C 41 ; WX 333 ; N parenright ; B 29 -177 285 676 ;
+C 42 ; WX 500 ; N asterisk ; B 69 265 432 676 ;
+C 43 ; WX 564 ; N plus ; B 30 0 534 506 ;
+C 44 ; WX 250 ; N comma ; B 56 -141 195 102 ;
+C 45 ; WX 333 ; N hyphen ; B 39 194 285 257 ;
+C 46 ; WX 250 ; N period ; B 70 -11 181 100 ;
+C 47 ; WX 278 ; N slash ; B -9 -14 287 676 ;
+C 48 ; WX 500 ; N zero ; B 24 -14 476 676 ;
+C 49 ; WX 500 ; N one ; B 111 0 394 676 ;
+C 50 ; WX 500 ; N two ; B 30 0 475 676 ;
+C 51 ; WX 500 ; N three ; B 43 -14 432 676 ;
+C 52 ; WX 500 ; N four ; B 12 0 472 676 ;
+C 53 ; WX 500 ; N five ; B 32 -14 438 688 ;
+C 54 ; WX 500 ; N six ; B 34 -14 468 684 ;
+C 55 ; WX 500 ; N seven ; B 20 -8 449 662 ;
+C 56 ; WX 500 ; N eight ; B 56 -14 445 676 ;
+C 57 ; WX 500 ; N nine ; B 30 -22 459 676 ;
+C 58 ; WX 278 ; N colon ; B 81 -11 192 459 ;
+C 59 ; WX 278 ; N semicolon ; B 80 -141 219 459 ;
+C 60 ; WX 564 ; N less ; B 28 -10 536 516 ;
+C 61 ; WX 564 ; N equal ; B 30 120 534 386 ;
+C 62 ; WX 564 ; N greater ; B 28 -10 536 516 ;
+C 63 ; WX 444 ; N question ; B 68 -8 414 676 ;
+C 64 ; WX 921 ; N at ; B 116 -14 809 676 ;
+C 65 ; WX 722 ; N A ; B 15 0 706 674 ;
+C 66 ; WX 667 ; N B ; B 17 0 593 662 ;
+C 67 ; WX 667 ; N C ; B 28 -14 633 676 ;
+C 68 ; WX 722 ; N D ; B 16 0 685 662 ;
+C 69 ; WX 611 ; N E ; B 12 0 597 662 ;
+C 70 ; WX 556 ; N F ; B 12 0 546 662 ;
+C 71 ; WX 722 ; N G ; B 32 -14 709 676 ;
+C 72 ; WX 722 ; N H ; B 19 0 702 662 ;
+C 73 ; WX 333 ; N I ; B 18 0 315 662 ;
+C 74 ; WX 389 ; N J ; B 10 -14 370 662 ;
+C 75 ; WX 722 ; N K ; B 34 0 723 662 ;
+C 76 ; WX 611 ; N L ; B 12 0 598 662 ;
+C 77 ; WX 889 ; N M ; B 12 0 863 662 ;
+C 78 ; WX 722 ; N N ; B 12 -11 707 662 ;
+C 79 ; WX 722 ; N O ; B 34 -14 688 676 ;
+C 80 ; WX 556 ; N P ; B 16 0 542 662 ;
+C 81 ; WX 722 ; N Q ; B 34 -178 701 676 ;
+C 82 ; WX 667 ; N R ; B 17 0 659 662 ;
+C 83 ; WX 556 ; N S ; B 42 -14 491 676 ;
+C 84 ; WX 611 ; N T ; B 17 0 593 662 ;
+C 85 ; WX 722 ; N U ; B 14 -14 705 662 ;
+C 86 ; WX 722 ; N V ; B 16 -11 697 662 ;
+C 87 ; WX 944 ; N W ; B 5 -11 932 662 ;
+C 88 ; WX 722 ; N X ; B 10 0 704 662 ;
+C 89 ; WX 722 ; N Y ; B 22 0 703 662 ;
+C 90 ; WX 611 ; N Z ; B 9 0 597 662 ;
+C 91 ; WX 333 ; N bracketleft ; B 88 -156 299 662 ;
+C 92 ; WX 278 ; N backslash ; B -9 -14 287 676 ;
+C 93 ; WX 333 ; N bracketright ; B 34 -156 245 662 ;
+C 94 ; WX 469 ; N asciicircum ; B 24 297 446 662 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 333 ; N quoteleft ; B 115 433 254 676 ;
+C 97 ; WX 444 ; N a ; B 37 -10 442 460 ;
+C 98 ; WX 500 ; N b ; B 3 -10 468 683 ;
+C 99 ; WX 444 ; N c ; B 25 -10 412 460 ;
+C 100 ; WX 500 ; N d ; B 27 -10 491 683 ;
+C 101 ; WX 444 ; N e ; B 25 -10 424 460 ;
+C 102 ; WX 333 ; N f ; B 20 0 383 683 ;
+C 103 ; WX 500 ; N g ; B 28 -218 470 460 ;
+C 104 ; WX 500 ; N h ; B 9 0 487 683 ;
+C 105 ; WX 278 ; N i ; B 16 0 253 683 ;
+C 106 ; WX 278 ; N j ; B -70 -218 194 683 ;
+C 107 ; WX 500 ; N k ; B 7 0 505 683 ;
+C 108 ; WX 278 ; N l ; B 19 0 257 683 ;
+C 109 ; WX 778 ; N m ; B 16 0 775 460 ;
+C 110 ; WX 500 ; N n ; B 16 0 485 460 ;
+C 111 ; WX 500 ; N o ; B 29 -10 470 460 ;
+C 112 ; WX 500 ; N p ; B 5 -217 470 460 ;
+C 113 ; WX 500 ; N q ; B 24 -217 488 461 ;
+C 114 ; WX 333 ; N r ; B 5 0 335 460 ;
+C 115 ; WX 389 ; N s ; B 51 -10 348 459 ;
+C 116 ; WX 278 ; N t ; B 13 -10 279 579 ;
+C 117 ; WX 500 ; N u ; B 9 -10 479 450 ;
+C 118 ; WX 500 ; N v ; B 19 -14 477 450 ;
+C 119 ; WX 722 ; N w ; B 21 -14 694 450 ;
+C 120 ; WX 500 ; N x ; B 17 0 479 450 ;
+C 121 ; WX 500 ; N y ; B 14 -218 475 450 ;
+C 122 ; WX 444 ; N z ; B 27 0 418 450 ;
+C 123 ; WX 480 ; N braceleft ; B 100 -181 350 680 ;
+C 124 ; WX 200 ; N bar ; B 67 -14 133 676 ;
+C 125 ; WX 480 ; N braceright ; B 130 -181 380 680 ;
+C 126 ; WX 541 ; N asciitilde ; B 40 186 502 320 ;
+C 161 ; WX 333 ; N exclamdown ; B 97 -218 204 469 ;
+C 162 ; WX 500 ; N cent ; B 53 -138 448 579 ;
+C 163 ; WX 500 ; N sterling ; B 12 -8 490 676 ;
+C 164 ; WX 167 ; N fraction ; B -168 -14 331 676 ;
+C 165 ; WX 500 ; N yen ; B -53 0 512 662 ;
+C 166 ; WX 500 ; N florin ; B 7 -189 490 676 ;
+C 167 ; WX 500 ; N section ; B 70 -148 426 676 ;
+C 168 ; WX 500 ; N currency ; B -22 58 522 602 ;
+C 169 ; WX 180 ; N quotesingle ; B 48 431 133 676 ;
+C 170 ; WX 444 ; N quotedblleft ; B 43 433 414 676 ;
+C 171 ; WX 500 ; N guillemotleft ; B 42 33 456 416 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 63 33 285 416 ;
+C 173 ; WX 333 ; N guilsinglright ; B 48 33 270 416 ;
+C 174 ; WX 556 ; N fi ; B 31 0 521 683 ;
+C 175 ; WX 556 ; N fl ; B 32 0 521 683 ;
+C 177 ; WX 500 ; N endash ; B 0 201 500 250 ;
+C 178 ; WX 500 ; N dagger ; B 59 -149 443 676 ;
+C 179 ; WX 500 ; N daggerdbl ; B 58 -153 442 676 ;
+C 180 ; WX 250 ; N periodcentered ; B 70 199 181 310 ;
+C 182 ; WX 453 ; N paragraph ; B -22 -154 450 662 ;
+C 183 ; WX 350 ; N bullet ; B 40 196 310 466 ;
+C 184 ; WX 333 ; N quotesinglbase ; B 79 -141 218 102 ;
+C 185 ; WX 444 ; N quotedblbase ; B 45 -141 416 102 ;
+C 186 ; WX 444 ; N quotedblright ; B 30 433 401 676 ;
+C 187 ; WX 500 ; N guillemotright ; B 44 33 458 416 ;
+C 188 ; WX 1000 ; N ellipsis ; B 111 -11 888 100 ;
+C 189 ; WX 1000 ; N perthousand ; B 7 -19 994 706 ;
+C 191 ; WX 444 ; N questiondown ; B 30 -218 376 468 ;
+C 193 ; WX 333 ; N grave ; B 19 507 242 678 ;
+C 194 ; WX 333 ; N acute ; B 93 507 317 678 ;
+C 195 ; WX 333 ; N circumflex ; B 11 507 322 674 ;
+C 196 ; WX 333 ; N tilde ; B 1 532 331 638 ;
+C 197 ; WX 333 ; N macron ; B 11 547 322 601 ;
+C 198 ; WX 333 ; N breve ; B 26 507 307 664 ;
+C 199 ; WX 333 ; N dotaccent ; B 118 523 217 622 ;
+C 200 ; WX 333 ; N dieresis ; B 18 523 316 622 ;
+C 202 ; WX 333 ; N ring ; B 67 512 266 711 ;
+C 203 ; WX 333 ; N cedilla ; B 52 -215 261 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B -3 507 377 678 ;
+C 206 ; WX 333 ; N ogonek ; B 64 -165 249 0 ;
+C 207 ; WX 333 ; N caron ; B 11 507 322 674 ;
+C 208 ; WX 1000 ; N emdash ; B 0 201 1000 250 ;
+C 225 ; WX 889 ; N AE ; B 0 0 863 662 ;
+C 227 ; WX 276 ; N ordfeminine ; B 4 394 270 676 ;
+C 232 ; WX 611 ; N Lslash ; B 12 0 598 662 ;
+C 233 ; WX 722 ; N Oslash ; B 34 -80 688 734 ;
+C 234 ; WX 889 ; N OE ; B 30 -6 885 668 ;
+C 235 ; WX 310 ; N ordmasculine ; B 6 394 304 676 ;
+C 241 ; WX 667 ; N ae ; B 38 -10 632 460 ;
+C 245 ; WX 278 ; N dotlessi ; B 16 0 253 460 ;
+C 248 ; WX 278 ; N lslash ; B 19 0 259 683 ;
+C 249 ; WX 500 ; N oslash ; B 29 -112 470 551 ;
+C 250 ; WX 722 ; N oe ; B 30 -10 690 460 ;
+C 251 ; WX 500 ; N germandbls ; B 12 -9 468 683 ;
+C -1 ; WX 722 ; N Udieresis ; B 14 -14 705 834 ;
+C -1 ; WX 722 ; N Uacute ; B 14 -14 705 890 ;
+C -1 ; WX 556 ; N Scedilla ; B 42 -215 491 676 ;
+C -1 ; WX 611 ; N Tcaron ; B 17 0 593 886 ;
+C -1 ; WX 556 ; N Scaron ; B 42 -14 491 886 ;
+C -1 ; WX 667 ; N Rcaron ; B 17 0 659 886 ;
+C -1 ; WX 667 ; N Racute ; B 17 0 659 890 ;
+C -1 ; WX 556 ; N Sacute ; B 42 -14 491 890 ;
+C -1 ; WX 722 ; N Otilde ; B 34 -14 688 850 ;
+C -1 ; WX 500 ; N ucircumflex ; B 9 -10 479 674 ;
+C -1 ; WX 722 ; N Ohungarumlaut ; B 34 -14 688 890 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 14 -14 705 890 ;
+C -1 ; WX 722 ; N Yacute ; B 22 0 703 890 ;
+C -1 ; WX 722 ; N Eth ; B 16 0 685 662 ;
+C -1 ; WX 722 ; N Dcroat ; B 16 0 685 662 ;
+C -1 ; WX 611 ; N Zacute ; B 9 0 597 890 ;
+C -1 ; WX 722 ; N Uring ; B 14 -14 705 923 ;
+C -1 ; WX 500 ; N gbreve ; B 28 -218 470 664 ;
+C -1 ; WX 444 ; N eogonek ; B 25 -165 424 460 ;
+C -1 ; WX 444 ; N edotaccent ; B 25 -10 424 622 ;
+C -1 ; WX 444 ; N ecaron ; B 25 -10 424 674 ;
+C -1 ; WX 722 ; N Ugrave ; B 14 -14 705 890 ;
+C -1 ; WX 556 ; N Thorn ; B 16 0 542 662 ;
+C -1 ; WX 444 ; N eacute ; B 25 -10 424 678 ;
+C -1 ; WX 444 ; N edieresis ; B 25 -10 424 622 ;
+C -1 ; WX 600 ; N dcaron ; B 27 -10 599 683 ;
+C -1 ; WX 444 ; N ccedilla ; B 25 -215 412 460 ;
+C -1 ; WX 444 ; N ccaron ; B 25 -10 412 674 ;
+C -1 ; WX 444 ; N cacute ; B 25 -10 412 678 ;
+C -1 ; WX 444 ; N aogonek ; B 37 -165 444 460 ;
+C -1 ; WX 444 ; N aring ; B 37 -10 442 721 ;
+C -1 ; WX 444 ; N atilde ; B 37 -10 442 638 ;
+C -1 ; WX 444 ; N abreve ; B 37 -10 442 664 ;
+C -1 ; WX 444 ; N egrave ; B 25 -10 424 678 ;
+C -1 ; WX 444 ; N agrave ; B 37 -10 442 678 ;
+C -1 ; WX 444 ; N aacute ; B 37 -10 442 678 ;
+C -1 ; WX 444 ; N adieresis ; B 37 -10 442 622 ;
+C -1 ; WX 722 ; N Uogonek ; B 14 -165 705 662 ;
+C -1 ; WX 500 ; N ugrave ; B 9 -10 479 678 ;
+C -1 ; WX 500 ; N uacute ; B 9 -10 479 678 ;
+C -1 ; WX 500 ; N udieresis ; B 9 -10 479 622 ;
+C -1 ; WX 278 ; N tcaron ; B 13 -10 300 676 ;
+C -1 ; WX 389 ; N scommaaccent ; B 51 -281 348 459 ;
+C -1 ; WX 611 ; N Zcaron ; B 9 0 597 886 ;
+C -1 ; WX 444 ; N ecircumflex ; B 25 -10 424 674 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 14 -14 705 886 ;
+C -1 ; WX 444 ; N acircumflex ; B 37 -10 442 674 ;
+C -1 ; WX 611 ; N Zdotaccent ; B 9 0 597 834 ;
+C -1 ; WX 389 ; N scaron ; B 39 -10 350 674 ;
+C -1 ; WX 722 ; N Amacron ; B 15 0 706 813 ;
+C -1 ; WX 389 ; N sacute ; B 51 -10 365 678 ;
+C -1 ; WX 611 ; N Tcommaaccent ; B 17 -281 593 662 ;
+C -1 ; WX 722 ; N Ydieresis ; B 22 0 703 834 ;
+C -1 ; WX 500 ; N thorn ; B 5 -217 470 683 ;
+C -1 ; WX 611 ; N Emacron ; B 12 0 597 813 ;
+C -1 ; WX 722 ; N Ograve ; B 34 -14 688 890 ;
+C -1 ; WX 722 ; N Oacute ; B 34 -14 688 890 ;
+C -1 ; WX 722 ; N Odieresis ; B 34 -14 688 834 ;
+C -1 ; WX 722 ; N Ntilde ; B 12 -11 707 850 ;
+C -1 ; WX 722 ; N Ncaron ; B 12 -11 707 886 ;
+C -1 ; WX 722 ; N Nacute ; B 12 -11 707 890 ;
+C -1 ; WX 611 ; N Lcaron ; B 12 0 598 676 ;
+C -1 ; WX 611 ; N Lacute ; B 12 0 598 890 ;
+C -1 ; WX 333 ; N Idotaccent ; B 18 0 315 834 ;
+C -1 ; WX 333 ; N racute ; B 5 0 335 678 ;
+C -1 ; WX 333 ; N Icircumflex ; B 11 0 322 886 ;
+C -1 ; WX 500 ; N ohungarumlaut ; B 29 -10 470 678 ;
+C -1 ; WX 500 ; N otilde ; B 29 -10 470 638 ;
+C -1 ; WX 500 ; N Euro ; B -16 -14 477 674 ;
+C -1 ; WX 500 ; N ocircumflex ; B 29 -10 470 674 ;
+C -1 ; WX 300 ; N onesuperior ; B 57 270 248 676 ;
+C -1 ; WX 300 ; N twosuperior ; B 1 270 296 676 ;
+C -1 ; WX 300 ; N threesuperior ; B 14 262 291 676 ;
+C -1 ; WX 333 ; N Igrave ; B 18 0 315 890 ;
+C -1 ; WX 333 ; N Iacute ; B 18 0 317 890 ;
+C -1 ; WX 333 ; N Imacron ; B 11 0 322 813 ;
+C -1 ; WX 333 ; N Iogonek ; B 18 -165 397 662 ;
+C -1 ; WX 333 ; N Idieresis ; B 18 0 316 834 ;
+C -1 ; WX 722 ; N Gbreve ; B 32 -14 709 876 ;
+C -1 ; WX 722 ; N Umacron ; B 14 -14 705 813 ;
+C -1 ; WX 722 ; N Kcommaaccent ; B 34 -281 723 662 ;
+C -1 ; WX 500 ; N ograve ; B 29 -10 470 678 ;
+C -1 ; WX 556 ; N Scommaaccent ; B 42 -281 491 676 ;
+C -1 ; WX 611 ; N Eogonek ; B 12 -165 611 662 ;
+C -1 ; WX 500 ; N oacute ; B 29 -10 470 678 ;
+C -1 ; WX 611 ; N Edotaccent ; B 12 0 597 834 ;
+C -1 ; WX 278 ; N iogonek ; B 16 -165 278 683 ;
+C -1 ; WX 500 ; N gcommaaccent ; B 28 -218 470 736 ;
+C -1 ; WX 500 ; N odieresis ; B 29 -10 470 622 ;
+C -1 ; WX 500 ; N ntilde ; B 16 0 485 638 ;
+C -1 ; WX 500 ; N ncaron ; B 16 0 485 674 ;
+C -1 ; WX 611 ; N Ecaron ; B 12 0 597 886 ;
+C -1 ; WX 611 ; N Ecircumflex ; B 12 0 597 886 ;
+C -1 ; WX 389 ; N scedilla ; B 51 -215 348 459 ;
+C -1 ; WX 333 ; N rcaron ; B 5 0 335 674 ;
+C -1 ; WX 611 ; N Egrave ; B 12 0 597 890 ;
+C -1 ; WX 611 ; N Eacute ; B 12 0 597 890 ;
+C -1 ; WX 722 ; N Gcommaaccent ; B 32 -281 709 676 ;
+C -1 ; WX 667 ; N Rcommaaccent ; B 17 -281 659 662 ;
+C -1 ; WX 611 ; N Edieresis ; B 12 0 597 834 ;
+C -1 ; WX 500 ; N nacute ; B 16 0 485 678 ;
+C -1 ; WX 500 ; N uogonek ; B 9 -165 500 450 ;
+C -1 ; WX 500 ; N umacron ; B 9 -10 479 601 ;
+C -1 ; WX 722 ; N Dcaron ; B 16 0 685 886 ;
+C -1 ; WX 348 ; N lcaron ; B 19 0 348 683 ;
+C -1 ; WX 667 ; N Ccaron ; B 28 -14 633 886 ;
+C -1 ; WX 667 ; N Cacute ; B 28 -14 633 890 ;
+C -1 ; WX 667 ; N Ccedilla ; B 28 -215 633 676 ;
+C -1 ; WX 400 ; N degree ; B 57 390 343 676 ;
+C -1 ; WX 722 ; N Aogonek ; B 15 -165 786 674 ;
+C -1 ; WX 564 ; N minus ; B 30 220 534 286 ;
+C -1 ; WX 564 ; N multiply ; B 38 8 527 497 ;
+C -1 ; WX 564 ; N divide ; B 30 -10 534 516 ;
+C -1 ; WX 722 ; N Aring ; B 15 0 706 915 ;
+C -1 ; WX 980 ; N trademark ; B 30 256 957 662 ;
+C -1 ; WX 333 ; N rcommaaccent ; B 5 -281 335 460 ;
+C -1 ; WX 278 ; N lacute ; B 19 0 290 890 ;
+C -1 ; WX 500 ; N omacron ; B 29 -10 470 601 ;
+C -1 ; WX 722 ; N Atilde ; B 15 0 706 850 ;
+C -1 ; WX 278 ; N icircumflex ; B -16 0 295 674 ;
+C -1 ; WX 278 ; N igrave ; B -8 0 253 678 ;
+C -1 ; WX 500 ; N ncommaaccent ; B 16 -281 485 460 ;
+C -1 ; WX 278 ; N lcommaaccent ; B 19 -281 257 683 ;
+C -1 ; WX 564 ; N plusminus ; B 30 0 534 568 ;
+C -1 ; WX 750 ; N onehalf ; B 31 -14 746 676 ;
+C -1 ; WX 750 ; N onequarter ; B 37 -14 718 676 ;
+C -1 ; WX 750 ; N threequarters ; B 15 -14 718 676 ;
+C -1 ; WX 278 ; N iacute ; B 16 0 290 678 ;
+C -1 ; WX 722 ; N Abreve ; B 15 0 706 876 ;
+C -1 ; WX 500 ; N kcommaaccent ; B 7 -281 505 683 ;
+C -1 ; WX 722 ; N Omacron ; B 34 -14 688 813 ;
+C -1 ; WX 278 ; N imacron ; B -16 0 292 601 ;
+C -1 ; WX 444 ; N emacron ; B 25 -10 424 601 ;
+C -1 ; WX 444 ; N amacron ; B 37 -10 442 601 ;
+C -1 ; WX 278 ; N tcommaaccent ; B 13 -281 279 579 ;
+C -1 ; WX 500 ; N ydieresis ; B 14 -218 475 622 ;
+C -1 ; WX 444 ; N zdotaccent ; B 27 0 418 622 ;
+C -1 ; WX 444 ; N zcaron ; B 27 0 418 674 ;
+C -1 ; WX 444 ; N zacute ; B 27 0 418 678 ;
+C -1 ; WX 500 ; N yacute ; B 14 -218 475 678 ;
+C -1 ; WX 500 ; N uhungarumlaut ; B 9 -10 479 678 ;
+C -1 ; WX 500 ; N eth ; B 29 -10 471 686 ;
+C -1 ; WX 500 ; N uring ; B 9 -10 479 711 ;
+C -1 ; WX 722 ; N Ocircumflex ; B 34 -14 688 886 ;
+C -1 ; WX 333 ; N commaaccent ; B 97 -281 236 -38 ;
+C -1 ; WX 760 ; N copyright ; B 38 -14 722 676 ;
+C -1 ; WX 760 ; N registered ; B 38 -14 722 676 ;
+C -1 ; WX 722 ; N Acircumflex ; B 15 0 706 886 ;
+C -1 ; WX 278 ; N idieresis ; B 11 0 269 622 ;
+C -1 ; WX 494 ; N lozenge ; B 18 0 466 740 ;
+C -1 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C -1 ; WX 564 ; N notequal ; B 30 -3 534 509 ;
+C -1 ; WX 549 ; N radical ; B -2 -65 526 924 ;
+C -1 ; WX 722 ; N Agrave ; B 15 0 706 890 ;
+C -1 ; WX 722 ; N Aacute ; B 15 0 706 890 ;
+C -1 ; WX 564 ; N lessequal ; B 28 0 536 628 ;
+C -1 ; WX 564 ; N greaterequal ; B 28 0 536 628 ;
+C -1 ; WX 564 ; N logicalnot ; B 30 108 534 386 ;
+C -1 ; WX 713 ; N summation ; B 14 -123 695 752 ;
+C -1 ; WX 494 ; N partialdiff ; B 26 -10 462 753 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B 12 -281 707 662 ;
+C -1 ; WX 500 ; N dcroat ; B 27 -10 500 683 ;
+C -1 ; WX 200 ; N brokenbar ; B 67 -14 133 676 ;
+C -1 ; WX 611 ; N Lcommaaccent ; B 12 -281 598 662 ;
+C -1 ; WX 722 ; N Adieresis ; B 15 0 706 834 ;
+C -1 ; WX 500 ; N mu ; B 36 -218 512 450 ;
+C -1 ; WX 250 ; N .notdef ; B 125 0 125 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 998
+KPX A C -51
+KPX A Ccedilla -57
+KPX A G -57
+KPX A O -60
+KPX A Odieresis -60
+KPX A Q -60
+KPX A T -54
+KPX A U -62
+KPX A Uacute -62
+KPX A Ucircumflex -62
+KPX A Udieresis -62
+KPX A Ugrave -62
+KPX A V -131
+KPX A W -113
+KPX A Y -81
+KPX A a -6
+KPX A b -20
+KPX A c -29
+KPX A ccedilla -29
+KPX A comma -3
+KPX A d -28
+KPX A e -27
+KPX A g -20
+KPX A guillemotleft -64
+KPX A guilsinglleft -74
+KPX A hyphen -23
+KPX A o -40
+KPX A period -10
+KPX A q -21
+KPX A quotedblright -91
+KPX A quoteright -116
+KPX A t -20
+KPX A u -28
+KPX A v -81
+KPX A w -73
+KPX A y -83
+KPX Aacute C -51
+KPX Aacute G -57
+KPX Aacute O -60
+KPX Aacute Q -60
+KPX Aacute T -54
+KPX Aacute U -62
+KPX Aacute V -131
+KPX Aacute W -113
+KPX Aacute Y -81
+KPX Aacute a -6
+KPX Aacute b -20
+KPX Aacute c -29
+KPX Aacute comma -3
+KPX Aacute d -28
+KPX Aacute e -27
+KPX Aacute g -20
+KPX Aacute guillemotleft -64
+KPX Aacute guilsinglleft -74
+KPX Aacute hyphen -23
+KPX Aacute o -40
+KPX Aacute period -10
+KPX Aacute q -21
+KPX Aacute quoteright -116
+KPX Aacute t -20
+KPX Aacute u -28
+KPX Aacute v -81
+KPX Aacute w -73
+KPX Aacute y -83
+KPX Acircumflex C -51
+KPX Acircumflex G -57
+KPX Acircumflex O -60
+KPX Acircumflex Q -60
+KPX Acircumflex T -54
+KPX Acircumflex U -62
+KPX Acircumflex V -131
+KPX Acircumflex W -113
+KPX Acircumflex Y -81
+KPX Acircumflex comma -3
+KPX Acircumflex period -10
+KPX Adieresis C -51
+KPX Adieresis G -57
+KPX Adieresis O -60
+KPX Adieresis Q -60
+KPX Adieresis T -54
+KPX Adieresis U -62
+KPX Adieresis V -131
+KPX Adieresis W -113
+KPX Adieresis Y -81
+KPX Adieresis a -6
+KPX Adieresis b -20
+KPX Adieresis c -29
+KPX Adieresis comma -3
+KPX Adieresis d -28
+KPX Adieresis g -20
+KPX Adieresis guillemotleft -64
+KPX Adieresis guilsinglleft -74
+KPX Adieresis hyphen -23
+KPX Adieresis o -40
+KPX Adieresis period -10
+KPX Adieresis q -21
+KPX Adieresis quotedblright -91
+KPX Adieresis quoteright -116
+KPX Adieresis t -20
+KPX Adieresis u -28
+KPX Adieresis v -81
+KPX Adieresis w -73
+KPX Adieresis y -83
+KPX Agrave C -51
+KPX Agrave G -57
+KPX Agrave O -60
+KPX Agrave Q -60
+KPX Agrave T -54
+KPX Agrave U -62
+KPX Agrave V -131
+KPX Agrave W -113
+KPX Agrave Y -81
+KPX Agrave comma -3
+KPX Agrave period -10
+KPX Aring C -51
+KPX Aring G -57
+KPX Aring O -60
+KPX Aring Q -60
+KPX Aring T -54
+KPX Aring U -62
+KPX Aring V -131
+KPX Aring W -113
+KPX Aring Y -81
+KPX Aring a -6
+KPX Aring b -20
+KPX Aring c -29
+KPX Aring comma -3
+KPX Aring d -28
+KPX Aring e -27
+KPX Aring g -20
+KPX Aring guillemotleft -64
+KPX Aring guilsinglleft -74
+KPX Aring hyphen -23
+KPX Aring o -40
+KPX Aring period -10
+KPX Aring q -21
+KPX Aring quotedblright -91
+KPX Aring quoteright -116
+KPX Aring t -20
+KPX Aring u -28
+KPX Aring v -81
+KPX Aring w -73
+KPX Aring y -83
+KPX Atilde C -51
+KPX Atilde G -57
+KPX Atilde O -60
+KPX Atilde Q -60
+KPX Atilde T -54
+KPX Atilde U -62
+KPX Atilde V -131
+KPX Atilde W -113
+KPX Atilde Y -81
+KPX Atilde comma -3
+KPX Atilde period -10
+KPX B A -51
+KPX B AE -44
+KPX B Aacute -51
+KPX B Acircumflex -51
+KPX B Adieresis -51
+KPX B Aring -51
+KPX B Atilde -51
+KPX B O -24
+KPX B OE -18
+KPX B Oacute -24
+KPX B Ocircumflex -24
+KPX B Odieresis -24
+KPX B Ograve -24
+KPX B Oslash -23
+KPX B V -65
+KPX B W -59
+KPX B Y -68
+KPX C A -23
+KPX C AE -15
+KPX C Aacute -23
+KPX C Adieresis -23
+KPX C Aring -23
+KPX C H -2
+KPX C K -10
+KPX C O -12
+KPX C Oacute -12
+KPX C Odieresis -12
+KPX Ccedilla A -27
+KPX D A -67
+KPX D Aacute -67
+KPX D Acircumflex -67
+KPX D Adieresis -67
+KPX D Agrave -67
+KPX D Aring -67
+KPX D Atilde -67
+KPX D J -41
+KPX D T -10
+KPX D V -71
+KPX D W -57
+KPX D X -64
+KPX D Y -74
+KPX F A -71
+KPX F Aacute -71
+KPX F Acircumflex -71
+KPX F Adieresis -71
+KPX F Agrave -71
+KPX F Aring -71
+KPX F Atilde -71
+KPX F J -13
+KPX F O -10
+KPX F Odieresis -10
+KPX F a -34
+KPX F aacute -34
+KPX F adieresis -10
+KPX F ae -36
+KPX F aring -34
+KPX F comma -51
+KPX F e -19
+KPX F eacute -19
+KPX F hyphen 3
+KPX F i -13
+KPX F j -20
+KPX F o -21
+KPX F oacute -21
+KPX F odieresis -21
+KPX F oe -21
+KPX F oslash -21
+KPX F period -58
+KPX F r -10
+KPX F u -11
+KPX G A -26
+KPX G AE -19
+KPX G Aacute -26
+KPX G Acircumflex -26
+KPX G Adieresis -26
+KPX G Agrave -26
+KPX G Aring -26
+KPX G Atilde -26
+KPX G T -21
+KPX G V -23
+KPX G W -18
+KPX G Y -26
+KPX J A -53
+KPX J AE -46
+KPX J Adieresis -53
+KPX J Aring -53
+KPX K C -43
+KPX K G -49
+KPX K O -51
+KPX K OE -44
+KPX K Oacute -51
+KPX K Odieresis -51
+KPX K S 1
+KPX K T 0
+KPX K a 2
+KPX K adieresis 2
+KPX K ae 0
+KPX K aring 2
+KPX K e -19
+KPX K hyphen -63
+KPX K o -31
+KPX K oacute -31
+KPX K odieresis -31
+KPX K u -19
+KPX K udieresis -19
+KPX K y -86
+KPX L A 0
+KPX L AE 6
+KPX L Aacute 0
+KPX L Adieresis 0
+KPX L Aring 0
+KPX L C 2
+KPX L Ccedilla 0
+KPX L G 0
+KPX L O -3
+KPX L Oacute -3
+KPX L Ocircumflex -3
+KPX L Odieresis -3
+KPX L Ograve -3
+KPX L Otilde -3
+KPX L S 5
+KPX L T -73
+KPX L U -26
+KPX L Udieresis -26
+KPX L V -115
+KPX L W -89
+KPX L Y -100
+KPX L hyphen 25
+KPX L quotedblright -100
+KPX L quoteright -125
+KPX L u -10
+KPX L udieresis -10
+KPX L y -56
+KPX N A -28
+KPX N AE -21
+KPX N Aacute -28
+KPX N Adieresis -28
+KPX N Aring -28
+KPX N C -16
+KPX N Ccedilla -16
+KPX N G -19
+KPX N O -20
+KPX N Oacute -20
+KPX N Odieresis -20
+KPX N a -27
+KPX N aacute -27
+KPX N adieresis -27
+KPX N ae -27
+KPX N aring -27
+KPX N comma -14
+KPX N e -17
+KPX N eacute -17
+KPX N o -21
+KPX N oacute -21
+KPX N odieresis -21
+KPX N oslash -20
+KPX N period -21
+KPX N u -25
+KPX N udieresis -25
+KPX O A -58
+KPX O AE -50
+KPX O Aacute -58
+KPX O Adieresis -58
+KPX O Aring -58
+KPX O T -9
+KPX O V -69
+KPX O W -54
+KPX O X -55
+KPX O Y -72
+KPX Oacute A -58
+KPX Oacute T -9
+KPX Oacute V -69
+KPX Oacute W -54
+KPX Oacute Y -72
+KPX Ocircumflex T -9
+KPX Ocircumflex V -69
+KPX Ocircumflex Y -72
+KPX Odieresis A -58
+KPX Odieresis T -9
+KPX Odieresis V -69
+KPX Odieresis W -54
+KPX Odieresis X -55
+KPX Odieresis Y -72
+KPX Ograve T -9
+KPX Ograve V -69
+KPX Ograve Y -72
+KPX Oslash A -58
+KPX Otilde T -9
+KPX Otilde V -69
+KPX Otilde Y -72
+KPX P A -90
+KPX P AE -91
+KPX P Aacute -90
+KPX P Adieresis -90
+KPX P Aring -90
+KPX P J -52
+KPX P a -17
+KPX P aacute -17
+KPX P adieresis -17
+KPX P ae -18
+KPX P aring -17
+KPX P comma -94
+KPX P e -23
+KPX P eacute -23
+KPX P hyphen -37
+KPX P o -25
+KPX P oacute -25
+KPX P odieresis -25
+KPX P oe -25
+KPX P oslash -25
+KPX P period -101
+KPX R C -41
+KPX R Ccedilla -41
+KPX R G -44
+KPX R O -45
+KPX R OE -39
+KPX R Oacute -45
+KPX R Odieresis -45
+KPX R T -34
+KPX R U -56
+KPX R Udieresis -55
+KPX R V -73
+KPX R W -67
+KPX R Y -76
+KPX R a -2
+KPX R aacute -2
+KPX R adieresis -2
+KPX R ae -5
+KPX R aring -2
+KPX R e -23
+KPX R eacute -23
+KPX R hyphen -52
+KPX R o -36
+KPX R oacute -36
+KPX R odieresis -36
+KPX R oe -31
+KPX R u -24
+KPX R uacute -24
+KPX R udieresis -24
+KPX R y -37
+KPX S A -37
+KPX S AE -30
+KPX S Aacute -37
+KPX S Adieresis -37
+KPX S Aring -37
+KPX S T -19
+KPX S V -27
+KPX S W -21
+KPX S Y -30
+KPX S t -20
+KPX T A -53
+KPX T AE -45
+KPX T Aacute -53
+KPX T Acircumflex -53
+KPX T Adieresis -53
+KPX T Agrave -53
+KPX T Aring -53
+KPX T Atilde -53
+KPX T C -8
+KPX T G -11
+KPX T J -18
+KPX T O -10
+KPX T OE -4
+KPX T Oacute -10
+KPX T Ocircumflex -10
+KPX T Odieresis -10
+KPX T Ograve -10
+KPX T Oslash -10
+KPX T Otilde -10
+KPX T S -10
+KPX T V 14
+KPX T W 20
+KPX T Y 11
+KPX T a -77
+KPX T ae -80
+KPX T c -87
+KPX T colon -87
+KPX T comma -74
+KPX T e -86
+KPX T g -91
+KPX T guillemotleft -114
+KPX T guilsinglleft -125
+KPX T hyphen -73
+KPX T i -18
+KPX T j -25
+KPX T o -90
+KPX T oslash -89
+KPX T period -82
+KPX T r -50
+KPX T s -73
+KPX T semicolon -87
+KPX T u -93
+KPX T v -105
+KPX T w -106
+KPX T y -102
+KPX U A -65
+KPX U AE -58
+KPX U Aacute -65
+KPX U Acircumflex -65
+KPX U Adieresis -65
+KPX U Aring -65
+KPX U Atilde -65
+KPX U comma -31
+KPX U m -33
+KPX U n -31
+KPX U p -28
+KPX U period -37
+KPX U r -27
+KPX Uacute A -65
+KPX Uacute comma -31
+KPX Uacute m -33
+KPX Uacute n -31
+KPX Uacute p -28
+KPX Uacute period -37
+KPX Uacute r -27
+KPX Ucircumflex A -65
+KPX Udieresis A -65
+KPX Udieresis b 21
+KPX Udieresis comma -31
+KPX Udieresis m -33
+KPX Udieresis n -31
+KPX Udieresis p -28
+KPX Udieresis period -37
+KPX Udieresis r -27
+KPX Ugrave A -65
+KPX V A -124
+KPX V AE -104
+KPX V Aacute -124
+KPX V Acircumflex -124
+KPX V Adieresis -124
+KPX V Agrave -124
+KPX V Aring -124
+KPX V Atilde -124
+KPX V C -63
+KPX V G -66
+KPX V O -67
+KPX V Oacute -67
+KPX V Ocircumflex -67
+KPX V Odieresis -67
+KPX V Ograve -67
+KPX V Oslash -65
+KPX V Otilde -67
+KPX V S -47
+KPX V T 10
+KPX V a -88
+KPX V ae -89
+KPX V colon -90
+KPX V comma -105
+KPX V e -85
+KPX V g -101
+KPX V guillemotleft -109
+KPX V guilsinglleft -119
+KPX V hyphen -69
+KPX V i -20
+KPX V o -89
+KPX V oslash -88
+KPX V period -112
+KPX V r -56
+KPX V semicolon -89
+KPX V u -51
+KPX V y -54
+KPX W A -113
+KPX W AE -98
+KPX W Aacute -113
+KPX W Acircumflex -113
+KPX W Adieresis -113
+KPX W Agrave -113
+KPX W Aring -113
+KPX W Atilde -113
+KPX W C -53
+KPX W G -56
+KPX W O -56
+KPX W Oacute -56
+KPX W Ocircumflex -56
+KPX W Odieresis -56
+KPX W Ograve -56
+KPX W Oslash -55
+KPX W Otilde -56
+KPX W S -41
+KPX W T 17
+KPX W a -80
+KPX W ae -81
+KPX W colon -81
+KPX W comma -89
+KPX W e -72
+KPX W g -91
+KPX W guillemotleft -97
+KPX W guilsinglleft -107
+KPX W hyphen -56
+KPX W i -13
+KPX W o -76
+KPX W oslash -75
+KPX W period -96
+KPX W r -47
+KPX W semicolon -81
+KPX W u -43
+KPX W y -45
+KPX X C -52
+KPX X O -61
+KPX X Odieresis -61
+KPX X Q -61
+KPX X a -7
+KPX X e -28
+KPX X hyphen -54
+KPX X o -41
+KPX X u -29
+KPX X y -96
+KPX Y A -74
+KPX Y AE -67
+KPX Y Aacute -74
+KPX Y Acircumflex -74
+KPX Y Adieresis -74
+KPX Y Agrave -74
+KPX Y Aring -74
+KPX Y Atilde -74
+KPX Y C -68
+KPX Y G -71
+KPX Y O -69
+KPX Y Oacute -69
+KPX Y Ocircumflex -69
+KPX Y Odieresis -69
+KPX Y Ograve -69
+KPX Y Oslash -69
+KPX Y Otilde -69
+KPX Y S -44
+KPX Y T 13
+KPX Y a -99
+KPX Y ae -102
+KPX Y colon -109
+KPX Y comma -96
+KPX Y e -103
+KPX Y g -113
+KPX Y guillemotleft -135
+KPX Y guilsinglleft -145
+KPX Y hyphen -98
+KPX Y i -17
+KPX Y o -107
+KPX Y oslash -106
+KPX Y p -88
+KPX Y period -103
+KPX Y semicolon -108
+KPX Y u -78
+KPX Y v -86
+KPX Z v -48
+KPX Z y -50
+KPX a j -26
+KPX a quoteright -40
+KPX a v -30
+KPX a w -31
+KPX a y -32
+KPX aacute v -30
+KPX aacute w -31
+KPX aacute y -32
+KPX adieresis v -30
+KPX adieresis w -31
+KPX adieresis y -32
+KPX ae v -27
+KPX ae w -28
+KPX ae y -30
+KPX agrave v -30
+KPX agrave w -31
+KPX agrave y -32
+KPX aring v -30
+KPX aring w -31
+KPX aring y -32
+KPX b v -29
+KPX b w -30
+KPX b y -32
+KPX c h -15
+KPX c k -19
+KPX comma one -52
+KPX comma quotedblright -29
+KPX comma quoteright -53
+KPX e quoteright -30
+KPX e t -10
+KPX e v -27
+KPX e w -28
+KPX e x -35
+KPX e y -30
+KPX eacute v -27
+KPX eacute w -28
+KPX eacute y -30
+KPX ecircumflex v -27
+KPX ecircumflex w -28
+KPX ecircumflex y -30
+KPX eight four 0
+KPX eight one -64
+KPX eight seven -15
+KPX f a -25
+KPX f aacute -25
+KPX f adieresis 12
+KPX f ae -25
+KPX f aring -6
+KPX f e -34
+KPX f eacute -34
+KPX f f 6
+KPX f i 15
+KPX f j 8
+KPX f l 44
+KPX f o -38
+KPX f oacute -38
+KPX f odieresis -1
+KPX f oe -36
+KPX f oslash -37
+KPX f quoteright 17
+KPX f s -21
+KPX f t 10
+KPX five four -8
+KPX five one -70
+KPX five seven -36
+KPX four four 14
+KPX four one -75
+KPX four seven -42
+KPX g a -17
+KPX g adieresis -17
+KPX g ae -18
+KPX g aring -17
+KPX g e -25
+KPX g eacute -25
+KPX g l -7
+KPX g oacute -26
+KPX g odieresis -26
+KPX g r 11
+KPX guillemotright A -62
+KPX guillemotright AE -61
+KPX guillemotright Aacute -62
+KPX guillemotright Adieresis -62
+KPX guillemotright Aring -62
+KPX guillemotright T -114
+KPX guillemotright V -117
+KPX guillemotright W -95
+KPX guillemotright Y -138
+KPX guilsinglright A -72
+KPX guilsinglright AE -71
+KPX guilsinglright Aacute -72
+KPX guilsinglright Adieresis -72
+KPX guilsinglright Aring -72
+KPX guilsinglright T -124
+KPX guilsinglright V -128
+KPX guilsinglright W -105
+KPX guilsinglright Y -149
+KPX h quoteright -38
+KPX h y -30
+KPX hyphen A -26
+KPX hyphen AE -25
+KPX hyphen Aacute -26
+KPX hyphen Adieresis -26
+KPX hyphen Aring -26
+KPX hyphen T -77
+KPX hyphen V -82
+KPX hyphen W -59
+KPX hyphen Y -108
+KPX i T -28
+KPX i j -36
+KPX k a 1
+KPX k aacute 1
+KPX k adieresis 1
+KPX k ae -1
+KPX k aring 1
+KPX k comma 4
+KPX k e -19
+KPX k eacute -19
+KPX k g -12
+KPX k hyphen -65
+KPX k o -32
+KPX k oacute -32
+KPX k odieresis -32
+KPX k period -2
+KPX k s 5
+KPX k u 14
+KPX k udieresis 14
+KPX l v -28
+KPX l y -25
+KPX m p -9
+KPX m v -30
+KPX m w -31
+KPX m y -31
+KPX n T -55
+KPX n p -13
+KPX n quoteright -39
+KPX n v -30
+KPX n w -31
+KPX n y -31
+KPX nine four -7
+KPX nine one -63
+KPX nine seven -6
+KPX o T -91
+KPX o quoteright -34
+KPX o t -9
+KPX o v -36
+KPX o w -36
+KPX o x -36
+KPX o y -41
+KPX oacute v -36
+KPX oacute w -36
+KPX oacute y -41
+KPX ocircumflex t -9
+KPX odieresis t -9
+KPX odieresis v -36
+KPX odieresis w -36
+KPX odieresis x -36
+KPX odieresis y -41
+KPX ograve v -36
+KPX ograve w -36
+KPX ograve y -41
+KPX one comma -48
+KPX one eight -68
+KPX one five -37
+KPX one four -72
+KPX one nine -61
+KPX one one -78
+KPX one period -55
+KPX one seven -78
+KPX one six -66
+KPX one three -41
+KPX one two -34
+KPX one zero -54
+KPX p t -6
+KPX p y -28
+KPX period one -61
+KPX period quotedblright -33
+KPX period quoteright -58
+KPX q c -7
+KPX q u -12
+KPX quotedblbase A 12
+KPX quotedblbase AE 19
+KPX quotedblbase T -60
+KPX quotedblbase V -104
+KPX quotedblbase W -76
+KPX quotedblbase Y -87
+KPX quotedblleft A -86
+KPX quotedblleft AE -91
+KPX quotedblleft Aacute -86
+KPX quotedblleft Adieresis -86
+KPX quotedblleft Aring -86
+KPX quotedblleft T 14
+KPX quotedblleft V 1
+KPX quotedblleft W 7
+KPX quotedblleft Y -1
+KPX quotedblright A -94
+KPX quotedblright AE -99
+KPX quotedblright Aacute -94
+KPX quotedblright Adieresis -94
+KPX quotedblright Aring -94
+KPX quotedblright T 11
+KPX quotedblright V 0
+KPX quotedblright W 6
+KPX quotedblright Y -2
+KPX quoteleft A -110
+KPX quoteleft AE -115
+KPX quoteleft Aacute -110
+KPX quoteleft Adieresis -110
+KPX quoteleft Aring -110
+KPX quoteleft T -9
+KPX quoteleft V -23
+KPX quoteleft W -17
+KPX quoteleft Y -26
+KPX quoteright A -130
+KPX quoteright AE -135
+KPX quoteright Aacute -130
+KPX quoteright Adieresis -130
+KPX quoteright Aring -130
+KPX quoteright comma -71
+KPX quoteright d -56
+KPX quoteright o -54
+KPX quoteright period -78
+KPX quoteright r -44
+KPX quoteright s -47
+KPX quoteright t -43
+KPX quoteright v -47
+KPX quoteright w -47
+KPX quoteright y -45
+KPX r a -1
+KPX r aacute -1
+KPX r acircumflex -1
+KPX r adieresis -1
+KPX r ae -3
+KPX r agrave -1
+KPX r aring -1
+KPX r c -8
+KPX r ccedilla -8
+KPX r colon -7
+KPX r comma -41
+KPX r d -10
+KPX r e -6
+KPX r eacute -6
+KPX r ecircumflex -6
+KPX r egrave -6
+KPX r f 19
+KPX r g -15
+KPX r h -6
+KPX r hyphen -46
+KPX r i 20
+KPX r j 14
+KPX r k -10
+KPX r l -18
+KPX r m 20
+KPX r n 22
+KPX r o -8
+KPX r oacute -8
+KPX r ocircumflex -8
+KPX r odieresis -8
+KPX r oe -7
+KPX r ograve -8
+KPX r oslash -7
+KPX r p 25
+KPX r period -48
+KPX r q -10
+KPX r quoteright -19
+KPX r r 26
+KPX r s 0
+KPX r semicolon -7
+KPX r t 23
+KPX r u 19
+KPX r v 20
+KPX r w 19
+KPX r x 17
+KPX r y 22
+KPX r z 2
+KPX s quoteright -38
+KPX s t -15
+KPX seven colon -68
+KPX seven comma -72
+KPX seven eight -40
+KPX seven five -59
+KPX seven four -63
+KPX seven one -56
+KPX seven period -79
+KPX seven seven -20
+KPX seven six -46
+KPX seven three -35
+KPX seven two -31
+KPX six four 12
+KPX six one -74
+KPX six seven -29
+KPX t S 2
+KPX t a 10
+KPX t aacute 10
+KPX t adieresis 10
+KPX t ae 9
+KPX t aring 10
+KPX t colon -8
+KPX t e 0
+KPX t eacute 0
+KPX t h 10
+KPX t o -8
+KPX t oacute -8
+KPX t odieresis -8
+KPX t quoteright -29
+KPX t semicolon -8
+KPX three four -6
+KPX three one -75
+KPX three seven -28
+KPX two four 0
+KPX two one -60
+KPX two seven -16
+KPX u quoteright -36
+KPX v a -24
+KPX v aacute -24
+KPX v acircumflex -24
+KPX v adieresis -24
+KPX v ae -24
+KPX v agrave -24
+KPX v aring -24
+KPX v atilde -24
+KPX v c -37
+KPX v colon -20
+KPX v comma -69
+KPX v e -36
+KPX v eacute -36
+KPX v ecircumflex -36
+KPX v egrave -36
+KPX v g -41
+KPX v hyphen -28
+KPX v l -31
+KPX v o -38
+KPX v oacute -38
+KPX v odieresis -38
+KPX v ograve -38
+KPX v oslash -38
+KPX v period -76
+KPX v s -21
+KPX v semicolon -20
+KPX w a -27
+KPX w aacute -27
+KPX w acircumflex -27
+KPX w adieresis -27
+KPX w ae -27
+KPX w agrave -27
+KPX w aring -27
+KPX w atilde -27
+KPX w c -33
+KPX w colon -23
+KPX w comma -64
+KPX w e -31
+KPX w eacute -31
+KPX w ecircumflex -31
+KPX w egrave -31
+KPX w g -43
+KPX w hyphen -24
+KPX w l -33
+KPX w o -35
+KPX w oacute -35
+KPX w odieresis -35
+KPX w ograve -35
+KPX w oslash -34
+KPX w period -71
+KPX w s -23
+KPX w semicolon -23
+KPX x a -11
+KPX x c -34
+KPX x e -32
+KPX x eacute -32
+KPX x o -45
+KPX x q -26
+KPX y a -32
+KPX y aacute -32
+KPX y acircumflex -32
+KPX y adieresis -32
+KPX y ae -31
+KPX y agrave -32
+KPX y aring -32
+KPX y atilde -32
+KPX y c -37
+KPX y colon -23
+KPX y comma -66
+KPX y e -35
+KPX y eacute -35
+KPX y ecircumflex -35
+KPX y egrave -35
+KPX y g -48
+KPX y hyphen -27
+KPX y l -32
+KPX y o -39
+KPX y oacute -39
+KPX y odieresis -39
+KPX y ograve -39
+KPX y oslash -38
+KPX y period -73
+KPX y s -26
+KPX y semicolon -23
+KPX zero four 12
+KPX zero one -55
+KPX zero seven -5
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/pdf2swf/fonts/n021003l.pfb b/pdf2swf/fonts/n021003l.pfb
new file mode 100644
index 00000000..cbae7ed1
--- /dev/null
+++ b/pdf2swf/fonts/n021003l.pfb
Binary files differ
diff --git a/pdf2swf/fonts/n021004l.afm b/pdf2swf/fonts/n021004l.afm
new file mode 100644
index 00000000..8931279b
--- /dev/null
+++ b/pdf2swf/fonts/n021004l.afm
@@ -0,0 +1,1341 @@
+StartFontMetrics 3.0
+Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development
+Comment Creation Date: 12/22/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName NimbusRomNo9L-Medi
+FullName Nimbus Roman No9 L Medium
+FamilyName Nimbus Roman No9 L
+Weight Bold
+ItalicAngle 0.0
+IsFixedPitch false
+UnderlinePosition -100
+UnderlineThickness 50
+Version 1.05
+Notice (URW)++,Copyright 1999 by (URW)++ Design & Development
+EncodingScheme AdobeStandardEncoding
+FontBBox -168 -341 1000 960
+CapHeight 676
+XHeight 461
+Descender -205
+Ascender 676
+StartCharMetrics 316
+C 32 ; WX 250 ; N space ; B 125 0 125 0 ;
+C 33 ; WX 333 ; N exclam ; B 81 -13 251 691 ;
+C 34 ; WX 555 ; N quotedbl ; B 83 404 472 691 ;
+C 35 ; WX 500 ; N numbersign ; B 4 0 496 700 ;
+C 36 ; WX 500 ; N dollar ; B 29 -99 472 750 ;
+C 37 ; WX 1000 ; N percent ; B 124 -14 877 692 ;
+C 38 ; WX 833 ; N ampersand ; B 62 -16 787 691 ;
+C 39 ; WX 333 ; N quoteright ; B 79 356 263 691 ;
+C 40 ; WX 333 ; N parenleft ; B 46 -168 306 694 ;
+C 41 ; WX 333 ; N parenright ; B 27 -168 287 694 ;
+C 42 ; WX 500 ; N asterisk ; B 56 255 447 691 ;
+C 43 ; WX 570 ; N plus ; B 33 0 537 506 ;
+C 44 ; WX 250 ; N comma ; B 39 -180 223 155 ;
+C 45 ; WX 333 ; N hyphen ; B 44 171 287 287 ;
+C 46 ; WX 250 ; N period ; B 41 -13 210 156 ;
+C 47 ; WX 278 ; N slash ; B -24 -19 302 691 ;
+C 48 ; WX 500 ; N zero ; B 24 -13 476 688 ;
+C 49 ; WX 500 ; N one ; B 65 0 442 688 ;
+C 50 ; WX 500 ; N two ; B 17 0 478 688 ;
+C 51 ; WX 500 ; N three ; B 16 -14 468 688 ;
+C 52 ; WX 500 ; N four ; B 19 0 475 688 ;
+C 53 ; WX 500 ; N five ; B 22 -8 470 676 ;
+C 54 ; WX 500 ; N six ; B 28 -13 475 688 ;
+C 55 ; WX 500 ; N seven ; B 17 0 477 676 ;
+C 56 ; WX 500 ; N eight ; B 28 -13 472 688 ;
+C 57 ; WX 500 ; N nine ; B 26 -13 473 688 ;
+C 58 ; WX 333 ; N colon ; B 82 -13 251 472 ;
+C 59 ; WX 333 ; N semicolon ; B 82 -180 266 472 ;
+C 60 ; WX 570 ; N less ; B 31 -12 539 518 ;
+C 61 ; WX 570 ; N equal ; B 33 107 537 399 ;
+C 62 ; WX 570 ; N greater ; B 31 -12 539 518 ;
+C 63 ; WX 500 ; N question ; B 57 -13 445 689 ;
+C 64 ; WX 930 ; N at ; B 108 -19 822 691 ;
+C 65 ; WX 722 ; N A ; B 9 0 689 690 ;
+C 66 ; WX 667 ; N B ; B 16 0 619 676 ;
+C 67 ; WX 722 ; N C ; B 49 -19 687 691 ;
+C 68 ; WX 722 ; N D ; B 14 0 690 676 ;
+C 69 ; WX 667 ; N E ; B 16 0 641 676 ;
+C 70 ; WX 611 ; N F ; B 16 0 583 676 ;
+C 71 ; WX 778 ; N G ; B 37 -19 755 691 ;
+C 72 ; WX 778 ; N H ; B 21 0 759 676 ;
+C 73 ; WX 389 ; N I ; B 20 0 370 676 ;
+C 74 ; WX 500 ; N J ; B 3 -96 479 676 ;
+C 75 ; WX 778 ; N K ; B 30 0 769 676 ;
+C 76 ; WX 667 ; N L ; B 19 0 638 676 ;
+C 77 ; WX 944 ; N M ; B 14 0 921 676 ;
+C 78 ; WX 722 ; N N ; B 16 -18 701 676 ;
+C 79 ; WX 778 ; N O ; B 35 -19 743 691 ;
+C 80 ; WX 611 ; N P ; B 16 0 600 676 ;
+C 81 ; WX 778 ; N Q ; B 35 -176 743 691 ;
+C 82 ; WX 722 ; N R ; B 26 0 715 676 ;
+C 83 ; WX 556 ; N S ; B 35 -19 513 692 ;
+C 84 ; WX 667 ; N T ; B 31 0 636 676 ;
+C 85 ; WX 722 ; N U ; B 16 -19 701 676 ;
+C 86 ; WX 722 ; N V ; B 16 -18 701 676 ;
+C 87 ; WX 1000 ; N W ; B 19 -15 981 676 ;
+C 88 ; WX 722 ; N X ; B 16 0 699 676 ;
+C 89 ; WX 722 ; N Y ; B 15 0 699 676 ;
+C 90 ; WX 667 ; N Z ; B 28 0 634 676 ;
+C 91 ; WX 333 ; N bracketleft ; B 67 -149 301 678 ;
+C 92 ; WX 278 ; N backslash ; B -25 -19 303 691 ;
+C 93 ; WX 333 ; N bracketright ; B 32 -149 266 678 ;
+C 94 ; WX 581 ; N asciicircum ; B 73 311 509 676 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 333 ; N quoteleft ; B 70 356 254 691 ;
+C 97 ; WX 500 ; N a ; B 25 -14 488 473 ;
+C 98 ; WX 556 ; N b ; B 17 -14 521 676 ;
+C 99 ; WX 444 ; N c ; B 25 -14 430 473 ;
+C 100 ; WX 556 ; N d ; B 25 -14 534 676 ;
+C 101 ; WX 444 ; N e ; B 25 -14 426 473 ;
+C 102 ; WX 333 ; N f ; B 14 0 389 691 ;
+C 103 ; WX 500 ; N g ; B 28 -206 483 473 ;
+C 104 ; WX 556 ; N h ; B 16 0 534 676 ;
+C 105 ; WX 278 ; N i ; B 16 0 255 691 ;
+C 106 ; WX 333 ; N j ; B -57 -203 263 691 ;
+C 107 ; WX 556 ; N k ; B 22 0 543 676 ;
+C 108 ; WX 278 ; N l ; B 16 0 255 676 ;
+C 109 ; WX 833 ; N m ; B 16 0 814 473 ;
+C 110 ; WX 556 ; N n ; B 21 0 539 473 ;
+C 111 ; WX 500 ; N o ; B 25 -14 476 473 ;
+C 112 ; WX 556 ; N p ; B 19 -205 524 473 ;
+C 113 ; WX 556 ; N q ; B 34 -205 536 473 ;
+C 114 ; WX 444 ; N r ; B 29 0 434 473 ;
+C 115 ; WX 389 ; N s ; B 25 -14 361 473 ;
+C 116 ; WX 333 ; N t ; B 20 -12 332 630 ;
+C 117 ; WX 556 ; N u ; B 16 -14 537 461 ;
+C 118 ; WX 500 ; N v ; B 21 -14 485 461 ;
+C 119 ; WX 722 ; N w ; B 23 -14 707 461 ;
+C 120 ; WX 500 ; N x ; B 12 0 484 461 ;
+C 121 ; WX 500 ; N y ; B 16 -205 480 461 ;
+C 122 ; WX 444 ; N z ; B 21 0 420 461 ;
+C 123 ; WX 394 ; N braceleft ; B 22 -175 340 698 ;
+C 124 ; WX 220 ; N bar ; B 66 -19 154 691 ;
+C 125 ; WX 394 ; N braceright ; B 54 -175 372 698 ;
+C 126 ; WX 520 ; N asciitilde ; B 29 175 491 331 ;
+C 161 ; WX 333 ; N exclamdown ; B 82 -203 252 501 ;
+C 162 ; WX 500 ; N cent ; B 53 -140 458 588 ;
+C 163 ; WX 500 ; N sterling ; B 21 -14 477 684 ;
+C 164 ; WX 167 ; N fraction ; B -168 -12 329 688 ;
+C 165 ; WX 500 ; N yen ; B -64 0 547 676 ;
+C 166 ; WX 500 ; N florin ; B 0 -155 498 706 ;
+C 167 ; WX 500 ; N section ; B 57 -132 443 691 ;
+C 168 ; WX 500 ; N currency ; B -26 61 526 613 ;
+C 169 ; WX 278 ; N quotesingle ; B 75 404 204 691 ;
+C 170 ; WX 500 ; N quotedblleft ; B 32 356 486 691 ;
+C 171 ; WX 500 ; N guillemotleft ; B 23 36 473 415 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 51 36 305 415 ;
+C 173 ; WX 333 ; N guilsinglright ; B 28 36 282 415 ;
+C 174 ; WX 556 ; N fi ; B 14 0 536 691 ;
+C 175 ; WX 556 ; N fl ; B 14 0 536 691 ;
+C 177 ; WX 500 ; N endash ; B 0 181 500 271 ;
+C 178 ; WX 500 ; N dagger ; B 47 -134 453 691 ;
+C 179 ; WX 500 ; N daggerdbl ; B 45 -132 456 691 ;
+C 180 ; WX 250 ; N periodcentered ; B 41 248 210 417 ;
+C 182 ; WX 540 ; N paragraph ; B 0 -186 519 676 ;
+C 183 ; WX 350 ; N bullet ; B 35 198 315 478 ;
+C 184 ; WX 333 ; N quotesinglbase ; B 79 -180 263 155 ;
+C 185 ; WX 500 ; N quotedblbase ; B 14 -180 468 155 ;
+C 186 ; WX 500 ; N quotedblright ; B 14 356 468 691 ;
+C 187 ; WX 500 ; N guillemotright ; B 27 36 477 415 ;
+C 188 ; WX 1000 ; N ellipsis ; B 82 -13 917 156 ;
+C 189 ; WX 1000 ; N perthousand ; B 7 -29 995 706 ;
+C 191 ; WX 500 ; N questiondown ; B 55 -201 443 501 ;
+C 193 ; WX 333 ; N grave ; B 8 528 246 713 ;
+C 194 ; WX 333 ; N acute ; B 86 528 324 713 ;
+C 195 ; WX 333 ; N circumflex ; B -2 528 335 704 ;
+C 196 ; WX 333 ; N tilde ; B -16 547 349 674 ;
+C 197 ; WX 333 ; N macron ; B 1 565 331 637 ;
+C 198 ; WX 333 ; N breve ; B 15 528 318 691 ;
+C 199 ; WX 333 ; N dotaccent ; B 103 537 232 666 ;
+C 200 ; WX 333 ; N dieresis ; B -2 537 337 666 ;
+C 202 ; WX 333 ; N ring ; B 60 537 273 750 ;
+C 203 ; WX 333 ; N cedilla ; B 68 -218 294 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B -13 528 425 713 ;
+C 206 ; WX 333 ; N ogonek ; B 90 -173 319 44 ;
+C 207 ; WX 333 ; N caron ; B -2 528 335 704 ;
+C 208 ; WX 1000 ; N emdash ; B 0 181 1000 271 ;
+C 225 ; WX 1000 ; N AE ; B 4 0 951 676 ;
+C 227 ; WX 300 ; N ordfeminine ; B -1 397 301 688 ;
+C 232 ; WX 667 ; N Lslash ; B 19 0 638 676 ;
+C 233 ; WX 778 ; N Oslash ; B 35 -74 743 737 ;
+C 234 ; WX 1000 ; N OE ; B 22 -5 981 684 ;
+C 235 ; WX 330 ; N ordmasculine ; B 18 397 312 688 ;
+C 241 ; WX 722 ; N ae ; B 33 -14 693 473 ;
+C 245 ; WX 278 ; N dotlessi ; B 16 0 255 461 ;
+C 248 ; WX 278 ; N lslash ; B -22 0 303 676 ;
+C 249 ; WX 500 ; N oslash ; B 25 -92 476 549 ;
+C 250 ; WX 722 ; N oe ; B 22 -14 696 473 ;
+C 251 ; WX 556 ; N germandbls ; B 19 -12 517 691 ;
+C -1 ; WX 722 ; N Udieresis ; B 16 -19 701 876 ;
+C -1 ; WX 722 ; N Uacute ; B 16 -19 701 923 ;
+C -1 ; WX 556 ; N Scedilla ; B 35 -218 513 692 ;
+C -1 ; WX 667 ; N Tcaron ; B 31 0 636 914 ;
+C -1 ; WX 556 ; N Scaron ; B 35 -19 513 914 ;
+C -1 ; WX 722 ; N Rcaron ; B 26 0 715 914 ;
+C -1 ; WX 722 ; N Racute ; B 26 0 715 923 ;
+C -1 ; WX 556 ; N Sacute ; B 35 -19 513 923 ;
+C -1 ; WX 778 ; N Otilde ; B 35 -19 743 884 ;
+C -1 ; WX 556 ; N ucircumflex ; B 16 -14 537 704 ;
+C -1 ; WX 778 ; N Ohungarumlaut ; B 35 -19 743 923 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 16 -19 701 923 ;
+C -1 ; WX 722 ; N Yacute ; B 15 0 699 923 ;
+C -1 ; WX 722 ; N Eth ; B 6 0 690 676 ;
+C -1 ; WX 722 ; N Dcroat ; B 6 0 690 676 ;
+C -1 ; WX 667 ; N Zacute ; B 28 0 634 923 ;
+C -1 ; WX 722 ; N Uring ; B 16 -19 701 960 ;
+C -1 ; WX 500 ; N gbreve ; B 28 -206 483 691 ;
+C -1 ; WX 444 ; N eogonek ; B 25 -173 444 473 ;
+C -1 ; WX 444 ; N edotaccent ; B 25 -14 426 666 ;
+C -1 ; WX 444 ; N ecaron ; B 25 -14 426 704 ;
+C -1 ; WX 722 ; N Ugrave ; B 16 -19 701 923 ;
+C -1 ; WX 611 ; N Thorn ; B 16 0 600 676 ;
+C -1 ; WX 444 ; N eacute ; B 25 -14 426 713 ;
+C -1 ; WX 444 ; N edieresis ; B 25 -14 426 666 ;
+C -1 ; WX 665 ; N dcaron ; B 25 -14 665 691 ;
+C -1 ; WX 444 ; N ccedilla ; B 25 -218 430 473 ;
+C -1 ; WX 444 ; N ccaron ; B 25 -14 430 704 ;
+C -1 ; WX 444 ; N cacute ; B 25 -14 430 713 ;
+C -1 ; WX 500 ; N aogonek ; B 25 -173 500 473 ;
+C -1 ; WX 500 ; N aring ; B 25 -14 488 750 ;
+C -1 ; WX 500 ; N atilde ; B 25 -14 488 674 ;
+C -1 ; WX 500 ; N abreve ; B 25 -14 488 691 ;
+C -1 ; WX 444 ; N egrave ; B 25 -14 426 713 ;
+C -1 ; WX 500 ; N agrave ; B 25 -14 488 713 ;
+C -1 ; WX 500 ; N aacute ; B 25 -14 488 713 ;
+C -1 ; WX 500 ; N adieresis ; B 25 -14 488 666 ;
+C -1 ; WX 722 ; N Uogonek ; B 16 -173 701 676 ;
+C -1 ; WX 556 ; N ugrave ; B 16 -14 537 713 ;
+C -1 ; WX 556 ; N uacute ; B 16 -14 537 713 ;
+C -1 ; WX 556 ; N udieresis ; B 16 -14 537 666 ;
+C -1 ; WX 400 ; N tcaron ; B 20 -12 400 691 ;
+C -1 ; WX 389 ; N scommaaccent ; B 25 -341 361 473 ;
+C -1 ; WX 667 ; N Zcaron ; B 28 0 634 914 ;
+C -1 ; WX 444 ; N ecircumflex ; B 25 -14 426 704 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 16 -19 701 914 ;
+C -1 ; WX 500 ; N acircumflex ; B 25 -14 488 704 ;
+C -1 ; WX 667 ; N Zdotaccent ; B 28 0 634 876 ;
+C -1 ; WX 389 ; N scaron ; B 25 -14 363 704 ;
+C -1 ; WX 722 ; N Amacron ; B 9 0 689 847 ;
+C -1 ; WX 389 ; N sacute ; B 25 -14 361 713 ;
+C -1 ; WX 667 ; N Tcommaaccent ; B 31 -341 636 676 ;
+C -1 ; WX 722 ; N Ydieresis ; B 15 0 699 876 ;
+C -1 ; WX 556 ; N thorn ; B 19 -205 524 676 ;
+C -1 ; WX 667 ; N Emacron ; B 16 0 641 847 ;
+C -1 ; WX 778 ; N Ograve ; B 35 -19 743 923 ;
+C -1 ; WX 778 ; N Oacute ; B 35 -19 743 923 ;
+C -1 ; WX 778 ; N Odieresis ; B 35 -19 743 876 ;
+C -1 ; WX 722 ; N Ntilde ; B 16 -18 701 884 ;
+C -1 ; WX 722 ; N Ncaron ; B 16 -18 701 914 ;
+C -1 ; WX 722 ; N Nacute ; B 16 -18 701 923 ;
+C -1 ; WX 667 ; N Lcaron ; B 19 0 638 691 ;
+C -1 ; WX 667 ; N Lacute ; B 19 0 638 923 ;
+C -1 ; WX 389 ; N Idotaccent ; B 20 0 370 876 ;
+C -1 ; WX 444 ; N racute ; B 29 0 434 713 ;
+C -1 ; WX 389 ; N Icircumflex ; B 20 0 370 914 ;
+C -1 ; WX 500 ; N ohungarumlaut ; B 25 -14 509 713 ;
+C -1 ; WX 500 ; N otilde ; B 25 -14 476 674 ;
+C -1 ; WX 500 ; N Euro ; B -36 -24 478 671 ;
+C -1 ; WX 500 ; N ocircumflex ; B 25 -14 476 704 ;
+C -1 ; WX 300 ; N onesuperior ; B 28 275 273 688 ;
+C -1 ; WX 300 ; N twosuperior ; B 0 275 300 688 ;
+C -1 ; WX 300 ; N threesuperior ; B 3 268 297 688 ;
+C -1 ; WX 389 ; N Igrave ; B 20 0 370 923 ;
+C -1 ; WX 389 ; N Iacute ; B 20 0 370 923 ;
+C -1 ; WX 389 ; N Imacron ; B 20 0 370 847 ;
+C -1 ; WX 389 ; N Iogonek ; B 20 -173 505 676 ;
+C -1 ; WX 389 ; N Idieresis ; B 20 0 370 876 ;
+C -1 ; WX 778 ; N Gbreve ; B 37 -19 755 901 ;
+C -1 ; WX 722 ; N Umacron ; B 16 -19 701 847 ;
+C -1 ; WX 778 ; N Kcommaaccent ; B 30 -341 769 676 ;
+C -1 ; WX 500 ; N ograve ; B 25 -14 476 713 ;
+C -1 ; WX 556 ; N Scommaaccent ; B 35 -341 513 692 ;
+C -1 ; WX 667 ; N Eogonek ; B 16 -173 737 676 ;
+C -1 ; WX 500 ; N oacute ; B 25 -14 476 713 ;
+C -1 ; WX 667 ; N Edotaccent ; B 16 0 641 876 ;
+C -1 ; WX 278 ; N iogonek ; B 16 -173 388 691 ;
+C -1 ; WX 500 ; N gcommaaccent ; B 28 -206 483 811 ;
+C -1 ; WX 500 ; N odieresis ; B 25 -14 476 666 ;
+C -1 ; WX 556 ; N ntilde ; B 21 0 539 674 ;
+C -1 ; WX 556 ; N ncaron ; B 21 0 539 704 ;
+C -1 ; WX 667 ; N Ecaron ; B 16 0 641 914 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 16 0 641 914 ;
+C -1 ; WX 389 ; N scedilla ; B 25 -218 361 473 ;
+C -1 ; WX 444 ; N rcaron ; B 29 0 434 704 ;
+C -1 ; WX 667 ; N Egrave ; B 16 0 641 923 ;
+C -1 ; WX 667 ; N Eacute ; B 16 0 641 923 ;
+C -1 ; WX 778 ; N Gcommaaccent ; B 37 -341 755 691 ;
+C -1 ; WX 722 ; N Rcommaaccent ; B 26 -341 715 676 ;
+C -1 ; WX 667 ; N Edieresis ; B 16 0 641 876 ;
+C -1 ; WX 556 ; N nacute ; B 21 0 539 713 ;
+C -1 ; WX 556 ; N uogonek ; B 16 -173 556 461 ;
+C -1 ; WX 556 ; N umacron ; B 16 -14 537 637 ;
+C -1 ; WX 722 ; N Dcaron ; B 14 0 690 914 ;
+C -1 ; WX 396 ; N lcaron ; B 16 0 396 691 ;
+C -1 ; WX 722 ; N Ccaron ; B 49 -19 687 914 ;
+C -1 ; WX 722 ; N Cacute ; B 49 -19 687 923 ;
+C -1 ; WX 722 ; N Ccedilla ; B 49 -218 687 691 ;
+C -1 ; WX 400 ; N degree ; B 57 402 343 688 ;
+C -1 ; WX 722 ; N Aogonek ; B 9 -173 822 690 ;
+C -1 ; WX 570 ; N minus ; B 33 209 537 297 ;
+C -1 ; WX 570 ; N multiply ; B 48 16 522 490 ;
+C -1 ; WX 570 ; N divide ; B 33 -31 537 537 ;
+C -1 ; WX 722 ; N Aring ; B 9 0 689 948 ;
+C -1 ; WX 1000 ; N trademark ; B 24 271 977 676 ;
+C -1 ; WX 444 ; N rcommaaccent ; B 29 -341 434 473 ;
+C -1 ; WX 278 ; N lacute ; B 16 0 297 923 ;
+C -1 ; WX 500 ; N omacron ; B 25 -14 476 637 ;
+C -1 ; WX 722 ; N Atilde ; B 9 0 689 884 ;
+C -1 ; WX 278 ; N icircumflex ; B -36 0 301 704 ;
+C -1 ; WX 278 ; N igrave ; B -26 0 255 713 ;
+C -1 ; WX 556 ; N ncommaaccent ; B 21 -341 539 473 ;
+C -1 ; WX 278 ; N lcommaaccent ; B 16 -341 255 676 ;
+C -1 ; WX 570 ; N plusminus ; B 33 0 537 568 ;
+C -1 ; WX 750 ; N onehalf ; B -7 -12 775 688 ;
+C -1 ; WX 750 ; N onequarter ; B 28 -12 743 688 ;
+C -1 ; WX 750 ; N threequarters ; B 23 -12 733 688 ;
+C -1 ; WX 278 ; N iacute ; B 16 0 290 713 ;
+C -1 ; WX 722 ; N Abreve ; B 9 0 689 901 ;
+C -1 ; WX 556 ; N kcommaaccent ; B 22 -341 543 676 ;
+C -1 ; WX 778 ; N Omacron ; B 35 -19 743 847 ;
+C -1 ; WX 278 ; N imacron ; B -27 0 303 637 ;
+C -1 ; WX 444 ; N emacron ; B 25 -14 426 637 ;
+C -1 ; WX 500 ; N amacron ; B 25 -14 488 637 ;
+C -1 ; WX 333 ; N tcommaaccent ; B 20 -341 332 630 ;
+C -1 ; WX 500 ; N ydieresis ; B 16 -205 480 666 ;
+C -1 ; WX 444 ; N zdotaccent ; B 21 0 420 666 ;
+C -1 ; WX 444 ; N zcaron ; B 21 0 420 704 ;
+C -1 ; WX 444 ; N zacute ; B 21 0 420 713 ;
+C -1 ; WX 500 ; N yacute ; B 16 -205 480 713 ;
+C -1 ; WX 556 ; N uhungarumlaut ; B 16 -14 537 713 ;
+C -1 ; WX 500 ; N eth ; B 25 -14 476 691 ;
+C -1 ; WX 556 ; N uring ; B 16 -14 537 750 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 35 -19 743 914 ;
+C -1 ; WX 333 ; N commaaccent ; B 84 -341 249 -40 ;
+C -1 ; WX 747 ; N copyright ; B 26 -19 721 691 ;
+C -1 ; WX 747 ; N registered ; B 26 -19 721 691 ;
+C -1 ; WX 722 ; N Acircumflex ; B 9 0 689 914 ;
+C -1 ; WX 278 ; N idieresis ; B -36 0 303 666 ;
+C -1 ; WX 494 ; N lozenge ; B 18 0 466 740 ;
+C -1 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C -1 ; WX 570 ; N notequal ; B 33 -13 537 519 ;
+C -1 ; WX 549 ; N radical ; B -17 -35 535 916 ;
+C -1 ; WX 722 ; N Agrave ; B 9 0 689 923 ;
+C -1 ; WX 722 ; N Aacute ; B 9 0 689 923 ;
+C -1 ; WX 570 ; N lessequal ; B 31 0 539 642 ;
+C -1 ; WX 570 ; N greaterequal ; B 31 0 539 642 ;
+C -1 ; WX 570 ; N logicalnot ; B 33 108 537 399 ;
+C -1 ; WX 713 ; N summation ; B 14 -123 695 752 ;
+C -1 ; WX 494 ; N partialdiff ; B 16 -20 472 743 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B 16 -341 701 676 ;
+C -1 ; WX 556 ; N dcroat ; B 25 -14 534 676 ;
+C -1 ; WX 220 ; N brokenbar ; B 66 -19 154 691 ;
+C -1 ; WX 667 ; N Lcommaaccent ; B 19 -341 638 676 ;
+C -1 ; WX 722 ; N Adieresis ; B 9 0 689 876 ;
+C -1 ; WX 556 ; N mu ; B 33 -206 536 461 ;
+C -1 ; WX 250 ; N .notdef ; B 125 0 125 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 998
+KPX A C -73
+KPX A Ccedilla -77
+KPX A G -68
+KPX A O -68
+KPX A Odieresis -68
+KPX A Q -68
+KPX A T -59
+KPX A U -66
+KPX A Uacute -66
+KPX A Ucircumflex -66
+KPX A Udieresis -66
+KPX A Ugrave -66
+KPX A V -130
+KPX A W -116
+KPX A Y -74
+KPX A a -5
+KPX A b -22
+KPX A c -35
+KPX A ccedilla -43
+KPX A comma 1
+KPX A d -28
+KPX A e -32
+KPX A g -7
+KPX A guillemotleft -53
+KPX A guilsinglleft -67
+KPX A hyphen -30
+KPX A o -37
+KPX A period 0
+KPX A q -38
+KPX A quotedblright -76
+KPX A quoteright -108
+KPX A t -27
+KPX A u -30
+KPX A v -84
+KPX A w -79
+KPX A y -83
+KPX Aacute C -73
+KPX Aacute G -68
+KPX Aacute O -68
+KPX Aacute Q -68
+KPX Aacute T -59
+KPX Aacute U -66
+KPX Aacute V -130
+KPX Aacute W -116
+KPX Aacute Y -74
+KPX Aacute a -5
+KPX Aacute b -22
+KPX Aacute c -35
+KPX Aacute comma 1
+KPX Aacute d -28
+KPX Aacute e -32
+KPX Aacute g -7
+KPX Aacute guillemotleft -53
+KPX Aacute guilsinglleft -67
+KPX Aacute hyphen -30
+KPX Aacute o -37
+KPX Aacute period 0
+KPX Aacute q -38
+KPX Aacute quoteright -108
+KPX Aacute t -27
+KPX Aacute u -30
+KPX Aacute v -84
+KPX Aacute w -79
+KPX Aacute y -83
+KPX Acircumflex C -73
+KPX Acircumflex G -68
+KPX Acircumflex O -68
+KPX Acircumflex Q -68
+KPX Acircumflex T -59
+KPX Acircumflex U -66
+KPX Acircumflex V -130
+KPX Acircumflex W -116
+KPX Acircumflex Y -74
+KPX Acircumflex comma 1
+KPX Acircumflex period 0
+KPX Adieresis C -73
+KPX Adieresis G -68
+KPX Adieresis O -68
+KPX Adieresis Q -68
+KPX Adieresis T -59
+KPX Adieresis U -66
+KPX Adieresis V -130
+KPX Adieresis W -116
+KPX Adieresis Y -74
+KPX Adieresis a -5
+KPX Adieresis b -22
+KPX Adieresis c -35
+KPX Adieresis comma 1
+KPX Adieresis d -28
+KPX Adieresis g -7
+KPX Adieresis guillemotleft -53
+KPX Adieresis guilsinglleft -67
+KPX Adieresis hyphen -30
+KPX Adieresis o -37
+KPX Adieresis period 0
+KPX Adieresis q -38
+KPX Adieresis quotedblright -76
+KPX Adieresis quoteright -108
+KPX Adieresis t -27
+KPX Adieresis u -30
+KPX Adieresis v -84
+KPX Adieresis w -79
+KPX Adieresis y -83
+KPX Agrave C -73
+KPX Agrave G -68
+KPX Agrave O -68
+KPX Agrave Q -68
+KPX Agrave T -59
+KPX Agrave U -66
+KPX Agrave V -130
+KPX Agrave W -116
+KPX Agrave Y -74
+KPX Agrave comma 1
+KPX Agrave period 0
+KPX Aring C -73
+KPX Aring G -68
+KPX Aring O -68
+KPX Aring Q -68
+KPX Aring T -59
+KPX Aring U -66
+KPX Aring V -130
+KPX Aring W -116
+KPX Aring Y -74
+KPX Aring a -5
+KPX Aring b -22
+KPX Aring c -35
+KPX Aring comma 1
+KPX Aring d -28
+KPX Aring e -32
+KPX Aring g -7
+KPX Aring guillemotleft -53
+KPX Aring guilsinglleft -67
+KPX Aring hyphen -30
+KPX Aring o -37
+KPX Aring period 0
+KPX Aring q -38
+KPX Aring quotedblright -76
+KPX Aring quoteright -108
+KPX Aring t -27
+KPX Aring u -30
+KPX Aring v -84
+KPX Aring w -79
+KPX Aring y -83
+KPX Atilde C -73
+KPX Atilde G -68
+KPX Atilde O -68
+KPX Atilde Q -68
+KPX Atilde T -59
+KPX Atilde U -66
+KPX Atilde V -130
+KPX Atilde W -116
+KPX Atilde Y -74
+KPX Atilde comma 1
+KPX Atilde period 0
+KPX B A -34
+KPX B AE -32
+KPX B Aacute -34
+KPX B Acircumflex -34
+KPX B Adieresis -34
+KPX B Aring -34
+KPX B Atilde -34
+KPX B O -12
+KPX B OE -4
+KPX B Oacute -12
+KPX B Ocircumflex -12
+KPX B Odieresis -12
+KPX B Ograve -12
+KPX B Oslash -11
+KPX B V -45
+KPX B W -46
+KPX B Y -44
+KPX C A -25
+KPX C AE -22
+KPX C Aacute -25
+KPX C Adieresis -25
+KPX C Aring -25
+KPX C H -2
+KPX C K -6
+KPX C O -14
+KPX C Oacute -14
+KPX C Odieresis -14
+KPX Ccedilla A -33
+KPX D A -55
+KPX D Aacute -55
+KPX D Acircumflex -55
+KPX D Adieresis -55
+KPX D Agrave -55
+KPX D Aring -55
+KPX D Atilde -55
+KPX D J -40
+KPX D T -7
+KPX D V -60
+KPX D W -50
+KPX D X -51
+KPX D Y -59
+KPX F A -79
+KPX F Aacute -79
+KPX F Acircumflex -79
+KPX F Adieresis -79
+KPX F Agrave -79
+KPX F Aring -79
+KPX F Atilde -79
+KPX F J -42
+KPX F O -7
+KPX F Odieresis -7
+KPX F a -50
+KPX F aacute -50
+KPX F adieresis -22
+KPX F ae -53
+KPX F aring -50
+KPX F comma -59
+KPX F e -51
+KPX F eacute -51
+KPX F hyphen -34
+KPX F i -1
+KPX F j -26
+KPX F o -54
+KPX F oacute -54
+KPX F odieresis -24
+KPX F oe -51
+KPX F oslash -53
+KPX F period -60
+KPX F r -7
+KPX F u -10
+KPX G A -27
+KPX G AE -24
+KPX G Aacute -27
+KPX G Acircumflex -27
+KPX G Adieresis -27
+KPX G Agrave -27
+KPX G Aring -27
+KPX G Atilde -27
+KPX G T -41
+KPX G V -33
+KPX G W -35
+KPX G Y -33
+KPX J A -30
+KPX J AE -27
+KPX J Adieresis -30
+KPX J Aring -30
+KPX K C -61
+KPX K G -56
+KPX K O -56
+KPX K OE -46
+KPX K Oacute -56
+KPX K Odieresis -56
+KPX K S 13
+KPX K T -2
+KPX K a 6
+KPX K adieresis 6
+KPX K ae 3
+KPX K aring 6
+KPX K e -20
+KPX K hyphen -47
+KPX K o -25
+KPX K oacute -25
+KPX K odieresis -25
+KPX K u -18
+KPX K udieresis -18
+KPX K y -83
+KPX L A -1
+KPX L AE 1
+KPX L Aacute -1
+KPX L Adieresis -1
+KPX L Aring -1
+KPX L C -11
+KPX L Ccedilla -14
+KPX L G -5
+KPX L O -5
+KPX L Oacute -5
+KPX L Ocircumflex -5
+KPX L Odieresis -5
+KPX L Ograve -5
+KPX L Otilde -5
+KPX L S 2
+KPX L T -74
+KPX L U -29
+KPX L Udieresis -29
+KPX L V -106
+KPX L W -87
+KPX L Y -89
+KPX L hyphen 24
+KPX L quotedblright -37
+KPX L quoteright -69
+KPX L u -11
+KPX L udieresis -12
+KPX L y -49
+KPX N A -19
+KPX N AE -16
+KPX N Aacute -19
+KPX N Adieresis -19
+KPX N Aring -19
+KPX N C -22
+KPX N Ccedilla -22
+KPX N G -16
+KPX N O -15
+KPX N Oacute -15
+KPX N Odieresis -15
+KPX N a -16
+KPX N aacute -16
+KPX N adieresis -16
+KPX N ae -18
+KPX N aring -16
+KPX N comma 1
+KPX N e -13
+KPX N eacute -13
+KPX N o -16
+KPX N oacute -16
+KPX N odieresis -16
+KPX N oslash -15
+KPX N period 0
+KPX N u -17
+KPX N udieresis -17
+KPX O A -55
+KPX O AE -54
+KPX O Aacute -55
+KPX O Adieresis -55
+KPX O Aring -55
+KPX O T -9
+KPX O V -60
+KPX O W -54
+KPX O X -51
+KPX O Y -59
+KPX Oacute A -55
+KPX Oacute T -9
+KPX Oacute V -60
+KPX Oacute W -54
+KPX Oacute Y -59
+KPX Ocircumflex T -9
+KPX Ocircumflex V -60
+KPX Ocircumflex Y -59
+KPX Odieresis A -55
+KPX Odieresis T -9
+KPX Odieresis V -60
+KPX Odieresis W -54
+KPX Odieresis X -51
+KPX Odieresis Y -59
+KPX Ograve T -9
+KPX Ograve V -60
+KPX Ograve Y -59
+KPX Oslash A -52
+KPX Otilde T -9
+KPX Otilde V -60
+KPX Otilde Y -59
+KPX P A -81
+KPX P AE -94
+KPX P Aacute -81
+KPX P Adieresis -81
+KPX P Aring -81
+KPX P J -68
+KPX P a -19
+KPX P aacute -19
+KPX P adieresis -19
+KPX P ae -22
+KPX P aring -19
+KPX P comma -85
+KPX P e -29
+KPX P eacute -29
+KPX P hyphen -39
+KPX P o -33
+KPX P oacute -33
+KPX P odieresis -22
+KPX P oe -30
+KPX P oslash -33
+KPX P period -86
+KPX R C -36
+KPX R Ccedilla -37
+KPX R G -30
+KPX R O -29
+KPX R OE -22
+KPX R Oacute -29
+KPX R Odieresis -29
+KPX R T -26
+KPX R U -37
+KPX R Udieresis -37
+KPX R V -53
+KPX R W -55
+KPX R Y -53
+KPX R a 7
+KPX R aacute 7
+KPX R adieresis 7
+KPX R ae 4
+KPX R aring 7
+KPX R e -19
+KPX R eacute -19
+KPX R hyphen -30
+KPX R o -24
+KPX R oacute -24
+KPX R odieresis -24
+KPX R oe -21
+KPX R u -17
+KPX R uacute -17
+KPX R udieresis -17
+KPX R y -27
+KPX S A -24
+KPX S AE -21
+KPX S Aacute -24
+KPX S Adieresis -24
+KPX S Aring -24
+KPX S T -16
+KPX S V -9
+KPX S W -10
+KPX S Y -8
+KPX S t -10
+KPX T A -46
+KPX T AE -44
+KPX T Aacute -46
+KPX T Acircumflex -46
+KPX T Adieresis -46
+KPX T Agrave -46
+KPX T Aring -46
+KPX T Atilde -46
+KPX T C -17
+KPX T G -11
+KPX T J -43
+KPX T O -9
+KPX T OE -3
+KPX T Oacute -9
+KPX T Ocircumflex -9
+KPX T Odieresis -9
+KPX T Ograve -9
+KPX T Oslash -11
+KPX T Otilde -9
+KPX T S -2
+KPX T V 11
+KPX T W 9
+KPX T Y 11
+KPX T a -65
+KPX T ae -69
+KPX T c -88
+KPX T colon -85
+KPX T comma -63
+KPX T e -85
+KPX T g -68
+KPX T guillemotleft -99
+KPX T guilsinglleft -113
+KPX T hyphen -73
+KPX T i -16
+KPX T j -40
+KPX T o -88
+KPX T oslash -87
+KPX T period -64
+KPX T r -61
+KPX T s -59
+KPX T semicolon -85
+KPX T u -89
+KPX T v -106
+KPX T w -107
+KPX T y -104
+KPX U A -54
+KPX U AE -52
+KPX U Aacute -54
+KPX U Acircumflex -54
+KPX U Adieresis -54
+KPX U Aring -54
+KPX U Atilde -54
+KPX U comma -17
+KPX U m -23
+KPX U n -25
+KPX U p -28
+KPX U period -18
+KPX U r -29
+KPX Uacute A -54
+KPX Uacute comma -17
+KPX Uacute m -23
+KPX Uacute n -25
+KPX Uacute p -28
+KPX Uacute period -18
+KPX Uacute r -29
+KPX Ucircumflex A -54
+KPX Udieresis A -54
+KPX Udieresis b 10
+KPX Udieresis comma -17
+KPX Udieresis m -23
+KPX Udieresis n -25
+KPX Udieresis p -28
+KPX Udieresis period -18
+KPX Udieresis r -29
+KPX Ugrave A -54
+KPX V A -113
+KPX V AE -113
+KPX V Aacute -113
+KPX V Acircumflex -113
+KPX V Adieresis -113
+KPX V Agrave -113
+KPX V Aring -113
+KPX V Atilde -113
+KPX V C -70
+KPX V G -64
+KPX V O -63
+KPX V Oacute -63
+KPX V Ocircumflex -63
+KPX V Odieresis -63
+KPX V Ograve -63
+KPX V Oslash -65
+KPX V Otilde -63
+KPX V S -25
+KPX V T 8
+KPX V a -87
+KPX V ae -90
+KPX V colon -94
+KPX V comma -94
+KPX V e -86
+KPX V g -86
+KPX V guillemotleft -98
+KPX V guilsinglleft -112
+KPX V hyphen -68
+KPX V i -13
+KPX V o -89
+KPX V oslash -87
+KPX V period -95
+KPX V r -60
+KPX V semicolon -94
+KPX V u -58
+KPX V y -56
+KPX W A -98
+KPX W AE -102
+KPX W Aacute -98
+KPX W Acircumflex -98
+KPX W Adieresis -98
+KPX W Agrave -98
+KPX W Aring -98
+KPX W Atilde -98
+KPX W C -58
+KPX W G -52
+KPX W O -51
+KPX W Oacute -51
+KPX W Ocircumflex -51
+KPX W Odieresis -51
+KPX W Ograve -51
+KPX W Oslash -50
+KPX W Otilde -51
+KPX W S -24
+KPX W T 9
+KPX W a -70
+KPX W ae -73
+KPX W colon -81
+KPX W comma -72
+KPX W e -67
+KPX W g -70
+KPX W guillemotleft -79
+KPX W guilsinglleft -93
+KPX W hyphen -49
+KPX W i -12
+KPX W o -70
+KPX W oslash -69
+KPX W period -73
+KPX W r -49
+KPX W semicolon -80
+KPX W u -45
+KPX W y -44
+KPX X C -63
+KPX X O -56
+KPX X Odieresis -56
+KPX X Q -57
+KPX X a 0
+KPX X e -27
+KPX X hyphen -43
+KPX X o -32
+KPX X u -25
+KPX X y -90
+KPX Y A -64
+KPX Y AE -62
+KPX Y Aacute -64
+KPX Y Acircumflex -64
+KPX Y Adieresis -64
+KPX Y Agrave -64
+KPX Y Aring -64
+KPX Y Atilde -64
+KPX Y C -71
+KPX Y G -65
+KPX Y O -64
+KPX Y Oacute -64
+KPX Y Ocircumflex -64
+KPX Y Odieresis -64
+KPX Y Ograve -64
+KPX Y Oslash -68
+KPX Y Otilde -64
+KPX Y S -26
+KPX Y T 7
+KPX Y a -83
+KPX Y ae -87
+KPX Y colon -103
+KPX Y comma -80
+KPX Y e -93
+KPX Y g -86
+KPX Y guillemotleft -111
+KPX Y guilsinglleft -125
+KPX Y hyphen -87
+KPX Y i -14
+KPX Y o -96
+KPX Y oslash -95
+KPX Y p -72
+KPX Y period -81
+KPX Y semicolon -103
+KPX Y u -76
+KPX Y v -78
+KPX Z v -45
+KPX Z y -44
+KPX a j -39
+KPX a quoteright -34
+KPX a v -39
+KPX a w -40
+KPX a y -44
+KPX aacute v -39
+KPX aacute w -40
+KPX aacute y -44
+KPX adieresis v -39
+KPX adieresis w -40
+KPX adieresis y -44
+KPX ae v -34
+KPX ae w -35
+KPX ae y -37
+KPX agrave v -39
+KPX agrave w -40
+KPX agrave y -44
+KPX aring v -39
+KPX aring w -40
+KPX aring y -44
+KPX b v -39
+KPX b w -40
+KPX b y -42
+KPX c h -17
+KPX c k -18
+KPX comma one -12
+KPX comma quotedblright 9
+KPX comma quoteright -23
+KPX e quoteright -19
+KPX e t -10
+KPX e v -29
+KPX e w -30
+KPX e x -19
+KPX e y -31
+KPX eacute v -29
+KPX eacute w -30
+KPX eacute y -31
+KPX ecircumflex v -29
+KPX ecircumflex w -30
+KPX ecircumflex y -31
+KPX eight four 11
+KPX eight one -19
+KPX eight seven 0
+KPX f a -17
+KPX f aacute -17
+KPX f adieresis 14
+KPX f ae -21
+KPX f aring -15
+KPX f e -29
+KPX f eacute -29
+KPX f f 12
+KPX f i 22
+KPX f j -1
+KPX f l 33
+KPX f o -32
+KPX f oacute -32
+KPX f odieresis 11
+KPX f oe -29
+KPX f oslash -31
+KPX f quoteright 18
+KPX f s -8
+KPX f t -3
+KPX five four 1
+KPX five one -28
+KPX five seven -9
+KPX four four 13
+KPX four one -35
+KPX four seven -16
+KPX g a -15
+KPX g adieresis -15
+KPX g ae -18
+KPX g aring -15
+KPX g e -20
+KPX g eacute -20
+KPX g l 0
+KPX g oacute -20
+KPX g odieresis -20
+KPX g r 1
+KPX guillemotright A -40
+KPX guillemotright AE -46
+KPX guillemotright Aacute -40
+KPX guillemotright Adieresis -40
+KPX guillemotright Aring -40
+KPX guillemotright T -100
+KPX guillemotright V -102
+KPX guillemotright W -84
+KPX guillemotright Y -106
+KPX guilsinglright A -54
+KPX guilsinglright AE -60
+KPX guilsinglright Aacute -54
+KPX guilsinglright Adieresis -54
+KPX guilsinglright Aring -54
+KPX guilsinglright T -114
+KPX guilsinglright V -116
+KPX guilsinglright W -98
+KPX guilsinglright Y -120
+KPX h quoteright -30
+KPX h y -34
+KPX hyphen A -18
+KPX hyphen AE -24
+KPX hyphen Aacute -18
+KPX hyphen Adieresis -18
+KPX hyphen Aring -18
+KPX hyphen T -74
+KPX hyphen V -72
+KPX hyphen W -54
+KPX hyphen Y -83
+KPX i T -18
+KPX i j -36
+KPX k a -3
+KPX k aacute -3
+KPX k adieresis -3
+KPX k ae -7
+KPX k aring -3
+KPX k comma 0
+KPX k e -33
+KPX k eacute -33
+KPX k g -4
+KPX k hyphen -47
+KPX k o -38
+KPX k oacute -38
+KPX k odieresis -38
+KPX k period 0
+KPX k s 5
+KPX k u -5
+KPX k udieresis -5
+KPX l v -22
+KPX l y -19
+KPX m p -16
+KPX m v -32
+KPX m w -33
+KPX m y -33
+KPX n T -56
+KPX n p -14
+KPX n quoteright -28
+KPX n v -31
+KPX n w -32
+KPX n y -32
+KPX nine four 2
+KPX nine one -26
+KPX nine seven 10
+KPX o T -88
+KPX o quoteright -27
+KPX o t -10
+KPX o v -42
+KPX o w -38
+KPX o x -29
+KPX o y -42
+KPX oacute v -42
+KPX oacute w -38
+KPX oacute y -42
+KPX ocircumflex t -10
+KPX odieresis t -10
+KPX odieresis v -42
+KPX odieresis w -38
+KPX odieresis x -29
+KPX odieresis y -42
+KPX ograve v -42
+KPX ograve w -38
+KPX ograve y -42
+KPX one comma -16
+KPX one eight -34
+KPX one five -16
+KPX one four -56
+KPX one nine -9
+KPX one one -27
+KPX one period -17
+KPX one seven -56
+KPX one six -47
+KPX one three -10
+KPX one two -2
+KPX one zero -35
+KPX p t -11
+KPX p y -34
+KPX period one -21
+KPX period quotedblright 5
+KPX period quoteright -27
+KPX q c -13
+KPX q u -15
+KPX quotedblbase A 19
+KPX quotedblbase AE 20
+KPX quotedblbase T -59
+KPX quotedblbase V -98
+KPX quotedblbase W -75
+KPX quotedblbase Y -73
+KPX quotedblleft A -59
+KPX quotedblleft AE -78
+KPX quotedblleft Aacute -59
+KPX quotedblleft Adieresis -59
+KPX quotedblleft Aring -59
+KPX quotedblleft T 9
+KPX quotedblleft V 15
+KPX quotedblleft W 13
+KPX quotedblleft Y 15
+KPX quotedblright A -72
+KPX quotedblright AE -91
+KPX quotedblright Aacute -72
+KPX quotedblright Adieresis -72
+KPX quotedblright Aring -72
+KPX quotedblright T 4
+KPX quotedblright V 5
+KPX quotedblright W 4
+KPX quotedblright Y 6
+KPX quoteleft A -92
+KPX quoteleft AE -111
+KPX quoteleft Aacute -92
+KPX quoteleft Adieresis -92
+KPX quoteleft Aring -92
+KPX quoteleft T -22
+KPX quoteleft V -17
+KPX quoteleft W -19
+KPX quoteleft Y -17
+KPX quoteright A -91
+KPX quoteright AE -110
+KPX quoteright Aacute -91
+KPX quoteright Adieresis -91
+KPX quoteright Aring -91
+KPX quoteright comma -34
+KPX quoteright d -31
+KPX quoteright o -34
+KPX quoteright period -35
+KPX quoteright r -26
+KPX quoteright s -17
+KPX quoteright t -19
+KPX quoteright v -25
+KPX quoteright w -23
+KPX quoteright y -22
+KPX r a -6
+KPX r aacute -6
+KPX r acircumflex -6
+KPX r adieresis -6
+KPX r ae -8
+KPX r agrave -6
+KPX r aring -6
+KPX r c -15
+KPX r ccedilla -10
+KPX r colon -16
+KPX r comma -67
+KPX r d -13
+KPX r e -11
+KPX r eacute -11
+KPX r ecircumflex -11
+KPX r egrave -11
+KPX r f 11
+KPX r g -5
+KPX r h -15
+KPX r hyphen -18
+KPX r i 6
+KPX r j -12
+KPX r k -15
+KPX r l -14
+KPX r m 6
+KPX r n 4
+KPX r o -14
+KPX r oacute -14
+KPX r ocircumflex -14
+KPX r odieresis -14
+KPX r oe -12
+KPX r ograve -14
+KPX r oslash -14
+KPX r p 4
+KPX r period -68
+KPX r q -15
+KPX r quoteright -8
+KPX r r 0
+KPX r s 0
+KPX r semicolon -16
+KPX r t 9
+KPX r u 9
+KPX r v 8
+KPX r w 7
+KPX r x 11
+KPX r y 9
+KPX r z -1
+KPX s quoteright -17
+KPX s t -7
+KPX seven colon -64
+KPX seven comma -57
+KPX seven eight -18
+KPX seven five -34
+KPX seven four -54
+KPX seven one -25
+KPX seven period -58
+KPX seven seven -6
+KPX seven six -37
+KPX seven three -20
+KPX seven two -21
+KPX six four 13
+KPX six one -43
+KPX six seven -7
+KPX t S 11
+KPX t a 11
+KPX t aacute 11
+KPX t adieresis 11
+KPX t ae 7
+KPX t aring 11
+KPX t colon -12
+KPX t e -1
+KPX t eacute -1
+KPX t h -4
+KPX t o -4
+KPX t oacute -4
+KPX t odieresis -4
+KPX t quoteright -31
+KPX t semicolon -12
+KPX three four 9
+KPX three one -33
+KPX three seven -15
+KPX two four 14
+KPX two one -29
+KPX two seven -7
+KPX u quoteright -25
+KPX v a -23
+KPX v aacute -23
+KPX v acircumflex -23
+KPX v adieresis -23
+KPX v ae -25
+KPX v agrave -23
+KPX v aring -23
+KPX v atilde -23
+KPX v c -40
+KPX v colon -23
+KPX v comma -56
+KPX v e -35
+KPX v eacute -35
+KPX v ecircumflex -35
+KPX v egrave -35
+KPX v g -22
+KPX v hyphen -27
+KPX v l -16
+KPX v o -40
+KPX v oacute -40
+KPX v odieresis -40
+KPX v ograve -40
+KPX v oslash -39
+KPX v period -57
+KPX v s -16
+KPX v semicolon -23
+KPX w a -23
+KPX w aacute -23
+KPX w acircumflex -23
+KPX w adieresis -23
+KPX w ae -25
+KPX w agrave -23
+KPX w aring -23
+KPX w atilde -23
+KPX w c -36
+KPX w colon -23
+KPX w comma -50
+KPX w e -33
+KPX w eacute -33
+KPX w ecircumflex -33
+KPX w egrave -33
+KPX w g -22
+KPX w hyphen -23
+KPX w l -16
+KPX w o -36
+KPX w oacute -36
+KPX w odieresis -36
+KPX w ograve -36
+KPX w oslash -35
+KPX w period -51
+KPX w s -16
+KPX w semicolon -23
+KPX x a -2
+KPX x c -30
+KPX x e -27
+KPX x eacute -27
+KPX x o -30
+KPX x q -32
+KPX y a -32
+KPX y aacute -32
+KPX y acircumflex -32
+KPX y adieresis -32
+KPX y ae -34
+KPX y agrave -32
+KPX y aring -32
+KPX y atilde -32
+KPX y c -42
+KPX y colon -28
+KPX y comma -56
+KPX y e -40
+KPX y eacute -40
+KPX y ecircumflex -40
+KPX y egrave -40
+KPX y g -31
+KPX y hyphen -29
+KPX y l -19
+KPX y o -42
+KPX y oacute -42
+KPX y odieresis -42
+KPX y ograve -42
+KPX y oslash -41
+KPX y period -57
+KPX y s -24
+KPX y semicolon -28
+KPX zero four 11
+KPX zero one -31
+KPX zero seven 7
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/pdf2swf/fonts/n021004l.pfb b/pdf2swf/fonts/n021004l.pfb
new file mode 100644
index 00000000..47f8fd57
--- /dev/null
+++ b/pdf2swf/fonts/n021004l.pfb
Binary files differ
diff --git a/pdf2swf/fonts/n021023l.afm b/pdf2swf/fonts/n021023l.afm
new file mode 100644
index 00000000..8454d36a
--- /dev/null
+++ b/pdf2swf/fonts/n021023l.afm
@@ -0,0 +1,1341 @@
+StartFontMetrics 3.0
+Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development
+Comment Creation Date: 12/22/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName NimbusRomNo9L-ReguItal
+FullName Nimbus Roman No9 L Regular Italic
+FamilyName Nimbus Roman No9 L
+Weight Regular
+ItalicAngle -15.0
+IsFixedPitch false
+UnderlinePosition -100
+UnderlineThickness 50
+Version 1.05
+Notice (URW)++,Copyright 1999 by (URW)++ Design & Development
+EncodingScheme AdobeStandardEncoding
+FontBBox -169 -270 1010 924
+CapHeight 653
+XHeight 432
+Descender -205
+Ascender 683
+StartCharMetrics 316
+C 32 ; WX 250 ; N space ; B 125 0 125 0 ;
+C 33 ; WX 333 ; N exclam ; B 39 -11 302 667 ;
+C 34 ; WX 420 ; N quotedbl ; B 144 421 432 666 ;
+C 35 ; WX 500 ; N numbersign ; B 2 0 540 676 ;
+C 36 ; WX 500 ; N dollar ; B 31 -89 497 731 ;
+C 37 ; WX 833 ; N percent ; B 79 -13 790 676 ;
+C 38 ; WX 778 ; N ampersand ; B 76 -18 723 666 ;
+C 39 ; WX 333 ; N quoteright ; B 151 436 290 666 ;
+C 40 ; WX 333 ; N parenleft ; B 42 -181 315 669 ;
+C 41 ; WX 333 ; N parenright ; B 16 -180 289 669 ;
+C 42 ; WX 500 ; N asterisk ; B 128 255 492 666 ;
+C 43 ; WX 675 ; N plus ; B 86 0 590 506 ;
+C 44 ; WX 250 ; N comma ; B -4 -129 135 101 ;
+C 45 ; WX 333 ; N hyphen ; B 49 192 282 255 ;
+C 46 ; WX 250 ; N period ; B 27 -11 138 100 ;
+C 47 ; WX 278 ; N slash ; B -65 -18 386 666 ;
+C 48 ; WX 500 ; N zero ; B 32 -7 497 676 ;
+C 49 ; WX 500 ; N one ; B 49 0 409 676 ;
+C 50 ; WX 500 ; N two ; B 12 0 452 676 ;
+C 51 ; WX 500 ; N three ; B 15 -7 466 676 ;
+C 52 ; WX 500 ; N four ; B 1 0 479 676 ;
+C 53 ; WX 500 ; N five ; B 15 -7 491 666 ;
+C 54 ; WX 500 ; N six ; B 30 -7 521 686 ;
+C 55 ; WX 500 ; N seven ; B 75 -8 537 666 ;
+C 56 ; WX 500 ; N eight ; B 30 -7 493 676 ;
+C 57 ; WX 500 ; N nine ; B 23 -17 492 676 ;
+C 58 ; WX 333 ; N colon ; B 50 -11 261 441 ;
+C 59 ; WX 333 ; N semicolon ; B 27 -129 261 441 ;
+C 60 ; WX 675 ; N less ; B 84 -10 592 516 ;
+C 61 ; WX 675 ; N equal ; B 86 120 590 386 ;
+C 62 ; WX 675 ; N greater ; B 84 -10 592 516 ;
+C 63 ; WX 500 ; N question ; B 132 -12 472 664 ;
+C 64 ; WX 920 ; N at ; B 118 -18 806 666 ;
+C 65 ; WX 611 ; N A ; B -51 0 564 668 ;
+C 66 ; WX 611 ; N B ; B -8 0 588 653 ;
+C 67 ; WX 667 ; N C ; B 66 -18 689 666 ;
+C 68 ; WX 722 ; N D ; B -8 0 700 653 ;
+C 69 ; WX 611 ; N E ; B -1 0 634 653 ;
+C 70 ; WX 611 ; N F ; B 8 0 645 653 ;
+C 71 ; WX 722 ; N G ; B 52 -18 722 666 ;
+C 72 ; WX 722 ; N H ; B -8 0 767 653 ;
+C 73 ; WX 333 ; N I ; B -8 0 384 653 ;
+C 74 ; WX 444 ; N J ; B -6 -18 491 653 ;
+C 75 ; WX 667 ; N K ; B 7 0 722 653 ;
+C 76 ; WX 556 ; N L ; B -8 0 559 653 ;
+C 77 ; WX 833 ; N M ; B -18 0 873 653 ;
+C 78 ; WX 667 ; N N ; B -20 -15 727 653 ;
+C 79 ; WX 722 ; N O ; B 60 -18 706 666 ;
+C 80 ; WX 611 ; N P ; B 0 0 605 653 ;
+C 81 ; WX 722 ; N Q ; B 59 -183 699 666 ;
+C 82 ; WX 611 ; N R ; B -13 0 588 653 ;
+C 83 ; WX 500 ; N S ; B 17 -18 508 667 ;
+C 84 ; WX 556 ; N T ; B 59 0 633 653 ;
+C 85 ; WX 722 ; N U ; B 102 -18 765 653 ;
+C 86 ; WX 611 ; N V ; B 76 -18 688 653 ;
+C 87 ; WX 833 ; N W ; B 71 -18 906 653 ;
+C 88 ; WX 611 ; N X ; B -29 0 655 653 ;
+C 89 ; WX 556 ; N Y ; B 78 0 633 653 ;
+C 90 ; WX 556 ; N Z ; B -6 0 606 653 ;
+C 91 ; WX 389 ; N bracketleft ; B 21 -153 391 663 ;
+C 92 ; WX 278 ; N backslash ; B -41 -18 319 666 ;
+C 93 ; WX 389 ; N bracketright ; B 12 -153 382 663 ;
+C 94 ; WX 422 ; N asciicircum ; B 0 301 422 666 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 333 ; N quoteleft ; B 171 436 310 666 ;
+C 97 ; WX 500 ; N a ; B 17 -11 476 441 ;
+C 98 ; WX 500 ; N b ; B 23 -11 473 683 ;
+C 99 ; WX 444 ; N c ; B 30 -11 425 441 ;
+C 100 ; WX 500 ; N d ; B 15 -13 527 683 ;
+C 101 ; WX 444 ; N e ; B 31 -11 412 441 ;
+C 102 ; WX 278 ; N f ; B -147 -207 424 678 ;
+C 103 ; WX 500 ; N g ; B 8 -206 472 441 ;
+C 104 ; WX 500 ; N h ; B 19 -9 478 683 ;
+C 105 ; WX 278 ; N i ; B 49 -11 264 654 ;
+C 106 ; WX 278 ; N j ; B -124 -207 276 654 ;
+C 107 ; WX 444 ; N k ; B 14 -11 461 683 ;
+C 108 ; WX 278 ; N l ; B 40 -11 279 683 ;
+C 109 ; WX 722 ; N m ; B 12 -9 704 441 ;
+C 110 ; WX 500 ; N n ; B 14 -9 474 441 ;
+C 111 ; WX 500 ; N o ; B 27 -11 468 441 ;
+C 112 ; WX 500 ; N p ; B -75 -205 469 442 ;
+C 113 ; WX 500 ; N q ; B 25 -209 483 441 ;
+C 114 ; WX 389 ; N r ; B 45 0 412 441 ;
+C 115 ; WX 389 ; N s ; B 16 -13 366 442 ;
+C 116 ; WX 278 ; N t ; B 37 -11 296 546 ;
+C 117 ; WX 500 ; N u ; B 42 -11 475 441 ;
+C 118 ; WX 444 ; N v ; B 21 -18 426 441 ;
+C 119 ; WX 667 ; N w ; B 16 -18 648 441 ;
+C 120 ; WX 444 ; N x ; B -27 -11 447 441 ;
+C 121 ; WX 444 ; N y ; B -24 -206 426 441 ;
+C 122 ; WX 389 ; N z ; B -2 -81 380 428 ;
+C 123 ; WX 400 ; N braceleft ; B 51 -177 407 687 ;
+C 124 ; WX 275 ; N bar ; B 105 -18 171 666 ;
+C 125 ; WX 400 ; N braceright ; B -7 -177 349 687 ;
+C 126 ; WX 541 ; N asciitilde ; B 40 186 502 320 ;
+C 161 ; WX 389 ; N exclamdown ; B 59 -205 321 474 ;
+C 162 ; WX 500 ; N cent ; B 77 -143 472 560 ;
+C 163 ; WX 500 ; N sterling ; B 10 -6 517 670 ;
+C 164 ; WX 167 ; N fraction ; B -169 -10 337 676 ;
+C 165 ; WX 500 ; N yen ; B 27 0 603 653 ;
+C 166 ; WX 500 ; N florin ; B 25 -182 507 682 ;
+C 167 ; WX 500 ; N section ; B 53 -162 461 666 ;
+C 168 ; WX 500 ; N currency ; B -22 53 522 597 ;
+C 169 ; WX 214 ; N quotesingle ; B 132 421 241 666 ;
+C 170 ; WX 556 ; N quotedblleft ; B 166 436 514 666 ;
+C 171 ; WX 500 ; N guillemotleft ; B 53 37 445 403 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 51 37 281 403 ;
+C 173 ; WX 333 ; N guilsinglright ; B 52 37 282 403 ;
+C 174 ; WX 500 ; N fi ; B -141 -207 481 681 ;
+C 175 ; WX 500 ; N fl ; B -141 -204 518 682 ;
+C 177 ; WX 500 ; N endash ; B -6 197 505 243 ;
+C 178 ; WX 500 ; N dagger ; B 101 -159 488 666 ;
+C 179 ; WX 500 ; N daggerdbl ; B 22 -143 491 666 ;
+C 180 ; WX 250 ; N periodcentered ; B 70 199 181 310 ;
+C 182 ; WX 523 ; N paragraph ; B 55 -123 616 653 ;
+C 183 ; WX 350 ; N bullet ; B 40 191 310 461 ;
+C 184 ; WX 333 ; N quotesinglbase ; B 44 -129 183 101 ;
+C 185 ; WX 556 ; N quotedblbase ; B 57 -129 405 101 ;
+C 186 ; WX 556 ; N quotedblright ; B 151 436 499 666 ;
+C 187 ; WX 500 ; N guillemotright ; B 55 37 447 403 ;
+C 188 ; WX 889 ; N ellipsis ; B 57 -11 762 100 ;
+C 189 ; WX 1000 ; N perthousand ; B 25 -19 1010 706 ;
+C 191 ; WX 500 ; N questiondown ; B 28 -205 367 473 ;
+C 193 ; WX 333 ; N grave ; B 121 492 311 664 ;
+C 194 ; WX 333 ; N acute ; B 180 494 403 664 ;
+C 195 ; WX 333 ; N circumflex ; B 91 492 385 661 ;
+C 196 ; WX 333 ; N tilde ; B 100 517 427 624 ;
+C 197 ; WX 333 ; N macron ; B 99 532 411 583 ;
+C 198 ; WX 333 ; N breve ; B 117 492 418 650 ;
+C 199 ; WX 333 ; N dotaccent ; B 207 508 305 606 ;
+C 200 ; WX 333 ; N dieresis ; B 107 508 405 606 ;
+C 202 ; WX 333 ; N ring ; B 155 508 355 707 ;
+C 203 ; WX 333 ; N cedilla ; B -30 -217 182 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 93 494 486 664 ;
+C 206 ; WX 333 ; N ogonek ; B -20 -169 200 40 ;
+C 207 ; WX 333 ; N caron ; B 121 492 426 661 ;
+C 208 ; WX 889 ; N emdash ; B -6 197 894 243 ;
+C 225 ; WX 889 ; N AE ; B -27 0 911 653 ;
+C 227 ; WX 276 ; N ordfeminine ; B 42 406 352 676 ;
+C 232 ; WX 556 ; N Lslash ; B -8 0 559 653 ;
+C 233 ; WX 722 ; N Oslash ; B 60 -105 699 722 ;
+C 234 ; WX 944 ; N OE ; B 49 -8 964 666 ;
+C 235 ; WX 310 ; N ordmasculine ; B 67 406 362 676 ;
+C 241 ; WX 667 ; N ae ; B 23 -11 640 441 ;
+C 245 ; WX 278 ; N dotlessi ; B 49 -11 235 441 ;
+C 248 ; WX 278 ; N lslash ; B 37 -11 307 683 ;
+C 249 ; WX 500 ; N oslash ; B 28 -135 469 554 ;
+C 250 ; WX 667 ; N oe ; B 20 -12 646 441 ;
+C 251 ; WX 500 ; N germandbls ; B -168 -207 493 679 ;
+C -1 ; WX 722 ; N Udieresis ; B 102 -18 765 818 ;
+C -1 ; WX 722 ; N Uacute ; B 102 -18 765 876 ;
+C -1 ; WX 500 ; N Scedilla ; B 17 -217 508 667 ;
+C -1 ; WX 556 ; N Tcaron ; B 59 0 633 873 ;
+C -1 ; WX 500 ; N Scaron ; B 17 -18 520 873 ;
+C -1 ; WX 611 ; N Rcaron ; B -13 0 588 873 ;
+C -1 ; WX 611 ; N Racute ; B -13 0 588 876 ;
+C -1 ; WX 500 ; N Sacute ; B 17 -18 508 876 ;
+C -1 ; WX 722 ; N Otilde ; B 60 -18 706 836 ;
+C -1 ; WX 500 ; N ucircumflex ; B 42 -11 475 661 ;
+C -1 ; WX 722 ; N Ohungarumlaut ; B 60 -18 706 876 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 102 -18 765 876 ;
+C -1 ; WX 556 ; N Yacute ; B 78 0 633 876 ;
+C -1 ; WX 722 ; N Eth ; B -8 0 700 653 ;
+C -1 ; WX 722 ; N Dcroat ; B -8 0 700 653 ;
+C -1 ; WX 556 ; N Zacute ; B -6 0 606 876 ;
+C -1 ; WX 722 ; N Uring ; B 102 -18 765 919 ;
+C -1 ; WX 500 ; N gbreve ; B 8 -206 502 650 ;
+C -1 ; WX 444 ; N eogonek ; B 31 -169 444 441 ;
+C -1 ; WX 444 ; N edotaccent ; B 31 -11 412 606 ;
+C -1 ; WX 444 ; N ecaron ; B 31 -11 482 661 ;
+C -1 ; WX 722 ; N Ugrave ; B 102 -18 765 876 ;
+C -1 ; WX 611 ; N Thorn ; B 0 0 569 653 ;
+C -1 ; WX 444 ; N eacute ; B 31 -11 459 664 ;
+C -1 ; WX 444 ; N edieresis ; B 31 -11 451 606 ;
+C -1 ; WX 521 ; N dcaron ; B 15 -13 641 683 ;
+C -1 ; WX 444 ; N ccedilla ; B 26 -217 425 441 ;
+C -1 ; WX 444 ; N ccaron ; B 30 -11 484 661 ;
+C -1 ; WX 444 ; N cacute ; B 30 -11 458 664 ;
+C -1 ; WX 500 ; N aogonek ; B 17 -169 500 441 ;
+C -1 ; WX 500 ; N aring ; B 17 -11 476 707 ;
+C -1 ; WX 500 ; N atilde ; B 17 -11 511 624 ;
+C -1 ; WX 500 ; N abreve ; B 17 -11 502 650 ;
+C -1 ; WX 444 ; N egrave ; B 31 -11 412 664 ;
+C -1 ; WX 500 ; N agrave ; B 17 -11 476 664 ;
+C -1 ; WX 500 ; N aacute ; B 17 -11 487 664 ;
+C -1 ; WX 500 ; N adieresis ; B 17 -11 489 606 ;
+C -1 ; WX 722 ; N Uogonek ; B 102 -169 765 653 ;
+C -1 ; WX 500 ; N ugrave ; B 42 -11 475 664 ;
+C -1 ; WX 500 ; N uacute ; B 42 -11 477 664 ;
+C -1 ; WX 500 ; N udieresis ; B 42 -11 479 606 ;
+C -1 ; WX 278 ; N tcaron ; B 37 -11 378 666 ;
+C -1 ; WX 389 ; N scommaaccent ; B 16 -270 366 442 ;
+C -1 ; WX 556 ; N Zcaron ; B -6 0 606 873 ;
+C -1 ; WX 444 ; N ecircumflex ; B 31 -11 441 661 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 102 -18 765 873 ;
+C -1 ; WX 500 ; N acircumflex ; B 17 -11 476 661 ;
+C -1 ; WX 556 ; N Zdotaccent ; B -6 0 606 818 ;
+C -1 ; WX 389 ; N scaron ; B 16 -13 454 661 ;
+C -1 ; WX 611 ; N Amacron ; B -51 0 564 795 ;
+C -1 ; WX 389 ; N sacute ; B 16 -13 431 664 ;
+C -1 ; WX 556 ; N Tcommaaccent ; B 59 -270 633 653 ;
+C -1 ; WX 556 ; N Ydieresis ; B 78 0 633 818 ;
+C -1 ; WX 500 ; N thorn ; B -75 -205 469 683 ;
+C -1 ; WX 611 ; N Emacron ; B -1 0 634 795 ;
+C -1 ; WX 722 ; N Ograve ; B 60 -18 706 876 ;
+C -1 ; WX 722 ; N Oacute ; B 60 -18 706 876 ;
+C -1 ; WX 722 ; N Odieresis ; B 60 -18 706 818 ;
+C -1 ; WX 667 ; N Ntilde ; B -20 -15 727 836 ;
+C -1 ; WX 667 ; N Ncaron ; B -20 -15 727 873 ;
+C -1 ; WX 667 ; N Nacute ; B -20 -15 727 876 ;
+C -1 ; WX 556 ; N Lcaron ; B -8 0 596 666 ;
+C -1 ; WX 556 ; N Lacute ; B -8 0 559 876 ;
+C -1 ; WX 333 ; N Idotaccent ; B -8 0 384 818 ;
+C -1 ; WX 389 ; N racute ; B 45 0 431 664 ;
+C -1 ; WX 333 ; N Icircumflex ; B -8 0 425 873 ;
+C -1 ; WX 500 ; N ohungarumlaut ; B 27 -11 570 664 ;
+C -1 ; WX 500 ; N otilde ; B 27 -11 496 624 ;
+C -1 ; WX 500 ; N Euro ; B 57 0 668 693 ;
+C -1 ; WX 500 ; N ocircumflex ; B 27 -11 468 661 ;
+C -1 ; WX 300 ; N onesuperior ; B 43 271 284 676 ;
+C -1 ; WX 300 ; N twosuperior ; B 33 271 324 676 ;
+C -1 ; WX 300 ; N threesuperior ; B 43 268 339 676 ;
+C -1 ; WX 333 ; N Igrave ; B -8 0 384 876 ;
+C -1 ; WX 333 ; N Iacute ; B -8 0 403 876 ;
+C -1 ; WX 333 ; N Imacron ; B -8 0 441 795 ;
+C -1 ; WX 333 ; N Iogonek ; B -8 -169 384 653 ;
+C -1 ; WX 333 ; N Idieresis ; B -8 0 435 818 ;
+C -1 ; WX 722 ; N Gbreve ; B 52 -18 722 862 ;
+C -1 ; WX 722 ; N Umacron ; B 102 -18 765 795 ;
+C -1 ; WX 667 ; N Kcommaaccent ; B 7 -270 722 653 ;
+C -1 ; WX 500 ; N ograve ; B 27 -11 468 664 ;
+C -1 ; WX 500 ; N Scommaaccent ; B 17 -270 508 667 ;
+C -1 ; WX 611 ; N Eogonek ; B -1 -169 651 653 ;
+C -1 ; WX 500 ; N oacute ; B 27 -11 487 664 ;
+C -1 ; WX 611 ; N Edotaccent ; B -1 0 634 818 ;
+C -1 ; WX 278 ; N iogonek ; B 49 -169 278 654 ;
+C -1 ; WX 500 ; N gcommaaccent ; B 8 -206 472 706 ;
+C -1 ; WX 500 ; N odieresis ; B 27 -11 489 606 ;
+C -1 ; WX 500 ; N ntilde ; B 14 -9 476 624 ;
+C -1 ; WX 500 ; N ncaron ; B 14 -9 510 661 ;
+C -1 ; WX 611 ; N Ecaron ; B -1 0 634 873 ;
+C -1 ; WX 611 ; N Ecircumflex ; B -1 0 634 873 ;
+C -1 ; WX 389 ; N scedilla ; B -2 -217 366 442 ;
+C -1 ; WX 389 ; N rcaron ; B 45 0 454 661 ;
+C -1 ; WX 611 ; N Egrave ; B -1 0 634 876 ;
+C -1 ; WX 611 ; N Eacute ; B -1 0 634 876 ;
+C -1 ; WX 722 ; N Gcommaaccent ; B 52 -270 722 666 ;
+C -1 ; WX 611 ; N Rcommaaccent ; B -13 -270 588 653 ;
+C -1 ; WX 611 ; N Edieresis ; B -1 0 634 818 ;
+C -1 ; WX 500 ; N nacute ; B 14 -9 487 664 ;
+C -1 ; WX 500 ; N uogonek ; B 42 -169 500 441 ;
+C -1 ; WX 500 ; N umacron ; B 42 -11 495 583 ;
+C -1 ; WX 722 ; N Dcaron ; B -8 0 700 873 ;
+C -1 ; WX 278 ; N lcaron ; B 40 -11 395 683 ;
+C -1 ; WX 667 ; N Ccaron ; B 66 -18 689 873 ;
+C -1 ; WX 667 ; N Cacute ; B 66 -18 689 876 ;
+C -1 ; WX 667 ; N Ccedilla ; B 66 -217 689 666 ;
+C -1 ; WX 400 ; N degree ; B 101 390 387 676 ;
+C -1 ; WX 611 ; N Aogonek ; B -51 -169 707 668 ;
+C -1 ; WX 675 ; N minus ; B 86 220 590 286 ;
+C -1 ; WX 675 ; N multiply ; B 93 8 582 497 ;
+C -1 ; WX 675 ; N divide ; B 86 -11 590 517 ;
+C -1 ; WX 611 ; N Aring ; B -51 0 564 904 ;
+C -1 ; WX 980 ; N trademark ; B 30 247 957 653 ;
+C -1 ; WX 389 ; N rcommaaccent ; B 35 -270 412 441 ;
+C -1 ; WX 278 ; N lacute ; B 40 -11 376 876 ;
+C -1 ; WX 500 ; N omacron ; B 27 -11 495 583 ;
+C -1 ; WX 611 ; N Atilde ; B -51 0 566 836 ;
+C -1 ; WX 278 ; N icircumflex ; B 34 -11 328 661 ;
+C -1 ; WX 278 ; N igrave ; B 49 -11 284 664 ;
+C -1 ; WX 500 ; N ncommaaccent ; B 14 -270 474 441 ;
+C -1 ; WX 278 ; N lcommaaccent ; B -21 -270 279 683 ;
+C -1 ; WX 675 ; N plusminus ; B 86 0 590 568 ;
+C -1 ; WX 750 ; N onehalf ; B 34 -10 749 676 ;
+C -1 ; WX 750 ; N onequarter ; B 33 -10 736 676 ;
+C -1 ; WX 750 ; N threequarters ; B 23 -10 736 676 ;
+C -1 ; WX 278 ; N iacute ; B 49 -11 356 664 ;
+C -1 ; WX 611 ; N Abreve ; B -51 0 564 862 ;
+C -1 ; WX 444 ; N kcommaaccent ; B 14 -270 461 683 ;
+C -1 ; WX 722 ; N Omacron ; B 60 -18 706 795 ;
+C -1 ; WX 278 ; N imacron ; B 49 -11 384 583 ;
+C -1 ; WX 444 ; N emacron ; B 31 -11 467 583 ;
+C -1 ; WX 500 ; N amacron ; B 17 -11 495 583 ;
+C -1 ; WX 278 ; N tcommaaccent ; B -21 -270 296 546 ;
+C -1 ; WX 444 ; N ydieresis ; B -24 -206 441 606 ;
+C -1 ; WX 389 ; N zdotaccent ; B -2 -81 380 606 ;
+C -1 ; WX 389 ; N zcaron ; B -2 -81 434 661 ;
+C -1 ; WX 389 ; N zacute ; B -2 -81 431 664 ;
+C -1 ; WX 444 ; N yacute ; B -24 -206 459 664 ;
+C -1 ; WX 500 ; N uhungarumlaut ; B 42 -11 570 664 ;
+C -1 ; WX 500 ; N eth ; B 27 -11 482 683 ;
+C -1 ; WX 500 ; N uring ; B 42 -11 475 707 ;
+C -1 ; WX 722 ; N Ocircumflex ; B 60 -18 706 873 ;
+C -1 ; WX 333 ; N commaaccent ; B 7 -270 146 -40 ;
+C -1 ; WX 760 ; N copyright ; B 41 -18 719 666 ;
+C -1 ; WX 760 ; N registered ; B 41 -18 719 666 ;
+C -1 ; WX 611 ; N Acircumflex ; B -51 0 564 873 ;
+C -1 ; WX 278 ; N idieresis ; B 49 -11 353 606 ;
+C -1 ; WX 494 ; N lozenge ; B 18 0 466 740 ;
+C -1 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C -1 ; WX 564 ; N notequal ; B 30 -3 534 509 ;
+C -1 ; WX 549 ; N radical ; B -2 -65 526 924 ;
+C -1 ; WX 611 ; N Agrave ; B -51 0 564 876 ;
+C -1 ; WX 611 ; N Aacute ; B -51 0 564 876 ;
+C -1 ; WX 675 ; N lessequal ; B 84 0 592 628 ;
+C -1 ; WX 675 ; N greaterequal ; B 84 0 592 628 ;
+C -1 ; WX 675 ; N logicalnot ; B 86 108 590 386 ;
+C -1 ; WX 713 ; N summation ; B 14 -123 695 752 ;
+C -1 ; WX 494 ; N partialdiff ; B 26 -10 462 753 ;
+C -1 ; WX 667 ; N Ncommaaccent ; B -20 -270 727 653 ;
+C -1 ; WX 500 ; N dcroat ; B 15 -13 558 683 ;
+C -1 ; WX 275 ; N brokenbar ; B 105 -18 171 666 ;
+C -1 ; WX 556 ; N Lcommaaccent ; B -8 -270 559 653 ;
+C -1 ; WX 611 ; N Adieresis ; B -51 0 564 818 ;
+C -1 ; WX 500 ; N mu ; B -30 -209 497 428 ;
+C -1 ; WX 250 ; N .notdef ; B 125 0 125 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 998
+KPX A C -50
+KPX A Ccedilla -50
+KPX A G -44
+KPX A O -45
+KPX A Odieresis -45
+KPX A Q -44
+KPX A T -14
+KPX A U -57
+KPX A Uacute -57
+KPX A Ucircumflex -57
+KPX A Udieresis -57
+KPX A Ugrave -57
+KPX A V -81
+KPX A W -75
+KPX A Y -21
+KPX A a -4
+KPX A b 0
+KPX A c -18
+KPX A ccedilla -28
+KPX A comma 8
+KPX A d -4
+KPX A e -17
+KPX A g -25
+KPX A guillemotleft -44
+KPX A guilsinglleft -43
+KPX A hyphen -13
+KPX A o -17
+KPX A period 8
+KPX A q -12
+KPX A quotedblright -92
+KPX A quoteright -92
+KPX A t -6
+KPX A u -9
+KPX A v -50
+KPX A w -44
+KPX A y -57
+KPX Aacute C -50
+KPX Aacute G -44
+KPX Aacute O -45
+KPX Aacute Q -44
+KPX Aacute T -14
+KPX Aacute U -57
+KPX Aacute V -81
+KPX Aacute W -75
+KPX Aacute Y -21
+KPX Aacute a -4
+KPX Aacute b 0
+KPX Aacute c -18
+KPX Aacute comma 8
+KPX Aacute d -4
+KPX Aacute e -17
+KPX Aacute g -25
+KPX Aacute guillemotleft -44
+KPX Aacute guilsinglleft -43
+KPX Aacute hyphen -13
+KPX Aacute o -17
+KPX Aacute period 8
+KPX Aacute q -12
+KPX Aacute quoteright -92
+KPX Aacute t -6
+KPX Aacute u -9
+KPX Aacute v -50
+KPX Aacute w -44
+KPX Aacute y -57
+KPX Acircumflex C -50
+KPX Acircumflex G -44
+KPX Acircumflex O -45
+KPX Acircumflex Q -44
+KPX Acircumflex T -14
+KPX Acircumflex U -57
+KPX Acircumflex V -81
+KPX Acircumflex W -75
+KPX Acircumflex Y -21
+KPX Acircumflex comma 8
+KPX Acircumflex period 8
+KPX Adieresis C -50
+KPX Adieresis G -44
+KPX Adieresis O -45
+KPX Adieresis Q -44
+KPX Adieresis T -14
+KPX Adieresis U -57
+KPX Adieresis V -81
+KPX Adieresis W -75
+KPX Adieresis Y -21
+KPX Adieresis a -4
+KPX Adieresis b 0
+KPX Adieresis c -18
+KPX Adieresis comma 8
+KPX Adieresis d -4
+KPX Adieresis g -25
+KPX Adieresis guillemotleft -44
+KPX Adieresis guilsinglleft -43
+KPX Adieresis hyphen -13
+KPX Adieresis o -17
+KPX Adieresis period 8
+KPX Adieresis q -12
+KPX Adieresis quotedblright -92
+KPX Adieresis quoteright -92
+KPX Adieresis t -6
+KPX Adieresis u -9
+KPX Adieresis v -50
+KPX Adieresis w -44
+KPX Adieresis y -57
+KPX Agrave C -50
+KPX Agrave G -44
+KPX Agrave O -45
+KPX Agrave Q -44
+KPX Agrave T -14
+KPX Agrave U -57
+KPX Agrave V -81
+KPX Agrave W -75
+KPX Agrave Y -21
+KPX Agrave comma 8
+KPX Agrave period 8
+KPX Aring C -50
+KPX Aring G -44
+KPX Aring O -45
+KPX Aring Q -44
+KPX Aring T -14
+KPX Aring U -57
+KPX Aring V -81
+KPX Aring W -75
+KPX Aring Y -21
+KPX Aring a -4
+KPX Aring b 0
+KPX Aring c -18
+KPX Aring comma 8
+KPX Aring d -4
+KPX Aring e -17
+KPX Aring g -25
+KPX Aring guillemotleft -44
+KPX Aring guilsinglleft -43
+KPX Aring hyphen -13
+KPX Aring o -17
+KPX Aring period 8
+KPX Aring q -12
+KPX Aring quotedblright -92
+KPX Aring quoteright -92
+KPX Aring t -6
+KPX Aring u -9
+KPX Aring v -50
+KPX Aring w -44
+KPX Aring y -57
+KPX Atilde C -50
+KPX Atilde G -44
+KPX Atilde O -45
+KPX Atilde Q -44
+KPX Atilde T -14
+KPX Atilde U -57
+KPX Atilde V -81
+KPX Atilde W -75
+KPX Atilde Y -21
+KPX Atilde comma 7
+KPX Atilde period 7
+KPX B A -23
+KPX B AE -35
+KPX B Aacute -23
+KPX B Acircumflex -23
+KPX B Adieresis -23
+KPX B Aring -23
+KPX B Atilde -23
+KPX B O -14
+KPX B OE -6
+KPX B Oacute -14
+KPX B Ocircumflex -14
+KPX B Odieresis -14
+KPX B Ograve -14
+KPX B Oslash -14
+KPX B V -32
+KPX B W -29
+KPX B Y -39
+KPX C A -14
+KPX C AE -30
+KPX C Aacute -14
+KPX C Adieresis -14
+KPX C Aring -14
+KPX C H -13
+KPX C K -21
+KPX C O -19
+KPX C Oacute -19
+KPX C Odieresis -19
+KPX Ccedilla A -18
+KPX D A -36
+KPX D Aacute -36
+KPX D Acircumflex -36
+KPX D Adieresis -36
+KPX D Agrave -36
+KPX D Aring -36
+KPX D Atilde -36
+KPX D J -32
+KPX D T -9
+KPX D V -42
+KPX D W -36
+KPX D X -40
+KPX D Y -50
+KPX F A -72
+KPX F Aacute -72
+KPX F Acircumflex -72
+KPX F Adieresis -72
+KPX F Agrave -72
+KPX F Aring -72
+KPX F Atilde -72
+KPX F J -60
+KPX F O -40
+KPX F Odieresis -40
+KPX F a -77
+KPX F aacute -78
+KPX F adieresis -52
+KPX F ae -82
+KPX F aring -70
+KPX F comma -95
+KPX F e -83
+KPX F eacute -83
+KPX F hyphen -45
+KPX F i -36
+KPX F j -41
+KPX F o -79
+KPX F oacute -79
+KPX F odieresis -52
+KPX F oe -75
+KPX F oslash -80
+KPX F period -99
+KPX F r -52
+KPX F u -50
+KPX G A -17
+KPX G AE -29
+KPX G Aacute -17
+KPX G Acircumflex -17
+KPX G Adieresis -17
+KPX G Agrave -17
+KPX G Aring -17
+KPX G Atilde -17
+KPX G T -13
+KPX G V -5
+KPX G W -2
+KPX G Y -12
+KPX J A -40
+KPX J AE -52
+KPX J Adieresis -40
+KPX J Aring -40
+KPX K C -55
+KPX K G -53
+KPX K O -46
+KPX K OE -45
+KPX K Oacute -46
+KPX K Odieresis -46
+KPX K S 6
+KPX K T 21
+KPX K a -5
+KPX K adieresis -5
+KPX K ae -5
+KPX K aring -5
+KPX K e -18
+KPX K hyphen -57
+KPX K o -18
+KPX K oacute -18
+KPX K odieresis -18
+KPX K u -10
+KPX K udieresis -10
+KPX K y -89
+KPX L A 44
+KPX L AE 32
+KPX L Aacute 44
+KPX L Adieresis 44
+KPX L Aring 44
+KPX L C 6
+KPX L Ccedilla 4
+KPX L G 11
+KPX L O 10
+KPX L Oacute 10
+KPX L Ocircumflex 10
+KPX L Odieresis 10
+KPX L Ograve 10
+KPX L Otilde 10
+KPX L S 20
+KPX L T -13
+KPX L U -8
+KPX L Udieresis -8
+KPX L V -55
+KPX L W -48
+KPX L Y -20
+KPX L hyphen 47
+KPX L quotedblright -92
+KPX L quoteright -92
+KPX L u 12
+KPX L udieresis 10
+KPX L y -26
+KPX N A -20
+KPX N AE -32
+KPX N Aacute -20
+KPX N Adieresis -20
+KPX N Aring -20
+KPX N C -21
+KPX N Ccedilla -20
+KPX N G -14
+KPX N O -20
+KPX N Oacute -20
+KPX N Odieresis -20
+KPX N a -22
+KPX N aacute -23
+KPX N adieresis -23
+KPX N ae -27
+KPX N aring -23
+KPX N comma -13
+KPX N e -28
+KPX N eacute -30
+KPX N o -25
+KPX N oacute -27
+KPX N odieresis -27
+KPX N oslash -27
+KPX N period -16
+KPX N u -24
+KPX N udieresis -25
+KPX O A -38
+KPX O AE -70
+KPX O Aacute -38
+KPX O Adieresis -38
+KPX O Aring -38
+KPX O T -3
+KPX O V -45
+KPX O W -39
+KPX O X -41
+KPX O Y -51
+KPX Oacute A -38
+KPX Oacute T -3
+KPX Oacute V -45
+KPX Oacute W -39
+KPX Oacute Y -51
+KPX Ocircumflex T -3
+KPX Ocircumflex V -45
+KPX Ocircumflex Y -51
+KPX Odieresis A -38
+KPX Odieresis T -3
+KPX Odieresis V -45
+KPX Odieresis W -39
+KPX Odieresis X -41
+KPX Odieresis Y -51
+KPX Ograve T -3
+KPX Ograve V -45
+KPX Ograve Y -51
+KPX Oslash A -38
+KPX Otilde T -3
+KPX Otilde V -45
+KPX Otilde Y -51
+KPX P A -79
+KPX P AE -116
+KPX P Aacute -79
+KPX P Adieresis -79
+KPX P Aring -79
+KPX P J -89
+KPX P a -74
+KPX P aacute -74
+KPX P adieresis -64
+KPX P ae -80
+KPX P aring -74
+KPX P comma -118
+KPX P e -79
+KPX P eacute -79
+KPX P hyphen -64
+KPX P o -73
+KPX P oacute -73
+KPX P odieresis -64
+KPX P oe -67
+KPX P oslash -74
+KPX P period -121
+KPX R C -26
+KPX R Ccedilla -25
+KPX R G -20
+KPX R O -26
+KPX R OE -18
+KPX R Oacute -26
+KPX R Odieresis -26
+KPX R T 0
+KPX R U -36
+KPX R Udieresis -36
+KPX R V -31
+KPX R W -28
+KPX R Y -19
+KPX R a -3
+KPX R aacute -3
+KPX R adieresis -3
+KPX R ae -3
+KPX R aring -3
+KPX R e -15
+KPX R eacute -15
+KPX R hyphen -29
+KPX R o -15
+KPX R oacute -15
+KPX R odieresis -15
+KPX R oe -15
+KPX R u -7
+KPX R uacute -7
+KPX R udieresis -7
+KPX R y 0
+KPX S A -2
+KPX S AE -14
+KPX S Aacute -2
+KPX S Adieresis -2
+KPX S Aring -2
+KPX S T 1
+KPX S V 5
+KPX S W 8
+KPX S Y -1
+KPX S t -13
+KPX T A -33
+KPX T AE -45
+KPX T Aacute -33
+KPX T Acircumflex -33
+KPX T Adieresis -33
+KPX T Agrave -33
+KPX T Aring -33
+KPX T Atilde -33
+KPX T C -15
+KPX T G -7
+KPX T J -39
+KPX T O -20
+KPX T OE -8
+KPX T Oacute -20
+KPX T Ocircumflex -20
+KPX T Odieresis -20
+KPX T Ograve -20
+KPX T Oslash -20
+KPX T Otilde -20
+KPX T S -2
+KPX T V 41
+KPX T W 43
+KPX T Y 33
+KPX T a -81
+KPX T ae -81
+KPX T c -86
+KPX T colon -84
+KPX T comma -70
+KPX T e -90
+KPX T g -102
+KPX T guillemotleft -102
+KPX T guilsinglleft -101
+KPX T hyphen -68
+KPX T i -16
+KPX T j -20
+KPX T o -87
+KPX T oslash -89
+KPX T period -71
+KPX T r -87
+KPX T s -74
+KPX T semicolon -92
+KPX T u -86
+KPX T v -72
+KPX T w -69
+KPX T y -70
+KPX U A -50
+KPX U AE -69
+KPX U Aacute -50
+KPX U Acircumflex -50
+KPX U Adieresis -50
+KPX U Aring -50
+KPX U Atilde -50
+KPX U comma -35
+KPX U m -28
+KPX U n -29
+KPX U p -32
+KPX U period -39
+KPX U r -41
+KPX Uacute A -50
+KPX Uacute comma -35
+KPX Uacute m -28
+KPX Uacute n -29
+KPX Uacute p -32
+KPX Uacute period -39
+KPX Uacute r -41
+KPX Ucircumflex A -50
+KPX Udieresis A -50
+KPX Udieresis b 1
+KPX Udieresis comma -35
+KPX Udieresis m -28
+KPX Udieresis n -29
+KPX Udieresis p -32
+KPX Udieresis period -39
+KPX Udieresis r -41
+KPX Ugrave A -50
+KPX V A -66
+KPX V AE -102
+KPX V Aacute -66
+KPX V Acircumflex -66
+KPX V Adieresis -66
+KPX V Agrave -66
+KPX V Aring -66
+KPX V Atilde -66
+KPX V C -48
+KPX V G -42
+KPX V O -48
+KPX V Oacute -48
+KPX V Ocircumflex -48
+KPX V Odieresis -48
+KPX V Ograve -48
+KPX V Oslash -48
+KPX V Otilde -48
+KPX V S -15
+KPX V T 32
+KPX V a -67
+KPX V ae -72
+KPX V colon -82
+KPX V comma -76
+KPX V e -74
+KPX V g -84
+KPX V guillemotleft -82
+KPX V guilsinglleft -81
+KPX V hyphen -45
+KPX V i -16
+KPX V o -70
+KPX V oslash -72
+KPX V period -80
+KPX V r -45
+KPX V semicolon -79
+KPX V u -40
+KPX V y -16
+KPX W A -57
+KPX W AE -85
+KPX W Aacute -57
+KPX W Acircumflex -57
+KPX W Adieresis -57
+KPX W Agrave -57
+KPX W Aring -57
+KPX W Atilde -57
+KPX W C -39
+KPX W G -33
+KPX W O -39
+KPX W Oacute -39
+KPX W Ocircumflex -39
+KPX W Odieresis -39
+KPX W Ograve -39
+KPX W Oslash -39
+KPX W Otilde -39
+KPX W S -17
+KPX W T 30
+KPX W a -53
+KPX W ae -58
+KPX W colon -77
+KPX W comma -58
+KPX W e -60
+KPX W g -75
+KPX W guillemotleft -68
+KPX W guilsinglleft -67
+KPX W hyphen -32
+KPX W i -18
+KPX W o -56
+KPX W oslash -58
+KPX W period -62
+KPX W r -40
+KPX W semicolon -74
+KPX W u -35
+KPX W y -11
+KPX X C -50
+KPX X O -44
+KPX X Odieresis -44
+KPX X Q -42
+KPX X a -3
+KPX X e -15
+KPX X hyphen -41
+KPX X o -15
+KPX X u -7
+KPX X y -67
+KPX Y A -27
+KPX Y AE -39
+KPX Y Aacute -27
+KPX Y Acircumflex -27
+KPX Y Adieresis -27
+KPX Y Agrave -27
+KPX Y Aring -27
+KPX Y Atilde -27
+KPX Y C -52
+KPX Y G -45
+KPX Y O -52
+KPX Y Oacute -52
+KPX Y Ocircumflex -52
+KPX Y Odieresis -52
+KPX Y Ograve -52
+KPX Y Oslash -52
+KPX Y Otilde -52
+KPX Y S -15
+KPX Y T 32
+KPX Y a -72
+KPX Y ae -75
+KPX Y colon -78
+KPX Y comma -64
+KPX Y e -78
+KPX Y g -94
+KPX Y guillemotleft -93
+KPX Y guilsinglleft -92
+KPX Y hyphen -60
+KPX Y i -16
+KPX Y o -75
+KPX Y oslash -77
+KPX Y p -52
+KPX Y period -65
+KPX Y semicolon -86
+KPX Y u -58
+KPX Y v -32
+KPX Z v -12
+KPX Z y -28
+KPX a j -22
+KPX a quoteright -28
+KPX a v 1
+KPX a w 4
+KPX a y 2
+KPX aacute v 1
+KPX aacute w 4
+KPX aacute y 2
+KPX adieresis v 1
+KPX adieresis w 4
+KPX adieresis y 2
+KPX ae v 2
+KPX ae w 5
+KPX ae y 6
+KPX agrave v 1
+KPX agrave w 4
+KPX agrave y 2
+KPX aring v 1
+KPX aring w 4
+KPX aring y 2
+KPX b v -10
+KPX b w -7
+KPX b y -3
+KPX c h -30
+KPX c k -29
+KPX comma one -40
+KPX comma quotedblright -39
+KPX comma quoteright -39
+KPX e quoteright -21
+KPX e t -16
+KPX e v 0
+KPX e w 2
+KPX e x -10
+KPX e y 4
+KPX eacute v 0
+KPX eacute w 2
+KPX eacute y 4
+KPX ecircumflex v 0
+KPX ecircumflex w 2
+KPX ecircumflex y 4
+KPX eight four 13
+KPX eight one -50
+KPX eight seven -1
+KPX f a -26
+KPX f aacute -27
+KPX f adieresis -2
+KPX f ae -30
+KPX f aring -17
+KPX f e -32
+KPX f eacute -34
+KPX f f 30
+KPX f i 17
+KPX f j 13
+KPX f l 42
+KPX f o -29
+KPX f oacute -30
+KPX f odieresis -2
+KPX f oe -24
+KPX f oslash -31
+KPX f quoteright 18
+KPX f s -20
+KPX f t 18
+KPX five four -5
+KPX five one -71
+KPX five seven -28
+KPX four four 12
+KPX four one -69
+KPX four seven -27
+KPX g a -41
+KPX g adieresis -42
+KPX g ae -46
+KPX g aring -42
+KPX g e -45
+KPX g eacute -45
+KPX g l -46
+KPX g oacute -41
+KPX g odieresis -41
+KPX g r -21
+KPX guillemotright A -25
+KPX guillemotright AE -51
+KPX guillemotright Aacute -25
+KPX guillemotright Adieresis -25
+KPX guillemotright Aring -25
+KPX guillemotright T -77
+KPX guillemotright V -76
+KPX guillemotright W -67
+KPX guillemotright Y -81
+KPX guilsinglright A -24
+KPX guilsinglright AE -50
+KPX guilsinglright Aacute -24
+KPX guilsinglright Adieresis -24
+KPX guilsinglright Aring -24
+KPX guilsinglright T -76
+KPX guilsinglright V -75
+KPX guilsinglright W -66
+KPX guilsinglright Y -80
+KPX h quoteright -31
+KPX h y -4
+KPX hyphen A 3
+KPX hyphen AE -23
+KPX hyphen Aacute 3
+KPX hyphen Adieresis 3
+KPX hyphen Aring 3
+KPX hyphen T -46
+KPX hyphen V -43
+KPX hyphen W -34
+KPX hyphen Y -53
+KPX i T -10
+KPX i j -31
+KPX k a 12
+KPX k aacute 12
+KPX k adieresis 12
+KPX k ae 9
+KPX k aring 12
+KPX k comma 27
+KPX k e 5
+KPX k eacute 5
+KPX k g -27
+KPX k hyphen -27
+KPX k o 6
+KPX k oacute 6
+KPX k odieresis 6
+KPX k period 26
+KPX k s 7
+KPX k u 8
+KPX k udieresis 8
+KPX l v -12
+KPX l y -11
+KPX m p -4
+KPX m v -6
+KPX m w -4
+KPX m y -3
+KPX n T -41
+KPX n p -7
+KPX n quoteright -34
+KPX n v -10
+KPX n w -7
+KPX n y -6
+KPX nine four 2
+KPX nine one -64
+KPX nine seven -5
+KPX o T -63
+KPX o quoteright -24
+KPX o t -15
+KPX o v -18
+KPX o w -15
+KPX o x -33
+KPX o y -10
+KPX oacute v -18
+KPX oacute w -15
+KPX oacute y -10
+KPX ocircumflex t -16
+KPX odieresis t -16
+KPX odieresis v -18
+KPX odieresis w -15
+KPX odieresis x -33
+KPX odieresis y -10
+KPX ograve v -18
+KPX ograve w -15
+KPX ograve y -10
+KPX one comma -52
+KPX one eight -57
+KPX one five -55
+KPX one four -69
+KPX one nine -61
+KPX one one -69
+KPX one period -56
+KPX one seven -60
+KPX one six -50
+KPX one three -55
+KPX one two -50
+KPX one zero -41
+KPX p t -14
+KPX p y -4
+KPX period one -39
+KPX period quotedblright -38
+KPX period quoteright -38
+KPX q c -13
+KPX q u -11
+KPX quotedblbase A 1
+KPX quotedblbase AE -13
+KPX quotedblbase T -64
+KPX quotedblbase V -96
+KPX quotedblbase W -84
+KPX quotedblbase Y -69
+KPX quotedblleft A -88
+KPX quotedblleft AE -141
+KPX quotedblleft Aacute -88
+KPX quotedblleft Adieresis -88
+KPX quotedblleft Aring -88
+KPX quotedblleft T -19
+KPX quotedblleft V -17
+KPX quotedblleft W -15
+KPX quotedblleft Y -25
+KPX quotedblright A -94
+KPX quotedblright AE -147
+KPX quotedblright Aacute -94
+KPX quotedblright Adieresis -94
+KPX quotedblright Aring -94
+KPX quotedblright T -21
+KPX quotedblright V -22
+KPX quotedblright W -19
+KPX quotedblright Y -30
+KPX quoteleft A -78
+KPX quoteleft AE -131
+KPX quoteleft Aacute -78
+KPX quoteleft Adieresis -78
+KPX quoteleft Aring -78
+KPX quoteleft T -9
+KPX quoteleft V -8
+KPX quoteleft W -5
+KPX quoteleft Y -15
+KPX quoteright A -87
+KPX quoteright AE -140
+KPX quoteright Aacute -87
+KPX quoteright Adieresis -87
+KPX quoteright Aring -87
+KPX quoteright comma -73
+KPX quoteright d -79
+KPX quoteright o -78
+KPX quoteright period -78
+KPX quoteright r -57
+KPX quoteright s -63
+KPX quoteright t -49
+KPX quoteright v -28
+KPX quoteright w -26
+KPX quoteright y -28
+KPX r a -29
+KPX r aacute -29
+KPX r acircumflex -29
+KPX r adieresis -29
+KPX r ae -36
+KPX r agrave -29
+KPX r aring -29
+KPX r c -26
+KPX r ccedilla -17
+KPX r colon -28
+KPX r comma -68
+KPX r d -31
+KPX r e -35
+KPX r eacute -35
+KPX r ecircumflex -35
+KPX r egrave -35
+KPX r f 23
+KPX r g -21
+KPX r h -17
+KPX r hyphen -52
+KPX r i 8
+KPX r j 4
+KPX r k -15
+KPX r l -21
+KPX r m 17
+KPX r n 16
+KPX r o -28
+KPX r oacute -28
+KPX r ocircumflex -28
+KPX r odieresis -28
+KPX r oe -23
+KPX r ograve -28
+KPX r oslash -29
+KPX r p 13
+KPX r period -72
+KPX r q -31
+KPX r quoteright -4
+KPX r r 4
+KPX r s -17
+KPX r semicolon -28
+KPX r t 12
+KPX r u 11
+KPX r v 30
+KPX r w 32
+KPX r x 7
+KPX r y 33
+KPX r z 0
+KPX s quoteright -20
+KPX s t -12
+KPX seven colon -88
+KPX seven comma -79
+KPX seven eight -32
+KPX seven five -53
+KPX seven four -65
+KPX seven one -47
+KPX seven period -83
+KPX seven seven -11
+KPX seven six -37
+KPX seven three -42
+KPX seven two -13
+KPX six four 17
+KPX six one -64
+KPX six seven -37
+KPX t S -9
+KPX t a -6
+KPX t aacute -6
+KPX t adieresis -6
+KPX t ae -10
+KPX t aring -6
+KPX t colon -29
+KPX t e -13
+KPX t eacute -13
+KPX t h -11
+KPX t o -11
+KPX t oacute -11
+KPX t odieresis -11
+KPX t quoteright -19
+KPX t semicolon -26
+KPX three four -9
+KPX three one -76
+KPX three seven -15
+KPX two four -12
+KPX two one -45
+KPX two seven -22
+KPX u quoteright -31
+KPX v a -24
+KPX v aacute -26
+KPX v acircumflex -26
+KPX v adieresis -26
+KPX v ae -29
+KPX v agrave -26
+KPX v aring -26
+KPX v atilde -26
+KPX v c -26
+KPX v colon -48
+KPX v comma -46
+KPX v e -30
+KPX v eacute -32
+KPX v ecircumflex -32
+KPX v egrave -32
+KPX v g -36
+KPX v hyphen 0
+KPX v l -29
+KPX v o -26
+KPX v oacute -28
+KPX v odieresis -28
+KPX v ograve -28
+KPX v oslash -29
+KPX v period -51
+KPX v s -30
+KPX v semicolon -48
+KPX w a -26
+KPX w aacute -28
+KPX w acircumflex -28
+KPX w adieresis -28
+KPX w ae -31
+KPX w agrave -28
+KPX w aring -28
+KPX w atilde -28
+KPX w c -28
+KPX w colon -49
+KPX w comma -47
+KPX w e -32
+KPX w eacute -34
+KPX w ecircumflex -34
+KPX w egrave -34
+KPX w g -38
+KPX w hyphen -4
+KPX w l -30
+KPX w o -28
+KPX w oacute -30
+KPX w odieresis -30
+KPX w ograve -30
+KPX w oslash -31
+KPX w period -51
+KPX w s -32
+KPX w semicolon -49
+KPX x a 6
+KPX x c 0
+KPX x e 0
+KPX x eacute 0
+KPX x o 1
+KPX x q 2
+KPX y a -12
+KPX y aacute -12
+KPX y acircumflex -12
+KPX y adieresis -12
+KPX y ae -17
+KPX y agrave -12
+KPX y aring -12
+KPX y atilde -12
+KPX y c -15
+KPX y colon -48
+KPX y comma -21
+KPX y e -19
+KPX y eacute -19
+KPX y ecircumflex -19
+KPX y egrave -19
+KPX y g -34
+KPX y hyphen 7
+KPX y l -18
+KPX y o -15
+KPX y oacute -15
+KPX y odieresis -15
+KPX y ograve -15
+KPX y oslash -16
+KPX y period -25
+KPX y s -19
+KPX y semicolon -45
+KPX zero four 14
+KPX zero one -50
+KPX zero seven -3
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/pdf2swf/fonts/n021023l.pfb b/pdf2swf/fonts/n021023l.pfb
new file mode 100644
index 00000000..aa9ff5f8
--- /dev/null
+++ b/pdf2swf/fonts/n021023l.pfb
Binary files differ
diff --git a/pdf2swf/fonts/n021024l.afm b/pdf2swf/fonts/n021024l.afm
new file mode 100644
index 00000000..0833e4f0
--- /dev/null
+++ b/pdf2swf/fonts/n021024l.afm
@@ -0,0 +1,1341 @@
+StartFontMetrics 3.0
+Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development
+Comment Creation Date: 12/22/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName NimbusRomNo9L-MediItal
+FullName Nimbus Roman No9 L Medium Italic
+FamilyName Nimbus Roman No9 L
+Weight Bold
+ItalicAngle -15.0
+IsFixedPitch false
+UnderlinePosition -100
+UnderlineThickness 50
+Version 1.05
+Notice (URW)++,Copyright 1999 by (URW)++ Design & Development
+EncodingScheme AdobeStandardEncoding
+FontBBox -200 -324 996 964
+CapHeight 669
+XHeight 449
+Descender -205
+Ascender 699
+StartCharMetrics 316
+C 32 ; WX 250 ; N space ; B 125 0 125 0 ;
+C 33 ; WX 389 ; N exclam ; B 67 -13 370 684 ;
+C 34 ; WX 555 ; N quotedbl ; B 136 398 536 685 ;
+C 35 ; WX 500 ; N numbersign ; B -33 0 533 700 ;
+C 36 ; WX 500 ; N dollar ; B -20 -100 497 733 ;
+C 37 ; WX 833 ; N percent ; B 39 -10 793 692 ;
+C 38 ; WX 778 ; N ampersand ; B 5 -19 699 682 ;
+C 39 ; WX 333 ; N quoteright ; B 98 369 302 685 ;
+C 40 ; WX 333 ; N parenleft ; B 28 -179 344 685 ;
+C 41 ; WX 333 ; N parenright ; B -44 -179 271 685 ;
+C 42 ; WX 500 ; N asterisk ; B 65 252 456 685 ;
+C 43 ; WX 570 ; N plus ; B 33 0 537 506 ;
+C 44 ; WX 250 ; N comma ; B -60 -182 144 134 ;
+C 45 ; WX 333 ; N hyphen ; B 2 166 271 282 ;
+C 46 ; WX 250 ; N period ; B -9 -13 139 135 ;
+C 47 ; WX 278 ; N slash ; B -64 -18 342 685 ;
+C 48 ; WX 500 ; N zero ; B 17 -14 477 683 ;
+C 49 ; WX 500 ; N one ; B 5 0 419 683 ;
+C 50 ; WX 500 ; N two ; B -27 0 446 683 ;
+C 51 ; WX 500 ; N three ; B -15 -13 450 683 ;
+C 52 ; WX 500 ; N four ; B -15 0 503 683 ;
+C 53 ; WX 500 ; N five ; B -11 -13 487 669 ;
+C 54 ; WX 500 ; N six ; B 23 -15 509 679 ;
+C 55 ; WX 500 ; N seven ; B 52 0 525 669 ;
+C 56 ; WX 500 ; N eight ; B 3 -13 476 683 ;
+C 57 ; WX 500 ; N nine ; B -12 -10 475 683 ;
+C 58 ; WX 333 ; N colon ; B 23 -13 264 459 ;
+C 59 ; WX 333 ; N semicolon ; B -25 -183 264 459 ;
+C 60 ; WX 570 ; N less ; B 31 -12 539 518 ;
+C 61 ; WX 570 ; N equal ; B 33 107 537 399 ;
+C 62 ; WX 570 ; N greater ; B 31 -12 539 518 ;
+C 63 ; WX 500 ; N question ; B 79 -13 470 684 ;
+C 64 ; WX 832 ; N at ; B 63 -18 770 685 ;
+C 65 ; WX 667 ; N A ; B -67 0 593 683 ;
+C 66 ; WX 667 ; N B ; B -24 0 624 669 ;
+C 67 ; WX 667 ; N C ; B 32 -18 677 685 ;
+C 68 ; WX 722 ; N D ; B -46 0 685 669 ;
+C 69 ; WX 667 ; N E ; B -27 0 653 669 ;
+C 70 ; WX 667 ; N F ; B -13 0 660 669 ;
+C 71 ; WX 722 ; N G ; B 21 -18 706 685 ;
+C 72 ; WX 778 ; N H ; B -24 0 799 669 ;
+C 73 ; WX 389 ; N I ; B -32 0 406 669 ;
+C 74 ; WX 500 ; N J ; B -46 -99 524 669 ;
+C 75 ; WX 667 ; N K ; B -21 0 702 669 ;
+C 76 ; WX 611 ; N L ; B -22 0 590 669 ;
+C 77 ; WX 889 ; N M ; B -29 -12 917 669 ;
+C 78 ; WX 722 ; N N ; B -27 -15 748 669 ;
+C 79 ; WX 722 ; N O ; B 27 -18 691 685 ;
+C 80 ; WX 611 ; N P ; B -27 0 613 669 ;
+C 81 ; WX 722 ; N Q ; B 27 -208 691 685 ;
+C 82 ; WX 667 ; N R ; B -29 0 623 669 ;
+C 83 ; WX 556 ; N S ; B 2 -18 526 685 ;
+C 84 ; WX 611 ; N T ; B 50 0 650 669 ;
+C 85 ; WX 722 ; N U ; B 67 -18 744 669 ;
+C 86 ; WX 667 ; N V ; B 65 -18 715 669 ;
+C 87 ; WX 889 ; N W ; B 65 -18 940 669 ;
+C 88 ; WX 667 ; N X ; B -24 0 694 669 ;
+C 89 ; WX 611 ; N Y ; B 73 0 659 669 ;
+C 90 ; WX 611 ; N Z ; B -11 0 590 669 ;
+C 91 ; WX 333 ; N bracketleft ; B -37 -159 362 674 ;
+C 92 ; WX 278 ; N backslash ; B -1 -18 279 685 ;
+C 93 ; WX 333 ; N bracketright ; B -56 -157 343 674 ;
+C 94 ; WX 570 ; N asciicircum ; B 67 304 503 669 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 333 ; N quoteleft ; B 128 369 332 685 ;
+C 97 ; WX 500 ; N a ; B -21 -14 455 462 ;
+C 98 ; WX 500 ; N b ; B -14 -13 444 699 ;
+C 99 ; WX 444 ; N c ; B -5 -13 392 462 ;
+C 100 ; WX 500 ; N d ; B -21 -13 517 699 ;
+C 101 ; WX 444 ; N e ; B 5 -13 398 462 ;
+C 102 ; WX 333 ; N f ; B -169 -205 446 698 ;
+C 103 ; WX 500 ; N g ; B -52 -203 478 462 ;
+C 104 ; WX 556 ; N h ; B -13 -9 498 699 ;
+C 105 ; WX 278 ; N i ; B 2 -9 263 685 ;
+C 106 ; WX 278 ; N j ; B -189 -207 279 685 ;
+C 107 ; WX 500 ; N k ; B -23 -8 483 699 ;
+C 108 ; WX 278 ; N l ; B 2 -9 290 699 ;
+C 109 ; WX 778 ; N m ; B -14 -9 722 462 ;
+C 110 ; WX 556 ; N n ; B -6 -9 493 462 ;
+C 111 ; WX 500 ; N o ; B -3 -13 441 462 ;
+C 112 ; WX 500 ; N p ; B -120 -205 446 462 ;
+C 113 ; WX 500 ; N q ; B 1 -205 471 462 ;
+C 114 ; WX 389 ; N r ; B -21 0 389 462 ;
+C 115 ; WX 389 ; N s ; B -19 -13 333 462 ;
+C 116 ; WX 278 ; N t ; B -11 -9 281 594 ;
+C 117 ; WX 556 ; N u ; B 15 -9 492 462 ;
+C 118 ; WX 444 ; N v ; B 16 -13 401 462 ;
+C 119 ; WX 667 ; N w ; B 16 -13 614 462 ;
+C 120 ; WX 500 ; N x ; B -46 -13 469 462 ;
+C 121 ; WX 444 ; N y ; B -94 -205 392 462 ;
+C 122 ; WX 389 ; N z ; B -43 -78 368 449 ;
+C 123 ; WX 348 ; N braceleft ; B 5 -187 436 686 ;
+C 124 ; WX 220 ; N bar ; B 66 -18 154 685 ;
+C 125 ; WX 348 ; N braceright ; B -129 -187 302 686 ;
+C 126 ; WX 570 ; N asciitilde ; B 54 175 516 331 ;
+C 161 ; WX 389 ; N exclamdown ; B 19 -205 320 494 ;
+C 162 ; WX 500 ; N cent ; B 42 -143 439 576 ;
+C 163 ; WX 500 ; N sterling ; B -32 -12 510 683 ;
+C 164 ; WX 167 ; N fraction ; B -169 -14 324 683 ;
+C 165 ; WX 500 ; N yen ; B 33 0 628 669 ;
+C 166 ; WX 500 ; N florin ; B -87 -156 537 707 ;
+C 167 ; WX 500 ; N section ; B 36 -143 459 685 ;
+C 168 ; WX 500 ; N currency ; B -26 34 526 586 ;
+C 169 ; WX 278 ; N quotesingle ; B 128 398 268 685 ;
+C 170 ; WX 500 ; N quotedblleft ; B 53 369 513 685 ;
+C 171 ; WX 500 ; N guillemotleft ; B 12 32 468 415 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 32 32 303 415 ;
+C 173 ; WX 333 ; N guilsinglright ; B 10 32 281 415 ;
+C 174 ; WX 556 ; N fi ; B -188 -205 514 703 ;
+C 175 ; WX 556 ; N fl ; B -186 -205 553 704 ;
+C 177 ; WX 500 ; N endash ; B -40 178 477 269 ;
+C 178 ; WX 500 ; N dagger ; B 91 -145 494 685 ;
+C 179 ; WX 500 ; N daggerdbl ; B 10 -139 493 685 ;
+C 180 ; WX 250 ; N periodcentered ; B 51 257 199 405 ;
+C 182 ; WX 500 ; N paragraph ; B -57 -193 562 669 ;
+C 183 ; WX 350 ; N bullet ; B 0 175 350 525 ;
+C 184 ; WX 333 ; N quotesinglbase ; B -5 -182 199 134 ;
+C 185 ; WX 500 ; N quotedblbase ; B -57 -182 403 134 ;
+C 186 ; WX 500 ; N quotedblright ; B 53 369 513 685 ;
+C 187 ; WX 500 ; N guillemotright ; B 12 32 468 415 ;
+C 188 ; WX 1000 ; N ellipsis ; B 40 -13 852 135 ;
+C 189 ; WX 1000 ; N perthousand ; B 7 -29 996 706 ;
+C 191 ; WX 500 ; N questiondown ; B 30 -205 421 492 ;
+C 193 ; WX 333 ; N grave ; B 85 516 297 697 ;
+C 194 ; WX 333 ; N acute ; B 139 516 379 697 ;
+C 195 ; WX 333 ; N circumflex ; B 40 516 367 690 ;
+C 196 ; WX 333 ; N tilde ; B 48 536 407 655 ;
+C 197 ; WX 333 ; N macron ; B 51 553 393 623 ;
+C 198 ; WX 333 ; N breve ; B 71 516 387 678 ;
+C 199 ; WX 333 ; N dotaccent ; B 163 525 293 655 ;
+C 200 ; WX 333 ; N dieresis ; B 55 525 397 655 ;
+C 202 ; WX 333 ; N ring ; B 127 540 340 754 ;
+C 203 ; WX 333 ; N cedilla ; B -80 -218 156 5 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 69 516 498 697 ;
+C 206 ; WX 333 ; N ogonek ; B -40 -173 189 44 ;
+C 207 ; WX 333 ; N caron ; B 79 516 411 690 ;
+C 208 ; WX 1000 ; N emdash ; B -40 178 977 269 ;
+C 225 ; WX 944 ; N AE ; B -64 0 918 669 ;
+C 227 ; WX 266 ; N ordfeminine ; B 16 399 330 685 ;
+C 232 ; WX 611 ; N Lslash ; B -22 0 590 669 ;
+C 233 ; WX 722 ; N Oslash ; B 27 -125 691 764 ;
+C 234 ; WX 944 ; N OE ; B 23 -9 946 677 ;
+C 235 ; WX 300 ; N ordmasculine ; B 56 400 350 685 ;
+C 241 ; WX 722 ; N ae ; B -5 -13 673 462 ;
+C 245 ; WX 278 ; N dotlessi ; B 2 -9 238 462 ;
+C 248 ; WX 278 ; N lslash ; B -13 -9 301 699 ;
+C 249 ; WX 500 ; N oslash ; B -3 -119 441 560 ;
+C 250 ; WX 722 ; N oe ; B 6 -13 674 462 ;
+C 251 ; WX 500 ; N germandbls ; B -200 -200 473 705 ;
+C -1 ; WX 722 ; N Udieresis ; B 67 -18 744 862 ;
+C -1 ; WX 722 ; N Uacute ; B 67 -18 744 904 ;
+C -1 ; WX 556 ; N Scedilla ; B 2 -218 526 685 ;
+C -1 ; WX 611 ; N Tcaron ; B 50 0 650 900 ;
+C -1 ; WX 556 ; N Scaron ; B 2 -18 526 897 ;
+C -1 ; WX 667 ; N Rcaron ; B -29 0 623 900 ;
+C -1 ; WX 667 ; N Racute ; B -29 0 623 907 ;
+C -1 ; WX 556 ; N Sacute ; B 2 -18 526 907 ;
+C -1 ; WX 722 ; N Otilde ; B 27 -18 691 862 ;
+C -1 ; WX 556 ; N ucircumflex ; B 15 -9 492 690 ;
+C -1 ; WX 722 ; N Ohungarumlaut ; B 27 -18 693 907 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 67 -18 744 907 ;
+C -1 ; WX 611 ; N Yacute ; B 73 0 659 904 ;
+C -1 ; WX 722 ; N Eth ; B -31 0 700 669 ;
+C -1 ; WX 722 ; N Dcroat ; B -31 0 700 669 ;
+C -1 ; WX 611 ; N Zacute ; B -11 0 590 907 ;
+C -1 ; WX 722 ; N Uring ; B 67 -18 744 964 ;
+C -1 ; WX 500 ; N gbreve ; B -52 -203 478 678 ;
+C -1 ; WX 444 ; N eogonek ; B 5 -173 404 462 ;
+C -1 ; WX 444 ; N edotaccent ; B 5 -13 398 655 ;
+C -1 ; WX 444 ; N ecaron ; B 5 -13 467 690 ;
+C -1 ; WX 722 ; N Ugrave ; B 67 -18 744 904 ;
+C -1 ; WX 611 ; N Thorn ; B -27 0 574 669 ;
+C -1 ; WX 444 ; N eacute ; B 5 -13 435 697 ;
+C -1 ; WX 444 ; N edieresis ; B 5 -13 443 655 ;
+C -1 ; WX 600 ; N dcaron ; B -21 -13 664 699 ;
+C -1 ; WX 444 ; N ccedilla ; B -24 -218 392 462 ;
+C -1 ; WX 444 ; N ccaron ; B -5 -13 468 690 ;
+C -1 ; WX 444 ; N cacute ; B -5 -13 444 697 ;
+C -1 ; WX 500 ; N aogonek ; B -21 -173 500 462 ;
+C -1 ; WX 500 ; N aring ; B -21 -14 455 754 ;
+C -1 ; WX 500 ; N atilde ; B -21 -14 491 655 ;
+C -1 ; WX 500 ; N abreve ; B -21 -14 470 678 ;
+C -1 ; WX 444 ; N egrave ; B 5 -13 398 697 ;
+C -1 ; WX 500 ; N agrave ; B -21 -14 455 697 ;
+C -1 ; WX 500 ; N aacute ; B -21 -14 463 697 ;
+C -1 ; WX 500 ; N adieresis ; B -21 -14 471 655 ;
+C -1 ; WX 722 ; N Uogonek ; B 67 -173 744 669 ;
+C -1 ; WX 556 ; N ugrave ; B 15 -9 492 697 ;
+C -1 ; WX 556 ; N uacute ; B 15 -9 492 697 ;
+C -1 ; WX 556 ; N udieresis ; B 15 -9 494 655 ;
+C -1 ; WX 345 ; N tcaron ; B -11 -9 409 685 ;
+C -1 ; WX 389 ; N scommaaccent ; B -26 -324 333 462 ;
+C -1 ; WX 611 ; N Zcaron ; B -11 0 590 897 ;
+C -1 ; WX 444 ; N ecircumflex ; B 5 -13 423 690 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 67 -18 744 897 ;
+C -1 ; WX 500 ; N acircumflex ; B -21 -14 455 690 ;
+C -1 ; WX 611 ; N Zdotaccent ; B -11 0 590 865 ;
+C -1 ; WX 389 ; N scaron ; B -19 -13 439 690 ;
+C -1 ; WX 667 ; N Amacron ; B -67 0 593 833 ;
+C -1 ; WX 389 ; N sacute ; B -19 -13 407 697 ;
+C -1 ; WX 611 ; N Tcommaaccent ; B 50 -324 650 669 ;
+C -1 ; WX 611 ; N Ydieresis ; B 73 0 659 862 ;
+C -1 ; WX 500 ; N thorn ; B -120 -205 446 699 ;
+C -1 ; WX 667 ; N Emacron ; B -27 0 653 833 ;
+C -1 ; WX 722 ; N Ograve ; B 27 -18 691 904 ;
+C -1 ; WX 722 ; N Oacute ; B 27 -18 691 904 ;
+C -1 ; WX 722 ; N Odieresis ; B 27 -18 691 862 ;
+C -1 ; WX 722 ; N Ntilde ; B -27 -15 748 862 ;
+C -1 ; WX 722 ; N Ncaron ; B -27 -15 748 900 ;
+C -1 ; WX 722 ; N Nacute ; B -27 -15 748 907 ;
+C -1 ; WX 611 ; N Lcaron ; B -22 0 651 685 ;
+C -1 ; WX 611 ; N Lacute ; B -22 0 590 907 ;
+C -1 ; WX 389 ; N Idotaccent ; B -32 0 406 865 ;
+C -1 ; WX 389 ; N racute ; B -21 0 407 697 ;
+C -1 ; WX 389 ; N Icircumflex ; B -32 0 420 897 ;
+C -1 ; WX 500 ; N ohungarumlaut ; B -3 -13 582 697 ;
+C -1 ; WX 500 ; N otilde ; B -3 -13 491 655 ;
+C -1 ; WX 500 ; N Euro ; B 53 -5 666 689 ;
+C -1 ; WX 500 ; N ocircumflex ; B -3 -13 451 690 ;
+C -1 ; WX 300 ; N onesuperior ; B 30 274 301 683 ;
+C -1 ; WX 300 ; N twosuperior ; B 2 274 313 683 ;
+C -1 ; WX 300 ; N threesuperior ; B 17 265 321 683 ;
+C -1 ; WX 389 ; N Igrave ; B -32 0 406 904 ;
+C -1 ; WX 389 ; N Iacute ; B -32 0 407 907 ;
+C -1 ; WX 389 ; N Imacron ; B -32 0 461 833 ;
+C -1 ; WX 389 ; N Iogonek ; B -32 -173 406 669 ;
+C -1 ; WX 389 ; N Idieresis ; B -32 0 445 862 ;
+C -1 ; WX 722 ; N Gbreve ; B 21 -18 706 888 ;
+C -1 ; WX 722 ; N Umacron ; B 67 -18 744 833 ;
+C -1 ; WX 667 ; N Kcommaaccent ; B -21 -324 702 669 ;
+C -1 ; WX 500 ; N ograve ; B -3 -13 441 697 ;
+C -1 ; WX 556 ; N Scommaaccent ; B 2 -324 526 685 ;
+C -1 ; WX 667 ; N Eogonek ; B -27 -173 667 669 ;
+C -1 ; WX 500 ; N oacute ; B -3 -13 463 697 ;
+C -1 ; WX 667 ; N Edotaccent ; B -27 0 653 865 ;
+C -1 ; WX 278 ; N iogonek ; B 2 -173 278 685 ;
+C -1 ; WX 500 ; N gcommaaccent ; B -52 -203 478 765 ;
+C -1 ; WX 500 ; N odieresis ; B -3 -13 466 655 ;
+C -1 ; WX 556 ; N ntilde ; B -6 -9 504 655 ;
+C -1 ; WX 556 ; N ncaron ; B -6 -9 523 690 ;
+C -1 ; WX 667 ; N Ecaron ; B -27 0 653 900 ;
+C -1 ; WX 667 ; N Ecircumflex ; B -27 0 653 897 ;
+C -1 ; WX 389 ; N scedilla ; B -40 -218 333 462 ;
+C -1 ; WX 389 ; N rcaron ; B -21 0 439 690 ;
+C -1 ; WX 667 ; N Egrave ; B -27 0 653 904 ;
+C -1 ; WX 667 ; N Eacute ; B -27 0 653 904 ;
+C -1 ; WX 722 ; N Gcommaaccent ; B 21 -324 706 685 ;
+C -1 ; WX 667 ; N Rcommaaccent ; B -29 -324 623 669 ;
+C -1 ; WX 667 ; N Edieresis ; B -27 0 653 862 ;
+C -1 ; WX 556 ; N nacute ; B -6 -9 493 697 ;
+C -1 ; WX 556 ; N uogonek ; B 15 -173 556 462 ;
+C -1 ; WX 556 ; N umacron ; B 15 -9 505 623 ;
+C -1 ; WX 722 ; N Dcaron ; B -46 0 685 900 ;
+C -1 ; WX 382 ; N lcaron ; B 2 -9 446 699 ;
+C -1 ; WX 667 ; N Ccaron ; B 32 -18 677 900 ;
+C -1 ; WX 667 ; N Cacute ; B 32 -18 677 907 ;
+C -1 ; WX 667 ; N Ccedilla ; B 32 -218 677 685 ;
+C -1 ; WX 400 ; N degree ; B 83 397 369 683 ;
+C -1 ; WX 667 ; N Aogonek ; B -67 -173 729 683 ;
+C -1 ; WX 606 ; N minus ; B 51 209 555 297 ;
+C -1 ; WX 570 ; N multiply ; B 48 16 522 490 ;
+C -1 ; WX 570 ; N divide ; B 33 -29 537 535 ;
+C -1 ; WX 667 ; N Aring ; B -67 0 593 950 ;
+C -1 ; WX 1000 ; N trademark ; B 32 263 968 669 ;
+C -1 ; WX 389 ; N rcommaaccent ; B -80 -324 389 462 ;
+C -1 ; WX 278 ; N lacute ; B 2 -9 392 907 ;
+C -1 ; WX 500 ; N omacron ; B -3 -13 477 623 ;
+C -1 ; WX 667 ; N Atilde ; B -67 0 593 862 ;
+C -1 ; WX 278 ; N icircumflex ; B -2 -9 325 690 ;
+C -1 ; WX 278 ; N igrave ; B 2 -9 260 697 ;
+C -1 ; WX 556 ; N ncommaaccent ; B -6 -324 493 462 ;
+C -1 ; WX 278 ; N lcommaaccent ; B -81 -324 290 699 ;
+C -1 ; WX 570 ; N plusminus ; B 33 0 537 568 ;
+C -1 ; WX 750 ; N onehalf ; B -9 -14 723 683 ;
+C -1 ; WX 750 ; N onequarter ; B 7 -14 721 683 ;
+C -1 ; WX 750 ; N threequarters ; B 7 -14 726 683 ;
+C -1 ; WX 278 ; N iacute ; B 2 -9 352 697 ;
+C -1 ; WX 667 ; N Abreve ; B -67 0 593 888 ;
+C -1 ; WX 500 ; N kcommaaccent ; B -23 -324 483 699 ;
+C -1 ; WX 722 ; N Omacron ; B 27 -18 691 833 ;
+C -1 ; WX 278 ; N imacron ; B 2 -9 366 623 ;
+C -1 ; WX 444 ; N emacron ; B 5 -13 449 623 ;
+C -1 ; WX 500 ; N amacron ; B -21 -14 477 623 ;
+C -1 ; WX 278 ; N tcommaaccent ; B -81 -324 281 594 ;
+C -1 ; WX 444 ; N ydieresis ; B -94 -205 438 655 ;
+C -1 ; WX 389 ; N zdotaccent ; B -43 -78 368 655 ;
+C -1 ; WX 389 ; N zcaron ; B -43 -78 424 690 ;
+C -1 ; WX 389 ; N zacute ; B -43 -78 407 697 ;
+C -1 ; WX 444 ; N yacute ; B -94 -205 435 697 ;
+C -1 ; WX 556 ; N uhungarumlaut ; B 15 -9 610 697 ;
+C -1 ; WX 500 ; N eth ; B -3 -13 454 699 ;
+C -1 ; WX 556 ; N uring ; B 15 -9 492 754 ;
+C -1 ; WX 722 ; N Ocircumflex ; B 27 -18 691 897 ;
+C -1 ; WX 333 ; N commaaccent ; B -54 -324 130 -40 ;
+C -1 ; WX 747 ; N copyright ; B 30 -18 718 685 ;
+C -1 ; WX 747 ; N registered ; B 30 -18 718 685 ;
+C -1 ; WX 667 ; N Acircumflex ; B -67 0 593 897 ;
+C -1 ; WX 278 ; N idieresis ; B 2 -9 360 655 ;
+C -1 ; WX 494 ; N lozenge ; B 18 0 466 740 ;
+C -1 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C -1 ; WX 570 ; N notequal ; B 33 -13 537 519 ;
+C -1 ; WX 549 ; N radical ; B -17 -35 535 916 ;
+C -1 ; WX 667 ; N Agrave ; B -67 0 593 904 ;
+C -1 ; WX 667 ; N Aacute ; B -67 0 593 904 ;
+C -1 ; WX 570 ; N lessequal ; B 31 0 539 642 ;
+C -1 ; WX 570 ; N greaterequal ; B 31 0 539 642 ;
+C -1 ; WX 606 ; N logicalnot ; B 51 108 555 399 ;
+C -1 ; WX 713 ; N summation ; B 14 -123 695 752 ;
+C -1 ; WX 494 ; N partialdiff ; B 16 -20 472 743 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B -27 -324 748 669 ;
+C -1 ; WX 500 ; N dcroat ; B -21 -13 540 699 ;
+C -1 ; WX 220 ; N brokenbar ; B 66 -18 154 685 ;
+C -1 ; WX 611 ; N Lcommaaccent ; B -22 -324 590 669 ;
+C -1 ; WX 667 ; N Adieresis ; B -67 0 593 862 ;
+C -1 ; WX 576 ; N mu ; B -60 -207 516 449 ;
+C -1 ; WX 250 ; N .notdef ; B 125 0 125 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 998
+KPX A C -61
+KPX A Ccedilla -63
+KPX A G -59
+KPX A O -53
+KPX A Odieresis -53
+KPX A Q -54
+KPX A T -33
+KPX A U -61
+KPX A Uacute -61
+KPX A Ucircumflex -61
+KPX A Udieresis -61
+KPX A Ugrave -61
+KPX A V -110
+KPX A W -107
+KPX A Y -44
+KPX A a -5
+KPX A b -1
+KPX A c -20
+KPX A ccedilla -29
+KPX A comma 0
+KPX A d -5
+KPX A e -25
+KPX A g -20
+KPX A guillemotleft -58
+KPX A guilsinglleft -68
+KPX A hyphen -23
+KPX A o -23
+KPX A period 1
+KPX A q -18
+KPX A quotedblright -78
+KPX A quoteright -101
+KPX A t -4
+KPX A u -18
+KPX A v -51
+KPX A w -56
+KPX A y -67
+KPX Aacute C -61
+KPX Aacute G -59
+KPX Aacute O -53
+KPX Aacute Q -54
+KPX Aacute T -33
+KPX Aacute U -61
+KPX Aacute V -110
+KPX Aacute W -107
+KPX Aacute Y -44
+KPX Aacute a -5
+KPX Aacute b -1
+KPX Aacute c -20
+KPX Aacute comma 0
+KPX Aacute d -5
+KPX Aacute e -25
+KPX Aacute g -20
+KPX Aacute guillemotleft -58
+KPX Aacute guilsinglleft -68
+KPX Aacute hyphen -23
+KPX Aacute o -23
+KPX Aacute period 1
+KPX Aacute q -18
+KPX Aacute quoteright -101
+KPX Aacute t -4
+KPX Aacute u -18
+KPX Aacute v -51
+KPX Aacute w -56
+KPX Aacute y -67
+KPX Acircumflex C -61
+KPX Acircumflex G -59
+KPX Acircumflex O -53
+KPX Acircumflex Q -54
+KPX Acircumflex T -33
+KPX Acircumflex U -61
+KPX Acircumflex V -110
+KPX Acircumflex W -107
+KPX Acircumflex Y -44
+KPX Acircumflex comma 0
+KPX Acircumflex period 1
+KPX Adieresis C -61
+KPX Adieresis G -59
+KPX Adieresis O -53
+KPX Adieresis Q -54
+KPX Adieresis T -33
+KPX Adieresis U -61
+KPX Adieresis V -110
+KPX Adieresis W -107
+KPX Adieresis Y -44
+KPX Adieresis a -5
+KPX Adieresis b -1
+KPX Adieresis c -20
+KPX Adieresis comma 0
+KPX Adieresis d -5
+KPX Adieresis g -20
+KPX Adieresis guillemotleft -58
+KPX Adieresis guilsinglleft -68
+KPX Adieresis hyphen -23
+KPX Adieresis o -23
+KPX Adieresis period 1
+KPX Adieresis q -18
+KPX Adieresis quotedblright -78
+KPX Adieresis quoteright -101
+KPX Adieresis t -4
+KPX Adieresis u -18
+KPX Adieresis v -51
+KPX Adieresis w -56
+KPX Adieresis y -67
+KPX Agrave C -61
+KPX Agrave G -59
+KPX Agrave O -53
+KPX Agrave Q -54
+KPX Agrave T -33
+KPX Agrave U -61
+KPX Agrave V -110
+KPX Agrave W -107
+KPX Agrave Y -44
+KPX Agrave comma 0
+KPX Agrave period 1
+KPX Aring C -61
+KPX Aring G -59
+KPX Aring O -53
+KPX Aring Q -54
+KPX Aring T -33
+KPX Aring U -61
+KPX Aring V -110
+KPX Aring W -107
+KPX Aring Y -44
+KPX Aring a -5
+KPX Aring b -1
+KPX Aring c -20
+KPX Aring comma 0
+KPX Aring d -5
+KPX Aring e -25
+KPX Aring g -20
+KPX Aring guillemotleft -58
+KPX Aring guilsinglleft -68
+KPX Aring hyphen -23
+KPX Aring o -23
+KPX Aring period 1
+KPX Aring q -18
+KPX Aring quotedblright -78
+KPX Aring quoteright -101
+KPX Aring t -4
+KPX Aring u -18
+KPX Aring v -51
+KPX Aring w -56
+KPX Aring y -67
+KPX Atilde C -61
+KPX Atilde G -59
+KPX Atilde O -53
+KPX Atilde Q -54
+KPX Atilde T -33
+KPX Atilde U -61
+KPX Atilde V -110
+KPX Atilde W -107
+KPX Atilde Y -44
+KPX Atilde comma 0
+KPX Atilde period 1
+KPX B A -34
+KPX B AE -40
+KPX B Aacute -34
+KPX B Acircumflex -34
+KPX B Adieresis -34
+KPX B Aring -34
+KPX B Atilde -34
+KPX B O -22
+KPX B OE -20
+KPX B Oacute -22
+KPX B Ocircumflex -22
+KPX B Odieresis -22
+KPX B Ograve -22
+KPX B Oslash -23
+KPX B V -46
+KPX B W -46
+KPX B Y -50
+KPX C A -24
+KPX C AE -31
+KPX C Aacute -24
+KPX C Adieresis -24
+KPX C Aring -24
+KPX C H -26
+KPX C K -28
+KPX C O -25
+KPX C Oacute -25
+KPX C Odieresis -25
+KPX Ccedilla A -30
+KPX D A -54
+KPX D Aacute -54
+KPX D Acircumflex -54
+KPX D Adieresis -54
+KPX D Agrave -54
+KPX D Aring -54
+KPX D Atilde -54
+KPX D J -67
+KPX D T -27
+KPX D V -60
+KPX D W -58
+KPX D X -64
+KPX D Y -64
+KPX F A -101
+KPX F Aacute -101
+KPX F Acircumflex -101
+KPX F Adieresis -101
+KPX F Agrave -101
+KPX F Aring -101
+KPX F Atilde -101
+KPX F J -88
+KPX F O -48
+KPX F Odieresis -48
+KPX F a -75
+KPX F aacute -75
+KPX F adieresis -48
+KPX F ae -83
+KPX F aring -75
+KPX F comma -96
+KPX F e -86
+KPX F eacute -86
+KPX F hyphen -54
+KPX F i -29
+KPX F j -34
+KPX F o -81
+KPX F oacute -82
+KPX F odieresis -45
+KPX F oe -86
+KPX F oslash -79
+KPX F period -98
+KPX F r -38
+KPX F u -42
+KPX G A -14
+KPX G AE -20
+KPX G Aacute -14
+KPX G Acircumflex -14
+KPX G Adieresis -14
+KPX G Agrave -14
+KPX G Aring -14
+KPX G Atilde -14
+KPX G T -42
+KPX G V -27
+KPX G W -27
+KPX G Y -31
+KPX J A -39
+KPX J AE -42
+KPX J Adieresis -39
+KPX J Aring -39
+KPX K C -51
+KPX K G -46
+KPX K O -43
+KPX K OE -42
+KPX K Oacute -43
+KPX K Odieresis -43
+KPX K S -1
+KPX K T 0
+KPX K a 3
+KPX K adieresis 3
+KPX K ae -4
+KPX K aring 3
+KPX K e -16
+KPX K hyphen -30
+KPX K o -13
+KPX K oacute -13
+KPX K odieresis -13
+KPX K u -8
+KPX K udieresis -8
+KPX K y -68
+KPX L A 28
+KPX L AE 25
+KPX L Aacute 28
+KPX L Adieresis 28
+KPX L Aring 28
+KPX L C 0
+KPX L Ccedilla 0
+KPX L G 4
+KPX L O 4
+KPX L Oacute 4
+KPX L Ocircumflex 4
+KPX L Odieresis 4
+KPX L Ograve 4
+KPX L Otilde 4
+KPX L S 1
+KPX L T -30
+KPX L U -17
+KPX L Udieresis -17
+KPX L V -77
+KPX L W -74
+KPX L Y -41
+KPX L hyphen 41
+KPX L quotedblright -45
+KPX L quoteright -67
+KPX L u 5
+KPX L udieresis 5
+KPX L y -23
+KPX N A -39
+KPX N AE -42
+KPX N Aacute -39
+KPX N Adieresis -39
+KPX N Aring -39
+KPX N C -32
+KPX N Ccedilla -30
+KPX N G -26
+KPX N O -32
+KPX N Oacute -32
+KPX N Odieresis -32
+KPX N a -25
+KPX N aacute -27
+KPX N adieresis -27
+KPX N ae -34
+KPX N aring -27
+KPX N comma -24
+KPX N e -37
+KPX N eacute -38
+KPX N o -32
+KPX N oacute -34
+KPX N odieresis -34
+KPX N oslash -32
+KPX N period -26
+KPX N u -33
+KPX N udieresis -33
+KPX O A -57
+KPX O AE -67
+KPX O Aacute -57
+KPX O Adieresis -57
+KPX O Aring -57
+KPX O T -18
+KPX O V -52
+KPX O W -52
+KPX O X -63
+KPX O Y -56
+KPX Oacute A -57
+KPX Oacute T -18
+KPX Oacute V -52
+KPX Oacute W -52
+KPX Oacute Y -56
+KPX Ocircumflex T -18
+KPX Ocircumflex V -52
+KPX Ocircumflex Y -56
+KPX Odieresis A -57
+KPX Odieresis T -18
+KPX Odieresis V -52
+KPX Odieresis W -52
+KPX Odieresis X -63
+KPX Odieresis Y -56
+KPX Ograve T -18
+KPX Ograve V -52
+KPX Ograve Y -56
+KPX Oslash A -57
+KPX Otilde T -18
+KPX Otilde V -52
+KPX Otilde Y -56
+KPX P A -89
+KPX P AE -104
+KPX P Aacute -89
+KPX P Adieresis -89
+KPX P Aring -89
+KPX P J -105
+KPX P a -50
+KPX P aacute -50
+KPX P adieresis -38
+KPX P ae -58
+KPX P aring -50
+KPX P comma -107
+KPX P e -57
+KPX P eacute -57
+KPX P hyphen -54
+KPX P o -52
+KPX P oacute -52
+KPX P odieresis -35
+KPX P oe -57
+KPX P oslash -47
+KPX P period -109
+KPX R C -33
+KPX R Ccedilla -32
+KPX R G -28
+KPX R O -34
+KPX R OE -32
+KPX R Oacute -34
+KPX R Odieresis -34
+KPX R T -24
+KPX R U -44
+KPX R Udieresis -44
+KPX R V -46
+KPX R W -46
+KPX R Y -40
+KPX R a -1
+KPX R aacute -1
+KPX R adieresis -1
+KPX R ae -9
+KPX R aring -1
+KPX R e -21
+KPX R eacute -21
+KPX R hyphen -30
+KPX R o -18
+KPX R oacute -18
+KPX R odieresis -18
+KPX R oe -23
+KPX R u -13
+KPX R uacute -13
+KPX R udieresis -13
+KPX R y -12
+KPX S A -11
+KPX S AE -17
+KPX S Aacute -11
+KPX S Adieresis -11
+KPX S Aring -11
+KPX S T -34
+KPX S V -20
+KPX S W -20
+KPX S Y -24
+KPX S t -6
+KPX T A -52
+KPX T AE -54
+KPX T Aacute -52
+KPX T Acircumflex -52
+KPX T Adieresis -52
+KPX T Agrave -52
+KPX T Aring -52
+KPX T Atilde -52
+KPX T C -15
+KPX T G -9
+KPX T J -63
+KPX T O -22
+KPX T OE -18
+KPX T Oacute -22
+KPX T Ocircumflex -22
+KPX T Odieresis -22
+KPX T Ograve -22
+KPX T Oslash -22
+KPX T Otilde -22
+KPX T S -16
+KPX T V 15
+KPX T W 15
+KPX T Y 11
+KPX T a -83
+KPX T ae -91
+KPX T c -89
+KPX T colon -98
+KPX T comma -77
+KPX T e -94
+KPX T g -95
+KPX T guillemotleft -110
+KPX T guilsinglleft -120
+KPX T hyphen -74
+KPX T i -19
+KPX T j -27
+KPX T o -90
+KPX T oslash -90
+KPX T period -79
+KPX T r -76
+KPX T s -78
+KPX T semicolon -98
+KPX T u -91
+KPX T v -89
+KPX T w -89
+KPX T y -86
+KPX U A -65
+KPX U AE -71
+KPX U Aacute -65
+KPX U Acircumflex -65
+KPX U Adieresis -65
+KPX U Aring -65
+KPX U Atilde -65
+KPX U comma -40
+KPX U m -35
+KPX U n -39
+KPX U p -30
+KPX U period -41
+KPX U r -32
+KPX Uacute A -65
+KPX Uacute comma -40
+KPX Uacute m -35
+KPX Uacute n -39
+KPX Uacute p -30
+KPX Uacute period -41
+KPX Uacute r -32
+KPX Ucircumflex A -65
+KPX Udieresis A -65
+KPX Udieresis b 1
+KPX Udieresis comma -40
+KPX Udieresis m -35
+KPX Udieresis n -39
+KPX Udieresis p -30
+KPX Udieresis period -41
+KPX Udieresis r -32
+KPX Ugrave A -65
+KPX V A -100
+KPX V AE -111
+KPX V Aacute -100
+KPX V Acircumflex -100
+KPX V Adieresis -100
+KPX V Agrave -100
+KPX V Aring -100
+KPX V Atilde -100
+KPX V C -60
+KPX V G -53
+KPX V O -64
+KPX V Oacute -64
+KPX V Ocircumflex -64
+KPX V Odieresis -64
+KPX V Ograve -64
+KPX V Oslash -64
+KPX V Otilde -64
+KPX V S -25
+KPX V T 7
+KPX V a -76
+KPX V ae -84
+KPX V colon -96
+KPX V comma -96
+KPX V e -87
+KPX V g -83
+KPX V guillemotleft -99
+KPX V guilsinglleft -109
+KPX V hyphen -62
+KPX V i -12
+KPX V o -83
+KPX V oslash -81
+KPX V period -97
+KPX V r -44
+KPX V semicolon -96
+KPX V u -47
+KPX V y -34
+KPX W A -83
+KPX W AE -87
+KPX W Aacute -83
+KPX W Acircumflex -83
+KPX W Adieresis -83
+KPX W Agrave -83
+KPX W Aring -83
+KPX W Atilde -83
+KPX W C -46
+KPX W G -41
+KPX W O -47
+KPX W Oacute -47
+KPX W Ocircumflex -47
+KPX W Odieresis -47
+KPX W Ograve -47
+KPX W Oslash -48
+KPX W Otilde -47
+KPX W S -24
+KPX W T 8
+KPX W a -51
+KPX W ae -60
+KPX W colon -78
+KPX W comma -62
+KPX W e -62
+KPX W g -63
+KPX W guillemotleft -74
+KPX W guilsinglleft -84
+KPX W hyphen -37
+KPX W i -11
+KPX W o -58
+KPX W oslash -57
+KPX W period -64
+KPX W r -34
+KPX W semicolon -79
+KPX W u -38
+KPX W y -25
+KPX X C -58
+KPX X O -56
+KPX X Odieresis -56
+KPX X Q -58
+KPX X a -9
+KPX X e -29
+KPX X hyphen -46
+KPX X o -26
+KPX X u -21
+KPX X y -81
+KPX Y A -45
+KPX Y AE -47
+KPX Y Aacute -45
+KPX Y Acircumflex -45
+KPX Y Adieresis -45
+KPX Y Agrave -45
+KPX Y Aring -45
+KPX Y Atilde -45
+KPX Y C -59
+KPX Y G -54
+KPX Y O -61
+KPX Y Oacute -61
+KPX Y Ocircumflex -61
+KPX Y Odieresis -61
+KPX Y Ograve -61
+KPX Y Oslash -61
+KPX Y Otilde -61
+KPX Y S -25
+KPX Y T 7
+KPX Y a -69
+KPX Y ae -77
+KPX Y colon -91
+KPX Y comma -67
+KPX Y e -80
+KPX Y g -81
+KPX Y guillemotleft -97
+KPX Y guilsinglleft -107
+KPX Y hyphen -63
+KPX Y i -12
+KPX Y o -76
+KPX Y oslash -75
+KPX Y p -54
+KPX Y period -69
+KPX Y semicolon -91
+KPX Y u -59
+KPX Y v -54
+KPX Z v -29
+KPX Z y -39
+KPX a j -2
+KPX a quoteright -22
+KPX a v -5
+KPX a w -5
+KPX a y -3
+KPX aacute v -5
+KPX aacute w -5
+KPX aacute y -3
+KPX adieresis v -5
+KPX adieresis w -5
+KPX adieresis y -3
+KPX ae v -5
+KPX ae w -5
+KPX ae y -8
+KPX agrave v -5
+KPX agrave w -5
+KPX agrave y -3
+KPX aring v -5
+KPX aring w -5
+KPX aring y -3
+KPX b v -12
+KPX b w -12
+KPX b y -17
+KPX c h -20
+KPX c k -16
+KPX comma one -26
+KPX comma quotedblright -1
+KPX comma quoteright -23
+KPX e quoteright -12
+KPX e t -3
+KPX e v -3
+KPX e w -3
+KPX e x -15
+KPX e y -6
+KPX eacute v -3
+KPX eacute w -3
+KPX eacute y -6
+KPX ecircumflex v -3
+KPX ecircumflex w -3
+KPX ecircumflex y -6
+KPX eight four -4
+KPX eight one -52
+KPX eight seven -13
+KPX f a -23
+KPX f aacute -24
+KPX f adieresis 17
+KPX f ae -32
+KPX f aring -20
+KPX f e -35
+KPX f eacute -36
+KPX f f 2
+KPX f i 20
+KPX f j 12
+KPX f l 43
+KPX f o -30
+KPX f oacute -31
+KPX f odieresis 20
+KPX f oe -35
+KPX f oslash -29
+KPX f quoteright 12
+KPX f s -14
+KPX f t 9
+KPX five four -13
+KPX five one -56
+KPX five seven -37
+KPX four four 1
+KPX four one -50
+KPX four seven -21
+KPX g a -25
+KPX g adieresis -25
+KPX g ae -34
+KPX g aring -25
+KPX g e -32
+KPX g eacute -32
+KPX g l -21
+KPX g oacute -27
+KPX g odieresis -27
+KPX g r 3
+KPX guillemotright A -30
+KPX guillemotright AE -39
+KPX guillemotright Aacute -30
+KPX guillemotright Adieresis -30
+KPX guillemotright Aring -30
+KPX guillemotright T -76
+KPX guillemotright V -79
+KPX guillemotright W -75
+KPX guillemotright Y -83
+KPX guilsinglright A -40
+KPX guilsinglright AE -49
+KPX guilsinglright Aacute -40
+KPX guilsinglright Adieresis -40
+KPX guilsinglright Aring -40
+KPX guilsinglright T -86
+KPX guilsinglright V -89
+KPX guilsinglright W -85
+KPX guilsinglright Y -93
+KPX h quoteright -32
+KPX h y -20
+KPX hyphen A -13
+KPX hyphen AE -22
+KPX hyphen Aacute -13
+KPX hyphen Adieresis -13
+KPX hyphen Aring -13
+KPX hyphen T -59
+KPX hyphen V -62
+KPX hyphen W -59
+KPX hyphen Y -69
+KPX i T -20
+KPX i j -5
+KPX k a 10
+KPX k aacute 10
+KPX k adieresis 10
+KPX k ae 2
+KPX k aring 10
+KPX k comma 19
+KPX k e -2
+KPX k eacute -2
+KPX k g -14
+KPX k hyphen 1
+KPX k o 1
+KPX k oacute 1
+KPX k odieresis 1
+KPX k period 17
+KPX k s 1
+KPX k u 2
+KPX k udieresis 2
+KPX l v -12
+KPX l y -8
+KPX m p -1
+KPX m v -16
+KPX m w -16
+KPX m y -16
+KPX n T -59
+KPX n p -4
+KPX n quoteright -32
+KPX n v -20
+KPX n w -20
+KPX n y -20
+KPX nine four -18
+KPX nine one -67
+KPX nine seven -12
+KPX o T -75
+KPX o quoteright -22
+KPX o t -2
+KPX o v -21
+KPX o w -21
+KPX o x -26
+KPX o y -29
+KPX oacute v -21
+KPX oacute w -21
+KPX oacute y -29
+KPX ocircumflex t -4
+KPX odieresis t -4
+KPX odieresis v -21
+KPX odieresis w -21
+KPX odieresis x -26
+KPX odieresis y -29
+KPX ograve v -21
+KPX ograve w -21
+KPX ograve y -29
+KPX one comma -38
+KPX one eight -56
+KPX one five -45
+KPX one four -75
+KPX one nine -40
+KPX one one -48
+KPX one period -39
+KPX one seven -65
+KPX one six -62
+KPX one three -43
+KPX one two -32
+KPX one zero -48
+KPX p t -2
+KPX p y -13
+KPX period one -32
+KPX period quotedblright -5
+KPX period quoteright -27
+KPX q c -6
+KPX q u -5
+KPX quotedblbase A 24
+KPX quotedblbase AE 19
+KPX quotedblbase T -37
+KPX quotedblbase V -79
+KPX quotedblbase W -74
+KPX quotedblbase Y -48
+KPX quotedblleft A -76
+KPX quotedblleft AE -98
+KPX quotedblleft Aacute -76
+KPX quotedblleft Adieresis -76
+KPX quotedblleft Aring -76
+KPX quotedblleft T -11
+KPX quotedblleft V 3
+KPX quotedblleft W 3
+KPX quotedblleft Y 0
+KPX quotedblright A -72
+KPX quotedblright AE -94
+KPX quotedblright Aacute -72
+KPX quotedblright Adieresis -72
+KPX quotedblright Aring -72
+KPX quotedblright T -1
+KPX quotedblright V 6
+KPX quotedblright W 6
+KPX quotedblright Y 2
+KPX quoteleft A -83
+KPX quoteleft AE -105
+KPX quoteleft Aacute -83
+KPX quoteleft Adieresis -83
+KPX quoteleft Aring -83
+KPX quoteleft T -18
+KPX quoteleft V -3
+KPX quoteleft W -3
+KPX quoteleft Y -7
+KPX quoteright A -94
+KPX quoteright AE -116
+KPX quoteright Aacute -94
+KPX quoteright Adieresis -94
+KPX quoteright Aring -94
+KPX quoteright comma -57
+KPX quoteright d -50
+KPX quoteright o -50
+KPX quoteright period -59
+KPX quoteright r -26
+KPX quoteright s -26
+KPX quoteright t -19
+KPX quoteright v -23
+KPX quoteright w -23
+KPX quoteright y -18
+KPX r a -13
+KPX r aacute -13
+KPX r acircumflex -13
+KPX r adieresis -13
+KPX r ae -22
+KPX r agrave -13
+KPX r aring -13
+KPX r c -15
+KPX r ccedilla -8
+KPX r colon -30
+KPX r comma -67
+KPX r d -14
+KPX r e -20
+KPX r eacute -20
+KPX r ecircumflex -20
+KPX r egrave -20
+KPX r f 8
+KPX r g -4
+KPX r h -16
+KPX r hyphen -13
+KPX r i 17
+KPX r j 12
+KPX r k -11
+KPX r l -12
+KPX r m 10
+KPX r n 6
+KPX r o -15
+KPX r oacute -15
+KPX r ocircumflex -15
+KPX r odieresis -15
+KPX r oe -19
+KPX r ograve -15
+KPX r oslash -12
+KPX r p 16
+KPX r period -69
+KPX r q -19
+KPX r quoteright 0
+KPX r r 14
+KPX r s 1
+KPX r semicolon -30
+KPX r t 12
+KPX r u 11
+KPX r v 20
+KPX r w 20
+KPX r x 7
+KPX r y 20
+KPX r z 10
+KPX s quoteright -22
+KPX s t -6
+KPX seven colon -90
+KPX seven comma -80
+KPX seven eight -46
+KPX seven five -60
+KPX seven four -79
+KPX seven one -43
+KPX seven period -81
+KPX seven seven -27
+KPX seven six -60
+KPX seven three -42
+KPX seven two -30
+KPX six four 2
+KPX six one -52
+KPX six seven -32
+KPX t S -11
+KPX t a 10
+KPX t aacute 10
+KPX t adieresis 10
+KPX t ae 2
+KPX t aring 10
+KPX t colon -22
+KPX t e -2
+KPX t eacute -2
+KPX t h -5
+KPX t o 1
+KPX t oacute 1
+KPX t odieresis 1
+KPX t quoteright -19
+KPX t semicolon -23
+KPX three four -15
+KPX three one -67
+KPX three seven -27
+KPX two four -8
+KPX two one -48
+KPX two seven -27
+KPX u quoteright -33
+KPX v a -20
+KPX v aacute -20
+KPX v acircumflex -20
+KPX v adieresis -20
+KPX v ae -28
+KPX v agrave -20
+KPX v aring -20
+KPX v atilde -20
+KPX v c -24
+KPX v colon -51
+KPX v comma -51
+KPX v e -28
+KPX v eacute -28
+KPX v ecircumflex -28
+KPX v egrave -28
+KPX v g -20
+KPX v hyphen -1
+KPX v l -24
+KPX v o -24
+KPX v oacute -24
+KPX v odieresis -24
+KPX v ograve -24
+KPX v oslash -22
+KPX v period -51
+KPX v s -19
+KPX v semicolon -51
+KPX w a -24
+KPX w aacute -24
+KPX w acircumflex -24
+KPX w adieresis -24
+KPX w ae -32
+KPX w agrave -24
+KPX w aring -24
+KPX w atilde -24
+KPX w c -30
+KPX w colon -56
+KPX w comma -53
+KPX w e -34
+KPX w eacute -34
+KPX w ecircumflex -34
+KPX w egrave -34
+KPX w g -26
+KPX w hyphen -7
+KPX w l -28
+KPX w o -30
+KPX w oacute -30
+KPX w odieresis -30
+KPX w ograve -30
+KPX w oslash -28
+KPX w period -53
+KPX w s -24
+KPX w semicolon -56
+KPX x a -1
+KPX x c -10
+KPX x e -14
+KPX x eacute -14
+KPX x o -11
+KPX x q -12
+KPX y a -11
+KPX y aacute -12
+KPX y acircumflex -12
+KPX y adieresis -12
+KPX y ae -19
+KPX y agrave -12
+KPX y aring -12
+KPX y atilde -12
+KPX y c -17
+KPX y colon -43
+KPX y comma -25
+KPX y e -22
+KPX y eacute -23
+KPX y ecircumflex -23
+KPX y egrave -23
+KPX y g -23
+KPX y hyphen 2
+KPX y l -16
+KPX y o -17
+KPX y oacute -19
+KPX y odieresis -19
+KPX y ograve -19
+KPX y oslash -17
+KPX y period -26
+KPX y s -13
+KPX y semicolon -44
+KPX zero four -1
+KPX zero one -50
+KPX zero seven -12
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/pdf2swf/fonts/n021024l.pfb b/pdf2swf/fonts/n021024l.pfb
new file mode 100644
index 00000000..2d19d942
--- /dev/null
+++ b/pdf2swf/fonts/n021024l.pfb
Binary files differ
diff --git a/pdf2swf/fonts/n022003l.afm b/pdf2swf/fonts/n022003l.afm
new file mode 100644
index 00000000..2ebe8d24
--- /dev/null
+++ b/pdf2swf/fonts/n022003l.afm
@@ -0,0 +1,1341 @@
+StartFontMetrics 3.0
+Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development
+Comment Creation Date: 12/22/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName NimbusMonL-Regu
+FullName Nimbus Mono L Regular
+FamilyName Nimbus Mono L
+Weight Regular
+ItalicAngle 0.0
+IsFixedPitch false
+UnderlinePosition -100
+UnderlineThickness 50
+Version 1.05
+Notice (URW)++,Copyright 1999 by (URW)++ Design & Development
+EncodingScheme AdobeStandardEncoding
+FontBBox -12 -237 650 811
+CapHeight 563
+XHeight 417
+Descender -186
+Ascender 604
+StartCharMetrics 316
+C 32 ; WX 600 ; N space ; B 295 0 295 0 ;
+C 33 ; WX 600 ; N exclam ; B 240 -15 360 618 ;
+C 34 ; WX 600 ; N quotedbl ; B 146 315 454 604 ;
+C 35 ; WX 600 ; N numbersign ; B 92 -62 508 647 ;
+C 36 ; WX 600 ; N dollar ; B 113 -92 487 655 ;
+C 37 ; WX 600 ; N percent ; B 87 -12 513 611 ;
+C 38 ; WX 600 ; N ampersand ; B 105 -16 478 519 ;
+C 39 ; WX 600 ; N quoteright ; B 135 314 340 604 ;
+C 40 ; WX 600 ; N parenleft ; B 294 -124 458 604 ;
+C 41 ; WX 600 ; N parenright ; B 147 -124 311 604 ;
+C 42 ; WX 600 ; N asterisk ; B 113 250 487 604 ;
+C 43 ; WX 600 ; N plus ; B 72 32 528 530 ;
+C 44 ; WX 600 ; N comma ; B 135 -145 340 145 ;
+C 45 ; WX 600 ; N hyphen ; B 72 258 528 299 ;
+C 46 ; WX 600 ; N period ; B 226 -15 374 116 ;
+C 47 ; WX 600 ; N slash ; B 113 -81 487 668 ;
+C 48 ; WX 600 ; N zero ; B 113 -15 487 618 ;
+C 49 ; WX 600 ; N one ; B 113 0 487 612 ;
+C 50 ; WX 600 ; N two ; B 84 0 478 618 ;
+C 51 ; WX 600 ; N three ; B 96 -15 499 618 ;
+C 52 ; WX 600 ; N four ; B 105 0 478 604 ;
+C 53 ; WX 600 ; N five ; B 96 -15 499 604 ;
+C 54 ; WX 600 ; N six ; B 136 -15 510 618 ;
+C 55 ; WX 600 ; N seven ; B 105 -1 478 604 ;
+C 56 ; WX 600 ; N eight ; B 113 -15 487 618 ;
+C 57 ; WX 600 ; N nine ; B 136 -15 510 618 ;
+C 58 ; WX 600 ; N colon ; B 226 -15 374 417 ;
+C 59 ; WX 600 ; N semicolon ; B 139 -145 350 417 ;
+C 60 ; WX 600 ; N less ; B 72 44 522 518 ;
+C 61 ; WX 600 ; N equal ; B 51 190 549 375 ;
+C 62 ; WX 600 ; N greater ; B 78 44 528 518 ;
+C 63 ; WX 600 ; N question ; B 134 -15 487 577 ;
+C 64 ; WX 600 ; N at ; B 105 -62 478 624 ;
+C 65 ; WX 600 ; N A ; B 9 0 591 563 ;
+C 66 ; WX 600 ; N B ; B 43 0 541 563 ;
+C 67 ; WX 600 ; N C ; B 63 -16 534 576 ;
+C 68 ; WX 600 ; N D ; B 43 0 520 563 ;
+C 69 ; WX 600 ; N E ; B 43 0 520 563 ;
+C 70 ; WX 600 ; N F ; B 43 0 520 563 ;
+C 71 ; WX 600 ; N G ; B 63 -16 562 576 ;
+C 72 ; WX 600 ; N H ; B 53 0 551 563 ;
+C 73 ; WX 600 ; N I ; B 113 0 487 563 ;
+C 74 ; WX 600 ; N J ; B 84 -16 583 563 ;
+C 75 ; WX 600 ; N K ; B 43 0 572 563 ;
+C 76 ; WX 600 ; N L ; B 63 0 541 563 ;
+C 77 ; WX 600 ; N M ; B 11 0 593 563 ;
+C 78 ; WX 600 ; N N ; B 22 0 562 563 ;
+C 79 ; WX 600 ; N O ; B 51 -16 549 576 ;
+C 80 ; WX 600 ; N P ; B 43 0 499 563 ;
+C 81 ; WX 600 ; N Q ; B 51 -115 549 576 ;
+C 82 ; WX 600 ; N R ; B 43 0 589 563 ;
+C 83 ; WX 600 ; N S ; B 92 -16 508 576 ;
+C 84 ; WX 600 ; N T ; B 72 0 528 563 ;
+C 85 ; WX 600 ; N U ; B 40 -16 560 563 ;
+C 86 ; WX 600 ; N V ; B 9 0 591 563 ;
+C 87 ; WX 600 ; N W ; B 20 0 580 563 ;
+C 88 ; WX 600 ; N X ; B 40 0 560 563 ;
+C 89 ; WX 600 ; N Y ; B 51 0 549 563 ;
+C 90 ; WX 600 ; N Z ; B 103 0 497 563 ;
+C 91 ; WX 600 ; N bracketleft ; B 280 -124 445 604 ;
+C 92 ; WX 600 ; N backslash ; B 113 -81 487 668 ;
+C 93 ; WX 600 ; N bracketright ; B 155 -124 320 604 ;
+C 94 ; WX 600 ; N asciicircum ; B 113 354 487 615 ;
+C 95 ; WX 600 ; N underscore ; B -12 -125 612 -75 ;
+C 96 ; WX 600 ; N quoteleft ; B 260 343 465 604 ;
+C 97 ; WX 600 ; N a ; B 72 -16 541 431 ;
+C 98 ; WX 600 ; N b ; B 22 -16 541 604 ;
+C 99 ; WX 600 ; N c ; B 84 -16 535 431 ;
+C 100 ; WX 600 ; N d ; B 63 -16 583 604 ;
+C 101 ; WX 600 ; N e ; B 63 -16 520 431 ;
+C 102 ; WX 600 ; N f ; B 105 0 541 604 ;
+C 103 ; WX 600 ; N g ; B 63 -186 562 431 ;
+C 104 ; WX 600 ; N h ; B 43 0 551 604 ;
+C 105 ; WX 600 ; N i ; B 92 0 508 624 ;
+C 106 ; WX 600 ; N j ; B 147 -186 458 624 ;
+C 107 ; WX 600 ; N k ; B 63 0 541 604 ;
+C 108 ; WX 600 ; N l ; B 92 0 508 604 ;
+C 109 ; WX 600 ; N m ; B 11 0 593 431 ;
+C 110 ; WX 600 ; N n ; B 53 0 541 431 ;
+C 111 ; WX 600 ; N o ; B 72 -16 528 431 ;
+C 112 ; WX 600 ; N p ; B 22 -186 541 431 ;
+C 113 ; WX 600 ; N q ; B 63 -186 583 431 ;
+C 114 ; WX 600 ; N r ; B 84 0 541 427 ;
+C 115 ; WX 600 ; N s ; B 103 -16 497 431 ;
+C 116 ; WX 600 ; N t ; B 43 -16 499 563 ;
+C 117 ; WX 600 ; N u ; B 43 -16 541 417 ;
+C 118 ; WX 600 ; N v ; B 30 0 570 417 ;
+C 119 ; WX 600 ; N w ; B 30 0 570 417 ;
+C 120 ; WX 600 ; N x ; B 51 0 549 417 ;
+C 121 ; WX 600 ; N y ; B 51 -186 549 417 ;
+C 122 ; WX 600 ; N z ; B 115 0 489 417 ;
+C 123 ; WX 600 ; N braceleft ; B 197 -124 403 604 ;
+C 124 ; WX 600 ; N bar ; B 280 -124 320 604 ;
+C 125 ; WX 600 ; N braceright ; B 197 -124 403 604 ;
+C 126 ; WX 600 ; N asciitilde ; B 92 212 508 348 ;
+C 161 ; WX 600 ; N exclamdown ; B 240 -216 360 417 ;
+C 162 ; WX 600 ; N cent ; B 113 -13 469 630 ;
+C 163 ; WX 600 ; N sterling ; B 63 0 520 578 ;
+C 164 ; WX 600 ; N fraction ; B 50 138 549 470 ;
+C 165 ; WX 600 ; N yen ; B 51 0 549 563 ;
+C 166 ; WX 600 ; N florin ; B 87 -93 518 618 ;
+C 167 ; WX 600 ; N section ; B 66 -62 534 603 ;
+C 168 ; WX 600 ; N currency ; B 103 95 497 489 ;
+C 169 ; WX 600 ; N quotesingle ; B 236 315 364 604 ;
+C 170 ; WX 600 ; N quotedblleft ; B 93 343 507 604 ;
+C 171 ; WX 600 ; N guillemotleft ; B 63 0 541 417 ;
+C 172 ; WX 600 ; N guilsinglleft ; B 63 0 312 417 ;
+C 173 ; WX 600 ; N guilsinglright ; B 293 0 541 417 ;
+C 174 ; WX 600 ; N fi ; B 10 0 585 624 ;
+C 175 ; WX 600 ; N fl ; B 10 0 587 604 ;
+C 177 ; WX 600 ; N endash ; B 72 261 528 302 ;
+C 178 ; WX 600 ; N dagger ; B 124 -63 476 604 ;
+C 179 ; WX 600 ; N daggerdbl ; B 124 -62 476 604 ;
+C 180 ; WX 600 ; N periodcentered ; B 226 217 374 348 ;
+C 182 ; WX 600 ; N paragraph ; B 79 -62 525 604 ;
+C 183 ; WX 600 ; N bullet ; B 202 141 398 337 ;
+C 184 ; WX 600 ; N quotesinglbase ; B 135 -145 340 145 ;
+C 185 ; WX 600 ; N quotedblbase ; B 93 -116 507 145 ;
+C 186 ; WX 600 ; N quotedblright ; B 93 343 507 604 ;
+C 187 ; WX 600 ; N guillemotright ; B 63 0 541 417 ;
+C 188 ; WX 600 ; N ellipsis ; B 51 -15 549 84 ;
+C 189 ; WX 600 ; N perthousand ; B 34 -9 564 614 ;
+C 191 ; WX 600 ; N questiondown ; B 113 -175 466 417 ;
+C 193 ; WX 600 ; N grave ; B 155 490 320 639 ;
+C 194 ; WX 600 ; N acute ; B 280 490 445 639 ;
+C 195 ; WX 600 ; N circumflex ; B 155 490 445 639 ;
+C 196 ; WX 600 ; N tilde ; B 145 516 455 605 ;
+C 197 ; WX 600 ; N macron ; B 155 536 445 576 ;
+C 198 ; WX 600 ; N breve ; B 155 490 445 620 ;
+C 199 ; WX 600 ; N dotaccent ; B 250 511 350 611 ;
+C 200 ; WX 600 ; N dieresis ; B 140 511 461 611 ;
+C 202 ; WX 600 ; N ring ; B 207 480 393 661 ;
+C 203 ; WX 600 ; N cedilla ; B 210 -173 377 0 ;
+C 205 ; WX 600 ; N hungarumlaut ; B 155 490 445 633 ;
+C 206 ; WX 600 ; N ogonek ; B 280 -155 433 0 ;
+C 207 ; WX 600 ; N caron ; B 155 490 445 639 ;
+C 208 ; WX 600 ; N emdash ; B 1 261 599 302 ;
+C 225 ; WX 600 ; N AE ; B 10 0 590 563 ;
+C 227 ; WX 600 ; N ordfeminine ; B 155 279 447 574 ;
+C 232 ; WX 600 ; N Lslash ; B 43 0 541 563 ;
+C 233 ; WX 600 ; N Oslash ; B 40 -43 560 605 ;
+C 234 ; WX 600 ; N OE ; B 10 0 590 563 ;
+C 235 ; WX 600 ; N ordmasculine ; B 154 284 448 577 ;
+C 241 ; WX 600 ; N ae ; B 12 -16 578 431 ;
+C 245 ; WX 600 ; N dotlessi ; B 92 0 508 417 ;
+C 248 ; WX 600 ; N lslash ; B 92 0 508 604 ;
+C 249 ; WX 600 ; N oslash ; B 53 -43 543 458 ;
+C 250 ; WX 600 ; N oe ; B 12 -16 578 431 ;
+C 251 ; WX 600 ; N germandbls ; B 43 -16 499 604 ;
+C -1 ; WX 600 ; N Udieresis ; B 40 -16 560 761 ;
+C -1 ; WX 600 ; N Uacute ; B 40 -16 560 789 ;
+C -1 ; WX 600 ; N Scedilla ; B 92 -173 508 576 ;
+C -1 ; WX 600 ; N Tcaron ; B 72 0 528 789 ;
+C -1 ; WX 600 ; N Scaron ; B 92 -16 508 789 ;
+C -1 ; WX 600 ; N Rcaron ; B 43 0 589 789 ;
+C -1 ; WX 600 ; N Racute ; B 43 0 589 789 ;
+C -1 ; WX 600 ; N Sacute ; B 92 -16 508 789 ;
+C -1 ; WX 600 ; N Otilde ; B 51 -16 549 755 ;
+C -1 ; WX 600 ; N ucircumflex ; B 43 -16 541 639 ;
+C -1 ; WX 600 ; N Ohungarumlaut ; B 51 -16 549 783 ;
+C -1 ; WX 600 ; N Uhungarumlaut ; B 40 -16 560 783 ;
+C -1 ; WX 600 ; N Yacute ; B 51 0 549 789 ;
+C -1 ; WX 600 ; N Eth ; B 0 0 520 563 ;
+C -1 ; WX 600 ; N Dcroat ; B 0 0 520 563 ;
+C -1 ; WX 600 ; N Zacute ; B 103 0 497 789 ;
+C -1 ; WX 600 ; N Uring ; B 40 -16 560 811 ;
+C -1 ; WX 600 ; N gbreve ; B 63 -186 562 620 ;
+C -1 ; WX 600 ; N eogonek ; B 63 -155 520 431 ;
+C -1 ; WX 600 ; N edotaccent ; B 63 -16 520 611 ;
+C -1 ; WX 600 ; N ecaron ; B 63 -16 520 639 ;
+C -1 ; WX 600 ; N Ugrave ; B 40 -16 560 789 ;
+C -1 ; WX 600 ; N Thorn ; B 43 0 499 563 ;
+C -1 ; WX 600 ; N eacute ; B 63 -16 520 639 ;
+C -1 ; WX 600 ; N edieresis ; B 63 -16 520 611 ;
+C -1 ; WX 600 ; N dcaron ; B 63 -16 650 616 ;
+C -1 ; WX 600 ; N ccedilla ; B 84 -173 535 431 ;
+C -1 ; WX 600 ; N ccaron ; B 84 -16 535 639 ;
+C -1 ; WX 600 ; N cacute ; B 84 -16 535 639 ;
+C -1 ; WX 600 ; N aogonek ; B 72 -155 556 431 ;
+C -1 ; WX 600 ; N aring ; B 72 -16 541 661 ;
+C -1 ; WX 600 ; N atilde ; B 72 -16 541 605 ;
+C -1 ; WX 600 ; N abreve ; B 72 -16 541 620 ;
+C -1 ; WX 600 ; N egrave ; B 63 -16 520 639 ;
+C -1 ; WX 600 ; N agrave ; B 72 -16 541 639 ;
+C -1 ; WX 600 ; N aacute ; B 72 -16 541 639 ;
+C -1 ; WX 600 ; N adieresis ; B 72 -16 541 611 ;
+C -1 ; WX 600 ; N Uogonek ; B 40 -155 560 563 ;
+C -1 ; WX 600 ; N ugrave ; B 43 -16 541 639 ;
+C -1 ; WX 600 ; N uacute ; B 43 -16 541 639 ;
+C -1 ; WX 600 ; N udieresis ; B 43 -16 541 611 ;
+C -1 ; WX 600 ; N tcaron ; B 43 -16 508 616 ;
+C -1 ; WX 600 ; N scommaaccent ; B 103 -237 497 431 ;
+C -1 ; WX 600 ; N Zcaron ; B 103 0 497 789 ;
+C -1 ; WX 600 ; N ecircumflex ; B 63 -16 520 639 ;
+C -1 ; WX 600 ; N Ucircumflex ; B 40 -16 560 789 ;
+C -1 ; WX 600 ; N acircumflex ; B 72 -16 541 639 ;
+C -1 ; WX 600 ; N Zdotaccent ; B 103 0 497 761 ;
+C -1 ; WX 600 ; N scaron ; B 103 -16 497 639 ;
+C -1 ; WX 600 ; N Amacron ; B 9 0 591 726 ;
+C -1 ; WX 600 ; N sacute ; B 103 -16 497 639 ;
+C -1 ; WX 600 ; N Tcommaaccent ; B 72 -237 528 563 ;
+C -1 ; WX 600 ; N Ydieresis ; B 51 0 549 761 ;
+C -1 ; WX 600 ; N thorn ; B 22 -186 541 590 ;
+C -1 ; WX 600 ; N Emacron ; B 43 0 520 726 ;
+C -1 ; WX 600 ; N Ograve ; B 51 -16 549 789 ;
+C -1 ; WX 600 ; N Oacute ; B 51 -16 549 789 ;
+C -1 ; WX 600 ; N Odieresis ; B 51 -16 549 761 ;
+C -1 ; WX 600 ; N Ntilde ; B 22 0 562 755 ;
+C -1 ; WX 600 ; N Ncaron ; B 22 0 562 789 ;
+C -1 ; WX 600 ; N Nacute ; B 22 0 562 789 ;
+C -1 ; WX 600 ; N Lcaron ; B 63 0 541 566 ;
+C -1 ; WX 600 ; N Lacute ; B 63 0 541 789 ;
+C -1 ; WX 600 ; N Idotaccent ; B 113 0 487 761 ;
+C -1 ; WX 600 ; N racute ; B 84 0 541 639 ;
+C -1 ; WX 600 ; N Icircumflex ; B 113 0 487 789 ;
+C -1 ; WX 600 ; N ohungarumlaut ; B 72 -16 528 633 ;
+C -1 ; WX 600 ; N otilde ; B 72 -16 528 605 ;
+C -1 ; WX 600 ; N Euro ; B 11 -16 534 576 ;
+C -1 ; WX 600 ; N ocircumflex ; B 72 -16 528 639 ;
+C -1 ; WX 600 ; N onesuperior ; B 191 259 410 612 ;
+C -1 ; WX 600 ; N twosuperior ; B 175 259 405 612 ;
+C -1 ; WX 600 ; N threesuperior ; B 181 251 416 612 ;
+C -1 ; WX 600 ; N Igrave ; B 113 0 487 789 ;
+C -1 ; WX 600 ; N Iacute ; B 113 0 487 789 ;
+C -1 ; WX 600 ; N Imacron ; B 113 0 487 726 ;
+C -1 ; WX 600 ; N Iogonek ; B 113 -155 500 563 ;
+C -1 ; WX 600 ; N Idieresis ; B 113 0 487 761 ;
+C -1 ; WX 600 ; N Gbreve ; B 63 -16 562 770 ;
+C -1 ; WX 600 ; N Umacron ; B 40 -16 560 726 ;
+C -1 ; WX 600 ; N Kcommaaccent ; B 43 -237 572 563 ;
+C -1 ; WX 600 ; N ograve ; B 72 -16 528 639 ;
+C -1 ; WX 600 ; N Scommaaccent ; B 92 -237 508 576 ;
+C -1 ; WX 600 ; N Eogonek ; B 43 -155 549 563 ;
+C -1 ; WX 600 ; N oacute ; B 72 -16 528 639 ;
+C -1 ; WX 600 ; N Edotaccent ; B 43 0 520 761 ;
+C -1 ; WX 600 ; N iogonek ; B 92 -155 520 624 ;
+C -1 ; WX 600 ; N gcommaaccent ; B 63 -186 562 666 ;
+C -1 ; WX 600 ; N odieresis ; B 72 -16 528 611 ;
+C -1 ; WX 600 ; N ntilde ; B 53 0 541 605 ;
+C -1 ; WX 600 ; N ncaron ; B 53 0 541 639 ;
+C -1 ; WX 600 ; N Ecaron ; B 43 0 520 789 ;
+C -1 ; WX 600 ; N Ecircumflex ; B 43 0 520 789 ;
+C -1 ; WX 600 ; N scedilla ; B 103 -173 497 431 ;
+C -1 ; WX 600 ; N rcaron ; B 84 0 541 639 ;
+C -1 ; WX 600 ; N Egrave ; B 43 0 520 789 ;
+C -1 ; WX 600 ; N Eacute ; B 43 0 520 789 ;
+C -1 ; WX 600 ; N Gcommaaccent ; B 63 -237 562 576 ;
+C -1 ; WX 600 ; N Rcommaaccent ; B 43 -237 589 563 ;
+C -1 ; WX 600 ; N Edieresis ; B 43 0 520 761 ;
+C -1 ; WX 600 ; N nacute ; B 53 0 541 639 ;
+C -1 ; WX 600 ; N uogonek ; B 43 -155 556 417 ;
+C -1 ; WX 600 ; N umacron ; B 43 -16 541 576 ;
+C -1 ; WX 600 ; N Dcaron ; B 43 0 520 789 ;
+C -1 ; WX 600 ; N lcaron ; B 92 0 508 616 ;
+C -1 ; WX 600 ; N Ccaron ; B 63 -16 534 789 ;
+C -1 ; WX 600 ; N Cacute ; B 63 -16 534 789 ;
+C -1 ; WX 600 ; N Ccedilla ; B 63 -173 534 576 ;
+C -1 ; WX 600 ; N degree ; B 155 346 445 636 ;
+C -1 ; WX 600 ; N Aogonek ; B 9 -155 600 563 ;
+C -1 ; WX 600 ; N minus ; B 72 261 528 302 ;
+C -1 ; WX 600 ; N multiply ; B 118 100 482 464 ;
+C -1 ; WX 600 ; N divide ; B 72 25 528 540 ;
+C -1 ; WX 600 ; N Aring ; B 9 0 591 811 ;
+C -1 ; WX 600 ; N trademark ; B 4 243 598 563 ;
+C -1 ; WX 600 ; N rcommaaccent ; B 84 -237 541 427 ;
+C -1 ; WX 600 ; N lacute ; B 92 0 508 789 ;
+C -1 ; WX 600 ; N omacron ; B 72 -16 528 576 ;
+C -1 ; WX 600 ; N Atilde ; B 9 0 591 755 ;
+C -1 ; WX 600 ; N icircumflex ; B 92 0 508 639 ;
+C -1 ; WX 600 ; N igrave ; B 92 0 508 639 ;
+C -1 ; WX 600 ; N ncommaaccent ; B 53 -237 541 431 ;
+C -1 ; WX 600 ; N lcommaaccent ; B 92 -237 508 604 ;
+C -1 ; WX 600 ; N plusminus ; B 72 0 528 529 ;
+C -1 ; WX 600 ; N onehalf ; B 23 0 573 612 ;
+C -1 ; WX 600 ; N onequarter ; B 16 0 580 612 ;
+C -1 ; WX 600 ; N threequarters ; B 6 0 580 612 ;
+C -1 ; WX 600 ; N iacute ; B 92 0 508 639 ;
+C -1 ; WX 600 ; N Abreve ; B 9 0 591 770 ;
+C -1 ; WX 600 ; N kcommaaccent ; B 63 -237 541 604 ;
+C -1 ; WX 600 ; N Omacron ; B 51 -16 549 726 ;
+C -1 ; WX 600 ; N imacron ; B 92 0 508 576 ;
+C -1 ; WX 600 ; N emacron ; B 63 -16 520 576 ;
+C -1 ; WX 600 ; N amacron ; B 72 -16 541 576 ;
+C -1 ; WX 600 ; N tcommaaccent ; B 43 -237 499 563 ;
+C -1 ; WX 600 ; N ydieresis ; B 51 -186 549 611 ;
+C -1 ; WX 600 ; N zdotaccent ; B 115 0 489 611 ;
+C -1 ; WX 600 ; N zcaron ; B 115 0 489 639 ;
+C -1 ; WX 600 ; N zacute ; B 115 0 489 639 ;
+C -1 ; WX 600 ; N yacute ; B 51 -186 549 639 ;
+C -1 ; WX 600 ; N uhungarumlaut ; B 43 -16 541 633 ;
+C -1 ; WX 600 ; N eth ; B 72 -17 528 620 ;
+C -1 ; WX 600 ; N uring ; B 43 -16 541 661 ;
+C -1 ; WX 600 ; N Ocircumflex ; B 51 -16 549 789 ;
+C -1 ; WX 600 ; N commaaccent ; B 234 -237 367 -60 ;
+C -1 ; WX 600 ; N copyright ; B 3 -15 596 578 ;
+C -1 ; WX 600 ; N registered ; B 3 -15 596 578 ;
+C -1 ; WX 600 ; N Acircumflex ; B 9 0 591 789 ;
+C -1 ; WX 600 ; N idieresis ; B 92 0 508 611 ;
+C -1 ; WX 600 ; N lozenge ; B 89 -11 511 575 ;
+C -1 ; WX 600 ; N Delta ; B 43 0 557 563 ;
+C -1 ; WX 600 ; N notequal ; B 51 94 549 464 ;
+C -1 ; WX 600 ; N radical ; B 27 0 628 699 ;
+C -1 ; WX 600 ; N Agrave ; B 9 0 591 789 ;
+C -1 ; WX 600 ; N Aacute ; B 9 0 591 789 ;
+C -1 ; WX 600 ; N lessequal ; B 53 0 525 535 ;
+C -1 ; WX 600 ; N greaterequal ; B 59 0 531 535 ;
+C -1 ; WX 600 ; N logicalnot ; B 72 168 528 438 ;
+C -1 ; WX 600 ; N summation ; B 113 -127 507 563 ;
+C -1 ; WX 600 ; N partialdiff ; B 71 -17 529 582 ;
+C -1 ; WX 600 ; N Ncommaaccent ; B 22 -237 562 563 ;
+C -1 ; WX 600 ; N dcroat ; B 63 -16 583 604 ;
+C -1 ; WX 600 ; N brokenbar ; B 280 -124 320 604 ;
+C -1 ; WX 600 ; N Lcommaaccent ; B 63 -237 541 563 ;
+C -1 ; WX 600 ; N Adieresis ; B 9 0 591 761 ;
+C -1 ; WX 600 ; N mu ; B 43 -200 541 417 ;
+C -1 ; WX 600 ; N .notdef ; B 295 0 295 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 998
+KPX A C -33
+KPX A Ccedilla -30
+KPX A G -27
+KPX A O -27
+KPX A Odieresis -27
+KPX A Q -28
+KPX A T -27
+KPX A U -32
+KPX A Uacute -32
+KPX A Ucircumflex -32
+KPX A Udieresis -32
+KPX A Ugrave -32
+KPX A V -74
+KPX A W -12
+KPX A Y -28
+KPX A a 8
+KPX A b 46
+KPX A c -19
+KPX A ccedilla -15
+KPX A comma -39
+KPX A d -10
+KPX A e -14
+KPX A g -23
+KPX A guillemotleft -49
+KPX A guilsinglleft -49
+KPX A hyphen -30
+KPX A o -16
+KPX A period -67
+KPX A q -24
+KPX A quotedblright -78
+KPX A quoteright -98
+KPX A t -26
+KPX A u -15
+KPX A v -55
+KPX A w -19
+KPX A y -60
+KPX Aacute C -33
+KPX Aacute G -27
+KPX Aacute O -27
+KPX Aacute Q -28
+KPX Aacute T -27
+KPX Aacute U -32
+KPX Aacute V -74
+KPX Aacute W -12
+KPX Aacute Y -28
+KPX Aacute a 8
+KPX Aacute b 46
+KPX Aacute c -19
+KPX Aacute comma -39
+KPX Aacute d -10
+KPX Aacute e -14
+KPX Aacute g -23
+KPX Aacute guillemotleft -49
+KPX Aacute guilsinglleft -49
+KPX Aacute hyphen -30
+KPX Aacute o -16
+KPX Aacute period -67
+KPX Aacute q -24
+KPX Aacute quoteright -98
+KPX Aacute t -26
+KPX Aacute u -15
+KPX Aacute v -55
+KPX Aacute w -19
+KPX Aacute y -60
+KPX Acircumflex C -33
+KPX Acircumflex G -27
+KPX Acircumflex O -27
+KPX Acircumflex Q -28
+KPX Acircumflex T -27
+KPX Acircumflex U -32
+KPX Acircumflex V -74
+KPX Acircumflex W -12
+KPX Acircumflex Y -28
+KPX Acircumflex comma -39
+KPX Acircumflex period -67
+KPX Adieresis C -33
+KPX Adieresis G -27
+KPX Adieresis O -27
+KPX Adieresis Q -28
+KPX Adieresis T -27
+KPX Adieresis U -32
+KPX Adieresis V -74
+KPX Adieresis W -12
+KPX Adieresis Y -28
+KPX Adieresis a 8
+KPX Adieresis b 46
+KPX Adieresis c -19
+KPX Adieresis comma -39
+KPX Adieresis d -10
+KPX Adieresis g -23
+KPX Adieresis guillemotleft -49
+KPX Adieresis guilsinglleft -49
+KPX Adieresis hyphen -30
+KPX Adieresis o -16
+KPX Adieresis period -67
+KPX Adieresis q -24
+KPX Adieresis quotedblright -78
+KPX Adieresis quoteright -98
+KPX Adieresis t -26
+KPX Adieresis u -15
+KPX Adieresis v -55
+KPX Adieresis w -19
+KPX Adieresis y -60
+KPX Agrave C -33
+KPX Agrave G -27
+KPX Agrave O -27
+KPX Agrave Q -28
+KPX Agrave T -27
+KPX Agrave U -32
+KPX Agrave V -74
+KPX Agrave W -12
+KPX Agrave Y -28
+KPX Agrave comma -39
+KPX Agrave period -67
+KPX Aring C -33
+KPX Aring G -27
+KPX Aring O -27
+KPX Aring Q -28
+KPX Aring T -27
+KPX Aring U -32
+KPX Aring V -74
+KPX Aring W -12
+KPX Aring Y -28
+KPX Aring a 8
+KPX Aring b 46
+KPX Aring c -19
+KPX Aring comma -39
+KPX Aring d -10
+KPX Aring e -14
+KPX Aring g -23
+KPX Aring guillemotleft -49
+KPX Aring guilsinglleft -49
+KPX Aring hyphen -30
+KPX Aring o -16
+KPX Aring period -67
+KPX Aring q -24
+KPX Aring quotedblright -78
+KPX Aring quoteright -98
+KPX Aring t -26
+KPX Aring u -15
+KPX Aring v -55
+KPX Aring w -19
+KPX Aring y -60
+KPX Atilde C -33
+KPX Atilde G -27
+KPX Atilde O -27
+KPX Atilde Q -28
+KPX Atilde T -27
+KPX Atilde U -32
+KPX Atilde V -74
+KPX Atilde W -12
+KPX Atilde Y -28
+KPX Atilde comma -39
+KPX Atilde period -67
+KPX B A -9
+KPX B AE -9
+KPX B Aacute -9
+KPX B Acircumflex -9
+KPX B Adieresis -9
+KPX B Aring -9
+KPX B Atilde -9
+KPX B O -10
+KPX B OE 10
+KPX B Oacute -10
+KPX B Ocircumflex -10
+KPX B Odieresis -10
+KPX B Ograve -10
+KPX B Oslash -8
+KPX B V -29
+KPX B W -12
+KPX B Y -50
+KPX C A -9
+KPX C AE -9
+KPX C Aacute -9
+KPX C Adieresis -9
+KPX C Aring -9
+KPX C H -26
+KPX C K -11
+KPX C O -21
+KPX C Oacute -21
+KPX C Odieresis -21
+KPX Ccedilla A -5
+KPX D A -42
+KPX D Aacute -42
+KPX D Acircumflex -42
+KPX D Adieresis -42
+KPX D Agrave -42
+KPX D Aring -42
+KPX D Atilde -42
+KPX D J -31
+KPX D T -40
+KPX D V -42
+KPX D W -17
+KPX D X -55
+KPX D Y -63
+KPX F A -38
+KPX F Aacute -38
+KPX F Acircumflex -38
+KPX F Adieresis -38
+KPX F Agrave -38
+KPX F Aring -38
+KPX F Atilde -38
+KPX F J -95
+KPX F O -27
+KPX F Odieresis -27
+KPX F a -47
+KPX F aacute -47
+KPX F adieresis -43
+KPX F ae -20
+KPX F aring -47
+KPX F comma -168
+KPX F e -56
+KPX F eacute -56
+KPX F hyphen -67
+KPX F i -47
+KPX F j -54
+KPX F o -63
+KPX F oacute -63
+KPX F odieresis -48
+KPX F oe -21
+KPX F oslash -63
+KPX F period -193
+KPX F r -32
+KPX F u -1
+KPX G A 6
+KPX G AE 5
+KPX G Aacute 6
+KPX G Acircumflex 6
+KPX G Adieresis 6
+KPX G Agrave 6
+KPX G Aring 6
+KPX G Atilde 6
+KPX G T -25
+KPX G V 6
+KPX G W 1
+KPX G Y -14
+KPX J A -7
+KPX J AE -16
+KPX J Adieresis -7
+KPX J Aring -7
+KPX K C -42
+KPX K G -36
+KPX K O -37
+KPX K OE -19
+KPX K Oacute -37
+KPX K Odieresis -37
+KPX K S -9
+KPX K T -12
+KPX K a -1
+KPX K adieresis -1
+KPX K ae 26
+KPX K aring -1
+KPX K e -24
+KPX K hyphen -61
+KPX K o -25
+KPX K oacute -25
+KPX K odieresis -25
+KPX K u -25
+KPX K udieresis -25
+KPX K y -67
+KPX L A 17
+KPX L AE 16
+KPX L Aacute 17
+KPX L Adieresis 17
+KPX L Aring 17
+KPX L C -11
+KPX L Ccedilla -10
+KPX L G -10
+KPX L O -6
+KPX L Oacute -6
+KPX L Ocircumflex -6
+KPX L Odieresis -6
+KPX L Ograve -6
+KPX L Otilde -6
+KPX L S -24
+KPX L T -52
+KPX L U -29
+KPX L Udieresis -29
+KPX L V -66
+KPX L W -27
+KPX L Y -53
+KPX L hyphen 3
+KPX L quotedblright -66
+KPX L quoteright -73
+KPX L u -16
+KPX L udieresis -16
+KPX L y -45
+KPX N A -3
+KPX N AE -3
+KPX N Aacute -3
+KPX N Adieresis -3
+KPX N Aring -3
+KPX N C -12
+KPX N Ccedilla -12
+KPX N G -11
+KPX N O -9
+KPX N Oacute -9
+KPX N Odieresis -9
+KPX N a -19
+KPX N aacute -19
+KPX N adieresis -19
+KPX N ae 11
+KPX N aring -19
+KPX N comma -58
+KPX N e -6
+KPX N eacute -6
+KPX N o -10
+KPX N oacute -10
+KPX N odieresis -10
+KPX N oslash -7
+KPX N period -83
+KPX N u -9
+KPX N udieresis -9
+KPX O A -27
+KPX O AE -26
+KPX O Aacute -27
+KPX O Adieresis -27
+KPX O Aring -27
+KPX O T -30
+KPX O V -31
+KPX O W -5
+KPX O X -43
+KPX O Y -52
+KPX Oacute A -27
+KPX Oacute T -30
+KPX Oacute V -31
+KPX Oacute W -5
+KPX Oacute Y -52
+KPX Ocircumflex T -30
+KPX Ocircumflex V -31
+KPX Ocircumflex Y -52
+KPX Odieresis A -27
+KPX Odieresis T -30
+KPX Odieresis V -31
+KPX Odieresis W -5
+KPX Odieresis X -43
+KPX Odieresis Y -52
+KPX Ograve T -30
+KPX Ograve V -31
+KPX Ograve Y -52
+KPX Oslash A -26
+KPX Otilde T -30
+KPX Otilde V -31
+KPX Otilde Y -52
+KPX P A -79
+KPX P AE -76
+KPX P Aacute -79
+KPX P Adieresis -79
+KPX P Aring -79
+KPX P J -82
+KPX P a -52
+KPX P aacute -52
+KPX P adieresis -52
+KPX P ae -25
+KPX P aring -52
+KPX P comma -156
+KPX P e -42
+KPX P eacute -42
+KPX P hyphen -46
+KPX P o -48
+KPX P oacute -48
+KPX P odieresis -48
+KPX P oe -13
+KPX P oslash -48
+KPX P period -181
+KPX R C -27
+KPX R Ccedilla -28
+KPX R G -26
+KPX R O -25
+KPX R OE -4
+KPX R Oacute -25
+KPX R Odieresis -25
+KPX R T -28
+KPX R U -32
+KPX R Udieresis -32
+KPX R V -33
+KPX R W -13
+KPX R Y -29
+KPX R a 7
+KPX R aacute 7
+KPX R adieresis 7
+KPX R ae 35
+KPX R aring 7
+KPX R e -15
+KPX R eacute -15
+KPX R hyphen -48
+KPX R o -17
+KPX R oacute -17
+KPX R odieresis -17
+KPX R oe 22
+KPX R u -11
+KPX R uacute -11
+KPX R udieresis -11
+KPX R y -15
+KPX S A -22
+KPX S AE -22
+KPX S Aacute -22
+KPX S Adieresis -22
+KPX S Aring -22
+KPX S T -42
+KPX S V -10
+KPX S W -16
+KPX S Y -31
+KPX S t -18
+KPX T A -27
+KPX T AE -27
+KPX T Aacute -27
+KPX T Acircumflex -27
+KPX T Adieresis -27
+KPX T Agrave -27
+KPX T Aring -27
+KPX T Atilde -27
+KPX T C -29
+KPX T G -30
+KPX T J -79
+KPX T O -29
+KPX T OE -7
+KPX T Oacute -29
+KPX T Ocircumflex -29
+KPX T Odieresis -29
+KPX T Ograve -29
+KPX T Oslash -29
+KPX T Otilde -29
+KPX T S -43
+KPX T V 10
+KPX T W 5
+KPX T Y -10
+KPX T a -60
+KPX T ae -33
+KPX T c -88
+KPX T colon -136
+KPX T comma -108
+KPX T e -83
+KPX T g -92
+KPX T guillemotleft -122
+KPX T guilsinglleft -122
+KPX T hyphen -94
+KPX T i -58
+KPX T j -80
+KPX T o -85
+KPX T oslash -54
+KPX T period -136
+KPX T r -54
+KPX T s -63
+KPX T semicolon -111
+KPX T u -84
+KPX T v -93
+KPX T w -88
+KPX T y -103
+KPX U A -18
+KPX U AE -27
+KPX U Aacute -18
+KPX U Acircumflex -18
+KPX U Adieresis -18
+KPX U Aring -18
+KPX U Atilde -18
+KPX U comma -76
+KPX U m 6
+KPX U n -19
+KPX U p 0
+KPX U period -101
+KPX U r -41
+KPX Uacute A -18
+KPX Uacute comma -76
+KPX Uacute m 6
+KPX Uacute n -19
+KPX Uacute p 0
+KPX Uacute period -101
+KPX Uacute r -41
+KPX Ucircumflex A -18
+KPX Udieresis A -18
+KPX Udieresis b 25
+KPX Udieresis comma -76
+KPX Udieresis m 6
+KPX Udieresis n -19
+KPX Udieresis p 0
+KPX Udieresis period -101
+KPX Udieresis r -41
+KPX Ugrave A -18
+KPX V A -3
+KPX V AE -12
+KPX V Aacute -3
+KPX V Acircumflex -3
+KPX V Adieresis -3
+KPX V Agrave -3
+KPX V Aring -3
+KPX V Atilde -3
+KPX V C -29
+KPX V G -31
+KPX V O -31
+KPX V Oacute -31
+KPX V Ocircumflex -31
+KPX V Odieresis -31
+KPX V Ograve -31
+KPX V Oslash -31
+KPX V Otilde -31
+KPX V S -34
+KPX V T 10
+KPX V a -60
+KPX V ae -33
+KPX V colon -124
+KPX V comma -129
+KPX V e -52
+KPX V g -53
+KPX V guillemotleft -75
+KPX V guilsinglleft -75
+KPX V hyphen -43
+KPX V i -60
+KPX V o -56
+KPX V oslash -53
+KPX V period -154
+KPX V r -46
+KPX V semicolon -114
+KPX V u -15
+KPX V y -19
+KPX W A -8
+KPX W AE -14
+KPX W Aacute -8
+KPX W Acircumflex -8
+KPX W Adieresis -8
+KPX W Agrave -8
+KPX W Aring -8
+KPX W Atilde -8
+KPX W C -8
+KPX W G -7
+KPX W O -5
+KPX W Oacute -5
+KPX W Ocircumflex -5
+KPX W Odieresis -5
+KPX W Ograve -5
+KPX W Oslash -2
+KPX W Otilde -5
+KPX W S -24
+KPX W T 5
+KPX W a -20
+KPX W ae 10
+KPX W colon -88
+KPX W comma -66
+KPX W e -6
+KPX W g -7
+KPX W guillemotleft -31
+KPX W guilsinglleft -31
+KPX W hyphen -2
+KPX W i -43
+KPX W o -10
+KPX W oslash -7
+KPX W period -90
+KPX W r -29
+KPX W semicolon -69
+KPX W u 2
+KPX W y -2
+KPX X C -46
+KPX X O -43
+KPX X Odieresis -43
+KPX X Q -44
+KPX X a -7
+KPX X e -30
+KPX X hyphen -75
+KPX X o -31
+KPX X u -31
+KPX X y -53
+KPX Y A -24
+KPX Y AE -27
+KPX Y Aacute -24
+KPX Y Acircumflex -24
+KPX Y Adieresis -24
+KPX Y Agrave -24
+KPX Y Aring -24
+KPX Y Atilde -24
+KPX Y C -51
+KPX Y G -52
+KPX Y O -53
+KPX Y Oacute -53
+KPX Y Ocircumflex -53
+KPX Y Odieresis -53
+KPX Y Ograve -53
+KPX Y Oslash -53
+KPX Y Otilde -53
+KPX Y S -55
+KPX Y T -10
+KPX Y a -60
+KPX Y ae -32
+KPX Y colon -135
+KPX Y comma -107
+KPX Y e -78
+KPX Y g -81
+KPX Y guillemotleft -115
+KPX Y guilsinglleft -115
+KPX Y hyphen -91
+KPX Y i -57
+KPX Y o -83
+KPX Y oslash -54
+KPX Y p -35
+KPX Y period -135
+KPX Y semicolon -110
+KPX Y u -46
+KPX Y v -39
+KPX Z v -50
+KPX Z y -61
+KPX a j -87
+KPX a quoteright -56
+KPX a v -28
+KPX a w -21
+KPX a y -38
+KPX aacute v -28
+KPX aacute w -21
+KPX aacute y -38
+KPX adieresis v -28
+KPX adieresis w -21
+KPX adieresis y -38
+KPX ae v 21
+KPX ae w 21
+KPX ae y 10
+KPX agrave v -28
+KPX agrave w -21
+KPX agrave y -38
+KPX aring v -28
+KPX aring w -21
+KPX aring y -38
+KPX b v -12
+KPX b w 1
+KPX b y -22
+KPX c h -3
+KPX c k -9
+KPX comma one -144
+KPX comma quotedblright -119
+KPX comma quoteright -136
+KPX e quoteright -41
+KPX e t -29
+KPX e v -22
+KPX e w -19
+KPX e x -2
+KPX e y -33
+KPX eacute v -22
+KPX eacute w -19
+KPX eacute y -33
+KPX ecircumflex v -22
+KPX ecircumflex w -19
+KPX ecircumflex y -33
+KPX eight four -58
+KPX eight one -75
+KPX eight seven -68
+KPX f a -38
+KPX f aacute -38
+KPX f adieresis -22
+KPX f ae -11
+KPX f aring -38
+KPX f e -55
+KPX f eacute -55
+KPX f f -42
+KPX f i -36
+KPX f j -59
+KPX f l -25
+KPX f o -62
+KPX f oacute -62
+KPX f odieresis -27
+KPX f oe -20
+KPX f oslash -32
+KPX f quoteright -56
+KPX f s -41
+KPX f t -6
+KPX five four -52
+KPX five one -86
+KPX five seven -72
+KPX four four -62
+KPX four one -66
+KPX four seven -93
+KPX g a -10
+KPX g adieresis -10
+KPX g ae 16
+KPX g aring -10
+KPX g e -4
+KPX g eacute -4
+KPX g l -33
+KPX g oacute -8
+KPX g odieresis -8
+KPX g r 0
+KPX guillemotright A -43
+KPX guillemotright AE -39
+KPX guillemotright Aacute -43
+KPX guillemotright Adieresis -43
+KPX guillemotright Aring -43
+KPX guillemotright T -121
+KPX guillemotright V -71
+KPX guillemotright W -29
+KPX guillemotright Y -114
+KPX guilsinglright A -43
+KPX guilsinglright AE -39
+KPX guilsinglright Aacute -43
+KPX guilsinglright Adieresis -43
+KPX guilsinglright Aring -43
+KPX guilsinglright T -121
+KPX guilsinglright V -71
+KPX guilsinglright W -29
+KPX guilsinglright Y -114
+KPX h quoteright -49
+KPX h y -32
+KPX hyphen A -26
+KPX hyphen AE -20
+KPX hyphen Aacute -26
+KPX hyphen Adieresis -26
+KPX hyphen Aring -26
+KPX hyphen T -95
+KPX hyphen V -41
+KPX hyphen W -1
+KPX hyphen Y -92
+KPX i T -58
+KPX i j -142
+KPX k a -6
+KPX k aacute -6
+KPX k adieresis -6
+KPX k ae 21
+KPX k aring -6
+KPX k comma -53
+KPX k e -29
+KPX k eacute -29
+KPX k g -38
+KPX k hyphen -99
+KPX k o -30
+KPX k oacute -30
+KPX k odieresis -30
+KPX k period -81
+KPX k s -9
+KPX k u -3
+KPX k udieresis -3
+KPX l v -83
+KPX l y -93
+KPX m p 22
+KPX m v 14
+KPX m w 15
+KPX m y 3
+KPX n T -42
+KPX n p -5
+KPX n quoteright -47
+KPX n v -21
+KPX n w -12
+KPX n y -31
+KPX nine four -51
+KPX nine one -75
+KPX nine seven -66
+KPX o T -85
+KPX o quoteright -39
+KPX o t -22
+KPX o v -21
+KPX o w -6
+KPX o x -26
+KPX o y -31
+KPX oacute v -21
+KPX oacute w -6
+KPX oacute y -31
+KPX ocircumflex t -22
+KPX odieresis t -22
+KPX odieresis v -21
+KPX odieresis w -6
+KPX odieresis x -26
+KPX odieresis y -31
+KPX ograve v -21
+KPX ograve w -6
+KPX ograve y -31
+KPX one comma -91
+KPX one eight -86
+KPX one five -67
+KPX one four -119
+KPX one nine -75
+KPX one one -62
+KPX one period -119
+KPX one seven -141
+KPX one six -111
+KPX one three -61
+KPX one two -47
+KPX one zero -94
+KPX p t -15
+KPX p y -19
+KPX period one -119
+KPX period quotedblright -108
+KPX period quoteright -125
+KPX q c -2
+KPX q u 42
+KPX quotedblbase A -3
+KPX quotedblbase AE -3
+KPX quotedblbase T -78
+KPX quotedblbase V -83
+KPX quotedblbase W -23
+KPX quotedblbase Y -79
+KPX quotedblleft A -59
+KPX quotedblleft AE -52
+KPX quotedblleft Aacute -59
+KPX quotedblleft Adieresis -59
+KPX quotedblleft Aring -59
+KPX quotedblleft T -37
+KPX quotedblleft V -14
+KPX quotedblleft W -3
+KPX quotedblleft Y -35
+KPX quotedblright A -59
+KPX quotedblright AE -68
+KPX quotedblright Aacute -59
+KPX quotedblright Adieresis -59
+KPX quotedblright Aring -59
+KPX quotedblright T -45
+KPX quotedblright V -14
+KPX quotedblright W -20
+KPX quotedblright Y -35
+KPX quoteleft A -80
+KPX quoteleft AE -73
+KPX quoteleft Aacute -80
+KPX quoteleft Adieresis -80
+KPX quoteleft Aring -80
+KPX quoteleft T -59
+KPX quoteleft V -36
+KPX quoteleft W -24
+KPX quoteleft Y -56
+KPX quoteright A -140
+KPX quoteright AE -149
+KPX quoteright Aacute -140
+KPX quoteright Adieresis -140
+KPX quoteright Aring -140
+KPX quoteright comma -196
+KPX quoteright d -126
+KPX quoteright o -131
+KPX quoteright period -220
+KPX quoteright r -145
+KPX quoteright s -140
+KPX quoteright t -114
+KPX quoteright v -108
+KPX quoteright w -105
+KPX quoteright y -118
+KPX r a -20
+KPX r aacute -20
+KPX r acircumflex -20
+KPX r adieresis -20
+KPX r ae 7
+KPX r agrave -20
+KPX r aring -20
+KPX r c -24
+KPX r ccedilla -28
+KPX r colon -81
+KPX r comma -97
+KPX r d -14
+KPX r e -12
+KPX r eacute -12
+KPX r ecircumflex -12
+KPX r egrave -12
+KPX r f -18
+KPX r g -11
+KPX r h -19
+KPX r hyphen -120
+KPX r i -28
+KPX r j -35
+KPX r k -29
+KPX r l -47
+KPX r m 33
+KPX r n 6
+KPX r o -19
+KPX r oacute -19
+KPX r ocircumflex -19
+KPX r odieresis -19
+KPX r oe 18
+KPX r ograve -19
+KPX r oslash -19
+KPX r p 28
+KPX r period -125
+KPX r q -11
+KPX r quoteright -37
+KPX r r -13
+KPX r s -24
+KPX r semicolon -69
+KPX r t 17
+KPX r u 17
+KPX r v 24
+KPX r w 24
+KPX r x 2
+KPX r y 13
+KPX r z -19
+KPX s quoteright -48
+KPX s t -13
+KPX seven colon -148
+KPX seven comma -140
+KPX seven eight -79
+KPX seven five -84
+KPX seven four -111
+KPX seven one -67
+KPX seven period -165
+KPX seven seven -62
+KPX seven six -99
+KPX seven three -72
+KPX seven two -69
+KPX six four -46
+KPX six one -61
+KPX six seven -48
+KPX t S -35
+KPX t a -20
+KPX t aacute -20
+KPX t adieresis -20
+KPX t ae 8
+KPX t aring -20
+KPX t colon -102
+KPX t e -37
+KPX t eacute -37
+KPX t h -7
+KPX t o -39
+KPX t oacute -39
+KPX t odieresis -39
+KPX t quoteright -94
+KPX t semicolon -80
+KPX three four -52
+KPX three one -74
+KPX three seven -67
+KPX two four -92
+KPX two one -66
+KPX two seven -71
+KPX u quoteright -38
+KPX v a -6
+KPX v aacute -6
+KPX v acircumflex -6
+KPX v adieresis -6
+KPX v ae 20
+KPX v agrave -6
+KPX v aring -6
+KPX v atilde -6
+KPX v c -25
+KPX v colon -71
+KPX v comma -113
+KPX v e -13
+KPX v eacute -13
+KPX v ecircumflex -13
+KPX v egrave -13
+KPX v g -11
+KPX v hyphen -24
+KPX v l -82
+KPX v o -21
+KPX v oacute -21
+KPX v odieresis -21
+KPX v ograve -21
+KPX v oslash -21
+KPX v period -139
+KPX v s -19
+KPX v semicolon -62
+KPX w a -6
+KPX w aacute -6
+KPX w acircumflex -6
+KPX w adieresis -6
+KPX w ae 20
+KPX w agrave -6
+KPX w aring -6
+KPX w atilde -6
+KPX w c -10
+KPX w colon -71
+KPX w comma -70
+KPX w e -1
+KPX w eacute -1
+KPX w ecircumflex -1
+KPX w egrave -1
+KPX w g -3
+KPX w hyphen 1
+KPX w l -50
+KPX w o -6
+KPX w oacute -6
+KPX w odieresis -6
+KPX w ograve -6
+KPX w oslash -3
+KPX w period -95
+KPX w s -18
+KPX w semicolon -62
+KPX x a -2
+KPX x c -29
+KPX x e -25
+KPX x eacute -25
+KPX x o -26
+KPX x q -30
+KPX y a -17
+KPX y aacute -17
+KPX y acircumflex -17
+KPX y adieresis -17
+KPX y ae 10
+KPX y agrave -17
+KPX y aring -17
+KPX y atilde -17
+KPX y c -35
+KPX y colon -81
+KPX y comma -117
+KPX y e -24
+KPX y eacute -24
+KPX y ecircumflex -24
+KPX y egrave -24
+KPX y g -21
+KPX y hyphen -24
+KPX y l -93
+KPX y o -31
+KPX y oacute -31
+KPX y odieresis -31
+KPX y ograve -31
+KPX y oslash -31
+KPX y period -144
+KPX y s -30
+KPX y semicolon -72
+KPX zero four -58
+KPX zero one -81
+KPX zero seven -73
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/pdf2swf/fonts/n022003l.pfb b/pdf2swf/fonts/n022003l.pfb
new file mode 100644
index 00000000..0cadce7d
--- /dev/null
+++ b/pdf2swf/fonts/n022003l.pfb
Binary files differ
diff --git a/pdf2swf/fonts/n022004l.afm b/pdf2swf/fonts/n022004l.afm
new file mode 100644
index 00000000..0bafed51
--- /dev/null
+++ b/pdf2swf/fonts/n022004l.afm
@@ -0,0 +1,1341 @@
+StartFontMetrics 3.0
+Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development
+Comment Creation Date: 12/22/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName NimbusMonL-Bold
+FullName Nimbus Mono L Bold
+FamilyName Nimbus Mono L
+Weight Bold
+ItalicAngle 0.0
+IsFixedPitch false
+UnderlinePosition -100
+UnderlineThickness 50
+Version 1.05
+Notice (URW)++,Copyright 1999 by (URW)++ Design & Development
+EncodingScheme AdobeStandardEncoding
+FontBBox -43 -278 681 871
+CapHeight 583
+XHeight 437
+Descender -205
+Ascender 624
+StartCharMetrics 316
+C 32 ; WX 600 ; N space ; B 375 0 375 0 ;
+C 33 ; WX 600 ; N exclam ; B 220 -15 381 638 ;
+C 34 ; WX 600 ; N quotedbl ; B 136 312 464 602 ;
+C 35 ; WX 600 ; N numbersign ; B 62 -92 538 675 ;
+C 36 ; WX 600 ; N dollar ; B 83 -123 517 684 ;
+C 37 ; WX 600 ; N percent ; B 80 -15 521 617 ;
+C 38 ; WX 600 ; N ampersand ; B 75 -14 508 550 ;
+C 39 ; WX 600 ; N quoteright ; B 147 331 351 623 ;
+C 40 ; WX 600 ; N parenleft ; B 264 -153 488 632 ;
+C 41 ; WX 600 ; N parenright ; B 117 -153 341 632 ;
+C 42 ; WX 600 ; N asterisk ; B 83 208 517 622 ;
+C 43 ; WX 600 ; N plus ; B 42 0 558 560 ;
+C 44 ; WX 600 ; N comma ; B 147 -158 351 134 ;
+C 45 ; WX 600 ; N hyphen ; B 42 229 558 329 ;
+C 46 ; WX 600 ; N period ; B 225 -15 375 117 ;
+C 47 ; WX 600 ; N slash ; B 83 -113 517 695 ;
+C 48 ; WX 600 ; N zero ; B 83 -15 517 638 ;
+C 49 ; WX 600 ; N one ; B 83 0 517 638 ;
+C 50 ; WX 600 ; N two ; B 54 0 508 638 ;
+C 51 ; WX 600 ; N three ; B 66 -15 529 638 ;
+C 52 ; WX 600 ; N four ; B 75 0 508 622 ;
+C 53 ; WX 600 ; N five ; B 66 -15 529 622 ;
+C 54 ; WX 600 ; N six ; B 105 -15 540 638 ;
+C 55 ; WX 600 ; N seven ; B 75 -1 508 622 ;
+C 56 ; WX 600 ; N eight ; B 83 -15 517 638 ;
+C 57 ; WX 600 ; N nine ; B 106 -15 541 638 ;
+C 58 ; WX 600 ; N colon ; B 225 -15 375 437 ;
+C 59 ; WX 600 ; N semicolon ; B 147 -158 351 437 ;
+C 60 ; WX 600 ; N less ; B 42 54 544 501 ;
+C 61 ; WX 600 ; N equal ; B 42 138 558 422 ;
+C 62 ; WX 600 ; N greater ; B 56 53 558 500 ;
+C 63 ; WX 600 ; N question ; B 104 -15 517 598 ;
+C 64 ; WX 600 ; N at ; B 76 -152 509 620 ;
+C 65 ; WX 600 ; N A ; B -21 0 621 583 ;
+C 66 ; WX 600 ; N B ; B 13 0 571 583 ;
+C 67 ; WX 600 ; N C ; B 33 -14 564 597 ;
+C 68 ; WX 600 ; N D ; B 13 0 550 583 ;
+C 69 ; WX 600 ; N E ; B 13 0 550 583 ;
+C 70 ; WX 600 ; N F ; B 13 0 550 583 ;
+C 71 ; WX 600 ; N G ; B 33 -14 592 597 ;
+C 72 ; WX 600 ; N H ; B 23 0 581 583 ;
+C 73 ; WX 600 ; N I ; B 83 0 517 583 ;
+C 74 ; WX 600 ; N J ; B 54 -14 613 583 ;
+C 75 ; WX 600 ; N K ; B 13 0 602 583 ;
+C 76 ; WX 600 ; N L ; B 33 0 571 583 ;
+C 77 ; WX 600 ; N M ; B -19 0 623 584 ;
+C 78 ; WX 600 ; N N ; B -8 0 592 583 ;
+C 79 ; WX 600 ; N O ; B 21 -14 579 597 ;
+C 80 ; WX 600 ; N P ; B 13 0 529 583 ;
+C 81 ; WX 600 ; N Q ; B 21 -145 579 597 ;
+C 82 ; WX 600 ; N R ; B 13 0 619 583 ;
+C 83 ; WX 600 ; N S ; B 62 -14 538 597 ;
+C 84 ; WX 600 ; N T ; B 42 0 558 583 ;
+C 85 ; WX 600 ; N U ; B 10 -14 590 583 ;
+C 86 ; WX 600 ; N V ; B -21 0 621 583 ;
+C 87 ; WX 600 ; N W ; B -10 0 610 583 ;
+C 88 ; WX 600 ; N X ; B 10 0 590 583 ;
+C 89 ; WX 600 ; N Y ; B 21 0 579 583 ;
+C 90 ; WX 600 ; N Z ; B 73 0 527 583 ;
+C 91 ; WX 600 ; N bracketleft ; B 250 -148 475 627 ;
+C 92 ; WX 600 ; N backslash ; B 83 -113 517 695 ;
+C 93 ; WX 600 ; N bracketright ; B 125 -148 350 627 ;
+C 94 ; WX 600 ; N asciicircum ; B 83 325 517 652 ;
+C 95 ; WX 600 ; N underscore ; B -12 -125 612 -75 ;
+C 96 ; WX 600 ; N quoteleft ; B 249 348 453 602 ;
+C 97 ; WX 600 ; N a ; B 42 -16 571 450 ;
+C 98 ; WX 600 ; N b ; B -8 -14 571 624 ;
+C 99 ; WX 600 ; N c ; B 54 -16 565 450 ;
+C 100 ; WX 600 ; N d ; B 33 -14 613 624 ;
+C 101 ; WX 600 ; N e ; B 33 -16 550 450 ;
+C 102 ; WX 600 ; N f ; B 75 0 571 623 ;
+C 103 ; WX 600 ; N g ; B 33 -205 592 451 ;
+C 104 ; WX 600 ; N h ; B 13 0 581 624 ;
+C 105 ; WX 600 ; N i ; B 62 0 538 623 ;
+C 106 ; WX 600 ; N j ; B 117 -205 488 623 ;
+C 107 ; WX 600 ; N k ; B 33 0 571 624 ;
+C 108 ; WX 600 ; N l ; B 62 0 538 624 ;
+C 109 ; WX 600 ; N m ; B -19 0 623 450 ;
+C 110 ; WX 600 ; N n ; B 23 0 571 450 ;
+C 111 ; WX 600 ; N o ; B 42 -16 558 450 ;
+C 112 ; WX 600 ; N p ; B -8 -205 571 450 ;
+C 113 ; WX 600 ; N q ; B 33 -205 613 450 ;
+C 114 ; WX 600 ; N r ; B 54 0 571 449 ;
+C 115 ; WX 600 ; N s ; B 73 -16 527 450 ;
+C 116 ; WX 600 ; N t ; B 13 -16 529 591 ;
+C 117 ; WX 600 ; N u ; B 13 -13 571 437 ;
+C 118 ; WX 600 ; N v ; B 0 0 600 437 ;
+C 119 ; WX 600 ; N w ; B 0 0 600 437 ;
+C 120 ; WX 600 ; N x ; B 21 0 579 437 ;
+C 121 ; WX 600 ; N y ; B 21 -205 579 437 ;
+C 122 ; WX 600 ; N z ; B 85 0 519 437 ;
+C 123 ; WX 600 ; N braceleft ; B 167 -153 433 623 ;
+C 124 ; WX 600 ; N bar ; B 250 -153 350 622 ;
+C 125 ; WX 600 ; N braceright ; B 167 -153 433 623 ;
+C 126 ; WX 600 ; N asciitilde ; B 62 179 538 385 ;
+C 161 ; WX 600 ; N exclamdown ; B 220 -227 381 426 ;
+C 162 ; WX 600 ; N cent ; B 83 -44 499 661 ;
+C 163 ; WX 600 ; N sterling ; B 33 0 550 598 ;
+C 164 ; WX 600 ; N fraction ; B 21 102 580 500 ;
+C 165 ; WX 600 ; N yen ; B 21 0 579 580 ;
+C 166 ; WX 600 ; N florin ; B 57 -123 548 638 ;
+C 167 ; WX 600 ; N section ; B 36 -170 564 583 ;
+C 168 ; WX 600 ; N currency ; B 73 64 527 519 ;
+C 169 ; WX 600 ; N quotesingle ; B 236 312 364 602 ;
+C 170 ; WX 600 ; N quotedblleft ; B 98 348 502 602 ;
+C 171 ; WX 600 ; N guillemotleft ; B 33 20 571 415 ;
+C 172 ; WX 600 ; N guilsinglleft ; B 33 20 342 415 ;
+C 173 ; WX 600 ; N guilsinglright ; B 263 20 571 415 ;
+C 174 ; WX 600 ; N fi ; B -14 0 619 624 ;
+C 175 ; WX 600 ; N fl ; B -17 0 617 623 ;
+C 177 ; WX 600 ; N endash ; B 42 229 558 329 ;
+C 178 ; WX 600 ; N dagger ; B 94 -92 506 622 ;
+C 179 ; WX 600 ; N daggerdbl ; B 94 -92 506 622 ;
+C 180 ; WX 600 ; N periodcentered ; B 225 214 375 346 ;
+C 182 ; WX 600 ; N paragraph ; B 49 -174 558 583 ;
+C 183 ; WX 600 ; N bullet ; B 150 154 449 453 ;
+C 184 ; WX 600 ; N quotesinglbase ; B 147 -158 351 134 ;
+C 185 ; WX 600 ; N quotedblbase ; B 87 -120 491 134 ;
+C 186 ; WX 600 ; N quotedblright ; B 87 348 491 602 ;
+C 187 ; WX 600 ; N guillemotright ; B 33 20 571 415 ;
+C 188 ; WX 600 ; N ellipsis ; B 25 -15 575 117 ;
+C 189 ; WX 600 ; N perthousand ; B 0 0 600 618 ;
+C 191 ; WX 600 ; N questiondown ; B 83 -227 496 386 ;
+C 193 ; WX 600 ; N grave ; B 125 496 350 696 ;
+C 194 ; WX 600 ; N acute ; B 250 496 475 696 ;
+C 195 ; WX 600 ; N circumflex ; B 125 497 476 696 ;
+C 196 ; WX 600 ; N tilde ; B 115 523 485 656 ;
+C 197 ; WX 600 ; N macron ; B 125 546 475 626 ;
+C 198 ; WX 600 ; N breve ; B 125 503 475 687 ;
+C 199 ; WX 600 ; N dotaccent ; B 240 534 360 654 ;
+C 200 ; WX 600 ; N dieresis ; B 136 534 464 654 ;
+C 202 ; WX 600 ; N ring ; B 177 486 423 727 ;
+C 203 ; WX 600 ; N cedilla ; B 180 -229 407 0 ;
+C 205 ; WX 600 ; N hungarumlaut ; B 125 496 475 694 ;
+C 206 ; WX 600 ; N ogonek ; B 250 -208 463 0 ;
+C 207 ; WX 600 ; N caron ; B 125 497 476 696 ;
+C 208 ; WX 600 ; N emdash ; B -29 229 629 329 ;
+C 225 ; WX 600 ; N AE ; B -20 0 614 583 ;
+C 227 ; WX 600 ; N ordfeminine ; B 118 182 489 595 ;
+C 232 ; WX 600 ; N Lslash ; B 12 0 571 583 ;
+C 233 ; WX 600 ; N Oslash ; B 9 -70 590 638 ;
+C 234 ; WX 600 ; N OE ; B -20 0 612 583 ;
+C 235 ; WX 600 ; N ordmasculine ; B 122 182 480 595 ;
+C 241 ; WX 600 ; N ae ; B -13 -16 612 450 ;
+C 245 ; WX 600 ; N dotlessi ; B 62 0 538 437 ;
+C 248 ; WX 600 ; N lslash ; B 62 0 538 624 ;
+C 249 ; WX 600 ; N oslash ; B 23 -70 573 494 ;
+C 250 ; WX 600 ; N oe ; B -11 -16 613 450 ;
+C 251 ; WX 600 ; N germandbls ; B 13 -16 529 623 ;
+C -1 ; WX 600 ; N Udieresis ; B 10 -14 590 798 ;
+C -1 ; WX 600 ; N Uacute ; B 10 -14 590 839 ;
+C -1 ; WX 600 ; N Scedilla ; B 62 -229 538 597 ;
+C -1 ; WX 600 ; N Tcaron ; B 42 0 558 839 ;
+C -1 ; WX 600 ; N Scaron ; B 62 -14 538 839 ;
+C -1 ; WX 600 ; N Rcaron ; B 13 0 619 839 ;
+C -1 ; WX 600 ; N Racute ; B 13 0 619 839 ;
+C -1 ; WX 600 ; N Sacute ; B 62 -14 538 839 ;
+C -1 ; WX 600 ; N Otilde ; B 21 -14 579 799 ;
+C -1 ; WX 600 ; N ucircumflex ; B 13 -13 571 696 ;
+C -1 ; WX 600 ; N Ohungarumlaut ; B 21 -14 579 838 ;
+C -1 ; WX 600 ; N Uhungarumlaut ; B 10 -14 590 838 ;
+C -1 ; WX 600 ; N Yacute ; B 21 0 579 839 ;
+C -1 ; WX 600 ; N Eth ; B 0 0 550 583 ;
+C -1 ; WX 600 ; N Dcroat ; B 0 0 550 583 ;
+C -1 ; WX 600 ; N Zacute ; B 73 0 527 839 ;
+C -1 ; WX 600 ; N Uring ; B 10 -14 590 871 ;
+C -1 ; WX 600 ; N gbreve ; B 33 -205 592 687 ;
+C -1 ; WX 600 ; N eogonek ; B 33 -208 550 450 ;
+C -1 ; WX 600 ; N edotaccent ; B 33 -16 550 654 ;
+C -1 ; WX 600 ; N ecaron ; B 33 -16 550 696 ;
+C -1 ; WX 600 ; N Ugrave ; B 10 -14 590 839 ;
+C -1 ; WX 600 ; N Thorn ; B 14 0 523 583 ;
+C -1 ; WX 600 ; N eacute ; B 33 -16 550 696 ;
+C -1 ; WX 600 ; N edieresis ; B 33 -16 550 654 ;
+C -1 ; WX 600 ; N dcaron ; B 33 -14 681 637 ;
+C -1 ; WX 600 ; N ccedilla ; B 54 -229 565 450 ;
+C -1 ; WX 600 ; N ccaron ; B 54 -16 565 696 ;
+C -1 ; WX 600 ; N cacute ; B 54 -16 565 696 ;
+C -1 ; WX 600 ; N aogonek ; B 42 -208 580 450 ;
+C -1 ; WX 600 ; N aring ; B 42 -16 571 727 ;
+C -1 ; WX 600 ; N atilde ; B 42 -16 571 656 ;
+C -1 ; WX 600 ; N abreve ; B 42 -16 571 687 ;
+C -1 ; WX 600 ; N egrave ; B 33 -16 550 696 ;
+C -1 ; WX 600 ; N agrave ; B 42 -16 571 696 ;
+C -1 ; WX 600 ; N aacute ; B 42 -16 571 696 ;
+C -1 ; WX 600 ; N adieresis ; B 42 -16 571 654 ;
+C -1 ; WX 600 ; N Uogonek ; B 10 -208 590 583 ;
+C -1 ; WX 600 ; N ugrave ; B 13 -13 571 696 ;
+C -1 ; WX 600 ; N uacute ; B 13 -13 571 696 ;
+C -1 ; WX 600 ; N udieresis ; B 13 -13 571 654 ;
+C -1 ; WX 600 ; N tcaron ; B 13 -16 530 637 ;
+C -1 ; WX 600 ; N scommaaccent ; B 73 -278 527 450 ;
+C -1 ; WX 600 ; N Zcaron ; B 73 0 527 839 ;
+C -1 ; WX 600 ; N ecircumflex ; B 33 -16 550 696 ;
+C -1 ; WX 600 ; N Ucircumflex ; B 10 -14 590 839 ;
+C -1 ; WX 600 ; N acircumflex ; B 42 -16 571 696 ;
+C -1 ; WX 600 ; N Zdotaccent ; B 73 0 527 798 ;
+C -1 ; WX 600 ; N scaron ; B 73 -16 527 696 ;
+C -1 ; WX 600 ; N Amacron ; B -21 0 621 769 ;
+C -1 ; WX 600 ; N sacute ; B 73 -16 527 696 ;
+C -1 ; WX 600 ; N Tcommaaccent ; B 42 -278 558 583 ;
+C -1 ; WX 600 ; N Ydieresis ; B 21 0 579 798 ;
+C -1 ; WX 600 ; N thorn ; B -8 -205 571 624 ;
+C -1 ; WX 600 ; N Emacron ; B 13 0 550 769 ;
+C -1 ; WX 600 ; N Ograve ; B 21 -14 579 839 ;
+C -1 ; WX 600 ; N Oacute ; B 21 -14 579 839 ;
+C -1 ; WX 600 ; N Odieresis ; B 21 -14 579 798 ;
+C -1 ; WX 600 ; N Ntilde ; B -8 0 592 799 ;
+C -1 ; WX 600 ; N Ncaron ; B -8 0 592 839 ;
+C -1 ; WX 600 ; N Nacute ; B -8 0 592 839 ;
+C -1 ; WX 600 ; N Lcaron ; B 33 0 571 598 ;
+C -1 ; WX 600 ; N Lacute ; B 33 0 571 839 ;
+C -1 ; WX 600 ; N Idotaccent ; B 83 0 517 798 ;
+C -1 ; WX 600 ; N racute ; B 54 0 571 696 ;
+C -1 ; WX 600 ; N Icircumflex ; B 83 0 517 839 ;
+C -1 ; WX 600 ; N ohungarumlaut ; B 42 -16 558 694 ;
+C -1 ; WX 600 ; N otilde ; B 42 -16 558 656 ;
+C -1 ; WX 600 ; N Euro ; B 4 -14 538 597 ;
+C -1 ; WX 600 ; N ocircumflex ; B 42 -16 558 696 ;
+C -1 ; WX 600 ; N onesuperior ; B 166 247 434 638 ;
+C -1 ; WX 600 ; N twosuperior ; B 149 247 429 637 ;
+C -1 ; WX 600 ; N threesuperior ; B 157 238 442 637 ;
+C -1 ; WX 600 ; N Igrave ; B 83 0 517 839 ;
+C -1 ; WX 600 ; N Iacute ; B 83 0 517 839 ;
+C -1 ; WX 600 ; N Imacron ; B 83 0 517 769 ;
+C -1 ; WX 600 ; N Iogonek ; B 83 -208 517 583 ;
+C -1 ; WX 600 ; N Idieresis ; B 83 0 517 798 ;
+C -1 ; WX 600 ; N Gbreve ; B 33 -14 592 831 ;
+C -1 ; WX 600 ; N Umacron ; B 10 -14 590 769 ;
+C -1 ; WX 600 ; N Kcommaaccent ; B 13 -278 602 583 ;
+C -1 ; WX 600 ; N ograve ; B 42 -16 558 696 ;
+C -1 ; WX 600 ; N Scommaaccent ; B 62 -278 538 597 ;
+C -1 ; WX 600 ; N Eogonek ; B 13 -208 587 583 ;
+C -1 ; WX 600 ; N oacute ; B 42 -16 558 696 ;
+C -1 ; WX 600 ; N Edotaccent ; B 13 0 550 798 ;
+C -1 ; WX 600 ; N iogonek ; B 62 -208 540 623 ;
+C -1 ; WX 600 ; N gcommaaccent ; B 33 -205 592 721 ;
+C -1 ; WX 600 ; N odieresis ; B 42 -16 558 654 ;
+C -1 ; WX 600 ; N ntilde ; B 23 0 571 656 ;
+C -1 ; WX 600 ; N ncaron ; B 23 0 571 696 ;
+C -1 ; WX 600 ; N Ecaron ; B 13 0 550 839 ;
+C -1 ; WX 600 ; N Ecircumflex ; B 13 0 550 839 ;
+C -1 ; WX 600 ; N scedilla ; B 73 -229 527 450 ;
+C -1 ; WX 600 ; N rcaron ; B 54 0 571 696 ;
+C -1 ; WX 600 ; N Egrave ; B 13 0 550 839 ;
+C -1 ; WX 600 ; N Eacute ; B 13 0 550 839 ;
+C -1 ; WX 600 ; N Gcommaaccent ; B 33 -278 592 597 ;
+C -1 ; WX 600 ; N Rcommaaccent ; B 13 -278 619 583 ;
+C -1 ; WX 600 ; N Edieresis ; B 13 0 550 798 ;
+C -1 ; WX 600 ; N nacute ; B 23 0 571 696 ;
+C -1 ; WX 600 ; N uogonek ; B 13 -208 571 437 ;
+C -1 ; WX 600 ; N umacron ; B 13 -13 571 626 ;
+C -1 ; WX 600 ; N Dcaron ; B 13 0 550 839 ;
+C -1 ; WX 600 ; N lcaron ; B 62 0 538 637 ;
+C -1 ; WX 600 ; N Ccaron ; B 33 -14 564 839 ;
+C -1 ; WX 600 ; N Cacute ; B 33 -14 564 839 ;
+C -1 ; WX 600 ; N Ccedilla ; B 33 -229 564 597 ;
+C -1 ; WX 600 ; N degree ; B 125 243 475 596 ;
+C -1 ; WX 600 ; N Aogonek ; B -21 -208 621 583 ;
+C -1 ; WX 600 ; N minus ; B 42 230 558 330 ;
+C -1 ; WX 600 ; N multiply ; B 100 80 500 480 ;
+C -1 ; WX 600 ; N divide ; B 42 28 558 532 ;
+C -1 ; WX 600 ; N Aring ; B -21 0 621 871 ;
+C -1 ; WX 600 ; N trademark ; B -33 220 620 583 ;
+C -1 ; WX 600 ; N rcommaaccent ; B 54 -278 571 449 ;
+C -1 ; WX 600 ; N lacute ; B 62 0 538 840 ;
+C -1 ; WX 600 ; N omacron ; B 42 -16 558 626 ;
+C -1 ; WX 600 ; N Atilde ; B -21 0 621 799 ;
+C -1 ; WX 600 ; N icircumflex ; B 62 0 538 696 ;
+C -1 ; WX 600 ; N igrave ; B 62 0 538 696 ;
+C -1 ; WX 600 ; N ncommaaccent ; B 23 -278 571 450 ;
+C -1 ; WX 600 ; N lcommaaccent ; B 62 -278 538 624 ;
+C -1 ; WX 600 ; N plusminus ; B 42 0 558 624 ;
+C -1 ; WX 600 ; N onehalf ; B -34 0 629 638 ;
+C -1 ; WX 600 ; N onequarter ; B -34 0 629 638 ;
+C -1 ; WX 600 ; N threequarters ; B -43 0 630 637 ;
+C -1 ; WX 600 ; N iacute ; B 62 0 538 696 ;
+C -1 ; WX 600 ; N Abreve ; B -21 0 621 831 ;
+C -1 ; WX 600 ; N kcommaaccent ; B 33 -278 571 624 ;
+C -1 ; WX 600 ; N Omacron ; B 21 -14 579 769 ;
+C -1 ; WX 600 ; N imacron ; B 62 0 538 626 ;
+C -1 ; WX 600 ; N emacron ; B 33 -16 550 626 ;
+C -1 ; WX 600 ; N amacron ; B 42 -16 571 626 ;
+C -1 ; WX 600 ; N tcommaaccent ; B 13 -278 529 591 ;
+C -1 ; WX 600 ; N ydieresis ; B 21 -205 579 654 ;
+C -1 ; WX 600 ; N zdotaccent ; B 85 0 519 654 ;
+C -1 ; WX 600 ; N zcaron ; B 85 0 519 696 ;
+C -1 ; WX 600 ; N zacute ; B 85 0 519 696 ;
+C -1 ; WX 600 ; N yacute ; B 21 -205 579 696 ;
+C -1 ; WX 600 ; N uhungarumlaut ; B 13 -13 571 694 ;
+C -1 ; WX 600 ; N eth ; B 42 -16 558 646 ;
+C -1 ; WX 600 ; N uring ; B 13 -13 571 727 ;
+C -1 ; WX 600 ; N Ocircumflex ; B 21 -14 579 839 ;
+C -1 ; WX 600 ; N commaaccent ; B 183 -278 351 -59 ;
+C -1 ; WX 600 ; N copyright ; B -7 -15 606 598 ;
+C -1 ; WX 600 ; N registered ; B -7 -15 606 598 ;
+C -1 ; WX 600 ; N Acircumflex ; B -21 0 621 839 ;
+C -1 ; WX 600 ; N idieresis ; B 62 0 538 654 ;
+C -1 ; WX 600 ; N lozenge ; B 72 -19 529 593 ;
+C -1 ; WX 600 ; N Delta ; B 15 0 585 583 ;
+C -1 ; WX 600 ; N notequal ; B 42 22 558 525 ;
+C -1 ; WX 600 ; N radical ; B 12 -60 642 697 ;
+C -1 ; WX 600 ; N Agrave ; B -21 0 621 839 ;
+C -1 ; WX 600 ; N Aacute ; B -21 0 621 839 ;
+C -1 ; WX 600 ; N lessequal ; B 3 0 549 591 ;
+C -1 ; WX 600 ; N greaterequal ; B 35 0 582 591 ;
+C -1 ; WX 600 ; N logicalnot ; B 42 115 465 445 ;
+C -1 ; WX 600 ; N summation ; B 45 -97 538 671 ;
+C -1 ; WX 600 ; N partialdiff ; B 102 -16 524 590 ;
+C -1 ; WX 600 ; N Ncommaaccent ; B -8 -278 592 583 ;
+C -1 ; WX 600 ; N dcroat ; B 33 -16 613 624 ;
+C -1 ; WX 600 ; N brokenbar ; B 250 -153 350 622 ;
+C -1 ; WX 600 ; N Lcommaaccent ; B 33 -278 571 583 ;
+C -1 ; WX 600 ; N Adieresis ; B -21 0 621 798 ;
+C -1 ; WX 600 ; N mu ; B 13 -153 571 437 ;
+C -1 ; WX 600 ; N .notdef ; B 375 0 375 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 998
+KPX A C -14
+KPX A Ccedilla -22
+KPX A G -10
+KPX A O -15
+KPX A Odieresis -15
+KPX A Q -16
+KPX A T -27
+KPX A U -23
+KPX A Uacute -23
+KPX A Ucircumflex -23
+KPX A Udieresis -23
+KPX A Ugrave -23
+KPX A V -59
+KPX A W -13
+KPX A Y -27
+KPX A a 15
+KPX A b 45
+KPX A c -4
+KPX A ccedilla -8
+KPX A comma -47
+KPX A d 4
+KPX A e 2
+KPX A g 0
+KPX A guillemotleft -40
+KPX A guilsinglleft -40
+KPX A hyphen -19
+KPX A o -3
+KPX A period -62
+KPX A q -4
+KPX A quotedblright -84
+KPX A quoteright -113
+KPX A t -20
+KPX A u -12
+KPX A v -39
+KPX A w -13
+KPX A y -39
+KPX Aacute C -14
+KPX Aacute G -10
+KPX Aacute O -15
+KPX Aacute Q -16
+KPX Aacute T -27
+KPX Aacute U -23
+KPX Aacute V -59
+KPX Aacute W -13
+KPX Aacute Y -27
+KPX Aacute a 15
+KPX Aacute b 45
+KPX Aacute c -4
+KPX Aacute comma -47
+KPX Aacute d 4
+KPX Aacute e 2
+KPX Aacute g 0
+KPX Aacute guillemotleft -40
+KPX Aacute guilsinglleft -40
+KPX Aacute hyphen -19
+KPX Aacute o -3
+KPX Aacute period -62
+KPX Aacute q -4
+KPX Aacute quoteright -113
+KPX Aacute t -20
+KPX Aacute u -12
+KPX Aacute v -39
+KPX Aacute w -13
+KPX Aacute y -39
+KPX Acircumflex C -14
+KPX Acircumflex G -10
+KPX Acircumflex O -15
+KPX Acircumflex Q -16
+KPX Acircumflex T -27
+KPX Acircumflex U -23
+KPX Acircumflex V -59
+KPX Acircumflex W -13
+KPX Acircumflex Y -27
+KPX Acircumflex comma -47
+KPX Acircumflex period -62
+KPX Adieresis C -14
+KPX Adieresis G -10
+KPX Adieresis O -15
+KPX Adieresis Q -16
+KPX Adieresis T -27
+KPX Adieresis U -23
+KPX Adieresis V -59
+KPX Adieresis W -13
+KPX Adieresis Y -27
+KPX Adieresis a 15
+KPX Adieresis b 45
+KPX Adieresis c -4
+KPX Adieresis comma -47
+KPX Adieresis d 4
+KPX Adieresis g 0
+KPX Adieresis guillemotleft -40
+KPX Adieresis guilsinglleft -40
+KPX Adieresis hyphen -19
+KPX Adieresis o -3
+KPX Adieresis period -62
+KPX Adieresis q -4
+KPX Adieresis quotedblright -84
+KPX Adieresis quoteright -113
+KPX Adieresis t -20
+KPX Adieresis u -12
+KPX Adieresis v -39
+KPX Adieresis w -13
+KPX Adieresis y -39
+KPX Agrave C -14
+KPX Agrave G -10
+KPX Agrave O -15
+KPX Agrave Q -16
+KPX Agrave T -27
+KPX Agrave U -23
+KPX Agrave V -59
+KPX Agrave W -13
+KPX Agrave Y -27
+KPX Agrave comma -47
+KPX Agrave period -62
+KPX Aring C -14
+KPX Aring G -10
+KPX Aring O -15
+KPX Aring Q -16
+KPX Aring T -27
+KPX Aring U -23
+KPX Aring V -59
+KPX Aring W -13
+KPX Aring Y -27
+KPX Aring a 15
+KPX Aring b 45
+KPX Aring c -4
+KPX Aring comma -47
+KPX Aring d 4
+KPX Aring e 2
+KPX Aring g 0
+KPX Aring guillemotleft -40
+KPX Aring guilsinglleft -40
+KPX Aring hyphen -19
+KPX Aring o -3
+KPX Aring period -62
+KPX Aring q -4
+KPX Aring quotedblright -84
+KPX Aring quoteright -113
+KPX Aring t -20
+KPX Aring u -12
+KPX Aring v -39
+KPX Aring w -13
+KPX Aring y -39
+KPX Atilde C -14
+KPX Atilde G -10
+KPX Atilde O -15
+KPX Atilde Q -16
+KPX Atilde T -27
+KPX Atilde U -23
+KPX Atilde V -59
+KPX Atilde W -13
+KPX Atilde Y -27
+KPX Atilde comma -47
+KPX Atilde period -62
+KPX B A 4
+KPX B AE 3
+KPX B Aacute 4
+KPX B Acircumflex 4
+KPX B Adieresis 4
+KPX B Aring 4
+KPX B Atilde 4
+KPX B O -9
+KPX B OE 11
+KPX B Oacute -9
+KPX B Ocircumflex -9
+KPX B Odieresis -9
+KPX B Ograve -9
+KPX B Oslash -5
+KPX B V -18
+KPX B W -6
+KPX B Y -39
+KPX C A 8
+KPX C AE 7
+KPX C Aacute 8
+KPX C Adieresis 8
+KPX C Aring 8
+KPX C H -13
+KPX C K -8
+KPX C O -14
+KPX C Oacute -14
+KPX C Odieresis -14
+KPX Ccedilla A 3
+KPX D A -25
+KPX D Aacute -25
+KPX D Acircumflex -25
+KPX D Adieresis -25
+KPX D Agrave -25
+KPX D Aring -25
+KPX D Atilde -25
+KPX D J -32
+KPX D T -27
+KPX D V -30
+KPX D W -13
+KPX D X -37
+KPX D Y -51
+KPX F A -39
+KPX F Aacute -39
+KPX F Acircumflex -39
+KPX F Adieresis -39
+KPX F Agrave -39
+KPX F Aring -39
+KPX F Atilde -39
+KPX F J -78
+KPX F O -24
+KPX F Odieresis -24
+KPX F a -40
+KPX F aacute -40
+KPX F adieresis -40
+KPX F ae -18
+KPX F aring -40
+KPX F comma -168
+KPX F e -47
+KPX F eacute -47
+KPX F hyphen -55
+KPX F i -46
+KPX F j -54
+KPX F o -51
+KPX F oacute -51
+KPX F odieresis -51
+KPX F oe -16
+KPX F oslash -51
+KPX F period -187
+KPX F r -32
+KPX F u -1
+KPX G A 6
+KPX G AE 5
+KPX G Aacute 6
+KPX G Acircumflex 6
+KPX G Adieresis 6
+KPX G Agrave 6
+KPX G Aring 6
+KPX G Atilde 6
+KPX G T -25
+KPX G V 6
+KPX G W 6
+KPX G Y -14
+KPX J A -8
+KPX J AE -16
+KPX J Adieresis -8
+KPX J Aring -8
+KPX K C -24
+KPX K G -19
+KPX K O -25
+KPX K OE -4
+KPX K Oacute -25
+KPX K Odieresis -25
+KPX K S -9
+KPX K T -13
+KPX K a 6
+KPX K adieresis 6
+KPX K ae 31
+KPX K aring 6
+KPX K e -6
+KPX K hyphen -44
+KPX K o -12
+KPX K oacute -12
+KPX K odieresis -12
+KPX K u -22
+KPX K udieresis -22
+KPX K y -50
+KPX L A 16
+KPX L AE 16
+KPX L Aacute 16
+KPX L Adieresis 16
+KPX L Aring 16
+KPX L C -10
+KPX L Ccedilla -11
+KPX L G -10
+KPX L O -7
+KPX L Oacute -7
+KPX L Ocircumflex -7
+KPX L Odieresis -7
+KPX L Ograve -7
+KPX L Otilde -7
+KPX L S -24
+KPX L T -52
+KPX L U -29
+KPX L Udieresis -29
+KPX L V -57
+KPX L W -22
+KPX L Y -52
+KPX L hyphen 9
+KPX L quotedblright -72
+KPX L quoteright -99
+KPX L u -10
+KPX L udieresis -11
+KPX L y -33
+KPX N A -3
+KPX N AE -3
+KPX N Aacute -3
+KPX N Adieresis -3
+KPX N Aring -3
+KPX N C -7
+KPX N Ccedilla -6
+KPX N G -6
+KPX N O -5
+KPX N Oacute -5
+KPX N Odieresis -5
+KPX N a -11
+KPX N aacute -11
+KPX N adieresis -11
+KPX N ae 18
+KPX N aring -11
+KPX N comma -75
+KPX N e -3
+KPX N eacute -3
+KPX N o -8
+KPX N oacute -8
+KPX N odieresis -8
+KPX N oslash -3
+KPX N period -93
+KPX N u -8
+KPX N udieresis -8
+KPX O A -14
+KPX O AE -14
+KPX O Aacute -14
+KPX O Adieresis -14
+KPX O Aring -14
+KPX O T -15
+KPX O V -23
+KPX O W -2
+KPX O X -26
+KPX O Y -43
+KPX Oacute A -14
+KPX Oacute T -15
+KPX Oacute V -23
+KPX Oacute W -2
+KPX Oacute Y -43
+KPX Ocircumflex T -15
+KPX Ocircumflex V -23
+KPX Ocircumflex Y -43
+KPX Odieresis A -14
+KPX Odieresis T -15
+KPX Odieresis V -23
+KPX Odieresis W -2
+KPX Odieresis X -26
+KPX Odieresis Y -43
+KPX Ograve T -15
+KPX Ograve V -23
+KPX Ograve Y -43
+KPX Oslash A -10
+KPX Otilde T -15
+KPX Otilde V -23
+KPX Otilde Y -43
+KPX P A -61
+KPX P AE -59
+KPX P Aacute -61
+KPX P Adieresis -61
+KPX P Aring -61
+KPX P J -73
+KPX P a -49
+KPX P aacute -49
+KPX P adieresis -49
+KPX P ae -27
+KPX P aring -49
+KPX P comma -160
+KPX P e -38
+KPX P eacute -38
+KPX P hyphen -33
+KPX P o -42
+KPX P oacute -42
+KPX P odieresis -42
+KPX P oe -13
+KPX P oslash -42
+KPX P period -178
+KPX R C -14
+KPX R Ccedilla -17
+KPX R G -10
+KPX R O -14
+KPX R OE 5
+KPX R Oacute -14
+KPX R Odieresis -14
+KPX R T -28
+KPX R U -16
+KPX R Udieresis -17
+KPX R V -24
+KPX R W -8
+KPX R Y -28
+KPX R a 14
+KPX R aacute 14
+KPX R adieresis 14
+KPX R ae 40
+KPX R aring 14
+KPX R e 2
+KPX R eacute 2
+KPX R hyphen -25
+KPX R o -3
+KPX R oacute -3
+KPX R odieresis -3
+KPX R oe 29
+KPX R u -7
+KPX R uacute -8
+KPX R udieresis -8
+KPX R y -18
+KPX S A -10
+KPX S AE -10
+KPX S Aacute -10
+KPX S Adieresis -10
+KPX S Aring -10
+KPX S T -41
+KPX S V -10
+KPX S W -12
+KPX S Y -31
+KPX S t -17
+KPX T A -28
+KPX T AE -28
+KPX T Aacute -28
+KPX T Acircumflex -28
+KPX T Adieresis -28
+KPX T Agrave -28
+KPX T Aring -28
+KPX T Atilde -28
+KPX T C -19
+KPX T G -19
+KPX T J -65
+KPX T O -14
+KPX T OE 6
+KPX T Oacute -14
+KPX T Ocircumflex -14
+KPX T Odieresis -14
+KPX T Ograve -14
+KPX T Oslash -14
+KPX T Otilde -14
+KPX T S -41
+KPX T V 10
+KPX T W 4
+KPX T Y -10
+KPX T a -34
+KPX T ae -12
+KPX T c -37
+KPX T colon -112
+KPX T comma -130
+KPX T e -26
+KPX T g -24
+KPX T guillemotleft -73
+KPX T guilsinglleft -73
+KPX T hyphen -91
+KPX T i -42
+KPX T j -49
+KPX T o -31
+KPX T oslash -31
+KPX T period -148
+KPX T r -28
+KPX T s -39
+KPX T semicolon -100
+KPX T u 4
+KPX T v 10
+KPX T w 10
+KPX T y 0
+KPX U A -19
+KPX U AE -18
+KPX U Aacute -19
+KPX U Acircumflex -19
+KPX U Adieresis -19
+KPX U Aring -19
+KPX U Atilde -19
+KPX U comma -95
+KPX U m 16
+KPX U n -8
+KPX U p 0
+KPX U period -114
+KPX U r -34
+KPX Uacute A -19
+KPX Uacute comma -95
+KPX Uacute m 16
+KPX Uacute n -8
+KPX Uacute p 0
+KPX Uacute period -114
+KPX Uacute r -34
+KPX Ucircumflex A -19
+KPX Udieresis A -19
+KPX Udieresis b 27
+KPX Udieresis comma -95
+KPX Udieresis m 16
+KPX Udieresis n -8
+KPX Udieresis p 0
+KPX Udieresis period -114
+KPX Udieresis r -34
+KPX Ugrave A -19
+KPX V A -4
+KPX V AE -12
+KPX V Aacute -4
+KPX V Acircumflex -4
+KPX V Adieresis -4
+KPX V Agrave -4
+KPX V Aring -4
+KPX V Atilde -4
+KPX V C -24
+KPX V G -24
+KPX V O -23
+KPX V Oacute -23
+KPX V Ocircumflex -23
+KPX V Odieresis -23
+KPX V Ograve -23
+KPX V Oslash -23
+KPX V Otilde -23
+KPX V S -27
+KPX V T 10
+KPX V a -54
+KPX V ae -27
+KPX V colon -132
+KPX V comma -146
+KPX V e -47
+KPX V g -46
+KPX V guillemotleft -75
+KPX V guilsinglleft -75
+KPX V hyphen -39
+KPX V i -59
+KPX V o -52
+KPX V oslash -48
+KPX V period -164
+KPX V r -45
+KPX V semicolon -120
+KPX V u -15
+KPX V y -17
+KPX W A -9
+KPX W AE -9
+KPX W Aacute -9
+KPX W Acircumflex -9
+KPX W Adieresis -9
+KPX W Agrave -9
+KPX W Aring -9
+KPX W Atilde -9
+KPX W C -4
+KPX W G -3
+KPX W O -2
+KPX W Oacute -2
+KPX W Ocircumflex -2
+KPX W Odieresis -2
+KPX W Ograve -2
+KPX W Oslash 2
+KPX W Otilde -2
+KPX W S -17
+KPX W T 4
+KPX W a -11
+KPX W ae 17
+KPX W colon -99
+KPX W comma -83
+KPX W e -3
+KPX W g -3
+KPX W guillemotleft -31
+KPX W guilsinglleft -31
+KPX W hyphen 1
+KPX W i -38
+KPX W o -8
+KPX W oslash -4
+KPX W period -101
+KPX W r -25
+KPX W semicolon -82
+KPX W u 1
+KPX W y -2
+KPX X C -28
+KPX X O -26
+KPX X Odieresis -26
+KPX X Q -26
+KPX X a 0
+KPX X e -12
+KPX X hyphen -50
+KPX X o -18
+KPX X u -28
+KPX X y -43
+KPX Y A -25
+KPX Y AE -28
+KPX Y Aacute -25
+KPX Y Acircumflex -25
+KPX Y Adieresis -25
+KPX Y Agrave -25
+KPX Y Aring -25
+KPX Y Atilde -25
+KPX Y C -45
+KPX Y G -45
+KPX Y O -44
+KPX Y Oacute -44
+KPX Y Ocircumflex -44
+KPX Y Odieresis -44
+KPX Y Ograve -44
+KPX Y Oslash -43
+KPX Y Otilde -44
+KPX Y S -48
+KPX Y T -10
+KPX Y a -53
+KPX Y ae -28
+KPX Y colon -150
+KPX Y comma -118
+KPX Y e -59
+KPX Y g -59
+KPX Y guillemotleft -94
+KPX Y guilsinglleft -94
+KPX Y hyphen -81
+KPX Y i -58
+KPX Y o -64
+KPX Y oslash -51
+KPX Y p -30
+KPX Y period -136
+KPX Y semicolon -133
+KPX Y u -43
+KPX Y v -33
+KPX Z v -41
+KPX Z y -52
+KPX a j -81
+KPX a quoteright -78
+KPX a v -21
+KPX a w -12
+KPX a y -31
+KPX aacute v -21
+KPX aacute w -12
+KPX aacute y -31
+KPX adieresis v -21
+KPX adieresis w -12
+KPX adieresis y -31
+KPX ae v 28
+KPX ae w 32
+KPX ae y 18
+KPX agrave v -21
+KPX agrave w -12
+KPX agrave y -31
+KPX aring v -21
+KPX aring w -12
+KPX aring y -31
+KPX b v 0
+KPX b w 4
+KPX b y -10
+KPX c h 11
+KPX c k 6
+KPX comma one -128
+KPX comma quotedblright -137
+KPX comma quoteright -166
+KPX e quoteright -65
+KPX e t -16
+KPX e v -9
+KPX e w -3
+KPX e x 6
+KPX e y -20
+KPX eacute v -9
+KPX eacute w -3
+KPX eacute y -20
+KPX ecircumflex v -9
+KPX ecircumflex w -3
+KPX ecircumflex y -20
+KPX eight four -58
+KPX eight one -72
+KPX eight seven -65
+KPX f a -32
+KPX f aacute -32
+KPX f adieresis -32
+KPX f ae -7
+KPX f aring -32
+KPX f e -43
+KPX f eacute -43
+KPX f f -43
+KPX f i -37
+KPX f j -60
+KPX f l -25
+KPX f o -47
+KPX f oacute -47
+KPX f odieresis -42
+KPX f oe -15
+KPX f oslash -29
+KPX f quoteright -73
+KPX f s -42
+KPX f t -6
+KPX five four -52
+KPX five one -73
+KPX five seven -73
+KPX four four -62
+KPX four one -66
+KPX four seven -93
+KPX g a -4
+KPX g adieresis -4
+KPX g ae 23
+KPX g aring -4
+KPX g e 1
+KPX g eacute 1
+KPX g l -34
+KPX g oacute -3
+KPX g odieresis -3
+KPX g r 0
+KPX guillemotright A -37
+KPX guillemotright AE -34
+KPX guillemotright Aacute -37
+KPX guillemotright Adieresis -37
+KPX guillemotright Aring -37
+KPX guillemotright T -71
+KPX guillemotright V -72
+KPX guillemotright W -29
+KPX guillemotright Y -92
+KPX guilsinglright A -37
+KPX guilsinglright AE -34
+KPX guilsinglright Aacute -37
+KPX guilsinglright Adieresis -37
+KPX guilsinglright Aring -37
+KPX guilsinglright T -71
+KPX guilsinglright V -72
+KPX guilsinglright W -29
+KPX guilsinglright Y -92
+KPX h quoteright -69
+KPX h y -23
+KPX hyphen A -18
+KPX hyphen AE -14
+KPX hyphen Aacute -18
+KPX hyphen Adieresis -18
+KPX hyphen Aring -18
+KPX hyphen T -90
+KPX hyphen V -38
+KPX hyphen W 1
+KPX hyphen Y -81
+KPX i T -58
+KPX i j -143
+KPX k a 1
+KPX k aacute 1
+KPX k adieresis 1
+KPX k ae 26
+KPX k aring 1
+KPX k comma -63
+KPX k e -11
+KPX k eacute -11
+KPX k g -14
+KPX k hyphen -50
+KPX k o -17
+KPX k oacute -17
+KPX k odieresis -17
+KPX k period -75
+KPX k s -9
+KPX k u -3
+KPX k udieresis -3
+KPX l v -77
+KPX l y -77
+KPX m p 32
+KPX m v 18
+KPX m w 22
+KPX m y 8
+KPX n T -40
+KPX n p 4
+KPX n quoteright -68
+KPX n v -12
+KPX n w -5
+KPX n y -22
+KPX nine four -53
+KPX nine one -66
+KPX nine seven -57
+KPX o T -31
+KPX o quoteright -62
+KPX o t -13
+KPX o v -6
+KPX o w -3
+KPX o x -10
+KPX o y -17
+KPX oacute v -6
+KPX oacute w -3
+KPX oacute y -17
+KPX ocircumflex t -13
+KPX odieresis t -13
+KPX odieresis v -6
+KPX odieresis w -3
+KPX odieresis x -10
+KPX odieresis y -17
+KPX ograve v -6
+KPX ograve w -3
+KPX ograve y -17
+KPX one comma -99
+KPX one eight -74
+KPX one five -55
+KPX one four -87
+KPX one nine -73
+KPX one one -62
+KPX one period -114
+KPX one seven -141
+KPX one six -98
+KPX one three -53
+KPX one two -47
+KPX one zero -86
+KPX p t -3
+KPX p y -6
+KPX period one -113
+KPX period quotedblright -131
+KPX period quoteright -161
+KPX q c 2
+KPX q u 41
+KPX quotedblbase A -6
+KPX quotedblbase AE -7
+KPX quotedblbase T -90
+KPX quotedblbase V -104
+KPX quotedblbase W -43
+KPX quotedblbase Y -78
+KPX quotedblleft A -62
+KPX quotedblleft AE -60
+KPX quotedblleft Aacute -62
+KPX quotedblleft Adieresis -62
+KPX quotedblleft Aring -62
+KPX quotedblleft T -24
+KPX quotedblleft V -22
+KPX quotedblleft W -13
+KPX quotedblleft Y -49
+KPX quotedblright A -76
+KPX quotedblright AE -75
+KPX quotedblright Aacute -76
+KPX quotedblright Adieresis -76
+KPX quotedblright Aring -76
+KPX quotedblright T -39
+KPX quotedblright V -30
+KPX quotedblright W -26
+KPX quotedblright Y -51
+KPX quoteleft A -87
+KPX quoteleft AE -85
+KPX quoteleft Aacute -87
+KPX quoteleft Adieresis -87
+KPX quoteleft Aring -87
+KPX quoteleft T -49
+KPX quoteleft V -46
+KPX quoteleft W -38
+KPX quoteleft Y -73
+KPX quoteright A -154
+KPX quoteright AE -153
+KPX quoteright Aacute -154
+KPX quoteright Adieresis -154
+KPX quoteright Aring -154
+KPX quoteright comma -227
+KPX quoteright d -140
+KPX quoteright o -143
+KPX quoteright period -244
+KPX quoteright r -149
+KPX quoteright s -150
+KPX quoteright t -117
+KPX quoteright v -110
+KPX quoteright w -105
+KPX quoteright y -116
+KPX r a -17
+KPX r aacute -17
+KPX r acircumflex -17
+KPX r adieresis -17
+KPX r ae 4
+KPX r agrave -17
+KPX r aring -17
+KPX r c -18
+KPX r ccedilla -15
+KPX r colon -95
+KPX r comma -108
+KPX r d -8
+KPX r e -7
+KPX r eacute -7
+KPX r ecircumflex -7
+KPX r egrave -7
+KPX r f -16
+KPX r g -5
+KPX r h -20
+KPX r hyphen -41
+KPX r i -25
+KPX r j -33
+KPX r k -30
+KPX r l -47
+KPX r m 36
+KPX r n 10
+KPX r o -12
+KPX r oacute -12
+KPX r ocircumflex -12
+KPX r odieresis -12
+KPX r oe 18
+KPX r ograve -12
+KPX r oslash -12
+KPX r p 30
+KPX r period -122
+KPX r q -4
+KPX r quoteright -41
+KPX r r -11
+KPX r s -21
+KPX r semicolon -83
+KPX r t 20
+KPX r u 20
+KPX r v 26
+KPX r w 26
+KPX r x 7
+KPX r y 16
+KPX r z -21
+KPX s quoteright -60
+KPX s t -11
+KPX seven colon -156
+KPX seven comma -157
+KPX seven eight -74
+KPX seven five -82
+KPX seven four -101
+KPX seven one -67
+KPX seven period -176
+KPX seven seven -62
+KPX seven six -93
+KPX seven three -72
+KPX seven two -64
+KPX six four -49
+KPX six one -54
+KPX six seven -46
+KPX t S -35
+KPX t a -16
+KPX t aacute -16
+KPX t adieresis -16
+KPX t ae 9
+KPX t aring -16
+KPX t colon -117
+KPX t e -24
+KPX t eacute -24
+KPX t h -5
+KPX t o -30
+KPX t oacute -30
+KPX t odieresis -30
+KPX t quoteright -102
+KPX t semicolon -103
+KPX three four -52
+KPX three one -71
+KPX three seven -64
+KPX two four -67
+KPX two one -66
+KPX two seven -68
+KPX u quoteright -56
+KPX v a -3
+KPX v aacute -3
+KPX v acircumflex -3
+KPX v adieresis -3
+KPX v ae 18
+KPX v agrave -3
+KPX v aring -3
+KPX v atilde -3
+KPX v c -11
+KPX v colon -81
+KPX v comma -136
+KPX v e 0
+KPX v eacute 0
+KPX v ecircumflex 0
+KPX v egrave 0
+KPX v g 1
+KPX v hyphen -23
+KPX v l -77
+KPX v o -5
+KPX v oacute -5
+KPX v odieresis -5
+KPX v ograve -5
+KPX v oslash -5
+KPX v period -156
+KPX v s -11
+KPX v semicolon -69
+KPX w a -3
+KPX w aacute -3
+KPX w acircumflex -3
+KPX w adieresis -3
+KPX w ae 23
+KPX w agrave -3
+KPX w aring -3
+KPX w atilde -3
+KPX w c -6
+KPX w colon -81
+KPX w comma -90
+KPX w e 2
+KPX w eacute 2
+KPX w ecircumflex 2
+KPX w egrave 2
+KPX w g 3
+KPX w hyphen 3
+KPX w l -48
+KPX w o -2
+KPX w oacute -2
+KPX w odieresis -2
+KPX w ograve -2
+KPX w oslash 2
+KPX w period -109
+KPX w s -11
+KPX w semicolon -69
+KPX x a 5
+KPX x c -14
+KPX x e -5
+KPX x eacute -5
+KPX x o -10
+KPX x q -8
+KPX y a -13
+KPX y aacute -13
+KPX y acircumflex -13
+KPX y adieresis -13
+KPX y ae 8
+KPX y agrave -13
+KPX y aring -13
+KPX y atilde -13
+KPX y c -21
+KPX y colon -91
+KPX y comma -134
+KPX y e -11
+KPX y eacute -11
+KPX y ecircumflex -11
+KPX y egrave -11
+KPX y g -9
+KPX y hyphen -19
+KPX y l -78
+KPX y o -15
+KPX y oacute -15
+KPX y odieresis -15
+KPX y ograve -15
+KPX y oslash -15
+KPX y period -155
+KPX y s -21
+KPX y semicolon -79
+KPX zero four -59
+KPX zero one -76
+KPX zero seven -68
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/pdf2swf/fonts/n022004l.pfb b/pdf2swf/fonts/n022004l.pfb
new file mode 100644
index 00000000..f1da6121
--- /dev/null
+++ b/pdf2swf/fonts/n022004l.pfb
Binary files differ
diff --git a/pdf2swf/fonts/n022023l.afm b/pdf2swf/fonts/n022023l.afm
new file mode 100644
index 00000000..718ec5de
--- /dev/null
+++ b/pdf2swf/fonts/n022023l.afm
@@ -0,0 +1,1341 @@
+StartFontMetrics 3.0
+Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development
+Comment Creation Date: 12/22/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName NimbusMonL-ReguObli
+FullName Nimbus Mono L Regular Oblique
+FamilyName Nimbus Mono L
+Weight Regular
+ItalicAngle -12.0
+IsFixedPitch false
+UnderlinePosition -100
+UnderlineThickness 50
+Version 1.05
+Notice (URW)++,Copyright 1999 by (URW)++ Design & Development
+EncodingScheme AdobeStandardEncoding
+FontBBox -61 -237 774 811
+CapHeight 563
+XHeight 417
+Descender -186
+Ascender 604
+StartCharMetrics 316
+C 32 ; WX 600 ; N space ; B 319 0 319 0 ;
+C 33 ; WX 600 ; N exclam ; B 246 -15 463 618 ;
+C 34 ; WX 600 ; N quotedbl ; B 254 315 582 604 ;
+C 35 ; WX 600 ; N numbersign ; B 137 -62 589 647 ;
+C 36 ; WX 600 ; N dollar ; B 131 -92 582 655 ;
+C 37 ; WX 600 ; N percent ; B 137 -12 591 611 ;
+C 38 ; WX 600 ; N ampersand ; B 132 -16 527 519 ;
+C 39 ; WX 600 ; N quoteright ; B 207 314 468 604 ;
+C 40 ; WX 600 ; N parenleft ; B 335 -124 583 604 ;
+C 41 ; WX 600 ; N parenright ; B 124 -124 372 604 ;
+C 42 ; WX 600 ; N asterisk ; B 211 250 586 604 ;
+C 43 ; WX 600 ; N plus ; B 131 32 588 530 ;
+C 44 ; WX 600 ; N comma ; B 110 -145 371 145 ;
+C 45 ; WX 600 ; N hyphen ; B 131 258 588 299 ;
+C 46 ; WX 600 ; N period ; B 235 -15 386 116 ;
+C 47 ; WX 600 ; N slash ; B 99 -81 625 668 ;
+C 48 ; WX 600 ; N zero ; B 156 -15 571 618 ;
+C 49 ; WX 600 ; N one ; B 117 0 492 612 ;
+C 50 ; WX 600 ; N two ; B 84 0 572 618 ;
+C 51 ; WX 600 ; N three ; B 110 -15 579 618 ;
+C 52 ; WX 600 ; N four ; B 141 0 545 604 ;
+C 53 ; WX 600 ; N five ; B 113 -15 584 604 ;
+C 54 ; WX 600 ; N six ; B 184 -15 631 618 ;
+C 55 ; WX 600 ; N seven ; B 215 -1 606 604 ;
+C 56 ; WX 600 ; N eight ; B 143 -15 576 618 ;
+C 57 ; WX 600 ; N nine ; B 142 -15 589 618 ;
+C 58 ; WX 600 ; N colon ; B 235 -15 450 417 ;
+C 59 ; WX 600 ; N semicolon ; B 114 -145 426 417 ;
+C 60 ; WX 600 ; N less ; B 131 44 627 518 ;
+C 61 ; WX 600 ; N equal ; B 95 190 625 375 ;
+C 62 ; WX 600 ; N greater ; B 92 44 588 518 ;
+C 63 ; WX 600 ; N question ; B 231 -15 581 577 ;
+C 64 ; WX 600 ; N at ; B 139 -62 561 624 ;
+C 65 ; WX 600 ; N A ; B 13 0 596 563 ;
+C 66 ; WX 600 ; N B ; B 47 0 591 563 ;
+C 67 ; WX 600 ; N C ; B 110 -16 635 576 ;
+C 68 ; WX 600 ; N D ; B 47 0 592 563 ;
+C 69 ; WX 600 ; N E ; B 47 0 619 563 ;
+C 70 ; WX 600 ; N F ; B 47 0 640 563 ;
+C 71 ; WX 600 ; N G ; B 108 -16 636 576 ;
+C 72 ; WX 600 ; N H ; B 57 0 646 563 ;
+C 73 ; WX 600 ; N I ; B 117 0 603 563 ;
+C 74 ; WX 600 ; N J ; B 100 -16 699 563 ;
+C 75 ; WX 600 ; N K ; B 47 0 662 563 ;
+C 76 ; WX 600 ; N L ; B 67 0 585 563 ;
+C 77 ; WX 600 ; N M ; B 15 0 700 563 ;
+C 78 ; WX 600 ; N N ; B 46 0 678 563 ;
+C 79 ; WX 600 ; N O ; B 102 -16 616 576 ;
+C 80 ; WX 600 ; N P ; B 47 0 587 563 ;
+C 81 ; WX 600 ; N Q ; B 102 -115 616 576 ;
+C 82 ; WX 600 ; N R ; B 47 0 594 563 ;
+C 83 ; WX 600 ; N S ; B 96 -17 602 577 ;
+C 84 ; WX 600 ; N T ; B 152 0 648 563 ;
+C 85 ; WX 600 ; N U ; B 136 -16 676 563 ;
+C 86 ; WX 600 ; N V ; B 124 0 707 563 ;
+C 87 ; WX 600 ; N W ; B 122 0 696 563 ;
+C 88 ; WX 600 ; N X ; B 44 0 662 563 ;
+C 89 ; WX 600 ; N Y ; B 153 0 665 563 ;
+C 90 ; WX 600 ; N Z ; B 103 0 590 563 ;
+C 91 ; WX 600 ; N bracketleft ; B 254 -124 570 604 ;
+C 92 ; WX 600 ; N backslash ; B 250 -81 474 668 ;
+C 93 ; WX 600 ; N bracketright ; B 132 -124 448 604 ;
+C 94 ; WX 600 ; N asciicircum ; B 192 354 567 615 ;
+C 95 ; WX 600 ; N underscore ; B -61 -125 564 -75 ;
+C 96 ; WX 600 ; N quoteleft ; B 388 343 544 604 ;
+C 97 ; WX 600 ; N a ; B 93 -16 546 431 ;
+C 98 ; WX 600 ; N b ; B 26 -16 591 604 ;
+C 99 ; WX 600 ; N c ; B 121 -17 596 432 ;
+C 100 ; WX 600 ; N d ; B 102 -16 630 604 ;
+C 101 ; WX 600 ; N e ; B 104 -16 570 431 ;
+C 102 ; WX 600 ; N f ; B 109 0 663 604 ;
+C 103 ; WX 600 ; N g ; B 105 -186 647 431 ;
+C 104 ; WX 600 ; N h ; B 55 0 556 604 ;
+C 105 ; WX 600 ; N i ; B 96 0 513 624 ;
+C 106 ; WX 600 ; N j ; B 112 -186 547 624 ;
+C 107 ; WX 600 ; N k ; B 67 0 578 604 ;
+C 108 ; WX 600 ; N l ; B 96 0 513 604 ;
+C 109 ; WX 600 ; N m ; B 15 0 603 431 ;
+C 110 ; WX 600 ; N n ; B 57 0 546 431 ;
+C 111 ; WX 600 ; N o ; B 111 -16 577 431 ;
+C 112 ; WX 600 ; N p ; B -13 -186 593 431 ;
+C 113 ; WX 600 ; N q ; B 105 -186 668 431 ;
+C 114 ; WX 600 ; N r ; B 88 0 619 427 ;
+C 115 ; WX 600 ; N s ; B 108 -17 558 431 ;
+C 116 ; WX 600 ; N t ; B 127 -16 518 563 ;
+C 117 ; WX 600 ; N u ; B 127 -16 569 417 ;
+C 118 ; WX 600 ; N v ; B 114 0 655 417 ;
+C 119 ; WX 600 ; N w ; B 114 0 655 417 ;
+C 120 ; WX 600 ; N x ; B 55 0 611 417 ;
+C 121 ; WX 600 ; N y ; B 22 -186 634 417 ;
+C 122 ; WX 600 ; N z ; B 115 0 563 417 ;
+C 123 ; WX 600 ; N braceleft ; B 248 -124 528 604 ;
+C 124 ; WX 600 ; N bar ; B 257 -124 444 604 ;
+C 125 ; WX 600 ; N braceright ; B 175 -124 455 604 ;
+C 126 ; WX 600 ; N asciitilde ; B 145 212 575 348 ;
+C 161 ; WX 600 ; N exclamdown ; B 222 -216 439 417 ;
+C 162 ; WX 600 ; N cent ; B 175 -13 563 630 ;
+C 163 ; WX 600 ; N sterling ; B 90 0 541 578 ;
+C 164 ; WX 600 ; N fraction ; B 84 138 645 470 ;
+C 165 ; WX 600 ; N yen ; B 161 0 665 563 ;
+C 166 ; WX 600 ; N florin ; B 74 -93 643 618 ;
+C 167 ; WX 600 ; N section ; B 91 -62 624 603 ;
+C 168 ; WX 600 ; N currency ; B 127 95 597 489 ;
+C 169 ; WX 600 ; N quotesingle ; B 344 315 492 604 ;
+C 170 ; WX 600 ; N quotedblleft ; B 221 343 586 604 ;
+C 171 ; WX 600 ; N guillemotleft ; B 108 0 626 417 ;
+C 172 ; WX 600 ; N guilsinglleft ; B 108 0 397 417 ;
+C 173 ; WX 600 ; N guilsinglright ; B 297 0 585 417 ;
+C 174 ; WX 600 ; N fi ; B 14 0 615 624 ;
+C 175 ; WX 600 ; N fl ; B 14 0 611 604 ;
+C 177 ; WX 600 ; N endash ; B 131 261 588 302 ;
+C 178 ; WX 600 ; N dagger ; B 208 -63 561 604 ;
+C 179 ; WX 600 ; N daggerdbl ; B 154 -62 561 604 ;
+C 180 ; WX 600 ; N periodcentered ; B 285 217 436 348 ;
+C 182 ; WX 600 ; N paragraph ; B 152 -62 648 604 ;
+C 183 ; WX 600 ; N bullet ; B 253 141 449 337 ;
+C 184 ; WX 600 ; N quotesinglbase ; B 110 -145 371 145 ;
+C 185 ; WX 600 ; N quotedblbase ; B 73 -116 538 145 ;
+C 186 ; WX 600 ; N quotedblright ; B 170 343 635 604 ;
+C 187 ; WX 600 ; N guillemotright ; B 67 0 585 417 ;
+C 188 ; WX 600 ; N ellipsis ; B 57 -15 557 84 ;
+C 189 ; WX 600 ; N perthousand ; B 91 -9 598 614 ;
+C 191 ; WX 600 ; N questiondown ; B 105 -175 455 417 ;
+C 193 ; WX 600 ; N grave ; B 286 490 429 639 ;
+C 194 ; WX 600 ; N acute ; B 388 490 577 639 ;
+C 195 ; WX 600 ; N circumflex ; B 263 490 554 639 ;
+C 196 ; WX 600 ; N tilde ; B 258 516 579 605 ;
+C 197 ; WX 600 ; N macron ; B 273 536 564 576 ;
+C 198 ; WX 600 ; N breve ; B 280 489 574 621 ;
+C 199 ; WX 600 ; N dotaccent ; B 368 511 470 611 ;
+C 200 ; WX 600 ; N dieresis ; B 258 511 581 611 ;
+C 202 ; WX 600 ; N ring ; B 326 480 516 661 ;
+C 203 ; WX 600 ; N cedilla ; B 181 -173 356 0 ;
+C 205 ; WX 600 ; N hungarumlaut ; B 263 490 576 633 ;
+C 206 ; WX 600 ; N ogonek ; B 258 -155 408 0 ;
+C 207 ; WX 600 ; N caron ; B 286 490 577 639 ;
+C 208 ; WX 600 ; N emdash ; B 60 261 659 302 ;
+C 225 ; WX 600 ; N AE ; B 14 0 690 563 ;
+C 227 ; WX 600 ; N ordfeminine ; B 229 279 511 574 ;
+C 232 ; WX 600 ; N Lslash ; B 66 0 586 563 ;
+C 233 ; WX 600 ; N Oslash ; B 34 -43 685 605 ;
+C 234 ; WX 600 ; N OE ; B 62 0 690 563 ;
+C 235 ; WX 600 ; N ordmasculine ; B 243 284 543 577 ;
+C 241 ; WX 600 ; N ae ; B 36 -16 630 431 ;
+C 245 ; WX 600 ; N dotlessi ; B 96 0 513 417 ;
+C 248 ; WX 600 ; N lslash ; B 96 0 524 604 ;
+C 249 ; WX 600 ; N oslash ; B 47 -43 637 458 ;
+C 250 ; WX 600 ; N oe ; B 50 -16 630 431 ;
+C 251 ; WX 600 ; N germandbls ; B 47 -16 539 604 ;
+C -1 ; WX 600 ; N Udieresis ; B 136 -16 676 762 ;
+C -1 ; WX 600 ; N Uacute ; B 136 -16 676 789 ;
+C -1 ; WX 600 ; N Scedilla ; B 96 -179 602 577 ;
+C -1 ; WX 600 ; N Tcaron ; B 152 0 648 789 ;
+C -1 ; WX 600 ; N Scaron ; B 96 -17 618 789 ;
+C -1 ; WX 600 ; N Rcaron ; B 47 0 594 789 ;
+C -1 ; WX 600 ; N Racute ; B 47 0 594 789 ;
+C -1 ; WX 600 ; N Sacute ; B 96 -17 602 789 ;
+C -1 ; WX 600 ; N Otilde ; B 103 -16 618 755 ;
+C -1 ; WX 600 ; N ucircumflex ; B 127 -16 569 639 ;
+C -1 ; WX 600 ; N Ohungarumlaut ; B 102 -16 672 787 ;
+C -1 ; WX 600 ; N Uhungarumlaut ; B 136 -16 676 787 ;
+C -1 ; WX 600 ; N Yacute ; B 153 0 665 789 ;
+C -1 ; WX 600 ; N Eth ; B 47 0 592 563 ;
+C -1 ; WX 600 ; N Dcroat ; B 47 0 592 563 ;
+C -1 ; WX 600 ; N Zacute ; B 103 0 590 789 ;
+C -1 ; WX 600 ; N Uring ; B 136 -16 676 807 ;
+C -1 ; WX 600 ; N gbreve ; B 105 -186 647 621 ;
+C -1 ; WX 600 ; N eogonek ; B 104 -155 570 431 ;
+C -1 ; WX 600 ; N edotaccent ; B 104 -16 570 611 ;
+C -1 ; WX 600 ; N ecaron ; B 104 -16 577 639 ;
+C -1 ; WX 600 ; N Ugrave ; B 136 -16 676 789 ;
+C -1 ; WX 600 ; N Thorn ; B 47 0 566 563 ;
+C -1 ; WX 600 ; N eacute ; B 104 -16 570 639 ;
+C -1 ; WX 600 ; N edieresis ; B 104 -16 586 611 ;
+C -1 ; WX 600 ; N dcaron ; B 102 -16 774 618 ;
+C -1 ; WX 600 ; N ccedilla ; B 122 -173 596 431 ;
+C -1 ; WX 600 ; N ccaron ; B 121 -17 596 639 ;
+C -1 ; WX 600 ; N cacute ; B 121 -17 596 639 ;
+C -1 ; WX 600 ; N aogonek ; B 93 -155 546 431 ;
+C -1 ; WX 600 ; N aring ; B 93 -16 546 661 ;
+C -1 ; WX 600 ; N atilde ; B 93 -16 570 605 ;
+C -1 ; WX 600 ; N abreve ; B 93 -16 574 621 ;
+C -1 ; WX 600 ; N egrave ; B 104 -16 570 639 ;
+C -1 ; WX 600 ; N agrave ; B 93 -16 546 639 ;
+C -1 ; WX 600 ; N aacute ; B 93 -16 546 639 ;
+C -1 ; WX 600 ; N adieresis ; B 93 -16 571 611 ;
+C -1 ; WX 600 ; N Uogonek ; B 136 -155 676 563 ;
+C -1 ; WX 600 ; N ugrave ; B 127 -16 569 639 ;
+C -1 ; WX 600 ; N uacute ; B 127 -16 569 639 ;
+C -1 ; WX 600 ; N udieresis ; B 127 -16 573 611 ;
+C -1 ; WX 600 ; N tcaron ; B 127 -16 593 618 ;
+C -1 ; WX 600 ; N scommaaccent ; B 108 -237 558 431 ;
+C -1 ; WX 600 ; N Zcaron ; B 103 0 604 789 ;
+C -1 ; WX 600 ; N ecircumflex ; B 104 -16 570 639 ;
+C -1 ; WX 600 ; N Ucircumflex ; B 136 -16 676 789 ;
+C -1 ; WX 600 ; N acircumflex ; B 93 -16 546 639 ;
+C -1 ; WX 600 ; N Zdotaccent ; B 103 0 590 762 ;
+C -1 ; WX 600 ; N scaron ; B 107 -17 584 639 ;
+C -1 ; WX 600 ; N Amacron ; B 13 0 596 723 ;
+C -1 ; WX 600 ; N sacute ; B 108 -17 577 639 ;
+C -1 ; WX 600 ; N Tcommaaccent ; B 152 -237 648 563 ;
+C -1 ; WX 600 ; N Ydieresis ; B 153 0 665 762 ;
+C -1 ; WX 600 ; N thorn ; B -13 -186 593 590 ;
+C -1 ; WX 600 ; N Emacron ; B 47 0 619 723 ;
+C -1 ; WX 600 ; N Ograve ; B 102 -16 616 789 ;
+C -1 ; WX 600 ; N Oacute ; B 102 -16 616 789 ;
+C -1 ; WX 600 ; N Odieresis ; B 102 -16 616 762 ;
+C -1 ; WX 600 ; N Ntilde ; B 46 0 678 755 ;
+C -1 ; WX 600 ; N Ncaron ; B 46 0 678 789 ;
+C -1 ; WX 600 ; N Nacute ; B 46 0 678 789 ;
+C -1 ; WX 600 ; N Lcaron ; B 67 0 638 576 ;
+C -1 ; WX 600 ; N Lacute ; B 67 0 585 789 ;
+C -1 ; WX 600 ; N Idotaccent ; B 117 0 603 762 ;
+C -1 ; WX 600 ; N racute ; B 88 0 619 639 ;
+C -1 ; WX 600 ; N Icircumflex ; B 117 0 603 789 ;
+C -1 ; WX 600 ; N ohungarumlaut ; B 111 -16 616 633 ;
+C -1 ; WX 600 ; N otilde ; B 111 -16 586 605 ;
+C -1 ; WX 600 ; N Euro ; B 60 -16 634 576 ;
+C -1 ; WX 600 ; N ocircumflex ; B 111 -16 577 639 ;
+C -1 ; WX 600 ; N onesuperior ; B 249 259 469 612 ;
+C -1 ; WX 600 ; N twosuperior ; B 230 259 514 612 ;
+C -1 ; WX 600 ; N threesuperior ; B 245 251 516 612 ;
+C -1 ; WX 600 ; N Igrave ; B 117 0 603 789 ;
+C -1 ; WX 600 ; N Iacute ; B 117 0 603 789 ;
+C -1 ; WX 600 ; N Imacron ; B 117 0 603 723 ;
+C -1 ; WX 600 ; N Iogonek ; B 117 -155 603 563 ;
+C -1 ; WX 600 ; N Idieresis ; B 117 0 611 762 ;
+C -1 ; WX 600 ; N Gbreve ; B 108 -16 656 777 ;
+C -1 ; WX 600 ; N Umacron ; B 136 -16 676 723 ;
+C -1 ; WX 600 ; N Kcommaaccent ; B 47 -237 662 563 ;
+C -1 ; WX 600 ; N ograve ; B 111 -16 577 639 ;
+C -1 ; WX 600 ; N Scommaaccent ; B 96 -237 602 577 ;
+C -1 ; WX 600 ; N Eogonek ; B 47 -155 619 563 ;
+C -1 ; WX 600 ; N oacute ; B 111 -16 577 639 ;
+C -1 ; WX 600 ; N Edotaccent ; B 47 0 619 762 ;
+C -1 ; WX 600 ; N iogonek ; B 96 -155 513 624 ;
+C -1 ; WX 600 ; N gcommaaccent ; B 105 -186 647 668 ;
+C -1 ; WX 600 ; N odieresis ; B 111 -16 581 611 ;
+C -1 ; WX 600 ; N ntilde ; B 57 0 570 605 ;
+C -1 ; WX 600 ; N ncaron ; B 57 0 577 639 ;
+C -1 ; WX 600 ; N Ecaron ; B 47 0 619 789 ;
+C -1 ; WX 600 ; N Ecircumflex ; B 47 0 619 789 ;
+C -1 ; WX 600 ; N scedilla ; B 108 -173 558 431 ;
+C -1 ; WX 600 ; N rcaron ; B 88 0 619 639 ;
+C -1 ; WX 600 ; N Egrave ; B 47 0 619 789 ;
+C -1 ; WX 600 ; N Eacute ; B 47 0 619 789 ;
+C -1 ; WX 600 ; N Gcommaaccent ; B 108 -237 636 576 ;
+C -1 ; WX 600 ; N Rcommaaccent ; B 47 -237 594 563 ;
+C -1 ; WX 600 ; N Edieresis ; B 47 0 619 762 ;
+C -1 ; WX 600 ; N nacute ; B 57 0 577 639 ;
+C -1 ; WX 600 ; N uogonek ; B 127 -155 569 417 ;
+C -1 ; WX 600 ; N umacron ; B 127 -16 569 576 ;
+C -1 ; WX 600 ; N Dcaron ; B 47 0 592 789 ;
+C -1 ; WX 600 ; N lcaron ; B 96 0 593 618 ;
+C -1 ; WX 600 ; N Ccaron ; B 110 -16 635 789 ;
+C -1 ; WX 600 ; N Cacute ; B 110 -16 635 789 ;
+C -1 ; WX 600 ; N Ccedilla ; B 110 -173 635 576 ;
+C -1 ; WX 600 ; N degree ; B 257 346 553 636 ;
+C -1 ; WX 600 ; N Aogonek ; B 13 -155 596 563 ;
+C -1 ; WX 600 ; N minus ; B 131 261 588 302 ;
+C -1 ; WX 600 ; N multiply ; B 143 100 577 464 ;
+C -1 ; WX 600 ; N divide ; B 131 25 588 540 ;
+C -1 ; WX 600 ; N Aring ; B 13 0 596 811 ;
+C -1 ; WX 600 ; N trademark ; B 90 243 710 563 ;
+C -1 ; WX 600 ; N rcommaaccent ; B 88 -237 619 427 ;
+C -1 ; WX 600 ; N lacute ; B 96 0 572 789 ;
+C -1 ; WX 600 ; N omacron ; B 111 -16 577 576 ;
+C -1 ; WX 600 ; N Atilde ; B 13 0 596 755 ;
+C -1 ; WX 600 ; N icircumflex ; B 95 0 536 639 ;
+C -1 ; WX 600 ; N igrave ; B 96 0 513 639 ;
+C -1 ; WX 600 ; N ncommaaccent ; B 57 -237 546 431 ;
+C -1 ; WX 600 ; N lcommaaccent ; B 96 -237 513 604 ;
+C -1 ; WX 600 ; N plusminus ; B 76 0 597 529 ;
+C -1 ; WX 600 ; N onehalf ; B 82 0 627 612 ;
+C -1 ; WX 600 ; N onequarter ; B 74 0 619 612 ;
+C -1 ; WX 600 ; N threequarters ; B 70 0 619 612 ;
+C -1 ; WX 600 ; N iacute ; B 96 0 535 639 ;
+C -1 ; WX 600 ; N Abreve ; B 13 0 596 777 ;
+C -1 ; WX 600 ; N kcommaaccent ; B 67 -237 578 604 ;
+C -1 ; WX 600 ; N Omacron ; B 102 -16 616 723 ;
+C -1 ; WX 600 ; N imacron ; B 96 0 564 576 ;
+C -1 ; WX 600 ; N emacron ; B 104 -16 570 576 ;
+C -1 ; WX 600 ; N amacron ; B 93 -16 564 576 ;
+C -1 ; WX 600 ; N tcommaaccent ; B 127 -237 518 563 ;
+C -1 ; WX 600 ; N ydieresis ; B 22 -186 634 611 ;
+C -1 ; WX 600 ; N zdotaccent ; B 115 0 563 611 ;
+C -1 ; WX 600 ; N zcaron ; B 115 0 576 639 ;
+C -1 ; WX 600 ; N zacute ; B 115 0 577 639 ;
+C -1 ; WX 600 ; N yacute ; B 22 -186 634 639 ;
+C -1 ; WX 600 ; N uhungarumlaut ; B 127 -16 576 633 ;
+C -1 ; WX 600 ; N eth ; B 111 -17 582 620 ;
+C -1 ; WX 600 ; N uring ; B 127 -16 569 661 ;
+C -1 ; WX 600 ; N Ocircumflex ; B 102 -16 616 789 ;
+C -1 ; WX 600 ; N commaaccent ; B 159 -237 322 -60 ;
+C -1 ; WX 600 ; N copyright ; B 57 -15 663 578 ;
+C -1 ; WX 600 ; N registered ; B 57 -15 663 578 ;
+C -1 ; WX 600 ; N Acircumflex ; B 13 0 596 789 ;
+C -1 ; WX 600 ; N idieresis ; B 96 0 568 611 ;
+C -1 ; WX 600 ; N lozenge ; B 149 -11 571 575 ;
+C -1 ; WX 600 ; N Delta ; B 43 0 557 563 ;
+C -1 ; WX 600 ; N notequal ; B 96 94 625 464 ;
+C -1 ; WX 600 ; N radical ; B 88 0 773 699 ;
+C -1 ; WX 600 ; N Agrave ; B 13 0 596 789 ;
+C -1 ; WX 600 ; N Aacute ; B 13 0 596 789 ;
+C -1 ; WX 600 ; N lessequal ; B 56 0 635 535 ;
+C -1 ; WX 600 ; N greaterequal ; B 71 0 600 535 ;
+C -1 ; WX 600 ; N logicalnot ; B 160 168 621 438 ;
+C -1 ; WX 600 ; N summation ; B 90 -127 616 563 ;
+C -1 ; WX 600 ; N partialdiff ; B 111 -16 580 581 ;
+C -1 ; WX 600 ; N Ncommaaccent ; B 46 -237 678 563 ;
+C -1 ; WX 600 ; N dcroat ; B 102 -16 690 604 ;
+C -1 ; WX 600 ; N brokenbar ; B 257 -124 444 604 ;
+C -1 ; WX 600 ; N Lcommaaccent ; B 67 -237 585 563 ;
+C -1 ; WX 600 ; N Adieresis ; B 13 0 596 762 ;
+C -1 ; WX 600 ; N mu ; B 86 -200 569 417 ;
+C -1 ; WX 600 ; N .notdef ; B 319 0 319 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 998
+KPX A C -41
+KPX A Ccedilla -39
+KPX A G -36
+KPX A O -35
+KPX A Odieresis -35
+KPX A Q -37
+KPX A T -34
+KPX A U -41
+KPX A Uacute -41
+KPX A Ucircumflex -41
+KPX A Udieresis -41
+KPX A Ugrave -41
+KPX A V -78
+KPX A W -20
+KPX A Y -35
+KPX A a 1
+KPX A b 40
+KPX A c -26
+KPX A ccedilla -23
+KPX A comma -47
+KPX A d -17
+KPX A e -21
+KPX A g -27
+KPX A guillemotleft -57
+KPX A guilsinglleft -57
+KPX A hyphen -35
+KPX A o -22
+KPX A period -70
+KPX A q -27
+KPX A quotedblright -82
+KPX A quoteright -102
+KPX A t -33
+KPX A u -23
+KPX A v -59
+KPX A w -27
+KPX A y -63
+KPX Aacute C -41
+KPX Aacute G -36
+KPX Aacute O -35
+KPX Aacute Q -37
+KPX Aacute T -34
+KPX Aacute U -41
+KPX Aacute V -78
+KPX Aacute W -20
+KPX Aacute Y -35
+KPX Aacute a 1
+KPX Aacute b 40
+KPX Aacute c -26
+KPX Aacute comma -47
+KPX Aacute d -17
+KPX Aacute e -21
+KPX Aacute g -27
+KPX Aacute guillemotleft -57
+KPX Aacute guilsinglleft -57
+KPX Aacute hyphen -35
+KPX Aacute o -22
+KPX Aacute period -70
+KPX Aacute q -27
+KPX Aacute quoteright -102
+KPX Aacute t -33
+KPX Aacute u -23
+KPX Aacute v -59
+KPX Aacute w -27
+KPX Aacute y -63
+KPX Acircumflex C -41
+KPX Acircumflex G -36
+KPX Acircumflex O -35
+KPX Acircumflex Q -37
+KPX Acircumflex T -34
+KPX Acircumflex U -41
+KPX Acircumflex V -78
+KPX Acircumflex W -20
+KPX Acircumflex Y -35
+KPX Acircumflex comma -47
+KPX Acircumflex period -70
+KPX Adieresis C -41
+KPX Adieresis G -36
+KPX Adieresis O -35
+KPX Adieresis Q -37
+KPX Adieresis T -34
+KPX Adieresis U -41
+KPX Adieresis V -78
+KPX Adieresis W -20
+KPX Adieresis Y -35
+KPX Adieresis a 1
+KPX Adieresis b 40
+KPX Adieresis c -26
+KPX Adieresis comma -47
+KPX Adieresis d -17
+KPX Adieresis g -27
+KPX Adieresis guillemotleft -57
+KPX Adieresis guilsinglleft -57
+KPX Adieresis hyphen -35
+KPX Adieresis o -22
+KPX Adieresis period -70
+KPX Adieresis q -27
+KPX Adieresis quotedblright -82
+KPX Adieresis quoteright -102
+KPX Adieresis t -33
+KPX Adieresis u -23
+KPX Adieresis v -59
+KPX Adieresis w -27
+KPX Adieresis y -63
+KPX Agrave C -41
+KPX Agrave G -36
+KPX Agrave O -35
+KPX Agrave Q -37
+KPX Agrave T -34
+KPX Agrave U -41
+KPX Agrave V -78
+KPX Agrave W -20
+KPX Agrave Y -35
+KPX Agrave comma -47
+KPX Agrave period -70
+KPX Aring C -41
+KPX Aring G -36
+KPX Aring O -35
+KPX Aring Q -37
+KPX Aring T -34
+KPX Aring U -41
+KPX Aring V -78
+KPX Aring W -20
+KPX Aring Y -35
+KPX Aring a 1
+KPX Aring b 40
+KPX Aring c -26
+KPX Aring comma -47
+KPX Aring d -17
+KPX Aring e -21
+KPX Aring g -27
+KPX Aring guillemotleft -57
+KPX Aring guilsinglleft -57
+KPX Aring hyphen -35
+KPX Aring o -22
+KPX Aring period -70
+KPX Aring q -27
+KPX Aring quotedblright -82
+KPX Aring quoteright -102
+KPX Aring t -33
+KPX Aring u -23
+KPX Aring v -59
+KPX Aring w -27
+KPX Aring y -63
+KPX Atilde C -41
+KPX Atilde G -36
+KPX Atilde O -35
+KPX Atilde Q -37
+KPX Atilde T -34
+KPX Atilde U -41
+KPX Atilde V -78
+KPX Atilde W -20
+KPX Atilde Y -35
+KPX Atilde comma -47
+KPX Atilde period -70
+KPX B A -15
+KPX B AE -16
+KPX B Aacute -15
+KPX B Acircumflex -15
+KPX B Adieresis -15
+KPX B Aring -15
+KPX B Atilde -15
+KPX B O -15
+KPX B OE 5
+KPX B Oacute -15
+KPX B Ocircumflex -15
+KPX B Odieresis -15
+KPX B Ograve -15
+KPX B Oslash -14
+KPX B V -37
+KPX B W -15
+KPX B Y -58
+KPX C A -14
+KPX C AE -14
+KPX C Aacute -14
+KPX C Adieresis -14
+KPX C Aring -14
+KPX C H -34
+KPX C K -19
+KPX C O -24
+KPX C Oacute -24
+KPX C Odieresis -24
+KPX Ccedilla A -8
+KPX D A -47
+KPX D Aacute -47
+KPX D Acircumflex -47
+KPX D Adieresis -47
+KPX D Agrave -47
+KPX D Aring -47
+KPX D Atilde -47
+KPX D J -38
+KPX D T -47
+KPX D V -50
+KPX D W -20
+KPX D X -60
+KPX D Y -71
+KPX F A -45
+KPX F Aacute -45
+KPX F Acircumflex -45
+KPX F Adieresis -45
+KPX F Agrave -45
+KPX F Aring -45
+KPX F Atilde -45
+KPX F J -100
+KPX F O -34
+KPX F Odieresis -34
+KPX F a -52
+KPX F aacute -52
+KPX F adieresis -49
+KPX F ae -25
+KPX F aring -52
+KPX F comma -172
+KPX F e -61
+KPX F eacute -61
+KPX F hyphen -72
+KPX F i -51
+KPX F j -59
+KPX F o -68
+KPX F oacute -68
+KPX F odieresis -54
+KPX F oe -26
+KPX F oslash -68
+KPX F period -196
+KPX F r -37
+KPX F u -6
+KPX G A 0
+KPX G AE 0
+KPX G Aacute 0
+KPX G Acircumflex 0
+KPX G Adieresis 0
+KPX G Agrave 0
+KPX G Aring 0
+KPX G Atilde 0
+KPX G T -31
+KPX G V -1
+KPX G W -4
+KPX G Y -22
+KPX J A -14
+KPX J AE -23
+KPX J Adieresis -14
+KPX J Aring -14
+KPX K C -50
+KPX K G -46
+KPX K O -45
+KPX K OE -28
+KPX K Oacute -45
+KPX K Odieresis -45
+KPX K S -16
+KPX K T -18
+KPX K a -8
+KPX K adieresis -8
+KPX K ae 19
+KPX K aring -8
+KPX K e -30
+KPX K hyphen -66
+KPX K o -32
+KPX K oacute -32
+KPX K odieresis -32
+KPX K u -33
+KPX K udieresis -33
+KPX K y -72
+KPX L A 9
+KPX L AE 9
+KPX L Aacute 9
+KPX L Adieresis 9
+KPX L Aring 9
+KPX L C -19
+KPX L Ccedilla -19
+KPX L G -18
+KPX L O -15
+KPX L Oacute -15
+KPX L Ocircumflex -15
+KPX L Odieresis -15
+KPX L Ograve -15
+KPX L Otilde -15
+KPX L S -31
+KPX L T -59
+KPX L U -36
+KPX L Udieresis -36
+KPX L V -71
+KPX L W -31
+KPX L Y -60
+KPX L hyphen -1
+KPX L quotedblright -76
+KPX L quoteright -84
+KPX L u -20
+KPX L udieresis -20
+KPX L y -50
+KPX N A -10
+KPX N AE -10
+KPX N Aacute -10
+KPX N Adieresis -10
+KPX N Aring -10
+KPX N C -18
+KPX N Ccedilla -18
+KPX N G -16
+KPX N O -14
+KPX N Oacute -14
+KPX N Odieresis -14
+KPX N a -23
+KPX N aacute -23
+KPX N adieresis -23
+KPX N ae 7
+KPX N aring -23
+KPX N comma -64
+KPX N e -10
+KPX N eacute -10
+KPX N o -14
+KPX N oacute -14
+KPX N odieresis -14
+KPX N oslash -11
+KPX N period -87
+KPX N u -14
+KPX N udieresis -14
+KPX O A -33
+KPX O AE -30
+KPX O Aacute -33
+KPX O Adieresis -33
+KPX O Aring -33
+KPX O T -37
+KPX O V -40
+KPX O W -8
+KPX O X -47
+KPX O Y -61
+KPX Oacute A -33
+KPX Oacute T -37
+KPX Oacute V -40
+KPX Oacute W -8
+KPX Oacute Y -61
+KPX Ocircumflex T -37
+KPX Ocircumflex V -40
+KPX Ocircumflex Y -61
+KPX Odieresis A -33
+KPX Odieresis T -37
+KPX Odieresis V -40
+KPX Odieresis W -8
+KPX Odieresis X -47
+KPX Odieresis Y -61
+KPX Ograve T -37
+KPX Ograve V -40
+KPX Ograve Y -61
+KPX Oslash A -31
+KPX Otilde T -36
+KPX Otilde V -39
+KPX Otilde Y -60
+KPX P A -87
+KPX P AE -81
+KPX P Aacute -87
+KPX P Adieresis -87
+KPX P Aring -87
+KPX P J -90
+KPX P a -57
+KPX P aacute -57
+KPX P adieresis -57
+KPX P ae -29
+KPX P aring -57
+KPX P comma -161
+KPX P e -47
+KPX P eacute -47
+KPX P hyphen -52
+KPX P o -53
+KPX P oacute -53
+KPX P odieresis -53
+KPX P oe -18
+KPX P oslash -53
+KPX P period -185
+KPX R C -32
+KPX R Ccedilla -33
+KPX R G -31
+KPX R O -29
+KPX R OE -8
+KPX R Oacute -29
+KPX R Odieresis -29
+KPX R T -35
+KPX R U -36
+KPX R Udieresis -36
+KPX R V -42
+KPX R W -21
+KPX R Y -36
+KPX R a 0
+KPX R aacute 0
+KPX R adieresis 0
+KPX R ae 27
+KPX R aring 0
+KPX R e -22
+KPX R eacute -22
+KPX R hyphen -53
+KPX R o -23
+KPX R oacute -23
+KPX R odieresis -23
+KPX R oe 15
+KPX R u -16
+KPX R uacute -16
+KPX R udieresis -16
+KPX R y -20
+KPX S A -28
+KPX S AE -28
+KPX S Aacute -28
+KPX S Adieresis -28
+KPX S Aring -28
+KPX S T -48
+KPX S V -18
+KPX S W -23
+KPX S Y -39
+KPX S t -25
+KPX T A -34
+KPX T AE -35
+KPX T Aacute -34
+KPX T Acircumflex -34
+KPX T Adieresis -34
+KPX T Agrave -34
+KPX T Aring -34
+KPX T Atilde -34
+KPX T C -36
+KPX T G -35
+KPX T J -88
+KPX T O -34
+KPX T OE -12
+KPX T Oacute -34
+KPX T Ocircumflex -34
+KPX T Odieresis -34
+KPX T Ograve -34
+KPX T Oslash -34
+KPX T Otilde -34
+KPX T S -50
+KPX T V 4
+KPX T W -1
+KPX T Y -17
+KPX T a -68
+KPX T ae -38
+KPX T c -83
+KPX T colon -145
+KPX T comma -116
+KPX T e -83
+KPX T g -76
+KPX T guillemotleft -129
+KPX T guilsinglleft -129
+KPX T hyphen -99
+KPX T i -51
+KPX T j -59
+KPX T o -87
+KPX T oslash -60
+KPX T period -145
+KPX T r -37
+KPX T s -70
+KPX T semicolon -119
+KPX T u -92
+KPX T v -98
+KPX T w -96
+KPX T y -108
+KPX U A -26
+KPX U AE -35
+KPX U Aacute -26
+KPX U Acircumflex -26
+KPX U Adieresis -26
+KPX U Aring -26
+KPX U Atilde -26
+KPX U comma -80
+KPX U m 3
+KPX U n -22
+KPX U p -5
+KPX U period -105
+KPX U r -47
+KPX Uacute A -26
+KPX Uacute comma -80
+KPX Uacute m 3
+KPX Uacute n -22
+KPX Uacute p -5
+KPX Uacute period -105
+KPX Uacute r -47
+KPX Ucircumflex A -26
+KPX Udieresis A -26
+KPX Udieresis b 17
+KPX Udieresis comma -80
+KPX Udieresis m 3
+KPX Udieresis n -22
+KPX Udieresis p -5
+KPX Udieresis period -105
+KPX Udieresis r -47
+KPX Ugrave A -26
+KPX V A -10
+KPX V AE -19
+KPX V Aacute -10
+KPX V Acircumflex -10
+KPX V Adieresis -10
+KPX V Agrave -10
+KPX V Aring -10
+KPX V Atilde -10
+KPX V C -39
+KPX V G -38
+KPX V O -37
+KPX V Oacute -37
+KPX V Ocircumflex -37
+KPX V Odieresis -37
+KPX V Ograve -37
+KPX V Oslash -38
+KPX V Otilde -38
+KPX V S -41
+KPX V T 4
+KPX V a -65
+KPX V ae -37
+KPX V colon -130
+KPX V comma -134
+KPX V e -56
+KPX V g -57
+KPX V guillemotleft -83
+KPX V guilsinglleft -83
+KPX V hyphen -49
+KPX V i -65
+KPX V o -60
+KPX V oslash -57
+KPX V period -158
+KPX V r -51
+KPX V semicolon -121
+KPX V u -20
+KPX V y -24
+KPX W A -16
+KPX W AE -21
+KPX W Aacute -16
+KPX W Acircumflex -16
+KPX W Adieresis -16
+KPX W Agrave -16
+KPX W Aring -16
+KPX W Atilde -16
+KPX W C -14
+KPX W G -12
+KPX W O -10
+KPX W Oacute -10
+KPX W Ocircumflex -10
+KPX W Odieresis -10
+KPX W Ograve -10
+KPX W Oslash -7
+KPX W Otilde -10
+KPX W S -29
+KPX W T -2
+KPX W a -24
+KPX W ae 6
+KPX W colon -93
+KPX W comma -71
+KPX W e -10
+KPX W g -11
+KPX W guillemotleft -38
+KPX W guilsinglleft -38
+KPX W hyphen -7
+KPX W i -48
+KPX W o -14
+KPX W oslash -11
+KPX W period -95
+KPX W r -34
+KPX W semicolon -74
+KPX W u -2
+KPX W y -6
+KPX X C -52
+KPX X O -48
+KPX X Odieresis -48
+KPX X Q -48
+KPX X a -14
+KPX X e -36
+KPX X hyphen -81
+KPX X o -38
+KPX X u -39
+KPX X y -57
+KPX Y A -31
+KPX Y AE -34
+KPX Y Aacute -31
+KPX Y Acircumflex -31
+KPX Y Adieresis -31
+KPX Y Agrave -31
+KPX Y Aring -31
+KPX Y Atilde -31
+KPX Y C -60
+KPX Y G -60
+KPX Y O -59
+KPX Y Oacute -59
+KPX Y Ocircumflex -59
+KPX Y Odieresis -59
+KPX Y Ograve -59
+KPX Y Oslash -59
+KPX Y Otilde -59
+KPX Y S -62
+KPX Y T -17
+KPX Y a -67
+KPX Y ae -40
+KPX Y colon -145
+KPX Y comma -116
+KPX Y e -81
+KPX Y g -84
+KPX Y guillemotleft -119
+KPX Y guilsinglleft -119
+KPX Y hyphen -96
+KPX Y i -63
+KPX Y o -86
+KPX Y oslash -59
+KPX Y p -39
+KPX Y period -144
+KPX Y semicolon -119
+KPX Y u -50
+KPX Y v -44
+KPX Z v -54
+KPX Z y -64
+KPX a j -93
+KPX a quoteright -60
+KPX a v -33
+KPX a w -23
+KPX a y -44
+KPX aacute v -33
+KPX aacute w -23
+KPX aacute y -44
+KPX adieresis v -33
+KPX adieresis w -23
+KPX adieresis y -44
+KPX ae v 16
+KPX ae w 16
+KPX ae y 5
+KPX agrave v -33
+KPX agrave w -23
+KPX agrave y -44
+KPX aring v -33
+KPX aring w -23
+KPX aring y -44
+KPX b v -17
+KPX b w 0
+KPX b y -28
+KPX c h -6
+KPX c k -12
+KPX comma one -148
+KPX comma quotedblright -123
+KPX comma quoteright -142
+KPX e quoteright -43
+KPX e t -34
+KPX e v -28
+KPX e w -20
+KPX e x -5
+KPX e y -39
+KPX eacute v -28
+KPX eacute w -20
+KPX eacute y -39
+KPX ecircumflex v -28
+KPX ecircumflex w -20
+KPX ecircumflex y -39
+KPX eight four -65
+KPX eight one -85
+KPX eight seven -77
+KPX f a -44
+KPX f aacute -44
+KPX f adieresis -26
+KPX f ae -17
+KPX f aring -44
+KPX f e -58
+KPX f eacute -58
+KPX f f -46
+KPX f i -40
+KPX f j -63
+KPX f l -31
+KPX f o -65
+KPX f oacute -65
+KPX f odieresis -31
+KPX f oe -23
+KPX f oslash -36
+KPX f quoteright -62
+KPX f s -46
+KPX f t -10
+KPX five four -56
+KPX five one -90
+KPX five seven -78
+KPX four four -68
+KPX four one -73
+KPX four seven -99
+KPX g a -14
+KPX g adieresis -14
+KPX g ae 13
+KPX g aring -14
+KPX g e -7
+KPX g eacute -7
+KPX g l -37
+KPX g oacute -12
+KPX g odieresis -12
+KPX g r -4
+KPX guillemotright A -50
+KPX guillemotright AE -46
+KPX guillemotright Aacute -50
+KPX guillemotright Adieresis -50
+KPX guillemotright Aring -50
+KPX guillemotright T -128
+KPX guillemotright V -80
+KPX guillemotright W -37
+KPX guillemotright Y -119
+KPX guilsinglright A -50
+KPX guilsinglright AE -46
+KPX guilsinglright Aacute -50
+KPX guilsinglright Adieresis -50
+KPX guilsinglright Aring -50
+KPX guilsinglright T -128
+KPX guilsinglright V -80
+KPX guilsinglright W -37
+KPX guilsinglright Y -119
+KPX h quoteright -52
+KPX h y -37
+KPX hyphen A -29
+KPX hyphen AE -23
+KPX hyphen Aacute -29
+KPX hyphen Adieresis -29
+KPX hyphen Aring -29
+KPX hyphen T -98
+KPX hyphen V -44
+KPX hyphen W -4
+KPX hyphen Y -95
+KPX i T -64
+KPX i j -146
+KPX k a -12
+KPX k aacute -12
+KPX k adieresis -12
+KPX k ae 15
+KPX k aring -12
+KPX k comma -60
+KPX k e -34
+KPX k eacute -34
+KPX k g -43
+KPX k hyphen -104
+KPX k o -35
+KPX k oacute -35
+KPX k odieresis -35
+KPX k period -89
+KPX k s -14
+KPX k u -7
+KPX k udieresis -7
+KPX l v -86
+KPX l y -96
+KPX m p 19
+KPX m v 7
+KPX m w 13
+KPX m y -3
+KPX n T -48
+KPX n p -8
+KPX n quoteright -50
+KPX n v -25
+KPX n w -14
+KPX n y -36
+KPX nine four -58
+KPX nine one -84
+KPX nine seven -75
+KPX o T -89
+KPX o quoteright -41
+KPX o t -24
+KPX o v -25
+KPX o w -7
+KPX o x -28
+KPX o y -36
+KPX oacute v -25
+KPX oacute w -7
+KPX oacute y -36
+KPX ocircumflex t -24
+KPX odieresis t -24
+KPX odieresis v -25
+KPX odieresis w -7
+KPX odieresis x -28
+KPX odieresis y -36
+KPX ograve v -25
+KPX ograve w -7
+KPX ograve y -36
+KPX one comma -99
+KPX one eight -94
+KPX one five -76
+KPX one four -127
+KPX one nine -81
+KPX one one -69
+KPX one period -128
+KPX one seven -147
+KPX one six -119
+KPX one three -69
+KPX one two -54
+KPX one zero -102
+KPX p t -20
+KPX p y -25
+KPX period one -125
+KPX period quotedblright -114
+KPX period quoteright -133
+KPX q c -4
+KPX q u 37
+KPX quotedblbase A -6
+KPX quotedblbase AE -6
+KPX quotedblbase T -82
+KPX quotedblbase V -85
+KPX quotedblbase W -24
+KPX quotedblbase Y -83
+KPX quotedblleft A -66
+KPX quotedblleft AE -57
+KPX quotedblleft Aacute -66
+KPX quotedblleft Adieresis -66
+KPX quotedblleft Aring -66
+KPX quotedblleft T -46
+KPX quotedblleft V -18
+KPX quotedblleft W -8
+KPX quotedblleft Y -46
+KPX quotedblright A -67
+KPX quotedblright AE -76
+KPX quotedblright Aacute -66
+KPX quotedblright Adieresis -66
+KPX quotedblright Aring -66
+KPX quotedblright T -53
+KPX quotedblright V -22
+KPX quotedblright W -26
+KPX quotedblright Y -43
+KPX quoteleft A -87
+KPX quoteleft AE -78
+KPX quoteleft Aacute -87
+KPX quoteleft Adieresis -87
+KPX quoteleft Aring -87
+KPX quoteleft T -67
+KPX quoteleft V -39
+KPX quoteleft W -29
+KPX quoteleft Y -67
+KPX quoteright A -145
+KPX quoteright AE -154
+KPX quoteright Aacute -145
+KPX quoteright Adieresis -145
+KPX quoteright Aring -145
+KPX quoteright comma -201
+KPX quoteright d -129
+KPX quoteright o -135
+KPX quoteright period -224
+KPX quoteright r -150
+KPX quoteright s -144
+KPX quoteright t -118
+KPX quoteright v -112
+KPX quoteright w -108
+KPX quoteright y -122
+KPX r a -26
+KPX r aacute -26
+KPX r acircumflex -26
+KPX r adieresis -26
+KPX r ae 1
+KPX r agrave -26
+KPX r aring -26
+KPX r c -26
+KPX r ccedilla -34
+KPX r colon -86
+KPX r comma -104
+KPX r d -18
+KPX r e -17
+KPX r eacute -17
+KPX r ecircumflex -17
+KPX r egrave -17
+KPX r f -24
+KPX r g -15
+KPX r h -24
+KPX r hyphen -125
+KPX r i -34
+KPX r j -42
+KPX r k -34
+KPX r l -51
+KPX r m 27
+KPX r n 0
+KPX r o -24
+KPX r oacute -24
+KPX r ocircumflex -24
+KPX r odieresis -24
+KPX r oe 13
+KPX r ograve -24
+KPX r oslash -24
+KPX r p 21
+KPX r period -133
+KPX r q -16
+KPX r quoteright -44
+KPX r r -20
+KPX r s -29
+KPX r semicolon -75
+KPX r t 11
+KPX r u 11
+KPX r v 17
+KPX r w 17
+KPX r x -4
+KPX r y 6
+KPX r z -23
+KPX s quoteright -51
+KPX s t -17
+KPX seven colon -154
+KPX seven comma -146
+KPX seven eight -86
+KPX seven five -91
+KPX seven four -116
+KPX seven one -74
+KPX seven period -169
+KPX seven seven -69
+KPX seven six -104
+KPX seven three -79
+KPX seven two -76
+KPX six four -52
+KPX six one -68
+KPX six seven -55
+KPX t S -40
+KPX t a -25
+KPX t aacute -25
+KPX t adieresis -25
+KPX t ae 2
+KPX t aring -25
+KPX t colon -107
+KPX t e -43
+KPX t eacute -43
+KPX t h -8
+KPX t o -45
+KPX t oacute -45
+KPX t odieresis -45
+KPX t quoteright -100
+KPX t semicolon -86
+KPX three four -58
+KPX three one -82
+KPX three seven -75
+KPX two four -97
+KPX two one -73
+KPX two seven -79
+KPX u quoteright -43
+KPX v a -9
+KPX v aacute -9
+KPX v acircumflex -9
+KPX v adieresis -9
+KPX v ae 17
+KPX v agrave -9
+KPX v aring -9
+KPX v atilde -9
+KPX v c -22
+KPX v colon -75
+KPX v comma -118
+KPX v e -17
+KPX v eacute -17
+KPX v ecircumflex -17
+KPX v egrave -17
+KPX v g -14
+KPX v hyphen -30
+KPX v l -87
+KPX v o -23
+KPX v oacute -23
+KPX v odieresis -23
+KPX v ograve -23
+KPX v oslash -23
+KPX v period -143
+KPX v s -22
+KPX v semicolon -66
+KPX w a -9
+KPX w aacute -9
+KPX w acircumflex -9
+KPX w adieresis -9
+KPX w ae 17
+KPX w agrave -9
+KPX w aring -9
+KPX w atilde -9
+KPX w c -12
+KPX w colon -75
+KPX w comma -75
+KPX w e -4
+KPX w eacute -4
+KPX w ecircumflex -4
+KPX w egrave -4
+KPX w g -6
+KPX w hyphen -4
+KPX w l -53
+KPX w o -9
+KPX w oacute -9
+KPX w odieresis -9
+KPX w ograve -9
+KPX w oslash -6
+KPX w period -99
+KPX w s -22
+KPX w semicolon -66
+KPX x a -8
+KPX x c -35
+KPX x e -30
+KPX x eacute -30
+KPX x o -31
+KPX x q -33
+KPX y a -20
+KPX y aacute -20
+KPX y acircumflex -20
+KPX y adieresis -20
+KPX y ae 6
+KPX y agrave -20
+KPX y aring -20
+KPX y atilde -20
+KPX y c -33
+KPX y colon -86
+KPX y comma -122
+KPX y e -28
+KPX y eacute -28
+KPX y ecircumflex -28
+KPX y egrave -28
+KPX y g -25
+KPX y hyphen -29
+KPX y l -98
+KPX y o -34
+KPX y oacute -34
+KPX y odieresis -34
+KPX y ograve -34
+KPX y oslash -34
+KPX y period -148
+KPX y s -33
+KPX y semicolon -77
+KPX zero four -64
+KPX zero one -91
+KPX zero seven -82
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/pdf2swf/fonts/n022023l.pfb b/pdf2swf/fonts/n022023l.pfb
new file mode 100644
index 00000000..107a5133
--- /dev/null
+++ b/pdf2swf/fonts/n022023l.pfb
Binary files differ
diff --git a/pdf2swf/fonts/n022024l.afm b/pdf2swf/fonts/n022024l.afm
new file mode 100644
index 00000000..8e614b89
--- /dev/null
+++ b/pdf2swf/fonts/n022024l.afm
@@ -0,0 +1,1341 @@
+StartFontMetrics 3.0
+Comment Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development
+Comment Creation Date: 12/22/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName NimbusMonL-BoldObli
+FullName Nimbus Mono L Bold Oblique
+FamilyName Nimbus Mono L
+Weight Bold
+ItalicAngle -12.0
+IsFixedPitch false
+UnderlinePosition -100
+UnderlineThickness 50
+Version 1.05
+Notice (URW)++,Copyright 1999 by (URW)++ Design & Development
+EncodingScheme AdobeStandardEncoding
+FontBBox -61 -278 840 871
+CapHeight 583
+XHeight 437
+Descender -205
+Ascender 624
+StartCharMetrics 316
+C 32 ; WX 600 ; N space ; B 386 0 386 0 ;
+C 33 ; WX 600 ; N exclam ; B 234 -15 501 638 ;
+C 34 ; WX 600 ; N quotedbl ; B 243 312 592 602 ;
+C 35 ; WX 600 ; N numbersign ; B 101 -92 623 675 ;
+C 36 ; WX 600 ; N dollar ; B 100 -123 610 684 ;
+C 37 ; WX 600 ; N percent ; B 131 -15 599 617 ;
+C 38 ; WX 600 ; N ampersand ; B 102 -14 557 550 ;
+C 39 ; WX 600 ; N quoteright ; B 222 331 483 623 ;
+C 40 ; WX 600 ; N parenleft ; B 304 -153 613 632 ;
+C 41 ; WX 600 ; N parenright ; B 94 -153 403 632 ;
+C 42 ; WX 600 ; N asterisk ; B 178 208 614 622 ;
+C 43 ; WX 600 ; N plus ; B 101 0 619 560 ;
+C 44 ; WX 600 ; N comma ; B 118 -158 379 134 ;
+C 45 ; WX 600 ; N hyphen ; B 101 229 619 329 ;
+C 46 ; WX 600 ; N period ; B 234 -15 387 117 ;
+C 47 ; WX 600 ; N slash ; B 69 -113 656 695 ;
+C 48 ; WX 600 ; N zero ; B 130 -15 602 638 ;
+C 49 ; WX 600 ; N one ; B 93 0 529 638 ;
+C 50 ; WX 600 ; N two ; B 54 0 602 638 ;
+C 51 ; WX 600 ; N three ; B 80 -15 609 638 ;
+C 52 ; WX 600 ; N four ; B 104 0 579 622 ;
+C 53 ; WX 600 ; N five ; B 83 -15 610 622 ;
+C 54 ; WX 600 ; N six ; B 154 -15 663 638 ;
+C 55 ; WX 600 ; N seven ; B 184 -1 640 622 ;
+C 56 ; WX 600 ; N eight ; B 114 -15 608 638 ;
+C 57 ; WX 600 ; N nine ; B 115 -15 624 638 ;
+C 58 ; WX 600 ; N colon ; B 234 -15 455 437 ;
+C 59 ; WX 600 ; N semicolon ; B 118 -158 431 437 ;
+C 60 ; WX 600 ; N less ; B 102 54 642 501 ;
+C 61 ; WX 600 ; N equal ; B 81 138 638 422 ;
+C 62 ; WX 600 ; N greater ; B 76 53 616 500 ;
+C 63 ; WX 600 ; N question ; B 197 -15 608 598 ;
+C 64 ; WX 600 ; N at ; B 98 -152 582 620 ;
+C 65 ; WX 600 ; N A ; B -11 0 633 583 ;
+C 66 ; WX 600 ; N B ; B 22 0 620 583 ;
+C 67 ; WX 600 ; N C ; B 80 -14 663 597 ;
+C 68 ; WX 600 ; N D ; B 23 0 622 583 ;
+C 69 ; WX 600 ; N E ; B 23 0 652 583 ;
+C 70 ; WX 600 ; N F ; B 23 0 674 583 ;
+C 71 ; WX 600 ; N G ; B 79 -14 667 597 ;
+C 72 ; WX 600 ; N H ; B 32 0 675 583 ;
+C 73 ; WX 600 ; N I ; B 93 0 632 583 ;
+C 74 ; WX 600 ; N J ; B 64 -14 727 583 ;
+C 75 ; WX 600 ; N K ; B 22 0 687 583 ;
+C 76 ; WX 600 ; N L ; B 42 0 616 583 ;
+C 77 ; WX 600 ; N M ; B -10 0 728 583 ;
+C 78 ; WX 600 ; N N ; B 21 0 706 583 ;
+C 79 ; WX 600 ; N O ; B 75 -14 649 597 ;
+C 80 ; WX 600 ; N P ; B 23 0 617 583 ;
+C 81 ; WX 600 ; N Q ; B 75 -145 649 597 ;
+C 82 ; WX 600 ; N R ; B 23 0 631 583 ;
+C 83 ; WX 600 ; N S ; B 72 -14 634 597 ;
+C 84 ; WX 600 ; N T ; B 121 0 682 583 ;
+C 85 ; WX 600 ; N U ; B 110 -14 705 583 ;
+C 86 ; WX 600 ; N V ; B 91 0 735 583 ;
+C 87 ; WX 600 ; N W ; B 98 0 725 583 ;
+C 88 ; WX 600 ; N X ; B 19 0 692 583 ;
+C 89 ; WX 600 ; N Y ; B 128 0 694 583 ;
+C 90 ; WX 600 ; N Z ; B 73 0 628 583 ;
+C 91 ; WX 600 ; N bracketleft ; B 219 -148 598 627 ;
+C 92 ; WX 600 ; N backslash ; B 219 -113 504 695 ;
+C 93 ; WX 600 ; N bracketright ; B 104 -148 483 627 ;
+C 94 ; WX 600 ; N asciicircum ; B 161 325 598 652 ;
+C 95 ; WX 600 ; N underscore ; B -61 -125 564 -75 ;
+C 96 ; WX 600 ; N quoteleft ; B 377 348 534 602 ;
+C 97 ; WX 600 ; N a ; B 65 -16 583 450 ;
+C 98 ; WX 600 ; N b ; B 2 -14 623 624 ;
+C 99 ; WX 600 ; N c ; B 93 -16 626 450 ;
+C 100 ; WX 600 ; N d ; B 74 -14 664 624 ;
+C 101 ; WX 600 ; N e ; B 74 -16 600 450 ;
+C 102 ; WX 600 ; N f ; B 84 0 691 623 ;
+C 103 ; WX 600 ; N g ; B 73 -205 675 451 ;
+C 104 ; WX 600 ; N h ; B 33 0 593 624 ;
+C 105 ; WX 600 ; N i ; B 72 0 550 623 ;
+C 106 ; WX 600 ; N j ; B 83 -205 581 623 ;
+C 107 ; WX 600 ; N k ; B 42 0 606 624 ;
+C 108 ; WX 600 ; N l ; B 72 0 550 624 ;
+C 109 ; WX 600 ; N m ; B -9 0 635 450 ;
+C 110 ; WX 600 ; N n ; B 33 0 583 450 ;
+C 111 ; WX 600 ; N o ; B 84 -16 609 450 ;
+C 112 ; WX 600 ; N p ; B -42 -205 623 450 ;
+C 113 ; WX 600 ; N q ; B 75 -205 696 450 ;
+C 114 ; WX 600 ; N r ; B 64 0 650 449 ;
+C 115 ; WX 600 ; N s ; B 83 -16 592 450 ;
+C 116 ; WX 600 ; N t ; B 94 -16 547 591 ;
+C 117 ; WX 600 ; N u ; B 94 -13 603 437 ;
+C 118 ; WX 600 ; N v ; B 81 0 683 437 ;
+C 119 ; WX 600 ; N w ; B 82 0 684 437 ;
+C 120 ; WX 600 ; N x ; B 30 0 641 437 ;
+C 121 ; WX 600 ; N y ; B -13 -205 662 437 ;
+C 122 ; WX 600 ; N z ; B 85 0 599 437 ;
+C 123 ; WX 600 ; N braceleft ; B 217 -153 556 623 ;
+C 124 ; WX 600 ; N bar ; B 227 -153 472 622 ;
+C 125 ; WX 600 ; N braceright ; B 144 -153 483 623 ;
+C 126 ; WX 600 ; N asciitilde ; B 114 179 606 385 ;
+C 161 ; WX 600 ; N exclamdown ; B 186 -227 453 426 ;
+C 162 ; WX 600 ; N cent ; B 144 -44 593 661 ;
+C 163 ; WX 600 ; N sterling ; B 64 0 571 598 ;
+C 164 ; WX 600 ; N fraction ; B 52 102 676 500 ;
+C 165 ; WX 600 ; N yen ; B 133 0 693 580 ;
+C 166 ; WX 600 ; N florin ; B 43 -123 672 638 ;
+C 167 ; WX 600 ; N section ; B 45 -170 643 583 ;
+C 168 ; WX 600 ; N currency ; B 96 64 626 519 ;
+C 169 ; WX 600 ; N quotesingle ; B 343 312 492 602 ;
+C 170 ; WX 600 ; N quotedblleft ; B 226 348 583 602 ;
+C 171 ; WX 600 ; N guillemotleft ; B 80 20 654 415 ;
+C 172 ; WX 600 ; N guilsinglleft ; B 80 20 425 415 ;
+C 173 ; WX 600 ; N guilsinglright ; B 273 20 617 415 ;
+C 174 ; WX 600 ; N fi ; B -4 0 633 624 ;
+C 175 ; WX 600 ; N fl ; B -8 0 645 623 ;
+C 177 ; WX 600 ; N endash ; B 101 229 619 329 ;
+C 178 ; WX 600 ; N dagger ; B 175 -92 589 622 ;
+C 179 ; WX 600 ; N daggerdbl ; B 123 -92 589 622 ;
+C 180 ; WX 600 ; N periodcentered ; B 283 214 436 346 ;
+C 182 ; WX 600 ; N paragraph ; B 108 -174 672 583 ;
+C 183 ; WX 600 ; N bullet ; B 211 154 517 453 ;
+C 184 ; WX 600 ; N quotesinglbase ; B 118 -158 379 134 ;
+C 185 ; WX 600 ; N quotedblbase ; B 66 -120 519 134 ;
+C 186 ; WX 600 ; N quotedblright ; B 166 348 619 602 ;
+C 187 ; WX 600 ; N guillemotright ; B 43 20 617 415 ;
+C 188 ; WX 600 ; N ellipsis ; B 34 -15 587 117 ;
+C 189 ; WX 600 ; N perthousand ; B 104 0 627 618 ;
+C 191 ; WX 600 ; N questiondown ; B 70 -227 481 386 ;
+C 193 ; WX 600 ; N grave ; B 264 496 464 696 ;
+C 194 ; WX 600 ; N acute ; B 362 496 616 696 ;
+C 195 ; WX 600 ; N circumflex ; B 237 497 590 696 ;
+C 196 ; WX 600 ; N tilde ; B 233 523 619 656 ;
+C 197 ; WX 600 ; N macron ; B 249 546 600 626 ;
+C 198 ; WX 600 ; N breve ; B 261 503 614 687 ;
+C 199 ; WX 600 ; N dotaccent ; B 365 534 488 654 ;
+C 200 ; WX 600 ; N dieresis ; B 261 534 592 654 ;
+C 202 ; WX 600 ; N ring ; B 303 486 554 727 ;
+C 203 ; WX 600 ; N cedilla ; B 143 -229 381 0 ;
+C 205 ; WX 600 ; N hungarumlaut ; B 237 496 616 694 ;
+C 206 ; WX 600 ; N ogonek ; B 222 -208 433 0 ;
+C 207 ; WX 600 ; N caron ; B 264 497 617 696 ;
+C 208 ; WX 600 ; N emdash ; B 30 229 690 329 ;
+C 225 ; WX 600 ; N AE ; B -10 0 717 583 ;
+C 227 ; WX 600 ; N ordfeminine ; B 170 182 559 595 ;
+C 232 ; WX 600 ; N Lslash ; B 43 0 616 583 ;
+C 233 ; WX 600 ; N Oslash ; B 4 -70 717 638 ;
+C 234 ; WX 600 ; N OE ; B 34 0 717 583 ;
+C 235 ; WX 600 ; N ordmasculine ; B 168 182 566 595 ;
+C 241 ; WX 600 ; N ae ; B 14 -16 665 450 ;
+C 245 ; WX 600 ; N dotlessi ; B 72 0 550 437 ;
+C 248 ; WX 600 ; N lslash ; B 72 0 557 624 ;
+C 249 ; WX 600 ; N oslash ; B 17 -70 669 494 ;
+C 250 ; WX 600 ; N oe ; B 28 -16 666 450 ;
+C 251 ; WX 600 ; N germandbls ; B 22 -16 569 623 ;
+C -1 ; WX 600 ; N Udieresis ; B 110 -14 705 800 ;
+C -1 ; WX 600 ; N Uacute ; B 110 -14 705 839 ;
+C -1 ; WX 600 ; N Scedilla ; B 72 -229 634 597 ;
+C -1 ; WX 600 ; N Tcaron ; B 121 0 682 839 ;
+C -1 ; WX 600 ; N Scaron ; B 72 -14 657 839 ;
+C -1 ; WX 600 ; N Rcaron ; B 23 0 631 839 ;
+C -1 ; WX 600 ; N Racute ; B 23 0 631 839 ;
+C -1 ; WX 600 ; N Sacute ; B 72 -14 634 839 ;
+C -1 ; WX 600 ; N Otilde ; B 75 -14 656 799 ;
+C -1 ; WX 600 ; N ucircumflex ; B 94 -13 603 696 ;
+C -1 ; WX 600 ; N Ohungarumlaut ; B 75 -14 680 837 ;
+C -1 ; WX 600 ; N Uhungarumlaut ; B 110 -14 705 837 ;
+C -1 ; WX 600 ; N Yacute ; B 128 0 694 839 ;
+C -1 ; WX 600 ; N Eth ; B 23 0 622 583 ;
+C -1 ; WX 600 ; N Dcroat ; B 23 0 622 583 ;
+C -1 ; WX 600 ; N Zacute ; B 73 0 628 839 ;
+C -1 ; WX 600 ; N Uring ; B 110 -14 705 871 ;
+C -1 ; WX 600 ; N gbreve ; B 73 -205 675 687 ;
+C -1 ; WX 600 ; N eogonek ; B 74 -208 600 450 ;
+C -1 ; WX 600 ; N edotaccent ; B 74 -16 600 654 ;
+C -1 ; WX 600 ; N ecaron ; B 74 -16 617 696 ;
+C -1 ; WX 600 ; N Ugrave ; B 110 -14 705 839 ;
+C -1 ; WX 600 ; N Thorn ; B 23 0 588 583 ;
+C -1 ; WX 600 ; N eacute ; B 74 -16 600 696 ;
+C -1 ; WX 600 ; N edieresis ; B 74 -16 600 654 ;
+C -1 ; WX 740 ; N dcaron ; B 74 -14 840 639 ;
+C -1 ; WX 600 ; N ccedilla ; B 92 -229 626 450 ;
+C -1 ; WX 600 ; N ccaron ; B 93 -16 627 696 ;
+C -1 ; WX 600 ; N cacute ; B 93 -16 626 696 ;
+C -1 ; WX 600 ; N aogonek ; B 65 -208 583 450 ;
+C -1 ; WX 600 ; N aring ; B 65 -16 583 727 ;
+C -1 ; WX 600 ; N atilde ; B 65 -16 612 656 ;
+C -1 ; WX 600 ; N abreve ; B 65 -16 614 687 ;
+C -1 ; WX 600 ; N egrave ; B 74 -16 600 696 ;
+C -1 ; WX 600 ; N agrave ; B 65 -16 583 696 ;
+C -1 ; WX 600 ; N aacute ; B 66 -16 584 696 ;
+C -1 ; WX 600 ; N adieresis ; B 65 -16 583 654 ;
+C -1 ; WX 600 ; N Uogonek ; B 110 -208 705 583 ;
+C -1 ; WX 600 ; N ugrave ; B 94 -13 603 696 ;
+C -1 ; WX 600 ; N uacute ; B 94 -13 603 696 ;
+C -1 ; WX 600 ; N udieresis ; B 94 -13 603 654 ;
+C -1 ; WX 600 ; N tcaron ; B 94 -16 700 639 ;
+C -1 ; WX 600 ; N scommaaccent ; B 83 -278 592 450 ;
+C -1 ; WX 600 ; N Zcaron ; B 73 0 644 839 ;
+C -1 ; WX 600 ; N ecircumflex ; B 74 -16 600 696 ;
+C -1 ; WX 600 ; N Ucircumflex ; B 110 -14 705 839 ;
+C -1 ; WX 600 ; N acircumflex ; B 65 -16 583 696 ;
+C -1 ; WX 600 ; N Zdotaccent ; B 73 0 628 793 ;
+C -1 ; WX 600 ; N scaron ; B 83 -16 627 696 ;
+C -1 ; WX 600 ; N Amacron ; B -11 0 633 776 ;
+C -1 ; WX 600 ; N sacute ; B 83 -16 616 696 ;
+C -1 ; WX 600 ; N Tcommaaccent ; B 121 -278 682 583 ;
+C -1 ; WX 600 ; N Ydieresis ; B 128 0 694 800 ;
+C -1 ; WX 600 ; N thorn ; B -42 -205 623 624 ;
+C -1 ; WX 600 ; N Emacron ; B 23 0 652 776 ;
+C -1 ; WX 600 ; N Ograve ; B 75 -14 649 839 ;
+C -1 ; WX 600 ; N Oacute ; B 75 -14 649 839 ;
+C -1 ; WX 600 ; N Odieresis ; B 75 -14 649 800 ;
+C -1 ; WX 600 ; N Ntilde ; B 21 0 706 799 ;
+C -1 ; WX 600 ; N Ncaron ; B 21 0 706 839 ;
+C -1 ; WX 600 ; N Nacute ; B 21 0 706 839 ;
+C -1 ; WX 600 ; N Lcaron ; B 42 0 680 598 ;
+C -1 ; WX 600 ; N Lacute ; B 42 0 616 839 ;
+C -1 ; WX 600 ; N Idotaccent ; B 93 0 632 793 ;
+C -1 ; WX 600 ; N racute ; B 64 0 650 696 ;
+C -1 ; WX 600 ; N Icircumflex ; B 93 0 632 839 ;
+C -1 ; WX 600 ; N ohungarumlaut ; B 84 -16 616 694 ;
+C -1 ; WX 600 ; N otilde ; B 84 -16 626 656 ;
+C -1 ; WX 600 ; N Euro ; B 54 -14 639 597 ;
+C -1 ; WX 600 ; N ocircumflex ; B 84 -16 609 696 ;
+C -1 ; WX 600 ; N onesuperior ; B 224 247 494 638 ;
+C -1 ; WX 600 ; N twosuperior ; B 202 247 538 637 ;
+C -1 ; WX 600 ; N threesuperior ; B 218 238 543 637 ;
+C -1 ; WX 600 ; N Igrave ; B 93 0 632 839 ;
+C -1 ; WX 600 ; N Iacute ; B 93 0 632 839 ;
+C -1 ; WX 600 ; N Imacron ; B 93 0 632 776 ;
+C -1 ; WX 600 ; N Iogonek ; B 93 -208 632 583 ;
+C -1 ; WX 600 ; N Idieresis ; B 93 0 632 800 ;
+C -1 ; WX 600 ; N Gbreve ; B 79 -14 667 831 ;
+C -1 ; WX 600 ; N Umacron ; B 110 -14 705 776 ;
+C -1 ; WX 600 ; N Kcommaaccent ; B 22 -278 687 583 ;
+C -1 ; WX 600 ; N ograve ; B 84 -16 609 696 ;
+C -1 ; WX 600 ; N Scommaaccent ; B 72 -278 634 597 ;
+C -1 ; WX 600 ; N Eogonek ; B 23 -208 652 583 ;
+C -1 ; WX 600 ; N oacute ; B 84 -16 609 696 ;
+C -1 ; WX 600 ; N Edotaccent ; B 23 0 652 793 ;
+C -1 ; WX 600 ; N iogonek ; B 72 -208 550 623 ;
+C -1 ; WX 600 ; N gcommaaccent ; B 73 -205 675 722 ;
+C -1 ; WX 600 ; N odieresis ; B 84 -16 609 654 ;
+C -1 ; WX 600 ; N ntilde ; B 33 0 613 656 ;
+C -1 ; WX 600 ; N ncaron ; B 33 0 617 696 ;
+C -1 ; WX 600 ; N Ecaron ; B 23 0 652 839 ;
+C -1 ; WX 600 ; N Ecircumflex ; B 23 0 652 839 ;
+C -1 ; WX 600 ; N scedilla ; B 83 -229 592 450 ;
+C -1 ; WX 600 ; N rcaron ; B 64 0 650 696 ;
+C -1 ; WX 600 ; N Egrave ; B 23 0 652 839 ;
+C -1 ; WX 600 ; N Eacute ; B 23 0 652 839 ;
+C -1 ; WX 600 ; N Gcommaaccent ; B 79 -278 667 597 ;
+C -1 ; WX 600 ; N Rcommaaccent ; B 23 -278 631 583 ;
+C -1 ; WX 600 ; N Edieresis ; B 23 0 652 800 ;
+C -1 ; WX 600 ; N nacute ; B 33 0 616 696 ;
+C -1 ; WX 600 ; N uogonek ; B 94 -208 603 437 ;
+C -1 ; WX 600 ; N umacron ; B 94 -13 603 626 ;
+C -1 ; WX 600 ; N Dcaron ; B 23 0 622 839 ;
+C -1 ; WX 600 ; N lcaron ; B 72 0 700 639 ;
+C -1 ; WX 600 ; N Ccaron ; B 80 -14 663 839 ;
+C -1 ; WX 600 ; N Cacute ; B 80 -14 663 839 ;
+C -1 ; WX 600 ; N Ccedilla ; B 80 -229 663 597 ;
+C -1 ; WX 600 ; N degree ; B 210 243 568 596 ;
+C -1 ; WX 600 ; N Aogonek ; B -11 -208 633 583 ;
+C -1 ; WX 600 ; N minus ; B 101 230 619 330 ;
+C -1 ; WX 600 ; N multiply ; B 126 80 592 480 ;
+C -1 ; WX 600 ; N divide ; B 101 28 619 532 ;
+C -1 ; WX 600 ; N Aring ; B -11 0 633 871 ;
+C -1 ; WX 600 ; N trademark ; B 60 220 732 583 ;
+C -1 ; WX 600 ; N rcommaaccent ; B 64 -278 650 449 ;
+C -1 ; WX 600 ; N lacute ; B 72 0 600 839 ;
+C -1 ; WX 600 ; N omacron ; B 84 -16 609 626 ;
+C -1 ; WX 600 ; N Atilde ; B -11 0 633 799 ;
+C -1 ; WX 600 ; N icircumflex ; B 72 0 573 696 ;
+C -1 ; WX 600 ; N igrave ; B 72 0 550 696 ;
+C -1 ; WX 600 ; N ncommaaccent ; B 33 -278 583 450 ;
+C -1 ; WX 600 ; N lcommaaccent ; B 72 -278 550 624 ;
+C -1 ; WX 600 ; N plusminus ; B 52 0 640 624 ;
+C -1 ; WX 600 ; N onehalf ; B 25 0 685 638 ;
+C -1 ; WX 600 ; N onequarter ; B 25 0 673 638 ;
+C -1 ; WX 600 ; N threequarters ; B 18 0 673 637 ;
+C -1 ; WX 600 ; N iacute ; B 71 0 574 696 ;
+C -1 ; WX 600 ; N Abreve ; B -11 0 633 831 ;
+C -1 ; WX 600 ; N kcommaaccent ; B 42 -278 606 624 ;
+C -1 ; WX 600 ; N Omacron ; B 75 -14 649 776 ;
+C -1 ; WX 600 ; N imacron ; B 72 0 600 626 ;
+C -1 ; WX 600 ; N emacron ; B 74 -16 600 626 ;
+C -1 ; WX 600 ; N amacron ; B 65 -16 600 626 ;
+C -1 ; WX 600 ; N tcommaaccent ; B 94 -278 547 591 ;
+C -1 ; WX 600 ; N ydieresis ; B -13 -205 662 654 ;
+C -1 ; WX 600 ; N zdotaccent ; B 85 0 599 654 ;
+C -1 ; WX 600 ; N zcaron ; B 85 0 619 696 ;
+C -1 ; WX 600 ; N zacute ; B 85 0 616 696 ;
+C -1 ; WX 600 ; N yacute ; B -13 -205 662 696 ;
+C -1 ; WX 600 ; N uhungarumlaut ; B 94 -13 616 694 ;
+C -1 ; WX 600 ; N eth ; B 83 -16 617 646 ;
+C -1 ; WX 600 ; N uring ; B 94 -13 603 727 ;
+C -1 ; WX 600 ; N Ocircumflex ; B 75 -14 649 839 ;
+C -1 ; WX 600 ; N commaaccent ; B 147 -278 342 -59 ;
+C -1 ; WX 600 ; N copyright ; B 48 -15 675 598 ;
+C -1 ; WX 600 ; N registered ; B 48 -15 675 598 ;
+C -1 ; WX 600 ; N Acircumflex ; B -11 0 633 839 ;
+C -1 ; WX 600 ; N idieresis ; B 72 0 575 656 ;
+C -1 ; WX 600 ; N lozenge ; B 133 -19 590 593 ;
+C -1 ; WX 600 ; N Delta ; B 15 0 585 583 ;
+C -1 ; WX 600 ; N notequal ; B 81 22 638 525 ;
+C -1 ; WX 600 ; N radical ; B 74 -60 782 697 ;
+C -1 ; WX 600 ; N Agrave ; B -11 0 633 839 ;
+C -1 ; WX 600 ; N Aacute ; B -11 0 633 839 ;
+C -1 ; WX 600 ; N lessequal ; B 50 0 666 591 ;
+C -1 ; WX 600 ; N greaterequal ; B 52 0 660 591 ;
+C -1 ; WX 600 ; N logicalnot ; B 125 115 560 445 ;
+C -1 ; WX 600 ; N summation ; B 32 -97 668 671 ;
+C -1 ; WX 600 ; N partialdiff ; B 138 -16 579 590 ;
+C -1 ; WX 600 ; N Ncommaaccent ; B 21 -278 706 583 ;
+C -1 ; WX 600 ; N dcroat ; B 74 -14 712 624 ;
+C -1 ; WX 600 ; N brokenbar ; B 227 -153 472 622 ;
+C -1 ; WX 600 ; N Lcommaaccent ; B 42 -278 616 583 ;
+C -1 ; WX 600 ; N Adieresis ; B -11 0 633 800 ;
+C -1 ; WX 600 ; N mu ; B 72 -153 603 440 ;
+C -1 ; WX 600 ; N .notdef ; B 386 0 386 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 998
+KPX A C -24
+KPX A Ccedilla -30
+KPX A G -20
+KPX A O -26
+KPX A Odieresis -26
+KPX A Q -25
+KPX A T -35
+KPX A U -33
+KPX A Uacute -33
+KPX A Ucircumflex -33
+KPX A Udieresis -33
+KPX A Ugrave -33
+KPX A V -63
+KPX A W -21
+KPX A Y -34
+KPX A a 8
+KPX A b 39
+KPX A c -12
+KPX A ccedilla -15
+KPX A comma -52
+KPX A d -4
+KPX A e -5
+KPX A g -5
+KPX A guillemotleft -44
+KPX A guilsinglleft -44
+KPX A hyphen -23
+KPX A o -11
+KPX A period -67
+KPX A q -10
+KPX A quotedblright -89
+KPX A quoteright -116
+KPX A t -25
+KPX A u -18
+KPX A v -41
+KPX A w -15
+KPX A y -41
+KPX Aacute C -24
+KPX Aacute G -20
+KPX Aacute O -26
+KPX Aacute Q -25
+KPX Aacute T -35
+KPX Aacute U -33
+KPX Aacute V -63
+KPX Aacute W -21
+KPX Aacute Y -34
+KPX Aacute a 8
+KPX Aacute b 39
+KPX Aacute c -12
+KPX Aacute comma -52
+KPX Aacute d -4
+KPX Aacute e -5
+KPX Aacute g -5
+KPX Aacute guillemotleft -44
+KPX Aacute guilsinglleft -44
+KPX Aacute hyphen -23
+KPX Aacute o -11
+KPX Aacute period -67
+KPX Aacute q -10
+KPX Aacute quoteright -116
+KPX Aacute t -25
+KPX Aacute u -18
+KPX Aacute v -41
+KPX Aacute w -15
+KPX Aacute y -41
+KPX Acircumflex C -24
+KPX Acircumflex G -20
+KPX Acircumflex O -26
+KPX Acircumflex Q -25
+KPX Acircumflex T -35
+KPX Acircumflex U -33
+KPX Acircumflex V -63
+KPX Acircumflex W -21
+KPX Acircumflex Y -34
+KPX Acircumflex comma -52
+KPX Acircumflex period -67
+KPX Adieresis C -24
+KPX Adieresis G -20
+KPX Adieresis O -26
+KPX Adieresis Q -25
+KPX Adieresis T -35
+KPX Adieresis U -33
+KPX Adieresis V -63
+KPX Adieresis W -21
+KPX Adieresis Y -34
+KPX Adieresis a 8
+KPX Adieresis b 39
+KPX Adieresis c -12
+KPX Adieresis comma -52
+KPX Adieresis d -4
+KPX Adieresis g -5
+KPX Adieresis guillemotleft -44
+KPX Adieresis guilsinglleft -44
+KPX Adieresis hyphen -23
+KPX Adieresis o -11
+KPX Adieresis period -67
+KPX Adieresis q -10
+KPX Adieresis quotedblright -89
+KPX Adieresis quoteright -116
+KPX Adieresis t -25
+KPX Adieresis u -18
+KPX Adieresis v -41
+KPX Adieresis w -15
+KPX Adieresis y -41
+KPX Agrave C -24
+KPX Agrave G -20
+KPX Agrave O -26
+KPX Agrave Q -25
+KPX Agrave T -35
+KPX Agrave U -33
+KPX Agrave V -63
+KPX Agrave W -21
+KPX Agrave Y -34
+KPX Agrave comma -52
+KPX Agrave period -67
+KPX Aring C -24
+KPX Aring G -20
+KPX Aring O -26
+KPX Aring Q -25
+KPX Aring T -35
+KPX Aring U -33
+KPX Aring V -63
+KPX Aring W -21
+KPX Aring Y -34
+KPX Aring a 8
+KPX Aring b 39
+KPX Aring c -12
+KPX Aring comma -52
+KPX Aring d -4
+KPX Aring e -5
+KPX Aring g -5
+KPX Aring guillemotleft -44
+KPX Aring guilsinglleft -44
+KPX Aring hyphen -23
+KPX Aring o -11
+KPX Aring period -67
+KPX Aring q -10
+KPX Aring quotedblright -89
+KPX Aring quoteright -116
+KPX Aring t -25
+KPX Aring u -18
+KPX Aring v -41
+KPX Aring w -15
+KPX Aring y -41
+KPX Atilde C -24
+KPX Atilde G -20
+KPX Atilde O -26
+KPX Atilde Q -25
+KPX Atilde T -35
+KPX Atilde U -33
+KPX Atilde V -63
+KPX Atilde W -21
+KPX Atilde Y -34
+KPX Atilde comma -52
+KPX Atilde period -67
+KPX B A -2
+KPX B AE -3
+KPX B Aacute -2
+KPX B Acircumflex -2
+KPX B Adieresis -2
+KPX B Aring -2
+KPX B Atilde -2
+KPX B O -14
+KPX B OE 7
+KPX B Oacute -14
+KPX B Ocircumflex -14
+KPX B Odieresis -14
+KPX B Ograve -14
+KPX B Oslash -12
+KPX B V -29
+KPX B W -10
+KPX B Y -50
+KPX C A 2
+KPX C AE 2
+KPX C Aacute 2
+KPX C Adieresis 2
+KPX C Aring 2
+KPX C H -18
+KPX C K -13
+KPX C O -19
+KPX C Oacute -19
+KPX C Odieresis -19
+KPX Ccedilla A -5
+KPX D A -32
+KPX D Aacute -32
+KPX D Acircumflex -32
+KPX D Adieresis -32
+KPX D Agrave -32
+KPX D Aring -32
+KPX D Atilde -32
+KPX D J -38
+KPX D T -36
+KPX D V -40
+KPX D W -16
+KPX D X -40
+KPX D Y -61
+KPX F A -47
+KPX F Aacute -47
+KPX F Acircumflex -47
+KPX F Adieresis -47
+KPX F Agrave -47
+KPX F Aring -47
+KPX F Atilde -47
+KPX F J -83
+KPX F O -32
+KPX F Odieresis -32
+KPX F a -44
+KPX F aacute -45
+KPX F adieresis -44
+KPX F ae -22
+KPX F aring -44
+KPX F comma -172
+KPX F e -51
+KPX F eacute -51
+KPX F hyphen -61
+KPX F i -50
+KPX F j -58
+KPX F o -55
+KPX F oacute -55
+KPX F odieresis -55
+KPX F oe -20
+KPX F oslash -55
+KPX F period -191
+KPX F r -37
+KPX F u -6
+KPX G A 0
+KPX G AE 0
+KPX G Aacute 0
+KPX G Acircumflex 0
+KPX G Adieresis 0
+KPX G Agrave 0
+KPX G Aring 0
+KPX G Atilde 0
+KPX G T -30
+KPX G V 1
+KPX G W 5
+KPX G Y -20
+KPX J A -15
+KPX J AE -24
+KPX J Adieresis -15
+KPX J Aring -15
+KPX K C -32
+KPX K G -30
+KPX K O -31
+KPX K OE -9
+KPX K Oacute -31
+KPX K Odieresis -31
+KPX K S -17
+KPX K T -20
+KPX K a -1
+KPX K adieresis -1
+KPX K ae 23
+KPX K aring -1
+KPX K e -14
+KPX K hyphen -50
+KPX K o -20
+KPX K oacute -20
+KPX K odieresis -20
+KPX K u -30
+KPX K udieresis -30
+KPX K y -56
+KPX L A 9
+KPX L AE 9
+KPX L Aacute 9
+KPX L Adieresis 9
+KPX L Aring 9
+KPX L C -19
+KPX L Ccedilla -19
+KPX L G -19
+KPX L O -16
+KPX L Oacute -16
+KPX L Ocircumflex -16
+KPX L Odieresis -16
+KPX L Ograve -16
+KPX L Otilde -16
+KPX L S -32
+KPX L T -60
+KPX L U -31
+KPX L Udieresis -31
+KPX L V -61
+KPX L W -23
+KPX L Y -59
+KPX L hyphen 5
+KPX L quotedblright -82
+KPX L quoteright -107
+KPX L u -13
+KPX L udieresis -14
+KPX L y -36
+KPX N A -10
+KPX N AE -11
+KPX N Aacute -10
+KPX N Adieresis -10
+KPX N Aring -10
+KPX N C -13
+KPX N Ccedilla -10
+KPX N G -12
+KPX N O -10
+KPX N Oacute -10
+KPX N Odieresis -10
+KPX N a -14
+KPX N aacute -15
+KPX N adieresis -14
+KPX N ae 14
+KPX N aring -14
+KPX N comma -79
+KPX N e -7
+KPX N eacute -7
+KPX N o -12
+KPX N oacute -12
+KPX N odieresis -12
+KPX N oslash -6
+KPX N period -98
+KPX N u -12
+KPX N udieresis -12
+KPX O A -21
+KPX O AE -20
+KPX O Aacute -21
+KPX O Adieresis -21
+KPX O Aring -21
+KPX O T -23
+KPX O V -32
+KPX O W -4
+KPX O X -28
+KPX O Y -51
+KPX Oacute A -21
+KPX Oacute T -23
+KPX Oacute V -32
+KPX Oacute W -4
+KPX Oacute Y -51
+KPX Ocircumflex T -23
+KPX Ocircumflex V -32
+KPX Ocircumflex Y -51
+KPX Odieresis A -21
+KPX Odieresis T -23
+KPX Odieresis V -32
+KPX Odieresis W -4
+KPX Odieresis X -28
+KPX Odieresis Y -51
+KPX Ograve T -23
+KPX Ograve V -32
+KPX Ograve Y -51
+KPX Oslash A -13
+KPX Otilde T -23
+KPX Otilde V -32
+KPX Otilde Y -51
+KPX P A -65
+KPX P AE -63
+KPX P Aacute -65
+KPX P Adieresis -65
+KPX P Aring -65
+KPX P J -80
+KPX P a -54
+KPX P aacute -54
+KPX P adieresis -54
+KPX P ae -31
+KPX P aring -54
+KPX P comma -164
+KPX P e -43
+KPX P eacute -43
+KPX P hyphen -39
+KPX P o -47
+KPX P oacute -47
+KPX P odieresis -47
+KPX P oe -18
+KPX P oslash -46
+KPX P period -183
+KPX R C -19
+KPX R Ccedilla -18
+KPX R G -18
+KPX R O -18
+KPX R OE 3
+KPX R Oacute -18
+KPX R Odieresis -18
+KPX R T -36
+KPX R U -20
+KPX R Udieresis -21
+KPX R V -34
+KPX R W -10
+KPX R Y -35
+KPX R a 7
+KPX R aacute 6
+KPX R adieresis 7
+KPX R ae 32
+KPX R aring 7
+KPX R e -4
+KPX R eacute -4
+KPX R hyphen -30
+KPX R o -9
+KPX R oacute -9
+KPX R odieresis -9
+KPX R oe 24
+KPX R u -9
+KPX R uacute -9
+KPX R udieresis -9
+KPX R y -22
+KPX S A -16
+KPX S AE -16
+KPX S Aacute -16
+KPX S Adieresis -16
+KPX S Aring -16
+KPX S T -47
+KPX S V -16
+KPX S W -15
+KPX S Y -37
+KPX S t -20
+KPX T A -35
+KPX T AE -35
+KPX T Aacute -35
+KPX T Acircumflex -35
+KPX T Adieresis -35
+KPX T Agrave -35
+KPX T Aring -35
+KPX T Atilde -35
+KPX T C -27
+KPX T G -27
+KPX T J -72
+KPX T O -22
+KPX T OE 0
+KPX T Oacute -22
+KPX T Ocircumflex -22
+KPX T Odieresis -22
+KPX T Ograve -22
+KPX T Oslash -23
+KPX T Otilde -22
+KPX T S -49
+KPX T V 4
+KPX T W -2
+KPX T Y -17
+KPX T a -39
+KPX T ae -17
+KPX T c -42
+KPX T colon -119
+KPX T comma -136
+KPX T e -31
+KPX T g -28
+KPX T guillemotleft -81
+KPX T guilsinglleft -81
+KPX T hyphen -96
+KPX T i -46
+KPX T j -53
+KPX T o -36
+KPX T oslash -36
+KPX T period -154
+KPX T r -33
+KPX T s -43
+KPX T semicolon -106
+KPX T u -1
+KPX T v 6
+KPX T w 5
+KPX T y -4
+KPX U A -23
+KPX U AE -22
+KPX U Aacute -23
+KPX U Acircumflex -23
+KPX U Adieresis -23
+KPX U Aring -23
+KPX U Atilde -23
+KPX U comma -98
+KPX U m 14
+KPX U n -10
+KPX U p -3
+KPX U period -118
+KPX U r -36
+KPX Uacute A -23
+KPX Uacute comma -98
+KPX Uacute m 14
+KPX Uacute n -10
+KPX Uacute p -3
+KPX Uacute period -118
+KPX Uacute r -36
+KPX Ucircumflex A -23
+KPX Udieresis A -23
+KPX Udieresis b 20
+KPX Udieresis comma -98
+KPX Udieresis m 14
+KPX Udieresis n -10
+KPX Udieresis p -3
+KPX Udieresis period -118
+KPX Udieresis r -36
+KPX Ugrave A -23
+KPX V A -12
+KPX V AE -21
+KPX V Aacute -12
+KPX V Acircumflex -12
+KPX V Adieresis -12
+KPX V Agrave -12
+KPX V Aring -12
+KPX V Atilde -12
+KPX V C -34
+KPX V G -34
+KPX V O -32
+KPX V Oacute -32
+KPX V Ocircumflex -32
+KPX V Odieresis -32
+KPX V Ograve -32
+KPX V Oslash -32
+KPX V Otilde -32
+KPX V S -35
+KPX V T 3
+KPX V a -59
+KPX V ae -30
+KPX V colon -139
+KPX V comma -150
+KPX V e -51
+KPX V g -50
+KPX V guillemotleft -83
+KPX V guilsinglleft -83
+KPX V hyphen -45
+KPX V i -64
+KPX V o -56
+KPX V oslash -51
+KPX V period -169
+KPX V r -51
+KPX V semicolon -127
+KPX V u -21
+KPX V y -22
+KPX W A -15
+KPX W AE -14
+KPX W Aacute -15
+KPX W Acircumflex -15
+KPX W Adieresis -15
+KPX W Agrave -15
+KPX W Aring -15
+KPX W Atilde -15
+KPX W C -9
+KPX W G -8
+KPX W O -7
+KPX W Oacute -7
+KPX W Ocircumflex -7
+KPX W Odieresis -7
+KPX W Ograve -7
+KPX W Oslash -3
+KPX W Otilde -7
+KPX W S -21
+KPX W T -1
+KPX W a -14
+KPX W ae 15
+KPX W colon -103
+KPX W comma -86
+KPX W e -6
+KPX W g -5
+KPX W guillemotleft -38
+KPX W guilsinglleft -38
+KPX W hyphen -3
+KPX W i -40
+KPX W o -11
+KPX W oslash -6
+KPX W period -105
+KPX W r -28
+KPX W semicolon -86
+KPX W u -3
+KPX W y -6
+KPX X C -33
+KPX X O -31
+KPX X Odieresis -31
+KPX X Q -30
+KPX X a -7
+KPX X e -20
+KPX X hyphen -55
+KPX X o -26
+KPX X u -36
+KPX X y -49
+KPX Y A -32
+KPX Y AE -35
+KPX Y Aacute -32
+KPX Y Acircumflex -32
+KPX Y Adieresis -32
+KPX Y Agrave -32
+KPX Y Aring -32
+KPX Y Atilde -32
+KPX Y C -54
+KPX Y G -54
+KPX Y O -52
+KPX Y Oacute -52
+KPX Y Ocircumflex -52
+KPX Y Odieresis -52
+KPX Y Ograve -52
+KPX Y Oslash -50
+KPX Y Otilde -52
+KPX Y S -55
+KPX Y T -17
+KPX Y a -61
+KPX Y ae -36
+KPX Y colon -157
+KPX Y comma -123
+KPX Y e -63
+KPX Y g -62
+KPX Y guillemotleft -99
+KPX Y guilsinglleft -99
+KPX Y hyphen -87
+KPX Y i -63
+KPX Y o -68
+KPX Y oslash -56
+KPX Y p -34
+KPX Y period -141
+KPX Y semicolon -139
+KPX Y u -48
+KPX Y v -38
+KPX Z v -47
+KPX Z y -55
+KPX a j -85
+KPX a quoteright -79
+KPX a v -25
+KPX a w -13
+KPX a y -36
+KPX aacute v -25
+KPX aacute w -13
+KPX aacute y -36
+KPX adieresis v -25
+KPX adieresis w -13
+KPX adieresis y -36
+KPX ae v 24
+KPX ae w 31
+KPX ae y 13
+KPX agrave v -25
+KPX agrave w -13
+KPX agrave y -36
+KPX aring v -25
+KPX aring w -13
+KPX aring y -36
+KPX b v -4
+KPX b w 3
+KPX b y -15
+KPX c h 8
+KPX c k 3
+KPX comma one -133
+KPX comma quotedblright -142
+KPX comma quoteright -170
+KPX e quoteright -64
+KPX e t -16
+KPX e v -14
+KPX e w -4
+KPX e x 3
+KPX e y -25
+KPX eacute v -14
+KPX eacute w -4
+KPX eacute y -25
+KPX ecircumflex v -14
+KPX ecircumflex w -4
+KPX ecircumflex y -25
+KPX eight four -63
+KPX eight one -80
+KPX eight seven -75
+KPX f a -38
+KPX f aacute -38
+KPX f adieresis -38
+KPX f ae -13
+KPX f aring -38
+KPX f e -46
+KPX f eacute -46
+KPX f f -46
+KPX f i -40
+KPX f j -63
+KPX f l -30
+KPX f o -51
+KPX f oacute -51
+KPX f odieresis -48
+KPX f oe -17
+KPX f oslash -34
+KPX f quoteright -78
+KPX f s -46
+KPX f t -10
+KPX five four -58
+KPX five one -80
+KPX five seven -80
+KPX four four -68
+KPX four one -72
+KPX four seven -100
+KPX g a -7
+KPX g adieresis -7
+KPX g ae 21
+KPX g aring -7
+KPX g e -1
+KPX g eacute -1
+KPX g l -38
+KPX g oacute -6
+KPX g odieresis -6
+KPX g r -5
+KPX guillemotright A -42
+KPX guillemotright AE -39
+KPX guillemotright Aacute -42
+KPX guillemotright Adieresis -42
+KPX guillemotright Aring -42
+KPX guillemotright T -81
+KPX guillemotright V -80
+KPX guillemotright W -35
+KPX guillemotright Y -96
+KPX guilsinglright A -42
+KPX guilsinglright AE -39
+KPX guilsinglright Aacute -42
+KPX guilsinglright Adieresis -42
+KPX guilsinglright Aring -42
+KPX guilsinglright T -81
+KPX guilsinglright V -80
+KPX guilsinglright W -35
+KPX guilsinglright Y -96
+KPX h quoteright -71
+KPX h y -29
+KPX hyphen A -21
+KPX hyphen AE -17
+KPX hyphen Aacute -21
+KPX hyphen Adieresis -21
+KPX hyphen Aring -21
+KPX hyphen T -93
+KPX hyphen V -41
+KPX hyphen W -1
+KPX hyphen Y -84
+KPX i T -64
+KPX i j -145
+KPX k a -5
+KPX k aacute -5
+KPX k adieresis -5
+KPX k ae 20
+KPX k aring -5
+KPX k comma -67
+KPX k e -17
+KPX k eacute -17
+KPX k g -16
+KPX k hyphen -53
+KPX k o -22
+KPX k oacute -22
+KPX k odieresis -22
+KPX k period -80
+KPX k s -13
+KPX k u -7
+KPX k udieresis -7
+KPX l v -77
+KPX l y -78
+KPX m p 31
+KPX m v 13
+KPX m w 22
+KPX m y 2
+KPX n T -47
+KPX n p 2
+KPX n quoteright -69
+KPX n v -17
+KPX n w -6
+KPX n y -28
+KPX nine four -59
+KPX nine one -76
+KPX nine seven -68
+KPX o T -39
+KPX o quoteright -61
+KPX o t -16
+KPX o v -10
+KPX o w -3
+KPX o x -10
+KPX o y -21
+KPX oacute v -10
+KPX oacute w -3
+KPX oacute y -21
+KPX ocircumflex t -16
+KPX odieresis t -16
+KPX odieresis v -10
+KPX odieresis w -3
+KPX odieresis x -10
+KPX odieresis y -21
+KPX ograve v -10
+KPX ograve w -3
+KPX ograve y -21
+KPX one comma -104
+KPX one eight -83
+KPX one five -63
+KPX one four -95
+KPX one nine -80
+KPX one one -68
+KPX one period -119
+KPX one seven -146
+KPX one six -107
+KPX one three -62
+KPX one two -53
+KPX one zero -95
+KPX p t -7
+KPX p y -12
+KPX period one -118
+KPX period quotedblright -137
+KPX period quoteright -165
+KPX q c 0
+KPX q u 37
+KPX quotedblbase A -10
+KPX quotedblbase AE -11
+KPX quotedblbase T -92
+KPX quotedblbase V -108
+KPX quotedblbase W -46
+KPX quotedblbase Y -80
+KPX quotedblleft A -66
+KPX quotedblleft AE -64
+KPX quotedblleft Aacute -66
+KPX quotedblleft Adieresis -66
+KPX quotedblleft Aring -66
+KPX quotedblleft T -28
+KPX quotedblleft V -20
+KPX quotedblleft W -15
+KPX quotedblleft Y -50
+KPX quotedblright A -81
+KPX quotedblright AE -79
+KPX quotedblright Aacute -81
+KPX quotedblright Adieresis -81
+KPX quotedblright Aring -81
+KPX quotedblright T -45
+KPX quotedblright V -35
+KPX quotedblright W -30
+KPX quotedblright Y -57
+KPX quoteleft A -90
+KPX quoteleft AE -88
+KPX quoteleft Aacute -90
+KPX quoteleft Adieresis -90
+KPX quoteleft Aring -90
+KPX quoteleft T -52
+KPX quoteleft V -45
+KPX quoteleft W -40
+KPX quoteleft Y -74
+KPX quoteright A -160
+KPX quoteright AE -158
+KPX quoteright Aacute -160
+KPX quoteright Adieresis -160
+KPX quoteright Aring -160
+KPX quoteright comma -234
+KPX quoteright d -146
+KPX quoteright o -148
+KPX quoteright period -251
+KPX quoteright r -155
+KPX quoteright s -154
+KPX quoteright t -121
+KPX quoteright v -114
+KPX quoteright w -109
+KPX quoteright y -120
+KPX r a -22
+KPX r aacute -22
+KPX r acircumflex -22
+KPX r adieresis -22
+KPX r ae 0
+KPX r agrave -22
+KPX r aring -22
+KPX r c -23
+KPX r ccedilla -18
+KPX r colon -100
+KPX r comma -112
+KPX r d -13
+KPX r e -11
+KPX r eacute -11
+KPX r ecircumflex -11
+KPX r egrave -11
+KPX r f -20
+KPX r g -9
+KPX r h -23
+KPX r hyphen -48
+KPX r i -30
+KPX r j -38
+KPX r k -33
+KPX r l -50
+KPX r m 31
+KPX r n 5
+KPX r o -16
+KPX r oacute -16
+KPX r ocircumflex -16
+KPX r odieresis -16
+KPX r oe 15
+KPX r ograve -16
+KPX r oslash -16
+KPX r p 25
+KPX r period -126
+KPX r q -8
+KPX r quoteright -45
+KPX r r -17
+KPX r s -25
+KPX r semicolon -88
+KPX r t 15
+KPX r u 15
+KPX r v 22
+KPX r w 21
+KPX r x 2
+KPX r y 10
+KPX r z -24
+KPX s quoteright -62
+KPX s t -14
+KPX seven colon -162
+KPX seven comma -160
+KPX seven eight -79
+KPX seven five -87
+KPX seven four -105
+KPX seven one -72
+KPX seven period -179
+KPX seven seven -69
+KPX seven six -98
+KPX seven three -78
+KPX seven two -70
+KPX six four -54
+KPX six one -60
+KPX six seven -55
+KPX t S -40
+KPX t a -21
+KPX t aacute -21
+KPX t adieresis -21
+KPX t ae 4
+KPX t aring -21
+KPX t colon -121
+KPX t e -30
+KPX t eacute -30
+KPX t h -8
+KPX t o -36
+KPX t oacute -36
+KPX t odieresis -36
+KPX t quoteright -102
+KPX t semicolon -107
+KPX three four -58
+KPX three one -79
+KPX three seven -74
+KPX two four -75
+KPX two one -73
+KPX two seven -78
+KPX u quoteright -58
+KPX v a -7
+KPX v aacute -7
+KPX v acircumflex -7
+KPX v adieresis -7
+KPX v ae 15
+KPX v agrave -7
+KPX v aring -7
+KPX v atilde -7
+KPX v c -17
+KPX v colon -86
+KPX v comma -139
+KPX v e -6
+KPX v eacute -6
+KPX v ecircumflex -6
+KPX v egrave -6
+KPX v g -2
+KPX v hyphen -28
+KPX v l -79
+KPX v o -11
+KPX v oacute -11
+KPX v odieresis -11
+KPX v ograve -11
+KPX v oslash -10
+KPX v period -159
+KPX v s -15
+KPX v semicolon -74
+KPX w a -6
+KPX w aacute -7
+KPX w acircumflex -6
+KPX w adieresis -6
+KPX w ae 22
+KPX w agrave -6
+KPX w aring -6
+KPX w atilde -6
+KPX w c -8
+KPX w colon -86
+KPX w comma -93
+KPX w e 0
+KPX w eacute 0
+KPX w ecircumflex 0
+KPX w egrave 0
+KPX w g 2
+KPX w hyphen -1
+KPX w l -51
+KPX w o -4
+KPX w oacute -4
+KPX w odieresis -4
+KPX w ograve -4
+KPX w oslash 0
+KPX w period -112
+KPX w s -13
+KPX w semicolon -74
+KPX x a -1
+KPX x c -16
+KPX x e -7
+KPX x eacute -7
+KPX x o -12
+KPX x q -9
+KPX y a -17
+KPX y aacute -18
+KPX y acircumflex -17
+KPX y adieresis -17
+KPX y ae 4
+KPX y agrave -17
+KPX y aring -17
+KPX y atilde -17
+KPX y c -25
+KPX y colon -96
+KPX y comma -137
+KPX y e -14
+KPX y eacute -14
+KPX y ecircumflex -14
+KPX y egrave -14
+KPX y g -11
+KPX y hyphen -23
+KPX y l -79
+KPX y o -20
+KPX y oacute -20
+KPX y odieresis -20
+KPX y ograve -20
+KPX y oslash -19
+KPX y period -158
+KPX y s -24
+KPX y semicolon -84
+KPX zero four -65
+KPX zero one -81
+KPX zero seven -79
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/pdf2swf/fonts/n022024l.pfb b/pdf2swf/fonts/n022024l.pfb
new file mode 100644
index 00000000..8b7c24ff
--- /dev/null
+++ b/pdf2swf/fonts/n022024l.pfb
Binary files differ
diff --git a/pdf2swf/fonts/s050000l.afm b/pdf2swf/fonts/s050000l.afm
new file mode 100644
index 00000000..d8c19362
--- /dev/null
+++ b/pdf2swf/fonts/s050000l.afm
@@ -0,0 +1,213 @@
+StartFontMetrics 3.0
+Comment Copyright URW Software, Copyright 1997 by URW
+Comment Creation Date: 10/21/1999
+Comment See the file COPYING (GNU General Public License) for license conditions.
+FontName StandardSymL
+FullName Standard Symbols L
+FamilyName Standard Symbols L
+Weight Regular
+ItalicAngle 0.0
+IsFixedPitch false
+UnderlinePosition -229
+UnderlineThickness 46
+Version 001.005
+Notice URW Software, Copyright 1997 by URW
+EncodingScheme FontSpecific
+FontBBox -180 -293 1090 1010
+CapHeight 673
+XHeight 500
+Descender -222
+Ascender 673
+StartCharMetrics 190
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 128 -13 240 686 ;
+C 34 ; WX 713 ; N universal ; B 31 0 681 673 ;
+C 35 ; WX 500 ; N numbersign ; B 20 0 481 631 ;
+C 36 ; WX 549 ; N existential ; B 25 0 478 673 ;
+C 37 ; WX 833 ; N percent ; B 63 -7 771 673 ;
+C 38 ; WX 778 ; N ampersand ; B 41 -13 750 675 ;
+C 39 ; WX 439 ; N suchthat ; B 48 -13 414 503 ;
+C 40 ; WX 333 ; N parenleft ; B 53 -172 300 680 ;
+C 41 ; WX 333 ; N parenright ; B 30 -172 277 680 ;
+C 42 ; WX 500 ; N asteriskmath ; B 65 127 427 546 ;
+C 43 ; WX 549 ; N plus ; B 10 0 539 533 ;
+C 44 ; WX 250 ; N comma ; B 56 -120 194 102 ;
+C 45 ; WX 549 ; N minus ; B 11 239 535 294 ;
+C 46 ; WX 250 ; N period ; B 69 -13 181 100 ;
+C 47 ; WX 278 ; N slash ; B 0 0 254 673 ;
+C 48 ; WX 500 ; N zero ; B 23 -13 471 686 ;
+C 49 ; WX 500 ; N one ; B 117 0 390 673 ;
+C 50 ; WX 500 ; N two ; B 25 0 475 686 ;
+C 51 ; WX 500 ; N three ; B 39 -13 435 686 ;
+C 52 ; WX 500 ; N four ; B 16 0 469 680 ;
+C 53 ; WX 500 ; N five ; B 29 -13 443 699 ;
+C 54 ; WX 500 ; N six ; B 36 -13 468 685 ;
+C 55 ; WX 500 ; N seven ; B 24 -7 448 673 ;
+C 56 ; WX 500 ; N eight ; B 54 -13 440 686 ;
+C 57 ; WX 500 ; N nine ; B 31 -13 460 686 ;
+C 58 ; WX 278 ; N colon ; B 81 -13 193 463 ;
+C 59 ; WX 278 ; N semicolon ; B 83 -120 221 463 ;
+C 60 ; WX 549 ; N less ; B 26 0 523 522 ;
+C 61 ; WX 549 ; N equal ; B 11 142 537 391 ;
+C 62 ; WX 549 ; N greater ; B 26 0 523 522 ;
+C 63 ; WX 444 ; N question ; B 70 -13 412 686 ;
+C 64 ; WX 549 ; N congruent ; B 11 0 537 475 ;
+C 65 ; WX 722 ; N Alpha ; B 4 0 684 673 ;
+C 66 ; WX 667 ; N Beta ; B 29 0 592 673 ;
+C 67 ; WX 722 ; N Chi ; B -9 0 704 673 ;
+C 68 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C 69 ; WX 611 ; N Epsilon ; B 32 0 617 673 ;
+C 70 ; WX 763 ; N Phi ; B 26 0 741 673 ;
+C 71 ; WX 603 ; N Gamma ; B 24 0 609 673 ;
+C 72 ; WX 722 ; N Eta ; B 39 0 729 673 ;
+C 73 ; WX 333 ; N Iota ; B 32 0 316 673 ;
+C 74 ; WX 631 ; N theta1 ; B 18 -13 623 686 ;
+C 75 ; WX 722 ; N Kappa ; B 35 0 722 673 ;
+C 76 ; WX 686 ; N Lambda ; B 6 0 680 688 ;
+C 77 ; WX 889 ; N Mu ; B 28 0 887 673 ;
+C 78 ; WX 722 ; N Nu ; B 29 0 720 673 ;
+C 79 ; WX 722 ; N Omicron ; B 41 -13 715 686 ;
+C 80 ; WX 768 ; N Pi ; B 25 0 745 673 ;
+C 81 ; WX 741 ; N Theta ; B 41 -13 715 686 ;
+C 82 ; WX 556 ; N Rho ; B 28 0 563 673 ;
+C 83 ; WX 592 ; N Sigma ; B 5 0 589 673 ;
+C 84 ; WX 611 ; N Tau ; B 33 0 607 673 ;
+C 85 ; WX 690 ; N Upsilon ; B -8 0 694 673 ;
+C 86 ; WX 439 ; N sigma1 ; B 40 -222 436 513 ;
+C 87 ; WX 768 ; N Omega ; B 34 0 736 686 ;
+C 88 ; WX 645 ; N Xi ; B 40 0 599 673 ;
+C 89 ; WX 795 ; N Psi ; B 15 0 781 686 ;
+C 90 ; WX 611 ; N Zeta ; B 44 0 636 673 ;
+C 91 ; WX 333 ; N bracketleft ; B 86 -165 299 673 ;
+C 92 ; WX 863 ; N therefore ; B 163 -13 701 433 ;
+C 93 ; WX 333 ; N bracketright ; B 33 -165 246 673 ;
+C 94 ; WX 658 ; N perpendicular ; B 15 0 652 673 ;
+C 95 ; WX 500 ; N underscore ; B -2 -252 502 -206 ;
+C 96 ; WX 500 ; N radicalex ; B 480 857 1090 913 ;
+C 97 ; WX 631 ; N alpha ; B 41 -13 622 513 ;
+C 98 ; WX 549 ; N beta ; B 61 -222 515 740 ;
+C 99 ; WX 549 ; N chi ; B 12 -210 522 513 ;
+C 100 ; WX 494 ; N delta ; B 40 -13 481 740 ;
+C 101 ; WX 439 ; N epsilon ; B 22 -13 427 513 ;
+C 102 ; WX 521 ; N phi ; B 27 -222 490 686 ;
+C 103 ; WX 411 ; N gamma ; B 5 -219 484 513 ;
+C 104 ; WX 603 ; N eta ; B 0 -222 527 513 ;
+C 105 ; WX 329 ; N iota ; B 0 -13 301 513 ;
+C 106 ; WX 603 ; N phi1 ; B 36 -222 587 513 ;
+C 107 ; WX 549 ; N kappa ; B 33 0 558 513 ;
+C 108 ; WX 549 ; N lambda ; B 24 -13 548 740 ;
+C 109 ; WX 576 ; N mu ; B 33 -219 567 500 ;
+C 110 ; WX 521 ; N nu ; B -9 -13 475 513 ;
+C 111 ; WX 549 ; N omicron ; B 35 -13 501 513 ;
+C 112 ; WX 549 ; N pi ; B 10 -13 530 500 ;
+C 113 ; WX 521 ; N theta ; B 43 -13 485 686 ;
+C 114 ; WX 549 ; N rho ; B 50 -220 490 513 ;
+C 115 ; WX 603 ; N sigma ; B 30 -13 588 500 ;
+C 116 ; WX 439 ; N tau ; B 10 -13 418 500 ;
+C 117 ; WX 576 ; N upsilon ; B 7 -13 535 513 ;
+C 118 ; WX 713 ; N omega1 ; B 12 -13 671 583 ;
+C 119 ; WX 686 ; N omega ; B 42 -13 684 513 ;
+C 120 ; WX 493 ; N xi ; B 27 -222 469 766 ;
+C 121 ; WX 686 ; N psi ; B 12 -222 701 513 ;
+C 122 ; WX 494 ; N zeta ; B 60 -222 467 756 ;
+C 123 ; WX 480 ; N braceleft ; B 58 -165 397 673 ;
+C 124 ; WX 200 ; N bar ; B 65 -177 135 673 ;
+C 125 ; WX 480 ; N braceright ; B 79 -165 418 673 ;
+C 126 ; WX 549 ; N similar ; B 17 196 529 325 ;
+C 160 ; WX 762 ; N Euro ; B 53 -4 722 671 ;
+C 161 ; WX 620 ; N Upsilon1 ; B -2 0 610 687 ;
+C 162 ; WX 247 ; N minute ; B 27 476 228 735 ;
+C 163 ; WX 549 ; N lessequal ; B 29 0 526 639 ;
+C 164 ; WX 167 ; N fraction ; B -180 0 340 673 ;
+C 165 ; WX 713 ; N infinity ; B 26 115 688 414 ;
+C 166 ; WX 500 ; N florin ; B 2 -174 494 687 ;
+C 167 ; WX 753 ; N club ; B 86 -26 660 544 ;
+C 168 ; WX 753 ; N diamond ; B 142 -36 600 550 ;
+C 169 ; WX 753 ; N heart ; B 117 -33 631 528 ;
+C 170 ; WX 753 ; N spade ; B 113 -36 629 591 ;
+C 171 ; WX 1042 ; N arrowboth ; B 24 -16 1024 512 ;
+C 172 ; WX 987 ; N arrowleft ; B 32 -15 942 511 ;
+C 173 ; WX 603 ; N arrowup ; B 45 0 571 910 ;
+C 174 ; WX 987 ; N arrowright ; B 49 -15 959 511 ;
+C 175 ; WX 603 ; N arrowdown ; B 45 -22 571 888 ;
+C 176 ; WX 400 ; N degree ; B 50 380 350 686 ;
+C 177 ; WX 549 ; N plusminus ; B 10 0 539 662 ;
+C 178 ; WX 411 ; N second ; B 20 476 413 735 ;
+C 179 ; WX 549 ; N greaterequal ; B 29 0 526 639 ;
+C 180 ; WX 549 ; N multiply ; B 17 9 533 525 ;
+C 181 ; WX 713 ; N proportional ; B 27 114 639 416 ;
+C 182 ; WX 494 ; N partialdiff ; B 26 -10 462 753 ;
+C 183 ; WX 460 ; N bullet ; B 50 155 410 518 ;
+C 184 ; WX 549 ; N divide ; B 10 2 536 525 ;
+C 185 ; WX 549 ; N notequal ; B 15 -25 540 549 ;
+C 186 ; WX 549 ; N equivalence ; B 14 87 538 446 ;
+C 187 ; WX 549 ; N approxequal ; B 14 121 527 408 ;
+C 188 ; WX 1000 ; N ellipsis ; B 111 -13 889 100 ;
+C 189 ; WX 603 ; N arrowvertex ; B 280 -120 336 1010 ;
+C 190 ; WX 1000 ; N arrowhorizex ; B -60 220 1050 276 ;
+C 191 ; WX 658 ; N carriagereturn ; B 15 -16 602 629 ;
+C 192 ; WX 823 ; N aleph ; B 175 0 662 689 ;
+C 193 ; WX 686 ; N Ifraktur ; B 10 -54 578 736 ;
+C 194 ; WX 795 ; N Rfraktur ; B 26 -16 759 730 ;
+C 195 ; WX 987 ; N weierstrass ; B 159 -211 870 574 ;
+C 196 ; WX 768 ; N circlemultiply ; B 43 0 733 691 ;
+C 197 ; WX 768 ; N circleplus ; B 43 0 733 689 ;
+C 198 ; WX 823 ; N emptyset ; B 39 -24 781 718 ;
+C 199 ; WX 768 ; N intersection ; B 40 0 732 507 ;
+C 200 ; WX 768 ; N union ; B 40 -18 732 489 ;
+C 201 ; WX 713 ; N propersuperset ; B 20 0 673 470 ;
+C 202 ; WX 713 ; N reflexsuperset ; B 20 -125 673 470 ;
+C 203 ; WX 713 ; N notsubset ; B 36 -70 690 540 ;
+C 204 ; WX 713 ; N propersubset ; B 37 0 690 470 ;
+C 205 ; WX 713 ; N reflexsubset ; B 37 -125 690 470 ;
+C 206 ; WX 713 ; N element ; B 45 0 505 470 ;
+C 207 ; WX 713 ; N notelement ; B 45 -58 505 555 ;
+C 208 ; WX 768 ; N angle ; B 26 -1 738 672 ;
+C 209 ; WX 713 ; N gradient ; B 36 0 681 687 ;
+C 210 ; WX 790 ; N registerserif ; B 50 -13 740 690 ;
+C 211 ; WX 790 ; N copyrightserif ; B 51 -13 741 690 ;
+C 212 ; WX 890 ; N trademarkserif ; B 18 269 855 673 ;
+C 213 ; WX 823 ; N product ; B 25 -124 803 751 ;
+C 214 ; WX 549 ; N radical ; B 10 -35 515 913 ;
+C 215 ; WX 250 ; N dotmath ; B 69 209 169 311 ;
+C 216 ; WX 713 ; N logicalnot ; B 15 40 680 367 ;
+C 217 ; WX 603 ; N logicaland ; B 23 -1 583 476 ;
+C 218 ; WX 603 ; N logicalor ; B 30 -1 578 476 ;
+C 219 ; WX 1042 ; N arrowdblboth ; B 27 -19 1023 506 ;
+C 220 ; WX 987 ; N arrowdblleft ; B 30 -19 939 506 ;
+C 221 ; WX 603 ; N arrowdblup ; B 39 0 567 909 ;
+C 222 ; WX 987 ; N arrowdblright ; B 45 -19 954 506 ;
+C 223 ; WX 603 ; N arrowdbldown ; B 44 0 572 909 ;
+C 224 ; WX 494 ; N lozenge ; B 18 -1 466 740 ;
+C 225 ; WX 329 ; N angleleft ; B 25 -152 306 757 ;
+C 226 ; WX 790 ; N registersans ; B 50 -12 740 679 ;
+C 227 ; WX 790 ; N copyrightsans ; B 49 -12 739 679 ;
+C 228 ; WX 786 ; N trademarksans ; B 5 277 725 673 ;
+C 229 ; WX 713 ; N summation ; B 14 -123 695 752 ;
+C 230 ; WX 384 ; N parenlefttp ; B 40 -293 436 926 ;
+C 231 ; WX 384 ; N parenleftex ; B 40 -79 92 925 ;
+C 232 ; WX 384 ; N parenleftbt ; B 40 -293 436 926 ;
+C 233 ; WX 384 ; N bracketlefttp ; B 0 -80 341 926 ;
+C 234 ; WX 384 ; N bracketleftex ; B 0 -85 55 925 ;
+C 235 ; WX 384 ; N bracketleftbt ; B 0 -80 340 926 ;
+C 236 ; WX 494 ; N bracelefttp ; B 201 -75 439 926 ;
+C 237 ; WX 494 ; N braceleftmid ; B 14 -85 255 935 ;
+C 238 ; WX 494 ; N braceleftbt ; B 201 -70 439 926 ;
+C 239 ; WX 494 ; N braceex ; B 201 -79 255 925 ;
+C 241 ; WX 329 ; N angleright ; B 21 -152 302 757 ;
+C 242 ; WX 274 ; N integral ; B 2 -107 291 916 ;
+C 243 ; WX 686 ; N integraltp ; B 332 -83 715 922 ;
+C 244 ; WX 686 ; N integralex ; B 332 -88 415 975 ;
+C 245 ; WX 686 ; N integralbt ; B 39 -81 415 921 ;
+C 246 ; WX 384 ; N parenrighttp ; B 54 -293 450 926 ;
+C 247 ; WX 384 ; N parenrightex ; B 398 -70 450 935 ;
+C 248 ; WX 384 ; N parenrightbt ; B 54 -293 450 926 ;
+C 249 ; WX 384 ; N bracketrighttp ; B 22 -80 360 926 ;
+C 250 ; WX 384 ; N bracketrightex ; B 305 -85 360 925 ;
+C 251 ; WX 384 ; N bracketrightbt ; B 20 -80 360 926 ;
+C 252 ; WX 494 ; N bracerighttp ; B 17 -75 255 926 ;
+C 253 ; WX 494 ; N bracerightmid ; B 201 -85 442 935 ;
+C 254 ; WX 494 ; N bracerightbt ; B 17 -70 255 926 ;
+C -1 ; WX 250 ; N .notdef ; B 0 0 0 0 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/pdf2swf/fonts/s050000l.pfb b/pdf2swf/fonts/s050000l.pfb
new file mode 100644
index 00000000..d0505e46
--- /dev/null
+++ b/pdf2swf/fonts/s050000l.pfb
Binary files differ
diff --git a/pdf2swf/pdf2swf.1 b/pdf2swf/pdf2swf.1
new file mode 100644
index 00000000..f17bc616
--- /dev/null
+++ b/pdf2swf/pdf2swf.1
@@ -0,0 +1,37 @@
+.TH pdf2swf "1" "October 2001" "pdf2swf" "swftools"
+.SH NAME
+pdf2swf - convert PDF files into SWF
+.SH Synopsis
+.B pdf2swf
+[\fIoptions\fR] \fIfile.pdf\fR [\fIfile.swf\fR]
+.SH DESCRIPTION
+This tools attempts to convert Acrobat PDF files into Flash SWF Animation
+files.
+.SH OPTIONS
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Print short help message and exit
+.\".TP
+.\" \fB\-\-version\fR
+.\" Print version info and exit
+.TP
+\fB\-p\fR, \fB\-\-pages\fR \fIrange\fR
+Convert only pages in \fIrange\fR with \fIrange\fR e.g. 1-20 or 1,4,6,9-11 or
+3-5,10-12
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+Be verbose. Use more than one -v for greater effect.
+.SH NOTES
+Every page in the PDF will be a frame in the SWF. This means the generated
+SWF must be inserted into some wrapper SWF if the SWF needs to be
+browsed. See the documentation of
+\fIswfcombine\fR for information about how to insert SWFs into one another.
+.SH BUGS
+.PP
+type 3 and some truetype fonts don't work yet
+.PP
+Output files tend to be a little big
+
+.SH AUTHOR
+
+Matthias Kramm <kramm@quiss.org>
diff --git a/pdf2swf/pdf2swf.cc b/pdf2swf/pdf2swf.cc
new file mode 100644
index 00000000..0d817962
--- /dev/null
+++ b/pdf2swf/pdf2swf.cc
@@ -0,0 +1,249 @@
+/* pdf2swf.cc
+ main routine for pdf2swf(1)
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include "../config.h"
+#include "args.h"
+#include "pdfswf.h"
+#include "t1lib.h"
+extern "C" {
+#include "log.h"
+}
+
+static char * outputname = 0;
+static int loglevel = 3;
+static char * pagerange = 0;
+static char * filename = 0;
+static char * password = 0;
+
+int args_callback_option(char*name,char*val) {
+ if (!strcmp(name, "o"))
+ {
+ outputname = val;
+ return 1;
+ }
+ else if (!strcmp(name, "v"))
+ {
+ loglevel ++;
+ return 0;
+ }
+ else if (name[0]=='p')
+ {
+ /* check whether the page range follows the p directly, like
+ in -p1,2 */
+ do {
+ name++;
+ } while(*name == 32 || *name == 13 || *name == 10 || *name == '\t');
+
+ if(*name) {
+ pagerange = name;
+ return 0;
+ }
+ pagerange = val;
+ return 1;
+ }
+ else if (!strcmp(name, "P"))
+ {
+ password = val;
+ return 1;
+ }
+ else if (!strcmp(name, "V"))
+ {
+ printf("pdf2swf - part of %s %s\n", PACKAGE, VERSION);
+ exit(0);
+ }
+ else
+ {
+ fprintf(stderr, "Unknown option: -%s\n", name);
+ exit(1);
+ }
+ return 0;
+}
+
+struct options_t
+{
+ char shortoption;
+ char*longoption;
+} options[] =
+{{'o',"output"},
+ {'V',"version"},
+ {'p',"pages"}
+};
+
+int args_callback_longoption(char*name,char*val) {
+ int t;
+ char*equal = strchr(name,'=');
+ if (equal) {
+ *equal = 0;
+ equal++;
+ }
+ for(t=0;t<sizeof(options)/sizeof(struct options_t);t++) {
+ if(!strcmp(options[t].longoption, name)) {
+ char*tmp = (char*)malloc(strlen(equal)+strlen(name)+2);
+ tmp[0] = options[t].shortoption;
+ tmp[1] = 0;
+ if(equal) {
+ strcpy(&tmp[1], equal);
+ }
+ return args_callback_option(tmp,val);
+ }
+ }
+ fprintf(stderr, "Unknown option: %s\n", name);
+ exit(1);
+}
+
+int args_callback_command(char*name, char*val) {
+ if (!filename)
+ filename = name;
+ else {
+ if(outputname)
+ {
+ fprintf(stderr, "Error: Do you want the output to go to %s or to %s?",
+ outputname, name);
+ exit(1);
+ }
+ outputname = name;
+ }
+ return 0;
+}
+
+void args_callback_usage(char*name)
+{
+ printf("Usage: %s [-p range] [-P password] input.pdf [output.swf]\n", name);
+ printf("\n");
+ printf("-p range (range) Convert only pages in range\n");
+ printf("-P password (password) Use password for deciphering the pdf\n");
+ printf("\n");
+}
+
+/* check whether the value t is in a given range.
+ examples: 3 is in range 1-10: true
+ 7 is in range 2-4,6,8-10: false
+ 9 is in range 1,2,3-12: true
+*/
+char is_in_range(int t, char*irange)
+{
+ char*pos = irange;
+ char*digits;
+ int num;
+ char range = 0;
+ int last=0;
+ char tmp;
+
+ if(!irange) // no range resembles (-OO,OO)
+ return 1;
+
+ while(*pos)
+ {
+ while(*pos == ' ' || *pos == '\r' || *pos == '\n' || *pos == '\t')
+ pos++;
+
+ digits = pos;
+ while(*digits>='0' && *digits<='9')
+ digits++;
+ if(digits == pos) {
+ fprintf(stderr, "Error: \"%s\" is not a valid format (digit expected)\n",irange);
+ exit(1);
+ }
+
+ tmp=*digits;*digits=0;
+ num = atoi(pos);
+ *digits=tmp;
+ pos = digits;
+
+ while(*pos == ' ' || *pos == '\r' || *pos == '\n' || *pos == '\t')
+ pos++;
+
+ if(range && last<=t && num>=t)
+ return 1;
+ if(range) {
+ range = 0;
+ if(*pos)
+ pos ++;
+ continue;
+ }
+
+ if(*pos=='-')
+ {
+ if(range) {
+ fprintf(stderr, "Error: \"%s\" is not a valid format (too many '-'s)\n",irange);
+ exit(1);
+ }
+ last = num;
+ range = 1;
+ if(*pos)
+ pos ++;
+ continue;
+ }
+ else
+ {
+ /* if it isn't a '-', we assume it is a seperator like
+ ',', ';', ':', whatever. */
+ if(t == num)
+ return 1;
+ if(*pos)
+ pos ++;
+ continue;
+ }
+ }
+ if(range && last<=t)
+ return 1;
+ return 0;
+}
+
+int main(int argn, char *argv[])
+{
+ processargs(argn, argv);
+ initLog(0,-1,0,0,-1,loglevel);
+
+ // test if the page range is o.k.
+ is_in_range(0x7fffffff, pagerange);
+
+ if (!filename) {
+ args_callback_usage(argv[0]);
+ exit(0);
+ }
+
+ logf("<verbose> reading data files from %s\n", DATADIR);
+ //TODO: use tempnam here. Check if environment already contains a
+ //T1LIB_CONFIG.
+ putenv( "T1LIB_CONFIG=/tmp/t1lib.config.tmp");
+ FILE*fi = fopen("/tmp/t1lib.config.tmp", "wb");
+ fprintf(fi, "FONTDATABASE=%s/FontDataBase\n", DATADIR);
+ fprintf(fi, "ENCODING=%s:.\n", DATADIR);
+ fprintf(fi, "AFM=%s:.\n", DATADIR);
+ fprintf(fi, "TYPE1=%s:.\n", DATADIR);
+ fclose(fi);
+ /* initialize t1lib */
+ T1_SetBitmapPad( 16);
+ if ((T1_InitLib(NO_LOGFILE)==NULL)){
+ fprintf(stderr, "Initialization of t1lib failed\n");
+ exit(1);
+ }
+ unlink("/tmp/t1lib.config.tmp");
+
+ pdfswf_init(filename, password);
+ pdfswf_setoutputfilename(outputname);
+
+ int pages = pdfswf_numpages();
+ int t = 1;
+ for(t = 1; t <= pages; t++)
+ {
+ if(is_in_range(t, pagerange))
+ pdfswf_convertpage(t);
+ }
+
+ pdfswf_close();
+ return 0;
+}
+
+
diff --git a/pdf2swf/spline.cc b/pdf2swf/spline.cc
new file mode 100644
index 00000000..a0aed8dd
--- /dev/null
+++ b/pdf2swf/spline.cc
@@ -0,0 +1,140 @@
+/* spline.cc
+ Routine to convert cubic splines into quadratic ones.
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+/* At the moment, we convert non-recursively into at max. 6 quadratic splines,
+ trying to maintain the general structure of the curve, rather than it's
+ exact path.
+ To accomplish this, we split each curve at it's X,Y extremas as well as
+ its deviation's X,Y extremas.
+ */
+
+#include <math.h>
+#include "spline.h"
+
+int solve(double a,double b,double c, double*dd)
+{
+ double det=b*b-4*a*c;
+ int pos = 0;
+ if(det<0) return 0; // we don't do imaginary. not today.
+ if(det==0) { // unlikely, but we have to deal with it.
+ dd[0]=-b/2*a;
+ return (dd[0]>0 && dd[0]<1);
+ }
+
+ dd[pos]=(-b+sqrt(det))/(2*a);
+ if(dd[pos]>0 && dd[pos]<1)
+ pos++;
+ dd[pos]=(-b-sqrt(det))/(2*a);
+ if(dd[pos]>0 && dd[pos]<1)
+ pos++;
+ return pos;
+}
+
+struct plotxy splinepos(struct plotxy p0, struct plotxy p1, struct plotxy p2, struct plotxy p3, double d) {
+ struct plotxy p;
+ p.x = (p0.x * d*d*d + p1.x * 3*(1-d)*d*d + p2.x * 3*(1-d)*(1-d)*d + p3.x * (1-d)*(1-d)*(1-d));
+ p.y = (p0.y * d*d*d + p1.y * 3*(1-d)*d*d + p2.y * 3*(1-d)*(1-d)*d + p3.y * (1-d)*(1-d)*(1-d));
+ return p;
+}
+
+double distance(struct plotxy p0, struct plotxy p1)
+{
+ double xd=p1.x-p0.x;
+ double yd=p1.y-p0.y;
+ return sqrt(xd*xd+yd*yd);
+}
+
+int wp(double p0,double p1,double p2,double p3,double*dd)
+{
+ double div= (6*p0-18*p1+18*p2-6*p3);
+ if(!div) return 0;
+ dd[0] = -(6*p1-12*p2+6*p3)/div;
+ return (dd[0]>0 && dd[0]<1);
+}
+
+int approximate(struct plotxy p0, struct plotxy p1,
+ struct plotxy p2, struct plotxy p3, struct qspline*q)
+{
+ double roots[12];
+ int pos = 0;
+ int s,t;
+ struct plotxy myxy[12];
+ struct plotxy last;
+ // the parameters for the solve function are the 1st deviation of a cubic spline
+ roots[pos] = 0;pos++;
+ pos += solve(3*p0.x-9*p1.x+9*p2.x-3*p3.x, 6*p1.x-12*p2.x+6*p3.x,3*p2.x-3*p3.x, &roots[pos]);
+ pos += solve(3*p0.y-9*p1.y+9*p2.y-3*p3.y, 6*p1.y-12*p2.y+6*p3.y,3*p2.y-3*p3.y, &roots[pos]);
+ pos += wp(p0.x,p1.x,p2.x,p3.x,&roots[pos]);
+ pos += wp(p0.x,p1.x,p2.x,p3.x,&roots[pos]);
+ roots[pos] = 1;pos++;
+
+ // bubblesort - fast enough for 4-6 parameters
+ for(s=0;s<pos;s++)
+ for(t=s+1;t<pos;t++)
+ if(roots[s]>roots[t])
+ {
+ double tmp=roots[s];
+ roots[s]=roots[t];
+ roots[t]=tmp;
+ }
+ for(t=0;t<pos;t++)
+ myxy[t] = splinepos(p0,p1,p2,p3,roots[t]);
+
+ s=1;
+ last = myxy[0];
+ for(t=1;t<pos;t++)
+ {
+ double dist=distance(myxy[t],last);
+ myxy[s]=myxy[t];
+ roots[s]=roots[t];
+ if(dist>0.01 || t==pos-1)
+ {
+ s++;
+ last=myxy[t];
+ }
+ }
+ pos = s;
+
+ // try 1:curve through 3 points, using the middle of the cubic spline.
+ for(t=0;t<pos-1;t++) {
+// circle(myxy[t].x,myxy[t].y,5);
+ struct plotxy control;
+ struct plotxy midpoint = splinepos(p0,p1,p2,p3,(roots[t]+roots[t+1])/2);
+ control.x = midpoint.x + (midpoint.x-(myxy[t].x+myxy[t+1].x)/2);
+ control.y = midpoint.y + (midpoint.y-(myxy[t].y+myxy[t+1].y)/2);
+ //qspline(myxy[t],control,myxy[t+1]);
+ q[t].start=myxy[t];
+ q[t].control=control;
+ q[t].end=myxy[t+1];
+ }
+
+ /*
+ for(t=0;t<pos-1;t++) {
+ plotxy control;
+ vga.setcolor(0xffffff);
+ circle(myxy[t].x,myxy[t].y,5);
+ if(t==0) {
+ //double lenmain = distance(p3,p0);
+ //double lenq = distance(myxy[0],myxy[1]);
+ //control.x = myxy[0].x + (p2.x-p3.x);// /lenmain*lenq;
+ //control.y = myxy[0].y + (p2.y-p3.y);// /lenmain*lenq;
+ plotxy midpoint = splinepos(p0,p1,p2,p3,(roots[t]+roots[t+1])/2);
+ control.x = midpoint.x + (midpoint.x-(myxy[t].x+myxy[t+1].x)/2);
+ control.y = midpoint.y + (midpoint.y-(myxy[t].y+myxy[t+1].y)/2);
+ qspline(myxy[0], control, myxy[1]);
+ } else {
+ control.x = 2*myxy[t].x - last.x;
+ control.y = 2*myxy[t].y - last.y;
+ qspline(myxy[t], control, myxy[t+1]);
+ }
+ last = control;
+ }*/
+ return pos-1;
+}
+
diff --git a/pdf2swf/spline.h b/pdf2swf/spline.h
new file mode 100644
index 00000000..f9549cc6
--- /dev/null
+++ b/pdf2swf/spline.h
@@ -0,0 +1,36 @@
+/* spline.h
+ Header file for spline.cc
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#ifndef __spline_h__
+#define __spline_h__
+
+struct plotxy
+{
+ double x,y;
+};
+
+struct qspline
+{
+ struct plotxy start;
+ struct plotxy control;
+ struct plotxy end;
+};
+
+struct cspline
+{
+ struct plotxy start;
+ struct plotxy control1;
+ struct plotxy control2;
+ struct plotxy end;
+};
+
+int approximate(struct plotxy p0, struct plotxy p1,
+ struct plotxy p2, struct plotxy p3, struct qspline*q);
+
+#endif// __spline_h__
diff --git a/pdf2swf/swfoutput.cc b/pdf2swf/swfoutput.cc
new file mode 100644
index 00000000..8636bba4
--- /dev/null
+++ b/pdf2swf/swfoutput.cc
@@ -0,0 +1,594 @@
+/* swfoutput.cc
+ Implements generation of swf files using the rfxswf lib. The routines
+ in this file are called from pdf2swf.
+
+ This file is part of swftools.
+
+ Swftools is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Swftools is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with swftools; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include "swfoutput.h"
+#include "spline.h"
+extern "C" {
+#include "../lib/log.h"
+#include "../lib/rfxswf.h"
+}
+
+typedef unsigned char u8;
+typedef unsigned short int u16;
+typedef unsigned long int u32;
+
+static int fi;
+static int flag_protected;
+static SWF swf;
+static TAG *tag;
+static int shapeid = -1;
+static int shapecount = 0;
+static SHAPE* shape;
+static int fillstyleid;
+static int linestyleid;
+static int swflastx=0;
+static int swflasty=0;
+static int lastwasfill = 0;
+static char* filename = 0;
+static int sizex;
+static int sizey;
+static char fill = 0;
+static int depth = 1;
+static int startdepth = 1;
+TAG* cliptags[128];
+int clipshapes[128];
+u32 clipdepths[128];
+int clippos = 0;
+
+void startshape(struct swfoutput* obj);
+
+// matrix multiplication. changes p0
+void transform (plotxy*p0,struct swfmatrix*m)
+{
+ double x,y;
+ x = m->m11*p0->x+m->m12*p0->y;
+ y = m->m21*p0->x+m->m22*p0->y;
+ p0->x = x + m->m13;
+ p0->y = y + m->m23;
+}
+
+// write a move-to command into the swf
+void moveto(plotxy p0)
+{
+ int rx = (int)(p0.x*20);
+ int ry = (int)(p0.y*20);
+ if(rx!=swflastx || ry!=swflasty) {
+ ShapeSetMove (tag, shape, rx,ry);
+ }
+ swflastx=rx;
+ swflasty=ry;
+}
+
+// write a line-to command into the swf
+void lineto(plotxy p0)
+{
+ int rx = ((int)(p0.x*20)-swflastx);
+ int ry = ((int)(p0.y*20)-swflasty);
+ /* we can't skip this for rx=0,ry=0, those
+ are plots */
+ ShapeSetLine (tag, shape, rx,ry);
+ swflastx+=rx;
+ swflasty+=ry;
+}
+
+// write a spline-to command into the swf
+void splineto(plotxy control,plotxy end)
+{
+ int cx = ((int)(control.x*20)-swflastx);
+ int cy = ((int)(control.y*20)-swflasty);
+ swflastx += cx;
+ swflasty += cy;
+ int ex = ((int)(end.x*20)-swflastx);
+ int ey = ((int)(end.y*20)-swflasty);
+ swflastx += ex;
+ swflasty += ey;
+ ShapeSetCurve(tag, shape, cx,cy,ex,ey);
+}
+
+/* write a line, given two points and the transformation
+ matrix. */
+void line(plotxy p0, plotxy p1, struct swfmatrix*m)
+{
+ transform(&p0,m);
+ transform(&p1,m);
+ moveto(p0);
+ lineto(p1);
+}
+
+/* write a cubic (!) spline. This involves calling the approximate()
+ function out of spline.cc to convert it to a quadratic spline. */
+void spline(plotxy p0,plotxy p1,plotxy p2,plotxy p3,struct swfmatrix*m)
+{
+ double d;
+ struct qspline q[16];
+ int num;
+ int t;
+ transform(&p0,m);
+ transform(&p1,m);
+ transform(&p2,m);
+ transform(&p3,m);
+
+ num = approximate(p0,p1,p2,p3,q);
+ for(t=0;t<num;t++) {
+ moveto(q[t].start);
+ splineto(q[t].control, q[t].end);
+ }
+}
+
+/* Adds an outline to a font. Applies only the 2x2 component of the transformation matrix.
+ */
+void addtofont(T1_OUTLINE*outline, struct swfmatrix*m, char*namehint)
+{
+}
+
+/* draw a T1 outline. These are generated by pdf2swf and by t1lib.
+ (representing characters) */
+void drawpath(T1_OUTLINE*outline, struct swfmatrix*m, char*namehint)
+{
+ double x=0,y=0;
+ double lastx=0,lasty=0;
+
+ while (outline)
+ {
+ logf("<debug> Pathtype:%s",outline->type == T1_PATHTYPE_MOVE?"MOVE":
+ (outline->type == T1_PATHTYPE_LINE?"LINE"
+ :"BEZIER"));
+ logf("<debug> relative coordinates: %08x,%08x", outline->dest.x, outline->dest.y);
+ x += (outline->dest.x/(float)0xffff);
+ y += (outline->dest.y/(float)0xffff);
+ logf("<debug> coordinates: %f,%f", x, y);
+ if(outline->type == T1_PATHTYPE_MOVE)
+ {
+ }
+ else if(outline->type == T1_PATHTYPE_LINE)
+ {
+ plotxy p0;
+ plotxy p1;
+ p0.x=lastx;
+ p0.y=lasty;
+ p1.x=x;
+ p1.y=y;
+ line(p0,p1,m);
+ }
+ else if(outline->type == T1_PATHTYPE_BEZIER)
+ {
+ plotxy p0;
+ plotxy p1;
+ plotxy p2;
+ plotxy p3;
+ T1_BEZIERSEGMENT*o2 = (T1_BEZIERSEGMENT*)outline;
+ p0.x=x;
+ p0.y=y;
+ p1.x=o2->C.x/(float)0xffff+lastx;
+ p1.y=o2->C.y/(float)0xffff+lasty;
+ p2.x=o2->B.x/(float)0xffff+lastx;
+ p2.y=o2->B.y/(float)0xffff+lasty;
+ p3.x=lastx;
+ p3.y=lasty;
+ spline(p0,p1,p2,p3,m);
+ }
+ else {
+ logf("<error> drawpath: unknown outline type:%d\n", outline->type);
+ }
+ lastx=x;
+ lasty=y;
+ outline = outline->link;
+ }
+}
+
+/* process a character. */
+void drawchar(struct swfoutput*obj, int t1fontindex, char character, swfmatrix*m)
+{
+
+ /* <T1 stuff> */
+ T1_OUTLINE*outline;
+ int width = T1_GetCharWidth(t1fontindex, character);
+ BBox bbox = T1_GetCharBBox(t1fontindex, character);
+ char*charname= T1_GetCharName(t1fontindex, character);
+ logf("<debug> Font name is %s", T1_GetFontFileName(t1fontindex));
+ logf("<debug> char 0x%02x is named %s\n",character,charname);
+ logf("<debug> bbox: %d %d %d %d\n",bbox.llx,bbox.lly,bbox.urx,bbox.ury);
+ if(!charname || charname[0] == '.')
+ {
+ /* for newline, we don't print an error. FIXME: We shouldn't get newlines here
+ in the first place
+ */
+ if(character != '\n') {
+ logf("<error> Char to set is not defined!");
+ logf("<error> - font file is %s\n", T1_GetFontFileName(t1fontindex));
+ logf("<error> - char 0x%02x is named %s\n",character,charname);
+ }
+ return;
+ }
+ swfmatrix m2=*m;
+ m2.m11/=100;
+ m2.m21/=100;
+ m2.m12/=100;
+ m2.m22/=100;
+ outline = T1_GetCharOutline( t1fontindex, character, 100.0, 0);
+
+ /** </T1 stuff> **/
+
+ if(shapeid<0)
+ startshape(obj);
+
+ if(!lastwasfill)
+ ShapeSetStyle(tag,shape,0x8000,fillstyleid,0);
+ lastwasfill = 1;
+
+ drawpath(outline, &m2, charname);
+}
+
+/* draw a curved polygon. */
+void swfoutput_drawpath(swfoutput*output, T1_OUTLINE*outline, struct swfmatrix*m)
+{
+ if(shapeid<0)
+ startshape(output);
+
+ if(lastwasfill && !fill)
+ {
+ ShapeSetStyle(tag,shape,linestyleid,0x8000,0);
+ lastwasfill = 0;
+ }
+ if(!lastwasfill && fill)
+ {
+ ShapeSetStyle(tag,shape,0x8000,fillstyleid,0);
+ lastwasfill = 1;
+ }
+
+ drawpath(outline,m, 0);
+}
+
+
+/* set's the t1 font index of the font to use for swfoutput_drawchar(). */
+int swfoutput_setfont(struct swfoutput*obj, int t1id)
+{
+ obj->t1font = t1id;
+}
+
+/* set's the matrix which is to be applied to characters drawn by
+ swfoutput_drawchar() */
+void swfoutput_setfontmatrix(struct swfoutput*obj,double m11,double m12,
+ double m21,double m22)
+{
+ obj->fontm11 = m11;
+ obj->fontm12 = m12;
+ obj->fontm21 = m21;
+ obj->fontm22 = m22;
+}
+
+/* draws a character at x,y. */
+void swfoutput_drawchar(struct swfoutput* obj,double x,double y,char character)
+{
+ swfmatrix m;
+ m.m11 = obj->fontm11;
+ m.m12 = obj->fontm12;
+ m.m21 = obj->fontm21;
+ m.m22 = obj->fontm22;
+ m.m13 = x;
+ m.m23 = y;
+ drawchar(obj, obj->t1font, character, &m);
+}
+
+/* initialize the swf writer */
+void swfoutput_init(struct swfoutput* obj, char*_filename, int _sizex, int _sizey)
+{
+ GLYPH *glyph;
+ RGBA rgb;
+ SRECT r;
+ memset(obj, 0, sizeof(struct swfoutput));
+ filename = _filename;
+ sizex = _sizex;
+ sizey = _sizey;
+
+ logf("<verbose> initializing swf output for size %d*%d\n", sizex,sizey);
+
+ obj->t1font = 0;
+
+ memset(&swf,0x00,sizeof(SWF));
+
+ swf.FileVersion = 4;
+// swf.FrameRate = 0x1900;
+ swf.FrameRate = 0x0040; // 1 frame per 4 seconds
+ swf.MovieSize.xmax = 20*sizex;
+ swf.MovieSize.ymax = 20*sizey;
+
+ swf.FirstTag = InsertTag(NULL,ST_SETBACKGROUNDCOLOR);
+ tag = swf.FirstTag;
+ rgb.r = 0xff;
+ rgb.g = 0xff;
+ rgb.b = 0xff;
+ SetRGB(tag,&rgb);
+ if(flag_protected)
+ tag = InsertTag(tag, ST_PROTECT);
+ depth = 1;
+ startdepth = depth;
+}
+
+void swfoutput_setprotected() //write PROTECT tag
+{
+ flag_protected = 1;
+}
+
+void startshape(struct swfoutput*obj)
+{
+ RGBA rgb;
+ SRECT r;
+ tag = InsertTag(tag,ST_DEFINESHAPE);
+
+ NewShape(&shape);
+ linestyleid = ShapeAddLineStyle(shape,obj->linewidth,&obj->strokergb);
+ rgb.r = obj->fillrgb.r;
+ rgb.g = obj->fillrgb.g;
+ rgb.b = obj->fillrgb.b;
+ fillstyleid = ShapeAddSolidFillStyle(shape,&obj->fillrgb);
+
+ shapeid = ++shapecount;
+ SetU16(tag,shapeid); // ID
+
+ r.xmin = 0;
+ r.ymin = 0;
+ r.xmax = 20*sizex;
+ r.ymax = 20*sizey;
+
+ SetRect(tag,&r);
+
+ SetShapeStyles(tag,shape);
+ ShapeCountBits(shape,NULL,NULL);
+ SetShapeBits(tag,shape);
+
+ ShapeSetAll(tag,shape,/*x*/0,/*y*/0,linestyleid,0,0);
+ swflastx=swflasty=0;
+ lastwasfill = 0;
+}
+
+void endshape()
+{
+ if(shapeid<0)
+ return;
+ ShapeSetEnd(tag);
+ tag = InsertTag(tag,ST_PLACEOBJECT2);
+ ObjectPlace(tag,shapeid,/*depth*/depth++,NULL,NULL,NULL);
+ shapeid = -1;
+}
+
+void endpage(struct swfoutput*obj)
+{
+ if(shapeid>=0)
+ endshape();
+ while(clippos)
+ swfoutput_endclip(obj);
+ tag = InsertTag(tag,ST_SHOWFRAME);
+}
+
+void swfoutput_newpage(struct swfoutput*obj)
+{
+ endpage(obj);
+
+ for(depth--;depth>=startdepth;depth--) {
+ tag = InsertTag(tag,ST_REMOVEOBJECT2);
+ SetU16(tag,depth);
+ }
+
+ depth = 1;
+ startdepth = depth;
+}
+
+/* "destroy" like in (oo-terminology) "destructor". Perform cleaning
+ up, complete the swf, and write it out. */
+void swfoutput_destroy(struct swfoutput* obj)
+{
+ endpage(obj);
+
+ T1_CloseLib();
+ if(!filename)
+ return;
+ if(filename)
+ fi = open(filename, O_CREAT|O_TRUNC|O_WRONLY, 0777);
+ else
+ fi = 1; // stdout
+
+ if(fi<=0) {
+ logf("<fatal> Could not create \"%s\". ", filename);
+ exit(1);
+ }
+
+ tag = InsertTag(tag,ST_END);
+
+ if FAILED(WriteSWF(fi,&swf))
+ logf("<error> WriteSWF() failed.\n");
+ if(filename)
+ close(fi);
+ printf("SWF written\n");
+}
+
+void swfoutput_setdrawmode(swfoutput* obj, int mode)
+{
+ if(mode == DRAWMODE_FILL)
+ fill = 1;
+ else if(mode == DRAWMODE_EOFILL)
+ fill = 1;
+ else if(mode == DRAWMODE_STROKE)
+ fill = 0;
+ else if(mode == DRAWMODE_CLIP)
+ fill = 1;
+ else if(mode == DRAWMODE_EOCLIP)
+ fill = 1;
+}
+
+void swfoutput_setfillcolor(swfoutput* obj, u8 r, u8 g, u8 b, u8 a)
+{
+ if(shape>=0)
+ endshape();
+ obj->fillrgb.r = r;
+ obj->fillrgb.g = g;
+ obj->fillrgb.b = b;
+ obj->fillrgb.a = a;
+}
+
+void swfoutput_setstrokecolor(swfoutput* obj, u8 r, u8 g, u8 b, u8 a)
+{
+ if(shape>=0)
+ endshape();
+ obj->strokergb.r = r;
+ obj->strokergb.g = g;
+ obj->strokergb.b = b;
+ obj->strokergb.a = a;
+}
+
+void swfoutput_setlinewidth(struct swfoutput*obj, double linewidth)
+{
+ if(shape>=0)
+ endshape();
+ obj->linewidth = (u16)(linewidth*20);
+}
+
+
+void swfoutput_startclip(swfoutput*obj, T1_OUTLINE*outline, struct swfmatrix*m)
+{
+ if(shape>=0)
+ endshape();
+
+ if(clippos >= 127)
+ {
+ logf("<warning> Too many clip levels.");
+ clippos --;
+ }
+
+ startshape(obj);
+
+ swfoutput_setdrawmode(obj, DRAWMODE_CLIP);
+ swfoutput_drawpath(obj, outline, m);
+
+ ShapeSetEnd(tag);
+ tag = InsertTag(tag,ST_PLACEOBJECT2);
+ cliptags[clippos] = tag;
+ clipshapes[clippos] = shapeid;
+ clipdepths[clippos] = depth++;
+ clippos++;
+ shapeid = -1;
+}
+
+void swfoutput_endclip(swfoutput*obj)
+{
+ if(shape>=0)
+ endshape();
+
+ if(!clippos) {
+ logf("<error> Invalid end of clipping region");
+ return;
+ }
+ clippos--;
+ PlaceObject(cliptags[clippos],clipshapes[clippos],clipdepths[clippos],NULL,NULL,NULL,depth++);
+}
+
+void swfoutput_drawimagefile(struct swfoutput*, char*filename, int sizex,int sizey,
+ double x1,double y1,
+ double x2,double y2,
+ double x3,double y3,
+ double x4,double y4)
+{
+ RGBA rgb;
+ SRECT r;
+ int lsid=0;
+ int fsid;
+ int bitid;
+ struct plotxy p1,p2,p3,p4;
+ int myshapeid;
+ double xmax=x1,ymax=y1,xmin=x1,ymin=y1;
+ if(x2>xmax) xmax=x2;
+ if(y2>ymax) ymax=y2;
+ if(x2<xmin) xmin=x2;
+ if(y2<ymin) ymin=y2;
+ if(x3>xmax) xmax=x3;
+ if(y3>ymax) ymax=y3;
+ if(x3<xmin) xmin=x3;
+ if(y3<ymin) ymin=y3;
+ if(x4>xmax) xmax=x4;
+ if(y4>ymax) ymax=y4;
+ if(x4<xmin) xmin=x4;
+ if(y4<ymin) ymin=y4;
+ p1.x=x1;
+ p1.y=y1;
+ p2.x=x2;
+ p2.y=y2;
+ p3.x=x3;
+ p3.y=y3;
+ p4.x=x4;
+ p4.y=y4;
+
+ MATRIX m;
+ m.sx = (int)(65536*20*(x4-x1))/sizex;
+ m.r1 = -(int)(65536*20*(y4-y1))/sizex;
+ m.r0 = (int)(65536*20*(x1-x2))/sizey;
+ m.sy = -(int)(65536*20*(y1-y2))/sizey;
+
+ m.tx = (int)(x1*20);
+ m.ty = (int)(y1*20);
+
+ if(shape>=0)
+ endshape();
+
+ bitid = ++shapecount;
+
+ /* bitmap */
+ tag = InsertTag(tag,ST_DEFINEBITSJPEG2);
+ SetU16(tag, bitid);
+ SetJPEGBits(tag, filename, 85);
+
+ /* shape */
+ myshapeid = ++shapecount;
+ tag = InsertTag(tag,ST_DEFINESHAPE);
+ NewShape(&shape);
+ //lsid = ShapeAddLineStyle(shape,obj->linewidth,&obj->strokergb);
+ //fsid = ShapeAddSolidFillStyle(shape,&obj->fillrgb);
+ fsid = ShapeAddBitmapFillStyle(shape,&m,bitid,0);
+ SetU16(tag, myshapeid);
+ r.xmin = (int)(xmin*20);
+ r.ymin = (int)(ymin*20);
+ r.xmax = (int)(xmax*20);
+ r.ymax = (int)(ymax*20);
+ SetRect(tag,&r);
+ SetShapeStyles(tag,shape);
+ ShapeCountBits(shape,NULL,NULL);
+ SetShapeBits(tag,shape);
+ ShapeSetAll(tag,shape,/*x*/0,/*y*/0,lsid,fsid,0);
+ swflastx = swflasty = 0;
+ moveto(p1);
+ lineto(p2);
+ lineto(p3);
+ lineto(p4);
+ lineto(p1);
+ /*
+ ShapeMoveTo (tag, shape, (int)(x1*20),(int)(y1*20));
+ ShapeSetLine (tag, shape, (int)(x1*20);
+ ShapeSetLine (tag, shape, x*20,0);
+ ShapeSetLine (tag, shape, 0,-y*20);
+ ShapeSetLine (tag, shape, -x*20,0);*/
+ ShapeSetEnd(tag);
+
+ /* instance */
+ tag = InsertTag(tag,ST_PLACEOBJECT2);
+ ObjectPlace(tag,myshapeid,/*depth*/depth++,NULL,NULL,NULL);
+}
+
diff --git a/pdf2swf/swfoutput.h b/pdf2swf/swfoutput.h
new file mode 100644
index 00000000..9792fd28
--- /dev/null
+++ b/pdf2swf/swfoutput.h
@@ -0,0 +1,68 @@
+/* swfoutput.h
+ Header file for swfoutput.cc (and swfoutput_x11.cc).
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#ifndef __swfoutput_h__
+#define __swfoutput_h__
+
+#include <t1lib.h>
+extern "C" {
+#include "../lib/rfxswf.h"
+}
+
+typedef long int twip;
+
+struct swfmatrix {
+ double m11,m12,m21,m22,m13,m23;
+};
+
+struct swfcoord {
+ twip x;
+ twip y;
+};
+
+struct swfoutput
+{
+ int t1font;
+ double fontm11,fontm12,fontm21,fontm22;
+ unsigned short int linewidth;
+ RGBA strokergb;
+ RGBA fillrgb;
+};
+
+#define DRAWMODE_STROKE 1
+#define DRAWMODE_FILL 2
+#define DRAWMODE_EOFILL 3
+#define DRAWMODE_CLIP 4
+#define DRAWMODE_EOCLIP 5
+
+void swfoutput_init(struct swfoutput*, char*filename, int sizex, int sizey);
+void swfoutput_setprotected(); //write PROTECT tag
+
+void swfoutput_newpage(struct swfoutput*);
+
+ int swfoutput_setfont(struct swfoutput*, int t1font);
+void swfoutput_setdrawmode(struct swfoutput*, int drawmode);
+void swfoutput_setfillcolor(struct swfoutput*, unsigned char r, unsigned char g, unsigned char b, unsigned char a);
+void swfoutput_setstrokecolor(struct swfoutput*, unsigned char r, unsigned char g, unsigned char b, unsigned char a);
+void swfoutput_setfontmatrix(struct swfoutput*,double,double,double,double);
+void swfoutput_setlinewidth(struct swfoutput*, double linewidth);
+
+void swfoutput_drawchar(struct swfoutput*,double x,double y,char a);
+void swfoutput_drawpath(struct swfoutput*, T1_OUTLINE*outline, struct swfmatrix*m);
+void swfoutput_startclip(struct swfoutput*, T1_OUTLINE*outline, struct swfmatrix*m);
+void swfoutput_endclip(struct swfoutput*);
+void swfoutput_drawimagefile(struct swfoutput*, char*filename, int sizex,int sizey,
+ double x1,double y1,
+ double x2,double y2,
+ double x3,double y3,
+ double x4,double y4);
+
+void swfoutput_destroy(struct swfoutput*);
+
+#endif //__swfoutput_h__
diff --git a/pdf2swf/swfoutput_x11.cc b/pdf2swf/swfoutput_x11.cc
new file mode 100644
index 00000000..947f9a96
--- /dev/null
+++ b/pdf2swf/swfoutput_x11.cc
@@ -0,0 +1,249 @@
+/* This file is only for testing purposes. it replaces swfoutput.cc, and dumps
+ the information it gets into an X11 Window, not into an swf.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#include <string.h>
+#include "swfoutput.h"
+#include "kramm/xwindows.h"
+#include "spline.h"
+#include "log.h"
+
+modexwindow*vga;
+
+void inline pp(int x,int y)
+{
+ if(x<0) return;
+ if(y<0) return;
+ vga->putpixel(x,y);
+}
+
+void circle(int mx,int my,int r)
+{
+ int d=3-(2*r);
+ int x=0;
+ int y=r;
+
+
+ while(x<=y)
+ {
+ pp(mx+x,my+y);
+ pp(mx+x,my-y);
+ pp(mx-x,my+y);
+ pp(mx-x,my-y);
+ pp(mx+y,my+x);
+ pp(mx+y,my-x);
+ pp(mx-y,my+x);
+ pp(mx-y,my-x);
+
+ if(d<0)
+ {
+ d=d+(4*x)+6;
+ }
+ else
+ {y--;
+ d=d+4*(x-y)+10;
+ };
+ x++;
+ }
+}
+
+void qspline(plotxy p0,plotxy p1,plotxy p2)
+{
+ double d;
+ //vga->setcolor(0x0000ff);
+ for(d=0.00;d<=1.00;d+=0.001) {
+ int x = (int)(p0.x * d*d + p1.x * 2*(1-d)*d + p2.x * (1-d)*(1-d));
+ int y = (int)(p0.y * d*d + p1.y * 2*(1-d)*d + p2.y * (1-d)*(1-d));
+ pp(x,y);
+ }
+}
+void transform (plotxy*p0,struct swfmatrix*m)
+{
+ double x,y;
+ x = m->m11*p0->x+m->m12*p0->y;
+ y = m->m21*p0->x+m->m22*p0->y;
+ p0->x = x + m->m13;
+ p0->y = y + m->m23;
+// p0->x *= 3;
+// p0->y *= 3;
+}
+
+void spline(plotxy p0,plotxy p1,plotxy p2,plotxy p3,struct swfmatrix*m)
+{
+ double d;
+ struct qspline q[16];
+ int num;
+ int t;
+ transform(&p0,m);
+ transform(&p1,m);
+ transform(&p2,m);
+ transform(&p3,m);
+ //vga->setcolor(0xffff00);
+ //vga->drawline(p3.x,p3.y,p2.x,p2.y);
+ //vga->drawline(p2.x,p2.y,p1.x,p1.y);
+ //vga->drawline(p1.x,p1.y,p0.x,p0.y);
+
+/* vga->setcolor(0x00ff00);
+ circle(p0.x,p0.y,5);
+ circle(p1.x,p1.y,5);
+ circle(p2.x,p2.y,5);
+ circle(p3.x,p3.y,5);*/
+
+/* vga->setcolor(0xff00ff);
+ for(d=0.00;d<1.00;d+=0.001) {
+ int x = (int)(p0.x * d*d*d + p1.x * 3*(1-d)*d*d + p2.x * 3*(1-d)*(1-d)*d + p3.x * (1-d)*(1-d)*(1-d));
+ int y = (int)(p0.y * d*d*d + p1.y * 3*(1-d)*d*d + p2.y * 3*(1-d)*(1-d)*d + p3.y * (1-d)*(1-d)*(1-d));
+ pp(x,y);
+ }*/
+
+ num = approximate(p0,p1,p2,p3,q);
+ for(t=0;t<num;t++)
+ {
+ qspline(q[t].start,q[t].control,q[t].end);
+ }
+}
+void line(plotxy p0, plotxy p1, struct swfmatrix*m)
+{
+ transform(&p0,m);
+ transform(&p1,m);
+ vga->drawline((int)p0.x,(int)p0.y,(int)p1.x,(int)p1.y);
+}
+
+void swfoutput_drawpath(swfoutput*output, T1_OUTLINE*outline, struct swfmatrix*m)
+{
+ double x=0,y=0;
+ double lastx=0,lasty=0;
+
+ vga->setcolor(0xffffff);
+ while (outline)
+ {
+ logf("<debug> Pathtype:%s",outline->type == T1_PATHTYPE_MOVE?"MOVE":
+ (outline->type == T1_PATHTYPE_LINE?"LINE"
+ :"BEZIER"));
+ logf("<debug> relative coordinates: %08x,%08x", outline->dest.x, outline->dest.y);
+ x += (outline->dest.x/(float)0xffff);
+ y += (outline->dest.y/(float)0xffff);
+ logf("<debug> coordinates: %f,%f", x, y);
+ if(outline->type == T1_PATHTYPE_MOVE)
+ {
+ }
+ else if(outline->type == T1_PATHTYPE_LINE)
+ {
+ plotxy p0;
+ plotxy p1;
+ p0.x=lastx;
+ p0.y=lasty;
+ p1.x=x;
+ p1.y=y;
+ line(p0,p1,m);
+ }
+ else if(outline->type == T1_PATHTYPE_BEZIER)
+ {
+ plotxy p0;
+ plotxy p1;
+ plotxy p2;
+ plotxy p3;
+ T1_BEZIERSEGMENT*o2 = (T1_BEZIERSEGMENT*)outline;
+ p0.x=x;
+ p0.y=y;
+ p1.x=o2->C.x/(float)0xffff+lastx;
+ p1.y=o2->C.y/(float)0xffff+lasty;
+ p2.x=o2->B.x/(float)0xffff+lastx;
+ p2.y=o2->B.y/(float)0xffff+lasty;
+ p3.x=lastx;
+ p3.y=lasty;
+ spline(p0,p1,p2,p3,m);
+// vga->drawline(320+lastx, 240+lasty, 320+x, 240+y);
+ }
+ else {
+ printf("outline type:%d\n", outline->type);
+ }
+
+ lastx=x;
+ lasty=y;
+ outline = outline->link;
+ }
+ XFlush(X.d);
+}
+
+void processchar(struct swfoutput*obj, int i, char c, swfmatrix*m)
+{
+ T1_OUTLINE*outline;
+ int width = T1_GetCharWidth(i, c);
+ BBox bbox = T1_GetCharBBox(i, c);
+ char*charname= T1_GetCharName(i, c);
+ logf("<debug> Font name is %s", T1_GetFontFileName(i));
+ logf("<debug> char 0x%02x is named %s\n",c,charname);
+ logf("<debug> bbox: %d %d %d %d\n",bbox.llx,bbox.lly,bbox.urx,bbox.ury);
+ if(!charname || charname[0] == '.')
+ {
+ logf("<error> Char to set is not defined!");
+ logf("<error> - font file is %s\n", T1_GetFontFileName(i));
+ logf("<error> - char 0x%02x is named %s\n",c,charname);
+ }
+ swfmatrix m2=*m;
+ m2.m11/=100;
+ m2.m21/=100;
+ m2.m12/=100;
+ m2.m22/=100;
+ outline = T1_GetCharOutline( i, c, 100.0, 0);
+ swfoutput_drawpath(obj, outline, &m2);
+}
+
+void swfoutput_init(struct swfoutput* obj, int sizex, int sizey)
+{
+ GLYPH *glyph;
+ int i;
+
+ logf("<verbose> initializing swf output for size %d*%d\n", sizex,sizey);
+
+ vga=new modexwindow(sizex,sizey,"");
+ vga->setdirect();
+ if(!vga->on()) exit(1);
+ vga->setcolor(0xff00ff);
+
+ obj->t1font = 0;
+ obj->t1fontsize = 0.0025;
+}
+
+int swfoutput_setfont(struct swfoutput*obj, int t1id)
+{
+ obj->t1font = t1id;
+}
+
+void swfoutput_setfontsize(struct swfoutput* obj, double size)
+{
+ obj->t1fontsize = size;
+}
+
+void swfoutput_setfontmatrix(struct swfoutput*obj,double m11,double m12,
+ double m21,double m22)
+{
+ obj->fontm11 = m11;
+ obj->fontm12 = m12;
+ obj->fontm21 = m21;
+ obj->fontm22 = m22;
+}
+
+void swfoutput_drawchar(struct swfoutput* obj,double x,double y,char a)
+{
+ swfmatrix m;
+ m.m11 = obj->fontm11*obj->t1fontsize;
+ m.m12 = obj->fontm12*obj->t1fontsize;
+ m.m21 = obj->fontm21*obj->t1fontsize;
+ m.m22 = obj->fontm22*obj->t1fontsize;
+ m.m13 = x;
+ m.m23 = y;
+ processchar(obj, obj->t1font, a, &m);
+}
+
+void swfoutput_destroy(struct swfoutput* obj)
+{
+ T1_CloseLib();
+ vga->off();
+ delete vga;
+}
+
diff --git a/pdf2swf/xpdf/Array.cc b/pdf2swf/xpdf/Array.cc
new file mode 100644
index 00000000..9681b685
--- /dev/null
+++ b/pdf2swf/xpdf/Array.cc
@@ -0,0 +1,51 @@
+//========================================================================
+//
+// Array.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include "gmem.h"
+#include "Object.h"
+#include "Array.h"
+
+//------------------------------------------------------------------------
+// Array
+//------------------------------------------------------------------------
+
+Array::Array() {
+ elems = NULL;
+ size = length = 0;
+ ref = 1;
+}
+
+Array::~Array() {
+ int i;
+
+ for (i = 0; i < length; ++i)
+ elems[i].free();
+ gfree(elems);
+}
+
+void Array::add(Object *elem) {
+ if (length + 1 > size) {
+ size += 8;
+ elems = (Object *)grealloc(elems, size * sizeof(Object));
+ }
+ elems[length] = *elem;
+ ++length;
+}
+
+Object *Array::get(int i, Object *obj) {
+ return elems[i].fetch(obj);
+}
+
+Object *Array::getNF(int i, Object *obj) {
+ return elems[i].copy(obj);
+}
diff --git a/pdf2swf/xpdf/Array.h b/pdf2swf/xpdf/Array.h
new file mode 100644
index 00000000..ecf2eea6
--- /dev/null
+++ b/pdf2swf/xpdf/Array.h
@@ -0,0 +1,53 @@
+//========================================================================
+//
+// Array.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef ARRAY_H
+#define ARRAY_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "Object.h"
+
+//------------------------------------------------------------------------
+// Array
+//------------------------------------------------------------------------
+
+class Array {
+public:
+
+ // Constructor.
+ Array();
+
+ // Destructor.
+ ~Array();
+
+ // Reference counting.
+ int incRef() { return ++ref; }
+ int decRef() { return --ref; }
+
+ // Get number of elements.
+ int getLength() { return length; }
+
+ // Add an element.
+ void add(Object *elem);
+
+ // Accessors.
+ Object *get(int i, Object *obj);
+ Object *getNF(int i, Object *obj);
+
+private:
+
+ Object *elems; // array of elements
+ int size; // size of <elems> array
+ int length; // number of elements in array
+ int ref; // reference count
+};
+
+#endif
diff --git a/pdf2swf/xpdf/Catalog.cc b/pdf2swf/xpdf/Catalog.cc
new file mode 100644
index 00000000..815cca3a
--- /dev/null
+++ b/pdf2swf/xpdf/Catalog.cc
@@ -0,0 +1,301 @@
+//========================================================================
+//
+// Catalog.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include "gmem.h"
+#include "Object.h"
+#include "Array.h"
+#include "Dict.h"
+#include "Page.h"
+#include "Error.h"
+#include "Link.h"
+#include "Catalog.h"
+
+//------------------------------------------------------------------------
+// Catalog
+//------------------------------------------------------------------------
+
+Catalog::Catalog(Object *catDict) {
+ Object pagesDict;
+ Object obj, obj2;
+ int numPages0;
+ int i;
+
+ ok = gTrue;
+ pages = NULL;
+ pageRefs = NULL;
+ numPages = pagesSize = 0;
+
+ if (!catDict->isDict()) {
+ error(-1, "Catalog object is wrong type (%s)", catDict->getTypeName());
+ goto err1;
+ }
+
+ // read page tree
+ catDict->dictLookup("Pages", &pagesDict);
+ // This should really be isDict("Pages"), but I've seen at least one
+ // PDF file where the /Type entry is missing.
+ if (!pagesDict.isDict()) {
+ error(-1, "Top-level pages object is wrong type (%s)",
+ pagesDict.getTypeName());
+ goto err2;
+ }
+ pagesDict.dictLookup("Count", &obj);
+ if (!obj.isInt()) {
+ error(-1, "Page count in top-level pages object is wrong type (%s)",
+ obj.getTypeName());
+ goto err3;
+ }
+ pagesSize = numPages0 = obj.getInt();
+ obj.free();
+ pages = (Page **)gmalloc(pagesSize * sizeof(Page *));
+ pageRefs = (Ref *)gmalloc(pagesSize * sizeof(Ref));
+ for (i = 0; i < pagesSize; ++i) {
+ pages[i] = NULL;
+ pageRefs[i].num = -1;
+ pageRefs[i].gen = -1;
+ }
+ numPages = readPageTree(pagesDict.getDict(), NULL, 0);
+ if (numPages != numPages0) {
+ error(-1, "Page count in top-level pages object is incorrect");
+ }
+ pagesDict.free();
+
+ // read named destination dictionary
+ catDict->dictLookup("Dests", &dests);
+
+ // read root of named destination tree
+ if (catDict->dictLookup("Names", &obj)->isDict())
+ obj.dictLookup("Dests", &nameTree);
+ else
+ nameTree.initNull();
+ obj.free();
+
+ // read base URI
+ baseURI = NULL;
+ if (catDict->dictLookup("URI", &obj)->isDict()) {
+ if (obj.dictLookup("Base", &obj2)->isString()) {
+ baseURI = obj2.getString()->copy();
+ }
+ obj2.free();
+ }
+ obj.free();
+
+ return;
+
+ err3:
+ obj.free();
+ err2:
+ pagesDict.free();
+ err1:
+ dests.initNull();
+ nameTree.initNull();
+ ok = gFalse;
+}
+
+Catalog::~Catalog() {
+ int i;
+
+ if (pages) {
+ for (i = 0; i < pagesSize; ++i) {
+ if (pages[i]) {
+ delete pages[i];
+ }
+ }
+ gfree(pages);
+ gfree(pageRefs);
+ }
+ dests.free();
+ nameTree.free();
+ if (baseURI) {
+ delete baseURI;
+ }
+}
+
+int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start) {
+ Object kids;
+ Object kid;
+ Object kidRef;
+ PageAttrs *attrs1, *attrs2;
+ Page *page;
+ int i, j;
+
+ attrs1 = new PageAttrs(attrs, pagesDict);
+ pagesDict->lookup("Kids", &kids);
+ if (!kids.isArray()) {
+ error(-1, "Kids object (page %d) is wrong type (%s)",
+ start+1, kids.getTypeName());
+ goto err1;
+ }
+ for (i = 0; i < kids.arrayGetLength(); ++i) {
+ kids.arrayGet(i, &kid);
+ if (kid.isDict("Page")) {
+ attrs2 = new PageAttrs(attrs1, kid.getDict());
+ page = new Page(start+1, kid.getDict(), attrs2);
+ if (!page->isOk()) {
+ ++start;
+ goto err3;
+ }
+ if (start >= pagesSize) {
+ pagesSize += 32;
+ pages = (Page **)grealloc(pages, pagesSize * sizeof(Page *));
+ pageRefs = (Ref *)grealloc(pageRefs, pagesSize * sizeof(Ref));
+ for (j = pagesSize - 32; j < pagesSize; ++j) {
+ pages[j] = NULL;
+ pageRefs[j].num = -1;
+ pageRefs[j].gen = -1;
+ }
+ }
+ pages[start] = page;
+ kids.arrayGetNF(i, &kidRef);
+ if (kidRef.isRef()) {
+ pageRefs[start].num = kidRef.getRefNum();
+ pageRefs[start].gen = kidRef.getRefGen();
+ }
+ kidRef.free();
+ ++start;
+ // This should really be isDict("Pages"), but I've seen at least one
+ // PDF file where the /Type entry is missing.
+ } else if (kid.isDict()) {
+ if ((start = readPageTree(kid.getDict(), attrs1, start)) < 0)
+ goto err2;
+ } else {
+ error(-1, "Kid object (page %d) is wrong type (%s)",
+ start+1, kid.getTypeName());
+ goto err2;
+ }
+ kid.free();
+ }
+ delete attrs1;
+ kids.free();
+ return start;
+
+ err3:
+ delete page;
+ err2:
+ kid.free();
+ err1:
+ kids.free();
+ delete attrs1;
+ ok = gFalse;
+ return -1;
+}
+
+int Catalog::findPage(int num, int gen) {
+ int i;
+
+ for (i = 0; i < numPages; ++i) {
+ if (pageRefs[i].num == num && pageRefs[i].gen == gen)
+ return i + 1;
+ }
+ return 0;
+}
+
+LinkDest *Catalog::findDest(GString *name) {
+ LinkDest *dest;
+ Object obj1, obj2;
+ GBool found;
+
+ // try named destination dictionary then name tree
+ found = gFalse;
+ if (dests.isDict()) {
+ if (!dests.dictLookup(name->getCString(), &obj1)->isNull())
+ found = gTrue;
+ else
+ obj1.free();
+ }
+ if (!found && nameTree.isDict()) {
+ if (!findDestInTree(&nameTree, name, &obj1)->isNull())
+ found = gTrue;
+ else
+ obj1.free();
+ }
+ if (!found)
+ return NULL;
+
+ // construct LinkDest
+ dest = NULL;
+ if (obj1.isArray()) {
+ dest = new LinkDest(obj1.getArray(), gTrue);
+ } else if (obj1.isDict()) {
+ if (obj1.dictLookup("D", &obj2)->isArray())
+ dest = new LinkDest(obj2.getArray(), gTrue);
+ else
+ error(-1, "Bad named destination value");
+ obj2.free();
+ } else {
+ error(-1, "Bad named destination value");
+ }
+ obj1.free();
+
+ return dest;
+}
+
+Object *Catalog::findDestInTree(Object *tree, GString *name, Object *obj) {
+ Object names, name1;
+ Object kids, kid, limits, low, high;
+ GBool done, found;
+ int cmp, i;
+
+ // leaf node
+ if (tree->dictLookup("Names", &names)->isArray()) {
+ done = found = gFalse;
+ for (i = 0; !done && i < names.arrayGetLength(); i += 2) {
+ if (names.arrayGet(i, &name1)->isString()) {
+ cmp = name->cmp(name1.getString());
+ if (cmp == 0) {
+ names.arrayGet(i+1, obj);
+ found = gTrue;
+ done = gTrue;
+ } else if (cmp < 0) {
+ done = gTrue;
+ }
+ name1.free();
+ }
+ }
+ names.free();
+ if (!found)
+ obj->initNull();
+ return obj;
+ }
+ names.free();
+
+ // root or intermediate node
+ done = gFalse;
+ if (tree->dictLookup("Kids", &kids)->isArray()) {
+ for (i = 0; !done && i < kids.arrayGetLength(); ++i) {
+ if (kids.arrayGet(i, &kid)->isDict()) {
+ if (kid.dictLookup("Limits", &limits)->isArray()) {
+ if (limits.arrayGet(0, &low)->isString() &&
+ name->cmp(low.getString()) >= 0) {
+ if (limits.arrayGet(1, &high)->isString() &&
+ name->cmp(high.getString()) <= 0) {
+ findDestInTree(&kid, name, obj);
+ done = gTrue;
+ }
+ high.free();
+ }
+ low.free();
+ }
+ limits.free();
+ }
+ kid.free();
+ }
+ }
+ kids.free();
+
+ // name was outside of ranges of all kids
+ if (!done)
+ obj->initNull();
+
+ return obj;
+}
diff --git a/pdf2swf/xpdf/Catalog.h b/pdf2swf/xpdf/Catalog.h
new file mode 100644
index 00000000..b0f31432
--- /dev/null
+++ b/pdf2swf/xpdf/Catalog.h
@@ -0,0 +1,73 @@
+//========================================================================
+//
+// Catalog.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef CATALOG_H
+#define CATALOG_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+class Object;
+class Page;
+class PageAttrs;
+struct Ref;
+class LinkDest;
+
+//------------------------------------------------------------------------
+// Catalog
+//------------------------------------------------------------------------
+
+class Catalog {
+public:
+
+ // Constructor.
+ Catalog(Object *catDict);
+
+ // Destructor.
+ ~Catalog();
+
+ // Is catalog valid?
+ GBool isOk() { return ok; }
+
+ // Get number of pages.
+ int getNumPages() { return numPages; }
+
+ // Get a page.
+ Page *getPage(int i) { return pages[i-1]; }
+
+ // Get the reference for a page object.
+ Ref *getPageRef(int i) { return &pageRefs[i-1]; }
+
+ // Return base URI, or NULL if none.
+ GString *getBaseURI() { return baseURI; }
+
+ // Find a page, given its object ID. Returns page number, or 0 if
+ // not found.
+ int findPage(int num, int gen);
+
+ // Find a named destination. Returns the link destination, or
+ // NULL if <name> is not a destination.
+ LinkDest *findDest(GString *name);
+
+private:
+
+ Page **pages; // array of pages
+ Ref *pageRefs; // object ID for each page
+ int numPages; // number of pages
+ int pagesSize; // size of pages array
+ Object dests; // named destination dictionary
+ Object nameTree; // name tree
+ GString *baseURI; // base URI for URI-type links
+ GBool ok; // true if catalog is valid
+
+ int readPageTree(Dict *pages, PageAttrs *attrs, int start);
+ Object *findDestInTree(Object *tree, GString *name, Object *obj);
+};
+
+#endif
diff --git a/pdf2swf/xpdf/CompactFontInfo.h b/pdf2swf/xpdf/CompactFontInfo.h
new file mode 100644
index 00000000..c6426602
--- /dev/null
+++ b/pdf2swf/xpdf/CompactFontInfo.h
@@ -0,0 +1,464 @@
+//========================================================================
+//
+// CompactFontInfo.h
+//
+// Copyright 1999 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef COMPACTFONTINFO_H
+#define COMPACTFONTINFO_H
+
+static char *type1CStdStrings[391] = {
+ ".notdef",
+ "space",
+ "exclam",
+ "quotedbl",
+ "numbersign",
+ "dollar",
+ "percent",
+ "ampersand",
+ "quoteright",
+ "parenleft",
+ "parenright",
+ "asterisk",
+ "plus",
+ "comma",
+ "hyphen",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "at",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "bracketleft",
+ "backslash",
+ "bracketright",
+ "asciicircum",
+ "underscore",
+ "quoteleft",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "braceleft",
+ "bar",
+ "braceright",
+ "asciitilde",
+ "exclamdown",
+ "cent",
+ "sterling",
+ "fraction",
+ "yen",
+ "florin",
+ "section",
+ "currency",
+ "quotesingle",
+ "quotedblleft",
+ "guillemotleft",
+ "guilsinglleft",
+ "guilsinglright",
+ "fi",
+ "fl",
+ "endash",
+ "dagger",
+ "daggerdbl",
+ "periodcentered",
+ "paragraph",
+ "bullet",
+ "quotesinglbase",
+ "quotedblbase",
+ "quotedblright",
+ "guillemotright",
+ "ellipsis",
+ "perthousand",
+ "questiondown",
+ "grave",
+ "acute",
+ "circumflex",
+ "tilde",
+ "macron",
+ "breve",
+ "dotaccent",
+ "dieresis",
+ "ring",
+ "cedilla",
+ "hungarumlaut",
+ "ogonek",
+ "caron",
+ "emdash",
+ "AE",
+ "ordfeminine",
+ "Lslash",
+ "Oslash",
+ "OE",
+ "ordmasculine",
+ "ae",
+ "dotlessi",
+ "lslash",
+ "oslash",
+ "oe",
+ "germandbls",
+ "onesuperior",
+ "logicalnot",
+ "mu",
+ "trademark",
+ "Eth",
+ "onehalf",
+ "plusminus",
+ "Thorn",
+ "onequarter",
+ "divide",
+ "brokenbar",
+ "degree",
+ "thorn",
+ "threequarters",
+ "twosuperior",
+ "registered",
+ "minus",
+ "eth",
+ "multiply",
+ "threesuperior",
+ "copyright",
+ "Aacute",
+ "Acircumflex",
+ "Adieresis",
+ "Agrave",
+ "Aring",
+ "Atilde",
+ "Ccedilla",
+ "Eacute",
+ "Ecircumflex",
+ "Edieresis",
+ "Egrave",
+ "Iacute",
+ "Icircumflex",
+ "Idieresis",
+ "Igrave",
+ "Ntilde",
+ "Oacute",
+ "Ocircumflex",
+ "Odieresis",
+ "Ograve",
+ "Otilde",
+ "Scaron",
+ "Uacute",
+ "Ucircumflex",
+ "Udieresis",
+ "Ugrave",
+ "Yacute",
+ "Ydieresis",
+ "Zcaron",
+ "aacute",
+ "acircumflex",
+ "adieresis",
+ "agrave",
+ "aring",
+ "atilde",
+ "ccedilla",
+ "eacute",
+ "ecircumflex",
+ "edieresis",
+ "egrave",
+ "iacute",
+ "icircumflex",
+ "idieresis",
+ "igrave",
+ "ntilde",
+ "oacute",
+ "ocircumflex",
+ "odieresis",
+ "ograve",
+ "otilde",
+ "scaron",
+ "uacute",
+ "ucircumflex",
+ "udieresis",
+ "ugrave",
+ "yacute",
+ "ydieresis",
+ "zcaron",
+ "exclamsmall",
+ "Hungarumlautsmall",
+ "dollaroldstyle",
+ "dollarsuperior",
+ "ampersandsmall",
+ "Acutesmall",
+ "parenleftsuperior",
+ "parenrightsuperior",
+ "twodotenleader",
+ "onedotenleader",
+ "zerooldstyle",
+ "oneoldstyle",
+ "twooldstyle",
+ "threeoldstyle",
+ "fouroldstyle",
+ "fiveoldstyle",
+ "sixoldstyle",
+ "sevenoldstyle",
+ "eightoldstyle",
+ "nineoldstyle",
+ "commasuperior",
+ "threequartersemdash",
+ "periodsuperior",
+ "questionsmall",
+ "asuperior",
+ "bsuperior",
+ "centsuperior",
+ "dsuperior",
+ "esuperior",
+ "isuperior",
+ "lsuperior",
+ "msuperior",
+ "nsuperior",
+ "osuperior",
+ "rsuperior",
+ "ssuperior",
+ "tsuperior",
+ "ff",
+ "ffi",
+ "ffl",
+ "parenleftinferior",
+ "parenrightinferior",
+ "Circumflexsmall",
+ "hyphensuperior",
+ "Gravesmall",
+ "Asmall",
+ "Bsmall",
+ "Csmall",
+ "Dsmall",
+ "Esmall",
+ "Fsmall",
+ "Gsmall",
+ "Hsmall",
+ "Ismall",
+ "Jsmall",
+ "Ksmall",
+ "Lsmall",
+ "Msmall",
+ "Nsmall",
+ "Osmall",
+ "Psmall",
+ "Qsmall",
+ "Rsmall",
+ "Ssmall",
+ "Tsmall",
+ "Usmall",
+ "Vsmall",
+ "Wsmall",
+ "Xsmall",
+ "Ysmall",
+ "Zsmall",
+ "colonmonetary",
+ "onefitted",
+ "rupiah",
+ "Tildesmall",
+ "exclamdownsmall",
+ "centoldstyle",
+ "Lslashsmall",
+ "Scaronsmall",
+ "Zcaronsmall",
+ "Dieresissmall",
+ "Brevesmall",
+ "Caronsmall",
+ "Dotaccentsmall",
+ "Macronsmall",
+ "figuredash",
+ "hypheninferior",
+ "Ogoneksmall",
+ "Ringsmall",
+ "Cedillasmall",
+ "questiondownsmall",
+ "oneeighth",
+ "threeeighths",
+ "fiveeighths",
+ "seveneighths",
+ "onethird",
+ "twothirds",
+ "zerosuperior",
+ "foursuperior",
+ "fivesuperior",
+ "sixsuperior",
+ "sevensuperior",
+ "eightsuperior",
+ "ninesuperior",
+ "zeroinferior",
+ "oneinferior",
+ "twoinferior",
+ "threeinferior",
+ "fourinferior",
+ "fiveinferior",
+ "sixinferior",
+ "seveninferior",
+ "eightinferior",
+ "nineinferior",
+ "centinferior",
+ "dollarinferior",
+ "periodinferior",
+ "commainferior",
+ "Agravesmall",
+ "Aacutesmall",
+ "Acircumflexsmall",
+ "Atildesmall",
+ "Adieresissmall",
+ "Aringsmall",
+ "AEsmall",
+ "Ccedillasmall",
+ "Egravesmall",
+ "Eacutesmall",
+ "Ecircumflexsmall",
+ "Edieresissmall",
+ "Igravesmall",
+ "Iacutesmall",
+ "Icircumflexsmall",
+ "Idieresissmall",
+ "Ethsmall",
+ "Ntildesmall",
+ "Ogravesmall",
+ "Oacutesmall",
+ "Ocircumflexsmall",
+ "Otildesmall",
+ "Odieresissmall",
+ "OEsmall",
+ "Oslashsmall",
+ "Ugravesmall",
+ "Uacutesmall",
+ "Ucircumflexsmall",
+ "Udieresissmall",
+ "Yacutesmall",
+ "Thornsmall",
+ "Ydieresissmall",
+ "001.000",
+ "001.001",
+ "001.002",
+ "001.003",
+ "Black",
+ "Bold",
+ "Book",
+ "Light",
+ "Medium",
+ "Regular",
+ "Roman",
+ "Semibold"
+};
+
+static Gushort type1CISOAdobeCharset[229] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
+ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
+ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
+ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
+ 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
+ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
+ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
+ 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
+ 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
+ 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
+ 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
+ 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
+ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
+ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
+ 220, 221, 222, 223, 224, 225, 226, 227, 228
+};
+
+static Gushort type1CExpertCharset[166] = {
+ 0, 1, 229, 230, 231, 232, 233, 234, 235, 236,
+ 237, 238, 13, 14, 15, 99, 239, 240, 241, 242,
+ 243, 244, 245, 246, 247, 248, 27, 28, 249, 250,
+ 251, 252, 253, 254, 255, 256, 257, 258, 259, 260,
+ 261, 262, 263, 264, 265, 266, 109, 110, 267, 268,
+ 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
+ 279, 280, 281, 282, 283, 284, 285, 286, 287, 288,
+ 289, 290, 291, 292, 293, 294, 295, 296, 297, 298,
+ 299, 300, 301, 302, 303, 304, 305, 306, 307, 308,
+ 309, 310, 311, 312, 313, 314, 315, 316, 317, 318,
+ 158, 155, 163, 319, 320, 321, 322, 323, 324, 325,
+ 326, 150, 164, 169, 327, 328, 329, 330, 331, 332,
+ 333, 334, 335, 336, 337, 338, 339, 340, 341, 342,
+ 343, 344, 345, 346, 347, 348, 349, 350, 351, 352,
+ 353, 354, 355, 356, 357, 358, 359, 360, 361, 362,
+ 363, 364, 365, 366, 367, 368, 369, 370, 371, 372,
+ 373, 374, 375, 376, 377, 378
+};
+
+static Gushort type1CExpertSubsetCharset[87] = {
+ 0, 1, 231, 232, 235, 236, 237, 238, 13, 14,
+ 15, 99, 239, 240, 241, 242, 243, 244, 245, 246,
+ 247, 248, 27, 28, 249, 250, 251, 253, 254, 255,
+ 256, 257, 258, 259, 260, 261, 262, 263, 264, 265,
+ 266, 109, 110, 267, 268, 269, 270, 272, 300, 301,
+ 302, 305, 314, 315, 158, 155, 163, 320, 321, 322,
+ 323, 324, 325, 326, 150, 164, 169, 327, 328, 329,
+ 330, 331, 332, 333, 334, 335, 336, 337, 338, 339,
+ 340, 341, 342, 343, 344, 345, 346
+};
+
+#endif
diff --git a/pdf2swf/xpdf/Decrypt.cc b/pdf2swf/xpdf/Decrypt.cc
new file mode 100644
index 00000000..ae9b7323
--- /dev/null
+++ b/pdf2swf/xpdf/Decrypt.cc
@@ -0,0 +1,304 @@
+//========================================================================
+//
+// Decrypt.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include "gmem.h"
+#include "Decrypt.h"
+
+static void rc4InitKey(Guchar *key, int keyLen, Guchar *state);
+static Guchar rc4DecryptByte(Guchar *state, Guchar *x, Guchar *y, Guchar c);
+static void md5(Guchar *msg, int msgLen, Guchar *digest);
+
+static Guchar passwordPad[32] = {
+ 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41,
+ 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08,
+ 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80,
+ 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a
+};
+
+//------------------------------------------------------------------------
+// Decrypt
+//------------------------------------------------------------------------
+
+Decrypt::Decrypt(Guchar *fileKey, int objNum, int objGen) {
+ // construct object key
+ objKey[0] = fileKey[0];
+ objKey[1] = fileKey[1];
+ objKey[2] = fileKey[2];
+ objKey[3] = fileKey[3];
+ objKey[4] = fileKey[4];
+ objKey[5] = objNum & 0xff;
+ objKey[6] = (objNum >> 8) & 0xff;
+ objKey[7] = (objNum >> 16) & 0xff;
+ objKey[8] = objGen & 0xff;
+ objKey[9] = (objGen >> 8) & 0xff;
+ md5(objKey, 10, objKey);
+
+ // set up for decryption
+ x = y = 0;
+ rc4InitKey(objKey, 10, state);
+}
+
+void Decrypt::reset() {
+ x = y = 0;
+ rc4InitKey(objKey, 10, state);
+}
+
+Guchar Decrypt::decryptByte(Guchar c) {
+ return rc4DecryptByte(state, &x, &y, c);
+}
+
+GBool Decrypt::makeFileKey(GString *ownerKey, GString *userKey,
+ int permissions, GString *fileID,
+ GString *userPassword, Guchar *fileKey) {
+ Guchar *buf;
+ Guchar userTest[32];
+ Guchar fState[256];
+ Guchar fx, fy;
+ int len, i;
+ GBool ok;
+
+ // generate file key
+ buf = (Guchar *)gmalloc(68 + fileID->getLength());
+ if (userPassword) {
+ len = userPassword->getLength();
+ if (len < 32) {
+ memcpy(buf, userPassword->getCString(), len);
+ memcpy(buf + len, passwordPad, 32 - len);
+ } else {
+ memcpy(buf, userPassword->getCString(), 32);
+ }
+ } else {
+ memcpy(buf, passwordPad, 32);
+ }
+ memcpy(buf + 32, ownerKey->getCString(), 32);
+ buf[64] = permissions & 0xff;
+ buf[65] = (permissions >> 8) & 0xff;
+ buf[66] = (permissions >> 16) & 0xff;
+ buf[67] = (permissions >> 24) & 0xff;
+ memcpy(buf + 68, fileID->getCString(), fileID->getLength());
+ md5(buf, 68 + fileID->getLength(), fileKey);
+
+ // test user key
+ fx = fy = 0;
+ rc4InitKey(fileKey, 5, fState);
+ for (i = 0; i < 32; ++i) {
+ userTest[i] = rc4DecryptByte(fState, &fx, &fy, userKey->getChar(i));
+ }
+ ok = memcmp(userTest, passwordPad, 32) == 0;
+ gfree(buf);
+
+ return ok;
+}
+
+//------------------------------------------------------------------------
+// RC4-compatible decryption
+//------------------------------------------------------------------------
+
+static void rc4InitKey(Guchar *key, int keyLen, Guchar *state) {
+ Guchar index1, index2;
+ Guchar t;
+ int i;
+
+ for (i = 0; i < 256; ++i)
+ state[i] = i;
+ index1 = index2 = 0;
+ for (i = 0; i < 256; ++i) {
+ index2 = (key[index1] + state[i] + index2) % 256;
+ t = state[i];
+ state[i] = state[index2];
+ state[index2] = t;
+ index1 = (index1 + 1) % keyLen;
+ }
+}
+
+static Guchar rc4DecryptByte(Guchar *state, Guchar *x, Guchar *y, Guchar c) {
+ Guchar x1, y1, tx, ty;
+
+ x1 = *x = (*x + 1) % 256;
+ y1 = *y = (state[*x] + *y) % 256;
+ tx = state[x1];
+ ty = state[y1];
+ state[x1] = ty;
+ state[y1] = tx;
+ return c ^ state[(tx + ty) % 256];
+}
+
+//------------------------------------------------------------------------
+// MD5 message digest
+//------------------------------------------------------------------------
+
+static inline Gulong rotateLeft(Gulong x, int r) {
+ x &= 0xffffffff;
+ return ((x << r) | (x >> (32 - r))) & 0xffffffff;
+}
+
+static inline Gulong md5Round1(Gulong a, Gulong b, Gulong c, Gulong d,
+ Gulong Xk, Gulong s, Gulong Ti) {
+ return b + rotateLeft((a + ((b & c) | (~b & d)) + Xk + Ti), s);
+}
+
+static inline Gulong md5Round2(Gulong a, Gulong b, Gulong c, Gulong d,
+ Gulong Xk, Gulong s, Gulong Ti) {
+ return b + rotateLeft((a + ((b & d) | (c & ~d)) + Xk + Ti), s);
+}
+
+static inline Gulong md5Round3(Gulong a, Gulong b, Gulong c, Gulong d,
+ Gulong Xk, Gulong s, Gulong Ti) {
+ return b + rotateLeft((a + (b ^ c ^ d) + Xk + Ti), s);
+}
+
+static inline Gulong md5Round4(Gulong a, Gulong b, Gulong c, Gulong d,
+ Gulong Xk, Gulong s, Gulong Ti) {
+ return b + rotateLeft((a + (c ^ (b | ~d)) + Xk + Ti), s);
+}
+
+static void md5(Guchar *msg, int msgLen, Guchar *digest) {
+ Gulong x[16];
+ Gulong a, b, c, d, aa, bb, cc, dd;
+ int n64;
+ int i, j, k;
+
+ // compute number of 64-byte blocks
+ // (length + pad byte (0x80) + 8 bytes for length)
+ n64 = (msgLen + 1 + 8 + 63) / 64;
+
+ // initialize a, b, c, d
+ a = 0x67452301;
+ b = 0xefcdab89;
+ c = 0x98badcfe;
+ d = 0x10325476;
+
+ // loop through blocks
+ k = 0;
+ for (i = 0; i < n64; ++i) {
+
+ // grab a 64-byte block
+ for (j = 0; j < 16 && k < msgLen - 3; ++j, k += 4)
+ x[j] = (((((msg[k+3] << 8) + msg[k+2]) << 8) + msg[k+1]) << 8) + msg[k];
+ if (i == n64 - 1) {
+ if (k == msgLen - 3)
+ x[j] = 0x80000000 + (((msg[k+2] << 8) + msg[k+1]) << 8) + msg[k];
+ else if (k == msgLen - 2)
+ x[j] = 0x800000 + (msg[k+1] << 8) + msg[k];
+ else if (k == msgLen - 1)
+ x[j] = 0x8000 + msg[k];
+ else
+ x[j] = 0x80;
+ ++j;
+ while (j < 16)
+ x[j++] = 0;
+ x[14] = msgLen << 3;
+ }
+
+ // save a, b, c, d
+ aa = a;
+ bb = b;
+ cc = c;
+ dd = d;
+
+ // round 1
+ a = md5Round1(a, b, c, d, x[0], 7, 0xd76aa478);
+ d = md5Round1(d, a, b, c, x[1], 12, 0xe8c7b756);
+ c = md5Round1(c, d, a, b, x[2], 17, 0x242070db);
+ b = md5Round1(b, c, d, a, x[3], 22, 0xc1bdceee);
+ a = md5Round1(a, b, c, d, x[4], 7, 0xf57c0faf);
+ d = md5Round1(d, a, b, c, x[5], 12, 0x4787c62a);
+ c = md5Round1(c, d, a, b, x[6], 17, 0xa8304613);
+ b = md5Round1(b, c, d, a, x[7], 22, 0xfd469501);
+ a = md5Round1(a, b, c, d, x[8], 7, 0x698098d8);
+ d = md5Round1(d, a, b, c, x[9], 12, 0x8b44f7af);
+ c = md5Round1(c, d, a, b, x[10], 17, 0xffff5bb1);
+ b = md5Round1(b, c, d, a, x[11], 22, 0x895cd7be);
+ a = md5Round1(a, b, c, d, x[12], 7, 0x6b901122);
+ d = md5Round1(d, a, b, c, x[13], 12, 0xfd987193);
+ c = md5Round1(c, d, a, b, x[14], 17, 0xa679438e);
+ b = md5Round1(b, c, d, a, x[15], 22, 0x49b40821);
+
+ // round 2
+ a = md5Round2(a, b, c, d, x[1], 5, 0xf61e2562);
+ d = md5Round2(d, a, b, c, x[6], 9, 0xc040b340);
+ c = md5Round2(c, d, a, b, x[11], 14, 0x265e5a51);
+ b = md5Round2(b, c, d, a, x[0], 20, 0xe9b6c7aa);
+ a = md5Round2(a, b, c, d, x[5], 5, 0xd62f105d);
+ d = md5Round2(d, a, b, c, x[10], 9, 0x02441453);
+ c = md5Round2(c, d, a, b, x[15], 14, 0xd8a1e681);
+ b = md5Round2(b, c, d, a, x[4], 20, 0xe7d3fbc8);
+ a = md5Round2(a, b, c, d, x[9], 5, 0x21e1cde6);
+ d = md5Round2(d, a, b, c, x[14], 9, 0xc33707d6);
+ c = md5Round2(c, d, a, b, x[3], 14, 0xf4d50d87);
+ b = md5Round2(b, c, d, a, x[8], 20, 0x455a14ed);
+ a = md5Round2(a, b, c, d, x[13], 5, 0xa9e3e905);
+ d = md5Round2(d, a, b, c, x[2], 9, 0xfcefa3f8);
+ c = md5Round2(c, d, a, b, x[7], 14, 0x676f02d9);
+ b = md5Round2(b, c, d, a, x[12], 20, 0x8d2a4c8a);
+
+ // round 3
+ a = md5Round3(a, b, c, d, x[5], 4, 0xfffa3942);
+ d = md5Round3(d, a, b, c, x[8], 11, 0x8771f681);
+ c = md5Round3(c, d, a, b, x[11], 16, 0x6d9d6122);
+ b = md5Round3(b, c, d, a, x[14], 23, 0xfde5380c);
+ a = md5Round3(a, b, c, d, x[1], 4, 0xa4beea44);
+ d = md5Round3(d, a, b, c, x[4], 11, 0x4bdecfa9);
+ c = md5Round3(c, d, a, b, x[7], 16, 0xf6bb4b60);
+ b = md5Round3(b, c, d, a, x[10], 23, 0xbebfbc70);
+ a = md5Round3(a, b, c, d, x[13], 4, 0x289b7ec6);
+ d = md5Round3(d, a, b, c, x[0], 11, 0xeaa127fa);
+ c = md5Round3(c, d, a, b, x[3], 16, 0xd4ef3085);
+ b = md5Round3(b, c, d, a, x[6], 23, 0x04881d05);
+ a = md5Round3(a, b, c, d, x[9], 4, 0xd9d4d039);
+ d = md5Round3(d, a, b, c, x[12], 11, 0xe6db99e5);
+ c = md5Round3(c, d, a, b, x[15], 16, 0x1fa27cf8);
+ b = md5Round3(b, c, d, a, x[2], 23, 0xc4ac5665);
+
+ // round 4
+ a = md5Round4(a, b, c, d, x[0], 6, 0xf4292244);
+ d = md5Round4(d, a, b, c, x[7], 10, 0x432aff97);
+ c = md5Round4(c, d, a, b, x[14], 15, 0xab9423a7);
+ b = md5Round4(b, c, d, a, x[5], 21, 0xfc93a039);
+ a = md5Round4(a, b, c, d, x[12], 6, 0x655b59c3);
+ d = md5Round4(d, a, b, c, x[3], 10, 0x8f0ccc92);
+ c = md5Round4(c, d, a, b, x[10], 15, 0xffeff47d);
+ b = md5Round4(b, c, d, a, x[1], 21, 0x85845dd1);
+ a = md5Round4(a, b, c, d, x[8], 6, 0x6fa87e4f);
+ d = md5Round4(d, a, b, c, x[15], 10, 0xfe2ce6e0);
+ c = md5Round4(c, d, a, b, x[6], 15, 0xa3014314);
+ b = md5Round4(b, c, d, a, x[13], 21, 0x4e0811a1);
+ a = md5Round4(a, b, c, d, x[4], 6, 0xf7537e82);
+ d = md5Round4(d, a, b, c, x[11], 10, 0xbd3af235);
+ c = md5Round4(c, d, a, b, x[2], 15, 0x2ad7d2bb);
+ b = md5Round4(b, c, d, a, x[9], 21, 0xeb86d391);
+
+ // increment a, b, c, d
+ a += aa;
+ b += bb;
+ c += cc;
+ d += dd;
+ }
+
+ // break digest into bytes
+ digest[0] = a & 0xff;
+ digest[1] = (a >>= 8) & 0xff;
+ digest[2] = (a >>= 8) & 0xff;
+ digest[3] = (a >>= 8) & 0xff;
+ digest[4] = b & 0xff;
+ digest[5] = (b >>= 8) & 0xff;
+ digest[6] = (b >>= 8) & 0xff;
+ digest[7] = (b >>= 8) & 0xff;
+ digest[8] = c & 0xff;
+ digest[9] = (c >>= 8) & 0xff;
+ digest[10] = (c >>= 8) & 0xff;
+ digest[11] = (c >>= 8) & 0xff;
+ digest[12] = d & 0xff;
+ digest[13] = (d >>= 8) & 0xff;
+ digest[14] = (d >>= 8) & 0xff;
+ digest[15] = (d >>= 8) & 0xff;
+}
diff --git a/pdf2swf/xpdf/Decrypt.h b/pdf2swf/xpdf/Decrypt.h
new file mode 100644
index 00000000..3ea43741
--- /dev/null
+++ b/pdf2swf/xpdf/Decrypt.h
@@ -0,0 +1,49 @@
+//========================================================================
+//
+// Decrypt.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef DECRYPT_H
+#define DECRYPT_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "gtypes.h"
+#include "GString.h"
+
+//------------------------------------------------------------------------
+// Decrypt
+//------------------------------------------------------------------------
+
+class Decrypt {
+public:
+
+ // Initialize the decryptor object.
+ Decrypt(Guchar *fileKey, int objNum, int objGen);
+
+ // Reset decryption.
+ void reset();
+
+ // Decrypt one byte.
+ Guchar decryptByte(Guchar c);
+
+ // Generate a file key. The <fileKey> buffer must have space for
+ // at least 16 bytes. Checks user key and returns gTrue if okay.
+ // <userPassword> may be NULL.
+ static GBool makeFileKey(GString *ownerKey, GString *userKey,
+ int permissions, GString *fileID,
+ GString *userPassword, Guchar *fileKey);
+
+private:
+
+ Guchar objKey[16];
+ Guchar state[256];
+ Guchar x, y;
+};
+
+#endif
diff --git a/pdf2swf/xpdf/Dict.cc b/pdf2swf/xpdf/Dict.cc
new file mode 100644
index 00000000..c9f4feca
--- /dev/null
+++ b/pdf2swf/xpdf/Dict.cc
@@ -0,0 +1,88 @@
+//========================================================================
+//
+// Dict.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include <string.h>
+#include "gmem.h"
+#include "Object.h"
+#include "XRef.h"
+#include "Dict.h"
+
+//------------------------------------------------------------------------
+// Dict
+//------------------------------------------------------------------------
+
+Dict::Dict() {
+ entries = NULL;
+ size = length = 0;
+ ref = 1;
+}
+
+Dict::~Dict() {
+ int i;
+
+ for (i = 0; i < length; ++i) {
+ gfree(entries[i].key);
+ entries[i].val.free();
+ }
+ gfree(entries);
+}
+
+void Dict::add(char *key, Object *val) {
+ if (length + 1 > size) {
+ size += 8;
+ entries = (DictEntry *)grealloc(entries, size * sizeof(DictEntry));
+ }
+ entries[length].key = key;
+ entries[length].val = *val;
+ ++length;
+}
+
+inline DictEntry *Dict::find(char *key) {
+ int i;
+
+ for (i = 0; i < length; ++i) {
+ if (!strcmp(key, entries[i].key))
+ return &entries[i];
+ }
+ return NULL;
+}
+
+GBool Dict::is(char *type) {
+ DictEntry *e;
+
+ return (e = find("Type")) && e->val.isName(type);
+}
+
+Object *Dict::lookup(char *key, Object *obj) {
+ DictEntry *e;
+
+ return (e = find(key)) ? e->val.fetch(obj) : obj->initNull();
+}
+
+Object *Dict::lookupNF(char *key, Object *obj) {
+ DictEntry *e;
+
+ return (e = find(key)) ? e->val.copy(obj) : obj->initNull();
+}
+
+char *Dict::getKey(int i) {
+ return entries[i].key;
+}
+
+Object *Dict::getVal(int i, Object *obj) {
+ return entries[i].val.fetch(obj);
+}
+
+Object *Dict::getValNF(int i, Object *obj) {
+ return entries[i].val.copy(obj);
+}
diff --git a/pdf2swf/xpdf/Dict.h b/pdf2swf/xpdf/Dict.h
new file mode 100644
index 00000000..cfc64d3b
--- /dev/null
+++ b/pdf2swf/xpdf/Dict.h
@@ -0,0 +1,69 @@
+//========================================================================
+//
+// Dict.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef DICT_H
+#define DICT_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "Object.h"
+
+//------------------------------------------------------------------------
+// Dict
+//------------------------------------------------------------------------
+
+struct DictEntry {
+ char *key;
+ Object val;
+};
+
+class Dict {
+public:
+
+ // Constructor.
+ Dict();
+
+ // Destructor.
+ ~Dict();
+
+ // Reference counting.
+ int incRef() { return ++ref; }
+ int decRef() { return --ref; }
+
+ // Get number of entries.
+ int getLength() { return length; }
+
+ // Add an entry. NB: does not copy key.
+ void add(char *key, Object *val);
+
+ // Check if dictionary is of specified type.
+ GBool is(char *type);
+
+ // Look up an entry and return the value. Returns a null object
+ // if <key> is not in the dictionary.
+ Object *lookup(char *key, Object *obj);
+ Object *lookupNF(char *key, Object *obj);
+
+ // Iterative accessors.
+ char *getKey(int i);
+ Object *getVal(int i, Object *obj);
+ Object *getValNF(int i, Object *obj);
+
+private:
+
+ DictEntry *entries; // array of entries
+ int size; // size of <entries> array
+ int length; // number of entries in dictionary
+ int ref; // reference count
+
+ DictEntry *find(char *key);
+};
+
+#endif
diff --git a/pdf2swf/xpdf/Error.cc b/pdf2swf/xpdf/Error.cc
new file mode 100644
index 00000000..485a7cb4
--- /dev/null
+++ b/pdf2swf/xpdf/Error.cc
@@ -0,0 +1,50 @@
+//========================================================================
+//
+// Error.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <stddef.h>
+#include <stdarg.h>
+#include "gtypes.h"
+#include "Params.h"
+#include "Error.h"
+
+FILE *errFile;
+GBool errQuiet;
+
+void errorInit() {
+ if (errQuiet) {
+ errFile = NULL;
+ } else {
+ errFile = stderr;
+ }
+}
+
+void CDECL error(int pos, char *msg, ...) {
+ va_list args;
+
+ if (errQuiet) {
+ return;
+ }
+ if (printCommands) {
+ fflush(stdout);
+ }
+ if (pos >= 0) {
+ fprintf(errFile, "Error (%d): ", pos);
+ } else {
+ fprintf(errFile, "Error: ");
+ }
+ va_start(args, msg);
+ vfprintf(errFile, msg, args);
+ va_end(args);
+ fprintf(errFile, "\n");
+ fflush(errFile);
+}
diff --git a/pdf2swf/xpdf/Error.h b/pdf2swf/xpdf/Error.h
new file mode 100644
index 00000000..f651678c
--- /dev/null
+++ b/pdf2swf/xpdf/Error.h
@@ -0,0 +1,26 @@
+//========================================================================
+//
+// Error.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef ERROR_H
+#define ERROR_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include <stdio.h>
+#include "config.h"
+
+// File to send error (and other) messages to.
+extern FILE *errFile;
+
+extern void errorInit();
+
+extern void CDECL error(int pos, char *msg, ...);
+
+#endif
diff --git a/pdf2swf/xpdf/FontEncoding.cc b/pdf2swf/xpdf/FontEncoding.cc
new file mode 100644
index 00000000..bf12577e
--- /dev/null
+++ b/pdf2swf/xpdf/FontEncoding.cc
@@ -0,0 +1,143 @@
+//========================================================================
+//
+// FontEncoding.cc
+//
+// Copyright 1999 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include "gmem.h"
+#include "FontEncoding.h"
+
+//------------------------------------------------------------------------
+// FontEncoding
+//------------------------------------------------------------------------
+
+inline int FontEncoding::hash(char *name) {
+ Guint h;
+
+ h = (Guint)name[0] & 0xff;
+ if (h && name[1])
+ h = h * 61 + ((Guint)name[1] & 0xff);
+ return (int)(h % (Guint)fontEncHashSize);
+}
+
+FontEncoding::FontEncoding() {
+ int i;
+
+ encoding = (char **)gmalloc(256 * sizeof(char *));
+ size = 256;
+ freeEnc = gTrue;
+ for (i = 0; i < 256; ++i)
+ encoding[i] = NULL;
+ for (i = 0; i < fontEncHashSize; ++i)
+ hashTab[i] = -1;
+}
+
+FontEncoding::FontEncoding(char **encoding, int size) {
+ int i;
+
+ this->encoding = encoding;
+ this->size = size;
+ freeEnc = gFalse;
+ for (i = 0; i < fontEncHashSize; ++i)
+ hashTab[i] = -1;
+ for (i = 0; i < size; ++i) {
+ if (encoding[i])
+ addChar1(i, encoding[i]);
+ }
+}
+
+FontEncoding::FontEncoding(FontEncoding *fontEnc) {
+ int i;
+
+ encoding = (char **)gmalloc(fontEnc->size * sizeof(char *));
+ size = fontEnc->size;
+ freeEnc = gTrue;
+ for (i = 0; i < size; ++i) {
+ encoding[i] =
+ fontEnc->encoding[i] ? copyString(fontEnc->encoding[i]) : (char *)NULL;
+ }
+ memcpy(hashTab, fontEnc->hashTab, fontEncHashSize * sizeof(short));
+}
+
+void FontEncoding::addChar(int code, char *name) {
+ int h, i;
+
+ // replace character associated with code
+ if (encoding[code]) {
+ h = hash(encoding[code]);
+ for (i = 0; i < fontEncHashSize; ++i) {
+ if (hashTab[h] == code) {
+ hashTab[h] = -2;
+ break;
+ }
+ if (++h == fontEncHashSize)
+ h = 0;
+ }
+ gfree(encoding[code]);
+ }
+
+ // associate name with code
+ encoding[code] = name;
+
+ // insert name in hash table
+ addChar1(code, name);
+}
+
+void FontEncoding::addChar1(int code, char *name) {
+ int h, i, code2;
+
+ // insert name in hash table
+ h = hash(name);
+ for (i = 0; i < fontEncHashSize; ++i) {
+ code2 = hashTab[h];
+ if (code2 < 0) {
+ hashTab[h] = code;
+ break;
+ } else if (encoding[code2] && !strcmp(encoding[code2], name)) {
+ // keep the highest code for each char -- this is needed because
+ // X won't display chars with codes < 32
+ if (code > code2)
+ hashTab[h] = code;
+ break;
+ }
+ if (++h == fontEncHashSize)
+ h = 0;
+ }
+}
+
+FontEncoding::~FontEncoding() {
+ int i;
+
+ if (freeEnc) {
+ for (i = 0; i < size; ++i) {
+ if (encoding[i])
+ gfree(encoding[i]);
+ }
+ gfree(encoding);
+ }
+}
+
+int FontEncoding::getCharCode(char *name) {
+ int h, i, code;
+
+ h = hash(name);
+ for (i = 0; i < fontEncHashSize; ++i) {
+ code = hashTab[h];
+ if (code == -1 ||
+ (code >= 0 && encoding[code] && !strcmp(encoding[code], name)))
+ return code;
+ if (++h >= fontEncHashSize)
+ h = 0;
+ }
+ return -1;
+}
diff --git a/pdf2swf/xpdf/FontEncoding.h b/pdf2swf/xpdf/FontEncoding.h
new file mode 100644
index 00000000..7c811536
--- /dev/null
+++ b/pdf2swf/xpdf/FontEncoding.h
@@ -0,0 +1,64 @@
+//========================================================================
+//
+// FontEncoding.h
+//
+// Copyright 1999 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef FONTENCODING_H
+#define FONTENCODING_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "gtypes.h"
+
+//------------------------------------------------------------------------
+// FontEncoding
+//------------------------------------------------------------------------
+
+#define fontEncHashSize 419
+
+class FontEncoding {
+public:
+
+ // Construct an empty encoding.
+ FontEncoding();
+
+ // Construct an encoding from an array of char names.
+ FontEncoding(char **encoding, int size);
+
+ // Destructor.
+ ~FontEncoding();
+
+ // Create a copy of the encoding.
+ FontEncoding *copy() { return new FontEncoding(this); }
+
+ // Return number of codes in encoding, i.e., max code + 1.
+ int getSize() { return size; }
+
+ // Add a char to the encoding.
+ void addChar(int code, char *name);
+
+ // Return the character name associated with <code>.
+ char *getCharName(int code) { return encoding[code]; }
+
+ // Return the code associated with <name>.
+ int getCharCode(char *name);
+
+private:
+
+ FontEncoding(FontEncoding *fontEnc);
+ int hash(char *name);
+ void addChar1(int code, char *name);
+
+ char **encoding; // code --> name mapping
+ int size; // number of codes
+ GBool freeEnc; // should we free the encoding array?
+ short // name --> code hash table
+ hashTab[fontEncHashSize];
+};
+
+#endif
diff --git a/pdf2swf/xpdf/FontFile.cc b/pdf2swf/xpdf/FontFile.cc
new file mode 100644
index 00000000..777b56a3
--- /dev/null
+++ b/pdf2swf/xpdf/FontFile.cc
@@ -0,0 +1,1633 @@
+//========================================================================
+//
+// FontFile.cc
+//
+// Copyright 1999 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <math.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <ctype.h>
+#include "gmem.h"
+#include "Error.h"
+#include "FontFile.h"
+
+#include "StdFontInfo.h"
+#include "CompactFontInfo.h"
+
+//------------------------------------------------------------------------
+
+static Guint getWord(Guchar *ptr, int size);
+static double getNum(Guchar **ptr, GBool *fp);
+static char *getString(int sid, Guchar *stringIdxPtr,
+ Guchar *stringStartPtr, int stringOffSize,
+ char *buf);
+
+//------------------------------------------------------------------------
+
+static inline char *nextLine(char *line, char *end) {
+ while (line < end && *line != '\n' && *line != '\r')
+ ++line;
+ while (line < end && *line == '\n' || *line == '\r')
+ ++line;
+ return line;
+}
+
+static char hexChars[17] = "0123456789ABCDEF";
+
+//------------------------------------------------------------------------
+// FontFile
+//------------------------------------------------------------------------
+
+FontFile::FontFile() {
+}
+
+FontFile::~FontFile() {
+}
+
+//------------------------------------------------------------------------
+// Type1FontFile
+//------------------------------------------------------------------------
+
+Type1FontFile::Type1FontFile(char *file, int len) {
+ char *line, *line1, *p, *p2;
+ char buf[256];
+ char c;
+ int n, code, i;
+
+ name = NULL;
+ encoding = NULL;
+ freeEnc = gTrue;
+
+ for (i = 1, line = file; i <= 100 && line < file + len && !encoding; ++i) {
+
+ // get font name
+ if (!strncmp(line, "/FontName", 9)) {
+ strncpy(buf, line, 255);
+ buf[255] = '\0';
+ if ((p = strchr(buf+9, '/')) &&
+ (p = strtok(p+1, " \t\n\r")))
+ name = copyString(p);
+ line = nextLine(line, file + len);
+
+ // get encoding
+ } else if (!strncmp(line, "/Encoding StandardEncoding def", 30)) {
+ encoding = type1StdEncoding.copy();
+ } else if (!strncmp(line, "/Encoding 256 array", 19)) {
+ encoding = new FontEncoding();
+ for (i = 0; i < 300; ++i) {
+ line1 = nextLine(line, file + len);
+ if ((n = line1 - line) > 255)
+ n = 255;
+ strncpy(buf, line, n);
+ buf[n] = '\0';
+ for (p = buf; *p == ' ' || *p == '\t'; ++p) ;
+ if (!strncmp(p, "dup", 3)) {
+ for (p += 3; *p == ' ' || *p == '\t'; ++p) ;
+ for (p2 = p; *p2 >= '0' && *p2 <= '9'; ++p2) ;
+ if (*p2) {
+ c = *p2;
+ *p2 = '\0';
+ if ((code = atoi(p)) < 256) {
+ *p2 = c;
+ for (p = p2; *p == ' ' || *p == '\t'; ++p) ;
+ if (*p == '/') {
+ ++p;
+ for (p2 = p; *p2 && *p2 != ' ' && *p2 != '\t'; ++p2) ;
+ *p2 = '\0';
+ encoding->addChar(code, copyString(p));
+ }
+ }
+ }
+ } else {
+ if (strtok(buf, " \t") &&
+ (p = strtok(NULL, " \t\n\r")) && !strcmp(p, "def")) {
+ break;
+ }
+ }
+ line = line1;
+ }
+ //~ check for getinterval/putinterval junk
+
+ } else {
+ line = nextLine(line, file + len);
+ }
+ }
+}
+
+Type1FontFile::~Type1FontFile() {
+ if (name)
+ gfree(name);
+ if (encoding && freeEnc)
+ delete encoding;
+}
+
+FontEncoding *Type1FontFile::getEncoding(GBool taken) {
+ if (taken)
+ freeEnc = gFalse;
+ return encoding;
+}
+
+//------------------------------------------------------------------------
+// Type1CFontFile
+//------------------------------------------------------------------------
+
+Type1CFontFile::Type1CFontFile(char *file, int len) {
+ char buf[256];
+ Guchar *topPtr, *idxStartPtr, *idxPtr0, *idxPtr1;
+ Guchar *stringIdxPtr, *stringStartPtr;
+ int topOffSize, idxOffSize, stringOffSize;
+ int nFonts, nStrings, nGlyphs;
+ int nCodes, nRanges, nLeft, nSups;
+ Gushort *glyphNames;
+ int charset, enc, charstrings;
+ int charsetFormat, encFormat;
+ int c, sid;
+ double op[48];
+ double x;
+ GBool isFP;
+ int key;
+ int i, j, n;
+
+ name = NULL;
+ encoding = NULL;
+ freeEnc = gTrue;
+
+ // read header
+ topPtr = (Guchar *)file + (file[2] & 0xff);
+ topOffSize = file[3] & 0xff;
+
+ // read name index (first font only)
+ nFonts = getWord(topPtr, 2);
+ idxOffSize = topPtr[2];
+ topPtr += 3;
+ idxStartPtr = topPtr + (nFonts + 1) * idxOffSize - 1;
+ idxPtr0 = idxStartPtr + getWord(topPtr, idxOffSize);
+ idxPtr1 = idxStartPtr + getWord(topPtr + idxOffSize, idxOffSize);
+ if ((n = idxPtr1 - idxPtr0) > 255)
+ n = 255;
+ strncpy(buf, (char *)idxPtr0, n);
+ buf[n] = '\0';
+ name = copyString(buf);
+ topPtr = idxStartPtr + getWord(topPtr + nFonts * idxOffSize, idxOffSize);
+
+ // read top dict index (first font only)
+ nFonts = getWord(topPtr, 2);
+ idxOffSize = topPtr[2];
+ topPtr += 3;
+ idxStartPtr = topPtr + (nFonts + 1) * idxOffSize - 1;
+ idxPtr0 = idxStartPtr + getWord(topPtr, idxOffSize);
+ idxPtr1 = idxStartPtr + getWord(topPtr + idxOffSize, idxOffSize);
+ charset = 0;
+ enc = 0;
+ charstrings = 0;
+ i = 0;
+ while (idxPtr0 < idxPtr1) {
+ if (*idxPtr0 <= 27 || *idxPtr0 == 31) {
+ key = *idxPtr0++;
+ if (key == 0x0c)
+ key = (key << 8) | *idxPtr0++;
+ if (key == 0x0f) { // charset
+ charset = (int)op[0];
+ } else if (key == 0x10) { // encoding
+ enc = (int)op[0];
+ } else if (key == 0x11) { // charstrings
+ charstrings = (int)op[0];
+ }
+ i = 0;
+ } else {
+ x = getNum(&idxPtr0, &isFP);
+ if (i < 48)
+ op[i++] = x;
+ }
+ }
+ topPtr = idxStartPtr + getWord(topPtr + nFonts * idxOffSize, idxOffSize);
+
+ // read string index
+ nStrings = getWord(topPtr, 2);
+ stringOffSize = topPtr[2];
+ topPtr += 3;
+ stringIdxPtr = topPtr;
+ stringStartPtr = topPtr + (nStrings + 1) * stringOffSize - 1;
+ topPtr = stringStartPtr + getWord(topPtr + nStrings * stringOffSize,
+ stringOffSize);
+
+ // get number of glyphs from charstrings index
+ topPtr = (Guchar *)file + charstrings;
+ nGlyphs = getWord(topPtr, 2);
+
+ // read charset
+ if (charset == 0) {
+ glyphNames = type1CISOAdobeCharset;
+ } else if (charset == 1) {
+ glyphNames = type1CExpertCharset;
+ } else if (charset == 2) {
+ glyphNames = type1CExpertSubsetCharset;
+ } else {
+ glyphNames = (Gushort *)gmalloc(nGlyphs * sizeof(Gushort));
+ glyphNames[0] = 0;
+ topPtr = (Guchar *)file + charset;
+ charsetFormat = *topPtr++;
+ if (charsetFormat == 0) {
+ for (i = 1; i < nGlyphs; ++i) {
+ glyphNames[i] = getWord(topPtr, 2);
+ topPtr += 2;
+ }
+ } else if (charsetFormat == 1) {
+ i = 1;
+ while (i < nGlyphs) {
+ c = getWord(topPtr, 2);
+ topPtr += 2;
+ nLeft = *topPtr++;
+ for (j = 0; j <= nLeft; ++j)
+ glyphNames[i++] = c++;
+ }
+ } else if (charsetFormat == 2) {
+ i = 1;
+ while (i < nGlyphs) {
+ c = getWord(topPtr, 2);
+ topPtr += 2;
+ nLeft = getWord(topPtr, 2);
+ topPtr += 2;
+ for (j = 0; j <= nLeft; ++j)
+ glyphNames[i++] = c++;
+ }
+ }
+ }
+
+ // read encoding (glyph -> code mapping)
+ if (enc == 0) {
+ encoding = type1StdEncoding.copy();
+ } else if (enc == 1) {
+ encoding = type1ExpertEncoding.copy();
+ } else {
+ encoding = new FontEncoding();
+ topPtr = (Guchar *)file + enc;
+ encFormat = *topPtr++;
+ if ((encFormat & 0x7f) == 0) {
+ nCodes = 1 + *topPtr++;
+ if (nCodes > nGlyphs) {
+ nCodes = nGlyphs;
+ }
+ for (i = 1; i < nCodes; ++i) {
+ c = *topPtr++;
+ getString(glyphNames[i], stringIdxPtr, stringStartPtr,
+ stringOffSize, buf);
+ encoding->addChar(c, copyString(buf));
+ }
+ } else if ((encFormat & 0x7f) == 1) {
+ nRanges = *topPtr++;
+ nCodes = 1;
+ for (i = 0; i < nRanges; ++i) {
+ c = *topPtr++;
+ nLeft = *topPtr++;
+ for (j = 0; j <= nLeft && nCodes < nGlyphs; ++j) {
+ getString(glyphNames[nCodes], stringIdxPtr, stringStartPtr,
+ stringOffSize, buf);
+ encoding->addChar(c, copyString(buf));
+ ++nCodes;
+ ++c;
+ }
+ }
+ }
+ if (encFormat & 0x80) {
+ nSups = *topPtr++;
+ for (i = 0; i < nSups; ++i) {
+ c = *topPtr++;
+ sid = getWord(topPtr, 2);
+ topPtr += 2;
+ getString(sid, stringIdxPtr, stringStartPtr,
+ stringOffSize, buf);
+ encoding->addChar(c, copyString(buf));
+ }
+ }
+ }
+
+ if (charset > 2)
+ gfree(glyphNames);
+}
+
+Type1CFontFile::~Type1CFontFile() {
+ if (name)
+ gfree(name);
+ if (encoding && freeEnc)
+ delete encoding;
+}
+
+FontEncoding *Type1CFontFile::getEncoding(GBool taken) {
+ if (taken)
+ freeEnc = gFalse;
+ return encoding;
+}
+
+static Guint getWord(Guchar *ptr, int size) {
+ Guint x;
+ int i;
+
+ x = 0;
+ for (i = 0; i < size; ++i)
+ x = (x << 8) + *ptr++;
+ return x;
+}
+
+static double getNum(Guchar **ptr, GBool *fp) {
+ static char nybChars[16] = "0123456789.ee -";
+ int b0, b, nyb0, nyb1;
+ double x;
+ char buf[65];
+ int i;
+
+ x = 0;
+ *fp = gFalse;
+ b0 = (*ptr)[0];
+ if (b0 < 28) {
+ x = 0;
+ } else if (b0 == 28) {
+ x = ((*ptr)[1] << 8) + (*ptr)[2];
+ *ptr += 3;
+ } else if (b0 == 29) {
+ x = ((*ptr)[1] << 24) + ((*ptr)[2] << 16) + ((*ptr)[3] << 8) + (*ptr)[4];
+ *ptr += 5;
+ } else if (b0 == 30) {
+ *ptr += 1;
+ i = 0;
+ do {
+ b = *(*ptr)++;
+ nyb0 = b >> 4;
+ nyb1 = b & 0x0f;
+ if (nyb0 == 0xf)
+ break;
+ buf[i++] = nybChars[nyb0];
+ if (i == 64)
+ break;
+ if (nyb0 == 0xc)
+ buf[i++] = '-';
+ if (i == 64)
+ break;
+ if (nyb1 == 0xf)
+ break;
+ buf[i++] = nybChars[nyb1];
+ if (i == 64)
+ break;
+ if (nyb1 == 0xc)
+ buf[i++] = '-';
+ } while (i < 64);
+ buf[i] = '\0';
+ x = atof(buf);
+ *fp = gTrue;
+ } else if (b0 == 31) {
+ x = 0;
+ } else if (b0 < 247) {
+ x = b0 - 139;
+ *ptr += 1;
+ } else if (b0 < 251) {
+ x = ((b0 - 247) << 8) + (*ptr)[1] + 108;
+ *ptr += 2;
+ } else {
+ x = -((b0 - 251) << 8) - (*ptr)[1] - 108;
+ *ptr += 2;
+ }
+ return x;
+}
+
+static char *getString(int sid, Guchar *stringIdxPtr,
+ Guchar *stringStartPtr, int stringOffSize,
+ char *buf) {
+ Guchar *idxPtr0, *idxPtr1;
+ int len;
+
+ if (sid < 391) {
+ strcpy(buf, type1CStdStrings[sid]);
+ } else {
+ sid -= 391;
+ idxPtr0 = stringStartPtr + getWord(stringIdxPtr + sid * stringOffSize,
+ stringOffSize);
+ idxPtr1 = stringStartPtr + getWord(stringIdxPtr + (sid+1) * stringOffSize,
+ stringOffSize);
+ if ((len = idxPtr1 - idxPtr0) > 255)
+ len = 255;
+ strncpy(buf, (char *)idxPtr0, len);
+ buf[len] = '\0';
+ }
+ return buf;
+}
+
+//------------------------------------------------------------------------
+// Type1CFontConverter
+//------------------------------------------------------------------------
+
+Type1CFontConverter::Type1CFontConverter(char *file, int len, FILE *out) {
+ this->file = file;
+ this->len = len;
+ this->out = out;
+ r1 = 55665;
+ line = 0;
+}
+
+Type1CFontConverter::~Type1CFontConverter() {
+}
+
+void Type1CFontConverter::convert() {
+ char *fontName;
+ struct {
+ int version;
+ int notice;
+ int copyright;
+ int fullName;
+ int familyName;
+ int weight;
+ int isFixedPitch;
+ double italicAngle;
+ double underlinePosition;
+ double underlineThickness;
+ int paintType;
+ int charstringType; //~ ???
+ double fontMatrix[6];
+ int uniqueID;
+ double fontBBox[4];
+ double strokeWidth; //~ ???
+ int charset;
+ int encoding;
+ int charStrings;
+ int privateSize;
+ int privateOffset;
+ } dict;
+ char buf[256], eBuf[256];
+ Guchar *topPtr, *idxStartPtr, *idxPtr0, *idxPtr1;
+ Guchar *stringIdxPtr, *stringStartPtr;
+ int topOffSize, idxOffSize, stringOffSize;
+ int nFonts, nStrings, nGlyphs;
+ int nCodes, nRanges, nLeft, nSups;
+ Gushort *glyphNames;
+ int charsetFormat, encFormat;
+ int subrsOffset, nSubrs;
+ int nCharStrings;
+ int c, sid;
+ double x;
+ GBool isFP;
+ int key;
+ int i, j, n;
+
+ // read header
+ topPtr = (Guchar *)file + (file[2] & 0xff);
+ topOffSize = file[3] & 0xff;
+
+ // read name (first font only)
+ nFonts = getWord(topPtr, 2);
+ idxOffSize = topPtr[2];
+ topPtr += 3;
+ idxStartPtr = topPtr + (nFonts + 1) * idxOffSize - 1;
+ idxPtr0 = idxStartPtr + getWord(topPtr, idxOffSize);
+ idxPtr1 = idxStartPtr + getWord(topPtr + idxOffSize, idxOffSize);
+ if ((n = idxPtr1 - idxPtr0) > 255)
+ n = 255;
+ strncpy(buf, (char *)idxPtr0, n);
+ buf[n] = '\0';
+ fontName = copyString(buf);
+ topPtr = idxStartPtr + getWord(topPtr + nFonts * idxOffSize, idxOffSize);
+
+ // read top dict (first font only)
+ nFonts = getWord(topPtr, 2);
+ idxOffSize = topPtr[2];
+ topPtr += 3;
+ idxStartPtr = topPtr + (nFonts + 1) * idxOffSize - 1;
+ idxPtr0 = idxStartPtr + getWord(topPtr, idxOffSize);
+ idxPtr1 = idxStartPtr + getWord(topPtr + idxOffSize, idxOffSize);
+ dict.version = 0;
+ dict.notice = 0;
+ dict.copyright = 0;
+ dict.fullName = 0;
+ dict.familyName = 0;
+ dict.weight = 0;
+ dict.isFixedPitch = 0;
+ dict.italicAngle = 0;
+ dict.underlinePosition = -100;
+ dict.underlineThickness = 50;
+ dict.paintType = 0;
+ dict.charstringType = 2;
+ dict.fontMatrix[0] = 0.001;
+ dict.fontMatrix[1] = 0;
+ dict.fontMatrix[2] = 0;
+ dict.fontMatrix[3] = 0.001;
+ dict.fontMatrix[4] = 0;
+ dict.fontMatrix[5] = 0;
+ dict.uniqueID = 0;
+ dict.fontBBox[0] = 0;
+ dict.fontBBox[1] = 0;
+ dict.fontBBox[2] = 0;
+ dict.fontBBox[3] = 0;
+ dict.strokeWidth = 0;
+ dict.charset = 0;
+ dict.encoding = 0;
+ dict.charStrings = 0;
+ dict.privateSize = 0;
+ dict.privateOffset = 0;
+ i = 0;
+ while (idxPtr0 < idxPtr1) {
+ if (*idxPtr0 <= 27 || *idxPtr0 == 31) {
+ key = *idxPtr0++;
+ if (key == 0x0c)
+ key = (key << 8) | *idxPtr0++;
+ switch (key) {
+ case 0x0000: dict.version = (int)op[0]; break;
+ case 0x0001: dict.notice = (int)op[0]; break;
+ case 0x0c00: dict.copyright = (int)op[0]; break;
+ case 0x0002: dict.fullName = (int)op[0]; break;
+ case 0x0003: dict.familyName = (int)op[0]; break;
+ case 0x0004: dict.weight = (int)op[0]; break;
+ case 0x0c01: dict.isFixedPitch = (int)op[0]; break;
+ case 0x0c02: dict.italicAngle = op[0]; break;
+ case 0x0c03: dict.underlinePosition = op[0]; break;
+ case 0x0c04: dict.underlineThickness = op[0]; break;
+ case 0x0c05: dict.paintType = (int)op[0]; break;
+ case 0x0c06: dict.charstringType = (int)op[0]; break;
+ case 0x0c07: dict.fontMatrix[0] = op[0];
+ dict.fontMatrix[1] = op[1];
+ dict.fontMatrix[2] = op[2];
+ dict.fontMatrix[3] = op[3];
+ dict.fontMatrix[4] = op[4];
+ dict.fontMatrix[5] = op[5]; break;
+ case 0x000d: dict.uniqueID = (int)op[0]; break;
+ case 0x0005: dict.fontBBox[0] = op[0];
+ dict.fontBBox[1] = op[1];
+ dict.fontBBox[2] = op[2];
+ dict.fontBBox[3] = op[3]; break;
+ case 0x0c08: dict.strokeWidth = op[0]; break;
+ case 0x000f: dict.charset = (int)op[0]; break;
+ case 0x0010: dict.encoding = (int)op[0]; break;
+ case 0x0011: dict.charStrings = (int)op[0]; break;
+ case 0x0012: dict.privateSize = (int)op[0];
+ dict.privateOffset = (int)op[1]; break;
+ }
+ i = 0;
+ } else {
+ x = getNum(&idxPtr0, &isFP);
+ if (i < 48) {
+ op[i] = x;
+ fp[i++] = isFP;
+ }
+ }
+ }
+ topPtr = idxStartPtr + getWord(topPtr + nFonts * idxOffSize, idxOffSize);
+
+ // read string index
+ nStrings = getWord(topPtr, 2);
+ stringOffSize = topPtr[2];
+ topPtr += 3;
+ stringIdxPtr = topPtr;
+ stringStartPtr = topPtr + (nStrings + 1) * stringOffSize - 1;
+ topPtr = stringStartPtr + getWord(topPtr + nStrings * stringOffSize,
+ stringOffSize);
+
+#if 1 //~
+ // get global subrs
+ int nGSubrs;
+ int gSubrOffSize;
+
+ nGSubrs = getWord(topPtr, 2);
+ gSubrOffSize = topPtr[2];
+ topPtr += 3;
+#endif
+
+ // write header and font dictionary, up to encoding
+ fprintf(out, "%%!FontType1-1.0: %s", fontName);
+ if (dict.version != 0) {
+ fprintf(out, "%s",
+ getString(dict.version, stringIdxPtr, stringStartPtr,
+ stringOffSize, buf));
+ }
+ fprintf(out, "\n");
+ fprintf(out, "11 dict begin\n");
+ fprintf(out, "/FontInfo 10 dict dup begin\n");
+ if (dict.version != 0) {
+ fprintf(out, "/version (%s) readonly def\n",
+ getString(dict.version, stringIdxPtr, stringStartPtr,
+ stringOffSize, buf));
+ }
+ if (dict.notice != 0) {
+ fprintf(out, "/Notice (%s) readonly def\n",
+ getString(dict.notice, stringIdxPtr, stringStartPtr,
+ stringOffSize, buf));
+ }
+ if (dict.copyright != 0) {
+ fprintf(out, "/Copyright (%s) readonly def\n",
+ getString(dict.copyright, stringIdxPtr, stringStartPtr,
+ stringOffSize, buf));
+ }
+ if (dict.fullName != 0) {
+ fprintf(out, "/FullName (%s) readonly def\n",
+ getString(dict.fullName, stringIdxPtr, stringStartPtr,
+ stringOffSize, buf));
+ }
+ if (dict.familyName != 0) {
+ fprintf(out, "/FamilyName (%s) readonly def\n",
+ getString(dict.familyName, stringIdxPtr, stringStartPtr,
+ stringOffSize, buf));
+ }
+ if (dict.weight != 0) {
+ fprintf(out, "/Weight (%s) readonly def\n",
+ getString(dict.weight, stringIdxPtr, stringStartPtr,
+ stringOffSize, buf));
+ }
+ fprintf(out, "/isFixedPitch %s def\n", dict.isFixedPitch ? "true" : "false");
+ fprintf(out, "/ItalicAngle %g def\n", dict.italicAngle);
+ fprintf(out, "/UnderlinePosition %g def\n", dict.underlinePosition);
+ fprintf(out, "/UnderlineThickness %g def\n", dict.underlineThickness);
+ fprintf(out, "end readonly def\n");
+ fprintf(out, "/FontName /%s def\n", fontName);
+ fprintf(out, "/PaintType %d def\n", dict.paintType);
+ fprintf(out, "/FontType 1 def\n");
+ fprintf(out, "/FontMatrix [%g %g %g %g %g %g] readonly def\n",
+ dict.fontMatrix[0], dict.fontMatrix[1], dict.fontMatrix[2],
+ dict.fontMatrix[3], dict.fontMatrix[4], dict.fontMatrix[5]);
+ fprintf(out, "/FontBBox [%g %g %g %g] readonly def\n",
+ dict.fontBBox[0], dict.fontBBox[1],
+ dict.fontBBox[2], dict.fontBBox[3]);
+ if (dict.uniqueID != 0) {
+ fprintf(out, "/UniqueID %d def\n", dict.uniqueID);
+ }
+
+ // get number of glyphs from charstrings index
+ topPtr = (Guchar *)file + dict.charStrings;
+ nGlyphs = getWord(topPtr, 2);
+
+ // read charset
+ if (dict.charset == 0) {
+ glyphNames = type1CISOAdobeCharset;
+ } else if (dict.charset == 1) {
+ glyphNames = type1CExpertCharset;
+ } else if (dict.charset == 2) {
+ glyphNames = type1CExpertSubsetCharset;
+ } else {
+ glyphNames = (Gushort *)gmalloc(nGlyphs * sizeof(Gushort));
+ glyphNames[0] = 0;
+ topPtr = (Guchar *)file + dict.charset;
+ charsetFormat = *topPtr++;
+ if (charsetFormat == 0) {
+ for (i = 1; i < nGlyphs; ++i) {
+ glyphNames[i] = getWord(topPtr, 2);
+ topPtr += 2;
+ }
+ } else if (charsetFormat == 1) {
+ i = 1;
+ while (i < nGlyphs) {
+ c = getWord(topPtr, 2);
+ topPtr += 2;
+ nLeft = *topPtr++;
+ for (j = 0; j <= nLeft; ++j)
+ glyphNames[i++] = c++;
+ }
+ } else if (charsetFormat == 2) {
+ i = 1;
+ while (i < nGlyphs) {
+ c = getWord(topPtr, 2);
+ topPtr += 2;
+ nLeft = getWord(topPtr, 2);
+ topPtr += 2;
+ for (j = 0; j <= nLeft; ++j)
+ glyphNames[i++] = c++;
+ }
+ }
+ }
+
+ // read encoding (glyph -> code mapping), write Type 1 encoding
+ fprintf(out, "/Encoding ");
+ if (dict.encoding == 0) {
+ fprintf(out, "StandardEncoding def\n");
+ } else {
+ fprintf(out, "256 array\n");
+ fprintf(out, "0 1 255 {1 index exch /.notdef put} for\n");
+ if (dict.encoding == 1) {
+ for (i = 0; i < 256; ++i) {
+ if (type1ExpertEncodingNames[i])
+ fprintf(out, "dup %d /%s put\n", i, type1ExpertEncodingNames[i]);
+ }
+ } else {
+ topPtr = (Guchar *)file + dict.encoding;
+ encFormat = *topPtr++;
+ if ((encFormat & 0x7f) == 0) {
+ nCodes = 1 + *topPtr++;
+ if (nCodes > nGlyphs) {
+ nCodes = nGlyphs;
+ }
+ for (i = 1; i < nCodes; ++i) {
+ c = *topPtr++;
+ fprintf(out, "dup %d /%s put\n", c,
+ getString(glyphNames[i], stringIdxPtr, stringStartPtr,
+ stringOffSize, buf));
+ }
+ } else if ((encFormat & 0x7f) == 1) {
+ nRanges = *topPtr++;
+ nCodes = 1;
+ for (i = 0; i < nRanges; ++i) {
+ c = *topPtr++;
+ nLeft = *topPtr++;
+ for (j = 0; j <= nLeft && nCodes < nGlyphs; ++j) {
+ fprintf(out, "dup %d /%s put\n", c,
+ getString(glyphNames[nCodes], stringIdxPtr, stringStartPtr,
+ stringOffSize, buf));
+ ++nCodes;
+ ++c;
+ }
+ }
+ }
+ if (encFormat & 0x80) {
+ nSups = *topPtr++;
+ for (i = 0; i < nSups; ++i) {
+ c = *topPtr++;
+ sid = getWord(topPtr, 2);
+ topPtr += 2;
+ fprintf(out, "dup %d /%s put\n", c,
+ getString(sid, stringIdxPtr, stringStartPtr,
+ stringOffSize, buf));
+ }
+ }
+ }
+ fprintf(out, "readonly def\n");
+ }
+ fprintf(out, "currentdict end\n");
+ fprintf(out, "currentfile eexec\n");
+
+ // get private dictionary
+ eexecWrite("\x83\xca\x73\xd5");
+ eexecWrite("dup /Private 32 dict dup begin\n");
+ eexecWrite("/RD {string currentfile exch readstring pop} executeonly def\n");
+ eexecWrite("/ND {noaccess def} executeonly def\n");
+ eexecWrite("/NP {noaccess put} executeonly def\n");
+ eexecWrite("/MinFeature {16 16} ND\n");
+ eexecWrite("/password 5839 def\n");
+ subrsOffset = 0;
+ defaultWidthX = 0;
+ nominalWidthX = 0;
+ topPtr = (Guchar *)file + dict.privateOffset;
+ idxPtr0 = topPtr;
+ idxPtr1 = idxPtr0 + dict.privateSize;
+ i = 0;
+ while (idxPtr0 < idxPtr1) {
+ if (*idxPtr0 <= 27 || *idxPtr0 == 31) {
+ key = *idxPtr0++;
+ if (key == 0x0c)
+ key = (key << 8) | *idxPtr0++;
+ switch (key) {
+ case 0x0006:
+ getDeltaInt(eBuf, "BlueValues", op, i);
+ eexecWrite(eBuf);
+ break;
+ case 0x0007:
+ getDeltaInt(eBuf, "OtherBlues", op, i);
+ eexecWrite(eBuf);
+ break;
+ case 0x0008:
+ getDeltaInt(eBuf, "FamilyBlues", op, i);
+ eexecWrite(eBuf);
+ break;
+ case 0x0009:
+ getDeltaInt(eBuf, "FamilyOtherBlues", op, i);
+ eexecWrite(eBuf);
+ break;
+ case 0x0c09:
+ sprintf(eBuf, "/BlueScale %g def\n", op[0]);
+ eexecWrite(eBuf);
+ break;
+ case 0x0c0a:
+ sprintf(eBuf, "/BlueShift %d def\n", (int)op[0]);
+ eexecWrite(eBuf);
+ break;
+ case 0x0c0b:
+ sprintf(eBuf, "/BlueFuzz %d def\n", (int)op[0]);
+ eexecWrite(eBuf);
+ break;
+ case 0x000a:
+ sprintf(eBuf, "/StdHW [%g] def\n", op[0]);
+ eexecWrite(eBuf);
+ break;
+ case 0x000b:
+ sprintf(eBuf, "/StdVW [%g] def\n", op[0]);
+ eexecWrite(eBuf);
+ break;
+ case 0x0c0c:
+ getDeltaReal(eBuf, "StemSnapH", op, i);
+ eexecWrite(eBuf);
+ break;
+ case 0x0c0d:
+ getDeltaReal(eBuf, "StemSnapV", op, i);
+ eexecWrite(eBuf);
+ break;
+ case 0x0c0e:
+ sprintf(eBuf, "/ForceBold %s def\n", op[0] ? "true" : "false");
+ eexecWrite(eBuf);
+ break;
+ case 0x0c0f:
+ sprintf(eBuf, "/ForceBoldThreshold %g def\n", op[0]);
+ eexecWrite(eBuf);
+ break;
+ case 0x0c11:
+ sprintf(eBuf, "/LanguageGroup %d def\n", (int)op[0]);
+ eexecWrite(eBuf);
+ break;
+ case 0x0c12:
+ sprintf(eBuf, "/ExpansionFactor %g def\n", op[0]);
+ eexecWrite(eBuf);
+ break;
+ case 0x0c13:
+ error(-1, "Got Type 1C InitialRandomSeed");
+ break;
+ case 0x0013:
+ subrsOffset = (int)op[0];
+ break;
+ case 0x0014:
+ defaultWidthX = op[0];
+ defaultWidthXFP = fp[0];
+ break;
+ case 0x0015:
+ nominalWidthX = op[0];
+ nominalWidthXFP = fp[0];
+ break;
+ default:
+ error(-1, "Uknown Type 1C private dict entry %04x", key);
+ break;
+ }
+ i = 0;
+ } else {
+ x = getNum(&idxPtr0, &isFP);
+ if (i < 48) {
+ op[i] = x;
+ fp[i++] = isFP;
+ }
+ }
+ }
+
+ // get subrs
+ if (subrsOffset != 0) {
+ topPtr += subrsOffset;
+ nSubrs = getWord(topPtr, 2);
+ idxOffSize = topPtr[2];
+ topPtr += 3;
+ sprintf(eBuf, "/Subrs %d array\n", nSubrs);
+ eexecWrite(eBuf);
+ idxStartPtr = topPtr + (nSubrs + 1) * idxOffSize - 1;
+ idxPtr1 = idxStartPtr + getWord(topPtr, idxOffSize);
+ for (i = 0; i < nSubrs; ++i) {
+ idxPtr0 = idxPtr1;
+ idxPtr1 = idxStartPtr + getWord(topPtr + (i+1)*idxOffSize, idxOffSize);
+ n = idxPtr1 - idxPtr0;
+#if 1 //~
+ error(-1, "Unimplemented Type 2 subrs");
+#else
+ sprintf(eBuf, "dup %d %d RD ", i, n);
+ eexecWrite(eBuf);
+ cvtGlyph(idxPtr0, n);
+ eexecWrite(" NP\n");
+#endif
+ }
+ eexecWrite("ND\n");
+ }
+
+ // get CharStrings
+ topPtr = (Guchar *)file + dict.charStrings;
+ nCharStrings = getWord(topPtr, 2);
+ idxOffSize = topPtr[2];
+ topPtr += 3;
+ sprintf(eBuf, "2 index /CharStrings %d dict dup begin\n", nCharStrings);
+ eexecWrite(eBuf);
+ idxStartPtr = topPtr + (nCharStrings + 1) * idxOffSize - 1;
+ idxPtr1 = idxStartPtr + getWord(topPtr, idxOffSize);
+ for (i = 0; i < nCharStrings; ++i) {
+ idxPtr0 = idxPtr1;
+ idxPtr1 = idxStartPtr + getWord(topPtr + (i+1)*idxOffSize, idxOffSize);
+ n = idxPtr1 - idxPtr0;
+ cvtGlyph(getString(glyphNames[i], stringIdxPtr, stringStartPtr,
+ stringOffSize, buf),
+ idxPtr0, n);
+ }
+ eexecWrite("end\n");
+ eexecWrite("end\n");
+ eexecWrite("readonly put\n");
+ eexecWrite("noaccess put\n");
+ eexecWrite("dup /FontName get exch definefont pop\n");
+ eexecWrite("mark currentfile closefile\n");
+
+ // trailer
+ if (line > 0)
+ fputc('\n', out);
+ for (i = 0; i < 8; ++i) {
+ fprintf(out, "0000000000000000000000000000000000000000000000000000000000000000\n");
+ }
+ fprintf(out, "cleartomark\n");
+
+ // clean up
+ if (dict.charset > 2)
+ gfree(glyphNames);
+ gfree(fontName);
+}
+
+void Type1CFontConverter::eexecWrite(char *s) {
+ Guchar *p;
+ Guchar x;
+
+ for (p = (Guchar *)s; *p; ++p) {
+ x = *p ^ (r1 >> 8);
+ r1 = (x + r1) * 52845 + 22719;
+ fputc(hexChars[x >> 4], out);
+ fputc(hexChars[x & 0x0f], out);
+ line += 2;
+ if (line == 64) {
+ fputc('\n', out);
+ line = 0;
+ }
+ }
+}
+
+void Type1CFontConverter::cvtGlyph(char *name, Guchar *s, int n) {
+ int nHints;
+ int x;
+ GBool first = gTrue;
+ char eBuf[256];
+ double d, dx, dy;
+ GBool dFP;
+ int i, k;
+
+ charBuf = new GString();
+ charBuf->append((char)73);
+ charBuf->append((char)58);
+ charBuf->append((char)147);
+ charBuf->append((char)134);
+
+ i = 0;
+ nOps = 0;
+ nHints = 0;
+ while (i < n) {
+ if (s[i] == 12) {
+ switch (s[i+1]) {
+ case 0: // dotsection (should be Type 1 only?)
+ //~ ignored
+ break;
+ case 34: // hflex
+ if (nOps != 7) {
+ error(-1, "Wrong number of args (%d) to Type 2 hflex", nOps);
+ }
+ eexecDumpNum(op[0], fp[0]);
+ eexecDumpNum(0, gFalse);
+ eexecDumpNum(op[1], fp[1]);
+ eexecDumpNum(op[2], fp[2]);
+ eexecDumpNum(op[3], fp[3]);
+ eexecDumpNum(0, gFalse);
+ eexecDumpOp1(8);
+ eexecDumpNum(op[4], fp[4]);
+ eexecDumpNum(0, gFalse);
+ eexecDumpNum(op[5], fp[5]);
+ eexecDumpNum(-op[2], fp[2]);
+ eexecDumpNum(op[6], fp[6]);
+ eexecDumpNum(0, gFalse);
+ eexecDumpOp1(8);
+ break;
+ case 35: // flex
+ if (nOps != 13) {
+ error(-1, "Wrong number of args (%d) to Type 2 flex", nOps);
+ }
+ eexecDumpNum(op[0], fp[0]);
+ eexecDumpNum(op[1], fp[1]);
+ eexecDumpNum(op[2], fp[2]);
+ eexecDumpNum(op[3], fp[3]);
+ eexecDumpNum(op[4], fp[4]);
+ eexecDumpNum(op[5], fp[5]);
+ eexecDumpOp1(8);
+ eexecDumpNum(op[6], fp[6]);
+ eexecDumpNum(op[7], fp[7]);
+ eexecDumpNum(op[8], fp[8]);
+ eexecDumpNum(op[9], fp[9]);
+ eexecDumpNum(op[10], fp[10]);
+ eexecDumpNum(op[11], fp[11]);
+ eexecDumpOp1(8);
+ break;
+ case 36: // hflex1
+ if (nOps != 9) {
+ error(-1, "Wrong number of args (%d) to Type 2 hflex1", nOps);
+ }
+ eexecDumpNum(op[0], fp[0]);
+ eexecDumpNum(op[1], fp[1]);
+ eexecDumpNum(op[2], fp[2]);
+ eexecDumpNum(op[3], fp[3]);
+ eexecDumpNum(op[4], fp[4]);
+ eexecDumpNum(0, gFalse);
+ eexecDumpOp1(8);
+ eexecDumpNum(op[5], fp[5]);
+ eexecDumpNum(0, gFalse);
+ eexecDumpNum(op[6], fp[6]);
+ eexecDumpNum(op[7], fp[7]);
+ eexecDumpNum(op[8], fp[8]);
+ eexecDumpNum(-(op[1] + op[3] + op[7]), fp[1] | fp[3] | fp[7]);
+ eexecDumpOp1(8);
+ break;
+ case 37: // flex1
+ if (nOps != 11) {
+ error(-1, "Wrong number of args (%d) to Type 2 flex1", nOps);
+ }
+ eexecDumpNum(op[0], fp[0]);
+ eexecDumpNum(op[1], fp[1]);
+ eexecDumpNum(op[2], fp[2]);
+ eexecDumpNum(op[3], fp[3]);
+ eexecDumpNum(op[4], fp[4]);
+ eexecDumpNum(op[5], fp[5]);
+ eexecDumpOp1(8);
+ eexecDumpNum(op[6], fp[6]);
+ eexecDumpNum(op[7], fp[7]);
+ eexecDumpNum(op[8], fp[8]);
+ eexecDumpNum(op[9], fp[9]);
+ dx = op[0] + op[2] + op[4] + op[6] + op[8];
+ dy = op[1] + op[3] + op[5] + op[7] + op[9];
+ if (fabs(dx) > fabs(dy)) {
+ eexecDumpNum(op[10], fp[10]);
+ eexecDumpNum(-dy, fp[1] | fp[3] | fp[5] | fp[7] | fp[9]);
+ } else {
+ eexecDumpNum(-dx, fp[0] | fp[2] | fp[4] | fp[6] | fp[8]);
+ eexecDumpNum(op[10], fp[10]);
+ }
+ eexecDumpOp1(8);
+ break;
+ case 3: // and
+ case 4: // or
+ case 5: // not
+ case 8: // store
+ case 9: // abs
+ case 10: // add
+ case 11: // sub
+ case 12: // div
+ case 13: // load
+ case 14: // neg
+ case 15: // eq
+ case 18: // drop
+ case 20: // put
+ case 21: // get
+ case 22: // ifelse
+ case 23: // random
+ case 24: // mul
+ case 26: // sqrt
+ case 27: // dup
+ case 28: // exch
+ case 29: // index
+ case 30: // roll
+ error(-1, "Unimplemented Type 2 charstring op: 12.%d", s[i+1]);
+ break;
+ default:
+ error(-1, "Illegal Type 2 charstring op: 12.%d", s[i+1]);
+ break;
+ }
+ i += 2;
+ nOps = 0;
+ } else if (s[i] == 19) { // hintmask
+ //~ ignored
+ if (first) {
+ cvtGlyphWidth(nOps == 1);
+ first = gFalse;
+ }
+ if (nOps > 0) {
+ if (nOps & 1) {
+ error(-1, "Wrong number of args (%d) to Type 2 hintmask/vstemhm",
+ nOps);
+ }
+ nHints += nOps / 2;
+ }
+ i += 1 + ((nHints + 7) >> 3);
+ nOps = 0;
+ } else if (s[i] == 20) { // cntrmask
+ //~ ignored
+ if (first) {
+ cvtGlyphWidth(nOps == 1);
+ first = gFalse;
+ }
+ if (nOps > 0) {
+ if (nOps & 1) {
+ error(-1, "Wrong number of args (%d) to Type 2 cntrmask/vstemhm",
+ nOps);
+ }
+ nHints += nOps / 2;
+ }
+ i += 1 + ((nHints + 7) >> 3);
+ nOps = 0;
+ } else if (s[i] == 28) {
+ x = (s[i+1] << 8) + s[i+2];
+ if (x & 0x8000)
+ x |= -1 << 15;
+ if (nOps < 48) {
+ fp[nOps] = gFalse;
+ op[nOps++] = x;
+ }
+ i += 3;
+ } else if (s[i] <= 31) {
+ switch (s[i]) {
+ case 4: // vmoveto
+ if (first) {
+ cvtGlyphWidth(nOps == 2);
+ first = gFalse;
+ }
+ if (nOps != 1)
+ error(-1, "Wrong number of args (%d) to Type 2 vmoveto", nOps);
+ eexecDumpNum(op[0], fp[0]);
+ eexecDumpOp1(4);
+ break;
+ case 5: // rlineto
+ if (nOps < 2 || nOps % 2 != 0)
+ error(-1, "Wrong number of args (%d) to Type 2 rlineto", nOps);
+ for (k = 0; k < nOps; k += 2) {
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpOp1(5);
+ }
+ break;
+ case 6: // hlineto
+ if (nOps < 1)
+ error(-1, "Wrong number of args (%d) to Type 2 hlineto", nOps);
+ for (k = 0; k < nOps; ++k) {
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpOp1((k & 1) ? 7 : 6);
+ }
+ break;
+ case 7: // vlineto
+ if (nOps < 1)
+ error(-1, "Wrong number of args (%d) to Type 2 vlineto", nOps);
+ for (k = 0; k < nOps; ++k) {
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpOp1((k & 1) ? 6 : 7);
+ }
+ break;
+ case 8: // rrcurveto
+ if (nOps < 6 || nOps % 6 != 0)
+ error(-1, "Wrong number of args (%d) to Type 2 rrcurveto", nOps);
+ for (k = 0; k < nOps; k += 6) {
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpNum(op[k+2], fp[k+2]);
+ eexecDumpNum(op[k+3], fp[k+3]);
+ eexecDumpNum(op[k+4], fp[k+4]);
+ eexecDumpNum(op[k+5], fp[k+5]);
+ eexecDumpOp1(8);
+ }
+ break;
+ case 14: // endchar / seac
+ if (first) {
+ cvtGlyphWidth(nOps == 1 || nOps == 5);
+ first = gFalse;
+ }
+ if (nOps == 4) {
+ eexecDumpNum(0, 0);
+ eexecDumpNum(op[0], fp[0]);
+ eexecDumpNum(op[1], fp[1]);
+ eexecDumpNum(op[2], fp[2]);
+ eexecDumpNum(op[3], fp[3]);
+ eexecDumpOp2(6);
+ } else if (nOps == 0) {
+ eexecDumpOp1(14);
+ } else {
+ error(-1, "Wrong number of args (%d) to Type 2 endchar", nOps);
+ }
+ break;
+ case 21: // rmoveto
+ if (first) {
+ cvtGlyphWidth(nOps == 3);
+ first = gFalse;
+ }
+ if (nOps != 2)
+ error(-1, "Wrong number of args (%d) to Type 2 rmoveto", nOps);
+ eexecDumpNum(op[0], fp[0]);
+ eexecDumpNum(op[1], fp[1]);
+ eexecDumpOp1(21);
+ break;
+ case 22: // hmoveto
+ if (first) {
+ cvtGlyphWidth(nOps == 2);
+ first = gFalse;
+ }
+ if (nOps != 1)
+ error(-1, "Wrong number of args (%d) to Type 2 hmoveto", nOps);
+ eexecDumpNum(op[0], fp[0]);
+ eexecDumpOp1(22);
+ break;
+ case 24: // rcurveline
+ if (nOps < 8 || (nOps - 2) % 6 != 0)
+ error(-1, "Wrong number of args (%d) to Type 2 rcurveline", nOps);
+ for (k = 0; k < nOps - 2; k += 6) {
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpNum(op[k+2], fp[k+2]);
+ eexecDumpNum(op[k+3], fp[k+3]);
+ eexecDumpNum(op[k+4], fp[k+4]);
+ eexecDumpNum(op[k+5], fp[k+5]);
+ eexecDumpOp1(8);
+ }
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(op[k+1], fp[k]);
+ eexecDumpOp1(5);
+ break;
+ case 25: // rlinecurve
+ if (nOps < 8 || (nOps - 6) % 2 != 0)
+ error(-1, "Wrong number of args (%d) to Type 2 rlinecurve", nOps);
+ for (k = 0; k < nOps - 6; k += 2) {
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(op[k+1], fp[k]);
+ eexecDumpOp1(5);
+ }
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpNum(op[k+2], fp[k+2]);
+ eexecDumpNum(op[k+3], fp[k+3]);
+ eexecDumpNum(op[k+4], fp[k+4]);
+ eexecDumpNum(op[k+5], fp[k+5]);
+ eexecDumpOp1(8);
+ break;
+ case 26: // vvcurveto
+ if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0))
+ error(-1, "Wrong number of args (%d) to Type 2 vvcurveto", nOps);
+ if (nOps % 2 == 1) {
+ eexecDumpNum(op[0], fp[0]);
+ eexecDumpNum(op[1], fp[1]);
+ eexecDumpNum(op[2], fp[2]);
+ eexecDumpNum(op[3], fp[3]);
+ eexecDumpNum(0, gFalse);
+ eexecDumpNum(op[4], fp[4]);
+ eexecDumpOp1(8);
+ k = 5;
+ } else {
+ k = 0;
+ }
+ for (; k < nOps; k += 4) {
+ eexecDumpNum(0, gFalse);
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpNum(op[k+2], fp[k+2]);
+ eexecDumpNum(0, gFalse);
+ eexecDumpNum(op[k+3], fp[k+3]);
+ eexecDumpOp1(8);
+ }
+ break;
+ case 27: // hhcurveto
+ if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0))
+ error(-1, "Wrong number of args (%d) to Type 2 hhcurveto", nOps);
+ if (nOps % 2 == 1) {
+ eexecDumpNum(op[1], fp[1]);
+ eexecDumpNum(op[0], fp[0]);
+ eexecDumpNum(op[2], fp[2]);
+ eexecDumpNum(op[3], fp[3]);
+ eexecDumpNum(op[4], fp[4]);
+ eexecDumpNum(0, gFalse);
+ eexecDumpOp1(8);
+ k = 5;
+ } else {
+ k = 0;
+ }
+ for (; k < nOps; k += 4) {
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(0, gFalse);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpNum(op[k+2], fp[k+2]);
+ eexecDumpNum(op[k+3], fp[k+3]);
+ eexecDumpNum(0, gFalse);
+ eexecDumpOp1(8);
+ }
+ break;
+ case 30: // vhcurveto
+ if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0))
+ error(-1, "Wrong number of args (%d) to Type 2 vhcurveto", nOps);
+ for (k = 0; k < nOps && k != nOps-5; k += 4) {
+ if (k % 8 == 0) {
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpNum(op[k+2], fp[k+2]);
+ eexecDumpNum(op[k+3], fp[k+3]);
+ eexecDumpOp1(30);
+ } else {
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpNum(op[k+2], fp[k+2]);
+ eexecDumpNum(op[k+3], fp[k+3]);
+ eexecDumpOp1(31);
+ }
+ }
+ if (k == nOps-5) {
+ if (k % 8 == 0) {
+ eexecDumpNum(0, gFalse);
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpNum(op[k+2], fp[k+2]);
+ eexecDumpNum(op[k+3], fp[k+3]);
+ eexecDumpNum(op[k+4], fp[k+4]);
+ } else {
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(0, gFalse);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpNum(op[k+2], fp[k+2]);
+ eexecDumpNum(op[k+4], fp[k+4]);
+ eexecDumpNum(op[k+3], fp[k+3]);
+ }
+ eexecDumpOp1(8);
+ }
+ break;
+ case 31: // hvcurveto
+ if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0))
+ error(-1, "Wrong number of args (%d) to Type 2 hvcurveto", nOps);
+ for (k = 0; k < nOps && k != nOps-5; k += 4) {
+ if (k % 8 == 0) {
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpNum(op[k+2], fp[k+2]);
+ eexecDumpNum(op[k+3], fp[k+3]);
+ eexecDumpOp1(31);
+ } else {
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpNum(op[k+2], fp[k+2]);
+ eexecDumpNum(op[k+3], fp[k+3]);
+ eexecDumpOp1(30);
+ }
+ }
+ if (k == nOps-5) {
+ if (k % 8 == 0) {
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(0, gFalse);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpNum(op[k+2], fp[k+2]);
+ eexecDumpNum(op[k+4], fp[k+4]);
+ eexecDumpNum(op[k+3], fp[k+3]);
+ } else {
+ eexecDumpNum(0, gFalse);
+ eexecDumpNum(op[k], fp[k]);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ eexecDumpNum(op[k+2], fp[k+2]);
+ eexecDumpNum(op[k+3], fp[k+3]);
+ eexecDumpNum(op[k+4], fp[k+4]);
+ }
+ eexecDumpOp1(8);
+ }
+ break;
+ case 1: // hstem
+ if (first) {
+ cvtGlyphWidth(nOps & 1);
+ first = gFalse;
+ }
+ if (nOps & 1) {
+ error(-1, "Wrong number of args (%d) to Type 2 hstem", nOps);
+ }
+ d = 0;
+ dFP = gFalse;
+ for (k = 0; k < nOps; k += 2) {
+ if (op[k+1] < 0) {
+ d += op[k] + op[k+1];
+ dFP |= fp[k] | fp[k+1];
+ eexecDumpNum(d, dFP);
+ eexecDumpNum(-op[k+1], fp[k+1]);
+ } else {
+ d += op[k];
+ dFP |= fp[k];
+ eexecDumpNum(d, dFP);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ d += op[k+1];
+ dFP |= fp[k+1];
+ }
+ eexecDumpOp1(1);
+ }
+ nHints += nOps / 2;
+ break;
+ case 3: // vstem
+ if (first) {
+ cvtGlyphWidth(nOps & 1);
+ first = gFalse;
+ }
+ if (nOps & 1) {
+ error(-1, "Wrong number of args (%d) to Type 2 vstem", nOps);
+ }
+ d = 0;
+ dFP = gFalse;
+ for (k = 0; k < nOps; k += 2) {
+ if (op[k+1] < 0) {
+ d += op[k] + op[k+1];
+ dFP |= fp[k] | fp[k+1];
+ eexecDumpNum(d, dFP);
+ eexecDumpNum(-op[k+1], fp[k+1]);
+ } else {
+ d += op[k];
+ dFP |= fp[k];
+ eexecDumpNum(d, dFP);
+ eexecDumpNum(op[k+1], fp[k+1]);
+ d += op[k+1];
+ dFP |= fp[k+1];
+ }
+ eexecDumpOp1(3);
+ }
+ nHints += nOps / 2;
+ break;
+ case 18: // hstemhm
+ //~ ignored
+ if (first) {
+ cvtGlyphWidth(nOps & 1);
+ first = gFalse;
+ }
+ if (nOps & 1) {
+ error(-1, "Wrong number of args (%d) to Type 2 hstemhm", nOps);
+ }
+ nHints += nOps / 2;
+ break;
+ case 23: // vstemhm
+ //~ ignored
+ if (first) {
+ cvtGlyphWidth(nOps & 1);
+ first = gFalse;
+ }
+ if (nOps & 1) {
+ error(-1, "Wrong number of args (%d) to Type 2 vstemhm", nOps);
+ }
+ nHints += nOps / 2;
+ break;
+ case 10: // callsubr
+ case 11: // return
+ case 16: // blend
+ case 29: // callgsubr
+ error(-1, "Unimplemented Type 2 charstring op: %d", s[i]);
+ break;
+ default:
+ error(-1, "Illegal Type 2 charstring op: %d", s[i]);
+ break;
+ }
+ ++i;
+ nOps = 0;
+ } else if (s[i] <= 246) {
+ if (nOps < 48) {
+ fp[nOps] = gFalse;
+ op[nOps++] = (int)s[i] - 139;
+ }
+ ++i;
+ } else if (s[i] <= 250) {
+ if (nOps < 48) {
+ fp[nOps] = gFalse;
+ op[nOps++] = (((int)s[i] - 247) << 8) + (int)s[i+1] + 108;
+ }
+ i += 2;
+ } else if (s[i] <= 254) {
+ if (nOps < 48) {
+ fp[nOps] = gFalse;
+ op[nOps++] = -(((int)s[i] - 251) << 8) - (int)s[i+1] - 108;
+ }
+ i += 2;
+ } else {
+ x = (s[i+1] << 24) | (s[i+2] << 16) | (s[i+3] << 8) | s[i+4];
+ if (x & 0x80000000)
+ x |= -1 << 31;
+ if (nOps < 48) {
+ fp[nOps] = gTrue;
+ op[nOps++] = (double)x / 65536.0;
+ }
+ i += 5;
+ }
+ }
+
+ sprintf(eBuf, "/%s %d RD ", name, charBuf->getLength());
+ eexecWrite(eBuf);
+ eexecWriteCharstring((Guchar *)charBuf->getCString(), charBuf->getLength());
+ eexecWrite(" ND\n");
+ delete charBuf;
+}
+
+void Type1CFontConverter::cvtGlyphWidth(GBool useOp) {
+ double w;
+ GBool wFP;
+ int i;
+
+ if (useOp) {
+ w = nominalWidthX + op[0];
+ wFP = nominalWidthXFP | fp[0];
+ for (i = 1; i < nOps; ++i) {
+ op[i-1] = op[i];
+ fp[i-1] = fp[i];
+ }
+ --nOps;
+ } else {
+ w = defaultWidthX;
+ wFP = defaultWidthXFP;
+ }
+ eexecDumpNum(0, gFalse);
+ eexecDumpNum(w, wFP);
+ eexecDumpOp1(13);
+}
+
+void Type1CFontConverter::eexecDumpNum(double x, GBool fp) {
+ Guchar buf[12];
+ int y, n;
+
+ n = 0;
+ if (fp) {
+ if (x >= -32768 && x < 32768) {
+ y = (int)(x * 256.0);
+ buf[0] = 255;
+ buf[1] = (Guchar)(y >> 24);
+ buf[2] = (Guchar)(y >> 16);
+ buf[3] = (Guchar)(y >> 8);
+ buf[4] = (Guchar)y;
+ buf[5] = 255;
+ buf[6] = 0;
+ buf[7] = 0;
+ buf[8] = 1;
+ buf[9] = 0;
+ buf[10] = 12;
+ buf[11] = 12;
+ n = 12;
+ } else {
+ error(-1, "Type 2 fixed point constant out of range");
+ }
+ } else {
+ y = (int)x;
+ if (y >= -107 && y <= 107) {
+ buf[0] = (Guchar)(y + 139);
+ n = 1;
+ } else if (y > 107 && y <= 1131) {
+ y -= 108;
+ buf[0] = (Guchar)((y >> 8) + 247);
+ buf[1] = (Guchar)(y & 0xff);
+ n = 2;
+ } else if (y < -107 && y >= -1131) {
+ y = -y - 108;
+ buf[0] = (Guchar)((y >> 8) + 251);
+ buf[1] = (Guchar)(y & 0xff);
+ n = 2;
+ } else {
+ buf[0] = 255;
+ buf[1] = (Guchar)(y >> 24);
+ buf[2] = (Guchar)(y >> 16);
+ buf[3] = (Guchar)(y >> 8);
+ buf[4] = (Guchar)y;
+ n = 5;
+ }
+ }
+ charBuf->append((char *)buf, n);
+}
+
+void Type1CFontConverter::eexecDumpOp1(int op) {
+ charBuf->append((char)op);
+}
+
+void Type1CFontConverter::eexecDumpOp2(int op) {
+ charBuf->append((char)12);
+ charBuf->append((char)op);
+}
+
+void Type1CFontConverter::eexecWriteCharstring(Guchar *s, int n) {
+ Gushort r2;
+ Guchar x;
+ int i;
+
+ r2 = 4330;
+
+ for (i = 0; i < n; ++i) {
+ // charstring encryption
+ x = s[i];
+ x ^= (r2 >> 8);
+ r2 = (x + r2) * 52845 + 22719;
+
+ // eexec encryption
+ x ^= (r1 >> 8);
+ r1 = (x + r1) * 52845 + 22719;
+ fputc(hexChars[x >> 4], out);
+ fputc(hexChars[x & 0x0f], out);
+ line += 2;
+ if (line == 64) {
+ fputc('\n', out);
+ line = 0;
+ }
+ }
+}
+
+void Type1CFontConverter::getDeltaInt(char *buf, char *name, double *op,
+ int n) {
+ int x, i;
+
+ sprintf(buf, "/%s [", name);
+ buf += strlen(buf);
+ x = 0;
+ for (i = 0; i < n; ++i) {
+ x += (int)op[i];
+ sprintf(buf, "%s%d", i > 0 ? " " : "", x);
+ buf += strlen(buf);
+ }
+ sprintf(buf, "] def\n");
+}
+
+void Type1CFontConverter::getDeltaReal(char *buf, char *name, double *op,
+ int n) {
+ double x;
+ int i;
+
+ sprintf(buf, "/%s [", name);
+ buf += strlen(buf);
+ x = 0;
+ for (i = 0; i < n; ++i) {
+ x += op[i];
+ sprintf(buf, "%s%g", i > 0 ? " " : "", x);
+ buf += strlen(buf);
+ }
+ sprintf(buf, "] def\n");
+}
diff --git a/pdf2swf/xpdf/FontFile.h b/pdf2swf/xpdf/FontFile.h
new file mode 100644
index 00000000..ec625ef2
--- /dev/null
+++ b/pdf2swf/xpdf/FontFile.h
@@ -0,0 +1,117 @@
+//========================================================================
+//
+// FontFile.h
+//
+// Copyright 1999 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef FONTFILE_H
+#define FONTFILE_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include <stdio.h>
+#include "gtypes.h"
+#include "GString.h"
+#include "FontEncoding.h"
+
+//------------------------------------------------------------------------
+// FontFile
+//------------------------------------------------------------------------
+
+class FontFile {
+public:
+
+ FontFile();
+ virtual ~FontFile();
+
+ // Returns the font name, as specified internally by the font file.
+ // Returns NULL if no name is available.
+ virtual char *getName() = 0;
+
+ // Returns the custom font encoding, or NULL if the encoding is
+ // not available. If <taken> is set, the caller of this function
+ // will be responsible for freeing the encoding object.
+ virtual FontEncoding *getEncoding(GBool taken) = 0;
+};
+
+//------------------------------------------------------------------------
+// Type1FontFile
+//------------------------------------------------------------------------
+
+class Type1FontFile: public FontFile {
+public:
+
+ Type1FontFile(char *file, int len);
+ virtual ~Type1FontFile();
+ virtual char *getName() { return name; }
+ virtual FontEncoding *getEncoding(GBool taken);
+
+private:
+
+ char *name;
+ FontEncoding *encoding;
+ GBool freeEnc;
+};
+
+//------------------------------------------------------------------------
+// Type1CFontFile
+//------------------------------------------------------------------------
+
+class Type1CFontFile: public FontFile {
+public:
+
+ Type1CFontFile(char *file, int len);
+ virtual ~Type1CFontFile();
+ virtual char *getName() { return name; }
+ virtual FontEncoding *getEncoding(GBool taken);
+
+private:
+
+ char *name;
+ FontEncoding *encoding;
+ GBool freeEnc;
+};
+
+//------------------------------------------------------------------------
+// Type1CFontConverter
+//------------------------------------------------------------------------
+
+class Type1CFontConverter {
+public:
+
+ Type1CFontConverter(char *file, int len, FILE *out);
+ ~Type1CFontConverter();
+ void convert();
+
+private:
+
+ void eexecWrite(char *s);
+ void cvtGlyph(char *name, Guchar *s, int n);
+ void cvtGlyphWidth(GBool useOp);
+ void eexecDumpNum(double x, GBool fp);
+ void eexecDumpOp1(int op);
+ void eexecDumpOp2(int op);
+ void eexecWriteCharstring(Guchar *s, int n);
+ void getDeltaInt(char *buf, char *name, double *op, int n);
+ void getDeltaReal(char *buf, char *name, double *op, int n);
+
+ char *file;
+ int len;
+ FILE *out;
+ double op[48]; // operands
+ GBool fp[48]; // true if operand is fixed point
+ int nOps; // number of operands
+ double defaultWidthX; // default glyph width
+ double nominalWidthX; // nominal glyph width
+ GBool defaultWidthXFP; // true if defaultWidthX is fixed point
+ GBool nominalWidthXFP; // true if nominalWidthX is fixed point
+ Gushort r1; // eexec encryption key
+ GString *charBuf; // charstring output buffer
+ int line; // number of eexec chars on current line
+};
+
+#endif
diff --git a/pdf2swf/xpdf/FontInfo.h b/pdf2swf/xpdf/FontInfo.h
new file mode 100644
index 00000000..ee85b95b
--- /dev/null
+++ b/pdf2swf/xpdf/FontInfo.h
@@ -0,0 +1,2068 @@
+//========================================================================
+//
+// FontInfo.h
+//
+// This file was automatically generated by makeFontInfo.
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef FONTINFO_H
+#define FONTINFO_H
+
+//------------------------------------------------------------------------
+// Character encodings.
+//------------------------------------------------------------------------
+
+#define standardEncodingSize 335
+static char *standardEncodingNames[standardEncodingSize] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclam",
+ "quotedbl",
+ "numbersign",
+ "dollar",
+ "percent",
+ "ampersand",
+ "quoteright",
+ "parenleft",
+ "parenright",
+ "asterisk",
+ "plus",
+ "comma",
+ "hyphen",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "at",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "bracketleft",
+ "backslash",
+ "bracketright",
+ "asciicircum",
+ "underscore",
+ "quoteleft",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "braceleft",
+ "bar",
+ "braceright",
+ "asciitilde",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "exclamdown",
+ "cent",
+ "sterling",
+ "fraction",
+ "yen",
+ "florin",
+ "section",
+ "currency",
+ "quotesingle",
+ "quotedblleft",
+ "guillemotleft",
+ "guilsinglleft",
+ "guilsinglright",
+ "fi",
+ "fl",
+ NULL,
+ "endash",
+ "dagger",
+ "daggerdbl",
+ "periodcentered",
+ NULL,
+ "paragraph",
+ "bullet",
+ "quotesinglbase",
+ "quotedblbase",
+ "quotedblright",
+ "guillemotright",
+ "ellipsis",
+ "perthousand",
+ NULL,
+ "questiondown",
+ NULL,
+ "grave",
+ "acute",
+ "circumflex",
+ "tilde",
+ "macron",
+ "breve",
+ "dotaccent",
+ "dieresis",
+ NULL,
+ "ring",
+ "cedilla",
+ NULL,
+ "hungarumlaut",
+ "ogonek",
+ "caron",
+ "emdash",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "AE",
+ NULL,
+ "ordfeminine",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Lslash",
+ "Oslash",
+ "OE",
+ "ordmasculine",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "ae",
+ NULL,
+ NULL,
+ NULL,
+ "dotlessi",
+ NULL,
+ NULL,
+ "lslash",
+ "oslash",
+ "oe",
+ "germandbls",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Aacute",
+ "Acircumflex",
+ "Adieresis",
+ "Agrave",
+ "Aring",
+ "Atilde",
+ "Ccedilla",
+ "Eacute",
+ "Ecircumflex",
+ "Edieresis",
+ "Egrave",
+ "Eth",
+ "Iacute",
+ "Icircumflex",
+ "Idieresis",
+ "Igrave",
+ "Ntilde",
+ "Oacute",
+ "Ocircumflex",
+ "Odieresis",
+ "Ograve",
+ "Otilde",
+ "Scaron",
+ "Thorn",
+ "Uacute",
+ "Ucircumflex",
+ "Udieresis",
+ "Ugrave",
+ "Yacute",
+ "Ydieresis",
+ "Zcaron",
+ "aacute",
+ "acircumflex",
+ "adieresis",
+ "agrave",
+ "aring",
+ "atilde",
+ "brokenbar",
+ "ccedilla",
+ "copyright",
+ "degree",
+ "divide",
+ "eacute",
+ "ecircumflex",
+ "edieresis",
+ "egrave",
+ "eth",
+ "iacute",
+ "icircumflex",
+ "idieresis",
+ "igrave",
+ "logicalnot",
+ "minus",
+ "mu",
+ "multiply",
+ "ntilde",
+ "oacute",
+ "ocircumflex",
+ "odieresis",
+ "ograve",
+ "onehalf",
+ "onequarter",
+ "onesuperior",
+ "otilde",
+ "plusminus",
+ "registered",
+ "scaron",
+ "thorn",
+ "threequarters",
+ "threesuperior",
+ "trademark",
+ "twosuperior",
+ "uacute",
+ "ucircumflex",
+ "udieresis",
+ "ugrave",
+ "yacute",
+ "ydieresis",
+ "zcaron"
+};
+static FontEncoding standardEncoding(standardEncodingNames,
+ standardEncodingSize);
+
+#define symbolEncodingSize 257
+static char *symbolEncodingNames[symbolEncodingSize] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclam",
+ "universal",
+ "numbersign",
+ "existential",
+ "percent",
+ "ampersand",
+ "suchthat",
+ "parenleft",
+ "parenright",
+ "asteriskmath",
+ "plus",
+ "comma",
+ "minus",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "congruent",
+ "Alpha",
+ "Beta",
+ "Chi",
+ "Delta",
+ "Epsilon",
+ "Phi",
+ "Gamma",
+ "Eta",
+ "Iota",
+ "theta1",
+ "Kappa",
+ "Lambda",
+ "Mu",
+ "Nu",
+ "Omicron",
+ "Pi",
+ "Theta",
+ "Rho",
+ "Sigma",
+ "Tau",
+ "Upsilon",
+ "sigma1",
+ "Omega",
+ "Xi",
+ "Psi",
+ "Zeta",
+ "bracketleft",
+ "therefore",
+ "bracketright",
+ "perpendicular",
+ "underscore",
+ "radicalex",
+ "alpha",
+ "beta",
+ "chi",
+ "delta",
+ "epsilon",
+ "phi",
+ "gamma",
+ "eta",
+ "iota",
+ "phi1",
+ "kappa",
+ "lambda",
+ "mu",
+ "nu",
+ "omicron",
+ "pi",
+ "theta",
+ "rho",
+ "sigma",
+ "tau",
+ "upsilon",
+ "omega1",
+ "omega",
+ "xi",
+ "psi",
+ "zeta",
+ "braceleft",
+ "bar",
+ "braceright",
+ "similar",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Upsilon1",
+ "minute",
+ "lessequal",
+ "fraction",
+ "infinity",
+ "florin",
+ "club",
+ "diamond",
+ "heart",
+ "spade",
+ "arrowboth",
+ "arrowleft",
+ "arrowup",
+ "arrowright",
+ "arrowdown",
+ "degree",
+ "plusminus",
+ "second",
+ "greaterequal",
+ "multiply",
+ "proportional",
+ "partialdiff",
+ "bullet",
+ "divide",
+ "notequal",
+ "equivalence",
+ "approxequal",
+ "ellipsis",
+ "arrowvertex",
+ "arrowhorizex",
+ "carriagereturn",
+ "aleph",
+ "Ifraktur",
+ "Rfraktur",
+ "weierstrass",
+ "circlemultiply",
+ "circleplus",
+ "emptyset",
+ "intersection",
+ "union",
+ "propersuperset",
+ "reflexsuperset",
+ "notsubset",
+ "propersubset",
+ "reflexsubset",
+ "element",
+ "notelement",
+ "angle",
+ "gradient",
+ "registerserif",
+ "copyrightserif",
+ "trademarkserif",
+ "product",
+ "radical",
+ "dotmath",
+ "logicalnot",
+ "logicaland",
+ "logicalor",
+ "arrowdblboth",
+ "arrowdblleft",
+ "arrowdblup",
+ "arrowdblright",
+ "arrowdbldown",
+ "lozenge",
+ "angleleft",
+ "registersans",
+ "copyrightsans",
+ "trademarksans",
+ "summation",
+ "parenlefttp",
+ "parenleftex",
+ "parenleftbt",
+ "bracketlefttp",
+ "bracketleftex",
+ "bracketleftbt",
+ "bracelefttp",
+ "braceleftmid",
+ "braceleftbt",
+ "braceex",
+ NULL,
+ "angleright",
+ "integral",
+ "integraltp",
+ "integralex",
+ "integralbt",
+ "parenrighttp",
+ "parenrightex",
+ "parenrightbt",
+ "bracketrighttp",
+ "bracketrightex",
+ "bracketrightbt",
+ "bracerighttp",
+ "bracerightmid",
+ "bracerightbt",
+ NULL,
+ "apple"
+};
+static FontEncoding symbolEncoding(symbolEncodingNames,
+ symbolEncodingSize);
+
+#define zapfDingbatsEncodingSize 270
+static char *zapfDingbatsEncodingNames[zapfDingbatsEncodingSize] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "a1",
+ "a2",
+ "a202",
+ "a3",
+ "a4",
+ "a5",
+ "a119",
+ "a118",
+ "a117",
+ "a11",
+ "a12",
+ "a13",
+ "a14",
+ "a15",
+ "a16",
+ "a105",
+ "a17",
+ "a18",
+ "a19",
+ "a20",
+ "a21",
+ "a22",
+ "a23",
+ "a24",
+ "a25",
+ "a26",
+ "a27",
+ "a28",
+ "a6",
+ "a7",
+ "a8",
+ "a9",
+ "a10",
+ "a29",
+ "a30",
+ "a31",
+ "a32",
+ "a33",
+ "a34",
+ "a35",
+ "a36",
+ "a37",
+ "a38",
+ "a39",
+ "a40",
+ "a41",
+ "a42",
+ "a43",
+ "a44",
+ "a45",
+ "a46",
+ "a47",
+ "a48",
+ "a49",
+ "a50",
+ "a51",
+ "a52",
+ "a53",
+ "a54",
+ "a55",
+ "a56",
+ "a57",
+ "a58",
+ "a59",
+ "a60",
+ "a61",
+ "a62",
+ "a63",
+ "a64",
+ "a65",
+ "a66",
+ "a67",
+ "a68",
+ "a69",
+ "a70",
+ "a71",
+ "a72",
+ "a73",
+ "a74",
+ "a203",
+ "a75",
+ "a204",
+ "a76",
+ "a77",
+ "a78",
+ "a79",
+ "a81",
+ "a82",
+ "a83",
+ "a84",
+ "a97",
+ "a98",
+ "a99",
+ "a100",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "a101",
+ "a102",
+ "a103",
+ "a104",
+ "a106",
+ "a107",
+ "a108",
+ "a112",
+ "a111",
+ "a110",
+ "a109",
+ "a120",
+ "a121",
+ "a122",
+ "a123",
+ "a124",
+ "a125",
+ "a126",
+ "a127",
+ "a128",
+ "a129",
+ "a130",
+ "a131",
+ "a132",
+ "a133",
+ "a134",
+ "a135",
+ "a136",
+ "a137",
+ "a138",
+ "a139",
+ "a140",
+ "a141",
+ "a142",
+ "a143",
+ "a144",
+ "a145",
+ "a146",
+ "a147",
+ "a148",
+ "a149",
+ "a150",
+ "a151",
+ "a152",
+ "a153",
+ "a154",
+ "a155",
+ "a156",
+ "a157",
+ "a158",
+ "a159",
+ "a160",
+ "a161",
+ "a163",
+ "a164",
+ "a196",
+ "a165",
+ "a192",
+ "a166",
+ "a167",
+ "a168",
+ "a169",
+ "a170",
+ "a171",
+ "a172",
+ "a173",
+ "a162",
+ "a174",
+ "a175",
+ "a176",
+ "a177",
+ "a178",
+ "a179",
+ "a193",
+ "a180",
+ "a199",
+ "a181",
+ "a200",
+ "a182",
+ NULL,
+ "a201",
+ "a183",
+ "a184",
+ "a197",
+ "a185",
+ "a194",
+ "a198",
+ "a186",
+ "a195",
+ "a187",
+ "a188",
+ "a189",
+ "a190",
+ "a191",
+ NULL,
+ "a205",
+ "a206",
+ "a85",
+ "a86",
+ "a87",
+ "a88",
+ "a89",
+ "a90",
+ "a91",
+ "a92",
+ "a93",
+ "a94",
+ "a95",
+ "a96"
+};
+static FontEncoding zapfDingbatsEncoding(zapfDingbatsEncodingNames,
+ zapfDingbatsEncodingSize);
+
+#define macRomanEncodingSize 256
+static char *macRomanEncodingNames[macRomanEncodingSize] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclam",
+ "quotedbl",
+ "numbersign",
+ "dollar",
+ "percent",
+ "ampersand",
+ "quotesingle",
+ "parenleft",
+ "parenright",
+ "asterisk",
+ "plus",
+ "comma",
+ "hyphen",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "at",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "bracketleft",
+ "backslash",
+ "bracketright",
+ "asciicircum",
+ "underscore",
+ "grave",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "braceleft",
+ "bar",
+ "braceright",
+ "asciitilde",
+ NULL,
+ "Adieresis",
+ "Aring",
+ "Ccedilla",
+ "Eacute",
+ "Ntilde",
+ "Odieresis",
+ "Udieresis",
+ "aacute",
+ "agrave",
+ "acircumflex",
+ "adieresis",
+ "atilde",
+ "aring",
+ "ccedilla",
+ "eacute",
+ "egrave",
+ "ecircumflex",
+ "edieresis",
+ "iacute",
+ "igrave",
+ "icircumflex",
+ "idieresis",
+ "ntilde",
+ "oacute",
+ "ograve",
+ "ocircumflex",
+ "odieresis",
+ "otilde",
+ "uacute",
+ "ugrave",
+ "ucircumflex",
+ "udieresis",
+ "dagger",
+ "degree",
+ "cent",
+ "sterling",
+ "section",
+ "bullet",
+ "paragraph",
+ "germandbls",
+ "registered",
+ "copyright",
+ "trademark",
+ "acute",
+ "dieresis",
+ NULL,
+ "AE",
+ "Oslash",
+ NULL,
+ "plusminus",
+ NULL,
+ NULL,
+ "yen",
+ "mu",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "ordfeminine",
+ "ordmasculine",
+ NULL,
+ "ae",
+ "oslash",
+ "questiondown",
+ "exclamdown",
+ "logicalnot",
+ NULL,
+ "florin",
+ NULL,
+ NULL,
+ "guillemotleft",
+ "guillemotright",
+ "ellipsis",
+ "space",
+ "Agrave",
+ "Atilde",
+ "Otilde",
+ "OE",
+ "oe",
+ "endash",
+ "emdash",
+ "quotedblleft",
+ "quotedblright",
+ "quoteleft",
+ "quoteright",
+ "divide",
+ NULL,
+ "ydieresis",
+ "Ydieresis",
+ "fraction",
+ "currency",
+ "guilsinglleft",
+ "guilsinglright",
+ "fi",
+ "fl",
+ "daggerdbl",
+ "periodcentered",
+ "quotesinglbase",
+ "quotedblbase",
+ "perthousand",
+ "Acircumflex",
+ "Ecircumflex",
+ "Aacute",
+ "Edieresis",
+ "Egrave",
+ "Iacute",
+ "Icircumflex",
+ "Idieresis",
+ "Igrave",
+ "Oacute",
+ "Ocircumflex",
+ NULL,
+ "Ograve",
+ "Uacute",
+ "Ucircumflex",
+ "Ugrave",
+ "dotlessi",
+ "circumflex",
+ "tilde",
+ "macron",
+ "breve",
+ "dotaccent",
+ "ring",
+ "cedilla",
+ "hungarumlaut",
+ "ogonek",
+ "caron"
+};
+static FontEncoding macRomanEncoding(macRomanEncodingNames,
+ macRomanEncodingSize);
+
+#define winAnsiEncodingSize 256
+static char *winAnsiEncodingNames[winAnsiEncodingSize] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclam",
+ "quotedbl",
+ "numbersign",
+ "dollar",
+ "percent",
+ "ampersand",
+ "quotesingle",
+ "parenleft",
+ "parenright",
+ "asterisk",
+ "plus",
+ "comma",
+ "hyphen",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "at",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "bracketleft",
+ "backslash",
+ "bracketright",
+ "asciicircum",
+ "underscore",
+ "grave",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "braceleft",
+ "bar",
+ "braceright",
+ "asciitilde",
+ "bullet",
+ "bullet",
+ "bullet",
+ "quotesinglbase",
+ "florin",
+ "quotedblbase",
+ "ellipsis",
+ "dagger",
+ "daggerdbl",
+ "circumflex",
+ "perthousand",
+ "Scaron",
+ "guilsinglleft",
+ "OE",
+ "bullet",
+ "bullet",
+ "bullet",
+ "bullet",
+ "quoteleft",
+ "quoteright",
+ "quotedblleft",
+ "quotedblright",
+ "bullet",
+ "endash",
+ "emdash",
+ "tilde",
+ "trademark",
+ "scaron",
+ "guilsinglright",
+ "oe",
+ "bullet",
+ "bullet",
+ "Ydieresis",
+ "space",
+ "exclamdown",
+ "cent",
+ "sterling",
+ "currency",
+ "yen",
+ "brokenbar",
+ "section",
+ "dieresis",
+ "copyright",
+ "ordfeminine",
+ "guillemotleft",
+ "logicalnot",
+ "hyphen",
+ "registered",
+ "macron",
+ "degree",
+ "plusminus",
+ "twosuperior",
+ "threesuperior",
+ "acute",
+ "mu",
+ "paragraph",
+ "periodcentered",
+ "cedilla",
+ "onesuperior",
+ "ordmasculine",
+ "guillemotright",
+ "onequarter",
+ "onehalf",
+ "threequarters",
+ "questiondown",
+ "Agrave",
+ "Aacute",
+ "Acircumflex",
+ "Atilde",
+ "Adieresis",
+ "Aring",
+ "AE",
+ "Ccedilla",
+ "Egrave",
+ "Eacute",
+ "Ecircumflex",
+ "Edieresis",
+ "Igrave",
+ "Iacute",
+ "Icircumflex",
+ "Idieresis",
+ "Eth",
+ "Ntilde",
+ "Ograve",
+ "Oacute",
+ "Ocircumflex",
+ "Otilde",
+ "Odieresis",
+ "multiply",
+ "Oslash",
+ "Ugrave",
+ "Uacute",
+ "Ucircumflex",
+ "Udieresis",
+ "Yacute",
+ "Thorn",
+ "germandbls",
+ "agrave",
+ "aacute",
+ "acircumflex",
+ "atilde",
+ "adieresis",
+ "aring",
+ "ae",
+ "ccedilla",
+ "egrave",
+ "eacute",
+ "ecircumflex",
+ "edieresis",
+ "igrave",
+ "iacute",
+ "icircumflex",
+ "idieresis",
+ "eth",
+ "ntilde",
+ "ograve",
+ "oacute",
+ "ocircumflex",
+ "otilde",
+ "odieresis",
+ "divide",
+ "oslash",
+ "ugrave",
+ "uacute",
+ "ucircumflex",
+ "udieresis",
+ "yacute",
+ "thorn",
+ "ydieresis"
+};
+static FontEncoding winAnsiEncoding(winAnsiEncodingNames,
+ winAnsiEncodingSize);
+
+//------------------------------------------------------------------------
+// Character widths for built-in fonts.
+//------------------------------------------------------------------------
+
+static Gushort courierWidths[335] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 0, 600, 600, 600, 600, 0, 600, 600,
+ 600, 600, 600, 600, 600, 600, 0, 600,
+ 0, 600, 600, 600, 600, 600, 600, 600,
+ 600, 0, 600, 600, 0, 600, 600, 600,
+ 600, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 600, 0, 600, 0, 0, 0, 0,
+ 600, 600, 600, 600, 0, 0, 0, 0,
+ 0, 600, 0, 0, 0, 600, 0, 0,
+ 600, 600, 600, 600, 0, 0, 0, 0,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600
+};
+
+static Gushort courierBoldWidths[335] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 0, 600, 600, 600, 600, 0, 600, 600,
+ 600, 600, 600, 600, 600, 600, 0, 600,
+ 0, 600, 600, 600, 600, 600, 600, 600,
+ 600, 0, 600, 600, 0, 600, 600, 600,
+ 600, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 600, 0, 600, 0, 0, 0, 0,
+ 600, 600, 600, 600, 0, 0, 0, 0,
+ 0, 600, 0, 0, 0, 600, 0, 0,
+ 600, 600, 600, 600, 0, 0, 0, 0,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600
+};
+
+static Gushort courierBoldObliqueWidths[335] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 0, 600, 600, 600, 600, 0, 600, 600,
+ 600, 600, 600, 600, 600, 600, 0, 600,
+ 0, 600, 600, 600, 600, 600, 600, 600,
+ 600, 0, 600, 600, 0, 600, 600, 600,
+ 600, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 600, 0, 600, 0, 0, 0, 0,
+ 600, 600, 600, 600, 0, 0, 0, 0,
+ 0, 600, 0, 0, 0, 600, 0, 0,
+ 600, 600, 600, 600, 0, 0, 0, 0,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600
+};
+
+static Gushort courierObliqueWidths[335] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 0, 600, 600, 600, 600, 0, 600, 600,
+ 600, 600, 600, 600, 600, 600, 0, 600,
+ 0, 600, 600, 600, 600, 600, 600, 600,
+ 600, 0, 600, 600, 0, 600, 600, 600,
+ 600, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 600, 0, 600, 0, 0, 0, 0,
+ 600, 600, 600, 600, 0, 0, 0, 0,
+ 0, 600, 0, 0, 0, 600, 0, 0,
+ 600, 600, 600, 600, 0, 0, 0, 0,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600, 600,
+ 600, 600, 600, 600, 600, 600, 600
+};
+
+static Gushort helveticaWidths[335] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 278, 278, 355, 556, 556, 889, 667, 222,
+ 333, 333, 389, 584, 278, 333, 278, 278,
+ 556, 556, 556, 556, 556, 556, 556, 556,
+ 556, 556, 278, 278, 584, 584, 584, 556,
+ 1015, 667, 667, 722, 722, 667, 611, 778,
+ 722, 278, 500, 667, 556, 833, 722, 778,
+ 667, 778, 722, 667, 611, 722, 667, 944,
+ 667, 667, 611, 278, 278, 278, 469, 556,
+ 222, 556, 556, 500, 556, 556, 278, 556,
+ 556, 222, 222, 500, 222, 833, 556, 556,
+ 556, 556, 333, 500, 278, 556, 500, 722,
+ 500, 500, 500, 334, 260, 334, 584, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 333, 556, 556, 167, 556, 556, 556,
+ 556, 191, 333, 556, 333, 333, 500, 500,
+ 0, 556, 556, 556, 278, 0, 537, 350,
+ 222, 333, 333, 556, 1000, 1000, 0, 611,
+ 0, 333, 333, 333, 333, 333, 333, 333,
+ 333, 0, 333, 333, 0, 333, 333, 333,
+ 1000, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1000, 0, 370, 0, 0, 0, 0,
+ 556, 778, 1000, 365, 0, 0, 0, 0,
+ 0, 889, 0, 0, 0, 278, 0, 0,
+ 222, 611, 944, 611, 0, 0, 0, 0,
+ 667, 667, 667, 667, 667, 667, 722, 667,
+ 667, 667, 667, 722, 278, 278, 278, 278,
+ 722, 778, 778, 778, 778, 778, 667, 667,
+ 722, 722, 722, 722, 667, 667, 611, 556,
+ 556, 556, 556, 556, 556, 260, 500, 737,
+ 400, 584, 556, 556, 556, 556, 556, 278,
+ 278, 278, 278, 584, 584, 556, 584, 556,
+ 556, 556, 556, 556, 834, 834, 333, 556,
+ 584, 737, 500, 556, 834, 333, 1000, 333,
+ 556, 556, 556, 556, 500, 500, 500
+};
+
+static Gushort helveticaBoldWidths[335] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 278, 333, 474, 556, 556, 889, 722, 278,
+ 333, 333, 389, 584, 278, 333, 278, 278,
+ 556, 556, 556, 556, 556, 556, 556, 556,
+ 556, 556, 333, 333, 584, 584, 584, 611,
+ 975, 722, 722, 722, 722, 667, 611, 778,
+ 722, 278, 556, 722, 611, 833, 722, 778,
+ 667, 778, 722, 667, 611, 722, 667, 944,
+ 667, 667, 611, 333, 278, 333, 584, 556,
+ 278, 556, 611, 556, 611, 556, 333, 611,
+ 611, 278, 278, 556, 278, 889, 611, 611,
+ 611, 611, 389, 556, 333, 611, 556, 778,
+ 556, 556, 500, 389, 280, 389, 584, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 333, 556, 556, 167, 556, 556, 556,
+ 556, 238, 500, 556, 333, 333, 611, 611,
+ 0, 556, 556, 556, 278, 0, 556, 350,
+ 278, 500, 500, 556, 1000, 1000, 0, 611,
+ 0, 333, 333, 333, 333, 333, 333, 333,
+ 333, 0, 333, 333, 0, 333, 333, 333,
+ 1000, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1000, 0, 370, 0, 0, 0, 0,
+ 611, 778, 1000, 365, 0, 0, 0, 0,
+ 0, 889, 0, 0, 0, 278, 0, 0,
+ 278, 611, 944, 611, 0, 0, 0, 0,
+ 722, 722, 722, 722, 722, 722, 722, 667,
+ 667, 667, 667, 722, 278, 278, 278, 278,
+ 722, 778, 778, 778, 778, 778, 667, 667,
+ 722, 722, 722, 722, 667, 667, 611, 556,
+ 556, 556, 556, 556, 556, 280, 556, 737,
+ 400, 584, 556, 556, 556, 556, 611, 278,
+ 278, 278, 278, 584, 584, 611, 584, 611,
+ 611, 611, 611, 611, 834, 834, 333, 611,
+ 584, 737, 556, 611, 834, 333, 1000, 333,
+ 611, 611, 611, 611, 556, 556, 500
+};
+
+static Gushort helveticaBoldObliqueWidths[335] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 278, 333, 474, 556, 556, 889, 722, 278,
+ 333, 333, 389, 584, 278, 333, 278, 278,
+ 556, 556, 556, 556, 556, 556, 556, 556,
+ 556, 556, 333, 333, 584, 584, 584, 611,
+ 975, 722, 722, 722, 722, 667, 611, 778,
+ 722, 278, 556, 722, 611, 833, 722, 778,
+ 667, 778, 722, 667, 611, 722, 667, 944,
+ 667, 667, 611, 333, 278, 333, 584, 556,
+ 278, 556, 611, 556, 611, 556, 333, 611,
+ 611, 278, 278, 556, 278, 889, 611, 611,
+ 611, 611, 389, 556, 333, 611, 556, 778,
+ 556, 556, 500, 389, 280, 389, 584, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 333, 556, 556, 167, 556, 556, 556,
+ 556, 238, 500, 556, 333, 333, 611, 611,
+ 0, 556, 556, 556, 278, 0, 556, 350,
+ 278, 500, 500, 556, 1000, 1000, 0, 611,
+ 0, 333, 333, 333, 333, 333, 333, 333,
+ 333, 0, 333, 333, 0, 333, 333, 333,
+ 1000, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1000, 0, 370, 0, 0, 0, 0,
+ 611, 778, 1000, 365, 0, 0, 0, 0,
+ 0, 889, 0, 0, 0, 278, 0, 0,
+ 278, 611, 944, 611, 0, 0, 0, 0,
+ 722, 722, 722, 722, 722, 722, 722, 667,
+ 667, 667, 667, 722, 278, 278, 278, 278,
+ 722, 778, 778, 778, 778, 778, 667, 667,
+ 722, 722, 722, 722, 667, 667, 611, 556,
+ 556, 556, 556, 556, 556, 280, 556, 737,
+ 400, 584, 556, 556, 556, 556, 611, 278,
+ 278, 278, 278, 584, 584, 611, 584, 611,
+ 611, 611, 611, 611, 834, 834, 333, 611,
+ 584, 737, 556, 611, 834, 333, 1000, 333,
+ 611, 611, 611, 611, 556, 556, 500
+};
+
+static Gushort helveticaObliqueWidths[335] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 278, 278, 355, 556, 556, 889, 667, 222,
+ 333, 333, 389, 584, 278, 333, 278, 278,
+ 556, 556, 556, 556, 556, 556, 556, 556,
+ 556, 556, 278, 278, 584, 584, 584, 556,
+ 1015, 667, 667, 722, 722, 667, 611, 778,
+ 722, 278, 500, 667, 556, 833, 722, 778,
+ 667, 778, 722, 667, 611, 722, 667, 944,
+ 667, 667, 611, 278, 278, 278, 469, 556,
+ 222, 556, 556, 500, 556, 556, 278, 556,
+ 556, 222, 222, 500, 222, 833, 556, 556,
+ 556, 556, 333, 500, 278, 556, 500, 722,
+ 500, 500, 500, 334, 260, 334, 584, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 333, 556, 556, 167, 556, 556, 556,
+ 556, 191, 333, 556, 333, 333, 500, 500,
+ 0, 556, 556, 556, 278, 0, 537, 350,
+ 222, 333, 333, 556, 1000, 1000, 0, 611,
+ 0, 333, 333, 333, 333, 333, 333, 333,
+ 333, 0, 333, 333, 0, 333, 333, 333,
+ 1000, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1000, 0, 370, 0, 0, 0, 0,
+ 556, 778, 1000, 365, 0, 0, 0, 0,
+ 0, 889, 0, 0, 0, 278, 0, 0,
+ 222, 611, 944, 611, 0, 0, 0, 0,
+ 667, 667, 667, 667, 667, 667, 722, 667,
+ 667, 667, 667, 722, 278, 278, 278, 278,
+ 722, 778, 778, 778, 778, 778, 667, 667,
+ 722, 722, 722, 722, 667, 667, 611, 556,
+ 556, 556, 556, 556, 556, 260, 500, 737,
+ 400, 584, 556, 556, 556, 556, 556, 278,
+ 278, 278, 278, 584, 584, 556, 584, 556,
+ 556, 556, 556, 556, 834, 834, 333, 556,
+ 584, 737, 500, 556, 834, 333, 1000, 333,
+ 556, 556, 556, 556, 500, 500, 500
+};
+
+static Gushort symbolWidths[257] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 250, 333, 713, 500, 549, 833, 778, 439,
+ 333, 333, 500, 549, 250, 549, 250, 278,
+ 500, 500, 500, 500, 500, 500, 500, 500,
+ 500, 500, 278, 278, 549, 549, 549, 444,
+ 549, 722, 667, 722, 612, 611, 763, 603,
+ 722, 333, 631, 722, 686, 889, 722, 722,
+ 768, 741, 556, 592, 611, 690, 439, 768,
+ 645, 795, 611, 333, 863, 333, 658, 500,
+ 500, 631, 549, 549, 494, 439, 521, 411,
+ 603, 329, 603, 549, 549, 576, 521, 549,
+ 549, 521, 549, 603, 439, 576, 713, 686,
+ 493, 686, 494, 480, 200, 480, 549, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 620, 247, 549, 167, 713, 500, 753,
+ 753, 753, 753, 1042, 987, 603, 987, 603,
+ 400, 549, 411, 549, 549, 713, 494, 460,
+ 549, 549, 549, 549, 1000, 603, 1000, 658,
+ 823, 686, 795, 987, 768, 768, 823, 768,
+ 768, 713, 713, 713, 713, 713, 713, 713,
+ 768, 713, 790, 790, 890, 823, 549, 250,
+ 713, 603, 603, 1042, 987, 603, 987, 603,
+ 494, 329, 790, 790, 786, 713, 384, 384,
+ 384, 384, 384, 384, 494, 494, 494, 494,
+ 0, 329, 274, 686, 686, 686, 384, 384,
+ 384, 384, 384, 384, 494, 494, 494, 0,
+ 790
+};
+
+static Gushort timesBoldWidths[335] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 250, 333, 555, 500, 500, 1000, 833, 333,
+ 333, 333, 500, 570, 250, 333, 250, 278,
+ 500, 500, 500, 500, 500, 500, 500, 500,
+ 500, 500, 333, 333, 570, 570, 570, 500,
+ 930, 722, 667, 722, 722, 667, 611, 778,
+ 778, 389, 500, 778, 667, 944, 722, 778,
+ 611, 778, 722, 556, 667, 722, 722, 1000,
+ 722, 722, 667, 333, 278, 333, 581, 500,
+ 333, 500, 556, 444, 556, 444, 333, 500,
+ 556, 278, 333, 556, 278, 833, 556, 500,
+ 556, 556, 444, 389, 333, 556, 500, 722,
+ 500, 500, 444, 394, 220, 394, 520, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 333, 500, 500, 167, 500, 500, 500,
+ 500, 278, 500, 500, 333, 333, 556, 556,
+ 0, 500, 500, 500, 250, 0, 540, 350,
+ 333, 500, 500, 500, 1000, 1000, 0, 500,
+ 0, 333, 333, 333, 333, 333, 333, 333,
+ 333, 0, 333, 333, 0, 333, 333, 333,
+ 1000, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1000, 0, 300, 0, 0, 0, 0,
+ 667, 778, 1000, 330, 0, 0, 0, 0,
+ 0, 722, 0, 0, 0, 278, 0, 0,
+ 278, 500, 722, 556, 0, 0, 0, 0,
+ 722, 722, 722, 722, 722, 722, 722, 667,
+ 667, 667, 667, 722, 389, 389, 389, 389,
+ 722, 778, 778, 778, 778, 778, 556, 611,
+ 722, 722, 722, 722, 722, 722, 667, 500,
+ 500, 500, 500, 500, 500, 220, 444, 747,
+ 400, 570, 444, 444, 444, 444, 500, 278,
+ 278, 278, 278, 570, 570, 556, 570, 556,
+ 500, 500, 500, 500, 750, 750, 300, 500,
+ 570, 747, 389, 556, 750, 300, 1000, 300,
+ 556, 556, 556, 556, 500, 500, 444
+};
+
+static Gushort timesBoldItalicWidths[335] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 250, 389, 555, 500, 500, 833, 778, 333,
+ 333, 333, 500, 570, 250, 333, 250, 278,
+ 500, 500, 500, 500, 500, 500, 500, 500,
+ 500, 500, 333, 333, 570, 570, 570, 500,
+ 832, 667, 667, 667, 722, 667, 667, 722,
+ 778, 389, 500, 667, 611, 889, 722, 722,
+ 611, 722, 667, 556, 611, 722, 667, 889,
+ 667, 611, 611, 333, 278, 333, 570, 500,
+ 333, 500, 500, 444, 500, 444, 333, 500,
+ 556, 278, 278, 500, 278, 778, 556, 500,
+ 500, 500, 389, 389, 278, 556, 444, 667,
+ 500, 444, 389, 348, 220, 348, 570, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 389, 500, 500, 167, 500, 500, 500,
+ 500, 278, 500, 500, 333, 333, 556, 556,
+ 0, 500, 500, 500, 250, 0, 500, 350,
+ 333, 500, 500, 500, 1000, 1000, 0, 500,
+ 0, 333, 333, 333, 333, 333, 333, 333,
+ 333, 0, 333, 333, 0, 333, 333, 333,
+ 1000, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 944, 0, 266, 0, 0, 0, 0,
+ 611, 722, 944, 300, 0, 0, 0, 0,
+ 0, 722, 0, 0, 0, 278, 0, 0,
+ 278, 500, 722, 500, 0, 0, 0, 0,
+ 667, 667, 667, 667, 667, 667, 667, 667,
+ 667, 667, 667, 722, 389, 389, 389, 389,
+ 722, 722, 722, 722, 722, 722, 556, 611,
+ 722, 722, 722, 722, 611, 611, 611, 500,
+ 500, 500, 500, 500, 500, 220, 444, 747,
+ 400, 570, 444, 444, 444, 444, 500, 278,
+ 278, 278, 278, 606, 606, 576, 570, 556,
+ 500, 500, 500, 500, 750, 750, 300, 500,
+ 570, 747, 389, 500, 750, 300, 1000, 300,
+ 556, 556, 556, 556, 444, 444, 389
+};
+
+static Gushort timesItalicWidths[335] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 250, 333, 420, 500, 500, 833, 778, 333,
+ 333, 333, 500, 675, 250, 333, 250, 278,
+ 500, 500, 500, 500, 500, 500, 500, 500,
+ 500, 500, 333, 333, 675, 675, 675, 500,
+ 920, 611, 611, 667, 722, 611, 611, 722,
+ 722, 333, 444, 667, 556, 833, 667, 722,
+ 611, 722, 611, 500, 556, 722, 611, 833,
+ 611, 556, 556, 389, 278, 389, 422, 500,
+ 333, 500, 500, 444, 500, 444, 278, 500,
+ 500, 278, 278, 444, 278, 722, 500, 500,
+ 500, 500, 389, 389, 278, 500, 444, 667,
+ 444, 444, 389, 400, 275, 400, 541, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 389, 500, 500, 167, 500, 500, 500,
+ 500, 214, 556, 500, 333, 333, 500, 500,
+ 0, 500, 500, 500, 250, 0, 523, 350,
+ 333, 556, 556, 500, 889, 1000, 0, 500,
+ 0, 333, 333, 333, 333, 333, 333, 333,
+ 333, 0, 333, 333, 0, 333, 333, 333,
+ 889, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 889, 0, 276, 0, 0, 0, 0,
+ 556, 722, 944, 310, 0, 0, 0, 0,
+ 0, 667, 0, 0, 0, 278, 0, 0,
+ 278, 500, 667, 500, 0, 0, 0, 0,
+ 611, 611, 611, 611, 611, 611, 667, 611,
+ 611, 611, 611, 722, 333, 333, 333, 333,
+ 667, 722, 722, 722, 722, 722, 500, 611,
+ 722, 722, 722, 722, 556, 556, 556, 500,
+ 500, 500, 500, 500, 500, 275, 444, 760,
+ 400, 675, 444, 444, 444, 444, 500, 278,
+ 278, 278, 278, 675, 675, 500, 675, 500,
+ 500, 500, 500, 500, 750, 750, 300, 500,
+ 675, 760, 389, 500, 750, 300, 980, 300,
+ 500, 500, 500, 500, 444, 444, 389
+};
+
+static Gushort timesRomanWidths[335] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 250, 333, 408, 500, 500, 833, 778, 333,
+ 333, 333, 500, 564, 250, 333, 250, 278,
+ 500, 500, 500, 500, 500, 500, 500, 500,
+ 500, 500, 278, 278, 564, 564, 564, 444,
+ 921, 722, 667, 667, 722, 611, 556, 722,
+ 722, 333, 389, 722, 611, 889, 722, 722,
+ 556, 722, 667, 556, 611, 722, 722, 944,
+ 722, 722, 611, 333, 278, 333, 469, 500,
+ 333, 444, 500, 444, 500, 444, 333, 500,
+ 500, 278, 278, 500, 278, 778, 500, 500,
+ 500, 500, 333, 389, 278, 500, 500, 722,
+ 500, 500, 444, 480, 200, 480, 541, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 333, 500, 500, 167, 500, 500, 500,
+ 500, 180, 444, 500, 333, 333, 556, 556,
+ 0, 500, 500, 500, 250, 0, 453, 350,
+ 333, 444, 444, 500, 1000, 1000, 0, 444,
+ 0, 333, 333, 333, 333, 333, 333, 333,
+ 333, 0, 333, 333, 0, 333, 333, 333,
+ 1000, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 889, 0, 276, 0, 0, 0, 0,
+ 611, 722, 889, 310, 0, 0, 0, 0,
+ 0, 667, 0, 0, 0, 278, 0, 0,
+ 278, 500, 722, 500, 0, 0, 0, 0,
+ 722, 722, 722, 722, 722, 722, 667, 611,
+ 611, 611, 611, 722, 333, 333, 333, 333,
+ 722, 722, 722, 722, 722, 722, 556, 556,
+ 722, 722, 722, 722, 722, 722, 611, 444,
+ 444, 444, 444, 444, 444, 200, 444, 760,
+ 400, 564, 444, 444, 444, 444, 500, 278,
+ 278, 278, 278, 564, 564, 500, 564, 500,
+ 500, 500, 500, 500, 750, 750, 300, 500,
+ 564, 760, 389, 500, 750, 300, 980, 300,
+ 500, 500, 500, 500, 500, 500, 444
+};
+
+static Gushort zapfDingbatsWidths[270] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 278, 974, 961, 974, 980, 719, 789, 790,
+ 791, 690, 960, 939, 549, 855, 911, 933,
+ 911, 945, 974, 755, 846, 762, 761, 571,
+ 677, 763, 760, 759, 754, 494, 552, 537,
+ 577, 692, 786, 788, 788, 790, 793, 794,
+ 816, 823, 789, 841, 823, 833, 816, 831,
+ 923, 744, 723, 749, 790, 792, 695, 776,
+ 768, 792, 759, 707, 708, 682, 701, 826,
+ 815, 789, 789, 707, 687, 696, 689, 786,
+ 787, 713, 791, 785, 791, 873, 761, 762,
+ 762, 759, 759, 892, 892, 788, 784, 438,
+ 138, 277, 415, 392, 392, 668, 668, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 732, 544, 544, 910, 667, 760, 760,
+ 776, 595, 694, 626, 788, 788, 788, 788,
+ 788, 788, 788, 788, 788, 788, 788, 788,
+ 788, 788, 788, 788, 788, 788, 788, 788,
+ 788, 788, 788, 788, 788, 788, 788, 788,
+ 788, 788, 788, 788, 788, 788, 788, 788,
+ 788, 788, 788, 788, 894, 838, 1016, 458,
+ 748, 924, 748, 918, 927, 928, 928, 834,
+ 873, 828, 924, 924, 917, 930, 931, 463,
+ 883, 836, 836, 867, 867, 696, 696, 874,
+ 0, 874, 760, 946, 771, 865, 771, 888,
+ 967, 888, 831, 873, 927, 970, 918, 0,
+ 509, 410, 509, 410, 234, 234, 390, 390,
+ 276, 276, 317, 317, 334, 334
+};
+
+//------------------------------------------------------------------------
+// Built-in font table.
+//------------------------------------------------------------------------
+
+struct BuiltinFont {
+ char *name;
+ Gushort *widths;
+ FontEncoding *encoding;
+};
+
+#define numBuiltinFonts ((int)(sizeof(builtinFonts)/sizeof(BuiltinFont)))
+
+static BuiltinFont builtinFonts[] = {
+ {"Courier", courierWidths, &standardEncoding},
+ {"Courier-Bold", courierBoldWidths, &standardEncoding},
+ {"Courier-BoldOblique", courierBoldObliqueWidths, &standardEncoding},
+ {"Courier-Oblique", courierObliqueWidths, &standardEncoding},
+ {"Helvetica", helveticaWidths, &standardEncoding},
+ {"Helvetica-Bold", helveticaBoldWidths, &standardEncoding},
+ {"Helvetica-BoldOblique", helveticaBoldObliqueWidths, &standardEncoding},
+ {"Helvetica-Oblique", helveticaObliqueWidths, &standardEncoding},
+ {"Symbol", symbolWidths, &symbolEncoding},
+ {"Times-Bold", timesBoldWidths, &standardEncoding},
+ {"Times-BoldItalic", timesBoldItalicWidths, &standardEncoding},
+ {"Times-Italic", timesItalicWidths, &standardEncoding},
+ {"Times-Roman", timesRomanWidths, &standardEncoding},
+ {"ZapfDingbats", zapfDingbatsWidths, &zapfDingbatsEncoding}
+};
+
+#endif
diff --git a/pdf2swf/xpdf/FormWidget.cc b/pdf2swf/xpdf/FormWidget.cc
new file mode 100644
index 00000000..76428d05
--- /dev/null
+++ b/pdf2swf/xpdf/FormWidget.cc
@@ -0,0 +1,129 @@
+//========================================================================
+//
+// FormWidget.cc
+//
+// Copyright 2000 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include "gmem.h"
+#include "Object.h"
+#include "Gfx.h"
+#include "FormWidget.h"
+
+//------------------------------------------------------------------------
+// FormWidget
+//------------------------------------------------------------------------
+
+FormWidget::FormWidget(Dict *dict) {
+ Object obj1, obj2;
+ double t;
+
+ ok = gFalse;
+
+ if (dict->lookup("AP", &obj1)->isDict()) {
+ obj1.dictLookupNF("N", &obj2);
+ //~ this doesn't handle appearances with multiple states --
+ //~ need to look at AS key to get state and then get the
+ //~ corresponding entry from the N dict
+ if (obj2.isRef()) {
+ obj2.copy(&appearance);
+ ok = gTrue;
+ }
+ obj2.free();
+ }
+ obj1.free();
+
+ if (dict->lookup("Rect", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 4) {
+ //~ should check object types here
+ obj1.arrayGet(0, &obj2);
+ xMin = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ yMin = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2, &obj2);
+ xMax = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(3, &obj2);
+ yMax = obj2.getNum();
+ obj2.free();
+ if (xMin > xMax) {
+ t = xMin; xMin = xMax; xMax = t;
+ }
+ if (yMin > yMax) {
+ t = yMin; yMin = yMax; yMax = t;
+ }
+ } else {
+ //~ this should return an error
+ xMin = yMin = 0;
+ xMax = yMax = 1;
+ }
+ obj1.free();
+}
+
+FormWidget::~FormWidget() {
+ appearance.free();
+}
+
+void FormWidget::draw(Gfx *gfx) {
+ Object obj;
+
+ if (appearance.fetch(&obj)->isStream()) {
+ gfx->doWidgetForm(&obj, xMin, yMin, xMax, yMax);
+ }
+ obj.free();
+}
+
+//------------------------------------------------------------------------
+// FormWidgets
+//------------------------------------------------------------------------
+
+FormWidgets::FormWidgets(Object *annots) {
+ FormWidget *widget;
+ Object obj1, obj2;
+ int size;
+ int i;
+
+ widgets = NULL;
+ size = 0;
+ nWidgets = 0;
+
+ if (annots->isArray()) {
+ for (i = 0; i < annots->arrayGetLength(); ++i) {
+ if (annots->arrayGet(i, &obj1)->isDict()) {
+ obj1.dictLookup("Subtype", &obj2);
+ if (obj2.isName("Widget") ||
+ obj2.isName("Stamp")) {
+ widget = new FormWidget(obj1.getDict());
+ if (widget->isOk()) {
+ if (nWidgets >= size) {
+ size += 16;
+ widgets = (FormWidget **)grealloc(widgets,
+ size * sizeof(FormWidget *));
+ }
+ widgets[nWidgets++] = widget;
+ } else {
+ delete widget;
+ }
+ }
+ obj2.free();
+ }
+ obj1.free();
+ }
+ }
+}
+
+FormWidgets::~FormWidgets() {
+ int i;
+
+ for (i = 0; i < nWidgets; ++i) {
+ delete widgets[i];
+ }
+ gfree(widgets);
+}
diff --git a/pdf2swf/xpdf/FormWidget.h b/pdf2swf/xpdf/FormWidget.h
new file mode 100644
index 00000000..d746083b
--- /dev/null
+++ b/pdf2swf/xpdf/FormWidget.h
@@ -0,0 +1,65 @@
+//========================================================================
+//
+// FormWidget.h
+//
+// Copyright 2000 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef FORMWIDGET_H
+#define FORMWIDGET_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+class Gfx;
+
+//------------------------------------------------------------------------
+// FormWidget
+//------------------------------------------------------------------------
+
+class FormWidget {
+public:
+
+ FormWidget(Dict *dict);
+ ~FormWidget();
+ GBool isOk() { return ok; }
+
+ void draw(Gfx *gfx);
+
+ // Get appearance object.
+ Object *getAppearance(Object *obj) { return appearance.fetch(obj); }
+
+private:
+
+ Object appearance; // a reference to the Form XObject stream
+ // for the normal appearance
+ double xMin, yMin, // widget rectangle
+ xMax, yMax;
+ GBool ok;
+};
+
+//------------------------------------------------------------------------
+// FormWidgets
+//------------------------------------------------------------------------
+
+class FormWidgets {
+public:
+
+ // Extract widgets from array of annotations.
+ FormWidgets(Object *annots);
+
+ ~FormWidgets();
+
+ // Iterate through list of widgets.
+ int getNumWidgets() { return nWidgets; }
+ FormWidget *getWidget(int i) { return widgets[i]; }
+
+private:
+
+ FormWidget **widgets;
+ int nWidgets;
+};
+
+#endif
diff --git a/pdf2swf/xpdf/GString.cc b/pdf2swf/xpdf/GString.cc
new file mode 100644
index 00000000..7b8f2718
--- /dev/null
+++ b/pdf2swf/xpdf/GString.cc
@@ -0,0 +1,223 @@
+//========================================================================
+//
+// GString.cc
+//
+// Simple variable-length string type.
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <ctype.h>
+#include "gtypes.h"
+#include "GString.h"
+
+static inline int size(int len) {
+ int delta;
+
+ delta = len < 256 ? 7 : 255;
+ return ((len + 1) + delta) & ~delta;
+}
+
+inline void GString::resize(int length1) {
+ char *s1;
+
+ if (!s) {
+ s = new char[size(length1)];
+ } else if (size(length1) != size(length)) {
+ s1 = new char[size(length1)];
+ memcpy(s1, s, length + 1);
+ delete[] s;
+ s = s1;
+ }
+}
+
+GString::GString() {
+ s = NULL;
+ resize(length = 0);
+ s[0] = '\0';
+}
+
+GString::GString(const char *s1) {
+ int n = strlen(s1);
+
+ s = NULL;
+ resize(length = n);
+ memcpy(s, s1, n + 1);
+}
+
+GString::GString(const char *s1, int length1) {
+ s = NULL;
+ resize(length = length1);
+ memcpy(s, s1, length * sizeof(char));
+ s[length] = '\0';
+}
+
+GString::GString(GString *str) {
+ s = NULL;
+ resize(length = str->getLength());
+ memcpy(s, str->getCString(), length + 1);
+}
+
+GString::GString(GString *str1, GString *str2) {
+ int n1 = str1->getLength();
+ int n2 = str2->getLength();
+
+ s = NULL;
+ resize(length = n1 + n2);
+ memcpy(s, str1->getCString(), n1);
+ memcpy(s + n1, str2->getCString(), n2 + 1);
+}
+
+GString *GString::fromInt(int x) {
+ char buf[24]; // enough space for 64-bit ints plus a little extra
+ GBool neg;
+ Guint y;
+ int i;
+
+ i = 24;
+ if (x == 0) {
+ buf[--i] = '0';
+ } else {
+ if ((neg = x < 0)) {
+ y = (Guint)-x;
+ } else {
+ y = (Guint)x;
+ }
+ while (i > 0 && y > 0) {
+ buf[--i] = '0' + y % 10;
+ y /= 10;
+ }
+ if (neg && i > 0) {
+ buf[--i] = '-';
+ }
+ }
+ return new GString(buf + i, 24 - i);
+}
+
+GString::~GString() {
+ delete[] s;
+}
+
+GString *GString::clear() {
+ s[length = 0] = '\0';
+ resize(0);
+ return this;
+}
+
+GString *GString::append(char c) {
+ resize(length + 1);
+ s[length++] = c;
+ s[length] = '\0';
+ return this;
+}
+
+GString *GString::append(GString *str) {
+ int n = str->getLength();
+
+ resize(length + n);
+ memcpy(s + length, str->getCString(), n + 1);
+ length += n;
+ return this;
+}
+
+GString *GString::append(const char *str) {
+ int n = strlen(str);
+
+ resize(length + n);
+ memcpy(s + length, str, n + 1);
+ length += n;
+ return this;
+}
+
+GString *GString::append(const char *str, int length1) {
+ resize(length + length1);
+ memcpy(s + length, str, length1);
+ length += length1;
+ s[length] = '\0';
+ return this;
+}
+
+GString *GString::insert(int i, char c) {
+ int j;
+
+ resize(length + 1);
+ for (j = length + 1; j > i; --j)
+ s[j] = s[j-1];
+ s[i] = c;
+ ++length;
+ return this;
+}
+
+GString *GString::insert(int i, GString *str) {
+ int n = str->getLength();
+ int j;
+
+ resize(length + n);
+ for (j = length; j >= i; --j)
+ s[j+n] = s[j];
+ memcpy(s+i, str->getCString(), n);
+ length += n;
+ return this;
+}
+
+GString *GString::insert(int i, const char *str) {
+ int n = strlen(str);
+ int j;
+
+ resize(length + n);
+ for (j = length; j >= i; --j)
+ s[j+n] = s[j];
+ memcpy(s+i, str, n);
+ length += n;
+ return this;
+}
+
+GString *GString::insert(int i, const char *str, int length1) {
+ int j;
+
+ resize(length + length1);
+ for (j = length; j >= i; --j)
+ s[j+length1] = s[j];
+ memcpy(s+i, str, length1);
+ length += length1;
+ return this;
+}
+
+GString *GString::del(int i, int n) {
+ int j;
+
+ if (n > 0) {
+ for (j = i; j <= length - n; ++j)
+ s[j] = s[j + n];
+ resize(length -= n);
+ }
+ return this;
+}
+
+GString *GString::upperCase() {
+ int i;
+
+ for (i = 0; i < length; ++i) {
+ if (islower(s[i]))
+ s[i] = toupper(s[i]);
+ }
+ return this;
+}
+
+GString *GString::lowerCase() {
+ int i;
+
+ for (i = 0; i < length; ++i) {
+ if (isupper(s[i]))
+ s[i] = tolower(s[i]);
+ }
+ return this;
+}
diff --git a/pdf2swf/xpdf/GString.h b/pdf2swf/xpdf/GString.h
new file mode 100644
index 00000000..4c3b95f3
--- /dev/null
+++ b/pdf2swf/xpdf/GString.h
@@ -0,0 +1,95 @@
+//========================================================================
+//
+// GString.h
+//
+// Simple variable-length string type.
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef GSTRING_H
+#define GSTRING_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include <string.h>
+
+class GString {
+public:
+
+ // Create an empty string.
+ GString();
+
+ // Create a string from a C string.
+ GString(const char *s1);
+
+ // Create a string from <length1> chars at <s1>. This string
+ // can contain null characters.
+ GString (const char *s1, int length1);
+
+ // Copy a string.
+ GString(GString *str);
+ GString *copy() { return new GString(this); }
+
+ // Concatenate two strings.
+ GString(GString *str1, GString *str2);
+
+ // Convert an integer to a string.
+ static GString *fromInt(int x);
+
+ // Destructor.
+ ~GString();
+
+ // Get length.
+ int getLength() { return length; }
+
+ // Get C string.
+ char *getCString() { return s; }
+
+ // Get <i>th character.
+ char getChar(int i) { return s[i]; }
+
+ // Change <i>th character.
+ void setChar(int i, char c) { s[i] = c; }
+
+ // Clear string to zero length.
+ GString *clear();
+
+ // Append a character or string.
+ GString *append(char c);
+ GString *append(GString *str);
+ GString *append(const char *str);
+ GString *append(const char *str, int length1);
+
+ // Insert a character or string.
+ GString *insert(int i, char c);
+ GString *insert(int i, GString *str);
+ GString *insert(int i, const char *str);
+ GString *insert(int i, const char *str, int length1);
+
+ // Delete a character or range of characters.
+ GString *del(int i, int n = 1);
+
+ // Convert string to all-upper/all-lower case.
+ GString *upperCase();
+ GString *lowerCase();
+
+ // Compare two strings: -1:< 0:= +1:>
+ // These functions assume the strings do not contain null characters.
+ int cmp(GString *str) { return strcmp(s, str->getCString()); }
+ int cmpN(GString *str, int n) { return strncmp(s, str->getCString(), n); }
+ int cmp(const char *s1) { return strcmp(s, s1); }
+ int cmpN(const char *s1, int n) { return strncmp(s, s1, n); }
+
+private:
+
+ int length;
+ char *s;
+
+ void resize(int length1);
+};
+
+#endif
diff --git a/pdf2swf/xpdf/Gfx.cc b/pdf2swf/xpdf/Gfx.cc
new file mode 100644
index 00000000..0096d4b3
--- /dev/null
+++ b/pdf2swf/xpdf/Gfx.cc
@@ -0,0 +1,2107 @@
+//========================================================================
+//
+// Gfx.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+#include <math.h>
+#include "gmem.h"
+#include "Object.h"
+#include "Array.h"
+#include "Dict.h"
+#include "Stream.h"
+#include "Lexer.h"
+#include "Parser.h"
+#include "GfxFont.h"
+#include "GfxState.h"
+#include "OutputDev.h"
+#include "Params.h"
+#include "Error.h"
+#include "Gfx.h"
+
+//------------------------------------------------------------------------
+// Operator table
+//------------------------------------------------------------------------
+
+Operator Gfx::opTab[] = {
+ {"\"", 3, {tchkNum, tchkNum, tchkString},
+ &Gfx::opMoveSetShowText},
+ {"'", 1, {tchkString},
+ &Gfx::opMoveShowText},
+ {"B", 0, {tchkNone},
+ &Gfx::opFillStroke},
+ {"B*", 0, {tchkNone},
+ &Gfx::opEOFillStroke},
+ {"BDC", 2, {tchkName, tchkProps},
+ &Gfx::opBeginMarkedContent},
+ {"BI", 0, {tchkNone},
+ &Gfx::opBeginImage},
+ {"BMC", 1, {tchkName},
+ &Gfx::opBeginMarkedContent},
+ {"BT", 0, {tchkNone},
+ &Gfx::opBeginText},
+ {"BX", 0, {tchkNone},
+ &Gfx::opBeginIgnoreUndef},
+ {"CS", 1, {tchkName},
+ &Gfx::opSetStrokeColorSpace},
+ {"DP", 2, {tchkName, tchkProps},
+ &Gfx::opMarkPoint},
+ {"Do", 1, {tchkName},
+ &Gfx::opXObject},
+ {"EI", 0, {tchkNone},
+ &Gfx::opEndImage},
+ {"EMC", 0, {tchkNone},
+ &Gfx::opEndMarkedContent},
+ {"ET", 0, {tchkNone},
+ &Gfx::opEndText},
+ {"EX", 0, {tchkNone},
+ &Gfx::opEndIgnoreUndef},
+ {"F", 0, {tchkNone},
+ &Gfx::opFill},
+ {"G", 1, {tchkNum},
+ &Gfx::opSetStrokeGray},
+ {"ID", 0, {tchkNone},
+ &Gfx::opImageData},
+ {"J", 1, {tchkInt},
+ &Gfx::opSetLineCap},
+ {"K", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opSetStrokeCMYKColor},
+ {"M", 1, {tchkNum},
+ &Gfx::opSetMiterLimit},
+ {"MP", 1, {tchkName},
+ &Gfx::opMarkPoint},
+ {"Q", 0, {tchkNone},
+ &Gfx::opRestore},
+ {"RG", 3, {tchkNum, tchkNum, tchkNum},
+ &Gfx::opSetStrokeRGBColor},
+ {"S", 0, {tchkNone},
+ &Gfx::opStroke},
+ {"SC", -4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opSetStrokeColor},
+ {"SCN", -5, {tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN},
+ &Gfx::opSetStrokeColorN},
+ {"T*", 0, {tchkNone},
+ &Gfx::opTextNextLine},
+ {"TD", 2, {tchkNum, tchkNum},
+ &Gfx::opTextMoveSet},
+ {"TJ", 1, {tchkArray},
+ &Gfx::opShowSpaceText},
+ {"TL", 1, {tchkNum},
+ &Gfx::opSetTextLeading},
+ {"Tc", 1, {tchkNum},
+ &Gfx::opSetCharSpacing},
+ {"Td", 2, {tchkNum, tchkNum},
+ &Gfx::opTextMove},
+ {"Tf", 2, {tchkName, tchkNum},
+ &Gfx::opSetFont},
+ {"Tj", 1, {tchkString},
+ &Gfx::opShowText},
+ {"Tm", 6, {tchkNum, tchkNum, tchkNum, tchkNum,
+ tchkNum, tchkNum},
+ &Gfx::opSetTextMatrix},
+ {"Tr", 1, {tchkInt},
+ &Gfx::opSetTextRender},
+ {"Ts", 1, {tchkNum},
+ &Gfx::opSetTextRise},
+ {"Tw", 1, {tchkNum},
+ &Gfx::opSetWordSpacing},
+ {"Tz", 1, {tchkNum},
+ &Gfx::opSetHorizScaling},
+ {"W", 0, {tchkNone},
+ &Gfx::opClip},
+ {"W*", 0, {tchkNone},
+ &Gfx::opEOClip},
+ {"b", 0, {tchkNone},
+ &Gfx::opCloseFillStroke},
+ {"b*", 0, {tchkNone},
+ &Gfx::opCloseEOFillStroke},
+ {"c", 6, {tchkNum, tchkNum, tchkNum, tchkNum,
+ tchkNum, tchkNum},
+ &Gfx::opCurveTo},
+ {"cm", 6, {tchkNum, tchkNum, tchkNum, tchkNum,
+ tchkNum, tchkNum},
+ &Gfx::opConcat},
+ {"cs", 1, {tchkName},
+ &Gfx::opSetFillColorSpace},
+ {"d", 2, {tchkArray, tchkNum},
+ &Gfx::opSetDash},
+ {"d0", 2, {tchkNum, tchkNum},
+ &Gfx::opSetCharWidth},
+ {"d1", 6, {tchkNum, tchkNum, tchkNum, tchkNum,
+ tchkNum, tchkNum},
+ &Gfx::opSetCacheDevice},
+ {"f", 0, {tchkNone},
+ &Gfx::opFill},
+ {"f*", 0, {tchkNone},
+ &Gfx::opEOFill},
+ {"g", 1, {tchkNum},
+ &Gfx::opSetFillGray},
+ {"gs", 1, {tchkName},
+ &Gfx::opSetExtGState},
+ {"h", 0, {tchkNone},
+ &Gfx::opClosePath},
+ {"i", 1, {tchkNum},
+ &Gfx::opSetFlat},
+ {"j", 1, {tchkInt},
+ &Gfx::opSetLineJoin},
+ {"k", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opSetFillCMYKColor},
+ {"l", 2, {tchkNum, tchkNum},
+ &Gfx::opLineTo},
+ {"m", 2, {tchkNum, tchkNum},
+ &Gfx::opMoveTo},
+ {"n", 0, {tchkNone},
+ &Gfx::opEndPath},
+ {"q", 0, {tchkNone},
+ &Gfx::opSave},
+ {"re", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opRectangle},
+ {"rg", 3, {tchkNum, tchkNum, tchkNum},
+ &Gfx::opSetFillRGBColor},
+ {"ri", 1, {tchkName},
+ &Gfx::opSetRenderingIntent},
+ {"s", 0, {tchkNone},
+ &Gfx::opCloseStroke},
+ {"sc", -4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opSetFillColor},
+ {"scn", -5, {tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN},
+ &Gfx::opSetFillColorN},
+ {"sh", 1, {tchkName},
+ &Gfx::opShFill},
+ {"v", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opCurveTo1},
+ {"w", 1, {tchkNum},
+ &Gfx::opSetLineWidth},
+ {"y", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opCurveTo2},
+};
+
+#define numOps (sizeof(opTab) / sizeof(Operator))
+
+//------------------------------------------------------------------------
+
+GBool printCommands = gFalse;
+
+//------------------------------------------------------------------------
+// GfxResources
+//------------------------------------------------------------------------
+
+GfxResources::GfxResources(Dict *resDict, GfxResources *next) {
+ Object obj1;
+
+ if (resDict) {
+
+ // build font dictionary
+ fonts = NULL;
+ resDict->lookup("Font", &obj1);
+ if (obj1.isDict()) {
+ fonts = new GfxFontDict(obj1.getDict());
+ }
+ obj1.free();
+
+ // get XObject dictionary
+ resDict->lookup("XObject", &xObjDict);
+
+ // get color space dictionary
+ resDict->lookup("ColorSpace", &colorSpaceDict);
+
+ // get pattern dictionary
+ resDict->lookup("Pattern", &patternDict);
+
+ // get graphics state parameter dictionary
+ resDict->lookup("ExtGState", &gStateDict);
+
+ } else {
+ fonts = NULL;
+ xObjDict.initNull();
+ colorSpaceDict.initNull();
+ patternDict.initNull();
+ gStateDict.initNull();
+ }
+
+ this->next = next;
+}
+
+GfxResources::~GfxResources() {
+ if (fonts) {
+ delete fonts;
+ }
+ xObjDict.free();
+ colorSpaceDict.free();
+ patternDict.free();
+ gStateDict.free();
+}
+
+GfxFont *GfxResources::lookupFont(char *name) {
+ GfxFont *font;
+ GfxResources *resPtr;
+
+ for (resPtr = this; resPtr; resPtr = resPtr->next) {
+ if (resPtr->fonts) {
+ if ((font = resPtr->fonts->lookup(name)))
+ return font;
+ }
+ }
+ error(-1, "Unknown font tag '%s'", name);
+ return NULL;
+}
+
+GBool GfxResources::lookupXObject(char *name, Object *obj) {
+ GfxResources *resPtr;
+
+ for (resPtr = this; resPtr; resPtr = resPtr->next) {
+ if (resPtr->xObjDict.isDict()) {
+ if (!resPtr->xObjDict.dictLookup(name, obj)->isNull())
+ return gTrue;
+ obj->free();
+ }
+ }
+ error(-1, "XObject '%s' is unknown", name);
+ return gFalse;
+}
+
+GBool GfxResources::lookupXObjectNF(char *name, Object *obj) {
+ GfxResources *resPtr;
+
+ for (resPtr = this; resPtr; resPtr = resPtr->next) {
+ if (resPtr->xObjDict.isDict()) {
+ if (!resPtr->xObjDict.dictLookupNF(name, obj)->isNull())
+ return gTrue;
+ obj->free();
+ }
+ }
+ error(-1, "XObject '%s' is unknown", name);
+ return gFalse;
+}
+
+void GfxResources::lookupColorSpace(char *name, Object *obj) {
+ GfxResources *resPtr;
+
+ for (resPtr = this; resPtr; resPtr = resPtr->next) {
+ if (resPtr->colorSpaceDict.isDict()) {
+ if (!resPtr->colorSpaceDict.dictLookup(name, obj)->isNull()) {
+ return;
+ }
+ obj->free();
+ }
+ }
+ obj->initNull();
+}
+
+GfxPattern *GfxResources::lookupPattern(char *name) {
+ GfxResources *resPtr;
+ GfxPattern *pattern;
+ Object obj;
+
+ for (resPtr = this; resPtr; resPtr = resPtr->next) {
+ if (resPtr->patternDict.isDict()) {
+ if (!resPtr->patternDict.dictLookup(name, &obj)->isNull()) {
+ pattern = GfxPattern::parse(&obj);
+ obj.free();
+ return pattern;
+ }
+ obj.free();
+ }
+ }
+ error(-1, "Unknown pattern '%s'", name);
+ return NULL;
+}
+
+GBool GfxResources::lookupGState(char *name, Object *obj) {
+ GfxResources *resPtr;
+
+ for (resPtr = this; resPtr; resPtr = resPtr->next) {
+ if (resPtr->gStateDict.isDict()) {
+ if (!resPtr->gStateDict.dictLookup(name, obj)->isNull()) {
+ return gTrue;
+ }
+ obj->free();
+ }
+ }
+ error(-1, "ExtGState '%s' is unknown", name);
+ return gFalse;
+}
+
+//------------------------------------------------------------------------
+// Gfx
+//------------------------------------------------------------------------
+
+Gfx::Gfx(OutputDev *out1, int pageNum, Dict *resDict,
+ double dpi, double x1, double y1, double x2, double y2, GBool crop,
+ double cropX1, double cropY1, double cropX2, double cropY2,
+ int rotate) {
+ int i;
+
+ // start the resource stack
+ res = new GfxResources(resDict, NULL);
+
+ // initialize
+ out = out1;
+ state = new GfxState(dpi, x1, y1, x2, y2, rotate, out->upsideDown());
+ fontChanged = gFalse;
+ clip = clipNone;
+ ignoreUndef = 0;
+ out->startPage(pageNum, state);
+ out->setDefaultCTM(state->getCTM());
+ out->updateAll(state);
+ for (i = 0; i < 6; ++i) {
+ baseMatrix[i] = state->getCTM()[i];
+ }
+
+ // set crop box
+ if (crop) {
+ state->moveTo(cropX1, cropY1);
+ state->lineTo(cropX2, cropY1);
+ state->lineTo(cropX2, cropY2);
+ state->lineTo(cropX1, cropY2);
+ state->closePath();
+ out->clip(state);
+ state->clearPath();
+ }
+}
+
+Gfx::~Gfx() {
+ GfxResources *resPtr;
+
+ while (state->hasSaves()) {
+ state = state->restore();
+ out->restoreState(state);
+ }
+ out->endPage();
+ while (res) {
+ resPtr = res->getNext();
+ delete res;
+ res = resPtr;
+ }
+ if (state)
+ delete state;
+}
+
+void Gfx::display(Object *obj, GBool topLevel) {
+ Object obj2;
+ int i;
+
+ if (obj->isArray()) {
+ for (i = 0; i < obj->arrayGetLength(); ++i) {
+ obj->arrayGet(i, &obj2);
+ if (!obj2.isStream()) {
+ error(-1, "Weird page contents");
+ obj2.free();
+ return;
+ }
+ obj2.free();
+ }
+ } else if (!obj->isStream()) {
+ error(-1, "Weird page contents");
+ return;
+ }
+ parser = new Parser(new Lexer(obj));
+ go(topLevel);
+ delete parser;
+ parser = NULL;
+}
+
+void Gfx::go(GBool topLevel) {
+ Object obj;
+ Object args[maxArgs];
+ int numCmds, numArgs;
+ int i;
+
+ // scan a sequence of objects
+ numCmds = 0;
+ numArgs = 0;
+ parser->getObj(&obj);
+ while (!obj.isEOF()) {
+
+ // got a command - execute it
+ if (obj.isCmd()) {
+ if (printCommands) {
+ obj.print(stdout);
+ for (i = 0; i < numArgs; ++i) {
+ printf(" ");
+ args[i].print(stdout);
+ }
+ printf("\n");
+ }
+ execOp(&obj, args, numArgs);
+ obj.free();
+ for (i = 0; i < numArgs; ++i)
+ args[i].free();
+ numArgs = 0;
+
+ // periodically update display
+ if (++numCmds == 200) {
+ out->dump();
+ numCmds = 0;
+ }
+
+ // got an argument - save it
+ } else if (numArgs < maxArgs) {
+ args[numArgs++] = obj;
+
+ // too many arguments - something is wrong
+ } else {
+ error(getPos(), "Too many args in content stream");
+ if (printCommands) {
+ printf("throwing away arg: ");
+ obj.print(stdout);
+ printf("\n");
+ }
+ obj.free();
+ }
+
+ // grab the next object
+ parser->getObj(&obj);
+ }
+ obj.free();
+
+ // args at end with no command
+ if (numArgs > 0) {
+ error(getPos(), "Leftover args in content stream");
+ if (printCommands) {
+ printf("%d leftovers:", numArgs);
+ for (i = 0; i < numArgs; ++i) {
+ printf(" ");
+ args[i].print(stdout);
+ }
+ printf("\n");
+ }
+ for (i = 0; i < numArgs; ++i)
+ args[i].free();
+ }
+
+ // update display
+ if (topLevel && numCmds > 0) {
+ out->dump();
+ }
+
+ // clean up
+ if (printCommands) {
+ fflush(stdout);
+ }
+}
+
+void Gfx::execOp(Object *cmd, Object args[], int numArgs) {
+ Operator *op;
+ char *name;
+ int i;
+
+ // find operator
+ name = cmd->getName();
+ if (!(op = findOp(name))) {
+ if (ignoreUndef == 0)
+ error(getPos(), "Unknown operator '%s'", name);
+ return;
+ }
+
+ // type check args
+ if (op->numArgs >= 0) {
+ if (numArgs != op->numArgs) {
+ error(getPos(), "Wrong number (%d) of args to '%s' operator",
+ numArgs, name);
+ return;
+ }
+ } else {
+ if (numArgs > -op->numArgs) {
+ error(getPos(), "Too many (%d) args to '%s' operator",
+ numArgs, name);
+ return;
+ }
+ }
+ for (i = 0; i < numArgs; ++i) {
+ if (!checkArg(&args[i], op->tchk[i])) {
+ error(getPos(), "Arg #%d to '%s' operator is wrong type (%s)",
+ i, name, args[i].getTypeName());
+ return;
+ }
+ }
+
+ // do it
+ (this->*op->func)(args, numArgs);
+}
+
+Operator *Gfx::findOp(char *name) {
+ int a, b, m, cmp;
+
+ a = -1;
+ b = numOps;
+ // invariant: opTab[a] < name < opTab[b]
+ while (b - a > 1) {
+ m = (a + b) / 2;
+ cmp = strcmp(opTab[m].name, name);
+ if (cmp < 0)
+ a = m;
+ else if (cmp > 0)
+ b = m;
+ else
+ a = b = m;
+ }
+ if (cmp != 0)
+ return NULL;
+ return &opTab[a];
+}
+
+GBool Gfx::checkArg(Object *arg, TchkType type) {
+ switch (type) {
+ case tchkBool: return arg->isBool();
+ case tchkInt: return arg->isInt();
+ case tchkNum: return arg->isNum();
+ case tchkString: return arg->isString();
+ case tchkName: return arg->isName();
+ case tchkArray: return arg->isArray();
+ case tchkProps: return arg->isDict() || arg->isName();
+ case tchkSCN: return arg->isNum() || arg->isName();
+ case tchkNone: return gFalse;
+ }
+ return gFalse;
+}
+
+int Gfx::getPos() {
+ return parser ? parser->getPos() : -1;
+}
+
+//------------------------------------------------------------------------
+// graphics state operators
+//------------------------------------------------------------------------
+
+void Gfx::opSave(Object args[], int numArgs) {
+ out->saveState(state);
+ state = state->save();
+}
+
+void Gfx::opRestore(Object args[], int numArgs) {
+ state = state->restore();
+ out->restoreState(state);
+
+ // Some PDF producers (Macromedia FreeHand) generate a save (q) and
+ // restore (Q) inside a path sequence. The PDF spec seems to imply
+ // that this is illegal. Calling clearPath() here implements the
+ // behavior apparently expected by this software.
+ state->clearPath();
+}
+
+void Gfx::opConcat(Object args[], int numArgs) {
+ state->concatCTM(args[0].getNum(), args[1].getNum(),
+ args[2].getNum(), args[3].getNum(),
+ args[4].getNum(), args[5].getNum());
+ out->updateCTM(state, args[0].getNum(), args[1].getNum(),
+ args[2].getNum(), args[3].getNum(),
+ args[4].getNum(), args[5].getNum());
+ fontChanged = gTrue;
+}
+
+void Gfx::opSetDash(Object args[], int numArgs) {
+ Array *a;
+ int length;
+ Object obj;
+ double *dash;
+ int i;
+
+ a = args[0].getArray();
+ length = a->getLength();
+ if (length == 0) {
+ dash = NULL;
+ } else {
+ dash = (double *)gmalloc(length * sizeof(double));
+ for (i = 0; i < length; ++i) {
+ dash[i] = a->get(i, &obj)->getNum();
+ obj.free();
+ }
+ }
+ state->setLineDash(dash, length, args[1].getNum());
+ out->updateLineDash(state);
+}
+
+void Gfx::opSetFlat(Object args[], int numArgs) {
+ state->setFlatness((int)args[0].getNum());
+ out->updateFlatness(state);
+}
+
+void Gfx::opSetLineJoin(Object args[], int numArgs) {
+ state->setLineJoin(args[0].getInt());
+ out->updateLineJoin(state);
+}
+
+void Gfx::opSetLineCap(Object args[], int numArgs) {
+ state->setLineCap(args[0].getInt());
+ out->updateLineCap(state);
+}
+
+void Gfx::opSetMiterLimit(Object args[], int numArgs) {
+ state->setMiterLimit(args[0].getNum());
+ out->updateMiterLimit(state);
+}
+
+void Gfx::opSetLineWidth(Object args[], int numArgs) {
+ state->setLineWidth(args[0].getNum());
+ out->updateLineWidth(state);
+}
+
+void Gfx::opSetExtGState(Object args[], int numArgs) {
+ Object obj1, obj2;
+
+ if (!res->lookupGState(args[0].getName(), &obj1)) {
+ return;
+ }
+ if (!obj1.isDict()) {
+ error(getPos(), "ExtGState '%s' is wrong type", args[0].getName());
+ obj1.free();
+ return;
+ }
+ if (obj1.dictLookup("ca", &obj2)->isNum()) {
+ state->setFillOpacity(obj2.getNum());
+ out->updateFillOpacity(state);
+ }
+ obj2.free();
+ if (obj1.dictLookup("CA", &obj2)->isNum()) {
+ state->setStrokeOpacity(obj2.getNum());
+ out->updateStrokeOpacity(state);
+ }
+ obj2.free();
+ obj1.free();
+}
+
+void Gfx::opSetRenderingIntent(Object args[], int numArgs) {
+}
+
+//------------------------------------------------------------------------
+// color operators
+//------------------------------------------------------------------------
+
+void Gfx::opSetFillGray(Object args[], int numArgs) {
+ GfxColor color;
+
+ state->setFillPattern(NULL);
+ state->setFillColorSpace(new GfxDeviceGrayColorSpace());
+ color.c[0] = args[0].getNum();
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+}
+
+void Gfx::opSetStrokeGray(Object args[], int numArgs) {
+ GfxColor color;
+
+ state->setStrokePattern(NULL);
+ state->setStrokeColorSpace(new GfxDeviceGrayColorSpace());
+ color.c[0] = args[0].getNum();
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+}
+
+void Gfx::opSetFillCMYKColor(Object args[], int numArgs) {
+ GfxColor color;
+ int i;
+
+ state->setFillPattern(NULL);
+ state->setFillColorSpace(new GfxDeviceCMYKColorSpace());
+ for (i = 0; i < 4; ++i) {
+ color.c[i] = args[i].getNum();
+ }
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+}
+
+void Gfx::opSetStrokeCMYKColor(Object args[], int numArgs) {
+ GfxColor color;
+ int i;
+
+ state->setStrokePattern(NULL);
+ state->setStrokeColorSpace(new GfxDeviceCMYKColorSpace());
+ for (i = 0; i < 4; ++i) {
+ color.c[i] = args[i].getNum();
+ }
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+}
+
+void Gfx::opSetFillRGBColor(Object args[], int numArgs) {
+ GfxColor color;
+ int i;
+
+ state->setFillPattern(NULL);
+ state->setFillColorSpace(new GfxDeviceRGBColorSpace());
+ for (i = 0; i < 3; ++i) {
+ color.c[i] = args[i].getNum();
+ }
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+}
+
+void Gfx::opSetStrokeRGBColor(Object args[], int numArgs) {
+ GfxColor color;
+ int i;
+
+ state->setStrokePattern(NULL);
+ state->setStrokeColorSpace(new GfxDeviceRGBColorSpace());
+ for (i = 0; i < 3; ++i) {
+ color.c[i] = args[i].getNum();
+ }
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+}
+
+void Gfx::opSetFillColorSpace(Object args[], int numArgs) {
+ Object obj;
+ GfxColorSpace *colorSpace;
+ GfxColor color;
+ int i;
+
+ state->setFillPattern(NULL);
+ res->lookupColorSpace(args[0].getName(), &obj);
+ if (obj.isNull()) {
+ colorSpace = GfxColorSpace::parse(&args[0]);
+ } else {
+ colorSpace = GfxColorSpace::parse(&obj);
+ }
+ obj.free();
+ if (colorSpace) {
+ state->setFillColorSpace(colorSpace);
+ } else {
+ error(getPos(), "Bad color space");
+ }
+ for (i = 0; i < gfxColorMaxComps; ++i) {
+ color.c[i] = 0;
+ }
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+}
+
+void Gfx::opSetStrokeColorSpace(Object args[], int numArgs) {
+ Object obj;
+ GfxColorSpace *colorSpace;
+ GfxColor color;
+ int i;
+
+ state->setStrokePattern(NULL);
+ res->lookupColorSpace(args[0].getName(), &obj);
+ if (obj.isNull()) {
+ colorSpace = GfxColorSpace::parse(&args[0]);
+ } else {
+ colorSpace = GfxColorSpace::parse(&obj);
+ }
+ obj.free();
+ if (colorSpace) {
+ state->setStrokeColorSpace(colorSpace);
+ } else {
+ error(getPos(), "Bad color space");
+ }
+ for (i = 0; i < gfxColorMaxComps; ++i) {
+ color.c[i] = 0;
+ }
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+}
+
+void Gfx::opSetFillColor(Object args[], int numArgs) {
+ GfxColor color;
+ int i;
+
+ state->setFillPattern(NULL);
+ for (i = 0; i < numArgs; ++i) {
+ color.c[i] = args[i].getNum();
+ }
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+}
+
+void Gfx::opSetStrokeColor(Object args[], int numArgs) {
+ GfxColor color;
+ int i;
+
+ state->setStrokePattern(NULL);
+ for (i = 0; i < numArgs; ++i) {
+ color.c[i] = args[i].getNum();
+ }
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+}
+
+void Gfx::opSetFillColorN(Object args[], int numArgs) {
+ GfxColor color;
+ GfxPattern *pattern;
+ int i;
+
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ if (numArgs > 1) {
+ for (i = 0; i < numArgs && i < 4; ++i) {
+ if (args[i].isNum()) {
+ color.c[i] = args[i].getNum();
+ }
+ }
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+ }
+ if (args[numArgs-1].isName() &&
+ (pattern = res->lookupPattern(args[numArgs-1].getName()))) {
+ state->setFillPattern(pattern);
+ }
+
+ } else {
+ state->setFillPattern(NULL);
+ for (i = 0; i < numArgs && i < 4; ++i) {
+ if (args[i].isNum()) {
+ color.c[i] = args[i].getNum();
+ }
+ }
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+ }
+}
+
+void Gfx::opSetStrokeColorN(Object args[], int numArgs) {
+ GfxColor color;
+ GfxPattern *pattern;
+ int i;
+
+ if (state->getStrokeColorSpace()->getMode() == csPattern) {
+ if (numArgs > 1) {
+ for (i = 0; i < numArgs && i < 4; ++i) {
+ if (args[i].isNum()) {
+ color.c[i] = args[i].getNum();
+ }
+ }
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+ }
+ if (args[numArgs-1].isName() &&
+ (pattern = res->lookupPattern(args[numArgs-1].getName()))) {
+ state->setStrokePattern(pattern);
+ }
+
+ } else {
+ state->setStrokePattern(NULL);
+ for (i = 0; i < numArgs && i < 4; ++i) {
+ if (args[i].isNum()) {
+ color.c[i] = args[i].getNum();
+ }
+ }
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+ }
+}
+
+//------------------------------------------------------------------------
+// path segment operators
+//------------------------------------------------------------------------
+
+void Gfx::opMoveTo(Object args[], int numArgs) {
+ state->moveTo(args[0].getNum(), args[1].getNum());
+}
+
+void Gfx::opLineTo(Object args[], int numArgs) {
+ if (!state->isCurPt()) {
+ error(getPos(), "No current point in lineto");
+ return;
+ }
+ state->lineTo(args[0].getNum(), args[1].getNum());
+}
+
+void Gfx::opCurveTo(Object args[], int numArgs) {
+ double x1, y1, x2, y2, x3, y3;
+
+ if (!state->isCurPt()) {
+ error(getPos(), "No current point in curveto");
+ return;
+ }
+ x1 = args[0].getNum();
+ y1 = args[1].getNum();
+ x2 = args[2].getNum();
+ y2 = args[3].getNum();
+ x3 = args[4].getNum();
+ y3 = args[5].getNum();
+ state->curveTo(x1, y1, x2, y2, x3, y3);
+}
+
+void Gfx::opCurveTo1(Object args[], int numArgs) {
+ double x1, y1, x2, y2, x3, y3;
+
+ if (!state->isCurPt()) {
+ error(getPos(), "No current point in curveto1");
+ return;
+ }
+ x1 = state->getCurX();
+ y1 = state->getCurY();
+ x2 = args[0].getNum();
+ y2 = args[1].getNum();
+ x3 = args[2].getNum();
+ y3 = args[3].getNum();
+ state->curveTo(x1, y1, x2, y2, x3, y3);
+}
+
+void Gfx::opCurveTo2(Object args[], int numArgs) {
+ double x1, y1, x2, y2, x3, y3;
+
+ if (!state->isCurPt()) {
+ error(getPos(), "No current point in curveto2");
+ return;
+ }
+ x1 = args[0].getNum();
+ y1 = args[1].getNum();
+ x2 = args[2].getNum();
+ y2 = args[3].getNum();
+ x3 = x2;
+ y3 = y2;
+ state->curveTo(x1, y1, x2, y2, x3, y3);
+}
+
+void Gfx::opRectangle(Object args[], int numArgs) {
+ double x, y, w, h;
+
+ x = args[0].getNum();
+ y = args[1].getNum();
+ w = args[2].getNum();
+ h = args[3].getNum();
+ state->moveTo(x, y);
+ state->lineTo(x + w, y);
+ state->lineTo(x + w, y + h);
+ state->lineTo(x, y + h);
+ state->closePath();
+}
+
+void Gfx::opClosePath(Object args[], int numArgs) {
+ if (!state->isPath()) {
+ error(getPos(), "No current point in closepath");
+ return;
+ }
+ state->closePath();
+}
+
+//------------------------------------------------------------------------
+// path painting operators
+//------------------------------------------------------------------------
+
+void Gfx::opEndPath(Object args[], int numArgs) {
+ doEndPath();
+}
+
+void Gfx::opStroke(Object args[], int numArgs) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in stroke");
+ return;
+ }
+ if (state->isPath())
+ out->stroke(state);
+ doEndPath();
+}
+
+void Gfx::opCloseStroke(Object args[], int numArgs) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in closepath/stroke");
+ return;
+ }
+ if (state->isPath()) {
+ state->closePath();
+ out->stroke(state);
+ }
+ doEndPath();
+}
+
+void Gfx::opFill(Object args[], int numArgs) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in fill");
+ return;
+ }
+ if (state->isPath()) {
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ doPatternFill(gFalse);
+ } else {
+ out->fill(state);
+ }
+ }
+ doEndPath();
+}
+
+void Gfx::opEOFill(Object args[], int numArgs) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in eofill");
+ return;
+ }
+ if (state->isPath()) {
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ doPatternFill(gTrue);
+ } else {
+ out->eoFill(state);
+ }
+ }
+ doEndPath();
+}
+
+void Gfx::opFillStroke(Object args[], int numArgs) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in fill/stroke");
+ return;
+ }
+ if (state->isPath()) {
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ doPatternFill(gFalse);
+ } else {
+ out->fill(state);
+ }
+ out->stroke(state);
+ }
+ doEndPath();
+}
+
+void Gfx::opCloseFillStroke(Object args[], int numArgs) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in closepath/fill/stroke");
+ return;
+ }
+ if (state->isPath()) {
+ state->closePath();
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ doPatternFill(gFalse);
+ } else {
+ out->fill(state);
+ }
+ out->stroke(state);
+ }
+ doEndPath();
+}
+
+void Gfx::opEOFillStroke(Object args[], int numArgs) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in eofill/stroke");
+ return;
+ }
+ if (state->isPath()) {
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ doPatternFill(gTrue);
+ } else {
+ out->eoFill(state);
+ }
+ out->stroke(state);
+ }
+ doEndPath();
+}
+
+void Gfx::opCloseEOFillStroke(Object args[], int numArgs) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in closepath/eofill/stroke");
+ return;
+ }
+ if (state->isPath()) {
+ state->closePath();
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ doPatternFill(gTrue);
+ } else {
+ out->eoFill(state);
+ }
+ out->stroke(state);
+ }
+ doEndPath();
+}
+
+void Gfx::opShFill(Object args[], int numArgs) {
+}
+
+void Gfx::doPatternFill(GBool eoFill) {
+ GfxPatternColorSpace *patCS;
+ GfxPattern *pattern;
+ GfxTilingPattern *tPat;
+ GfxColorSpace *cs;
+ GfxPath *path;
+ GfxSubpath *subpath;
+ double xMin, yMin, xMax, yMax, x, y, x1, y1;
+ int xi0, yi0, xi1, yi1, xi, yi;
+ double *ctm, *btm, *ptm;
+ double m[6], ictm[6], m1[6], im[6];
+ double det;
+ double xstep, ystep;
+ int i, j;
+
+ // get color space
+ patCS = (GfxPatternColorSpace *)state->getFillColorSpace();
+
+ // get pattern
+ if (!(pattern = state->getFillPattern())) {
+ return;
+ }
+ if (pattern->getType() != 1) {
+ return;
+ }
+ tPat = (GfxTilingPattern *)pattern;
+
+ // construct a (pattern space) -> (current space) transform matrix
+ ctm = state->getCTM();
+ btm = baseMatrix;
+ ptm = tPat->getMatrix();
+ // iCTM = invert CTM
+ det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
+ ictm[0] = ctm[3] * det;
+ ictm[1] = -ctm[1] * det;
+ ictm[2] = -ctm[2] * det;
+ ictm[3] = ctm[0] * det;
+ ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det;
+ ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det;
+ // m1 = PTM * BTM = PTM * base transform matrix
+ m1[0] = ptm[0] * btm[0] + ptm[1] * btm[2];
+ m1[1] = ptm[0] * btm[1] + ptm[1] * btm[3];
+ m1[2] = ptm[2] * btm[0] + ptm[3] * btm[2];
+ m1[3] = ptm[2] * btm[1] + ptm[3] * btm[3];
+ m1[4] = ptm[4] * btm[0] + ptm[5] * btm[2] + btm[4];
+ m1[5] = ptm[4] * btm[1] + ptm[5] * btm[3] + btm[5];
+ // m = m1 * iCTM = (PTM * BTM) * (iCTM)
+ m[0] = m1[0] * ictm[0] + m1[1] * ictm[2];
+ m[1] = m1[0] * ictm[1] + m1[1] * ictm[3];
+ m[2] = m1[2] * ictm[0] + m1[3] * ictm[2];
+ m[3] = m1[2] * ictm[1] + m1[3] * ictm[3];
+ m[4] = m1[4] * ictm[0] + m1[5] * ictm[2] + ictm[4];
+ m[5] = m1[4] * ictm[1] + m1[5] * ictm[3] + ictm[5];
+
+ // construct a (current space) -> (pattern space) transform matrix
+ det = 1 / (m[0] * m[3] - m[1] * m[2]);
+ im[0] = m[3] * det;
+ im[1] = -m[1] * det;
+ im[2] = -m[2] * det;
+ im[3] = m[0] * det;
+ im[4] = (m[2] * m[5] - m[3] * m[4]) * det;
+ im[5] = (m[1] * m[4] - m[0] * m[5]) * det;
+
+ // compute bounding box of current path, in pattern space
+ xMin = xMax = yMin = yMax = 0; // make gcc happy
+ path = state->getPath();
+ for (i = 0; i < path->getNumSubpaths(); ++i) {
+ subpath = path->getSubpath(i);
+ for (j = 0; j < subpath->getNumPoints(); ++j) {
+ x = subpath->getX(j);
+ y = subpath->getY(j);
+ x1 = x * im[0] + y * im[2] + im[4];
+ y1 = x * im[1] + y * im[3] + im[5];
+ if (i == 0 && j == 0) {
+ xMin = xMax = x1;
+ yMin = yMax = y1;
+ } else {
+ if (x1 < xMin) {
+ xMin = x1;
+ } else if (x1 > xMax) {
+ xMax = x1;
+ }
+ if (y1 < yMin) {
+ yMin = y1;
+ } else if (y1 > yMax) {
+ yMax = y1;
+ }
+ }
+ }
+ }
+
+ // save current graphics state
+ out->saveState(state);
+ state = state->save();
+
+ // set underlying color space (for uncolored tiling patterns)
+ if (tPat->getPaintType() == 2 && (cs = patCS->getUnder())) {
+ state->setFillColorSpace(cs->copy());
+ } else {
+ state->setFillColorSpace(new GfxDeviceGrayColorSpace());
+ }
+ state->setFillPattern(NULL);
+ out->updateFillColor(state);
+
+ // clip to current path
+ if (eoFill) {
+ out->eoClip(state);
+ } else {
+ out->clip(state);
+ }
+ state->clearPath();
+
+ // draw the pattern
+ //~ this should treat negative steps differently -- start at right/top
+ //~ edge instead of left/bottom (?)
+ xstep = fabs(tPat->getXStep());
+ ystep = fabs(tPat->getYStep());
+ xi0 = (int)floor(xMin / xstep);
+ xi1 = (int)ceil(xMax / xstep);
+ yi0 = (int)floor(yMin / ystep);
+ yi1 = (int)ceil(yMax / ystep);
+ for (i = 0; i < 4; ++i) {
+ m1[i] = m[i];
+ }
+ for (yi = yi0; yi < yi1; ++yi) {
+ for (xi = xi0; xi < xi1; ++xi) {
+ x = xi * xstep;
+ y = yi * ystep;
+ m1[4] = x * m[0] + y * m[2] + m[4];
+ m1[5] = x * m[1] + y * m[3] + m[5];
+ doForm1(tPat->getContentStream(), tPat->getResDict(),
+ m1, tPat->getBBox());
+ }
+ }
+
+ // restore graphics state
+ state = state->restore();
+ out->restoreState(state);
+}
+
+void Gfx::doEndPath() {
+ if (state->isPath()) {
+ if (clip == clipNormal)
+ out->clip(state);
+ else if (clip == clipEO)
+ out->eoClip(state);
+ }
+ clip = clipNone;
+ state->clearPath();
+}
+
+//------------------------------------------------------------------------
+// path clipping operators
+//------------------------------------------------------------------------
+
+void Gfx::opClip(Object args[], int numArgs) {
+ clip = clipNormal;
+}
+
+void Gfx::opEOClip(Object args[], int numArgs) {
+ clip = clipEO;
+}
+
+//------------------------------------------------------------------------
+// text object operators
+//------------------------------------------------------------------------
+
+void Gfx::opBeginText(Object args[], int numArgs) {
+ state->setTextMat(1, 0, 0, 1, 0, 0);
+ state->textMoveTo(0, 0);
+ out->updateTextMat(state);
+ out->updateTextPos(state);
+ fontChanged = gTrue;
+}
+
+void Gfx::opEndText(Object args[], int numArgs) {
+}
+
+//------------------------------------------------------------------------
+// text state operators
+//------------------------------------------------------------------------
+
+void Gfx::opSetCharSpacing(Object args[], int numArgs) {
+ state->setCharSpace(args[0].getNum());
+ out->updateCharSpace(state);
+}
+
+void Gfx::opSetFont(Object args[], int numArgs) {
+ GfxFont *font;
+
+ if (!(font = res->lookupFont(args[0].getName()))) {
+ return;
+ }
+ if (printCommands) {
+ printf(" font: '%s' %g\n",
+ font->getName() ? font->getName()->getCString() : "???",
+ args[1].getNum());
+ }
+ state->setFont(font, args[1].getNum());
+ fontChanged = gTrue;
+}
+
+void Gfx::opSetTextLeading(Object args[], int numArgs) {
+ state->setLeading(args[0].getNum());
+}
+
+void Gfx::opSetTextRender(Object args[], int numArgs) {
+ state->setRender(args[0].getInt());
+ out->updateRender(state);
+}
+
+void Gfx::opSetTextRise(Object args[], int numArgs) {
+ state->setRise(args[0].getNum());
+ out->updateRise(state);
+}
+
+void Gfx::opSetWordSpacing(Object args[], int numArgs) {
+ state->setWordSpace(args[0].getNum());
+ out->updateWordSpace(state);
+}
+
+void Gfx::opSetHorizScaling(Object args[], int numArgs) {
+ state->setHorizScaling(args[0].getNum());
+ out->updateHorizScaling(state);
+}
+
+//------------------------------------------------------------------------
+// text positioning operators
+//------------------------------------------------------------------------
+
+void Gfx::opTextMove(Object args[], int numArgs) {
+ double tx, ty;
+
+ tx = state->getLineX() + args[0].getNum();
+ ty = state->getLineY() + args[1].getNum();
+ state->textMoveTo(tx, ty);
+ out->updateTextPos(state);
+}
+
+void Gfx::opTextMoveSet(Object args[], int numArgs) {
+ double tx, ty;
+
+ tx = state->getLineX() + args[0].getNum();
+ ty = args[1].getNum();
+ state->setLeading(-ty);
+ ty += state->getLineY();
+ state->textMoveTo(tx, ty);
+ out->updateTextPos(state);
+}
+
+void Gfx::opSetTextMatrix(Object args[], int numArgs) {
+ state->setTextMat(args[0].getNum(), args[1].getNum(),
+ args[2].getNum(), args[3].getNum(),
+ args[4].getNum(), args[5].getNum());
+ state->textMoveTo(0, 0);
+ out->updateTextMat(state);
+ out->updateTextPos(state);
+ fontChanged = gTrue;
+}
+
+void Gfx::opTextNextLine(Object args[], int numArgs) {
+ double tx, ty;
+
+ tx = state->getLineX();
+ ty = state->getLineY() - state->getLeading();
+ state->textMoveTo(tx, ty);
+ out->updateTextPos(state);
+}
+
+//------------------------------------------------------------------------
+// text string operators
+//------------------------------------------------------------------------
+
+void Gfx::opShowText(Object args[], int numArgs) {
+ if (!state->getFont()) {
+ error(getPos(), "No font in show");
+ return;
+ }
+ doShowText(args[0].getString());
+}
+
+void Gfx::opMoveShowText(Object args[], int numArgs) {
+ double tx, ty;
+
+ if (!state->getFont()) {
+ error(getPos(), "No font in move/show");
+ return;
+ }
+ tx = state->getLineX();
+ ty = state->getLineY() - state->getLeading();
+ state->textMoveTo(tx, ty);
+ out->updateTextPos(state);
+ doShowText(args[0].getString());
+}
+
+void Gfx::opMoveSetShowText(Object args[], int numArgs) {
+ double tx, ty;
+
+ if (!state->getFont()) {
+ error(getPos(), "No font in move/set/show");
+ return;
+ }
+ state->setWordSpace(args[0].getNum());
+ state->setCharSpace(args[1].getNum());
+ tx = state->getLineX();
+ ty = state->getLineY() - state->getLeading();
+ state->textMoveTo(tx, ty);
+ out->updateWordSpace(state);
+ out->updateCharSpace(state);
+ out->updateTextPos(state);
+ doShowText(args[2].getString());
+}
+
+void Gfx::opShowSpaceText(Object args[], int numArgs) {
+ Array *a;
+ Object obj;
+ int i;
+
+ if (!state->getFont()) {
+ error(getPos(), "No font in show/space");
+ return;
+ }
+ a = args[0].getArray();
+ for (i = 0; i < a->getLength(); ++i) {
+ a->get(i, &obj);
+ if (obj.isNum()) {
+ state->textShift(-obj.getNum() * 0.001 * state->getFontSize());
+ out->updateTextShift(state, obj.getNum());
+ } else if (obj.isString()) {
+ doShowText(obj.getString());
+ } else {
+ error(getPos(), "Element of show/space array must be number or string");
+ }
+ obj.free();
+ }
+}
+
+void Gfx::doShowText(GString *s) {
+ GfxFont *font;
+ GfxFontEncoding16 *enc;
+ Guchar *p;
+ Guchar c8;
+ int c16;
+ GString *s16;
+ char s16a[2];
+ int m, n;
+#if 0 //~type3
+ double dx, dy, width, height, w, h, x, y;
+ double oldCTM[6], newCTM[6];
+ double *mat;
+ Object charProc;
+ Parser *oldParser;
+ int i;
+#else
+ double dx, dy, width, height, w, h, sWidth, sHeight;
+#endif
+
+ if (fontChanged) {
+ out->updateFont(state);
+ fontChanged = gFalse;
+ }
+ font = state->getFont();
+
+ //----- 16-bit font
+ if (font->is16Bit()) {
+ enc = font->getEncoding16();
+ if (out->useDrawChar()) {
+ out->beginString(state, s);
+ s16 = NULL;
+ } else {
+ s16 = new GString();
+ }
+ sWidth = sHeight = 0;
+ state->textTransformDelta(0, state->getRise(), &dx, &dy);
+ p = (Guchar *)s->getCString();
+ n = s->getLength();
+ while (n > 0) {
+ m = getNextChar16(enc, p, &c16);
+ if (enc->wMode == 0) {
+ width = state->getFontSize() * state->getHorizScaling() *
+ font->getWidth16(c16) +
+ state->getCharSpace();
+ if (c16 == ' ') {
+ width += state->getWordSpace();
+ }
+ height = 0;
+ } else {
+ width = 0;
+ height = state->getFontSize() * font->getHeight16(c16);
+ }
+ state->textTransformDelta(width, height, &w, &h);
+ if (out->useDrawChar()) {
+ out->drawChar16(state, state->getCurX() + dx, state->getCurY() + dy,
+ w, h, c16);
+ state->textShift(width, height);
+ } else {
+ s16a[0] = (char)(c16 >> 8);
+ s16a[1] = (char)c16;
+ s16->append(s16a, 2);
+ sWidth += w;
+ sHeight += h;
+ }
+ n -= m;
+ p += m;
+ }
+ if (out->useDrawChar()) {
+ out->endString(state);
+ } else {
+ out->drawString16(state, s16);
+ delete s16;
+ state->textShift(sWidth, sHeight);
+ }
+
+ //----- 8-bit font
+ } else {
+#if 0 //~type3
+ //~ also check out->renderType3()
+ if (font->getType() == fontType3) {
+ out->beginString(state, s);
+ mat = state->getCTM();
+ for (i = 0; i < 6; ++i) {
+ oldCTM[i] = mat[i];
+ }
+ mat = state->getTextMat();
+ newCTM[0] = mat[0] * oldCTM[0] + mat[1] * oldCTM[2];
+ newCTM[1] = mat[0] * oldCTM[1] + mat[1] * oldCTM[3];
+ newCTM[2] = mat[2] * oldCTM[0] + mat[3] * oldCTM[2];
+ newCTM[3] = mat[2] * oldCTM[1] + mat[3] * oldCTM[3];
+ mat = font->getFontMatrix();
+ newCTM[0] = mat[0] * newCTM[0] + mat[1] * newCTM[2];
+ newCTM[1] = mat[0] * newCTM[1] + mat[1] * newCTM[3];
+ newCTM[2] = mat[2] * newCTM[0] + mat[3] * newCTM[2];
+ newCTM[3] = mat[2] * newCTM[1] + mat[3] * newCTM[3];
+ newCTM[0] *= state->getFontSize();
+ newCTM[3] *= state->getFontSize();
+ newCTM[0] *= state->getHorizScaling();
+ newCTM[2] *= state->getHorizScaling();
+ state->textTransformDelta(0, state->getRise(), &dx, &dy);
+ oldParser = parser;
+ for (p = (Guchar *)s->getCString(), n = s->getLength(); n; ++p, --n) {
+ c8 = *p;
+ font->getCharProc(c8, &charProc);
+ state->transform(state->getCurX() + dx, state->getCurY() + dy, &x, &y);
+ state->setCTM(newCTM[0], newCTM[1], newCTM[2], newCTM[3], x, y);
+ //~ out->updateCTM(???)
+ if (charProc.isStream()) {
+ display(&charProc, gFalse);
+ } else {
+ error(getPos(), "Missing or bad Type3 CharProc entry");
+ }
+ state->setCTM(oldCTM[0], oldCTM[1], oldCTM[2],
+ oldCTM[3], oldCTM[4], oldCTM[5]);
+ //~ out->updateCTM(???) - use gsave/grestore instead?
+ charProc.free();
+ width = state->getFontSize() * state->getHorizScaling() *
+ font->getWidth(c8) +
+ state->getCharSpace();
+ if (c8 == ' ') {
+ width += state->getWordSpace();
+ }
+ state->textShift(width);
+ }
+ parser = oldParser;
+ out->endString(state);
+ } else
+#endif
+ if (out->useDrawChar()) {
+ out->beginString(state, s);
+ state->textTransformDelta(0, state->getRise(), &dx, &dy);
+ for (p = (Guchar *)s->getCString(), n = s->getLength(); n; ++p, --n) {
+ c8 = *p;
+ width = state->getFontSize() * state->getHorizScaling() *
+ font->getWidth(c8) +
+ state->getCharSpace();
+ if (c8 == ' ')
+ width += state->getWordSpace();
+ state->textTransformDelta(width, 0, &w, &h);
+ out->drawChar(state, state->getCurX() + dx, state->getCurY() + dy,
+ w, h, c8);
+ state->textShift(width);
+ }
+ out->endString(state);
+ } else {
+ out->drawString(state, s);
+ width = state->getFontSize() * state->getHorizScaling() *
+ font->getWidth(s) +
+ s->getLength() * state->getCharSpace();
+ for (p = (Guchar *)s->getCString(), n = s->getLength(); n; ++p, --n) {
+ if (*p == ' ')
+ width += state->getWordSpace();
+ }
+ state->textShift(width);
+ }
+ }
+}
+
+int Gfx::getNextChar16(GfxFontEncoding16 *enc, Guchar *p, int *c16) {
+ int n;
+ int code;
+ int a, b, m;
+
+ n = enc->codeLen[*p];
+ if (n == 1) {
+ *c16 = enc->map1[*p];
+ } else {
+ code = (p[0] << 8) + p[1];
+ a = 0;
+ b = enc->map2Len;
+ // invariant: map2[2*a] <= code < map2[2*b]
+ while (b - a > 1) {
+ m = (a + b) / 2;
+ if (enc->map2[2*m] <= code)
+ a = m;
+ else if (enc->map2[2*m] > code)
+ b = m;
+ else
+ break;
+ }
+ *c16 = enc->map2[2*a+1] + (code - enc->map2[2*a]);
+ }
+ return n;
+}
+
+//------------------------------------------------------------------------
+// XObject operators
+//------------------------------------------------------------------------
+
+void Gfx::opXObject(Object args[], int numArgs) {
+ Object obj1, obj2, refObj;
+#if OPI_SUPPORT
+ Object opiDict;
+#endif
+
+ if (!res->lookupXObject(args[0].getName(), &obj1)) {
+ return;
+ }
+ if (!obj1.isStream()) {
+ error(getPos(), "XObject '%s' is wrong type", args[0].getName());
+ obj1.free();
+ return;
+ }
+#if OPI_SUPPORT
+ obj1.streamGetDict()->lookup("OPI", &opiDict);
+ if (opiDict.isDict()) {
+ out->opiBegin(state, opiDict.getDict());
+ }
+#endif
+ obj1.streamGetDict()->lookup("Subtype", &obj2);
+ if (obj2.isName("Image")) {
+ res->lookupXObjectNF(args[0].getName(), &refObj);
+ doImage(&refObj, obj1.getStream(), gFalse);
+ refObj.free();
+ } else if (obj2.isName("Form")) {
+ doForm(&obj1);
+ } else if (obj2.isName()) {
+ error(getPos(), "Unknown XObject subtype '%s'", obj2.getName());
+ } else {
+ error(getPos(), "XObject subtype is missing or wrong type");
+ }
+ obj2.free();
+#if OPI_SUPPORT
+ if (opiDict.isDict()) {
+ out->opiEnd(state, opiDict.getDict());
+ }
+ opiDict.free();
+#endif
+ obj1.free();
+}
+
+void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
+ Dict *dict;
+ Object obj1, obj2;
+ int width, height;
+ int bits;
+ GBool mask;
+ GfxColorSpace *colorSpace;
+ GfxImageColorMap *colorMap;
+ GBool invert;
+
+ // get stream dict
+ dict = str->getDict();
+
+ // get size
+ dict->lookup("Width", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("W", &obj1);
+ }
+ if (!obj1.isInt())
+ goto err2;
+ width = obj1.getInt();
+ obj1.free();
+ dict->lookup("Height", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("H", &obj1);
+ }
+ if (!obj1.isInt())
+ goto err2;
+ height = obj1.getInt();
+ obj1.free();
+
+ // image or mask?
+ dict->lookup("ImageMask", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("IM", &obj1);
+ }
+ mask = gFalse;
+ if (obj1.isBool())
+ mask = obj1.getBool();
+ else if (!obj1.isNull())
+ goto err2;
+ obj1.free();
+
+ // bit depth
+ dict->lookup("BitsPerComponent", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("BPC", &obj1);
+ }
+ if (!obj1.isInt())
+ goto err2;
+ bits = obj1.getInt();
+ obj1.free();
+
+ // display a mask
+ if (mask) {
+
+ // check for inverted mask
+ if (bits != 1)
+ goto err1;
+ invert = gFalse;
+ dict->lookup("Decode", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("D", &obj1);
+ }
+ if (obj1.isArray()) {
+ obj1.arrayGet(0, &obj2);
+ if (obj2.isInt() && obj2.getInt() == 1)
+ invert = gTrue;
+ obj2.free();
+ } else if (!obj1.isNull()) {
+ goto err2;
+ }
+ obj1.free();
+
+ // draw it
+ out->drawImageMask(state, ref, str, width, height, invert, inlineImg);
+
+ } else {
+
+ // get color space and color map
+ dict->lookup("ColorSpace", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("CS", &obj1);
+ }
+ if (obj1.isName()) {
+ res->lookupColorSpace(obj1.getName(), &obj2);
+ if (!obj2.isNull()) {
+ obj1.free();
+ obj1 = obj2;
+ } else {
+ obj2.free();
+ }
+ }
+ colorSpace = GfxColorSpace::parse(&obj1);
+ obj1.free();
+ if (!colorSpace) {
+ goto err1;
+ }
+ dict->lookup("Decode", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("D", &obj1);
+ }
+ colorMap = new GfxImageColorMap(bits, &obj1, colorSpace);
+ obj1.free();
+ if (!colorMap->isOk()) {
+ delete colorMap;
+ goto err1;
+ }
+
+ // draw it
+ out->drawImage(state, ref, str, width, height, colorMap, inlineImg);
+ delete colorMap;
+ str->close();
+ }
+
+ return;
+
+ err2:
+ obj1.free();
+ err1:
+ error(getPos(), "Bad image parameters");
+}
+
+void Gfx::doForm(Object *str) {
+ Dict *dict;
+ Object matrixObj, bboxObj;
+ double m[6], bbox[6];
+ Object resObj;
+ Dict *resDict;
+ Object obj1;
+ int i;
+
+ // get stream dict
+ dict = str->streamGetDict();
+
+ // check form type
+ dict->lookup("FormType", &obj1);
+ if (!(obj1.isInt() && obj1.getInt() == 1)) {
+ error(getPos(), "Unknown form type");
+ }
+ obj1.free();
+
+ // get bounding box
+ dict->lookup("BBox", &bboxObj);
+ if (!bboxObj.isArray()) {
+ matrixObj.free();
+ bboxObj.free();
+ error(getPos(), "Bad form bounding box");
+ return;
+ }
+ for (i = 0; i < 4; ++i) {
+ bboxObj.arrayGet(i, &obj1);
+ bbox[i] = obj1.getNum();
+ obj1.free();
+ }
+ bboxObj.free();
+
+ // get matrix
+ dict->lookup("Matrix", &matrixObj);
+ if (matrixObj.isArray()) {
+ for (i = 0; i < 6; ++i) {
+ matrixObj.arrayGet(i, &obj1);
+ m[i] = obj1.getNum();
+ obj1.free();
+ }
+ } else {
+ m[0] = 1; m[1] = 0;
+ m[2] = 0; m[3] = 1;
+ m[4] = 0; m[5] = 0;
+ }
+ matrixObj.free();
+
+ // get resources
+ dict->lookup("Resources", &resObj);
+ resDict = resObj.isDict() ? resObj.getDict() : NULL;
+
+ // draw it
+ doForm1(str, resDict, m, bbox);
+
+ resObj.free();
+}
+
+void Gfx::doWidgetForm(Object *str, double xMin, double yMin,
+ double xMax, double yMax) {
+ Dict *dict, *resDict;
+ Object matrixObj, bboxObj, resObj;
+ Object obj1;
+ double m[6], bbox[6];
+ double sx, sy;
+ int i;
+
+ // get stream dict
+ dict = str->streamGetDict();
+
+ // get bounding box
+ dict->lookup("BBox", &bboxObj);
+ if (!bboxObj.isArray()) {
+ bboxObj.free();
+ error(getPos(), "Bad form bounding box");
+ return;
+ }
+ for (i = 0; i < 4; ++i) {
+ bboxObj.arrayGet(i, &obj1);
+ bbox[i] = obj1.getNum();
+ obj1.free();
+ }
+ bboxObj.free();
+
+ // get matrix
+ dict->lookup("Matrix", &matrixObj);
+ if (matrixObj.isArray()) {
+ for (i = 0; i < 6; ++i) {
+ matrixObj.arrayGet(i, &obj1);
+ m[i] = obj1.getNum();
+ obj1.free();
+ }
+ } else {
+ m[0] = 1; m[1] = 0;
+ m[2] = 0; m[3] = 1;
+ m[4] = 0; m[5] = 0;
+ }
+ matrixObj.free();
+
+ // scale form bbox to widget rectangle
+ sx = fabs((xMax - xMin) / (bbox[2] - bbox[0]));
+ sy = fabs((yMax - yMin) / (bbox[3] - bbox[1]));
+ m[0] *= sx; m[1] *= sy;
+ m[2] *= sx; m[3] *= sy;
+ m[4] *= sx; m[5] *= sy;
+
+ // translate to widget rectangle
+ m[4] += xMin;
+ m[5] += yMin;
+
+ // get resources
+ dict->lookup("Resources", &resObj);
+ resDict = resObj.isDict() ? resObj.getDict() : NULL;
+
+ // draw it
+ doForm1(str, resDict, m, bbox);
+
+ resObj.free();
+ bboxObj.free();
+}
+
+void Gfx::doForm1(Object *str, Dict *resDict, double *matrix, double *bbox) {
+ Parser *oldParser;
+ double oldBaseMatrix[6];
+ GfxResources *resPtr;
+ int i;
+
+ // push new resources on stack
+ res = new GfxResources(resDict, res);
+
+ // save current graphics state
+ out->saveState(state);
+ state = state->save();
+
+ // save current parser
+ oldParser = parser;
+
+ // set form transformation matrix
+ state->concatCTM(matrix[0], matrix[1], matrix[2],
+ matrix[3], matrix[4], matrix[5]);
+ out->updateCTM(state, matrix[0], matrix[1], matrix[2],
+ matrix[3], matrix[4], matrix[5]);
+
+ // set new base matrix
+ for (i = 0; i < 6; ++i) {
+ oldBaseMatrix[i] = baseMatrix[i];
+ baseMatrix[i] = state->getCTM()[i];
+ }
+
+ // set form bounding box
+ state->moveTo(bbox[0], bbox[1]);
+ state->lineTo(bbox[2], bbox[1]);
+ state->lineTo(bbox[2], bbox[3]);
+ state->lineTo(bbox[0], bbox[3]);
+ state->closePath();
+ out->clip(state);
+ state->clearPath();
+
+ // draw the form
+ display(str, gFalse);
+
+ // restore base matrix
+ for (i = 0; i < 6; ++i) {
+ baseMatrix[i] = oldBaseMatrix[i];
+ }
+
+ // restore parser
+ parser = oldParser;
+
+ // restore graphics state
+ state = state->restore();
+ out->restoreState(state);
+
+ // pop resource stack
+ resPtr = res->getNext();
+ delete res;
+ res = resPtr;
+
+ return;
+}
+
+//------------------------------------------------------------------------
+// in-line image operators
+//------------------------------------------------------------------------
+
+void Gfx::opBeginImage(Object args[], int numArgs) {
+ Stream *str;
+ int c1, c2;
+
+ // build dict/stream
+ str = buildImageStream();
+
+ // display the image
+ if (str) {
+ doImage(NULL, str, gTrue);
+
+ // skip 'EI' tag
+ c1 = str->getBaseStream()->getChar();
+ c2 = str->getBaseStream()->getChar();
+ while (!(c1 == 'E' && c2 == 'I') && c2 != EOF) {
+ c1 = c2;
+ c2 = str->getBaseStream()->getChar();
+ }
+ delete str;
+ }
+}
+
+Stream *Gfx::buildImageStream() {
+ Object dict;
+ Object obj;
+ char *key;
+ Stream *str;
+
+ // build dictionary
+ dict.initDict();
+ parser->getObj(&obj);
+ while (!obj.isCmd("ID") && !obj.isEOF()) {
+ if (!obj.isName()) {
+ error(getPos(), "Inline image dictionary key must be a name object");
+ obj.free();
+ parser->getObj(&obj);
+ } else {
+ key = copyString(obj.getName());
+ obj.free();
+ parser->getObj(&obj);
+ if (obj.isEOF() || obj.isError())
+ break;
+ dict.dictAdd(key, &obj);
+ }
+ parser->getObj(&obj);
+ }
+ if (obj.isEOF())
+ error(getPos(), "End of file in inline image");
+ obj.free();
+
+ // make stream
+ str = new EmbedStream(parser->getStream(), &dict);
+ str = str->addFilters(&dict);
+
+ return str;
+}
+
+void Gfx::opImageData(Object args[], int numArgs) {
+ error(getPos(), "Internal: got 'ID' operator");
+}
+
+void Gfx::opEndImage(Object args[], int numArgs) {
+ error(getPos(), "Internal: got 'EI' operator");
+}
+
+//------------------------------------------------------------------------
+// type 3 font operators
+//------------------------------------------------------------------------
+
+void Gfx::opSetCharWidth(Object args[], int numArgs) {
+ error(getPos(), "Encountered 'd0' operator in content stream");
+}
+
+void Gfx::opSetCacheDevice(Object args[], int numArgs) {
+ error(getPos(), "Encountered 'd1' operator in content stream");
+}
+
+//------------------------------------------------------------------------
+// compatibility operators
+//------------------------------------------------------------------------
+
+void Gfx::opBeginIgnoreUndef(Object args[], int numArgs) {
+ ++ignoreUndef;
+}
+
+void Gfx::opEndIgnoreUndef(Object args[], int numArgs) {
+ if (ignoreUndef > 0)
+ --ignoreUndef;
+}
+
+//------------------------------------------------------------------------
+// marked content operators
+//------------------------------------------------------------------------
+
+void Gfx::opBeginMarkedContent(Object args[], int numArgs) {
+ if (printCommands) {
+ printf(" marked content: %s ", args[0].getName());
+ if (numArgs == 2)
+ args[2].print(stdout);
+ printf("\n");
+ }
+}
+
+void Gfx::opEndMarkedContent(Object args[], int numArgs) {
+}
+
+void Gfx::opMarkPoint(Object args[], int numArgs) {
+ if (printCommands) {
+ printf(" mark point: %s ", args[0].getName());
+ if (numArgs == 2)
+ args[2].print(stdout);
+ printf("\n");
+ }
+}
diff --git a/pdf2swf/xpdf/Gfx.h b/pdf2swf/xpdf/Gfx.h
new file mode 100644
index 00000000..34d8f992
--- /dev/null
+++ b/pdf2swf/xpdf/Gfx.h
@@ -0,0 +1,234 @@
+//========================================================================
+//
+// Gfx.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef GFX_H
+#define GFX_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "gtypes.h"
+
+class GString;
+class Array;
+class Stream;
+class Parser;
+class Dict;
+class OutputDev;
+class GfxFontDict;
+class GfxFont;
+struct GfxFontEncoding16;
+class GfxPattern;
+class GfxState;
+class Gfx;
+
+//------------------------------------------------------------------------
+// Gfx
+//------------------------------------------------------------------------
+
+enum GfxClipType {
+ clipNone,
+ clipNormal,
+ clipEO
+};
+
+enum TchkType {
+ tchkBool, // boolean
+ tchkInt, // integer
+ tchkNum, // number (integer or real)
+ tchkString, // string
+ tchkName, // name
+ tchkArray, // array
+ tchkProps, // properties (dictionary or name)
+ tchkSCN, // scn/SCN args (number of name)
+ tchkNone // used to avoid empty initializer lists
+};
+
+#define maxArgs 8
+
+struct Operator {
+ char name[4];
+ int numArgs;
+ TchkType tchk[maxArgs];
+ void (Gfx::*func)(Object args[], int numArgs);
+};
+
+class GfxResources {
+public:
+
+ GfxResources(Dict *resDict, GfxResources *next);
+ ~GfxResources();
+
+ GfxFont *lookupFont(char *name);
+ GBool lookupXObject(char *name, Object *obj);
+ GBool lookupXObjectNF(char *name, Object *obj);
+ void lookupColorSpace(char *name, Object *obj);
+ GfxPattern *lookupPattern(char *name);
+ GBool lookupGState(char *name, Object *obj);
+
+ GfxResources *getNext() { return next; }
+
+private:
+
+ GfxFontDict *fonts;
+ Object xObjDict;
+ Object colorSpaceDict;
+ Object patternDict;
+ Object gStateDict;
+ GfxResources *next;
+};
+
+class Gfx {
+public:
+
+ // Constructor for regular output.
+ Gfx(OutputDev *out1, int pageNum, Dict *resDict,
+ double dpi, double x1, double y1, double x2, double y2, GBool crop,
+ double cropX1, double cropY1, double cropX2, double cropY2,
+ int rotate);
+
+ // Destructor.
+ ~Gfx();
+
+ // Interpret a stream or array of streams.
+ void display(Object *obj, GBool topLevel = gTrue);
+
+ void doWidgetForm(Object *str, double xMin, double yMin,
+ double xMax, double yMax);
+
+private:
+
+ OutputDev *out; // output device
+ GfxResources *res; // resource stack
+
+ GfxState *state; // current graphics state
+ GBool fontChanged; // set if font or text matrix has changed
+ GfxClipType clip; // do a clip?
+ int ignoreUndef; // current BX/EX nesting level
+ double baseMatrix[6]; // default matrix for most recent
+ // page/form/pattern
+
+ Parser *parser; // parser for page content stream(s)
+
+ static Operator opTab[]; // table of operators
+
+ void go(GBool topLevel);
+ void execOp(Object *cmd, Object args[], int numArgs);
+ Operator *findOp(char *name);
+ GBool checkArg(Object *arg, TchkType type);
+ int getPos();
+
+ // graphics state operators
+ void opSave(Object args[], int numArgs);
+ void opRestore(Object args[], int numArgs);
+ void opConcat(Object args[], int numArgs);
+ void opSetDash(Object args[], int numArgs);
+ void opSetFlat(Object args[], int numArgs);
+ void opSetLineJoin(Object args[], int numArgs);
+ void opSetLineCap(Object args[], int numArgs);
+ void opSetMiterLimit(Object args[], int numArgs);
+ void opSetLineWidth(Object args[], int numArgs);
+ void opSetExtGState(Object args[], int numArgs);
+ void opSetRenderingIntent(Object args[], int numArgs);
+
+ // color operators
+ void opSetFillGray(Object args[], int numArgs);
+ void opSetStrokeGray(Object args[], int numArgs);
+ void opSetFillCMYKColor(Object args[], int numArgs);
+ void opSetStrokeCMYKColor(Object args[], int numArgs);
+ void opSetFillRGBColor(Object args[], int numArgs);
+ void opSetStrokeRGBColor(Object args[], int numArgs);
+ void opSetFillColorSpace(Object args[], int numArgs);
+ void opSetStrokeColorSpace(Object args[], int numArgs);
+ void opSetFillColor(Object args[], int numArgs);
+ void opSetStrokeColor(Object args[], int numArgs);
+ void opSetFillColorN(Object args[], int numArgs);
+ void opSetStrokeColorN(Object args[], int numArgs);
+
+ // path segment operators
+ void opMoveTo(Object args[], int numArgs);
+ void opLineTo(Object args[], int numArgs);
+ void opCurveTo(Object args[], int numArgs);
+ void opCurveTo1(Object args[], int numArgs);
+ void opCurveTo2(Object args[], int numArgs);
+ void opRectangle(Object args[], int numArgs);
+ void opClosePath(Object args[], int numArgs);
+
+ // path painting operators
+ void opEndPath(Object args[], int numArgs);
+ void opStroke(Object args[], int numArgs);
+ void opCloseStroke(Object args[], int numArgs);
+ void opFill(Object args[], int numArgs);
+ void opEOFill(Object args[], int numArgs);
+ void opFillStroke(Object args[], int numArgs);
+ void opCloseFillStroke(Object args[], int numArgs);
+ void opEOFillStroke(Object args[], int numArgs);
+ void opCloseEOFillStroke(Object args[], int numArgs);
+ void opShFill(Object args[], int numArgs);
+ void doPatternFill(GBool eoFill);
+ void doEndPath();
+
+ // path clipping operators
+ void opClip(Object args[], int numArgs);
+ void opEOClip(Object args[], int numArgs);
+
+ // text object operators
+ void opBeginText(Object args[], int numArgs);
+ void opEndText(Object args[], int numArgs);
+
+ // text state operators
+ void opSetCharSpacing(Object args[], int numArgs);
+ void opSetFont(Object args[], int numArgs);
+ void opSetTextLeading(Object args[], int numArgs);
+ void opSetTextRender(Object args[], int numArgs);
+ void opSetTextRise(Object args[], int numArgs);
+ void opSetWordSpacing(Object args[], int numArgs);
+ void opSetHorizScaling(Object args[], int numArgs);
+
+ // text positioning operators
+ void opTextMove(Object args[], int numArgs);
+ void opTextMoveSet(Object args[], int numArgs);
+ void opSetTextMatrix(Object args[], int numArgs);
+ void opTextNextLine(Object args[], int numArgs);
+
+ // text string operators
+ void opShowText(Object args[], int numArgs);
+ void opMoveShowText(Object args[], int numArgs);
+ void opMoveSetShowText(Object args[], int numArgs);
+ void opShowSpaceText(Object args[], int numArgs);
+ void doShowText(GString *s);
+ int getNextChar16(GfxFontEncoding16 *enc, Guchar *p, int *c16);
+
+ // XObject operators
+ void opXObject(Object args[], int numArgs);
+ void doImage(Object *ref, Stream *str, GBool inlineImg);
+ void doForm(Object *str);
+ void doForm1(Object *str, Dict *resDict, double *matrix, double *bbox);
+
+ // in-line image operators
+ void opBeginImage(Object args[], int numArgs);
+ Stream *buildImageStream();
+ void opImageData(Object args[], int numArgs);
+ void opEndImage(Object args[], int numArgs);
+
+ // type 3 font operators
+ void opSetCharWidth(Object args[], int numArgs);
+ void opSetCacheDevice(Object args[], int numArgs);
+
+ // compatibility operators
+ void opBeginIgnoreUndef(Object args[], int numArgs);
+ void opEndIgnoreUndef(Object args[], int numArgs);
+
+ // marked content operators
+ void opBeginMarkedContent(Object args[], int numArgs);
+ void opEndMarkedContent(Object args[], int numArgs);
+ void opMarkPoint(Object args[], int numArgs);
+};
+
+#endif
diff --git a/pdf2swf/xpdf/GfxFont.cc b/pdf2swf/xpdf/GfxFont.cc
new file mode 100644
index 00000000..16b311b3
--- /dev/null
+++ b/pdf2swf/xpdf/GfxFont.cc
@@ -0,0 +1,1018 @@
+//========================================================================
+//
+// GfxFont.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include "GString.h"
+#include "gmem.h"
+#include "gfile.h"
+#include "config.h"
+#include "Object.h"
+#include "Array.h"
+#include "Dict.h"
+#include "Error.h"
+#include "Params.h"
+#include "FontFile.h"
+#include "GfxFont.h"
+
+#include "FontInfo.h"
+#if JAPANESE_SUPPORT
+#include "Japan12CMapInfo.h"
+#endif
+#if CHINESE_GB_SUPPORT
+#include "GB12CMapInfo.h"
+#endif
+#if CHINESE_CNS_SUPPORT
+#include "CNS13CMapInfo.h"
+#endif
+
+//------------------------------------------------------------------------
+
+static int CDECL cmpWidthExcep(const void *w1, const void *w2);
+static int CDECL cmpWidthExcepV(const void *w1, const void *w2);
+
+//------------------------------------------------------------------------
+
+static Gushort *defCharWidths[12] = {
+ courierWidths,
+ courierObliqueWidths,
+ courierBoldWidths,
+ courierBoldObliqueWidths,
+ helveticaWidths,
+ helveticaObliqueWidths,
+ helveticaBoldWidths,
+ helveticaBoldObliqueWidths,
+ timesRomanWidths,
+ timesItalicWidths,
+ timesBoldWidths,
+ timesBoldItalicWidths
+};
+
+//------------------------------------------------------------------------
+// GfxFont
+//------------------------------------------------------------------------
+
+GfxFont::GfxFont(char *tag1, Ref id1, Dict *fontDict) {
+ BuiltinFont *builtinFont;
+ Object obj1, obj2, obj3, obj4;
+ int missingWidth;
+ char *name2, *p;
+ int i;
+
+ // get font tag and ID
+ tag = new GString(tag1);
+ id = id1;
+
+ // get font type
+ type = fontUnknownType;
+ fontDict->lookup("Subtype", &obj1);
+ if (obj1.isName("Type1"))
+ type = fontType1;
+ else if (obj1.isName("Type1C"))
+ type = fontType1C;
+ else if (obj1.isName("Type3"))
+ type = fontType3;
+ else if (obj1.isName("TrueType"))
+ type = fontTrueType;
+ else if (obj1.isName("Type0"))
+ type = fontType0;
+ obj1.free();
+ is16 = gFalse;
+
+ // get base font name
+ name = NULL;
+ fontDict->lookup("BaseFont", &obj1);
+ if (obj1.isName())
+ name = new GString(obj1.getName());
+ obj1.free();
+
+ // Newer Adobe tools are using Base14-compatible TrueType fonts
+ // without embedding them, so munge the names into the equivalent
+ // PostScript names. This is a kludge -- it would be nice if Adobe
+ // followed their own spec.
+ if (type == fontTrueType) {
+ p = name->getCString();
+ name2 = NULL;
+ if (!strncmp(p, "Arial", 5)) {
+ if (!strcmp(p+5, ",Bold")) {
+ name2 = "Helvetica-Bold";
+ } else if (!strcmp(p+5, ",Italic")) {
+ name2 = "Helvetica-Oblique";
+ } else if (!strcmp(p+5, ",BoldItalic")) {
+ name2 = "Helvetica-BoldOblique";
+ } else {
+ name2 = "Helvetica";
+ }
+ } else if (!strncmp(p, "TimesNewRoman", 13)) {
+ if (!strcmp(p+13, ",Bold")) {
+ name2 = "Times-Bold";
+ } else if (!strcmp(p+13, ",Italic")) {
+ name2 = "Times-Italic";
+ } else if (!strcmp(p+13, ",BoldItalic")) {
+ name2 = "Times-BoldItalic";
+ } else {
+ name2 = "Times-Roman";
+ }
+ } else if (!strncmp(p, "CourierNew", 10)) {
+ if (!strcmp(p+10, ",Bold")) {
+ name2 = "Courier-Bold";
+ } else if (!strcmp(p+10, ",Italic")) {
+ name2 = "Courier-Oblique";
+ } else if (!strcmp(p+10, ",BoldItalic")) {
+ name2 = "Courier-BoldOblique";
+ } else {
+ name2 = "Courier";
+ }
+ }
+ if (name2) {
+ delete name;
+ name = new GString(name2);
+ }
+ }
+
+ // is it a built-in font?
+ builtinFont = NULL;
+ if (name) {
+ for (i = 0; i < numBuiltinFonts; ++i) {
+ if (!strcmp(builtinFonts[i].name, name->getCString())) {
+ builtinFont = &builtinFonts[i];
+ break;
+ }
+ }
+ }
+
+ // assume Times-Roman by default (for substitution purposes)
+ flags = fontSerif;
+
+ // get info from font descriptor
+ embFontName = NULL;
+ embFontID.num = -1;
+ embFontID.gen = -1;
+ missingWidth = 0;
+ fontDict->lookup("FontDescriptor", &obj1);
+ if (obj1.isDict()) {
+
+ // get flags
+ obj1.dictLookup("Flags", &obj2);
+ if (obj2.isInt())
+ flags = obj2.getInt();
+ obj2.free();
+
+ // get name
+ obj1.dictLookup("FontName", &obj2);
+ if (obj2.isName())
+ embFontName = new GString(obj2.getName());
+ obj2.free();
+
+ // look for embedded font file
+ if (type == fontType1) {
+ obj1.dictLookupNF("FontFile", &obj2);
+ if (obj2.isRef())
+ embFontID = obj2.getRef();
+ obj2.free();
+ }
+ if (embFontID.num == -1 && type == fontTrueType) {
+ obj1.dictLookupNF("FontFile2", &obj2);
+ if (obj2.isRef())
+ embFontID = obj2.getRef();
+ obj2.free();
+ }
+ if (embFontID.num == -1) {
+ obj1.dictLookupNF("FontFile3", &obj2);
+ if (obj2.isRef()) {
+ embFontID = obj2.getRef();
+ obj2.fetch(&obj3);
+ if (obj3.isStream()) {
+ obj3.streamGetDict()->lookup("Subtype", &obj4);
+ if (obj4.isName("Type1"))
+ type = fontType1;
+ else if (obj4.isName("Type1C"))
+ type = fontType1C;
+ else if (obj4.isName("Type3"))
+ type = fontType3;
+ else if (obj4.isName("TrueType"))
+ type = fontTrueType;
+ else if (obj4.isName("Type0"))
+ type = fontType0;
+ obj4.free();
+ }
+ obj3.free();
+ }
+ obj2.free();
+ }
+
+ // look for MissingWidth
+ obj1.dictLookup("MissingWidth", &obj2);
+ if (obj2.isInt()) {
+ missingWidth = obj2.getInt();
+ }
+ obj2.free();
+ }
+ obj1.free();
+
+ // get Type3 font definition
+ if (type == fontType3) {
+ fontDict->lookup("CharProcs", &charProcs);
+ if (!charProcs.isDict()) {
+ error(-1, "Missing or invalid CharProcs dictionary in Type 3 font");
+ charProcs.free();
+ }
+ }
+
+ // look for an external font file
+ extFontFile = NULL;
+ if (type == fontType1 && name)
+ findExtFontFile();
+
+ // get font matrix
+ fontMat[0] = fontMat[3] = 1;
+ fontMat[1] = fontMat[2] = fontMat[4] = fontMat[5] = 0;
+ if (fontDict->lookup("FontMatrix", &obj1)->isArray()) {
+ for (i = 0; i < 6 && i < obj1.arrayGetLength(); ++i) {
+ if (obj1.arrayGet(i, &obj2)->isNum())
+ fontMat[i] = obj2.getNum();
+ obj2.free();
+ }
+ }
+ obj1.free();
+
+ // get encoding and character widths
+ if (type == fontType0) {
+ getType0EncAndWidths(fontDict);
+ } else {
+ getEncAndWidths(fontDict, builtinFont, missingWidth);
+ }
+}
+
+GfxFont::~GfxFont() {
+ delete tag;
+ if (name) {
+ delete name;
+ }
+ if (!is16 && encoding) {
+ delete encoding;
+ }
+ if (embFontName) {
+ delete embFontName;
+ }
+ if (extFontFile) {
+ delete extFontFile;
+ }
+ if (charProcs.isDict()) {
+ charProcs.free();
+ }
+ if (is16) {
+ gfree(widths16.exceps);
+ gfree(widths16.excepsV);
+ }
+}
+
+double GfxFont::getWidth(GString *s) {
+ double w;
+ int i;
+
+ w = 0;
+ for (i = 0; i < s->getLength(); ++i)
+ w += widths[s->getChar(i) & 0xff];
+ return w;
+}
+
+double GfxFont::getWidth16(int c) {
+ double w;
+ int a, b, m;
+
+ w = widths16.defWidth;
+ a = -1;
+ b = widths16.numExceps;
+ // invariant: widths16.exceps[a].last < c < widths16.exceps[b].first
+ while (b - a > 1) {
+ m = (a + b) / 2;
+ if (widths16.exceps[m].last < c) {
+ a = m;
+ } else if (c < widths16.exceps[m].first) {
+ b = m;
+ } else {
+ w = widths16.exceps[m].width;
+ break;
+ }
+ }
+ return w;
+}
+
+double GfxFont::getHeight16(int c) {
+ double h;
+ int a, b, m;
+
+ h = widths16.defHeight;
+ a = -1;
+ b = widths16.numExcepsV;
+ // invariant: widths16.excepsV[a].last < c < widths16.excepsV[b].first
+ while (b - a > 1) {
+ m = (a + b) / 2;
+ if (widths16.excepsV[m].last < c) {
+ a = m;
+ } else if (c < widths16.excepsV[m].first) {
+ b = m;
+ } else {
+ h = widths16.excepsV[m].height;
+ break;
+ }
+ }
+ return h;
+}
+
+double GfxFont::getOriginX16(int c) {
+ double vx;
+ int a, b, m;
+
+ vx = widths16.defWidth / 2;
+ a = -1;
+ b = widths16.numExcepsV;
+ // invariant: widths16.excepsV[a].last < c < widths16.excepsV[b].first
+ while (b - a > 1) {
+ m = (a + b) / 2;
+ if (widths16.excepsV[m].last < c) {
+ a = m;
+ } else if (c < widths16.excepsV[m].first) {
+ b = m;
+ } else {
+ vx = widths16.excepsV[m].vx;
+ break;
+ }
+ }
+ return vx;
+}
+
+double GfxFont::getOriginY16(int c) {
+ double vy;
+ int a, b, m;
+
+ vy = widths16.defVY;
+ a = -1;
+ b = widths16.numExcepsV;
+ // invariant: widths16.excepsV[a].last < c < widths16.excepsV[b].first
+ while (b - a > 1) {
+ m = (a + b) / 2;
+ if (widths16.excepsV[m].last < c) {
+ a = m;
+ } else if (c < widths16.excepsV[m].first) {
+ b = m;
+ } else {
+ vy = widths16.excepsV[m].vy;
+ break;
+ }
+ }
+ return vy;
+}
+
+Object *GfxFont::getCharProc(int code, Object *proc) {
+ if (charProcs.isDict()) {
+ charProcs.dictLookup(encoding->getCharName(code), proc);
+ } else {
+ proc->initNull();
+ }
+ return proc;
+}
+
+void GfxFont::getEncAndWidths(Dict *fontDict, BuiltinFont *builtinFont,
+ int missingWidth) {
+ Object obj1, obj2, obj3;
+ char *buf;
+ int len;
+ FontFile *fontFile;
+ int code, i;
+
+ // Encodings start with a base encoding, which can come from
+ // (in order of priority):
+ // 1. FontDict.Encoding or FontDict.Encoding.BaseEncoding
+ // - MacRoman / WinAnsi / Standard
+ // 2. embedded font file
+ // 3. default:
+ // - builtin --> builtin encoding
+ // - TrueType --> MacRomanEncoding
+ // - others --> StandardEncoding
+ // and then add a list of differences from
+ // FontDict.Encoding.Differences.
+
+ // check FontDict for base encoding
+ encoding = NULL;
+ fontDict->lookup("Encoding", &obj1);
+ if (obj1.isDict()) {
+ obj1.dictLookup("BaseEncoding", &obj2);
+ if (obj2.isName("MacRomanEncoding")) {
+ encoding = macRomanEncoding.copy();
+ } else if (obj2.isName("WinAnsiEncoding")) {
+ encoding = winAnsiEncoding.copy();
+ } else if (obj2.isName("StandardEncoding")) {
+ encoding = standardEncoding.copy();
+ }
+ obj2.free();
+ } else if (obj1.isName("MacRomanEncoding")) {
+ encoding = macRomanEncoding.copy();
+ } else if (obj1.isName("WinAnsiEncoding")) {
+ encoding = winAnsiEncoding.copy();
+ } else if (obj1.isName("StandardEncoding")) {
+ encoding = standardEncoding.copy();
+ }
+ obj1.free();
+
+ // check embedded or external font file for base encoding
+ if ((type == fontType1 || type == fontType1C) &&
+ (extFontFile || embFontID.num >= 0)) {
+ if (extFontFile)
+ buf = readExtFontFile(&len);
+ else
+ buf = readEmbFontFile(&len);
+ if (buf) {
+ if (type == fontType1)
+ fontFile = new Type1FontFile(buf, len);
+ else
+ fontFile = new Type1CFontFile(buf, len);
+ if (fontFile->getName()) {
+ if (embFontName)
+ delete embFontName;
+ embFontName = new GString(fontFile->getName());
+ }
+ if (!encoding)
+ encoding = fontFile->getEncoding(gTrue);
+ delete fontFile;
+ gfree(buf);
+ }
+ }
+
+ // get default base encoding
+ if (!encoding) {
+ if (builtinFont)
+ encoding = builtinFont->encoding->copy();
+ else if (type == fontTrueType)
+ encoding = macRomanEncoding.copy();
+ else
+ encoding = standardEncoding.copy();
+ }
+
+ // merge differences into encoding
+ fontDict->lookup("Encoding", &obj1);
+ if (obj1.isDict()) {
+ obj1.dictLookup("Differences", &obj2);
+ if (obj2.isArray()) {
+ code = 0;
+ for (i = 0; i < obj2.arrayGetLength(); ++i) {
+ obj2.arrayGet(i, &obj3);
+ if (obj3.isInt()) {
+ code = obj3.getInt();
+ } else if (obj3.isName()) {
+ if (code < 256)
+ encoding->addChar(code, copyString(obj3.getName()));
+ ++code;
+ } else {
+ error(-1, "Wrong type in font encoding resource differences (%s)",
+ obj3.getTypeName());
+ }
+ obj3.free();
+ }
+ }
+ obj2.free();
+ }
+ obj1.free();
+
+ // get character widths
+ if (builtinFont)
+ makeWidths(fontDict, builtinFont->encoding, builtinFont->widths,
+ missingWidth);
+ else
+ makeWidths(fontDict, NULL, NULL, missingWidth);
+}
+
+void GfxFont::findExtFontFile() {
+ char **path;
+ FILE *f;
+
+ for (path = fontPath; *path; ++path) {
+ extFontFile = appendToPath(new GString(*path), name->getCString());
+ f = fopen(extFontFile->getCString(), "rb");
+ if (!f) {
+ extFontFile->append(".pfb");
+ f = fopen(extFontFile->getCString(), "rb");
+ }
+ if (!f) {
+ extFontFile->del(extFontFile->getLength() - 4, 4);
+ extFontFile->append(".pfa");
+ f = fopen(extFontFile->getCString(), "rb");
+ }
+ if (f) {
+ fclose(f);
+ break;
+ }
+ delete extFontFile;
+ extFontFile = NULL;
+ }
+}
+
+char *GfxFont::readExtFontFile(int *len) {
+ FILE *f;
+ char *buf;
+
+ if (!(f = fopen(extFontFile->getCString(), "rb"))) {
+ error(-1, "Internal: external font file '%s' vanished", extFontFile);
+ return NULL;
+ }
+ fseek(f, 0, SEEK_END);
+ *len = (int)ftell(f);
+ fseek(f, 0, SEEK_SET);
+ buf = (char *)gmalloc(*len);
+ if ((int)fread(buf, 1, *len, f) != *len)
+ error(-1, "Error reading external font file '%s'", extFontFile);
+ fclose(f);
+ return buf;
+}
+
+char *GfxFont::readEmbFontFile(int *len) {
+ char *buf;
+ Object obj1, obj2;
+ Stream *str;
+ int c;
+ int size, i;
+
+ obj1.initRef(embFontID.num, embFontID.gen);
+ obj1.fetch(&obj2);
+ if (!obj2.isStream()) {
+ error(-1, "Embedded font file is not a stream");
+ obj2.free();
+ obj1.free();
+ embFontID.num = -1;
+ return NULL;
+ }
+ str = obj2.getStream();
+
+ buf = NULL;
+ i = size = 0;
+ str->reset();
+ while ((c = str->getChar()) != EOF) {
+ if (i == size) {
+ size += 4096;
+ buf = (char *)grealloc(buf, size);
+ }
+ buf[i++] = c;
+ }
+ *len = i;
+ str->close();
+
+ obj2.free();
+ obj1.free();
+
+ return buf;
+}
+
+void GfxFont::makeWidths(Dict *fontDict, FontEncoding *builtinEncoding,
+ Gushort *builtinWidths, int missingWidth) {
+ Object obj1, obj2;
+ int firstChar, lastChar;
+ int code, code2;
+ char *charName;
+ Gushort *defWidths;
+ int index;
+ double mult;
+
+ // initialize all widths
+ for (code = 0; code < 256; ++code) {
+ widths[code] = missingWidth * 0.001;
+ }
+
+ // use widths from built-in font
+ if (builtinEncoding) {
+ code2 = 0; // to make gcc happy
+ for (code = 0; code < 256; ++code) {
+ if ((charName = encoding->getCharName(code)) &&
+ (code2 = builtinEncoding->getCharCode(charName)) >= 0)
+ widths[code] = builtinWidths[code2] * 0.001;
+ }
+
+ // get widths from font dict
+ } else {
+ fontDict->lookup("FirstChar", &obj1);
+ firstChar = obj1.isInt() ? obj1.getInt() : 0;
+ obj1.free();
+ fontDict->lookup("LastChar", &obj1);
+ lastChar = obj1.isInt() ? obj1.getInt() : 255;
+ obj1.free();
+ if (type == fontType3)
+ mult = fontMat[0];
+ else
+ mult = 0.001;
+ fontDict->lookup("Widths", &obj1);
+ if (obj1.isArray()) {
+ for (code = firstChar; code <= lastChar; ++code) {
+ obj1.arrayGet(code - firstChar, &obj2);
+ if (obj2.isNum())
+ widths[code] = obj2.getNum() * mult;
+ obj2.free();
+ }
+ } else {
+
+ // couldn't find widths -- use defaults
+#if 0 //~
+ //~ certain PDF generators apparently don't include widths
+ //~ for Arial and TimesNewRoman -- and this error message
+ //~ is a nuisance
+ error(-1, "No character widths resource for non-builtin font");
+#endif
+ if (isFixedWidth())
+ index = 0;
+ else if (isSerif())
+ index = 8;
+ else
+ index = 4;
+ if (isBold())
+ index += 2;
+ if (isItalic())
+ index += 1;
+ defWidths = defCharWidths[index];
+ code2 = 0; // to make gcc happy
+ for (code = 0; code < 256; ++code) {
+ if ((charName = encoding->getCharName(code)) &&
+ (code2 = standardEncoding.getCharCode(charName)) >= 0)
+ widths[code] = defWidths[code2] * 0.001;
+ }
+ }
+ obj1.free();
+ }
+}
+
+void GfxFont::getType0EncAndWidths(Dict *fontDict) {
+ Object obj1, obj2, obj3, obj4, obj5, obj6, obj7, obj8;
+ int excepsSize;
+ int i, j, k, n;
+
+ widths16.exceps = NULL;
+ widths16.excepsV = NULL;
+
+ // get the CIDFont
+ fontDict->lookup("DescendantFonts", &obj1);
+ if (!obj1.isArray() || obj1.arrayGetLength() != 1) {
+ error(-1, "Bad DescendantFonts entry for Type 0 font");
+ goto err1;
+ }
+ obj1.arrayGet(0, &obj2);
+ if (!obj2.isDict()) {
+ error(-1, "Bad descendant font of Type 0 font");
+ goto err2;
+ }
+
+ // get font info
+ obj2.dictLookup("CIDSystemInfo", &obj3);
+ if (!obj3.isDict()) {
+ error(-1, "Bad CIDSystemInfo in Type 0 font descendant");
+ goto err3;
+ }
+ obj3.dictLookup("Registry", &obj4);
+ obj3.dictLookup("Ordering", &obj5);
+ if (obj4.isString() && obj5.isString()) {
+ if (obj4.getString()->cmp("Adobe") == 0 &&
+ obj5.getString()->cmp("Japan1") == 0) {
+#if JAPANESE_SUPPORT
+ is16 = gTrue;
+ enc16.charSet = font16AdobeJapan12;
+#else
+ error(-1, "Xpdf was compiled without Japanese font support");
+ goto err4;
+#endif
+ } else if (obj4.getString()->cmp("Adobe") == 0 &&
+ obj5.getString()->cmp("GB1") == 0) {
+#if CHINESE_GB_SUPPORT
+ is16 = gTrue;
+ enc16.charSet = font16AdobeGB12;
+#else
+ error(-1, "Xpdf was compiled without Chinese GB font support");
+ goto err4;
+#endif
+ } else if (obj4.getString()->cmp("Adobe") == 0 &&
+ obj5.getString()->cmp("CNS1") == 0) {
+#if CHINESE_CNS_SUPPORT
+ is16 = gTrue;
+ enc16.charSet = font16AdobeCNS13;
+#else
+ error(-1, "Xpdf was compiled without Chinese CNS font support");
+ goto err4;
+#endif
+ } else {
+ error(-1, "Uknown Type 0 character set: %s-%s",
+ obj4.getString()->getCString(), obj5.getString()->getCString());
+ goto err4;
+ }
+ } else {
+ error(-1, "Unknown Type 0 character set");
+ goto err4;
+ }
+ obj5.free();
+ obj4.free();
+ obj3.free();
+
+ // get default char width
+ obj2.dictLookup("DW", &obj3);
+ if (obj3.isInt())
+ widths16.defWidth = obj3.getInt() * 0.001;
+ else
+ widths16.defWidth = 1.0;
+ obj3.free();
+
+ // get default char metrics for vertical font
+ obj2.dictLookup("DW2", &obj3);
+ widths16.defVY = 0.880;
+ widths16.defHeight = -1;
+ if (obj3.isArray() && obj3.arrayGetLength() == 2) {
+ obj3.arrayGet(0, &obj4);
+ if (obj4.isInt()) {
+ widths16.defVY = obj4.getInt() * 0.001;
+ }
+ obj4.free();
+ obj3.arrayGet(1, &obj4);
+ if (obj4.isInt()) {
+ widths16.defHeight = obj4.getInt() * 0.001;
+ }
+ obj4.free();
+ }
+ obj3.free();
+
+ // get char width exceptions
+ widths16.exceps = NULL;
+ widths16.numExceps = 0;
+ obj2.dictLookup("W", &obj3);
+ if (obj3.isArray()) {
+ excepsSize = 0;
+ k = 0;
+ i = 0;
+ while (i+1 < obj3.arrayGetLength()) {
+ obj3.arrayGet(i, &obj4);
+ obj3.arrayGet(i+1, &obj5);
+ if (obj4.isInt() && obj5.isInt()) {
+ obj3.arrayGet(i+2, &obj6);
+ if (!obj6.isNum()) {
+ error(-1, "Bad widths array in Type 0 font");
+ obj6.free();
+ obj5.free();
+ obj4.free();
+ break;
+ }
+ if (k == excepsSize) {
+ excepsSize += 16;
+ widths16.exceps = (GfxFontWidthExcep *)
+ grealloc(widths16.exceps,
+ excepsSize * sizeof(GfxFontWidthExcep));
+ }
+ widths16.exceps[k].first = obj4.getInt();
+ widths16.exceps[k].last = obj5.getInt();
+ widths16.exceps[k].width = obj6.getNum() * 0.001;
+ obj6.free();
+ ++k;
+ i += 3;
+ } else if (obj4.isInt() && obj5.isArray()) {
+ if (k + obj5.arrayGetLength() >= excepsSize) {
+ excepsSize = (k + obj5.arrayGetLength() + 15) & ~15;
+ widths16.exceps = (GfxFontWidthExcep *)
+ grealloc(widths16.exceps,
+ excepsSize * sizeof(GfxFontWidthExcep));
+ }
+ n = obj4.getInt();
+ for (j = 0; j < obj5.arrayGetLength(); ++j) {
+ obj5.arrayGet(j, &obj6);
+ if (!obj6.isNum()) {
+ error(-1, "Bad widths array in Type 0 font");
+ obj6.free();
+ break;
+ }
+ widths16.exceps[k].first = widths16.exceps[k].last = n++;
+ widths16.exceps[k].width = obj6.getNum() * 0.001;
+ obj6.free();
+ ++k;
+ }
+ i += 2;
+ } else {
+ error(-1, "Bad widths array in Type 0 font");
+ obj6.free();
+ obj5.free();
+ obj4.free();
+ break;
+ }
+ obj5.free();
+ obj4.free();
+ }
+ widths16.numExceps = k;
+ if (k > 0)
+ qsort(widths16.exceps, k, sizeof(GfxFontWidthExcep), &cmpWidthExcep);
+ }
+ obj3.free();
+
+ // get char metric exceptions for vertical font
+ widths16.excepsV = NULL;
+ widths16.numExcepsV = 0;
+ obj2.dictLookup("W2", &obj3);
+ if (obj3.isArray()) {
+ excepsSize = 0;
+ k = 0;
+ i = 0;
+ while (i+1 < obj3.arrayGetLength()) {
+ obj3.arrayGet(i, &obj4);
+ obj3.arrayGet(i+1, &obj5);
+ if (obj4.isInt() && obj5.isInt()) {
+ obj3.arrayGet(i+2, &obj6);
+ obj3.arrayGet(i+3, &obj7);
+ obj3.arrayGet(i+4, &obj8);
+ if (!obj6.isNum() || !obj7.isNum() || !obj8.isNum()) {
+ error(-1, "Bad widths (W2) array in Type 0 font");
+ obj8.free();
+ obj7.free();
+ obj6.free();
+ obj5.free();
+ obj4.free();
+ break;
+ }
+ if (k == excepsSize) {
+ excepsSize += 16;
+ widths16.excepsV = (GfxFontWidthExcepV *)
+ grealloc(widths16.excepsV,
+ excepsSize * sizeof(GfxFontWidthExcepV));
+ }
+ widths16.excepsV[k].first = obj4.getInt();
+ widths16.excepsV[k].last = obj5.getInt();
+ widths16.excepsV[k].height = obj6.getNum() * 0.001;
+ widths16.excepsV[k].vx = obj7.getNum() * 0.001;
+ widths16.excepsV[k].vy = obj8.getNum() * 0.001;
+ obj8.free();
+ obj7.free();
+ obj6.free();
+ ++k;
+ i += 5;
+ } else if (obj4.isInt() && obj5.isArray()) {
+ if (k + obj5.arrayGetLength() / 3 >= excepsSize) {
+ excepsSize = (k + obj5.arrayGetLength() / 3 + 15) & ~15;
+ widths16.excepsV = (GfxFontWidthExcepV *)
+ grealloc(widths16.excepsV,
+ excepsSize * sizeof(GfxFontWidthExcepV));
+ }
+ n = obj4.getInt();
+ for (j = 0; j < obj5.arrayGetLength(); j += 3) {
+ obj5.arrayGet(j, &obj6);
+ obj5.arrayGet(j+1, &obj7);
+ obj5.arrayGet(j+1, &obj8);
+ if (!obj6.isNum() || !obj7.isNum() || !obj8.isNum()) {
+ error(-1, "Bad widths (W2) array in Type 0 font");
+ obj6.free();
+ break;
+ }
+ widths16.excepsV[k].first = widths16.exceps[k].last = n++;
+ widths16.excepsV[k].height = obj6.getNum() * 0.001;
+ widths16.excepsV[k].vx = obj7.getNum() * 0.001;
+ widths16.excepsV[k].vy = obj8.getNum() * 0.001;
+ obj8.free();
+ obj7.free();
+ obj6.free();
+ ++k;
+ }
+ i += 2;
+ } else {
+ error(-1, "Bad widths array in Type 0 font");
+ obj5.free();
+ obj4.free();
+ break;
+ }
+ obj5.free();
+ obj4.free();
+ }
+ widths16.numExcepsV = k;
+ if (k > 0) {
+ qsort(widths16.excepsV, k, sizeof(GfxFontWidthExcepV), &cmpWidthExcepV);
+ }
+ }
+ obj3.free();
+
+ obj2.free();
+ obj1.free();
+
+ // get encoding (CMap)
+ fontDict->lookup("Encoding", &obj1);
+ if (!obj1.isName()) {
+ error(-1, "Bad encoding for Type 0 font");
+ goto err1;
+ }
+#if JAPANESE_SUPPORT
+ if (enc16.charSet == font16AdobeJapan12) {
+ for (i = 0; gfxJapan12Tab[i].name; ++i) {
+ if (!strcmp(obj1.getName(), gfxJapan12Tab[i].name))
+ break;
+ }
+ if (!gfxJapan12Tab[i].name) {
+ error(-1, "Unknown encoding '%s' for Adobe-Japan1-2 font",
+ obj1.getName());
+ goto err1;
+ }
+ enc16.enc = gfxJapan12Tab[i].enc;
+ }
+#endif
+#if CHINESE_GB_SUPPORT
+ if (enc16.charSet == font16AdobeGB12) {
+ for (i = 0; gfxGB12Tab[i].name; ++i) {
+ if (!strcmp(obj1.getName(), gfxGB12Tab[i].name))
+ break;
+ }
+ if (!gfxGB12Tab[i].name) {
+ error(-1, "Unknown encoding '%s' for Adobe-GB1-2 font",
+ obj1.getName());
+ goto err1;
+ }
+ enc16.enc = gfxGB12Tab[i].enc;
+ }
+#endif
+#if CHINESE_CNS_SUPPORT
+ if (enc16.charSet == font16AdobeCNS13) {
+ for (i = 0; gfxCNS13Tab[i].name; ++i) {
+ if (!strcmp(obj1.getName(), gfxCNS13Tab[i].name))
+ break;
+ }
+ if (!gfxCNS13Tab[i].name) {
+ error(-1, "Unknown encoding '%s' for Adobe-CNS1-3 font",
+ obj1.getName());
+ goto err1;
+ }
+ enc16.enc = gfxCNS13Tab[i].enc;
+ }
+#endif
+ obj1.free();
+
+ return;
+
+ err4:
+ obj5.free();
+ obj4.free();
+ err3:
+ obj3.free();
+ err2:
+ obj2.free();
+ err1:
+ obj1.free();
+ //~ fix this --> add 16-bit font support to FontFile
+ encoding = new FontEncoding();
+ makeWidths(fontDict, NULL, NULL, 0);
+}
+
+static int CDECL cmpWidthExcep(const void *w1, const void *w2) {
+ return ((GfxFontWidthExcep *)w1)->first - ((GfxFontWidthExcep *)w2)->first;
+}
+
+static int CDECL cmpWidthExcepV(const void *w1, const void *w2) {
+ return ((GfxFontWidthExcepV *)w1)->first - ((GfxFontWidthExcepV *)w2)->first;
+}
+
+//------------------------------------------------------------------------
+// GfxFontDict
+//------------------------------------------------------------------------
+
+GfxFontDict::GfxFontDict(Dict *fontDict) {
+ int i;
+ Object obj1, obj2;
+
+ numFonts = fontDict->getLength();
+ fonts = (GfxFont **)gmalloc(numFonts * sizeof(GfxFont *));
+ for (i = 0; i < numFonts; ++i) {
+ fontDict->getValNF(i, &obj1);
+ obj1.fetch(&obj2);
+ if (obj1.isRef() && obj2.isDict()) {
+ fonts[i] = new GfxFont(fontDict->getKey(i), obj1.getRef(),
+ obj2.getDict());
+ } else {
+ error(-1, "font resource is not a dictionary");
+ fonts[i] = NULL;
+ }
+ obj1.free();
+ obj2.free();
+ }
+}
+
+GfxFontDict::~GfxFontDict() {
+ int i;
+
+ for (i = 0; i < numFonts; ++i)
+ delete fonts[i];
+ gfree(fonts);
+}
+
+GfxFont *GfxFontDict::lookup(char *tag) {
+ int i;
+
+ for (i = 0; i < numFonts; ++i) {
+ if (fonts[i]->matches(tag))
+ return fonts[i];
+ }
+ return NULL;
+}
diff --git a/pdf2swf/xpdf/GfxFont.h b/pdf2swf/xpdf/GfxFont.h
new file mode 100644
index 00000000..0435d90e
--- /dev/null
+++ b/pdf2swf/xpdf/GfxFont.h
@@ -0,0 +1,240 @@
+//========================================================================
+//
+// GfxFont.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef GFXFONT_H
+#define GFXFONT_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "gtypes.h"
+#include "GString.h"
+#include "Object.h"
+#include "FontEncoding.h"
+
+class Dict;
+struct BuiltinFont;
+
+//------------------------------------------------------------------------
+// GfxFontCharSet16
+//------------------------------------------------------------------------
+
+enum GfxFontCharSet16 {
+ font16AdobeJapan12, // Adobe-Japan1-2
+ font16AdobeGB12, // Adobe-GB1-2 (Chinese)
+ font16AdobeCNS13 // Adobe-CNS1-3 (Chinese)
+};
+
+//------------------------------------------------------------------------
+// GfxFontEncoding16
+//------------------------------------------------------------------------
+
+struct GfxFontEncoding16 {
+ int wMode; // writing mode (0=horizontal, 1=vertical)
+ Guchar codeLen[256]; // length of codes, in bytes, indexed by
+ // first byte of code
+ Gushort map1[256]; // one-byte code mapping:
+ // map1[code] --> 16-bit char selector
+ Gushort *map2; // two-byte code mapping
+ // map2[2*i] --> first code in range
+ // map2[2*i+1] --> 16-bit char selector
+ // for map2[2*i]
+ int map2Len; // length of map2 array (divided by 2)
+};
+
+//------------------------------------------------------------------------
+// GfxFontWidths16
+//------------------------------------------------------------------------
+
+struct GfxFontWidthExcep {
+ int first; // this record applies to
+ int last; // chars <first>..<last>
+ double width; // char width
+};
+
+struct GfxFontWidthExcepV {
+ int first; // this record applies to
+ int last; // chars <first>..<last>
+ double height; // char height
+ double vx, vy; // origin position
+};
+
+struct GfxFontWidths16 {
+ double defWidth; // default char width
+ double defHeight; // default char height
+ double defVY; // default origin position
+ GfxFontWidthExcep *exceps; // exceptions
+ int numExceps; // number of valid entries in exceps
+ GfxFontWidthExcepV *excepsV; // exceptions for vertical font
+ int numExcepsV; // number of valid entries in excepsV
+};
+
+//------------------------------------------------------------------------
+// GfxFont
+//------------------------------------------------------------------------
+
+#define fontFixedWidth (1 << 0)
+#define fontSerif (1 << 1)
+#define fontSymbolic (1 << 2)
+#define fontItalic (1 << 6)
+#define fontBold (1 << 18)
+
+enum GfxFontType {
+ fontUnknownType,
+ fontType1,
+ fontType1C,
+ fontType3,
+ fontTrueType,
+ fontType0
+};
+
+class GfxFont {
+public:
+
+ // Constructor.
+ GfxFont(char *tag1, Ref id1, Dict *fontDict);
+
+ // Destructor.
+ ~GfxFont();
+
+ // Get font tag.
+ GString *getTag() { return tag; }
+
+ // Get font dictionary ID.
+ Ref getID() { return id; }
+
+ // Does this font match the tag?
+ GBool matches(char *tag1) { return !tag->cmp(tag1); }
+
+ // Get base font name.
+ GString *getName() { return name; }
+
+ // Get font type.
+ GfxFontType getType() { return type; }
+
+ // Does this font use 16-bit characters?
+ GBool is16Bit() { return is16; }
+
+ // Get embedded font ID, i.e., a ref for the font file stream.
+ // Returns false if there is no embedded font.
+ GBool getEmbeddedFontID(Ref *embID)
+ { *embID = embFontID; return embFontID.num >= 0; }
+
+ // Get the PostScript font name for the embedded font. Returns
+ // NULL if there is no embedded font.
+ char *getEmbeddedFontName()
+ { return embFontName ? embFontName->getCString() : (char *)NULL; }
+
+ // Get the name of the external font file. Returns NULL if there
+ // is no external font file.
+ GString *getExtFontFile() { return extFontFile; }
+
+ // Get font descriptor flags.
+ GBool isFixedWidth() { return flags & fontFixedWidth; }
+ GBool isSerif() { return flags & fontSerif; }
+ GBool isSymbolic() { return flags & fontSymbolic; }
+ GBool isItalic() { return flags & fontItalic; }
+ GBool isBold() { return flags & fontBold; }
+
+ // Get width of a character or string.
+ double getWidth(Guchar c) { return widths[c]; }
+ double getWidth(GString *s);
+
+ // Get character metrics for 16-bit font.
+ double getWidth16(int c);
+ double getHeight16(int c);
+ double getOriginX16(int c);
+ double getOriginY16(int c);
+
+ // Return the encoding.
+ FontEncoding *getEncoding() { return encoding; }
+
+ // Return the character name associated with <code>.
+ char *getCharName(int code) { return encoding->getCharName(code); }
+
+ // Return the code associated with <name>.
+ int getCharCode(char *charName) { return encoding->getCharCode(charName); }
+
+ // Return the Type 3 CharProc for the character associated with <code>.
+ Object *getCharProc(int code, Object *proc);
+
+ // Return the 16-bit character set and encoding.
+ GfxFontCharSet16 getCharSet16() { return enc16.charSet; }
+ GfxFontEncoding16 *getEncoding16() { return enc16.enc; }
+
+ // Get the writing mode (0=horizontal, 1=vertical).
+ int getWMode16() { return enc16.enc->wMode; }
+
+ // Return the font matrix.
+ double *getFontMatrix() { return fontMat; }
+
+ // Read an external or embedded font file into a buffer.
+ char *readExtFontFile(int *len);
+ char *readEmbFontFile(int *len);
+
+private:
+
+ void getEncAndWidths(Dict *fontDict, BuiltinFont *builtinFont,
+ int missingWidth);
+ void findExtFontFile();
+ void makeWidths(Dict *fontDict, FontEncoding *builtinEncoding,
+ Gushort *builtinWidths, int missingWidth);
+ void getType0EncAndWidths(Dict *fontDict);
+
+ GString *tag; // PDF font tag
+ Ref id; // reference (used as unique ID)
+ GString *name; // font name
+ int flags; // font descriptor flags
+ GfxFontType type; // type of font
+ GBool is16; // set if font uses 16-bit chars
+ GString *embFontName; // name of embedded font
+ Ref embFontID; // ref to embedded font file stream
+ GString *extFontFile; // external font file name
+ Object charProcs; // Type3 CharProcs dictionary
+ double fontMat[6]; // font matrix
+ union {
+ FontEncoding *encoding; // 8-bit font encoding
+ struct {
+ GfxFontCharSet16 charSet; // 16-bit character set
+ GfxFontEncoding16 *enc; // 16-bit encoding (CMap)
+ } enc16;
+ };
+ union {
+ double widths[256]; // width of each char for 8-bit font
+ GfxFontWidths16 widths16; // char widths for 16-bit font
+ };
+};
+
+//------------------------------------------------------------------------
+// GfxFontDict
+//------------------------------------------------------------------------
+
+class GfxFontDict {
+public:
+
+ // Build the font dictionary, given the PDF font dictionary.
+ GfxFontDict(Dict *fontDict);
+
+ // Destructor.
+ ~GfxFontDict();
+
+ // Get the specified font.
+ GfxFont *lookup(char *tag);
+
+ // Iterative access.
+ int getNumFonts() { return numFonts; }
+ GfxFont *getFont(int i) { return fonts[i]; }
+
+private:
+
+ GfxFont **fonts; // list of fonts
+ int numFonts; // number of fonts
+};
+
+#endif
diff --git a/pdf2swf/xpdf/GfxState.cc b/pdf2swf/xpdf/GfxState.cc
new file mode 100644
index 00000000..1abf9a56
--- /dev/null
+++ b/pdf2swf/xpdf/GfxState.cc
@@ -0,0 +1,2271 @@
+//========================================================================
+//
+// GfxState.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include <math.h>
+#include <string.h> // for memcpy()
+#include "gmem.h"
+#include "Error.h"
+#include "Object.h"
+#include "Array.h"
+#include "GfxState.h"
+
+//------------------------------------------------------------------------
+
+static inline double clip01(double x) {
+ return (x < 0) ? 0 : ((x > 1) ? 1 : x);
+}
+
+//------------------------------------------------------------------------
+// GfxColorSpace
+//------------------------------------------------------------------------
+
+GfxColorSpace::GfxColorSpace() {
+}
+
+GfxColorSpace::~GfxColorSpace() {
+}
+
+GfxColorSpace *GfxColorSpace::parse(Object *csObj) {
+ GfxColorSpace *cs;
+ Object obj1;
+
+ cs = NULL;
+ if (csObj->isName()) {
+ if (csObj->isName("DeviceGray") || csObj->isName("G")) {
+ cs = new GfxDeviceGrayColorSpace();
+ } else if (csObj->isName("DeviceRGB") || csObj->isName("RGB")) {
+ cs = new GfxDeviceRGBColorSpace();
+ } else if (csObj->isName("DeviceCMYK") || csObj->isName("CMYK")) {
+ cs = new GfxDeviceCMYKColorSpace();
+ } else if (csObj->isName("Pattern")) {
+ cs = new GfxPatternColorSpace(NULL);
+ } else {
+ error(-1, "Bad color space '%s'", csObj->getName());
+ }
+ } else if (csObj->isArray()) {
+ csObj->arrayGet(0, &obj1);
+ if (obj1.isName("DeviceGray") || obj1.isName("G")) {
+ cs = new GfxDeviceGrayColorSpace();
+ } else if (obj1.isName("DeviceRGB") || obj1.isName("RGB")) {
+ cs = new GfxDeviceRGBColorSpace();
+ } else if (obj1.isName("DeviceCMYK") || obj1.isName("CMYK")) {
+ cs = new GfxDeviceCMYKColorSpace();
+ } else if (obj1.isName("CalGray")) {
+ cs = GfxCalGrayColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("CalRGB")) {
+ cs = GfxCalRGBColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("Lab")) {
+ cs = GfxLabColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("ICCBased")) {
+ cs = GfxICCBasedColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("Indexed") || obj1.isName("I")) {
+ cs = GfxIndexedColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("Separation")) {
+ cs = GfxSeparationColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("DeviceN")) {
+ cs = GfxDeviceNColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("Pattern")) {
+ cs = GfxPatternColorSpace::parse(csObj->getArray());
+ } else {
+ error(-1, "Bad color space '%s'", csObj->getName());
+ }
+ obj1.free();
+ } else {
+ error(-1, "Bad color space - expected name or array");
+ }
+ return cs;
+}
+
+void GfxColorSpace::getDefaultRanges(double *decodeLow, double *decodeRange,
+ int maxImgPixel) {
+ int i;
+
+ for (i = 0; i < getNComps(); ++i) {
+ decodeLow[i] = 0;
+ decodeRange[i] = 1;
+ }
+}
+
+//------------------------------------------------------------------------
+// GfxDeviceGrayColorSpace
+//------------------------------------------------------------------------
+
+GfxDeviceGrayColorSpace::GfxDeviceGrayColorSpace() {
+}
+
+GfxDeviceGrayColorSpace::~GfxDeviceGrayColorSpace() {
+}
+
+GfxColorSpace *GfxDeviceGrayColorSpace::copy() {
+ return new GfxDeviceGrayColorSpace();
+}
+
+void GfxDeviceGrayColorSpace::getGray(GfxColor *color, double *gray) {
+ *gray = clip01(color->c[0]);
+}
+
+void GfxDeviceGrayColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ rgb->r = rgb->g = rgb->b = clip01(color->c[0]);
+}
+
+void GfxDeviceGrayColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ cmyk->c = cmyk->m = cmyk->y = 0;
+ cmyk->k = clip01(1 - color->c[0]);
+}
+
+//------------------------------------------------------------------------
+// GfxCalGrayColorSpace
+//------------------------------------------------------------------------
+
+GfxCalGrayColorSpace::GfxCalGrayColorSpace() {
+ whiteX = whiteY = whiteZ = 1;
+ blackX = blackY = blackZ = 0;
+ gamma = 1;
+}
+
+GfxCalGrayColorSpace::~GfxCalGrayColorSpace() {
+}
+
+GfxColorSpace *GfxCalGrayColorSpace::copy() {
+ GfxCalGrayColorSpace *cs;
+
+ cs = new GfxCalGrayColorSpace();
+ cs->whiteX = whiteX;
+ cs->whiteY = whiteY;
+ cs->whiteZ = whiteZ;
+ cs->blackX = blackX;
+ cs->blackY = blackY;
+ cs->blackZ = blackZ;
+ cs->gamma = gamma;
+ return cs;
+}
+
+GfxColorSpace *GfxCalGrayColorSpace::parse(Array *arr) {
+ GfxCalGrayColorSpace *cs;
+ Object obj1, obj2, obj3;
+
+ arr->get(1, &obj1);
+ if (!obj1.isDict()) {
+ error(-1, "Bad CalGray color space");
+ obj1.free();
+ return NULL;
+ }
+ cs = new GfxCalGrayColorSpace();
+ if (obj1.dictLookup("WhitePoint", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->whiteX = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->whiteY = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->whiteZ = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("BlackPoint", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->blackX = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->blackY = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->blackZ = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("Gamma", &obj2)->isNum()) {
+ cs->gamma = obj2.getNum();
+ }
+ obj2.free();
+ obj1.free();
+ return cs;
+}
+
+void GfxCalGrayColorSpace::getGray(GfxColor *color, double *gray) {
+ *gray = clip01(color->c[0]);
+}
+
+void GfxCalGrayColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ rgb->r = rgb->g = rgb->b = clip01(color->c[0]);
+}
+
+void GfxCalGrayColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ cmyk->c = cmyk->m = cmyk->y = 0;
+ cmyk->k = clip01(1 - color->c[0]);
+}
+
+//------------------------------------------------------------------------
+// GfxDeviceRGBColorSpace
+//------------------------------------------------------------------------
+
+GfxDeviceRGBColorSpace::GfxDeviceRGBColorSpace() {
+}
+
+GfxDeviceRGBColorSpace::~GfxDeviceRGBColorSpace() {
+}
+
+GfxColorSpace *GfxDeviceRGBColorSpace::copy() {
+ return new GfxDeviceRGBColorSpace();
+}
+
+void GfxDeviceRGBColorSpace::getGray(GfxColor *color, double *gray) {
+ *gray = clip01(0.299 * color->c[0] +
+ 0.587 * color->c[1] +
+ 0.114 * color->c[2]);
+}
+
+void GfxDeviceRGBColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ rgb->r = clip01(color->c[0]);
+ rgb->g = clip01(color->c[1]);
+ rgb->b = clip01(color->c[2]);
+}
+
+void GfxDeviceRGBColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ double c, m, y, k;
+
+ c = clip01(1 - color->c[0]);
+ m = clip01(1 - color->c[1]);
+ y = clip01(1 - color->c[2]);
+ k = c;
+ if (m < k) {
+ k = m;
+ }
+ if (y < k) {
+ k = y;
+ }
+ cmyk->c = c - k;
+ cmyk->m = m - k;
+ cmyk->y = y - k;
+ cmyk->k = k;
+}
+
+//------------------------------------------------------------------------
+// GfxCalRGBColorSpace
+//------------------------------------------------------------------------
+
+GfxCalRGBColorSpace::GfxCalRGBColorSpace() {
+ whiteX = whiteY = whiteZ = 1;
+ blackX = blackY = blackZ = 0;
+ gammaR = gammaG = gammaB = 1;
+ m[0] = 1; m[1] = 0; m[2] = 0;
+ m[3] = 0; m[4] = 1; m[5] = 0;
+ m[6] = 0; m[7] = 0; m[8] = 1;
+}
+
+GfxCalRGBColorSpace::~GfxCalRGBColorSpace() {
+}
+
+GfxColorSpace *GfxCalRGBColorSpace::copy() {
+ GfxCalRGBColorSpace *cs;
+ int i;
+
+ cs = new GfxCalRGBColorSpace();
+ cs->whiteX = whiteX;
+ cs->whiteY = whiteY;
+ cs->whiteZ = whiteZ;
+ cs->blackX = blackX;
+ cs->blackY = blackY;
+ cs->blackZ = blackZ;
+ cs->gammaR = gammaR;
+ cs->gammaG = gammaG;
+ cs->gammaB = gammaB;
+ for (i = 0; i < 9; ++i) {
+ cs->m[i] = m[i];
+ }
+ return cs;
+}
+
+GfxColorSpace *GfxCalRGBColorSpace::parse(Array *arr) {
+ GfxCalRGBColorSpace *cs;
+ Object obj1, obj2, obj3;
+ int i;
+
+ arr->get(1, &obj1);
+ if (!obj1.isDict()) {
+ error(-1, "Bad CalRGB color space");
+ obj1.free();
+ return NULL;
+ }
+ cs = new GfxCalRGBColorSpace();
+ if (obj1.dictLookup("WhitePoint", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->whiteX = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->whiteY = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->whiteZ = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("BlackPoint", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->blackX = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->blackY = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->blackZ = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("Gamma", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->gammaR = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->gammaG = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->gammaB = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("Matrix", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 9) {
+ for (i = 0; i < 9; ++i) {
+ obj2.arrayGet(i, &obj3);
+ cs->m[i] = obj3.getNum();
+ obj3.free();
+ }
+ }
+ obj2.free();
+ obj1.free();
+ return cs;
+}
+
+void GfxCalRGBColorSpace::getGray(GfxColor *color, double *gray) {
+ *gray = clip01(0.299 * color->c[0] +
+ 0.587 * color->c[1] +
+ 0.114 * color->c[2]);
+}
+
+void GfxCalRGBColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ rgb->r = clip01(color->c[0]);
+ rgb->g = clip01(color->c[1]);
+ rgb->b = clip01(color->c[2]);
+}
+
+void GfxCalRGBColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ double c, m, y, k;
+
+ c = clip01(1 - color->c[0]);
+ m = clip01(1 - color->c[1]);
+ y = clip01(1 - color->c[2]);
+ k = c;
+ if (m < k) {
+ k = m;
+ }
+ if (y < k) {
+ k = y;
+ }
+ cmyk->c = c - k;
+ cmyk->m = m - k;
+ cmyk->y = y - k;
+ cmyk->k = k;
+}
+
+//------------------------------------------------------------------------
+// GfxDeviceCMYKColorSpace
+//------------------------------------------------------------------------
+
+GfxDeviceCMYKColorSpace::GfxDeviceCMYKColorSpace() {
+}
+
+GfxDeviceCMYKColorSpace::~GfxDeviceCMYKColorSpace() {
+}
+
+GfxColorSpace *GfxDeviceCMYKColorSpace::copy() {
+ return new GfxDeviceCMYKColorSpace();
+}
+
+void GfxDeviceCMYKColorSpace::getGray(GfxColor *color, double *gray) {
+ *gray = clip01(1 - color->c[3]
+ - 0.299 * color->c[0]
+ - 0.587 * color->c[1]
+ - 0.114 * color->c[2]);
+}
+
+void GfxDeviceCMYKColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ rgb->r = clip01(1 - (color->c[0] + color->c[3]));
+ rgb->g = clip01(1 - (color->c[1] + color->c[3]));
+ rgb->b = clip01(1 - (color->c[2] + color->c[3]));
+}
+
+void GfxDeviceCMYKColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ cmyk->c = clip01(color->c[0]);
+ cmyk->m = clip01(color->c[1]);
+ cmyk->y = clip01(color->c[2]);
+ cmyk->k = clip01(color->c[3]);
+}
+
+//------------------------------------------------------------------------
+// GfxLabColorSpace
+//------------------------------------------------------------------------
+
+// This is the inverse of MatrixLMN in Example 4.10 from the PostScript
+// Language Reference, Third Edition.
+static double xyzrgb[3][3] = {
+ { 3.240449, -1.537136, -0.498531 },
+ { -0.969265, 1.876011, 0.041556 },
+ { 0.055643, -0.204026, 1.057229 }
+};
+
+GfxLabColorSpace::GfxLabColorSpace() {
+ whiteX = whiteY = whiteZ = 1;
+ blackX = blackY = blackZ = 0;
+ aMin = bMin = -100;
+ aMax = bMax = 100;
+}
+
+GfxLabColorSpace::~GfxLabColorSpace() {
+}
+
+GfxColorSpace *GfxLabColorSpace::copy() {
+ GfxLabColorSpace *cs;
+
+ cs = new GfxLabColorSpace();
+ cs->whiteX = whiteX;
+ cs->whiteY = whiteY;
+ cs->whiteZ = whiteZ;
+ cs->blackX = blackX;
+ cs->blackY = blackY;
+ cs->blackZ = blackZ;
+ cs->aMin = aMin;
+ cs->aMax = aMax;
+ cs->bMin = bMin;
+ cs->bMax = bMax;
+ cs->kr = kr;
+ cs->kg = kg;
+ cs->kb = kb;
+ return cs;
+}
+
+GfxColorSpace *GfxLabColorSpace::parse(Array *arr) {
+ GfxLabColorSpace *cs;
+ Object obj1, obj2, obj3;
+
+ arr->get(1, &obj1);
+ if (!obj1.isDict()) {
+ error(-1, "Bad Lab color space");
+ obj1.free();
+ return NULL;
+ }
+ cs = new GfxLabColorSpace();
+ if (obj1.dictLookup("WhitePoint", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->whiteX = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->whiteY = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->whiteZ = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("BlackPoint", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->blackX = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->blackY = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->blackZ = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("Range", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 4) {
+ obj2.arrayGet(0, &obj3);
+ cs->aMin = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->aMax = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->bMin = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(3, &obj3);
+ cs->bMax = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ obj1.free();
+
+ cs->kr = 1 / (xyzrgb[0][0] * cs->whiteX +
+ xyzrgb[0][1] * cs->whiteY +
+ xyzrgb[0][2] * cs->whiteZ);
+ cs->kg = 1 / (xyzrgb[1][0] * cs->whiteX +
+ xyzrgb[1][1] * cs->whiteY +
+ xyzrgb[1][2] * cs->whiteZ);
+ cs->kb = 1 / (xyzrgb[2][0] * cs->whiteX +
+ xyzrgb[2][1] * cs->whiteY +
+ xyzrgb[2][2] * cs->whiteZ);
+
+ return cs;
+}
+
+void GfxLabColorSpace::getGray(GfxColor *color, double *gray) {
+ GfxRGB rgb;
+
+ getRGB(color, &rgb);
+ *gray = clip01(0.299 * rgb.r +
+ 0.587 * rgb.g +
+ 0.114 * rgb.b);
+}
+
+void GfxLabColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ double X, Y, Z;
+ double t1, t2;
+ double r, g, b;
+
+ // convert L*a*b* to CIE 1931 XYZ color space
+ t1 = (color->c[0] + 16) / 116;
+ t2 = t1 + color->c[1] / 500;
+ if (t2 >= (6.0 / 29.0)) {
+ X = t2 * t2 * t2;
+ } else {
+ X = (108.0 / 841.0) * (t2 - (4.0 / 29.0));
+ }
+ X *= whiteX;
+ if (t1 >= (6.0 / 29.0)) {
+ Y = t1 * t1 * t1;
+ } else {
+ Y = (108.0 / 841.0) * (t1 - (4.0 / 29.0));
+ }
+ Y *= whiteY;
+ t2 = t1 - color->c[2] / 200;
+ if (t2 >= (6.0 / 29.0)) {
+ Z = t2 * t2 * t2;
+ } else {
+ Z = (108.0 / 841.0) * (t2 - (4.0 / 29.0));
+ }
+ Z *= whiteZ;
+
+ // convert XYZ to RGB, including gamut mapping and gamma correction
+ r = xyzrgb[0][0] * X + xyzrgb[0][1] * Y + xyzrgb[0][2] * Z;
+ g = xyzrgb[1][0] * X + xyzrgb[1][1] * Y + xyzrgb[1][2] * Z;
+ b = xyzrgb[2][0] * X + xyzrgb[2][1] * Y + xyzrgb[2][2] * Z;
+ rgb->r = pow(clip01(r * kr), 0.5);
+ rgb->g = pow(clip01(g * kg), 0.5);
+ rgb->b = pow(clip01(b * kb), 0.5);
+}
+
+void GfxLabColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ GfxRGB rgb;
+ double c, m, y, k;
+
+ getRGB(color, &rgb);
+ c = clip01(1 - rgb.r);
+ m = clip01(1 - rgb.g);
+ y = clip01(1 - rgb.b);
+ k = c;
+ if (m < k) {
+ k = m;
+ }
+ if (y < k) {
+ k = y;
+ }
+ cmyk->c = c - k;
+ cmyk->m = m - k;
+ cmyk->y = y - k;
+ cmyk->k = k;
+}
+
+void GfxLabColorSpace::getDefaultRanges(double *decodeLow, double *decodeRange,
+ int maxImgPixel) {
+ decodeLow[0] = 0;
+ decodeRange[0] = 100;
+ decodeLow[1] = aMin;
+ decodeRange[1] = aMax - aMin;
+ decodeLow[2] = bMin;
+ decodeRange[2] = bMax - bMin;
+}
+
+//------------------------------------------------------------------------
+// GfxICCBasedColorSpace
+//------------------------------------------------------------------------
+
+GfxICCBasedColorSpace::GfxICCBasedColorSpace(int nComps, GfxColorSpace *alt,
+ Ref *iccProfileStream) {
+ this->nComps = nComps;
+ this->alt = alt;
+ this->iccProfileStream = *iccProfileStream;
+ rangeMin[0] = rangeMin[1] = rangeMin[2] = rangeMin[3] = 0;
+ rangeMax[0] = rangeMax[1] = rangeMax[2] = rangeMax[3] = 1;
+}
+
+GfxICCBasedColorSpace::~GfxICCBasedColorSpace() {
+ delete alt;
+}
+
+GfxColorSpace *GfxICCBasedColorSpace::copy() {
+ GfxICCBasedColorSpace *cs;
+ int i;
+
+ cs = new GfxICCBasedColorSpace(nComps, alt->copy(), &iccProfileStream);
+ for (i = 0; i < 4; ++i) {
+ cs->rangeMin[i] = rangeMin[i];
+ cs->rangeMax[i] = rangeMax[i];
+ }
+ return cs;
+}
+
+GfxColorSpace *GfxICCBasedColorSpace::parse(Array *arr) {
+ GfxICCBasedColorSpace *cs;
+ Ref iccProfileStream;
+ int nComps;
+ GfxColorSpace *alt;
+ Dict *dict;
+ Object obj1, obj2, obj3;
+ int i;
+
+ arr->getNF(1, &obj1);
+ if (obj1.isRef()) {
+ iccProfileStream = obj1.getRef();
+ } else {
+ iccProfileStream.num = 0;
+ iccProfileStream.gen = 0;
+ }
+ obj1.free();
+ arr->get(1, &obj1);
+ if (!obj1.isStream()) {
+ error(-1, "Bad ICCBased color space (stream)");
+ obj1.free();
+ return NULL;
+ }
+ dict = obj1.streamGetDict();
+ if (!dict->lookup("N", &obj2)->isInt()) {
+ error(-1, "Bad ICCBased color space (N)");
+ obj2.free();
+ obj1.free();
+ return NULL;
+ }
+ nComps = obj2.getInt();
+ obj2.free();
+ if (dict->lookup("Alternate", &obj2)->isNull() ||
+ !(alt = GfxColorSpace::parse(&obj2))) {
+ switch (nComps) {
+ case 1:
+ alt = new GfxDeviceGrayColorSpace();
+ break;
+ case 3:
+ alt = new GfxDeviceRGBColorSpace();
+ break;
+ case 4:
+ alt = new GfxDeviceCMYKColorSpace();
+ break;
+ default:
+ error(-1, "Bad ICCBased color space - invalid N");
+ obj2.free();
+ obj1.free();
+ return NULL;
+ }
+ }
+ obj2.free();
+ cs = new GfxICCBasedColorSpace(nComps, alt, &iccProfileStream);
+ if (dict->lookup("Range", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 2 * nComps) {
+ for (i = 0; i < nComps; ++i) {
+ obj2.arrayGet(2*i, &obj3);
+ cs->rangeMin[i] = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2*i+1, &obj3);
+ cs->rangeMax[i] = obj3.getNum();
+ obj3.free();
+ }
+ }
+ obj2.free();
+ obj1.free();
+ return cs;
+}
+
+void GfxICCBasedColorSpace::getGray(GfxColor *color, double *gray) {
+ alt->getGray(color, gray);
+}
+
+void GfxICCBasedColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ alt->getRGB(color, rgb);
+}
+
+void GfxICCBasedColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ alt->getCMYK(color, cmyk);
+}
+
+void GfxICCBasedColorSpace::getDefaultRanges(double *decodeLow,
+ double *decodeRange,
+ int maxImgPixel) {
+ int i;
+
+ for (i = 0; i < nComps; ++i) {
+ decodeLow[i] = rangeMin[i];
+ decodeRange[i] = rangeMax[i] - rangeMin[i];
+ }
+}
+
+//------------------------------------------------------------------------
+// GfxIndexedColorSpace
+//------------------------------------------------------------------------
+
+GfxIndexedColorSpace::GfxIndexedColorSpace(GfxColorSpace *base,
+ int indexHigh) {
+ this->base = base;
+ this->indexHigh = indexHigh;
+ this->lookup = (Guchar *)gmalloc((indexHigh + 1) * base->getNComps() *
+ sizeof(Guchar));
+}
+
+GfxIndexedColorSpace::~GfxIndexedColorSpace() {
+ delete base;
+ gfree(lookup);
+}
+
+GfxColorSpace *GfxIndexedColorSpace::copy() {
+ GfxIndexedColorSpace *cs;
+
+ cs = new GfxIndexedColorSpace(base->copy(), indexHigh);
+ memcpy(cs->lookup, lookup,
+ (indexHigh + 1) * base->getNComps() * sizeof(Guchar));
+ return cs;
+}
+
+GfxColorSpace *GfxIndexedColorSpace::parse(Array *arr) {
+ GfxIndexedColorSpace *cs;
+ GfxColorSpace *base;
+ int indexHigh;
+ Object obj1;
+ int x;
+ char *s;
+ int n, i, j;
+
+ if (arr->getLength() != 4) {
+ error(-1, "Bad Indexed color space");
+ goto err1;
+ }
+ arr->get(1, &obj1);
+ if (!(base = GfxColorSpace::parse(&obj1))) {
+ error(-1, "Bad Indexed color space (base color space)");
+ goto err2;
+ }
+ obj1.free();
+ if (!arr->get(2, &obj1)->isInt()) {
+ error(-1, "Bad Indexed color space (hival)");
+ goto err2;
+ }
+ indexHigh = obj1.getInt();
+ obj1.free();
+ cs = new GfxIndexedColorSpace(base, indexHigh);
+ arr->get(3, &obj1);
+ n = base->getNComps();
+ if (obj1.isStream()) {
+ obj1.streamReset();
+ for (i = 0; i <= indexHigh; ++i) {
+ for (j = 0; j < n; ++j) {
+ if ((x = obj1.streamGetChar()) == EOF) {
+ error(-1, "Bad Indexed color space (lookup table stream too short)");
+ goto err3;
+ }
+ cs->lookup[i*n + j] = (Guchar)x;
+ }
+ }
+ obj1.streamClose();
+ } else if (obj1.isString()) {
+ if (obj1.getString()->getLength() < (indexHigh + 1) * n) {
+ error(-1, "Bad Indexed color space (lookup table string too short)");
+ goto err3;
+ }
+ s = obj1.getString()->getCString();
+ for (i = 0; i <= indexHigh; ++i) {
+ for (j = 0; j < n; ++j) {
+ cs->lookup[i*n + j] = (Guchar)*s++;
+ }
+ }
+ } else {
+ error(-1, "Bad Indexed color space (lookup table)");
+ goto err3;
+ }
+ obj1.free();
+ return cs;
+
+ err3:
+ delete cs;
+ err2:
+ obj1.free();
+ err1:
+ return NULL;
+}
+
+void GfxIndexedColorSpace::getGray(GfxColor *color, double *gray) {
+ Guchar *p;
+ GfxColor color2;
+ int n, i;
+
+ n = base->getNComps();
+ p = &lookup[(int)(color->c[0] + 0.5) * n];
+ for (i = 0; i < n; ++i) {
+ color2.c[i] = p[i] / 255.0;
+ }
+ base->getGray(&color2, gray);
+}
+
+void GfxIndexedColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ Guchar *p;
+ GfxColor color2;
+ int n, i;
+
+ n = base->getNComps();
+ p = &lookup[(int)(color->c[0] + 0.5) * n];
+ for (i = 0; i < n; ++i) {
+ color2.c[i] = p[i] / 255.0;
+ }
+ base->getRGB(&color2, rgb);
+}
+
+void GfxIndexedColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ Guchar *p;
+ GfxColor color2;
+ int n, i;
+
+ n = base->getNComps();
+ p = &lookup[(int)(color->c[0] + 0.5) * n];
+ for (i = 0; i < n; ++i) {
+ color2.c[i] = p[i] / 255.0;
+ }
+ base->getCMYK(&color2, cmyk);
+}
+
+void GfxIndexedColorSpace::getDefaultRanges(double *decodeLow,
+ double *decodeRange,
+ int maxImgPixel) {
+ decodeLow[0] = 0;
+ decodeRange[0] = maxImgPixel;
+}
+
+//------------------------------------------------------------------------
+// GfxSeparationColorSpace
+//------------------------------------------------------------------------
+
+GfxSeparationColorSpace::GfxSeparationColorSpace(GString *name,
+ GfxColorSpace *alt,
+ Function *func) {
+ this->name = name;
+ this->alt = alt;
+ this->func = func;
+}
+
+GfxSeparationColorSpace::~GfxSeparationColorSpace() {
+ delete name;
+ delete alt;
+ delete func;
+}
+
+GfxColorSpace *GfxSeparationColorSpace::copy() {
+ return new GfxSeparationColorSpace(name->copy(), alt->copy(), func->copy());
+}
+
+//~ handle the 'All' and 'None' colorants
+GfxColorSpace *GfxSeparationColorSpace::parse(Array *arr) {
+ GfxSeparationColorSpace *cs;
+ GString *name;
+ GfxColorSpace *alt;
+ Function *func;
+ Object obj1;
+
+ if (arr->getLength() != 4) {
+ error(-1, "Bad Separation color space");
+ goto err1;
+ }
+ if (!arr->get(1, &obj1)->isName()) {
+ error(-1, "Bad Separation color space (name)");
+ goto err2;
+ }
+ name = new GString(obj1.getName());
+ obj1.free();
+ arr->get(2, &obj1);
+ if (!(alt = GfxColorSpace::parse(&obj1))) {
+ error(-1, "Bad Separation color space (alternate color space)");
+ goto err3;
+ }
+ obj1.free();
+ func = Function::parse(arr->get(3, &obj1));
+ obj1.free();
+ if (!func->isOk()) {
+ goto err4;
+ }
+ cs = new GfxSeparationColorSpace(name, alt, func);
+ return cs;
+
+ err4:
+ delete func;
+ delete alt;
+ err3:
+ delete name;
+ err2:
+ obj1.free();
+ err1:
+ return NULL;
+}
+
+void GfxSeparationColorSpace::getGray(GfxColor *color, double *gray) {
+ GfxColor color2;
+
+ func->transform(color->c, color2.c);
+ alt->getGray(&color2, gray);
+}
+
+void GfxSeparationColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ GfxColor color2;
+
+ func->transform(color->c, color2.c);
+ alt->getRGB(&color2, rgb);
+}
+
+void GfxSeparationColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ GfxColor color2;
+
+ func->transform(color->c, color2.c);
+ alt->getCMYK(&color2, cmyk);
+}
+
+//------------------------------------------------------------------------
+// GfxDeviceNColorSpace
+//------------------------------------------------------------------------
+
+GfxDeviceNColorSpace::GfxDeviceNColorSpace(int nComps,
+ GfxColorSpace *alt,
+ Function *func) {
+ this->nComps = nComps;
+ this->alt = alt;
+ this->func = func;
+}
+
+GfxDeviceNColorSpace::~GfxDeviceNColorSpace() {
+ int i;
+
+ for (i = 0; i < nComps; ++i) {
+ delete names[i];
+ }
+ delete alt;
+ delete func;
+}
+
+GfxColorSpace *GfxDeviceNColorSpace::copy() {
+ GfxDeviceNColorSpace *cs;
+ int i;
+
+ cs = new GfxDeviceNColorSpace(nComps, alt->copy(), func->copy());
+ for (i = 0; i < nComps; ++i) {
+ cs->names[i] = names[i]->copy();
+ }
+ return cs;
+}
+
+//~ handle the 'None' colorant
+GfxColorSpace *GfxDeviceNColorSpace::parse(Array *arr) {
+ GfxDeviceNColorSpace *cs;
+ int nComps;
+ GString *names[gfxColorMaxComps];
+ GfxColorSpace *alt;
+ Function *func;
+ Object obj1, obj2;
+ int i;
+
+ if (arr->getLength() != 4 && arr->getLength() != 5) {
+ error(-1, "Bad DeviceN color space");
+ goto err1;
+ }
+ if (!arr->get(1, &obj1)->isArray()) {
+ error(-1, "Bad DeviceN color space (names)");
+ goto err2;
+ }
+ nComps = obj1.arrayGetLength();
+ for (i = 0; i < nComps; ++i) {
+ if (!obj1.arrayGet(i, &obj2)->isName()) {
+ error(-1, "Bad DeviceN color space (names)");
+ obj2.free();
+ goto err2;
+ }
+ names[i] = new GString(obj2.getName());
+ obj2.free();
+ }
+ obj1.free();
+ arr->get(2, &obj1);
+ if (!(alt = GfxColorSpace::parse(&obj1))) {
+ error(-1, "Bad DeviceN color space (alternate color space)");
+ goto err3;
+ }
+ obj1.free();
+ func = Function::parse(arr->get(3, &obj1));
+ obj1.free();
+ if (!func->isOk()) {
+ goto err4;
+ }
+ cs = new GfxDeviceNColorSpace(nComps, alt, func);
+ for (i = 0; i < nComps; ++i) {
+ cs->names[i] = names[i];
+ }
+ return cs;
+
+ err4:
+ delete func;
+ delete alt;
+ err3:
+ for (i = 0; i < nComps; ++i) {
+ delete names[i];
+ }
+ err2:
+ obj1.free();
+ err1:
+ return NULL;
+}
+
+void GfxDeviceNColorSpace::getGray(GfxColor *color, double *gray) {
+ GfxColor color2;
+
+ func->transform(color->c, color2.c);
+ alt->getGray(&color2, gray);
+}
+
+void GfxDeviceNColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ GfxColor color2;
+
+ func->transform(color->c, color2.c);
+ alt->getRGB(&color2, rgb);
+}
+
+void GfxDeviceNColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ GfxColor color2;
+
+ func->transform(color->c, color2.c);
+ alt->getCMYK(&color2, cmyk);
+}
+
+//------------------------------------------------------------------------
+// GfxPatternColorSpace
+//------------------------------------------------------------------------
+
+GfxPatternColorSpace::GfxPatternColorSpace(GfxColorSpace *under) {
+ this->under = under;
+}
+
+GfxPatternColorSpace::~GfxPatternColorSpace() {
+ if (under) {
+ delete under;
+ }
+}
+
+GfxColorSpace *GfxPatternColorSpace::copy() {
+ return new GfxPatternColorSpace(under ? under->copy() :
+ (GfxColorSpace *)NULL);
+}
+
+GfxColorSpace *GfxPatternColorSpace::parse(Array *arr) {
+ GfxPatternColorSpace *cs;
+ GfxColorSpace *under;
+ Object obj1;
+
+ if (arr->getLength() != 1 && arr->getLength() != 2) {
+ error(-1, "Bad Pattern color space");
+ return NULL;
+ }
+ under = NULL;
+ if (arr->getLength() == 2) {
+ arr->get(1, &obj1);
+ if (!(under = GfxColorSpace::parse(&obj1))) {
+ error(-1, "Bad Pattern color space (underlying color space)");
+ obj1.free();
+ return NULL;
+ }
+ obj1.free();
+ }
+ cs = new GfxPatternColorSpace(under);
+ return cs;
+}
+
+void GfxPatternColorSpace::getGray(GfxColor *color, double *gray) {
+ *gray = 0;
+}
+
+void GfxPatternColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ rgb->r = rgb->g = rgb->b = 0;
+}
+
+void GfxPatternColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ cmyk->c = cmyk->m = cmyk->y = 0;
+ cmyk->k = 1;
+}
+
+//------------------------------------------------------------------------
+// Pattern
+//------------------------------------------------------------------------
+
+GfxPattern::GfxPattern(int type) {
+ this->type = type;
+}
+
+GfxPattern::~GfxPattern() {
+}
+
+GfxPattern *GfxPattern::parse(Object *obj) {
+ GfxPattern *pattern;
+ Dict *dict;
+ Object obj1;
+
+ pattern = NULL;
+ if (obj->isStream()) {
+ dict = obj->streamGetDict();
+ dict->lookup("PatternType", &obj1);
+ if (obj1.isInt() && obj1.getInt() == 1) {
+ pattern = new GfxTilingPattern(dict, obj);
+ }
+ obj1.free();
+ }
+ return pattern;
+}
+
+//------------------------------------------------------------------------
+// GfxTilingPattern
+//------------------------------------------------------------------------
+
+GfxTilingPattern::GfxTilingPattern(Dict *streamDict, Object *stream):
+ GfxPattern(1)
+{
+ Object obj1, obj2;
+ int i;
+
+ if (streamDict->lookup("PaintType", &obj1)->isInt()) {
+ paintType = obj1.getInt();
+ } else {
+ paintType = 1;
+ error(-1, "Invalid or missing PaintType in pattern");
+ }
+ obj1.free();
+ if (streamDict->lookup("TilingType", &obj1)->isInt()) {
+ tilingType = obj1.getInt();
+ } else {
+ tilingType = 1;
+ error(-1, "Invalid or missing TilingType in pattern");
+ }
+ obj1.free();
+ bbox[0] = bbox[1] = 0;
+ bbox[2] = bbox[3] = 1;
+ if (streamDict->lookup("BBox", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 4) {
+ for (i = 0; i < 4; ++i) {
+ if (obj1.arrayGet(i, &obj2)->isNum()) {
+ bbox[i] = obj2.getNum();
+ }
+ obj2.free();
+ }
+ } else {
+ error(-1, "Invalid or missing BBox in pattern");
+ }
+ obj1.free();
+ if (streamDict->lookup("XStep", &obj1)->isNum()) {
+ xStep = obj1.getNum();
+ } else {
+ xStep = 1;
+ error(-1, "Invalid or missing XStep in pattern");
+ }
+ obj1.free();
+ if (streamDict->lookup("YStep", &obj1)->isNum()) {
+ yStep = obj1.getNum();
+ } else {
+ yStep = 1;
+ error(-1, "Invalid or missing YStep in pattern");
+ }
+ obj1.free();
+ if (!streamDict->lookup("Resources", &resDict)->isDict()) {
+ resDict.free();
+ resDict.initNull();
+ error(-1, "Invalid or missing Resources in pattern");
+ }
+ matrix[0] = 1; matrix[1] = 0;
+ matrix[2] = 0; matrix[3] = 1;
+ matrix[4] = 0; matrix[5] = 0;
+ if (streamDict->lookup("Matrix", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 6) {
+ for (i = 0; i < 6; ++i) {
+ if (obj1.arrayGet(i, &obj2)->isNum()) {
+ matrix[i] = obj2.getNum();
+ }
+ obj2.free();
+ }
+ }
+ obj1.free();
+ stream->copy(&contentStream);
+}
+
+GfxTilingPattern::~GfxTilingPattern() {
+ resDict.free();
+ contentStream.free();
+}
+
+GfxPattern *GfxTilingPattern::copy() {
+ return new GfxTilingPattern(this);
+}
+
+GfxTilingPattern::GfxTilingPattern(GfxTilingPattern *pat):
+ GfxPattern(1)
+{
+ memcpy(this, pat, sizeof(GfxTilingPattern));
+ pat->resDict.copy(&resDict);
+ pat->contentStream.copy(&contentStream);
+}
+
+//------------------------------------------------------------------------
+// Function
+//------------------------------------------------------------------------
+
+Function::Function() {
+}
+
+Function::~Function() {
+}
+
+Function *Function::parse(Object *funcObj) {
+ Function *func;
+ Dict *dict;
+ int funcType;
+ Object obj1;
+
+ if (funcObj->isStream()) {
+ dict = funcObj->streamGetDict();
+ } else if (funcObj->isDict()) {
+ dict = funcObj->getDict();
+ } else {
+ error(-1, "Expected function dictionary or stream");
+ return NULL;
+ }
+
+ if (!dict->lookup("FunctionType", &obj1)->isInt()) {
+ error(-1, "Function type is missing or wrong type");
+ obj1.free();
+ return NULL;
+ }
+ funcType = obj1.getInt();
+ obj1.free();
+
+ if (funcType == 0) {
+ func = new SampledFunction(funcObj, dict);
+ } else if (funcType == 2) {
+ func = new ExponentialFunction(funcObj, dict);
+ } else {
+ error(-1, "Unimplemented function type");
+ return NULL;
+ }
+ if (!func->isOk()) {
+ delete func;
+ return NULL;
+ }
+
+ return func;
+}
+
+GBool Function::init(Dict *dict) {
+ Object obj1, obj2;
+ int i;
+
+ //----- Domain
+ if (!dict->lookup("Domain", &obj1)->isArray()) {
+ error(-1, "Function is missing domain");
+ goto err2;
+ }
+ m = obj1.arrayGetLength() / 2;
+ if (m > funcMaxInputs) {
+ error(-1, "Functions with more than %d inputs are unsupported",
+ funcMaxInputs);
+ goto err2;
+ }
+ for (i = 0; i < m; ++i) {
+ obj1.arrayGet(2*i, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function domain array");
+ goto err1;
+ }
+ domain[i][0] = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2*i+1, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function domain array");
+ goto err1;
+ }
+ domain[i][1] = obj2.getNum();
+ obj2.free();
+ }
+ obj1.free();
+
+ //----- Range
+ hasRange = gFalse;
+ n = 0;
+ if (dict->lookup("Range", &obj1)->isArray()) {
+ hasRange = gTrue;
+ n = obj1.arrayGetLength() / 2;
+ if (n > funcMaxOutputs) {
+ error(-1, "Functions with more than %d outputs are unsupported",
+ funcMaxOutputs);
+ goto err2;
+ }
+ for (i = 0; i < n; ++i) {
+ obj1.arrayGet(2*i, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function range array");
+ goto err1;
+ }
+ range[i][0] = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2*i+1, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function range array");
+ goto err1;
+ }
+ range[i][1] = obj2.getNum();
+ obj2.free();
+ }
+ obj1.free();
+ }
+
+ return gTrue;
+
+ err1:
+ obj2.free();
+ err2:
+ obj1.free();
+ return gFalse;
+}
+
+//------------------------------------------------------------------------
+// SampledFunction
+//------------------------------------------------------------------------
+
+SampledFunction::SampledFunction(Object *funcObj, Dict *dict) {
+ Stream *str;
+ int nSamples, sampleBits;
+ double sampleMul;
+ Object obj1, obj2;
+ Guint buf, bitMask;
+ int bits;
+ int s;
+ int i;
+
+ samples = NULL;
+ ok = gFalse;
+
+ //----- initialize the generic stuff
+ if (!init(dict)) {
+ goto err1;
+ }
+ if (!hasRange) {
+ error(-1, "Type 0 function is missing range");
+ goto err1;
+ }
+
+ //----- get the stream
+ if (!funcObj->isStream()) {
+ error(-1, "Type 0 function isn't a stream");
+ goto err1;
+ }
+ str = funcObj->getStream();
+
+ //----- Size
+ if (!dict->lookup("Size", &obj1)->isArray() ||
+ obj1.arrayGetLength() != m) {
+ error(-1, "Function has missing or invalid size array");
+ goto err2;
+ }
+ for (i = 0; i < m; ++i) {
+ obj1.arrayGet(i, &obj2);
+ if (!obj2.isInt()) {
+ error(-1, "Illegal value in function size array");
+ goto err3;
+ }
+ sampleSize[i] = obj2.getInt();
+ obj2.free();
+ }
+ obj1.free();
+
+ //----- BitsPerSample
+ if (!dict->lookup("BitsPerSample", &obj1)->isInt()) {
+ error(-1, "Function has missing or invalid BitsPerSample");
+ goto err2;
+ }
+ sampleBits = obj1.getInt();
+ sampleMul = 1.0 / (double)((1 << sampleBits) - 1);
+ obj1.free();
+
+ //----- Encode
+ if (dict->lookup("Encode", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 2*m) {
+ for (i = 0; i < m; ++i) {
+ obj1.arrayGet(2*i, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function encode array");
+ goto err3;
+ }
+ encode[i][0] = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2*i+1, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function encode array");
+ goto err3;
+ }
+ encode[i][1] = obj2.getNum();
+ obj2.free();
+ }
+ } else {
+ for (i = 0; i < m; ++i) {
+ encode[i][0] = 0;
+ encode[i][1] = sampleSize[i] - 1;
+ }
+ }
+ obj1.free();
+
+ //----- Decode
+ if (dict->lookup("Decode", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 2*n) {
+ for (i = 0; i < n; ++i) {
+ obj1.arrayGet(2*i, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function decode array");
+ goto err3;
+ }
+ decode[i][0] = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2*i+1, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function decode array");
+ goto err3;
+ }
+ decode[i][1] = obj2.getNum();
+ obj2.free();
+ }
+ } else {
+ for (i = 0; i < n; ++i) {
+ decode[i][0] = range[i][0];
+ decode[i][1] = range[i][1];
+ }
+ }
+ obj1.free();
+
+ //----- samples
+ nSamples = n;
+ for (i = 0; i < m; ++i)
+ nSamples *= sampleSize[i];
+ samples = (double *)gmalloc(nSamples * sizeof(double));
+ buf = 0;
+ bits = 0;
+ bitMask = (1 << sampleBits) - 1;
+ str->reset();
+ for (i = 0; i < nSamples; ++i) {
+ if (sampleBits == 8) {
+ s = str->getChar();
+ } else if (sampleBits == 16) {
+ s = str->getChar();
+ s = (s << 8) + str->getChar();
+ } else if (sampleBits == 32) {
+ s = str->getChar();
+ s = (s << 8) + str->getChar();
+ s = (s << 8) + str->getChar();
+ s = (s << 8) + str->getChar();
+ } else {
+ while (bits < sampleBits) {
+ buf = (buf << 8) | (str->getChar() & 0xff);
+ bits += 8;
+ }
+ s = (buf >> (bits - sampleBits)) & bitMask;
+ bits -= sampleBits;
+ }
+ samples[i] = (double)s * sampleMul;
+ }
+ str->close();
+
+ ok = gTrue;
+ return;
+
+ err3:
+ obj2.free();
+ err2:
+ obj1.free();
+ err1:
+ return;
+}
+
+SampledFunction::~SampledFunction() {
+ if (samples) {
+ gfree(samples);
+ }
+}
+
+SampledFunction::SampledFunction(SampledFunction *func) {
+ int nSamples, i;
+
+ memcpy(this, func, sizeof(SampledFunction));
+
+ nSamples = n;
+ for (i = 0; i < m; ++i) {
+ nSamples *= sampleSize[i];
+ }
+ samples = (double *)gmalloc(nSamples * sizeof(double));
+ memcpy(samples, func->samples, nSamples * sizeof(double));
+}
+
+void SampledFunction::transform(double *in, double *out) {
+ double e[4];
+ double s;
+ double x0, x1;
+ int e0, e1;
+ double efrac;
+ int i;
+
+ // map input values into sample array
+ for (i = 0; i < m; ++i) {
+ e[i] = ((in[i] - domain[i][0]) / (domain[i][1] - domain[i][0])) *
+ (encode[i][1] - encode[i][0]) + encode[i][0];
+ if (e[i] < 0) {
+ e[i] = 0;
+ } else if (e[i] > sampleSize[i] - 1) {
+ e[i] = sampleSize[i] - 1;
+ }
+ }
+
+ for (i = 0; i < n; ++i) {
+
+ // m-linear interpolation
+ // (only m=1 is currently supported)
+ e0 = (int)floor(e[0]);
+ e1 = (int)ceil(e[0]);
+ efrac = e[0] - e0;
+ x0 = samples[e0 * n + i];
+ x1 = samples[e1 * n + i];
+ s = (1 - efrac) * x0 + efrac * x1;
+
+ // map output values to range
+ out[i] = s * (decode[i][1] - decode[i][0]) + decode[i][0];
+ if (out[i] < range[i][0]) {
+ out[i] = range[i][0];
+ } else if (out[i] > range[i][1]) {
+ out[i] = range[i][1];
+ }
+ }
+}
+
+//------------------------------------------------------------------------
+// ExponentialFunction
+//------------------------------------------------------------------------
+
+ExponentialFunction::ExponentialFunction(Object *funcObj, Dict *dict) {
+ Object obj1, obj2;
+ GBool hasN;
+ int i;
+
+ ok = gFalse;
+ hasN = gFalse;
+
+ //----- initialize the generic stuff
+ if (!init(dict)) {
+ goto err1;
+ }
+ if (m != 1) {
+ error(-1, "Exponential function with more than one input");
+ goto err1;
+ }
+
+ //----- default values
+ for (i = 0; i < funcMaxOutputs; ++i) {
+ c0[i] = 0;
+ c1[i] = 1;
+ }
+
+ //----- C0
+ if (dict->lookup("C0", &obj1)->isArray()) {
+ if (!hasN) {
+ n = obj1.arrayGetLength();
+ } else if (obj1.arrayGetLength() != n) {
+ error(-1, "Function's C0 array is wrong length");
+ goto err2;
+ }
+ for (i = 0; i < n; ++i) {
+ obj1.arrayGet(i, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function C0 array");
+ goto err3;
+ }
+ c0[i] = obj2.getNum();
+ obj2.free();
+ }
+ obj1.free();
+ }
+
+ //----- C1
+ if (dict->lookup("C1", &obj1)->isArray()) {
+ if (!hasN) {
+ n = obj1.arrayGetLength();
+ } else if (obj1.arrayGetLength() != n) {
+ error(-1, "Function's C1 array is wrong length");
+ goto err2;
+ }
+ for (i = 0; i < n; ++i) {
+ obj1.arrayGet(i, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function C1 array");
+ goto err3;
+ }
+ c1[i] = obj2.getNum();
+ obj2.free();
+ }
+ obj1.free();
+ }
+
+ //----- N (exponent)
+ if (!dict->lookup("N", &obj1)->isNum()) {
+ error(-1, "Function has missing or invalid N");
+ goto err2;
+ }
+ e = obj1.getNum();
+ obj1.free();
+
+ ok = gTrue;
+ return;
+
+ err3:
+ obj2.free();
+ err2:
+ obj1.free();
+ err1:
+ return;
+}
+
+ExponentialFunction::~ExponentialFunction() {
+}
+
+ExponentialFunction::ExponentialFunction(ExponentialFunction *func) {
+ memcpy(this, func, sizeof(ExponentialFunction));
+}
+
+void ExponentialFunction::transform(double *in, double *out) {
+ double x;
+ int i;
+
+ if (in[0] < domain[0][0]) {
+ x = domain[0][0];
+ } else if (in[0] > domain[0][1]) {
+ x = domain[0][1];
+ } else {
+ x = in[0];
+ }
+ for (i = 0; i < n; ++i) {
+ out[i] = c0[i] + pow(x, e) * (c1[i] - c0[i]);
+ if (hasRange) {
+ if (out[i] < range[i][0]) {
+ out[i] = range[i][0];
+ } else if (out[i] > range[i][1]) {
+ out[i] = range[i][1];
+ }
+ }
+ }
+ return;
+}
+
+//------------------------------------------------------------------------
+// GfxImageColorMap
+//------------------------------------------------------------------------
+
+GfxImageColorMap::GfxImageColorMap(int bits, Object *decode,
+ GfxColorSpace *colorSpace) {
+ GfxIndexedColorSpace *indexedCS;
+ GfxSeparationColorSpace *sepCS;
+ int maxPixel, indexHigh;
+ Guchar *lookup2;
+ Function *sepFunc;
+ Object obj;
+ double x;
+ double y[gfxColorMaxComps];
+ int i, j, k;
+
+ ok = gTrue;
+
+ // bits per component and color space
+ this->bits = bits;
+ maxPixel = (1 << bits) - 1;
+ this->colorSpace = colorSpace;
+
+ // get decode map
+ if (decode->isNull()) {
+ nComps = colorSpace->getNComps();
+ colorSpace->getDefaultRanges(decodeLow, decodeRange, maxPixel);
+ } else if (decode->isArray()) {
+ nComps = decode->arrayGetLength() / 2;
+ if (nComps != colorSpace->getNComps()) {
+ goto err1;
+ }
+ for (i = 0; i < nComps; ++i) {
+ decode->arrayGet(2*i, &obj);
+ if (!obj.isNum()) {
+ goto err2;
+ }
+ decodeLow[i] = obj.getNum();
+ obj.free();
+ decode->arrayGet(2*i+1, &obj);
+ if (!obj.isNum()) {
+ goto err2;
+ }
+ decodeRange[i] = obj.getNum() - decodeLow[i];
+ obj.free();
+ }
+ } else {
+ goto err1;
+ }
+
+#if 0 //~
+ // handle the case where fewer than 2^n palette entries of an n-bit
+ // indexed color space are populated (this happens, e.g., in files
+ // optimized by Distiller)
+ if (colorSpace->getMode() == csIndexed) {
+ i = ((GfxIndexedColorSpace *)colorSpace)->getIndexHigh();
+ if (i < maxPixel) {
+ maxPixel = i;
+ }
+ }
+#endif
+
+ // Construct a lookup table -- this stores pre-computed decoded
+ // values for each component, i.e., the result of applying the
+ // decode mapping to each possible image pixel component value.
+ //
+ // Optimization: for Indexed and Separation color spaces (which have
+ // only one component), we store color values in the lookup table
+ // rather than component values.
+ colorSpace2 = NULL;
+ nComps2 = 0;
+ if (colorSpace->getMode() == csIndexed) {
+ // Note that indexHigh may not be the same as maxPixel --
+ // Distiller will remove unused palette entries, resulting in
+ // indexHigh < maxPixel.
+ indexedCS = (GfxIndexedColorSpace *)colorSpace;
+ colorSpace2 = indexedCS->getBase();
+ indexHigh = indexedCS->getIndexHigh();
+ nComps2 = colorSpace2->getNComps();
+ lookup = (double *)gmalloc((indexHigh + 1) * nComps2 * sizeof(double));
+ lookup2 = indexedCS->getLookup();
+ for (i = 0; i <= indexHigh; ++i) {
+ j = (int)(decodeLow[0] +(i * decodeRange[0]) / maxPixel + 0.5);
+ for (k = 0; k < nComps2; ++k) {
+ lookup[i*nComps2 + k] = lookup2[i*nComps2 + k] / 255.0;
+ }
+ }
+ } else if (colorSpace->getMode() == csSeparation) {
+ sepCS = (GfxSeparationColorSpace *)colorSpace;
+ colorSpace2 = sepCS->getAlt();
+ nComps2 = colorSpace2->getNComps();
+ lookup = (double *)gmalloc((maxPixel + 1) * nComps2 * sizeof(double));
+ sepFunc = sepCS->getFunc();
+ for (i = 0; i <= maxPixel; ++i) {
+ x = decodeLow[0] + (i * decodeRange[0]) / maxPixel;
+ sepFunc->transform(&x, y);
+ for (k = 0; k < nComps2; ++k) {
+ lookup[i*nComps2 + k] = y[k];
+ }
+ }
+ } else {
+ lookup = (double *)gmalloc((maxPixel + 1) * nComps * sizeof(double));
+ for (i = 0; i <= maxPixel; ++i) {
+ for (k = 0; k < nComps; ++k) {
+ lookup[i*nComps + k] = decodeLow[k] +
+ (i * decodeRange[k]) / maxPixel;
+ }
+ }
+ }
+
+ return;
+
+ err2:
+ obj.free();
+ err1:
+ ok = gFalse;
+}
+
+GfxImageColorMap::~GfxImageColorMap() {
+ delete colorSpace;
+ gfree(lookup);
+}
+
+void GfxImageColorMap::getGray(Guchar *x, double *gray) {
+ GfxColor color;
+ double *p;
+ int i;
+
+ if (colorSpace2) {
+ p = &lookup[x[0] * nComps2];
+ for (i = 0; i < nComps2; ++i) {
+ color.c[i] = *p++;
+ }
+ colorSpace2->getGray(&color, gray);
+ } else {
+ for (i = 0; i < nComps; ++i) {
+ color.c[i] = lookup[x[i] * nComps + i];
+ }
+ colorSpace->getGray(&color, gray);
+ }
+}
+
+void GfxImageColorMap::getRGB(Guchar *x, GfxRGB *rgb) {
+ GfxColor color;
+ double *p;
+ int i;
+
+ if (colorSpace2) {
+ p = &lookup[x[0] * nComps2];
+ for (i = 0; i < nComps2; ++i) {
+ color.c[i] = *p++;
+ }
+ colorSpace2->getRGB(&color, rgb);
+ } else {
+ for (i = 0; i < nComps; ++i) {
+ color.c[i] = lookup[x[i] * nComps + i];
+ }
+ colorSpace->getRGB(&color, rgb);
+ }
+}
+
+void GfxImageColorMap::getCMYK(Guchar *x, GfxCMYK *cmyk) {
+ GfxColor color;
+ double *p;
+ int i;
+
+ if (colorSpace2) {
+ p = &lookup[x[0] * nComps2];
+ for (i = 0; i < nComps2; ++i) {
+ color.c[i] = *p++;
+ }
+ colorSpace2->getCMYK(&color, cmyk);
+ } else {
+ for (i = 0; i < nComps; ++i) {
+ color.c[i] = lookup[x[i] * nComps + i];
+ }
+ colorSpace->getCMYK(&color, cmyk);
+ }
+}
+
+//------------------------------------------------------------------------
+// GfxSubpath and GfxPath
+//------------------------------------------------------------------------
+
+GfxSubpath::GfxSubpath(double x1, double y1) {
+ size = 16;
+ x = (double *)gmalloc(size * sizeof(double));
+ y = (double *)gmalloc(size * sizeof(double));
+ curve = (GBool *)gmalloc(size * sizeof(GBool));
+ n = 1;
+ x[0] = x1;
+ y[0] = y1;
+ curve[0] = gFalse;
+ closed = gFalse;
+}
+
+GfxSubpath::~GfxSubpath() {
+ gfree(x);
+ gfree(y);
+ gfree(curve);
+}
+
+// Used for copy().
+GfxSubpath::GfxSubpath(GfxSubpath *subpath) {
+ size = subpath->size;
+ n = subpath->n;
+ x = (double *)gmalloc(size * sizeof(double));
+ y = (double *)gmalloc(size * sizeof(double));
+ curve = (GBool *)gmalloc(size * sizeof(GBool));
+ memcpy(x, subpath->x, n * sizeof(double));
+ memcpy(y, subpath->y, n * sizeof(double));
+ memcpy(curve, subpath->curve, n * sizeof(GBool));
+ closed = subpath->closed;
+}
+
+void GfxSubpath::lineTo(double x1, double y1) {
+ if (n >= size) {
+ size += 16;
+ x = (double *)grealloc(x, size * sizeof(double));
+ y = (double *)grealloc(y, size * sizeof(double));
+ curve = (GBool *)grealloc(curve, size * sizeof(GBool));
+ }
+ x[n] = x1;
+ y[n] = y1;
+ curve[n] = gFalse;
+ ++n;
+}
+
+void GfxSubpath::curveTo(double x1, double y1, double x2, double y2,
+ double x3, double y3) {
+ if (n+3 > size) {
+ size += 16;
+ x = (double *)grealloc(x, size * sizeof(double));
+ y = (double *)grealloc(y, size * sizeof(double));
+ curve = (GBool *)grealloc(curve, size * sizeof(GBool));
+ }
+ x[n] = x1;
+ y[n] = y1;
+ x[n+1] = x2;
+ y[n+1] = y2;
+ x[n+2] = x3;
+ y[n+2] = y3;
+ curve[n] = curve[n+1] = gTrue;
+ curve[n+2] = gFalse;
+ n += 3;
+}
+
+void GfxSubpath::close() {
+ if (x[n-1] != x[0] || y[n-1] != y[0]) {
+ lineTo(x[0], y[0]);
+ }
+ closed = gTrue;
+}
+
+GfxPath::GfxPath() {
+ justMoved = gFalse;
+ size = 16;
+ n = 0;
+ firstX = firstY = 0;
+ subpaths = (GfxSubpath **)gmalloc(size * sizeof(GfxSubpath *));
+}
+
+GfxPath::~GfxPath() {
+ int i;
+
+ for (i = 0; i < n; ++i)
+ delete subpaths[i];
+ gfree(subpaths);
+}
+
+// Used for copy().
+GfxPath::GfxPath(GBool justMoved1, double firstX1, double firstY1,
+ GfxSubpath **subpaths1, int n1, int size1) {
+ int i;
+
+ justMoved = justMoved1;
+ firstX = firstX1;
+ firstY = firstY1;
+ size = size1;
+ n = n1;
+ subpaths = (GfxSubpath **)gmalloc(size * sizeof(GfxSubpath *));
+ for (i = 0; i < n; ++i)
+ subpaths[i] = subpaths1[i]->copy();
+}
+
+void GfxPath::moveTo(double x, double y) {
+ justMoved = gTrue;
+ firstX = x;
+ firstY = y;
+}
+
+void GfxPath::lineTo(double x, double y) {
+ if (justMoved) {
+ if (n >= size) {
+ size += 16;
+ subpaths = (GfxSubpath **)
+ grealloc(subpaths, size * sizeof(GfxSubpath *));
+ }
+ subpaths[n] = new GfxSubpath(firstX, firstY);
+ ++n;
+ justMoved = gFalse;
+ }
+ subpaths[n-1]->lineTo(x, y);
+}
+
+void GfxPath::curveTo(double x1, double y1, double x2, double y2,
+ double x3, double y3) {
+ if (justMoved) {
+ if (n >= size) {
+ size += 16;
+ subpaths = (GfxSubpath **)
+ grealloc(subpaths, size * sizeof(GfxSubpath *));
+ }
+ subpaths[n] = new GfxSubpath(firstX, firstY);
+ ++n;
+ justMoved = gFalse;
+ }
+ subpaths[n-1]->curveTo(x1, y1, x2, y2, x3, y3);
+}
+
+
+//------------------------------------------------------------------------
+// GfxState
+//------------------------------------------------------------------------
+
+GfxState::GfxState(double dpi, double px1a, double py1a,
+ double px2a, double py2a, int rotate, GBool upsideDown) {
+ double k;
+
+ px1 = px1a;
+ py1 = py1a;
+ px2 = px2a;
+ py2 = py2a;
+ k = dpi / 72.0;
+ if (rotate == 90) {
+ ctm[0] = 0;
+ ctm[1] = upsideDown ? k : -k;
+ ctm[2] = k;
+ ctm[3] = 0;
+ ctm[4] = -k * py1;
+ ctm[5] = k * (upsideDown ? -px1 : px2);
+ pageWidth = k * (py2 - py1);
+ pageHeight = k * (px2 - px1);
+ } else if (rotate == 180) {
+ ctm[0] = -k;
+ ctm[1] = 0;
+ ctm[2] = 0;
+ ctm[3] = upsideDown ? k : -k;
+ ctm[4] = k * px2;
+ ctm[5] = k * (upsideDown ? -py1 : py2);
+ pageWidth = k * (px2 - px1);
+ pageHeight = k * (py2 - py1);
+ } else if (rotate == 270) {
+ ctm[0] = 0;
+ ctm[1] = upsideDown ? -k : k;
+ ctm[2] = -k;
+ ctm[3] = 0;
+ ctm[4] = k * py2;
+ ctm[5] = k * (upsideDown ? px2 : -px1);
+ pageWidth = k * (py2 - py1);
+ pageHeight = k * (px2 - px1);
+ } else {
+ ctm[0] = k;
+ ctm[1] = 0;
+ ctm[2] = 0;
+ ctm[3] = upsideDown ? -k : k;
+ ctm[4] = -k * px1;
+ ctm[5] = k * (upsideDown ? py2 : -py1);
+ pageWidth = k * (px2 - px1);
+ pageHeight = k * (py2 - py1);
+ }
+
+ fillColorSpace = new GfxDeviceGrayColorSpace();
+ strokeColorSpace = new GfxDeviceGrayColorSpace();
+ fillColor.c[0] = 0;
+ strokeColor.c[0] = 0;
+ fillPattern = NULL;
+ strokePattern = NULL;
+ fillOpacity = 1;
+ strokeOpacity = 1;
+
+ lineWidth = 1;
+ lineDash = NULL;
+ lineDashLength = 0;
+ lineDashStart = 0;
+ flatness = 0;
+ lineJoin = 0;
+ lineCap = 0;
+ miterLimit = 10;
+
+ font = NULL;
+ fontSize = 0;
+ textMat[0] = 1; textMat[1] = 0;
+ textMat[2] = 0; textMat[3] = 1;
+ textMat[4] = 0; textMat[5] = 0;
+ charSpace = 0;
+ wordSpace = 0;
+ horizScaling = 1;
+ leading = 0;
+ rise = 0;
+ render = 0;
+
+ path = new GfxPath();
+ curX = curY = 0;
+ lineX = lineY = 0;
+
+ saved = NULL;
+}
+
+GfxState::~GfxState() {
+ if (fillColorSpace) {
+ delete fillColorSpace;
+ }
+ if (strokeColorSpace) {
+ delete strokeColorSpace;
+ }
+ if (fillPattern) {
+ delete fillPattern;
+ }
+ if (strokePattern) {
+ delete strokePattern;
+ }
+ gfree(lineDash);
+ delete path;
+ if (saved) {
+ delete saved;
+ }
+}
+
+// Used for copy();
+GfxState::GfxState(GfxState *state) {
+ memcpy(this, state, sizeof(GfxState));
+ if (fillColorSpace) {
+ fillColorSpace = state->fillColorSpace->copy();
+ }
+ if (strokeColorSpace) {
+ strokeColorSpace = state->strokeColorSpace->copy();
+ }
+ if (fillPattern) {
+ fillPattern = state->fillPattern->copy();
+ }
+ if (strokePattern) {
+ strokePattern = state->strokePattern->copy();
+ }
+ if (lineDashLength > 0) {
+ lineDash = (double *)gmalloc(lineDashLength * sizeof(double));
+ memcpy(lineDash, state->lineDash, lineDashLength * sizeof(double));
+ }
+ path = state->path->copy();
+ saved = NULL;
+}
+
+double GfxState::transformWidth(double w) {
+ double x, y;
+
+ x = ctm[0] + ctm[2];
+ y = ctm[1] + ctm[3];
+ return w * sqrt(0.5 * (x * x + y * y));
+}
+
+double GfxState::getTransformedFontSize() {
+ double x1, y1, x2, y2;
+
+ x1 = textMat[2] * fontSize;
+ y1 = textMat[3] * fontSize;
+ x2 = ctm[0] * x1 + ctm[2] * y1;
+ y2 = ctm[1] * x1 + ctm[3] * y1;
+ return sqrt(x2 * x2 + y2 * y2);
+}
+
+void GfxState::getFontTransMat(double *m11, double *m12,
+ double *m21, double *m22) {
+ *m11 = (textMat[0] * ctm[0] + textMat[1] * ctm[2]) * fontSize;
+ *m12 = (textMat[0] * ctm[1] + textMat[1] * ctm[3]) * fontSize;
+ *m21 = (textMat[2] * ctm[0] + textMat[3] * ctm[2]) * fontSize;
+ *m22 = (textMat[2] * ctm[1] + textMat[3] * ctm[3]) * fontSize;
+}
+
+void GfxState::setCTM(double a, double b, double c,
+ double d, double e, double f) {
+ ctm[0] = a;
+ ctm[1] = b;
+ ctm[2] = c;
+ ctm[3] = d;
+ ctm[4] = e;
+ ctm[5] = f;
+}
+
+void GfxState::concatCTM(double a, double b, double c,
+ double d, double e, double f) {
+ double a1 = ctm[0];
+ double b1 = ctm[1];
+ double c1 = ctm[2];
+ double d1 = ctm[3];
+
+ ctm[0] = a * a1 + b * c1;
+ ctm[1] = a * b1 + b * d1;
+ ctm[2] = c * a1 + d * c1;
+ ctm[3] = c * b1 + d * d1;
+ ctm[4] = e * a1 + f * c1 + ctm[4];
+ ctm[5] = e * b1 + f * d1 + ctm[5];
+}
+
+void GfxState::setFillColorSpace(GfxColorSpace *colorSpace) {
+ if (fillColorSpace) {
+ delete fillColorSpace;
+ }
+ fillColorSpace = colorSpace;
+}
+
+void GfxState::setStrokeColorSpace(GfxColorSpace *colorSpace) {
+ if (strokeColorSpace) {
+ delete strokeColorSpace;
+ }
+ strokeColorSpace = colorSpace;
+}
+
+void GfxState::setFillPattern(GfxPattern *pattern) {
+ if (fillPattern) {
+ delete fillPattern;
+ }
+ fillPattern = pattern;
+}
+
+void GfxState::setStrokePattern(GfxPattern *pattern) {
+ if (strokePattern) {
+ delete strokePattern;
+ }
+ strokePattern = pattern;
+}
+
+void GfxState::setLineDash(double *dash, int length, double start) {
+ if (lineDash)
+ gfree(lineDash);
+ lineDash = dash;
+ lineDashLength = length;
+ lineDashStart = start;
+}
+
+void GfxState::clearPath() {
+ delete path;
+ path = new GfxPath();
+}
+
+void GfxState::textShift(double tx) {
+ double dx, dy;
+
+ textTransformDelta(tx, 0, &dx, &dy);
+ curX += dx;
+ curY += dy;
+}
+
+void GfxState::textShift(double tx, double ty) {
+ double dx, dy;
+
+ textTransformDelta(tx, ty, &dx, &dy);
+ curX += dx;
+ curY += dy;
+}
+
+GfxState *GfxState::save() {
+ GfxState *newState;
+
+ newState = copy();
+ newState->saved = this;
+ return newState;
+}
+
+GfxState *GfxState::restore() {
+ GfxState *oldState;
+
+ if (saved) {
+ oldState = saved;
+ saved = NULL;
+ delete this;
+ } else {
+ oldState = this;
+ }
+ return oldState;
+}
diff --git a/pdf2swf/xpdf/GfxState.h b/pdf2swf/xpdf/GfxState.h
new file mode 100644
index 00000000..2056c4d1
--- /dev/null
+++ b/pdf2swf/xpdf/GfxState.h
@@ -0,0 +1,937 @@
+//========================================================================
+//
+// GfxState.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef GFXSTATE_H
+#define GFXSTATE_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "gtypes.h"
+#include "Object.h"
+
+class Array;
+class Function;
+class GfxFont;
+
+//------------------------------------------------------------------------
+// GfxColor
+//------------------------------------------------------------------------
+
+#define gfxColorMaxComps 8
+
+struct GfxColor {
+ double c[gfxColorMaxComps];
+};
+
+//------------------------------------------------------------------------
+// GfxRGB
+//------------------------------------------------------------------------
+
+struct GfxRGB {
+ double r, g, b;
+};
+
+//------------------------------------------------------------------------
+// GfxCMYK
+//------------------------------------------------------------------------
+
+struct GfxCMYK {
+ double c, m, y, k;
+};
+
+//------------------------------------------------------------------------
+// GfxColorSpace
+//------------------------------------------------------------------------
+
+enum GfxColorSpaceMode {
+ csDeviceGray,
+ csCalGray,
+ csDeviceRGB,
+ csCalRGB,
+ csDeviceCMYK,
+ csLab,
+ csICCBased,
+ csIndexed,
+ csSeparation,
+ csDeviceN,
+ csPattern
+};
+
+class GfxColorSpace {
+public:
+
+ GfxColorSpace();
+ virtual ~GfxColorSpace();
+ virtual GfxColorSpace *copy() = 0;
+ virtual GfxColorSpaceMode getMode() = 0;
+
+ // Construct a color space. Returns NULL if unsuccessful.
+ static GfxColorSpace *parse(Object *csObj);
+
+ // Convert to gray, RGB, or CMYK.
+ virtual void getGray(GfxColor *color, double *gray) = 0;
+ virtual void getRGB(GfxColor *color, GfxRGB *rgb) = 0;
+ virtual void getCMYK(GfxColor *color, GfxCMYK *cmyk) = 0;
+
+ // Return the number of color components.
+ virtual int getNComps() = 0;
+
+ // Return the default ranges for each component, assuming an image
+ // with a max pixel value of <maxImgPixel>.
+ virtual void getDefaultRanges(double *decodeLow, double *decodeRange,
+ int maxImgPixel);
+
+private:
+};
+
+//------------------------------------------------------------------------
+// GfxDeviceGrayColorSpace
+//------------------------------------------------------------------------
+
+class GfxDeviceGrayColorSpace: public GfxColorSpace {
+public:
+
+ GfxDeviceGrayColorSpace();
+ virtual ~GfxDeviceGrayColorSpace();
+ virtual GfxColorSpace *copy();
+ virtual GfxColorSpaceMode getMode() { return csDeviceGray; }
+
+ virtual void getGray(GfxColor *color, double *gray);
+ virtual void getRGB(GfxColor *color, GfxRGB *rgb);
+ virtual void getCMYK(GfxColor *color, GfxCMYK *cmyk);
+
+ virtual int getNComps() { return 1; }
+
+private:
+};
+
+//------------------------------------------------------------------------
+// GfxCalGrayColorSpace
+//------------------------------------------------------------------------
+
+class GfxCalGrayColorSpace: public GfxColorSpace {
+public:
+
+ GfxCalGrayColorSpace();
+ virtual ~GfxCalGrayColorSpace();
+ virtual GfxColorSpace *copy();
+ virtual GfxColorSpaceMode getMode() { return csCalGray; }
+
+ // Construct a CalGray color space. Returns NULL if unsuccessful.
+ static GfxColorSpace *parse(Array *arr);
+
+ virtual void getGray(GfxColor *color, double *gray);
+ virtual void getRGB(GfxColor *color, GfxRGB *rgb);
+ virtual void getCMYK(GfxColor *color, GfxCMYK *cmyk);
+
+ virtual int getNComps() { return 1; }
+
+ // CalGray-specific access.
+ double getWhiteX() { return whiteX; }
+ double getWhiteY() { return whiteY; }
+ double getWhiteZ() { return whiteZ; }
+ double getBlackX() { return blackX; }
+ double getBlackY() { return blackY; }
+ double getBlackZ() { return blackZ; }
+ double getGamma() { return gamma; }
+
+private:
+
+ double whiteX, whiteY, whiteZ; // white point
+ double blackX, blackY, blackZ; // black point
+ double gamma; // gamma value
+};
+
+//------------------------------------------------------------------------
+// GfxDeviceRGBColorSpace
+//------------------------------------------------------------------------
+
+class GfxDeviceRGBColorSpace: public GfxColorSpace {
+public:
+
+ GfxDeviceRGBColorSpace();
+ virtual ~GfxDeviceRGBColorSpace();
+ virtual GfxColorSpace *copy();
+ virtual GfxColorSpaceMode getMode() { return csDeviceRGB; }
+
+ virtual void getGray(GfxColor *color, double *gray);
+ virtual void getRGB(GfxColor *color, GfxRGB *rgb);
+ virtual void getCMYK(GfxColor *color, GfxCMYK *cmyk);
+
+ virtual int getNComps() { return 3; }
+
+private:
+};
+
+//------------------------------------------------------------------------
+// GfxCalRGBColorSpace
+//------------------------------------------------------------------------
+
+class GfxCalRGBColorSpace: public GfxColorSpace {
+public:
+
+ GfxCalRGBColorSpace();
+ virtual ~GfxCalRGBColorSpace();
+ virtual GfxColorSpace *copy();
+ virtual GfxColorSpaceMode getMode() { return csCalRGB; }
+
+ // Construct a CalRGB color space. Returns NULL if unsuccessful.
+ static GfxColorSpace *parse(Array *arr);
+
+ virtual void getGray(GfxColor *color, double *gray);
+ virtual void getRGB(GfxColor *color, GfxRGB *rgb);
+ virtual void getCMYK(GfxColor *color, GfxCMYK *cmyk);
+
+ virtual int getNComps() { return 3; }
+
+ // CalRGB-specific access.
+ double getWhiteX() { return whiteX; }
+ double getWhiteY() { return whiteY; }
+ double getWhiteZ() { return whiteZ; }
+ double getBlackX() { return blackX; }
+ double getBlackY() { return blackY; }
+ double getBlackZ() { return blackZ; }
+ double getGammaR() { return gammaR; }
+ double getGammaG() { return gammaG; }
+ double getGammaB() { return gammaB; }
+ double *getMatrix() { return m; }
+
+private:
+
+ double whiteX, whiteY, whiteZ; // white point
+ double blackX, blackY, blackZ; // black point
+ double gammaR, gammaG, gammaB; // gamma values
+ double m[9]; // ABC -> XYZ transform matrix
+};
+
+//------------------------------------------------------------------------
+// GfxDeviceCMYKColorSpace
+//------------------------------------------------------------------------
+
+class GfxDeviceCMYKColorSpace: public GfxColorSpace {
+public:
+
+ GfxDeviceCMYKColorSpace();
+ virtual ~GfxDeviceCMYKColorSpace();
+ virtual GfxColorSpace *copy();
+ virtual GfxColorSpaceMode getMode() { return csDeviceCMYK; }
+
+ virtual void getGray(GfxColor *color, double *gray);
+ virtual void getRGB(GfxColor *color, GfxRGB *rgb);
+ virtual void getCMYK(GfxColor *color, GfxCMYK *cmyk);
+
+ virtual int getNComps() { return 4; }
+
+private:
+};
+
+//------------------------------------------------------------------------
+// GfxLabColorSpace
+//------------------------------------------------------------------------
+
+class GfxLabColorSpace: public GfxColorSpace {
+public:
+
+ GfxLabColorSpace();
+ virtual ~GfxLabColorSpace();
+ virtual GfxColorSpace *copy();
+ virtual GfxColorSpaceMode getMode() { return csLab; }
+
+ // Construct a Lab color space. Returns NULL if unsuccessful.
+ static GfxColorSpace *parse(Array *arr);
+
+ virtual void getGray(GfxColor *color, double *gray);
+ virtual void getRGB(GfxColor *color, GfxRGB *rgb);
+ virtual void getCMYK(GfxColor *color, GfxCMYK *cmyk);
+
+ virtual int getNComps() { return 3; }
+
+ virtual void getDefaultRanges(double *decodeLow, double *decodeRange,
+ int maxImgPixel);
+
+ // Lab-specific access.
+ double getWhiteX() { return whiteX; }
+ double getWhiteY() { return whiteY; }
+ double getWhiteZ() { return whiteZ; }
+ double getBlackX() { return blackX; }
+ double getBlackY() { return blackY; }
+ double getBlackZ() { return blackZ; }
+ double getAMin() { return aMin; }
+ double getAMax() { return aMax; }
+ double getBMin() { return bMin; }
+ double getBMax() { return bMax; }
+
+private:
+
+ double whiteX, whiteY, whiteZ; // white point
+ double blackX, blackY, blackZ; // black point
+ double aMin, aMax, bMin, bMax; // range for the a and b components
+ double kr, kg, kb; // gamut mapping mulitpliers
+};
+
+//------------------------------------------------------------------------
+// GfxICCBasedColorSpace
+//------------------------------------------------------------------------
+
+class GfxICCBasedColorSpace: public GfxColorSpace {
+public:
+
+ GfxICCBasedColorSpace(int nComps, GfxColorSpace *alt,
+ Ref *iccProfileStream);
+ virtual ~GfxICCBasedColorSpace();
+ virtual GfxColorSpace *copy();
+ virtual GfxColorSpaceMode getMode() { return csICCBased; }
+
+ // Construct an ICCBased color space. Returns NULL if unsuccessful.
+ static GfxColorSpace *parse(Array *arr);
+
+ virtual void getGray(GfxColor *color, double *gray);
+ virtual void getRGB(GfxColor *color, GfxRGB *rgb);
+ virtual void getCMYK(GfxColor *color, GfxCMYK *cmyk);
+
+ virtual int getNComps() { return nComps; }
+
+ virtual void getDefaultRanges(double *decodeLow, double *decodeRange,
+ int maxImgPixel);
+
+ // ICCBased-specific access.
+ GfxColorSpace *getAlt() { return alt; }
+
+private:
+
+ int nComps; // number of color components (1, 3, or 4)
+ GfxColorSpace *alt; // alternate color space
+ double rangeMin[4]; // min values for each component
+ double rangeMax[4]; // max values for each component
+ Ref iccProfileStream; // the ICC profile
+};
+
+//------------------------------------------------------------------------
+// GfxIndexedColorSpace
+//------------------------------------------------------------------------
+
+class GfxIndexedColorSpace: public GfxColorSpace {
+public:
+
+ GfxIndexedColorSpace(GfxColorSpace *base, int indexHigh);
+ virtual ~GfxIndexedColorSpace();
+ virtual GfxColorSpace *copy();
+ virtual GfxColorSpaceMode getMode() { return csIndexed; }
+
+ // Construct a Lab color space. Returns NULL if unsuccessful.
+ static GfxColorSpace *parse(Array *arr);
+
+ virtual void getGray(GfxColor *color, double *gray);
+ virtual void getRGB(GfxColor *color, GfxRGB *rgb);
+ virtual void getCMYK(GfxColor *color, GfxCMYK *cmyk);
+
+ virtual int getNComps() { return 1; }
+
+ virtual void getDefaultRanges(double *decodeLow, double *decodeRange,
+ int maxImgPixel);
+
+ // Indexed-specific access.
+ GfxColorSpace *getBase() { return base; }
+ int getIndexHigh() { return indexHigh; }
+ Guchar *getLookup() { return lookup; }
+
+private:
+
+ GfxColorSpace *base; // base color space
+ int indexHigh; // max pixel value
+ Guchar *lookup; // lookup table
+};
+
+//------------------------------------------------------------------------
+// GfxSeparationColorSpace
+//------------------------------------------------------------------------
+
+class GfxSeparationColorSpace: public GfxColorSpace {
+public:
+
+ GfxSeparationColorSpace(GString *name, GfxColorSpace *alt,
+ Function *func);
+ virtual ~GfxSeparationColorSpace();
+ virtual GfxColorSpace *copy();
+ virtual GfxColorSpaceMode getMode() { return csSeparation; }
+
+ // Construct a Separation color space. Returns NULL if unsuccessful.
+ static GfxColorSpace *parse(Array *arr);
+
+ virtual void getGray(GfxColor *color, double *gray);
+ virtual void getRGB(GfxColor *color, GfxRGB *rgb);
+ virtual void getCMYK(GfxColor *color, GfxCMYK *cmyk);
+
+ virtual int getNComps() { return 1; }
+
+ // Separation-specific access.
+ GString *getName() { return name; }
+ GfxColorSpace *getAlt() { return alt; }
+ Function *getFunc() { return func; }
+
+private:
+
+ GString *name; // colorant name
+ GfxColorSpace *alt; // alternate color space
+ Function *func; // tint transform (into alternate color space)
+};
+
+//------------------------------------------------------------------------
+// GfxDeviceNColorSpace
+//------------------------------------------------------------------------
+
+class GfxDeviceNColorSpace: public GfxColorSpace {
+public:
+
+ GfxDeviceNColorSpace(int nComps, GfxColorSpace *alt, Function *func);
+ virtual ~GfxDeviceNColorSpace();
+ virtual GfxColorSpace *copy();
+ virtual GfxColorSpaceMode getMode() { return csDeviceN; }
+
+ // Construct a DeviceN color space. Returns NULL if unsuccessful.
+ static GfxColorSpace *parse(Array *arr);
+
+ virtual void getGray(GfxColor *color, double *gray);
+ virtual void getRGB(GfxColor *color, GfxRGB *rgb);
+ virtual void getCMYK(GfxColor *color, GfxCMYK *cmyk);
+
+ virtual int getNComps() { return nComps; }
+
+ // DeviceN-specific access.
+ GfxColorSpace *getAlt() { return alt; }
+
+private:
+
+ int nComps; // number of components
+ GString // colorant names
+ *names[gfxColorMaxComps];
+ GfxColorSpace *alt; // alternate color space
+ Function *func; // tint transform (into alternate color space)
+
+};
+
+//------------------------------------------------------------------------
+// GfxPatternColorSpace
+//------------------------------------------------------------------------
+
+class GfxPatternColorSpace: public GfxColorSpace {
+public:
+
+ GfxPatternColorSpace(GfxColorSpace *under);
+ virtual ~GfxPatternColorSpace();
+ virtual GfxColorSpace *copy();
+ virtual GfxColorSpaceMode getMode() { return csPattern; }
+
+ // Construct a Pattern color space. Returns NULL if unsuccessful.
+ static GfxColorSpace *parse(Array *arr);
+
+ virtual void getGray(GfxColor *color, double *gray);
+ virtual void getRGB(GfxColor *color, GfxRGB *rgb);
+ virtual void getCMYK(GfxColor *color, GfxCMYK *cmyk);
+
+ virtual int getNComps() { return 0; }
+
+ // Pattern-specific access.
+ GfxColorSpace *getUnder() { return under; }
+
+private:
+
+ GfxColorSpace *under; // underlying color space (for uncolored
+ // patterns)
+};
+
+//------------------------------------------------------------------------
+// GfxPattern
+//------------------------------------------------------------------------
+
+class GfxPattern {
+public:
+
+ GfxPattern(int type);
+ virtual ~GfxPattern();
+
+ static GfxPattern *parse(Object *obj);
+
+ virtual GfxPattern *copy() = 0;
+
+ int getType() { return type; }
+
+private:
+
+ int type;
+};
+
+//------------------------------------------------------------------------
+// GfxTilingPattern
+//------------------------------------------------------------------------
+
+class GfxTilingPattern: public GfxPattern {
+public:
+
+ GfxTilingPattern(Dict *streamDict, Object *stream);
+ virtual ~GfxTilingPattern();
+
+ virtual GfxPattern *copy();
+
+ int getPaintType() { return paintType; }
+ int getTilingType() { return tilingType; }
+ double *getBBox() { return bbox; }
+ double getXStep() { return xStep; }
+ double getYStep() { return yStep; }
+ Dict *getResDict()
+ { return resDict.isDict() ? resDict.getDict() : (Dict *)NULL; }
+ double *getMatrix() { return matrix; }
+ Object *getContentStream() { return &contentStream; }
+
+private:
+
+ GfxTilingPattern(GfxTilingPattern *pat);
+
+ int paintType;
+ int tilingType;
+ double bbox[4];
+ double xStep, yStep;
+ Object resDict;
+ double matrix[6];
+ Object contentStream;
+};
+
+//------------------------------------------------------------------------
+// Function
+//------------------------------------------------------------------------
+
+#define funcMaxInputs 1
+#define funcMaxOutputs 8
+
+class Function {
+public:
+
+ Function();
+
+ virtual ~Function();
+
+ // Construct a function. Returns NULL if unsuccessful.
+ static Function *parse(Object *funcObj);
+
+ // Initialize the entries common to all function types.
+ GBool init(Dict *dict);
+
+ virtual Function *copy() = 0;
+
+ // Return size of input and output tuples.
+ int getInputSize() { return m; }
+ int getOutputSize() { return n; }
+
+ // Transform an input tuple into an output tuple.
+ virtual void transform(double *in, double *out) = 0;
+
+ virtual GBool isOk() = 0;
+
+protected:
+
+ int m, n; // size of input and output tuples
+ double // min and max values for function domain
+ domain[funcMaxInputs][2];
+ double // min and max values for function range
+ range[funcMaxOutputs][2];
+ GBool hasRange; // set if range is defined
+};
+
+//------------------------------------------------------------------------
+// SampledFunction
+//------------------------------------------------------------------------
+
+class SampledFunction: public Function {
+public:
+
+ SampledFunction(Object *funcObj, Dict *dict);
+ virtual ~SampledFunction();
+ virtual Function *copy() { return new SampledFunction(this); }
+ virtual void transform(double *in, double *out);
+ virtual GBool isOk() { return ok; }
+
+private:
+
+ SampledFunction(SampledFunction *func);
+
+ int // number of samples for each domain element
+ sampleSize[funcMaxInputs];
+ double // min and max values for domain encoder
+ encode[funcMaxInputs][2];
+ double // min and max values for range decoder
+ decode[funcMaxOutputs][2];
+ double *samples; // the samples
+ GBool ok;
+};
+
+//------------------------------------------------------------------------
+// ExponentialFunction
+//------------------------------------------------------------------------
+
+class ExponentialFunction: public Function {
+public:
+
+ ExponentialFunction(Object *funcObj, Dict *dict);
+ virtual ~ExponentialFunction();
+ virtual Function *copy() { return new ExponentialFunction(this); }
+ virtual void transform(double *in, double *out);
+ virtual GBool isOk() { return ok; }
+
+private:
+
+ ExponentialFunction(ExponentialFunction *func);
+
+ double c0[funcMaxOutputs];
+ double c1[funcMaxOutputs];
+ double e;
+ GBool ok;
+};
+
+//------------------------------------------------------------------------
+// GfxImageColorMap
+//------------------------------------------------------------------------
+
+class GfxImageColorMap {
+public:
+
+ // Constructor.
+ GfxImageColorMap(int bits, Object *decode, GfxColorSpace *colorSpace);
+
+ // Destructor.
+ ~GfxImageColorMap();
+
+ // Is color map valid?
+ GBool isOk() { return ok; }
+
+ // Get the color space.
+ GfxColorSpace *getColorSpace() { return colorSpace; }
+
+ // Get stream decoding info.
+ int getNumPixelComps() { return nComps; }
+ int getBits() { return bits; }
+
+ // Get decode table.
+ double getDecodeLow(int i) { return decodeLow[i]; }
+ double getDecodeHigh(int i) { return decodeLow[i] + decodeRange[i]; }
+
+ // Convert an image pixel to a color.
+ void getGray(Guchar *x, double *gray);
+ void getRGB(Guchar *x, GfxRGB *rgb);
+ void getCMYK(Guchar *x, GfxCMYK *cmyk);
+
+private:
+
+ GfxColorSpace *colorSpace; // the image color space
+ int bits; // bits per component
+ int nComps; // number of components in a pixel
+ GfxColorSpace *colorSpace2; // secondary color space
+ int nComps2; // number of components in colorSpace2
+ double *lookup; // lookup table
+ double // minimum values for each component
+ decodeLow[gfxColorMaxComps];
+ double // max - min value for each component
+ decodeRange[gfxColorMaxComps];
+ GBool ok;
+};
+
+//------------------------------------------------------------------------
+// GfxSubpath and GfxPath
+//------------------------------------------------------------------------
+
+class GfxSubpath {
+public:
+
+ // Constructor.
+ GfxSubpath(double x1, double y1);
+
+ // Destructor.
+ ~GfxSubpath();
+
+ // Copy.
+ GfxSubpath *copy() { return new GfxSubpath(this); }
+
+ // Get points.
+ int getNumPoints() { return n; }
+ double getX(int i) { return x[i]; }
+ double getY(int i) { return y[i]; }
+ GBool getCurve(int i) { return curve[i]; }
+
+ // Get last point.
+ double getLastX() { return x[n-1]; }
+ double getLastY() { return y[n-1]; }
+
+ // Add a line segment.
+ void lineTo(double x1, double y1);
+
+ // Add a Bezier curve.
+ void curveTo(double x1, double y1, double x2, double y2,
+ double x3, double y3);
+
+ // Close the subpath.
+ void close();
+ GBool isClosed() { return closed; }
+
+private:
+
+ double *x, *y; // points
+ GBool *curve; // curve[i] => point i is a control point
+ // for a Bezier curve
+ int n; // number of points
+ int size; // size of x/y arrays
+ GBool closed; // set if path is closed
+
+ GfxSubpath(GfxSubpath *subpath);
+};
+
+class GfxPath {
+public:
+
+ // Constructor.
+ GfxPath();
+
+ // Destructor.
+ ~GfxPath();
+
+ // Copy.
+ GfxPath *copy()
+ { return new GfxPath(justMoved, firstX, firstY, subpaths, n, size); }
+
+ // Is there a current point?
+ GBool isCurPt() { return n > 0 || justMoved; }
+
+ // Is the path non-empty, i.e., is there at least one segment?
+ GBool isPath() { return n > 0; }
+
+ // Get subpaths.
+ int getNumSubpaths() { return n; }
+ GfxSubpath *getSubpath(int i) { return subpaths[i]; }
+
+ // Get last point on last subpath.
+ double getLastX() { return subpaths[n-1]->getLastX(); }
+ double getLastY() { return subpaths[n-1]->getLastY(); }
+
+ // Move the current point.
+ void moveTo(double x, double y);
+
+ // Add a segment to the last subpath.
+ void lineTo(double x, double y);
+
+ // Add a Bezier curve to the last subpath
+ void curveTo(double x1, double y1, double x2, double y2,
+ double x3, double y3);
+
+ // Close the last subpath.
+ void close() { subpaths[n-1]->close(); }
+
+private:
+
+ GBool justMoved; // set if a new subpath was just started
+ double firstX, firstY; // first point in new subpath
+ GfxSubpath **subpaths; // subpaths
+ int n; // number of subpaths
+ int size; // size of subpaths array
+
+ GfxPath(GBool justMoved1, double firstX1, double firstY1,
+ GfxSubpath **subpaths1, int n1, int size1);
+};
+
+//------------------------------------------------------------------------
+// GfxState
+//------------------------------------------------------------------------
+
+class GfxState {
+public:
+
+ // Construct a default GfxState, for a device with resolution <dpi>,
+ // page box (<x1>,<y1>)-(<x2>,<y2>), page rotation <rotate>, and
+ // coordinate system specified by <upsideDown>.
+ GfxState(double dpi, double px1a, double py1a,
+ double px2a, double py2a, int rotate, GBool upsideDown);
+
+ // Destructor.
+ ~GfxState();
+
+ // Copy.
+ GfxState *copy() { return new GfxState(this); }
+
+ // Accessors.
+ double *getCTM() { return ctm; }
+ double getX1() { return px1; }
+ double getY1() { return py1; }
+ double getX2() { return px2; }
+ double getY2() { return py2; }
+ double getPageWidth() { return pageWidth; }
+ double getPageHeight() { return pageHeight; }
+ GfxColor *getFillColor() { return &fillColor; }
+ GfxColor *getStrokeColor() { return &strokeColor; }
+ void getFillRGB(GfxRGB *rgb)
+ { fillColorSpace->getRGB(&fillColor, rgb); }
+ void getStrokeRGB(GfxRGB *rgb)
+ { strokeColorSpace->getRGB(&strokeColor, rgb); }
+ void getFillCMYK(GfxCMYK *cmyk)
+ { fillColorSpace->getCMYK(&fillColor, cmyk); }
+ void getStrokeCMYK(GfxCMYK *cmyk)
+ { strokeColorSpace->getCMYK(&strokeColor, cmyk); }
+ GfxColorSpace *getFillColorSpace() { return fillColorSpace; }
+ GfxColorSpace *getStrokeColorSpace() { return strokeColorSpace; }
+ GfxPattern *getFillPattern() { return fillPattern; }
+ GfxPattern *getStrokePattern() { return strokePattern; }
+ double getFillOpacity() { return fillOpacity; }
+ double getStrokeOpacity() { return strokeOpacity; }
+ double getLineWidth() { return lineWidth; }
+ void getLineDash(double **dash, int *length, double *start)
+ { *dash = lineDash; *length = lineDashLength; *start = lineDashStart; }
+ int getFlatness() { return flatness; }
+ int getLineJoin() { return lineJoin; }
+ int getLineCap() { return lineCap; }
+ double getMiterLimit() { return miterLimit; }
+ GfxFont *getFont() { return font; }
+ double getFontSize() { return fontSize; }
+ double *getTextMat() { return textMat; }
+ double getCharSpace() { return charSpace; }
+ double getWordSpace() { return wordSpace; }
+ double getHorizScaling() { return horizScaling; }
+ double getLeading() { return leading; }
+ double getRise() { return rise; }
+ int getRender() { return render; }
+ GfxPath *getPath() { return path; }
+ double getCurX() { return curX; }
+ double getCurY() { return curY; }
+ double getLineX() { return lineX; }
+ double getLineY() { return lineY; }
+
+ // Is there a current point/path?
+ GBool isCurPt() { return path->isCurPt(); }
+ GBool isPath() { return path->isPath(); }
+
+ // Transforms.
+ void transform(double x1, double y1, double *x2, double *y2)
+ { *x2 = ctm[0] * x1 + ctm[2] * y1 + ctm[4];
+ *y2 = ctm[1] * x1 + ctm[3] * y1 + ctm[5]; }
+ void transformDelta(double x1, double y1, double *x2, double *y2)
+ { *x2 = ctm[0] * x1 + ctm[2] * y1;
+ *y2 = ctm[1] * x1 + ctm[3] * y1; }
+ void textTransform(double x1, double y1, double *x2, double *y2)
+ { *x2 = textMat[0] * x1 + textMat[2] * y1 + textMat[4];
+ *y2 = textMat[1] * x1 + textMat[3] * y1 + textMat[5]; }
+ void textTransformDelta(double x1, double y1, double *x2, double *y2)
+ { *x2 = textMat[0] * x1 + textMat[2] * y1;
+ *y2 = textMat[1] * x1 + textMat[3] * y1; }
+ double transformWidth(double w);
+ double getTransformedLineWidth()
+ { return transformWidth(lineWidth); }
+ double getTransformedFontSize();
+ void getFontTransMat(double *m11, double *m12, double *m21, double *m22);
+
+ // Change state parameters.
+ void setCTM(double a, double b, double c,
+ double d, double e, double f);
+ void concatCTM(double a, double b, double c,
+ double d, double e, double f);
+ void setFillColorSpace(GfxColorSpace *colorSpace);
+ void setStrokeColorSpace(GfxColorSpace *colorSpace);
+ void setFillColor(GfxColor *color) { fillColor = *color; }
+ void setStrokeColor(GfxColor *color) { strokeColor = *color; }
+ void setFillPattern(GfxPattern *pattern);
+ void setStrokePattern(GfxPattern *pattern);
+ void setFillOpacity(double opac) { fillOpacity = opac; }
+ void setStrokeOpacity(double opac) { strokeOpacity = opac; }
+ void setLineWidth(double width) { lineWidth = width; }
+ void setLineDash(double *dash, int length, double start);
+ void setFlatness(int flatness1) { flatness = flatness1; }
+ void setLineJoin(int lineJoin1) { lineJoin = lineJoin1; }
+ void setLineCap(int lineCap1) { lineCap = lineCap1; }
+ void setMiterLimit(double miterLimit1) { miterLimit = miterLimit1; }
+ void setFont(GfxFont *font1, double fontSize1)
+ { font = font1; fontSize = fontSize1; }
+ void setTextMat(double a, double b, double c,
+ double d, double e, double f)
+ { textMat[0] = a; textMat[1] = b; textMat[2] = c;
+ textMat[3] = d; textMat[4] = e; textMat[5] = f; }
+ void setCharSpace(double space)
+ { charSpace = space; }
+ void setWordSpace(double space)
+ { wordSpace = space; }
+ void setHorizScaling(double scale)
+ { horizScaling = 0.01 * scale; }
+ void setLeading(double leading1)
+ { leading = leading1; }
+ void setRise(double rise1)
+ { rise = rise1; }
+ void setRender(int render1)
+ { render = render1; }
+
+ // Add to path.
+ void moveTo(double x, double y)
+ { path->moveTo(curX = x, curY = y); }
+ void lineTo(double x, double y)
+ { path->lineTo(curX = x, curY = y); }
+ void curveTo(double x1, double y1, double x2, double y2,
+ double x3, double y3)
+ { path->curveTo(x1, y1, x2, y2, curX = x3, curY = y3); }
+ void closePath()
+ { path->close(); curX = path->getLastX(); curY = path->getLastY(); }
+ void clearPath();
+
+ // Text position.
+ void textMoveTo(double tx, double ty)
+ { lineX = tx; lineY = ty; textTransform(tx, ty, &curX, &curY); }
+ void textShift(double tx);
+ void textShift(double tx, double ty);
+
+ // Push/pop GfxState on/off stack.
+ GfxState *save();
+ GfxState *restore();
+ GBool hasSaves() { return saved != NULL; }
+
+private:
+
+ double ctm[6]; // coord transform matrix
+ double px1, py1, px2, py2; // page corners (user coords)
+ double pageWidth, pageHeight; // page size (pixels)
+
+ GfxColorSpace *fillColorSpace; // fill color space
+ GfxColorSpace *strokeColorSpace; // stroke color space
+ GfxColor fillColor; // fill color
+ GfxColor strokeColor; // stroke color
+ GfxPattern *fillPattern; // fill pattern
+ GfxPattern *strokePattern; // stroke pattern
+ double fillOpacity; // fill opacity
+ double strokeOpacity; // stroke opacity
+
+ double lineWidth; // line width
+ double *lineDash; // line dash
+ int lineDashLength;
+ double lineDashStart;
+ int flatness; // curve flatness
+ int lineJoin; // line join style
+ int lineCap; // line cap style
+ double miterLimit; // line miter limit
+
+ GfxFont *font; // font
+ double fontSize; // font size
+ double textMat[6]; // text matrix
+ double charSpace; // character spacing
+ double wordSpace; // word spacing
+ double horizScaling; // horizontal scaling
+ double leading; // text leading
+ double rise; // text rise
+ int render; // text rendering mode
+
+ GfxPath *path; // array of path elements
+ double curX, curY; // current point (user coords)
+ double lineX, lineY; // start of current text line (text coords)
+
+ GfxState *saved; // next GfxState on stack
+
+ GfxState(GfxState *state);
+};
+
+#endif
diff --git a/pdf2swf/xpdf/Lexer.cc b/pdf2swf/xpdf/Lexer.cc
new file mode 100644
index 00000000..4ca8cfe9
--- /dev/null
+++ b/pdf2swf/xpdf/Lexer.cc
@@ -0,0 +1,468 @@
+//========================================================================
+//
+// Lexer.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <ctype.h>
+#include "Lexer.h"
+#include "Error.h"
+
+//------------------------------------------------------------------------
+
+// A '1' in this array means the character is white space. A '1' or
+// '2' means the character ends a name or command.
+static char specialChars[256] = {
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, // 0x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x
+ 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, // 2x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, // 3x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 5x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 7x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ax
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // bx
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // cx
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // dx
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ex
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fx
+};
+
+//------------------------------------------------------------------------
+// Lexer
+//------------------------------------------------------------------------
+
+Lexer::Lexer(Stream *str) {
+ Object obj;
+
+ curStr.initStream(str);
+ streams = new Array();
+ streams->add(curStr.copy(&obj));
+ strPtr = 0;
+ freeArray = gTrue;
+ curStr.streamReset();
+}
+
+Lexer::Lexer(Object *obj) {
+ Object obj2;
+
+ if (obj->isStream()) {
+ streams = new Array();
+ freeArray = gTrue;
+ streams->add(obj->copy(&obj2));
+ } else {
+ streams = obj->getArray();
+ freeArray = gFalse;
+ }
+ strPtr = 0;
+ if (streams->getLength() > 0) {
+ streams->get(strPtr, &curStr);
+ curStr.streamReset();
+ }
+}
+
+Lexer::~Lexer() {
+ if (!curStr.isNone()) {
+ curStr.streamClose();
+ curStr.free();
+ }
+ if (freeArray) {
+ delete streams;
+ }
+}
+
+int Lexer::getChar() {
+ int c;
+
+ c = EOF;
+ while (!curStr.isNone() && (c = curStr.streamGetChar()) == EOF) {
+ curStr.streamClose();
+ curStr.free();
+ ++strPtr;
+ if (strPtr < streams->getLength()) {
+ streams->get(strPtr, &curStr);
+ curStr.streamReset();
+ }
+ }
+ return c;
+}
+
+int Lexer::lookChar() {
+ if (curStr.isNone()) {
+ return EOF;
+ }
+ return curStr.streamLookChar();
+}
+
+Object *Lexer::getObj(Object *obj) {
+ char *p;
+ int c, c2;
+ GBool comment, neg, done;
+ int numParen;
+ int xi;
+ double xf, scale;
+ GString *s;
+ int n, m;
+
+ // skip whitespace and comments
+ comment = gFalse;
+ while (1) {
+ if ((c = getChar()) == EOF) {
+ return obj->initEOF();
+ }
+ if (comment) {
+ if (c == '\r' || c == '\n')
+ comment = gFalse;
+ } else if (c == '%') {
+ comment = gTrue;
+ } else if (specialChars[c] != 1) {
+ break;
+ }
+ }
+
+ // start reading token
+ switch (c) {
+
+ // number
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ case '-': case '.':
+ neg = gFalse;
+ xi = 0;
+ if (c == '-') {
+ neg = gTrue;
+ } else if (c == '.') {
+ goto doReal;
+ } else {
+ xi = c - '0';
+ }
+ while (1) {
+ c = lookChar();
+ if (isdigit(c)) {
+ getChar();
+ xi = xi * 10 + (c - '0');
+ } else if (c == '.') {
+ getChar();
+ goto doReal;
+ } else {
+ break;
+ }
+ }
+ if (neg)
+ xi = -xi;
+ obj->initInt(xi);
+ break;
+ doReal:
+ xf = xi;
+ scale = 0.1;
+ while (1) {
+ c = lookChar();
+ if (!isdigit(c)) {
+ break;
+ }
+ getChar();
+ xf = xf + scale * (c - '0');
+ scale *= 0.1;
+ }
+ if (neg)
+ xf = -xf;
+ obj->initReal(xf);
+ break;
+
+ // string
+ case '(':
+ p = tokBuf;
+ n = 0;
+ numParen = 1;
+ done = gFalse;
+ s = NULL;
+ do {
+ c2 = EOF;
+ switch (c = getChar()) {
+
+ case EOF:
+#if 0
+ // This breaks some PDF files, e.g., ones from Photoshop.
+ case '\r':
+ case '\n':
+#endif
+ error(getPos(), "Unterminated string");
+ done = gTrue;
+ break;
+
+ case '(':
+ ++numParen;
+ break;
+
+ case ')':
+ if (--numParen == 0)
+ done = gTrue;
+ break;
+
+ case '\\':
+ switch (c = getChar()) {
+ case 'n':
+ c2 = '\n';
+ break;
+ case 'r':
+ c2 = '\r';
+ break;
+ case 't':
+ c2 = '\t';
+ break;
+ case 'b':
+ c2 = '\b';
+ break;
+ case 'f':
+ c2 = '\f';
+ break;
+ case '\\':
+ case '(':
+ case ')':
+ c2 = c;
+ break;
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ c2 = c - '0';
+ c = lookChar();
+ if (c >= '0' && c <= '7') {
+ getChar();
+ c2 = (c2 << 3) + (c - '0');
+ c = lookChar();
+ if (c >= '0' && c <= '7') {
+ getChar();
+ c2 = (c2 << 3) + (c - '0');
+ }
+ }
+ break;
+ case '\r':
+ c = lookChar();
+ if (c == '\n') {
+ getChar();
+ }
+ break;
+ case '\n':
+ break;
+ case EOF:
+ error(getPos(), "Unterminated string");
+ done = gTrue;
+ break;
+ default:
+ c2 = c;
+ break;
+ }
+ break;
+
+ default:
+ c2 = c;
+ break;
+ }
+
+ if (c2 != EOF) {
+ if (n == tokBufSize) {
+ if (!s)
+ s = new GString(tokBuf, tokBufSize);
+ else
+ s->append(tokBuf, tokBufSize);
+ p = tokBuf;
+ n = 0;
+ }
+ *p++ = (char)c2;
+ ++n;
+ }
+ } while (!done);
+ if (!s)
+ s = new GString(tokBuf, n);
+ else
+ s->append(tokBuf, n);
+ obj->initString(s);
+ break;
+
+ // name
+ case '/':
+ p = tokBuf;
+ n = 0;
+ while ((c = lookChar()) != EOF && !specialChars[c]) {
+ getChar();
+ if (c == '#') {
+ c2 = lookChar();
+ if (c2 >= '0' && c2 <= '9') {
+ c = c2 - '0';
+ } else if (c2 >= 'A' && c2 <= 'F') {
+ c = c2 - 'A' + 10;
+ } else if (c2 >= 'a' && c2 <= 'f') {
+ c = c2 - 'a' + 10;
+ } else {
+ goto notEscChar;
+ }
+ getChar();
+ c <<= 4;
+ c2 = getChar();
+ if (c2 >= '0' && c2 <= '9') {
+ c += c2 - '0';
+ } else if (c2 >= 'A' && c2 <= 'F') {
+ c += c2 - 'A' + 10;
+ } else if (c2 >= 'a' && c2 <= 'f') {
+ c += c2 - 'a' + 10;
+ } else {
+ error(getPos(), "Illegal digit in hex char in name");
+ }
+ }
+ notEscChar:
+ if (++n == tokBufSize) {
+ error(getPos(), "Name token too long");
+ break;
+ }
+ *p++ = c;
+ }
+ *p = '\0';
+ obj->initName(tokBuf);
+ break;
+
+ // array punctuation
+ case '[':
+ case ']':
+ tokBuf[0] = c;
+ tokBuf[1] = '\0';
+ obj->initCmd(tokBuf);
+ break;
+
+ // hex string or dict punctuation
+ case '<':
+ c = lookChar();
+
+ // dict punctuation
+ if (c == '<') {
+ getChar();
+ tokBuf[0] = tokBuf[1] = '<';
+ tokBuf[2] = '\0';
+ obj->initCmd(tokBuf);
+
+ // hex string
+ } else {
+ p = tokBuf;
+ m = n = 0;
+ c2 = 0;
+ s = NULL;
+ while (1) {
+ c = getChar();
+ if (c == '>') {
+ break;
+ } else if (c == EOF) {
+ error(getPos(), "Unterminated hex string");
+ break;
+ } else if (specialChars[c] != 1) {
+ c2 = c2 << 4;
+ if (c >= '0' && c <= '9')
+ c2 += c - '0';
+ else if (c >= 'A' && c <= 'F')
+ c2 += c - 'A' + 10;
+ else if (c >= 'a' && c <= 'f')
+ c2 += c - 'a' + 10;
+ else
+ error(getPos(), "Illegal character <%02x> in hex string", c);
+ if (++m == 2) {
+ if (n == tokBufSize) {
+ if (!s)
+ s = new GString(tokBuf, tokBufSize);
+ else
+ s->append(tokBuf, tokBufSize);
+ p = tokBuf;
+ n = 0;
+ }
+ *p++ = (char)c2;
+ ++n;
+ c2 = 0;
+ m = 0;
+ }
+ }
+ }
+ if (!s)
+ s = new GString(tokBuf, n);
+ else
+ s->append(tokBuf, n);
+ if (m == 1)
+ s->append((char)(c2 << 4));
+ obj->initString(s);
+ }
+ break;
+
+ // dict punctuation
+ case '>':
+ c = lookChar();
+ if (c == '>') {
+ getChar();
+ tokBuf[0] = tokBuf[1] = '>';
+ tokBuf[2] = '\0';
+ obj->initCmd(tokBuf);
+ } else {
+ error(getPos(), "Illegal character '>'");
+ obj->initError();
+ }
+ break;
+
+ // error
+ case ')':
+ case '{':
+ case '}':
+ error(getPos(), "Illegal character '%c'", c);
+ obj->initError();
+ break;
+
+ // command
+ default:
+ p = tokBuf;
+ *p++ = c;
+ n = 1;
+ while ((c = lookChar()) != EOF && !specialChars[c]) {
+ getChar();
+ if (++n == tokBufSize) {
+ error(getPos(), "Command token too long");
+ break;
+ }
+ *p++ = c;
+ }
+ *p = '\0';
+ if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) {
+ obj->initBool(gTrue);
+ } else if (tokBuf[0] == 'f' && !strcmp(tokBuf, "false")) {
+ obj->initBool(gFalse);
+ } else if (tokBuf[0] == 'n' && !strcmp(tokBuf, "null")) {
+ obj->initNull();
+ } else {
+ obj->initCmd(tokBuf);
+ }
+ break;
+ }
+
+ return obj;
+}
+
+void Lexer::skipToNextLine() {
+ int c;
+
+ while (1) {
+ c = getChar();
+ if (c == EOF || c == '\n') {
+ return;
+ }
+ if (c == '\r') {
+ if ((c = lookChar()) == '\n') {
+ getChar();
+ }
+ return;
+ }
+ }
+}
diff --git a/pdf2swf/xpdf/Lexer.h b/pdf2swf/xpdf/Lexer.h
new file mode 100644
index 00000000..70144b86
--- /dev/null
+++ b/pdf2swf/xpdf/Lexer.h
@@ -0,0 +1,72 @@
+//========================================================================
+//
+// Lexer.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef LEXER_H
+#define LEXER_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "Object.h"
+#include "Stream.h"
+
+#define tokBufSize 128 // size of token buffer
+
+//------------------------------------------------------------------------
+// Lexer
+//------------------------------------------------------------------------
+
+class Lexer {
+public:
+
+ // Construct a lexer for a single stream. Deletes the stream when
+ // lexer is deleted.
+ Lexer(Stream *str);
+
+ // Construct a lexer for a stream or array of streams (assumes obj
+ // is either a stream or array of streams).
+ Lexer(Object *obj);
+
+ // Destructor.
+ ~Lexer();
+
+ // Get the next object from the input stream.
+ Object *getObj(Object *obj);
+
+ // Skip to the beginning of the next line in the input stream.
+ void skipToNextLine();
+
+ // Skip over one character.
+ void skipChar() { getChar(); }
+
+ // Get stream.
+ Stream *getStream()
+ { return curStr.isNone() ? (Stream *)NULL : curStr.getStream(); }
+
+ // Get current position in file.
+ int getPos()
+ { return curStr.isNone() ? -1 : curStr.streamGetPos(); }
+
+ // Set position in file.
+ void setPos(int pos)
+ { if (!curStr.isNone()) curStr.streamSetPos(pos); }
+
+private:
+
+ int getChar();
+ int lookChar();
+
+ Array *streams; // array of input streams
+ int strPtr; // index of current stream
+ Object curStr; // current stream
+ GBool freeArray; // should lexer free the streams array?
+ char tokBuf[tokBufSize]; // temporary token buffer
+};
+
+#endif
diff --git a/pdf2swf/xpdf/Link.cc b/pdf2swf/xpdf/Link.cc
new file mode 100644
index 00000000..adb8c97f
--- /dev/null
+++ b/pdf2swf/xpdf/Link.cc
@@ -0,0 +1,630 @@
+//========================================================================
+//
+// Link.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include <string.h>
+#include "gmem.h"
+#include "GString.h"
+#include "Error.h"
+#include "Object.h"
+#include "Array.h"
+#include "Dict.h"
+#include "Link.h"
+
+//------------------------------------------------------------------------
+
+static GString *getFileSpecName(Object *fileSpecObj);
+
+//------------------------------------------------------------------------
+// LinkDest
+//------------------------------------------------------------------------
+
+LinkDest::LinkDest(Array *a, GBool pageIsRef1) {
+ Object obj1, obj2;
+
+ // initialize fields
+ pageIsRef = pageIsRef1;
+ left = bottom = right = top = zoom = 0;
+ ok = gFalse;
+
+ // get page
+ if (pageIsRef) {
+ if (!a->getNF(0, &obj1)->isRef()) {
+ error(-1, "Bad annotation destination");
+ goto err2;
+ }
+ pageRef.num = obj1.getRefNum();
+ pageRef.gen = obj1.getRefGen();
+ obj1.free();
+ } else {
+ if (!a->get(0, &obj1)->isInt()) {
+ error(-1, "Bad annotation destination");
+ goto err2;
+ }
+ pageNum = obj1.getInt() + 1;
+ obj1.free();
+ }
+
+ // get destination type
+ a->get(1, &obj1);
+
+ // XYZ link
+ if (obj1.isName("XYZ")) {
+ kind = destXYZ;
+ a->get(2, &obj2);
+ if (obj2.isNull()) {
+ changeLeft = gFalse;
+ } else if (obj2.isNum()) {
+ changeLeft = gTrue;
+ left = obj2.getNum();
+ } else {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ obj2.free();
+ a->get(3, &obj2);
+ if (obj2.isNull()) {
+ changeTop = gFalse;
+ } else if (obj2.isNum()) {
+ changeTop = gTrue;
+ top = obj2.getNum();
+ } else {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ obj2.free();
+ a->get(4, &obj2);
+ if (obj2.isNull()) {
+ changeZoom = gFalse;
+ } else if (obj2.isNum()) {
+ changeZoom = gTrue;
+ zoom = obj2.getNum();
+ } else {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ obj2.free();
+
+ // Fit link
+ } else if (obj1.isName("Fit")) {
+ kind = destFit;
+
+ // FitH link
+ } else if (obj1.isName("FitH")) {
+ kind = destFitH;
+ if (!a->get(2, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ top = obj2.getNum();
+ obj2.free();
+
+ // FitV link
+ } else if (obj1.isName("FitV")) {
+ kind = destFitV;
+ if (!a->get(2, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ left = obj2.getNum();
+ obj2.free();
+
+ // FitR link
+ } else if (obj1.isName("FitR")) {
+ kind = destFitR;
+ if (!a->get(2, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ left = obj2.getNum();
+ obj2.free();
+ if (!a->get(3, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ bottom = obj2.getNum();
+ obj2.free();
+ if (!a->get(4, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ right = obj2.getNum();
+ obj2.free();
+ if (!a->get(5, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ top = obj2.getNum();
+ obj2.free();
+
+ // FitB link
+ } else if (obj1.isName("FitB")) {
+ kind = destFitB;
+
+ // FitBH link
+ } else if (obj1.isName("FitBH")) {
+ kind = destFitBH;
+ if (!a->get(2, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ top = obj2.getNum();
+ obj2.free();
+
+ // FitBV link
+ } else if (obj1.isName("FitBV")) {
+ kind = destFitBV;
+ if (!a->get(2, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ left = obj2.getNum();
+ obj2.free();
+
+ // unknown link kind
+ } else {
+ error(-1, "Unknown annotation destination type");
+ goto err2;
+ }
+
+ obj1.free();
+ ok = gTrue;
+ return;
+
+ err1:
+ obj2.free();
+ err2:
+ obj1.free();
+}
+
+LinkDest::LinkDest(LinkDest *dest) {
+ kind = dest->kind;
+ pageIsRef = dest->pageIsRef;
+ if (pageIsRef)
+ pageRef = dest->pageRef;
+ else
+ pageNum = dest->pageNum;
+ left = dest->left;
+ bottom = dest->bottom;
+ right = dest->right;
+ top = dest->top;
+ zoom = dest->zoom;
+ changeLeft = dest->changeLeft;
+ changeTop = dest->changeTop;
+ changeZoom = dest->changeZoom;
+ ok = gTrue;
+}
+
+//------------------------------------------------------------------------
+// LinkGoTo
+//------------------------------------------------------------------------
+
+LinkGoTo::LinkGoTo(Object *destObj) {
+ dest = NULL;
+ namedDest = NULL;
+
+ // named destination
+ if (destObj->isName()) {
+ namedDest = new GString(destObj->getName());
+ } else if (destObj->isString()) {
+ namedDest = destObj->getString()->copy();
+
+ // destination dictionary
+ } else if (destObj->isArray()) {
+ dest = new LinkDest(destObj->getArray(), gTrue);
+ if (!dest->isOk()) {
+ delete dest;
+ dest = NULL;
+ }
+
+ // error
+ } else {
+ error(-1, "Illegal annotation destination");
+ }
+}
+
+LinkGoTo::~LinkGoTo() {
+ if (dest)
+ delete dest;
+ if (namedDest)
+ delete namedDest;
+}
+
+//------------------------------------------------------------------------
+// LinkGoToR
+//------------------------------------------------------------------------
+
+LinkGoToR::LinkGoToR(Object *fileSpecObj, Object *destObj) {
+ dest = NULL;
+ namedDest = NULL;
+
+ // get file name
+ fileName = getFileSpecName(fileSpecObj);
+
+ // named destination
+ if (destObj->isName()) {
+ namedDest = new GString(destObj->getName());
+ } else if (destObj->isString()) {
+ namedDest = destObj->getString()->copy();
+
+ // destination dictionary
+ } else if (destObj->isArray()) {
+ dest = new LinkDest(destObj->getArray(), gFalse);
+ if (!dest->isOk()) {
+ delete dest;
+ dest = NULL;
+ }
+
+ // error
+ } else {
+ error(-1, "Illegal annotation destination");
+ }
+}
+
+LinkGoToR::~LinkGoToR() {
+ if (fileName)
+ delete fileName;
+ if (dest)
+ delete dest;
+ if (namedDest)
+ delete namedDest;
+}
+
+
+//------------------------------------------------------------------------
+// LinkLaunch
+//------------------------------------------------------------------------
+
+LinkLaunch::LinkLaunch(Object *actionObj) {
+ Object obj1, obj2;
+
+ fileName = NULL;
+ params = NULL;
+
+ if (actionObj->isDict()) {
+ if (!actionObj->dictLookup("F", &obj1)->isNull()) {
+ fileName = getFileSpecName(&obj1);
+ } else {
+ obj1.free();
+ //~ This hasn't been defined by Adobe yet, so assume it looks
+ //~ just like the Win dictionary until they say otherwise.
+ if (actionObj->dictLookup("Unix", &obj1)->isDict()) {
+ obj1.dictLookup("F", &obj2);
+ fileName = getFileSpecName(&obj2);
+ obj2.free();
+ if (obj1.dictLookup("P", &obj2)->isString())
+ params = obj2.getString()->copy();
+ obj2.free();
+ } else {
+ error(-1, "Bad launch-type link action");
+ }
+ }
+ obj1.free();
+ }
+}
+
+LinkLaunch::~LinkLaunch() {
+ if (fileName)
+ delete fileName;
+ if (params)
+ delete params;
+}
+
+//------------------------------------------------------------------------
+// LinkURI
+//------------------------------------------------------------------------
+
+LinkURI::LinkURI(Object *uriObj, GString *baseURI) {
+ GString *uri2;
+ int n;
+ char c;
+
+ uri = NULL;
+ if (uriObj->isString()) {
+ uri2 = uriObj->getString()->copy();
+ if (baseURI) {
+ n = strcspn(uri2->getCString(), "/:");
+ if (n == uri2->getLength() || uri2->getChar(n) == '/') {
+ uri = baseURI->copy();
+ c = uri->getChar(uri->getLength() - 1);
+ if (c == '/' || c == '?') {
+ if (uri2->getChar(0) == '/') {
+ uri2->del(0);
+ }
+ } else {
+ if (uri2->getChar(0) != '/') {
+ uri->append('/');
+ }
+ }
+ uri->append(uri2);
+ delete uri2;
+ } else {
+ uri = uri2;
+ }
+ } else {
+ uri = uri2;
+ }
+ } else {
+ error(-1, "Illegal URI-type link");
+ }
+}
+
+LinkURI::~LinkURI() {
+ if (uri)
+ delete uri;
+}
+
+//------------------------------------------------------------------------
+// LinkNamed
+//------------------------------------------------------------------------
+
+LinkNamed::LinkNamed(Object *nameObj) {
+ name = NULL;
+ if (nameObj->isName()) {
+ name = new GString(nameObj->getName());
+ }
+}
+
+LinkNamed::~LinkNamed() {
+ if (name) {
+ delete name;
+ }
+}
+
+//------------------------------------------------------------------------
+// LinkUnknown
+//------------------------------------------------------------------------
+
+LinkUnknown::LinkUnknown(char *action1) {
+ action = new GString(action1);
+}
+
+LinkUnknown::~LinkUnknown() {
+ delete action;
+}
+
+//------------------------------------------------------------------------
+// Link
+//------------------------------------------------------------------------
+
+Link::Link(Dict *dict, GString *baseURI) {
+ Object obj1, obj2, obj3, obj4;
+ double t;
+
+ action = NULL;
+ ok = gFalse;
+
+ // get rectangle
+ if (!dict->lookup("Rect", &obj1)->isArray()) {
+ error(-1, "Annotation rectangle is wrong type");
+ goto err2;
+ }
+ if (!obj1.arrayGet(0, &obj2)->isNum()) {
+ error(-1, "Bad annotation rectangle");
+ goto err1;
+ }
+ x1 = obj2.getNum();
+ obj2.free();
+ if (!obj1.arrayGet(1, &obj2)->isNum()) {
+ error(-1, "Bad annotation rectangle");
+ goto err1;
+ }
+ y1 = obj2.getNum();
+ obj2.free();
+ if (!obj1.arrayGet(2, &obj2)->isNum()) {
+ error(-1, "Bad annotation rectangle");
+ goto err1;
+ }
+ x2 = obj2.getNum();
+ obj2.free();
+ if (!obj1.arrayGet(3, &obj2)->isNum()) {
+ error(-1, "Bad annotation rectangle");
+ goto err1;
+ }
+ y2 = obj2.getNum();
+ obj2.free();
+ obj1.free();
+ if (x1 > x2) {
+ t = x1;
+ x1 = x2;
+ x2 = t;
+ }
+ if (y1 > y2) {
+ t = y1;
+ y1 = y2;
+ y2 = t;
+ }
+
+ // get border
+ borderW = 0;
+ if (!dict->lookup("Border", &obj1)->isNull()) {
+ if (obj1.isArray() && obj1.arrayGet(2, &obj2)->isNum())
+ borderW = obj2.getNum();
+ else
+ error(-1, "Bad annotation border");
+ obj2.free();
+ }
+ obj1.free();
+
+ // look for destination
+ if (!dict->lookup("Dest", &obj1)->isNull()) {
+ action = new LinkGoTo(&obj1);
+
+ // look for action
+ } else {
+ obj1.free();
+ if (dict->lookup("A", &obj1)->isDict()) {
+ obj1.dictLookup("S", &obj2);
+
+ // GoTo action
+ if (obj2.isName("GoTo")) {
+ obj1.dictLookup("D", &obj3);
+ action = new LinkGoTo(&obj3);
+ obj3.free();
+
+ // GoToR action
+ } else if (obj2.isName("GoToR")) {
+ obj1.dictLookup("F", &obj3);
+ obj1.dictLookup("D", &obj4);
+ action = new LinkGoToR(&obj3, &obj4);
+ obj3.free();
+ obj4.free();
+
+ // Launch action
+ } else if (obj2.isName("Launch")) {
+ action = new LinkLaunch(&obj1);
+
+ // URI action
+ } else if (obj2.isName("URI")) {
+ obj1.dictLookup("URI", &obj3);
+ action = new LinkURI(&obj3, baseURI);
+ obj3.free();
+
+ // Named action
+ } else if (obj2.isName("Named")) {
+ obj1.dictLookup("N", &obj3);
+ action = new LinkNamed(&obj3);
+ obj3.free();
+
+ // unknown action
+ } else if (obj2.isName()) {
+ action = new LinkUnknown(obj2.getName());
+
+ // action is missing or wrong type
+ } else {
+ error(-1, "Bad annotation action");
+ action = NULL;
+ }
+
+ obj2.free();
+
+ } else {
+ error(-1, "Missing annotation destination/action");
+ action = NULL;
+ }
+ }
+ obj1.free();
+
+ // check for bad action
+ if (action && action->isOk())
+ ok = gTrue;
+
+ return;
+
+ err1:
+ obj2.free();
+ err2:
+ obj1.free();
+}
+
+Link::~Link() {
+ if (action)
+ delete action;
+}
+
+//------------------------------------------------------------------------
+// Links
+//------------------------------------------------------------------------
+
+Links::Links(Object *annots, GString *baseURI) {
+ Link *link;
+ Object obj1, obj2;
+ int size;
+ int i;
+
+ links = NULL;
+ size = 0;
+ numLinks = 0;
+
+ if (annots->isArray()) {
+ for (i = 0; i < annots->arrayGetLength(); ++i) {
+ if (annots->arrayGet(i, &obj1)->isDict()) {
+ if (obj1.dictLookup("Subtype", &obj2)->isName("Link")) {
+ link = new Link(obj1.getDict(), baseURI);
+ if (link->isOk()) {
+ if (numLinks >= size) {
+ size += 16;
+ links = (Link **)grealloc(links, size * sizeof(Link *));
+ }
+ links[numLinks++] = link;
+ } else {
+ delete link;
+ }
+ }
+ obj2.free();
+ }
+ obj1.free();
+ }
+ }
+}
+
+Links::~Links() {
+ int i;
+
+ for (i = 0; i < numLinks; ++i)
+ delete links[i];
+ gfree(links);
+}
+
+LinkAction *Links::find(double x, double y) {
+ int i;
+
+ for (i = 0; i < numLinks; ++i) {
+ if (links[i]->inRect(x, y)) {
+ return links[i]->getAction();
+ }
+ }
+ return NULL;
+}
+
+GBool Links::onLink(double x, double y) {
+ int i;
+
+ for (i = 0; i < numLinks; ++i) {
+ if (links[i]->inRect(x, y))
+ return gTrue;
+ }
+ return gFalse;
+}
+
+//------------------------------------------------------------------------
+
+// Extract a file name from a file specification (string or dictionary).
+static GString *getFileSpecName(Object *fileSpecObj) {
+ GString *name;
+ Object obj1;
+
+ name = NULL;
+
+ // string
+ if (fileSpecObj->isString()) {
+ name = fileSpecObj->getString()->copy();
+
+ // dictionary
+ } else if (fileSpecObj->isDict()) {
+ if (!fileSpecObj->dictLookup("Unix", &obj1)->isString()) {
+ obj1.free();
+ fileSpecObj->dictLookup("F", &obj1);
+ }
+ if (obj1.isString())
+ name = obj1.getString()->copy();
+ else
+ error(-1, "Illegal file spec in link");
+ obj1.free();
+
+ // error
+ } else {
+ error(-1, "Illegal file spec in link");
+ }
+
+ return name;
+}
diff --git a/pdf2swf/xpdf/Link.h b/pdf2swf/xpdf/Link.h
new file mode 100644
index 00000000..7e00510c
--- /dev/null
+++ b/pdf2swf/xpdf/Link.h
@@ -0,0 +1,336 @@
+//========================================================================
+//
+// Link.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef LINK_H
+#define LINK_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "Object.h"
+
+class GString;
+class Array;
+class Dict;
+
+//------------------------------------------------------------------------
+// LinkAction
+//------------------------------------------------------------------------
+
+enum LinkActionKind {
+ actionGoTo, // go to destination
+ actionGoToR, // go to destination in new file
+ actionLaunch, // launch app (or open document)
+ actionURI, // URI
+ actionNamed, // named action
+ actionUnknown // anything else
+};
+
+class LinkAction {
+public:
+
+ // Destructor.
+ virtual ~LinkAction() {}
+
+ // Was the LinkAction created successfully?
+ virtual GBool isOk() = 0;
+
+ // Check link action type.
+ virtual LinkActionKind getKind() = 0;
+};
+
+//------------------------------------------------------------------------
+// LinkDest
+//------------------------------------------------------------------------
+
+enum LinkDestKind {
+ destXYZ,
+ destFit,
+ destFitH,
+ destFitV,
+ destFitR,
+ destFitB,
+ destFitBH,
+ destFitBV
+};
+
+class LinkDest {
+public:
+
+ // Build a LinkDest from the array. If <pageIsRef> is true, the
+ // page is specified by an object reference; otherwise the page is
+ // specified by a (zero-relative) page number.
+ LinkDest(Array *a, GBool pageIsRef1);
+
+ // Copy a LinkDest.
+ LinkDest *copy() { return new LinkDest(this); }
+
+ // Was the LinkDest created successfully?
+ GBool isOk() { return ok; }
+
+ // Accessors.
+ LinkDestKind getKind() { return kind; }
+ GBool isPageRef() { return pageIsRef; }
+ int getPageNum() { return pageNum; }
+ Ref getPageRef() { return pageRef; }
+ double getLeft() { return left; }
+ double getBottom() { return bottom; }
+ double getRight() { return right; }
+ double getTop() { return top; }
+ double getZoom() { return zoom; }
+ GBool getChangeLeft() { return changeLeft; }
+ GBool getChangeTop() { return changeTop; }
+ GBool getChangeZoom() { return changeZoom; }
+
+private:
+
+ LinkDestKind kind; // destination type
+ GBool pageIsRef; // is the page a reference or number?
+ union {
+ Ref pageRef; // reference to page
+ int pageNum; // one-relative page number
+ };
+ double left, bottom; // position
+ double right, top;
+ double zoom; // zoom factor
+ GBool changeLeft, changeTop; // for destXYZ links, which position
+ GBool changeZoom; // components to change
+ GBool ok; // set if created successfully
+
+ LinkDest(LinkDest *dest);
+};
+
+//------------------------------------------------------------------------
+// LinkGoTo
+//------------------------------------------------------------------------
+
+class LinkGoTo: public LinkAction {
+public:
+
+ // Build a LinkGoTo from a destination (dictionary, name, or string).
+ LinkGoTo(Object *destObj);
+
+ // Destructor.
+ virtual ~LinkGoTo();
+
+ // Was the LinkGoTo created successfully?
+ virtual GBool isOk() { return dest || namedDest; }
+
+ // Accessors.
+ virtual LinkActionKind getKind() { return actionGoTo; }
+ LinkDest *getDest() { return dest; }
+ GString *getNamedDest() { return namedDest; }
+
+private:
+
+ LinkDest *dest; // regular destination (NULL for remote
+ // link with bad destination)
+ GString *namedDest; // named destination (only one of dest and
+ // and namedDest may be non-NULL)
+};
+
+//------------------------------------------------------------------------
+// LinkGoToR
+//------------------------------------------------------------------------
+
+class LinkGoToR: public LinkAction {
+public:
+
+ // Build a LinkGoToR from a file spec (dictionary) and destination
+ // (dictionary, name, or string).
+ LinkGoToR(Object *fileSpecObj, Object *destObj);
+
+ // Destructor.
+ virtual ~LinkGoToR();
+
+ // Was the LinkGoToR created successfully?
+ virtual GBool isOk() { return fileName && (dest || namedDest); }
+
+ // Accessors.
+ virtual LinkActionKind getKind() { return actionGoToR; }
+ GString *getFileName() { return fileName; }
+ LinkDest *getDest() { return dest; }
+ GString *getNamedDest() { return namedDest; }
+
+private:
+
+ GString *fileName; // file name
+ LinkDest *dest; // regular destination (NULL for remote
+ // link with bad destination)
+ GString *namedDest; // named destination (only one of dest and
+ // and namedDest may be non-NULL)
+};
+
+//------------------------------------------------------------------------
+// LinkLaunch
+//------------------------------------------------------------------------
+
+class LinkLaunch: public LinkAction {
+public:
+
+ // Build a LinkLaunch from an action dictionary.
+ LinkLaunch(Object *actionObj);
+
+ // Destructor.
+ virtual ~LinkLaunch();
+
+ // Was the LinkLaunch created successfully?
+ virtual GBool isOk() { return fileName != NULL; }
+
+ // Accessors.
+ virtual LinkActionKind getKind() { return actionLaunch; }
+ GString *getFileName() { return fileName; }
+ GString *getParams() { return params; }
+
+private:
+
+ GString *fileName; // file name
+ GString *params; // parameters
+};
+
+//------------------------------------------------------------------------
+// LinkURI
+//------------------------------------------------------------------------
+
+class LinkURI: public LinkAction {
+public:
+
+ // Build a LinkURI given the URI (string) and base URI.
+ LinkURI(Object *uriObj, GString *baseURI);
+
+ // Destructor.
+ virtual ~LinkURI();
+
+ // Was the LinkURI created successfully?
+ virtual GBool isOk() { return uri != NULL; }
+
+ // Accessors.
+ virtual LinkActionKind getKind() { return actionURI; }
+ GString *getURI() { return uri; }
+
+private:
+
+ GString *uri; // the URI
+};
+
+//------------------------------------------------------------------------
+// LinkNamed
+//------------------------------------------------------------------------
+
+class LinkNamed: public LinkAction {
+public:
+
+ // Build a LinkNamed given the action name.
+ LinkNamed(Object *nameObj);
+
+ virtual ~LinkNamed();
+
+ virtual GBool isOk() { return name != NULL; }
+
+ virtual LinkActionKind getKind() { return actionNamed; }
+ GString *getName() { return name; }
+
+private:
+
+ GString *name;
+};
+
+//------------------------------------------------------------------------
+// LinkUnknown
+//------------------------------------------------------------------------
+
+class LinkUnknown: public LinkAction {
+public:
+
+ // Build a LinkUnknown with the specified action type.
+ LinkUnknown(char *action1);
+
+ // Destructor.
+ virtual ~LinkUnknown();
+
+ // Was the LinkUnknown create successfully?
+ virtual GBool isOk() { return action != NULL; }
+
+ // Accessors.
+ virtual LinkActionKind getKind() { return actionUnknown; }
+ GString *getAction() { return action; }
+
+private:
+
+ GString *action; // action subtype
+};
+
+//------------------------------------------------------------------------
+// Link
+//------------------------------------------------------------------------
+
+class Link {
+public:
+
+ // Construct a link, given its dictionary.
+ Link(Dict *dict, GString *baseURI);
+
+ // Destructor.
+ ~Link();
+
+ // Was the link created successfully?
+ GBool isOk() { return ok; }
+
+ // Check if point is inside the link rectangle.
+ GBool inRect(double x, double y)
+ { return x1 <= x && x <= x2 && y1 <= y && y <= y2; }
+
+ // Get action.
+ LinkAction *getAction() { return action; }
+
+ // Get border corners and width.
+ void getBorder(double *xa1, double *ya1, double *xa2, double *ya2,
+ double *wa)
+ { *xa1 = x1; *ya1 = y1; *xa2 = x2; *ya2 = y2; *wa = borderW; }
+
+private:
+
+ double x1, y1; // lower left corner
+ double x2, y2; // upper right corner
+ double borderW; // border width
+ LinkAction *action; // action
+ GBool ok; // is link valid?
+};
+
+//------------------------------------------------------------------------
+// Links
+//------------------------------------------------------------------------
+
+class Links {
+public:
+
+ // Extract links from array of annotations.
+ Links(Object *annots, GString *baseURI);
+
+ // Destructor.
+ ~Links();
+
+ // Iterate through list of links.
+ int getNumLinks() { return numLinks; }
+ Link *getLink(int i) { return links[i]; }
+
+ // If point <x>,<y> is in a link, return the associated action;
+ // else return NULL.
+ LinkAction *find(double x, double y);
+
+ // Return true if <x>,<y> is in a link.
+ GBool onLink(double x, double y);
+
+private:
+
+ Link **links;
+ int numLinks;
+};
+
+#endif
diff --git a/pdf2swf/xpdf/Makefile.am b/pdf2swf/xpdf/Makefile.am
new file mode 100644
index 00000000..eca0ce45
--- /dev/null
+++ b/pdf2swf/xpdf/Makefile.am
@@ -0,0 +1,11 @@
+## Process this file with automake to produce Makefile.in
+
+noinst_LIBRARIES = libpdf.a
+libpdf_a_SOURCES = Array.cc Catalog.cc \
+Decrypt.cc Dict.cc Error.cc FontEncoding.cc FontFile.cc \
+FormWidget.cc GString.cc Gfx.cc GfxFont.cc GfxState.cc Lexer.cc \
+Link.cc Object.cc OutputDev.cc PDFDoc.cc Page.cc Params.cc \
+Parser.cc Stream.cc XRef.cc gfile.cc gmem.cc ##parseargs.cc
+## this is a workaround. automake always tries to use $(COMPILE)
+## for .c sources, which is not defined
+COMPILE = $(CC)
diff --git a/pdf2swf/xpdf/Makefile.in b/pdf2swf/xpdf/Makefile.in
new file mode 100644
index 00000000..a9f18b3f
--- /dev/null
+++ b/pdf2swf/xpdf/Makefile.in
@@ -0,0 +1,330 @@
+# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ../..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AWK = @AWK@
+CC = @CC@
+CPP = @CPP@
+CXX = @CXX@
+EXEEXT = @EXEEXT@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+noinst_LIBRARIES = libpdf.a
+libpdf_a_SOURCES = Array.cc Catalog.cc Decrypt.cc Dict.cc Error.cc FontEncoding.cc FontFile.cc FormWidget.cc GString.cc Gfx.cc GfxFont.cc GfxState.cc Lexer.cc Link.cc Object.cc OutputDev.cc PDFDoc.cc Page.cc Params.cc Parser.cc Stream.cc XRef.cc gfile.cc gmem.cc ##parseargs.cc
+
+COMPILE = $(CC)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../../config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I../..
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+libpdf_a_LIBADD =
+libpdf_a_OBJECTS = Array.o Catalog.o Decrypt.o Dict.o Error.o \
+FontEncoding.o FontFile.o FormWidget.o GString.o Gfx.o GfxFont.o \
+GfxState.o Lexer.o Link.o Object.o OutputDev.o PDFDoc.o Page.o Params.o \
+Parser.o Stream.o XRef.o gfile.o gmem.o
+AR = ar
+CXXFLAGS = @CXXFLAGS@
+CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+DEP_FILES = .deps/Array.P .deps/Catalog.P .deps/Decrypt.P .deps/Dict.P \
+.deps/Error.P .deps/FontEncoding.P .deps/FontFile.P .deps/FormWidget.P \
+.deps/GString.P .deps/Gfx.P .deps/GfxFont.P .deps/GfxState.P \
+.deps/Lexer.P .deps/Link.P .deps/Object.P .deps/OutputDev.P \
+.deps/PDFDoc.P .deps/Page.P .deps/Params.P .deps/Parser.P \
+.deps/Stream.P .deps/XRef.P .deps/gfile.P .deps/gmem.P
+SOURCES = $(libpdf_a_SOURCES)
+OBJECTS = $(libpdf_a_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .cc .o .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu pdf2swf/xpdf/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+mostlyclean-noinstLIBRARIES:
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+distclean-noinstLIBRARIES:
+
+maintainer-clean-noinstLIBRARIES:
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+libpdf.a: $(libpdf_a_OBJECTS) $(libpdf_a_DEPENDENCIES)
+ -rm -f libpdf.a
+ $(AR) cru libpdf.a $(libpdf_a_OBJECTS) $(libpdf_a_LIBADD)
+ $(RANLIB) libpdf.a
+.cc.o:
+ $(CXXCOMPILE) -c $<
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = pdf2swf/xpdf
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu pdf2swf/xpdf/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+ @echo '$(COMPILE) -c $<'; \
+ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
+
+%.lo: %.c
+ @echo '$(LTCOMPILE) -c $<'; \
+ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+
+%.o: %.cc
+ @echo '$(CXXCOMPILE) -c $<'; \
+ $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
+
+%.lo: %.cc
+ @echo '$(LTCXXCOMPILE) -c $<'; \
+ $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile $(LIBRARIES)
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
+ mostlyclean-tags mostlyclean-depend mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
+ clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-noinstLIBRARIES distclean-compile \
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
+ maintainer-clean-compile maintainer-clean-tags \
+ maintainer-clean-depend maintainer-clean-generic \
+ distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
+clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/pdf2swf/xpdf/Object.cc b/pdf2swf/xpdf/Object.cc
new file mode 100644
index 00000000..f9c10674
--- /dev/null
+++ b/pdf2swf/xpdf/Object.cc
@@ -0,0 +1,220 @@
+//========================================================================
+//
+// Object.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include "Object.h"
+#include "Array.h"
+#include "Dict.h"
+#include "Error.h"
+#include "Stream.h"
+#include "XRef.h"
+
+//------------------------------------------------------------------------
+// Object
+//------------------------------------------------------------------------
+
+char *objTypeNames[numObjTypes] = {
+ "boolean",
+ "integer",
+ "real",
+ "string",
+ "name",
+ "null",
+ "array",
+ "dictionary",
+ "stream",
+ "ref",
+ "cmd",
+ "error",
+ "eof",
+ "none"
+};
+
+#ifdef DEBUG_MEM
+int Object::numAlloc[numObjTypes] =
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+#endif
+
+Object *Object::initArray() {
+ initObj(objArray);
+ array = new Array();
+ return this;
+}
+
+Object *Object::initDict() {
+ initObj(objDict);
+ dict = new Dict();
+ return this;
+}
+
+Object *Object::initStream(Stream *stream1) {
+ initObj(objStream);
+ stream = stream1;
+ return this;
+}
+
+Object *Object::copy(Object *obj) {
+ *obj = *this;
+ switch (type) {
+ case objString:
+ obj->string = string->copy();
+ break;
+ case objName:
+ obj->name = copyString(name);
+ break;
+ case objArray:
+ array->incRef();
+ break;
+ case objDict:
+ dict->incRef();
+ break;
+ case objStream:
+ stream->incRef();
+ break;
+ case objCmd:
+ obj->cmd = copyString(cmd);
+ break;
+ default:
+ break;
+ }
+#ifdef DEBUG_MEM
+ ++numAlloc[type];
+#endif
+ return obj;
+}
+
+Object *Object::fetch(Object *obj) {
+ return (type == objRef && xref) ?
+ xref->fetch(ref.num, ref.gen, obj) : copy(obj);
+}
+
+void Object::free() {
+ switch (type) {
+ case objString:
+ delete string;
+ break;
+ case objName:
+ gfree(name);
+ break;
+ case objArray:
+ if (!array->decRef()) {
+ delete array;
+ }
+ break;
+ case objDict:
+ if (!dict->decRef()) {
+ delete dict;
+ }
+ break;
+ case objStream:
+ if (!stream->decRef()) {
+ delete stream;
+ }
+ break;
+ case objCmd:
+ gfree(cmd);
+ break;
+ default:
+ break;
+ }
+#ifdef DEBUG_MEM
+ --numAlloc[type];
+#endif
+ type = objNone;
+}
+
+char *Object::getTypeName() {
+ return objTypeNames[type];
+}
+
+void Object::print(FILE *f) {
+ Object obj;
+ int i;
+
+ switch (type) {
+ case objBool:
+ fprintf(f, "%s", booln ? "true" : "false");
+ break;
+ case objInt:
+ fprintf(f, "%d", intg);
+ break;
+ case objReal:
+ fprintf(f, "%g", real);
+ break;
+ case objString:
+ fprintf(f, "(%s)", string->getCString());
+ break;
+ case objName:
+ fprintf(f, "/%s", name);
+ break;
+ case objNull:
+ fprintf(f, "null");
+ break;
+ case objArray:
+ fprintf(f, "[");
+ for (i = 0; i < arrayGetLength(); ++i) {
+ if (i > 0)
+ fprintf(f, " ");
+ arrayGetNF(i, &obj);
+ obj.print(f);
+ obj.free();
+ }
+ fprintf(f, "]");
+ break;
+ case objDict:
+ fprintf(f, "<<");
+ for (i = 0; i < dictGetLength(); ++i) {
+ fprintf(f, " /%s ", dictGetKey(i));
+ dictGetValNF(i, &obj);
+ obj.print(f);
+ obj.free();
+ }
+ fprintf(f, " >>");
+ break;
+ case objStream:
+ fprintf(f, "<stream>");
+ break;
+ case objRef:
+ fprintf(f, "%d %d R", ref.num, ref.gen);
+ break;
+ case objCmd:
+ fprintf(f, "%s", cmd);
+ break;
+ case objError:
+ fprintf(f, "<error>");
+ break;
+ case objEOF:
+ fprintf(f, "<EOF>");
+ break;
+ case objNone:
+ fprintf(f, "<none>");
+ break;
+ }
+}
+
+void Object::memCheck(FILE *f) {
+#ifdef DEBUG_MEM
+ int i;
+ int t;
+
+ t = 0;
+ for (i = 0; i < numObjTypes; ++i)
+ t += numAlloc[i];
+ if (t > 0) {
+ fprintf(f, "Allocated objects:\n");
+ for (i = 0; i < numObjTypes; ++i) {
+ if (numAlloc[i] > 0)
+ fprintf(f, " %-20s: %6d\n", objTypeNames[i], numAlloc[i]);
+ }
+ }
+#endif
+}
diff --git a/pdf2swf/xpdf/Object.h b/pdf2swf/xpdf/Object.h
new file mode 100644
index 00000000..fa4f740b
--- /dev/null
+++ b/pdf2swf/xpdf/Object.h
@@ -0,0 +1,300 @@
+//========================================================================
+//
+// Object.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef OBJECT_H
+#define OBJECT_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include "gtypes.h"
+#include "gmem.h"
+#include "GString.h"
+
+class Array;
+class Dict;
+class Stream;
+
+//------------------------------------------------------------------------
+// Ref
+//------------------------------------------------------------------------
+
+struct Ref {
+ int num; // object number
+ int gen; // generation number
+};
+
+//------------------------------------------------------------------------
+// object types
+//------------------------------------------------------------------------
+
+enum ObjType {
+ // simple objects
+ objBool, // boolean
+ objInt, // integer
+ objReal, // real
+ objString, // string
+ objName, // name
+ objNull, // null
+
+ // complex objects
+ objArray, // array
+ objDict, // dictionary
+ objStream, // stream
+ objRef, // indirect reference
+
+ // special objects
+ objCmd, // command name
+ objError, // error return from Lexer
+ objEOF, // end of file return from Lexer
+ objNone // uninitialized object
+};
+
+#define numObjTypes 14 // total number of object types
+
+//------------------------------------------------------------------------
+// Object
+//------------------------------------------------------------------------
+
+#ifdef DEBUG_MEM
+#define initObj(t) ++numAlloc[type = t]
+#else
+#define initObj(t) type = t
+#endif
+
+class Object {
+public:
+
+ // Default constructor.
+ Object():
+ type(objNone) {}
+
+ // Initialize an object.
+ Object *initBool(GBool booln1)
+ { initObj(objBool); booln = booln1; return this; }
+ Object *initInt(int intg1)
+ { initObj(objInt); intg = intg1; return this; }
+ Object *initReal(double real1)
+ { initObj(objReal); real = real1; return this; }
+ Object *initString(GString *string1)
+ { initObj(objString); string = string1; return this; }
+ Object *initName(char *name1)
+ { initObj(objName); name = copyString(name1); return this; }
+ Object *initNull()
+ { initObj(objNull); return this; }
+ Object *initArray();
+ Object *initDict();
+ Object *initDict(Dict *dict1)
+ { initObj(objDict); dict = dict1; return this; }
+ Object *initStream(Stream *stream1);
+ Object *initRef(int num1, int gen1)
+ { initObj(objRef); ref.num = num1; ref.gen = gen1; return this; }
+ Object *initCmd(char *cmd1)
+ { initObj(objCmd); cmd = copyString(cmd1); return this; }
+ Object *initError()
+ { initObj(objError); return this; }
+ Object *initEOF()
+ { initObj(objEOF); return this; }
+
+ // Copy an object.
+ Object *copy(Object *obj);
+
+ // If object is a Ref, fetch and return the referenced object.
+ // Otherwise, return a copy of the object.
+ Object *fetch(Object *obj);
+
+ // Free object contents.
+ void free();
+
+ // Type checking.
+ ObjType getType() { return type; }
+ GBool isBool() { return type == objBool; }
+ GBool isInt() { return type == objInt; }
+ GBool isReal() { return type == objReal; }
+ GBool isNum() { return type == objInt || type == objReal; }
+ GBool isString() { return type == objString; }
+ GBool isName() { return type == objName; }
+ GBool isNull() { return type == objNull; }
+ GBool isArray() { return type == objArray; }
+ GBool isDict() { return type == objDict; }
+ GBool isStream() { return type == objStream; }
+ GBool isRef() { return type == objRef; }
+ GBool isCmd() { return type == objCmd; }
+ GBool isError() { return type == objError; }
+ GBool isEOF() { return type == objEOF; }
+ GBool isNone() { return type == objNone; }
+
+ // Special type checking.
+ GBool isName(char *name1)
+ { return type == objName && !strcmp(name, name1); }
+ GBool isDict(char *dictType);
+ GBool isStream(char *dictType);
+ GBool isCmd(char *cmd1)
+ { return type == objCmd && !strcmp(cmd, cmd1); }
+
+ // Accessors. NB: these assume object is of correct type.
+ GBool getBool() { return booln; }
+ int getInt() { return intg; }
+ double getReal() { return real; }
+ double getNum() { return type == objInt ? (double)intg : real; }
+ GString *getString() { return string; }
+ char *getName() { return name; }
+ Array *getArray() { return array; }
+ Dict *getDict() { return dict; }
+ Stream *getStream() { return stream; }
+ Ref getRef() { return ref; }
+ int getRefNum() { return ref.num; }
+ int getRefGen() { return ref.gen; }
+
+ // Array accessors.
+ int arrayGetLength();
+ void arrayAdd(Object *elem);
+ Object *arrayGet(int i, Object *obj);
+ Object *arrayGetNF(int i, Object *obj);
+
+ // Dict accessors.
+ int dictGetLength();
+ void dictAdd(char *key, Object *val);
+ GBool dictIs(char *dictType);
+ Object *dictLookup(char *key, Object *obj);
+ Object *dictLookupNF(char *key, Object *obj);
+ char *dictGetKey(int i);
+ Object *dictGetVal(int i, Object *obj);
+ Object *dictGetValNF(int i, Object *obj);
+
+ // Stream accessors.
+ GBool streamIs(char *dictType);
+ void streamReset();
+ void streamClose();
+ int streamGetChar();
+ int streamLookChar();
+ char *streamGetLine(char *buf, int size);
+ int streamGetPos();
+ void streamSetPos(int pos);
+ Dict *streamGetDict();
+
+ // Output.
+ char *getTypeName();
+ void print(FILE *f = stdout);
+
+ // Memory testing.
+ static void memCheck(FILE *f);
+
+private:
+
+ ObjType type; // object type
+ union { // value for each type:
+ GBool booln; // boolean
+ int intg; // integer
+ double real; // real
+ GString *string; // string
+ char *name; // name
+ Array *array; // array
+ Dict *dict; // dictionary
+ Stream *stream; // stream
+ Ref ref; // indirect reference
+ char *cmd; // command
+ };
+
+#ifdef DEBUG_MEM
+ static int // number of each type of object
+ numAlloc[numObjTypes]; // currently allocated
+#endif
+};
+
+//------------------------------------------------------------------------
+// Array accessors.
+//------------------------------------------------------------------------
+
+#include "Array.h"
+
+inline int Object::arrayGetLength()
+ { return array->getLength(); }
+
+inline void Object::arrayAdd(Object *elem)
+ { array->add(elem); }
+
+inline Object *Object::arrayGet(int i, Object *obj)
+ { return array->get(i, obj); }
+
+inline Object *Object::arrayGetNF(int i, Object *obj)
+ { return array->getNF(i, obj); }
+
+//------------------------------------------------------------------------
+// Dict accessors.
+//------------------------------------------------------------------------
+
+#include "Dict.h"
+
+inline int Object::dictGetLength()
+ { return dict->getLength(); }
+
+inline void Object::dictAdd(char *key, Object *val)
+ { dict->add(key, val); }
+
+inline GBool Object::dictIs(char *dictType)
+ { return dict->is(dictType); }
+
+inline GBool Object::isDict(char *dictType)
+ { return type == objDict && dictIs(dictType); }
+
+inline Object *Object::dictLookup(char *key, Object *obj)
+ { return dict->lookup(key, obj); }
+
+inline Object *Object::dictLookupNF(char *key, Object *obj)
+ { return dict->lookupNF(key, obj); }
+
+inline char *Object::dictGetKey(int i)
+ { return dict->getKey(i); }
+
+inline Object *Object::dictGetVal(int i, Object *obj)
+ { return dict->getVal(i, obj); }
+
+inline Object *Object::dictGetValNF(int i, Object *obj)
+ { return dict->getValNF(i, obj); }
+
+//------------------------------------------------------------------------
+// Stream accessors.
+//------------------------------------------------------------------------
+
+#include "Stream.h"
+
+inline GBool Object::streamIs(char *dictType)
+ { return stream->getDict()->is(dictType); }
+
+inline GBool Object::isStream(char *dictType)
+ { return type == objStream && streamIs(dictType); }
+
+inline void Object::streamReset()
+ { stream->reset(); }
+
+inline void Object::streamClose()
+ { stream->close(); }
+
+inline int Object::streamGetChar()
+ { return stream->getChar(); }
+
+inline int Object::streamLookChar()
+ { return stream->lookChar(); }
+
+inline char *Object::streamGetLine(char *buf, int size)
+ { return stream->getLine(buf, size); }
+
+inline int Object::streamGetPos()
+ { return stream->getPos(); }
+
+inline void Object::streamSetPos(int pos)
+ { stream->setPos(pos); }
+
+inline Dict *Object::streamGetDict()
+ { return stream->getDict(); }
+
+#endif
diff --git a/pdf2swf/xpdf/OutputDev.cc b/pdf2swf/xpdf/OutputDev.cc
new file mode 100644
index 00000000..eebf4605
--- /dev/null
+++ b/pdf2swf/xpdf/OutputDev.cc
@@ -0,0 +1,93 @@
+//========================================================================
+//
+// OutputDev.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include "Object.h"
+#include "Stream.h"
+#include "GfxState.h"
+#include "OutputDev.h"
+
+//------------------------------------------------------------------------
+// OutputDev
+//------------------------------------------------------------------------
+
+void OutputDev::setDefaultCTM(double *ctm1) {
+ int i;
+ double det;
+
+ for (i = 0; i < 6; ++i)
+ ctm[i] = ctm1[i];
+ det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
+ ictm[0] = ctm[3] * det;
+ ictm[1] = -ctm[1] * det;
+ ictm[2] = -ctm[2] * det;
+ ictm[3] = ctm[0] * det;
+ ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det;
+ ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det;
+}
+
+void OutputDev::cvtDevToUser(int dx, int dy, double *ux, double *uy) {
+ *ux = ictm[0] * dx + ictm[2] * dy + ictm[4];
+ *uy = ictm[1] * dx + ictm[3] * dy + ictm[5];
+}
+
+void OutputDev::cvtUserToDev(double ux, double uy, int *dx, int *dy) {
+ *dx = (int)(ctm[0] * ux + ctm[2] * uy + ctm[4] + 0.5);
+ *dy = (int)(ctm[1] * ux + ctm[3] * uy + ctm[5] + 0.5);
+}
+
+void OutputDev::updateAll(GfxState *state) {
+ updateLineDash(state);
+ updateFlatness(state);
+ updateLineJoin(state);
+ updateLineCap(state);
+ updateMiterLimit(state);
+ updateLineWidth(state);
+ updateFillColor(state);
+ updateStrokeColor(state);
+ updateFont(state);
+}
+
+void OutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
+ int width, int height, GBool invert,
+ GBool inlineImg) {
+ int i, j;
+
+ if (inlineImg) {
+ str->reset();
+ j = height * ((width + 7) / 8);
+ for (i = 0; i < j; ++i)
+ str->getChar();
+ }
+}
+
+void OutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
+ int width, int height, GfxImageColorMap *colorMap,
+ GBool inlineImg) {
+ int i, j;
+
+ if (inlineImg) {
+ str->reset();
+ j = height * ((width * colorMap->getNumPixelComps() *
+ colorMap->getBits() + 7) / 8);
+ for (i = 0; i < j; ++i)
+ str->getChar();
+ }
+}
+
+#if OPI_SUPPORT
+void OutputDev::opiBegin(GfxState *state, Dict *opiDict) {
+}
+
+void OutputDev::opiEnd(GfxState *state, Dict *opiDict) {
+}
+#endif
diff --git a/pdf2swf/xpdf/OutputDev.h b/pdf2swf/xpdf/OutputDev.h
new file mode 100644
index 00000000..d7de97ab
--- /dev/null
+++ b/pdf2swf/xpdf/OutputDev.h
@@ -0,0 +1,140 @@
+//========================================================================
+//
+// OutputDev.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef OUTPUTDEV_H
+#define OUTPUTDEV_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "gtypes.h"
+
+class GString;
+class GfxState;
+class GfxColorSpace;
+class GfxImageColorMap;
+class Stream;
+class Link;
+class Catalog;
+
+//------------------------------------------------------------------------
+// OutputDev
+//------------------------------------------------------------------------
+
+class OutputDev {
+public:
+
+ // Constructor.
+ OutputDev() {}
+
+ // Destructor.
+ virtual ~OutputDev() {}
+
+ //----- get info about output device
+
+ // Does this device use upside-down coordinates?
+ // (Upside-down means (0,0) is the top left corner of the page.)
+ virtual GBool upsideDown() = 0;
+
+ // Does this device use drawChar() or drawString()?
+ virtual GBool useDrawChar() = 0;
+
+ //----- initialization and control
+
+ // Set default transform matrix.
+ virtual void setDefaultCTM(double *ctm1);
+
+ // Start a page.
+ virtual void startPage(int pageNum, GfxState *state) {}
+
+ // End a page.
+ virtual void endPage() {}
+
+ // Dump page contents to display.
+ virtual void dump() {}
+
+ //----- coordinate conversion
+
+ // Convert between device and user coordinates.
+ virtual void cvtDevToUser(int dx, int dy, double *ux, double *uy);
+ virtual void cvtUserToDev(double ux, double uy, int *dx, int *dy);
+
+ //----- link borders
+ virtual void drawLink(Link *link, Catalog *catalog) {}
+
+ //----- save/restore graphics state
+ virtual void saveState(GfxState *state) {}
+ virtual void restoreState(GfxState *state) {}
+
+ //----- update graphics state
+ virtual void updateAll(GfxState *state);
+ virtual void updateCTM(GfxState *state, double m11, double m12,
+ double m21, double m22, double m31, double m32) {}
+ virtual void updateLineDash(GfxState *state) {}
+ virtual void updateFlatness(GfxState *state) {}
+ virtual void updateLineJoin(GfxState *state) {}
+ virtual void updateLineCap(GfxState *state) {}
+ virtual void updateMiterLimit(GfxState *state) {}
+ virtual void updateLineWidth(GfxState *state) {}
+ virtual void updateFillColor(GfxState *state) {}
+ virtual void updateStrokeColor(GfxState *state) {}
+ virtual void updateFillOpacity(GfxState *state) {}
+ virtual void updateStrokeOpacity(GfxState *state) {}
+
+ //----- update text state
+ virtual void updateFont(GfxState *state) {}
+ virtual void updateTextMat(GfxState *state) {}
+ virtual void updateCharSpace(GfxState *state) {}
+ virtual void updateRender(GfxState *state) {}
+ virtual void updateRise(GfxState *state) {}
+ virtual void updateWordSpace(GfxState *state) {}
+ virtual void updateHorizScaling(GfxState *state) {}
+ virtual void updateTextPos(GfxState *state) {}
+ virtual void updateTextShift(GfxState *state, double shift) {}
+
+ //----- path painting
+ virtual void stroke(GfxState *state) {}
+ virtual void fill(GfxState *state) {}
+ virtual void eoFill(GfxState *state) {}
+
+ //----- path clipping
+ virtual void clip(GfxState *state) {}
+ virtual void eoClip(GfxState *state) {}
+
+ //----- text drawing
+ virtual void beginString(GfxState *state, GString *s) {}
+ virtual void endString(GfxState *state) {}
+ virtual void drawChar(GfxState *state, double x, double y,
+ double dx, double dy, Guchar c) {}
+ virtual void drawChar16(GfxState *state, double x, double y,
+ double dx, double dy, int c) {}
+ virtual void drawString(GfxState *state, GString *s) {}
+ virtual void drawString16(GfxState *state, GString *s) {}
+
+ //----- image drawing
+ virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
+ int width, int height, GBool invert,
+ GBool inlineImg);
+ virtual void drawImage(GfxState *state, Object *ref, Stream *str,
+ int width, int height, GfxImageColorMap *colorMap,
+ GBool inlineImg);
+
+#if OPI_SUPPORT
+ //----- OPI functions
+ virtual void opiBegin(GfxState *state, Dict *opiDict);
+ virtual void opiEnd(GfxState *state, Dict *opiDict);
+#endif
+
+private:
+
+ double ctm[6]; // coordinate transform matrix
+ double ictm[6]; // inverse CTM
+};
+
+#endif
diff --git a/pdf2swf/xpdf/PDFDoc.cc b/pdf2swf/xpdf/PDFDoc.cc
new file mode 100644
index 00000000..ae55d231
--- /dev/null
+++ b/pdf2swf/xpdf/PDFDoc.cc
@@ -0,0 +1,251 @@
+//========================================================================
+//
+// PDFDoc.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include "GString.h"
+#include "config.h"
+#include "Page.h"
+#include "Catalog.h"
+#include "Stream.h"
+#include "XRef.h"
+#include "Link.h"
+#include "OutputDev.h"
+#include "Params.h"
+#include "Error.h"
+#include "Lexer.h"
+#include "Parser.h"
+#include "PDFDoc.h"
+
+//------------------------------------------------------------------------
+
+#define headerSearchSize 1024 // read this many bytes at beginning of
+ // file to look for '%PDF'
+
+//------------------------------------------------------------------------
+// PDFDoc
+//------------------------------------------------------------------------
+
+PDFDoc::PDFDoc(GString *fileName1, GString *userPassword) {
+ Object obj;
+ GString *fileName2;
+
+ ok = gFalse;
+
+ file = NULL;
+ str = NULL;
+ xref = NULL;
+ catalog = NULL;
+ links = NULL;
+
+ // try to open file
+ fileName = fileName1;
+ fileName2 = NULL;
+#ifdef VMS
+ if (!(file = fopen(fileName->getCString(), "rb", "ctx=stm"))) {
+ error(-1, "Couldn't open file '%s'", fileName->getCString());
+ return;
+ }
+#else
+ if (!(file = fopen(fileName->getCString(), "rb"))) {
+ fileName2 = fileName->copy();
+ fileName2->lowerCase();
+ if (!(file = fopen(fileName2->getCString(), "rb"))) {
+ fileName2->upperCase();
+ if (!(file = fopen(fileName2->getCString(), "rb"))) {
+ error(-1, "Couldn't open file '%s'", fileName->getCString());
+ delete fileName2;
+ return;
+ }
+ }
+ delete fileName2;
+ }
+#endif
+
+ // create stream
+ obj.initNull();
+ str = new FileStream(file, 0, -1, &obj);
+
+ ok = setup(userPassword);
+}
+
+PDFDoc::PDFDoc(BaseStream *str, GString *userPassword) {
+ ok = gFalse;
+ fileName = NULL;
+ file = NULL;
+ this->str = str;
+ xref = NULL;
+ catalog = NULL;
+ links = NULL;
+ ok = setup(userPassword);
+}
+
+GBool PDFDoc::setup(GString *userPassword) {
+ Object catObj;
+
+ // check header
+ checkHeader();
+
+ // read xref table
+ xref = new XRef(str, userPassword);
+ if (!xref->isOk()) {
+ error(-1, "Couldn't read xref table");
+ return gFalse;
+ }
+
+ // read catalog
+ catalog = new Catalog(xref->getCatalog(&catObj));
+ catObj.free();
+ if (!catalog->isOk()) {
+ error(-1, "Couldn't read page catalog");
+ return gFalse;
+ }
+
+ // done
+ return gTrue;
+}
+
+PDFDoc::~PDFDoc() {
+ if (catalog) {
+ delete catalog;
+ }
+ if (xref) {
+ delete xref;
+ }
+ if (str) {
+ delete str;
+ }
+ if (file) {
+ fclose(file);
+ }
+ if (fileName) {
+ delete fileName;
+ }
+ if (links) {
+ delete links;
+ }
+}
+
+// Check for a PDF header on this stream. Skip past some garbage
+// if necessary.
+void PDFDoc::checkHeader() {
+ char hdrBuf[headerSearchSize+1];
+ char *p;
+ int i;
+
+ pdfVersion = 0;
+ for (i = 0; i < headerSearchSize; ++i) {
+ hdrBuf[i] = str->getChar();
+ }
+ hdrBuf[headerSearchSize] = '\0';
+ for (i = 0; i < headerSearchSize - 5; ++i) {
+ if (!strncmp(&hdrBuf[i], "%PDF-", 5)) {
+ break;
+ }
+ }
+ if (i >= headerSearchSize - 5) {
+ error(-1, "May not be a PDF file (continuing anyway)");
+ return;
+ }
+ str->moveStart(i);
+ p = strtok(&hdrBuf[i+5], " \t\n\r");
+ pdfVersion = atof(p);
+ if (!(hdrBuf[i+5] >= '0' && hdrBuf[i+5] <= '9') ||
+ pdfVersion > supportedPDFVersionNum + 0.0001) {
+ error(-1, "PDF version %s -- xpdf supports version %s"
+ " (continuing anyway)", p, supportedPDFVersionStr);
+ }
+}
+
+void PDFDoc::displayPage(OutputDev *out, int page, double zoom,
+ int rotate, GBool doLinks) {
+ Page *p;
+
+ if (printCommands) {
+ printf("***** page %d *****\n", page);
+ }
+ p = catalog->getPage(page);
+ if (doLinks) {
+ if (links) {
+ delete links;
+ }
+ getLinks(p);
+ p->display(out, zoom, rotate, links, catalog);
+ } else {
+ p->display(out, zoom, rotate, NULL, catalog);
+ }
+}
+
+void PDFDoc::displayPages(OutputDev *out, int firstPage, int lastPage,
+ int zoom, int rotate, GBool doLinks) {
+ int page;
+
+ for (page = firstPage; page <= lastPage; ++page) {
+ displayPage(out, page, zoom, rotate, doLinks);
+ }
+}
+
+GBool PDFDoc::isLinearized() {
+ Parser *parser;
+ Object obj1, obj2, obj3, obj4, obj5;
+ GBool lin;
+
+ lin = gFalse;
+ obj1.initNull();
+ parser = new Parser(new Lexer(str->makeSubStream(str->getStart(),
+ -1, &obj1)));
+ parser->getObj(&obj1);
+ parser->getObj(&obj2);
+ parser->getObj(&obj3);
+ parser->getObj(&obj4);
+ if (obj1.isInt() && obj2.isInt() && obj3.isCmd("obj") &&
+ obj4.isDict()) {
+ obj4.dictLookup("Linearized", &obj5);
+ if (obj5.isNum() && obj5.getNum() > 0) {
+ lin = gTrue;
+ }
+ obj5.free();
+ }
+ obj4.free();
+ obj3.free();
+ obj2.free();
+ obj1.free();
+ delete parser;
+ return lin;
+}
+
+GBool PDFDoc::saveAs(GString *name) {
+ FILE *f;
+ int c;
+
+ if (!(f = fopen(name->getCString(), "wb"))) {
+ error(-1, "Couldn't open file '%s'", name->getCString());
+ return gFalse;
+ }
+ str->reset();
+ while ((c = str->getChar()) != EOF) {
+ fputc(c, f);
+ }
+ str->close();
+ fclose(f);
+ return gTrue;
+}
+
+void PDFDoc::getLinks(Page *page) {
+ Object obj;
+
+ links = new Links(page->getAnnots(&obj), catalog->getBaseURI());
+ obj.free();
+}
+
diff --git a/pdf2swf/xpdf/PDFDoc.h b/pdf2swf/xpdf/PDFDoc.h
new file mode 100644
index 00000000..e679db97
--- /dev/null
+++ b/pdf2swf/xpdf/PDFDoc.h
@@ -0,0 +1,125 @@
+//========================================================================
+//
+// PDFDoc.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef PDFDOC_H
+#define PDFDOC_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include <stdio.h>
+#include "Link.h"
+#include "Catalog.h"
+#include "Page.h"
+
+class GString;
+class BaseStream;
+class XRef;
+class OutputDev;
+class Links;
+class LinkAction;
+class LinkDest;
+
+//------------------------------------------------------------------------
+// PDFDoc
+//------------------------------------------------------------------------
+
+class PDFDoc {
+public:
+
+ PDFDoc(GString *fileName1, GString *userPassword = NULL);
+ PDFDoc(BaseStream *str, GString *userPassword = NULL);
+ ~PDFDoc();
+
+ // Was PDF document successfully opened?
+ GBool isOk() { return ok; }
+
+ // Get file name.
+ GString *getFileName() { return fileName; }
+
+ // Get catalog.
+ Catalog *getCatalog() { return catalog; }
+
+ // Get base stream.
+ BaseStream *getBaseStream() { return str; }
+
+ // Get page parameters.
+ double getPageWidth(int page)
+ { return catalog->getPage(page)->getWidth(); }
+ double getPageHeight(int page)
+ { return catalog->getPage(page)->getHeight(); }
+ int getPageRotate(int page)
+ { return catalog->getPage(page)->getRotate(); }
+
+ // Get number of pages.
+ int getNumPages() { return catalog->getNumPages(); }
+
+ // Display a page.
+ void displayPage(OutputDev *out, int page, double zoom,
+ int rotate, GBool doLinks);
+
+ // Display a range of pages.
+ void displayPages(OutputDev *out, int firstPage, int lastPage,
+ int zoom, int rotate, GBool doLinks);
+
+ // Find a page, given its object ID. Returns page number, or 0 if
+ // not found.
+ int findPage(int num, int gen) { return catalog->findPage(num, gen); }
+
+ // If point <x>,<y> is in a link, return the associated action;
+ // else return NULL.
+ LinkAction *findLink(double x, double y) { return links->find(x, y); }
+
+ // Return true if <x>,<y> is in a link.
+ GBool onLink(double x, double y) { return links->onLink(x, y); }
+
+ // Find a named destination. Returns the link destination, or
+ // NULL if <name> is not a destination.
+ LinkDest *findDest(GString *name)
+ { return catalog->findDest(name); }
+
+ // Is the file encrypted?
+ GBool isEncrypted() { return xref->isEncrypted(); }
+
+ // Check various permissions.
+ GBool okToPrint() { return xref->okToPrint(); }
+ GBool okToChange() { return xref->okToChange(); }
+ GBool okToCopy() { return xref->okToCopy(); }
+ GBool okToAddNotes() { return xref->okToAddNotes(); }
+
+ // Is this document linearized?
+ GBool isLinearized();
+
+ // Return the document's Info dictionary (if any).
+ Object *getDocInfo(Object *obj) { return xref->getDocInfo(obj); }
+
+ // Return the PDF version specified by the file.
+ double getPDFVersion() { return pdfVersion; }
+
+ // Save this file with another name.
+ GBool saveAs(GString *name);
+
+private:
+
+ GBool setup(GString *userPassword);
+ void checkHeader();
+ void getLinks(Page *page);
+
+ GString *fileName;
+ FILE *file;
+ BaseStream *str;
+ double pdfVersion;
+ XRef *xref;
+ Catalog *catalog;
+ Links *links;
+
+ GBool ok;
+};
+
+#endif
diff --git a/pdf2swf/xpdf/Page.cc b/pdf2swf/xpdf/Page.cc
new file mode 100644
index 00000000..c2ac6b19
--- /dev/null
+++ b/pdf2swf/xpdf/Page.cc
@@ -0,0 +1,245 @@
+//========================================================================
+//
+// Page.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include "Object.h"
+#include "Array.h"
+#include "Dict.h"
+#include "XRef.h"
+#include "Link.h"
+#include "OutputDev.h"
+#ifndef PDF_PARSER_ONLY
+#include "Gfx.h"
+#include "FormWidget.h"
+#endif
+#include "Error.h"
+
+#include "Params.h"
+#include "Page.h"
+
+//------------------------------------------------------------------------
+// PageAttrs
+//------------------------------------------------------------------------
+
+PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
+ Object obj1, obj2;
+ double w, h;
+
+ // get old/default values
+ if (attrs) {
+ x1 = attrs->x1;
+ y1 = attrs->y1;
+ x2 = attrs->x2;
+ y2 = attrs->y2;
+ cropX1 = attrs->cropX1;
+ cropY1 = attrs->cropY1;
+ cropX2 = attrs->cropX2;
+ cropY2 = attrs->cropY2;
+ rotate = attrs->rotate;
+ attrs->resources.copy(&resources);
+ } else {
+ // set default MediaBox to 8.5" x 11" -- this shouldn't be necessary
+ // but some (non-compliant) PDF files don't specify a MediaBox
+ x1 = 0;
+ y1 = 0;
+ x2 = 612;
+ y2 = 792;
+ cropX1 = cropY1 = cropX2 = cropY2 = 0;
+ rotate = 0;
+ resources.initNull();
+ }
+
+ // media box
+ dict->lookup("MediaBox", &obj1);
+ if (obj1.isArray() && obj1.arrayGetLength() == 4) {
+ obj1.arrayGet(0, &obj2);
+ if (obj2.isNum())
+ x1 = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ if (obj2.isNum())
+ y1 = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2, &obj2);
+ if (obj2.isNum())
+ x2 = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(3, &obj2);
+ if (obj2.isNum())
+ y2 = obj2.getNum();
+ obj2.free();
+ }
+ obj1.free();
+
+ // crop box
+ dict->lookup("CropBox", &obj1);
+ if (obj1.isArray() && obj1.arrayGetLength() == 4) {
+ obj1.arrayGet(0, &obj2);
+ if (obj2.isNum())
+ cropX1 = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ if (obj2.isNum())
+ cropY1 = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2, &obj2);
+ if (obj2.isNum())
+ cropX2 = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(3, &obj2);
+ if (obj2.isNum())
+ cropY2 = obj2.getNum();
+ obj2.free();
+ }
+ obj1.free();
+
+ // if the MediaBox is excessively larger than the CropBox,
+ // just use the CropBox
+ limitToCropBox = gFalse;
+ w = 0.25 * (cropX2 - cropX1);
+ h = 0.25 * (cropY2 - cropY1);
+ if (cropX2 > cropX1 &&
+ ((cropX1 - x1) + (x2 - cropX2) > w ||
+ (cropY1 - y1) + (y2 - cropY2) > h)) {
+ limitToCropBox = gTrue;
+ }
+
+ // rotate
+ dict->lookup("Rotate", &obj1);
+ if (obj1.isInt())
+ rotate = obj1.getInt();
+ obj1.free();
+ while (rotate < 0)
+ rotate += 360;
+ while (rotate >= 360)
+ rotate -= 360;
+
+ // resource dictionary
+ dict->lookup("Resources", &obj1);
+ if (obj1.isDict()) {
+ resources.free();
+ obj1.copy(&resources);
+ }
+ obj1.free();
+}
+
+PageAttrs::~PageAttrs() {
+ resources.free();
+}
+
+//------------------------------------------------------------------------
+// Page
+//------------------------------------------------------------------------
+
+Page::Page(int num1, Dict *pageDict, PageAttrs *attrs1) {
+
+ ok = gTrue;
+ num = num1;
+
+ // get attributes
+ attrs = attrs1;
+
+ // annotations
+ pageDict->lookupNF("Annots", &annots);
+ if (!(annots.isRef() || annots.isArray() || annots.isNull())) {
+ error(-1, "Page annotations object (page %d) is wrong type (%s)",
+ num, annots.getTypeName());
+ annots.free();
+ goto err2;
+ }
+
+ // contents
+ pageDict->lookupNF("Contents", &contents);
+ if (!(contents.isRef() || contents.isArray() ||
+ contents.isNull())) {
+ error(-1, "Page contents object (page %d) is wrong type (%s)",
+ num, contents.getTypeName());
+ contents.free();
+ goto err1;
+ }
+
+ return;
+
+ err2:
+ annots.initNull();
+ err1:
+ contents.initNull();
+ ok = gFalse;
+}
+
+Page::~Page() {
+ delete attrs;
+ annots.free();
+ contents.free();
+}
+
+void Page::display(OutputDev *out, double dpi, int rotate,
+ Links *links, Catalog *catalog) {
+#ifndef PDF_PARSER_ONLY
+ Gfx *gfx;
+ Object obj;
+ Link *link;
+ int i;
+ FormWidgets *formWidgets;
+
+ if (printCommands) {
+ printf("***** MediaBox = ll:%g,%g ur:%g,%g\n",
+ getX1(), getY1(), getX2(), getY2());
+ if (isCropped()) {
+ printf("***** CropBox = ll:%g,%g ur:%g,%g\n",
+ getCropX1(), getCropY1(), getCropX2(), getCropY2());
+ }
+ printf("***** Rotate = %d\n", attrs->getRotate());
+ }
+
+ rotate += getRotate();
+ if (rotate >= 360) {
+ rotate -= 360;
+ } else if (rotate < 0) {
+ rotate += 360;
+ }
+ gfx = new Gfx(out, num, attrs->getResourceDict(),
+ dpi, getX1(), getY1(), getX2(), getY2(), isCropped(),
+ getCropX1(), getCropY1(), getCropX2(), getCropY2(), rotate);
+ contents.fetch(&obj);
+ if (!obj.isNull()) {
+ gfx->display(&obj);
+ }
+ obj.free();
+
+ // draw links
+ if (links) {
+ for (i = 0; i < links->getNumLinks(); ++i) {
+ link = links->getLink(i);
+ out->drawLink(link, catalog);
+ }
+ out->dump();
+ }
+
+ // draw AcroForm widgets
+ //~ need to reset CTM ???
+ formWidgets = new FormWidgets(annots.fetch(&obj));
+ obj.free();
+ if (printCommands && formWidgets->getNumWidgets() > 0) {
+ printf("***** AcroForm widgets\n");
+ }
+ for (i = 0; i < formWidgets->getNumWidgets(); ++i) {
+ formWidgets->getWidget(i)->draw(gfx);
+ }
+ if (formWidgets->getNumWidgets() > 0) {
+ out->dump();
+ }
+ delete formWidgets;
+
+ delete gfx;
+#endif
+}
diff --git a/pdf2swf/xpdf/Page.h b/pdf2swf/xpdf/Page.h
new file mode 100644
index 00000000..a144d2cf
--- /dev/null
+++ b/pdf2swf/xpdf/Page.h
@@ -0,0 +1,114 @@
+//========================================================================
+//
+// Page.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef PAGE_H
+#define PAGE_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "Object.h"
+
+class Dict;
+class XRef;
+class OutputDev;
+class Links;
+class Catalog;
+
+//------------------------------------------------------------------------
+// PageAttrs
+//------------------------------------------------------------------------
+
+class PageAttrs {
+public:
+
+ // Construct a new PageAttrs object by merging a dictionary
+ // (of type Pages or Page) into another PageAttrs object. If
+ // <attrs> is NULL, uses defaults.
+ PageAttrs(PageAttrs *attrs, Dict *dict);
+
+ // Destructor.
+ ~PageAttrs();
+
+ // Accessors.
+ double getX1() { return limitToCropBox ? cropX1 : x1; }
+ double getY1() { return limitToCropBox ? cropY1 : y1; }
+ double getX2() { return limitToCropBox ? cropX2 : x2; }
+ double getY2() { return limitToCropBox ? cropY2 : y2; }
+ GBool isCropped() { return cropX2 > cropX1; }
+ double getCropX1() { return cropX1; }
+ double getCropY1() { return cropY1; }
+ double getCropX2() { return cropX2; }
+ double getCropY2() { return cropY2; }
+ int getRotate() { return rotate; }
+ Dict *getResourceDict()
+ { return resources.isDict() ? resources.getDict() : (Dict *)NULL; }
+
+private:
+
+ double x1, y1, x2, y2;
+ double cropX1, cropY1, cropX2, cropY2;
+ GBool limitToCropBox;
+ int rotate;
+ Object resources;
+};
+
+//------------------------------------------------------------------------
+// Page
+//------------------------------------------------------------------------
+
+class Page {
+public:
+
+ // Constructor.
+ Page(int num1, Dict *pageDict, PageAttrs *attrs1);
+
+ // Destructor.
+ ~Page();
+
+ // Is page valid?
+ GBool isOk() { return ok; }
+
+ // Get page parameters.
+ double getX1() { return attrs->getX1(); }
+ double getY1() { return attrs->getY1(); }
+ double getX2() { return attrs->getX2(); }
+ double getY2() { return attrs->getY2(); }
+ GBool isCropped() { return attrs->isCropped(); }
+ double getCropX1() { return attrs->getCropX1(); }
+ double getCropY1() { return attrs->getCropY1(); }
+ double getCropX2() { return attrs->getCropX2(); }
+ double getCropY2() { return attrs->getCropY2(); }
+ double getWidth() { return attrs->getX2() - attrs->getX1(); }
+ double getHeight() { return attrs->getY2() - attrs->getY1(); }
+ int getRotate() { return attrs->getRotate(); }
+
+ // Get resource dictionary.
+ Dict *getResourceDict() { return attrs->getResourceDict(); }
+
+ // Get annotations array.
+ Object *getAnnots(Object *obj) { return annots.fetch(obj); }
+
+ // Get contents.
+ Object *getContents(Object *obj) { return contents.fetch(obj); }
+
+ // Display a page.
+ void display(OutputDev *out, double dpi, int rotate,
+ Links *links, Catalog *catalog);
+
+private:
+
+ int num; // page number
+ PageAttrs *attrs; // page attributes
+ Object annots; // annotations array
+ Object contents; // page contents
+ GBool ok; // true if page is valid
+};
+
+#endif
diff --git a/pdf2swf/xpdf/Params.cc b/pdf2swf/xpdf/Params.cc
new file mode 100644
index 00000000..35adfdfe
--- /dev/null
+++ b/pdf2swf/xpdf/Params.cc
@@ -0,0 +1,87 @@
+//========================================================================
+//
+// Params.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include "gtypes.h"
+#include "gmem.h"
+#include "GString.h"
+#include "gfile.h"
+#include "Params.h"
+
+char **fontPath = NULL;
+static int fontPathLen, fontPathSize;
+
+DevFontMapEntry *devFontMap = NULL;
+static int devFontMapLen, devFontMapSize;
+
+void initParams(char *configFile) {
+ GString *fileName;
+ FILE *f;
+ char buf[256];
+ char *p, *q;
+
+ // initialize font path and font map
+ fontPath = (char **)gmalloc((fontPathSize = 8) * sizeof(char *));
+ fontPath[fontPathLen = 0] = NULL;
+ devFontMap = (DevFontMapEntry *)gmalloc((devFontMapSize = 8) *
+ sizeof(DevFontMapEntry));
+ devFontMap[devFontMapLen = 0].pdfFont = NULL;
+
+ // read config file
+ fileName = appendToPath(getHomeDir(), configFile);
+ if ((f = fopen(fileName->getCString(), "r"))) {
+ while (fgets(buf, sizeof(buf)-1, f)) {
+ buf[sizeof(buf)-1] = '\0';
+ p = strtok(buf, " \t\n\r");
+ if (p && !strcmp(p, "fontpath")) {
+ if (fontPathLen+1 >= fontPathSize)
+ fontPath = (char **)
+ grealloc(fontPath, (fontPathSize += 8) * sizeof(char *));
+ p = strtok(NULL, " \t\n\r");
+ fontPath[fontPathLen++] = copyString(p);
+ } else if (p && !strcmp(p, "fontmap")) {
+ if (devFontMapLen+1 >= devFontMapSize)
+ devFontMap = (DevFontMapEntry *)
+ grealloc(devFontMap,
+ (devFontMapSize += 8) * sizeof(DevFontMapEntry));
+ p = strtok(NULL, " \t\n\r");
+ devFontMap[devFontMapLen].pdfFont = copyString(p);
+ p = strtok(NULL, "\t\n\r");
+ while (*p == ' ')
+ ++p;
+ for (q = p + strlen(p) - 1; q >= p && *q == ' '; --q) ;
+ q[1] = '\0';
+ devFontMap[devFontMapLen++].devFont = copyString(p);
+ }
+ }
+ fclose(f);
+ fontPath[fontPathLen] = NULL;
+ devFontMap[devFontMapLen].pdfFont = NULL;
+ }
+ delete fileName;
+}
+
+void freeParams() {
+ int i;
+
+ if (fontPath) {
+ for (i = 0; i < fontPathLen; ++i)
+ gfree(fontPath[i]);
+ gfree(fontPath);
+ }
+ if (devFontMap) {
+ for (i = 0; i < devFontMapLen; ++i) {
+ gfree(devFontMap[i].pdfFont);
+ gfree(devFontMap[i].devFont);
+ }
+ gfree(devFontMap);
+ }
+}
diff --git a/pdf2swf/xpdf/Params.h b/pdf2swf/xpdf/Params.h
new file mode 100644
index 00000000..ea8536fa
--- /dev/null
+++ b/pdf2swf/xpdf/Params.h
@@ -0,0 +1,37 @@
+//========================================================================
+//
+// Params.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef PARAMS_H
+#define PARAMS_H
+
+// Print commands as they're executed.
+extern GBool printCommands;
+
+// If this is set, error messages will be silently discarded.
+extern GBool errQuiet;
+
+// Font search path.
+extern char **fontPath;
+
+// Mapping from PDF font name to device font name.
+struct DevFontMapEntry {
+ char *pdfFont;
+ char *devFont;
+};
+extern DevFontMapEntry *devFontMap;
+
+//------------------------------------------------------------------------
+
+// Initialize font path and font map, and read configuration file,
+// if present.
+extern void initParams(char *configFile);
+
+// Free memory used for font path and font map.
+extern void freeParams();
+
+#endif
diff --git a/pdf2swf/xpdf/Parser.cc b/pdf2swf/xpdf/Parser.cc
new file mode 100644
index 00000000..6ad0c5a7
--- /dev/null
+++ b/pdf2swf/xpdf/Parser.cc
@@ -0,0 +1,209 @@
+//========================================================================
+//
+// Parser.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include "Object.h"
+#include "Array.h"
+#include "Dict.h"
+#include "Parser.h"
+#include "XRef.h"
+#include "Error.h"
+#ifndef NO_DECRYPTION
+#include "Decrypt.h"
+#endif
+
+Parser::Parser(Lexer *lexer1) {
+ lexer = lexer1;
+ inlineImg = 0;
+ lexer->getObj(&buf1);
+ lexer->getObj(&buf2);
+}
+
+Parser::~Parser() {
+ buf1.free();
+ buf2.free();
+ delete lexer;
+}
+
+#ifndef NO_DECRYPTION
+Object *Parser::getObj(Object *obj,
+ Guchar *fileKey, int objNum, int objGen) {
+#else
+Object *Parser::getObj(Object *obj) {
+#endif
+ char *key;
+ Stream *str;
+ Object obj2;
+ int num;
+#ifndef NO_DECRYPTION
+ Decrypt *decrypt;
+ GString *s;
+ char *p;
+ int i;
+#endif
+
+ // refill buffer after inline image data
+ if (inlineImg == 2) {
+ buf1.free();
+ buf2.free();
+ lexer->getObj(&buf1);
+ lexer->getObj(&buf2);
+ inlineImg = 0;
+ }
+
+ // array
+ if (buf1.isCmd("[")) {
+ shift();
+ obj->initArray();
+ while (!buf1.isCmd("]") && !buf1.isEOF())
+#ifndef NO_DECRYPTION
+ obj->arrayAdd(getObj(&obj2, fileKey, objNum, objGen));
+#else
+ obj->arrayAdd(getObj(&obj2));
+#endif
+ if (buf1.isEOF())
+ error(getPos(), "End of file inside array");
+ shift();
+
+ // dictionary or stream
+ } else if (buf1.isCmd("<<")) {
+ shift();
+ obj->initDict();
+ while (!buf1.isCmd(">>") && !buf1.isEOF()) {
+ if (!buf1.isName()) {
+ error(getPos(), "Dictionary key must be a name object");
+ shift();
+ } else {
+ key = copyString(buf1.getName());
+ shift();
+ if (buf1.isEOF() || buf1.isError())
+ break;
+#ifndef NO_DECRYPTION
+ obj->dictAdd(key, getObj(&obj2, fileKey, objNum, objGen));
+#else
+ obj->dictAdd(key, getObj(&obj2));
+#endif
+ }
+ }
+ if (buf1.isEOF())
+ error(getPos(), "End of file inside dictionary");
+ if (buf2.isCmd("stream")) {
+ if ((str = makeStream(obj))) {
+ obj->initStream(str);
+#ifndef NO_DECRYPTION
+ if (fileKey) {
+ str->getBaseStream()->doDecryption(fileKey, objNum, objGen);
+ }
+#endif
+ } else {
+ obj->free();
+ obj->initError();
+ }
+ } else {
+ shift();
+ }
+
+ // indirect reference or integer
+ } else if (buf1.isInt()) {
+ num = buf1.getInt();
+ shift();
+ if (buf1.isInt() && buf2.isCmd("R")) {
+ obj->initRef(num, buf1.getInt());
+ shift();
+ shift();
+ } else {
+ obj->initInt(num);
+ }
+
+#ifndef NO_DECRYPTION
+ // string
+ } else if (buf1.isString() && fileKey) {
+ buf1.copy(obj);
+ s = obj->getString();
+ decrypt = new Decrypt(fileKey, objNum, objGen);
+ for (i = 0, p = obj->getString()->getCString();
+ i < s->getLength();
+ ++i, ++p) {
+ *p = decrypt->decryptByte(*p);
+ }
+ delete decrypt;
+ shift();
+#endif
+
+ // simple object
+ } else {
+ buf1.copy(obj);
+ shift();
+ }
+
+ return obj;
+}
+
+Stream *Parser::makeStream(Object *dict) {
+ Object obj;
+ Stream *str;
+ int pos, endPos, length;
+
+ // get stream start position
+ lexer->skipToNextLine();
+ pos = lexer->getPos();
+
+ // get length
+ dict->dictLookup("Length", &obj);
+ if (obj.isInt()) {
+ length = obj.getInt();
+ obj.free();
+ } else {
+ error(getPos(), "Bad 'Length' attribute in stream");
+ obj.free();
+ return NULL;
+ }
+
+ // check for length in damaged file
+ if ((endPos = xref->getStreamEnd(pos)) >= 0) {
+ length = endPos - pos;
+ }
+
+ // make base stream
+ str = lexer->getStream()->getBaseStream()->makeSubStream(pos, length, dict);
+
+ // get filters
+ str = str->addFilters(dict);
+
+ // skip over stream data
+ lexer->setPos(pos + length);
+
+ // refill token buffers and check for 'endstream'
+ shift(); // kill '>>'
+ shift(); // kill 'stream'
+ if (buf1.isCmd("endstream"))
+ shift();
+ else
+ error(getPos(), "Missing 'endstream'");
+
+ return str;
+}
+
+void Parser::shift() {
+ if (inlineImg > 0) {
+ ++inlineImg;
+ } else if (buf2.isCmd("ID")) {
+ lexer->skipChar(); // skip char after 'ID' command
+ inlineImg = 1;
+ }
+ buf1.free();
+ buf1 = buf2;
+ if (inlineImg > 0) // don't buffer inline image data
+ buf2.initNull();
+ else
+ lexer->getObj(&buf2);
+}
diff --git a/pdf2swf/xpdf/Parser.h b/pdf2swf/xpdf/Parser.h
new file mode 100644
index 00000000..6e618449
--- /dev/null
+++ b/pdf2swf/xpdf/Parser.h
@@ -0,0 +1,56 @@
+//========================================================================
+//
+// Parser.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef PARSER_H
+#define PARSER_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "Lexer.h"
+
+//------------------------------------------------------------------------
+// Parser
+//------------------------------------------------------------------------
+
+class Parser {
+public:
+
+ // Constructor.
+ Parser(Lexer *lexer1);
+
+ // Destructor.
+ ~Parser();
+
+ // Get the next object from the input stream.
+#ifndef NO_DECRYPTION
+ Object *getObj(Object *obj,
+ Guchar *fileKey = NULL, int objNum = 0, int objGen = 0);
+#else
+ Object *getObj(Object *obj);
+#endif
+
+ // Get stream.
+ Stream *getStream() { return lexer->getStream(); }
+
+ // Get current position in file.
+ int getPos() { return lexer->getPos(); }
+
+private:
+
+ Lexer *lexer; // input stream
+ Object buf1, buf2; // next two tokens
+ int inlineImg; // set when inline image data is encountered
+
+ Stream *makeStream(Object *dict);
+ void shift();
+};
+
+#endif
+
diff --git a/pdf2swf/xpdf/StdFontInfo.h b/pdf2swf/xpdf/StdFontInfo.h
new file mode 100644
index 00000000..0db033f6
--- /dev/null
+++ b/pdf2swf/xpdf/StdFontInfo.h
@@ -0,0 +1,546 @@
+//========================================================================
+//
+// StdFontInfo.h
+//
+// This file was automatically generated by makeFontInfo.
+//
+// Copyright 1999 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef STDFONTINFO_H
+#define STDFONTINFO_H
+
+//------------------------------------------------------------------------
+// type1StdEncoding -- Adobe Type 1 StandardEncoding
+//------------------------------------------------------------------------
+
+#define type1StdEncodingSize 256
+static char *type1StdEncodingNames[type1StdEncodingSize] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclam",
+ "quotedbl",
+ "numbersign",
+ "dollar",
+ "percent",
+ "ampersand",
+ "quoteright",
+ "parenleft",
+ "parenright",
+ "asterisk",
+ "plus",
+ "comma",
+ "hyphen",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "at",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "bracketleft",
+ "backslash",
+ "bracketright",
+ "asciicircum",
+ "underscore",
+ "quoteleft",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "braceleft",
+ "bar",
+ "braceright",
+ "asciitilde",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "exclamdown",
+ "cent",
+ "sterling",
+ "fraction",
+ "yen",
+ "florin",
+ "section",
+ "currency",
+ "quotesingle",
+ "quotedblleft",
+ "guillemotleft",
+ "guilsinglleft",
+ "guilsinglright",
+ "fi",
+ "fl",
+ NULL,
+ "endash",
+ "dagger",
+ "daggerdbl",
+ "periodcentered",
+ NULL,
+ "paragraph",
+ "bullet",
+ "quotesinglbase",
+ "quotedblbase",
+ "quotedblright",
+ "guillemotright",
+ "ellipsis",
+ "perthousand",
+ NULL,
+ "questiondown",
+ NULL,
+ "grave",
+ "acute",
+ "circumflex",
+ "tilde",
+ "macron",
+ "breve",
+ "dotaccent",
+ "dieresis",
+ NULL,
+ "ring",
+ "cedilla",
+ NULL,
+ "hungarumlaut",
+ "ogonek",
+ "caron",
+ "emdash",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "AE",
+ NULL,
+ "ordfeminine",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Lslash",
+ "Oslash",
+ "OE",
+ "ordmasculine",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "ae",
+ NULL,
+ NULL,
+ NULL,
+ "dotlessi",
+ NULL,
+ NULL,
+ "lslash",
+ "oslash",
+ "oe",
+ "germandbls",
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+static FontEncoding type1StdEncoding(type1StdEncodingNames,
+ type1StdEncodingSize);
+
+//------------------------------------------------------------------------
+// type1ExpertEncoding -- Adobe Type 1 ExpertEncoding
+//------------------------------------------------------------------------
+
+#define type1ExpertEncodingSize 256
+static char *type1ExpertEncodingNames[type1ExpertEncodingSize] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclamsmall",
+ "Hungarumlautsmall",
+ NULL,
+ "dollaroldstyle",
+ "dollarsuperior",
+ "ampersandsmall",
+ "Acutesmall",
+ "parenleftsuperior",
+ "parenrightsuperior",
+ "twodotenleader",
+ "onedotenleader",
+ "comma",
+ "hyphen",
+ "period",
+ "fraction",
+ "zerooldstyle",
+ "oneoldstyle",
+ "twooldstyle",
+ "threeoldstyle",
+ "fouroldstyle",
+ "fiveoldstyle",
+ "sixoldstyle",
+ "sevenoldstyle",
+ "eightoldstyle",
+ "nineoldstyle",
+ "colon",
+ "semicolon",
+ "commasuperior",
+ "threequartersemdash",
+ "periodsuperior",
+ "questionsmall",
+ NULL,
+ "asuperior",
+ "bsuperior",
+ "centsuperior",
+ "dsuperior",
+ "esuperior",
+ NULL,
+ NULL,
+ NULL,
+ "isuperior",
+ NULL,
+ NULL,
+ "lsuperior",
+ "msuperior",
+ "nsuperior",
+ "osuperior",
+ NULL,
+ NULL,
+ "rsuperior",
+ "ssuperior",
+ "tsuperior",
+ NULL,
+ "ff",
+ "fi",
+ "fl",
+ "ffi",
+ "ffl",
+ "parenleftinferior",
+ NULL,
+ "parenrightinferior",
+ "Circumflexsmall",
+ "hyphensuperior",
+ "Gravesmall",
+ "Asmall",
+ "Bsmall",
+ "Csmall",
+ "Dsmall",
+ "Esmall",
+ "Fsmall",
+ "Gsmall",
+ "Hsmall",
+ "Ismall",
+ "Jsmall",
+ "Ksmall",
+ "Lsmall",
+ "Msmall",
+ "Nsmall",
+ "Osmall",
+ "Psmall",
+ "Qsmall",
+ "Rsmall",
+ "Ssmall",
+ "Tsmall",
+ "Usmall",
+ "Vsmall",
+ "Wsmall",
+ "Xsmall",
+ "Ysmall",
+ "Zsmall",
+ "colonmonetary",
+ "onefitted",
+ "rupiah",
+ "Tildesmall",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "exclamdownsmall",
+ "centoldstyle",
+ "Lslashsmall",
+ NULL,
+ NULL,
+ "Scaronsmall",
+ "Zcaronsmall",
+ "Dieresissmall",
+ "Brevesmall",
+ "Caronsmall",
+ NULL,
+ "Dotaccentsmall",
+ NULL,
+ NULL,
+ "Macronsmall",
+ NULL,
+ NULL,
+ "figuredash",
+ "hypheninferior",
+ NULL,
+ NULL,
+ "Ogoneksmall",
+ "Ringsmall",
+ "Cedillasmall",
+ NULL,
+ NULL,
+ NULL,
+ "onequarter",
+ "onehalf",
+ "threequarters",
+ "questiondownsmall",
+ "oneeighth",
+ "threeeighths",
+ "fiveeighths",
+ "seveneighths",
+ "onethird",
+ "twothirds",
+ NULL,
+ NULL,
+ "zerosuperior",
+ "onesuperior",
+ "twosuperior",
+ "threesuperior",
+ "foursuperior",
+ "fivesuperior",
+ "sixsuperior",
+ "sevensuperior",
+ "eightsuperior",
+ "ninesuperior",
+ "zeroinferior",
+ "oneinferior",
+ "twoinferior",
+ "threeinferior",
+ "fourinferior",
+ "fiveinferior",
+ "sixinferior",
+ "seveninferior",
+ "eightinferior",
+ "nineinferior",
+ "centinferior",
+ "dollarinferior",
+ "periodinferior",
+ "commainferior",
+ "Agravesmall",
+ "Aacutesmall",
+ "Acircumflexsmall",
+ "Atildesmall",
+ "Adieresissmall",
+ "Aringsmall",
+ "AEsmall",
+ "Ccedillasmall",
+ "Egravesmall",
+ "Eacutesmall",
+ "Ecircumflexsmall",
+ "Edieresissmall",
+ "Igravesmall",
+ "Iacutesmall",
+ "Icircumflexsmall",
+ "Idieresissmall",
+ "Ethsmall",
+ "Ntildesmall",
+ "Ogravesmall",
+ "Oacutesmall",
+ "Ocircumflexsmall",
+ "Otildesmall",
+ "Odieresissmall",
+ "OEsmall",
+ "Oslashsmall",
+ "Ugravesmall",
+ "Uacutesmall",
+ "Ucircumflexsmall",
+ "Udieresissmall",
+ "Yacutesmall",
+ "Thornsmall",
+ "Ydieresissmall"
+};
+static FontEncoding type1ExpertEncoding(type1ExpertEncodingNames,
+ type1ExpertEncodingSize);
+
+#endif
diff --git a/pdf2swf/xpdf/Stream-CCITT.h b/pdf2swf/xpdf/Stream-CCITT.h
new file mode 100644
index 00000000..1af87422
--- /dev/null
+++ b/pdf2swf/xpdf/Stream-CCITT.h
@@ -0,0 +1,459 @@
+//========================================================================
+//
+// Stream-CCITT.h
+//
+// Tables for CCITT Fax decoding.
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+struct CCITTCode {
+ short bits;
+ short n;
+};
+
+#define ccittEOL -2
+
+//------------------------------------------------------------------------
+// 2D codes
+//------------------------------------------------------------------------
+
+#define twoDimPass 0
+#define twoDimHoriz 1
+#define twoDimVert0 2
+#define twoDimVertR1 3
+#define twoDimVertL1 4
+#define twoDimVertR2 5
+#define twoDimVertL2 6
+#define twoDimVertR3 7
+#define twoDimVertL3 8
+
+// 1-7 bit codes
+static CCITTCode twoDimTab1[128] = {
+ {-1, -1}, {-1, -1}, // 000000x
+ {7, twoDimVertL3}, // 0000010
+ {7, twoDimVertR3}, // 0000011
+ {6, twoDimVertL2}, {6, twoDimVertL2}, // 000010x
+ {6, twoDimVertR2}, {6, twoDimVertR2}, // 000011x
+ {4, twoDimPass}, {4, twoDimPass}, // 0001xxx
+ {4, twoDimPass}, {4, twoDimPass},
+ {4, twoDimPass}, {4, twoDimPass},
+ {4, twoDimPass}, {4, twoDimPass},
+ {3, twoDimHoriz}, {3, twoDimHoriz}, // 001xxxx
+ {3, twoDimHoriz}, {3, twoDimHoriz},
+ {3, twoDimHoriz}, {3, twoDimHoriz},
+ {3, twoDimHoriz}, {3, twoDimHoriz},
+ {3, twoDimHoriz}, {3, twoDimHoriz},
+ {3, twoDimHoriz}, {3, twoDimHoriz},
+ {3, twoDimHoriz}, {3, twoDimHoriz},
+ {3, twoDimHoriz}, {3, twoDimHoriz},
+ {3, twoDimVertL1}, {3, twoDimVertL1}, // 010xxxx
+ {3, twoDimVertL1}, {3, twoDimVertL1},
+ {3, twoDimVertL1}, {3, twoDimVertL1},
+ {3, twoDimVertL1}, {3, twoDimVertL1},
+ {3, twoDimVertL1}, {3, twoDimVertL1},
+ {3, twoDimVertL1}, {3, twoDimVertL1},
+ {3, twoDimVertL1}, {3, twoDimVertL1},
+ {3, twoDimVertL1}, {3, twoDimVertL1},
+ {3, twoDimVertR1}, {3, twoDimVertR1}, // 011xxxx
+ {3, twoDimVertR1}, {3, twoDimVertR1},
+ {3, twoDimVertR1}, {3, twoDimVertR1},
+ {3, twoDimVertR1}, {3, twoDimVertR1},
+ {3, twoDimVertR1}, {3, twoDimVertR1},
+ {3, twoDimVertR1}, {3, twoDimVertR1},
+ {3, twoDimVertR1}, {3, twoDimVertR1},
+ {3, twoDimVertR1}, {3, twoDimVertR1},
+ {1, twoDimVert0}, {1, twoDimVert0}, // 1xxxxxx
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0},
+ {1, twoDimVert0}, {1, twoDimVert0}
+};
+
+//------------------------------------------------------------------------
+// white run lengths
+//------------------------------------------------------------------------
+
+// 11-12 bit codes (upper 7 bits are 0)
+static CCITTCode whiteTab1[32] = {
+ {-1, -1}, // 00000
+ {12, ccittEOL}, // 00001
+ {-1, -1}, {-1, -1}, // 0001x
+ {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 001xx
+ {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 010xx
+ {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 011xx
+ {11, 1792}, {11, 1792}, // 1000x
+ {12, 1984}, // 10010
+ {12, 2048}, // 10011
+ {12, 2112}, // 10100
+ {12, 2176}, // 10101
+ {12, 2240}, // 10110
+ {12, 2304}, // 10111
+ {11, 1856}, {11, 1856}, // 1100x
+ {11, 1920}, {11, 1920}, // 1101x
+ {12, 2368}, // 11100
+ {12, 2432}, // 11101
+ {12, 2496}, // 11110
+ {12, 2560} // 11111
+};
+
+// 1-9 bit codes
+static CCITTCode whiteTab2[512] = {
+ {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 0000000xx
+ {8, 29}, {8, 29}, // 00000010x
+ {8, 30}, {8, 30}, // 00000011x
+ {8, 45}, {8, 45}, // 00000100x
+ {8, 46}, {8, 46}, // 00000101x
+ {7, 22}, {7, 22}, {7, 22}, {7, 22}, // 0000011xx
+ {7, 23}, {7, 23}, {7, 23}, {7, 23}, // 0000100xx
+ {8, 47}, {8, 47}, // 00001010x
+ {8, 48}, {8, 48}, // 00001011x
+ {6, 13}, {6, 13}, {6, 13}, {6, 13}, // 000011xxx
+ {6, 13}, {6, 13}, {6, 13}, {6, 13},
+ {7, 20}, {7, 20}, {7, 20}, {7, 20}, // 0001000xx
+ {8, 33}, {8, 33}, // 00010010x
+ {8, 34}, {8, 34}, // 00010011x
+ {8, 35}, {8, 35}, // 00010100x
+ {8, 36}, {8, 36}, // 00010101x
+ {8, 37}, {8, 37}, // 00010110x
+ {8, 38}, {8, 38}, // 00010111x
+ {7, 19}, {7, 19}, {7, 19}, {7, 19}, // 0001100xx
+ {8, 31}, {8, 31}, // 00011010x
+ {8, 32}, {8, 32}, // 00011011x
+ {6, 1}, {6, 1}, {6, 1}, {6, 1}, // 000111xxx
+ {6, 1}, {6, 1}, {6, 1}, {6, 1},
+ {6, 12}, {6, 12}, {6, 12}, {6, 12}, // 001000xxx
+ {6, 12}, {6, 12}, {6, 12}, {6, 12},
+ {8, 53}, {8, 53}, // 00100100x
+ {8, 54}, {8, 54}, // 00100101x
+ {7, 26}, {7, 26}, {7, 26}, {7, 26}, // 0010011xx
+ {8, 39}, {8, 39}, // 00101000x
+ {8, 40}, {8, 40}, // 00101001x
+ {8, 41}, {8, 41}, // 00101010x
+ {8, 42}, {8, 42}, // 00101011x
+ {8, 43}, {8, 43}, // 00101100x
+ {8, 44}, {8, 44}, // 00101101x
+ {7, 21}, {7, 21}, {7, 21}, {7, 21}, // 0010111xx
+ {7, 28}, {7, 28}, {7, 28}, {7, 28}, // 0011000xx
+ {8, 61}, {8, 61}, // 00110010x
+ {8, 62}, {8, 62}, // 00110011x
+ {8, 63}, {8, 63}, // 00110100x
+ {8, 0}, {8, 0}, // 00110101x
+ {8, 320}, {8, 320}, // 00110110x
+ {8, 384}, {8, 384}, // 00110111x
+ {5, 10}, {5, 10}, {5, 10}, {5, 10}, // 00111xxxx
+ {5, 10}, {5, 10}, {5, 10}, {5, 10},
+ {5, 10}, {5, 10}, {5, 10}, {5, 10},
+ {5, 10}, {5, 10}, {5, 10}, {5, 10},
+ {5, 11}, {5, 11}, {5, 11}, {5, 11}, // 01000xxxx
+ {5, 11}, {5, 11}, {5, 11}, {5, 11},
+ {5, 11}, {5, 11}, {5, 11}, {5, 11},
+ {5, 11}, {5, 11}, {5, 11}, {5, 11},
+ {7, 27}, {7, 27}, {7, 27}, {7, 27}, // 0100100xx
+ {8, 59}, {8, 59}, // 01001010x
+ {8, 60}, {8, 60}, // 01001011x
+ {9, 1472}, // 010011000
+ {9, 1536}, // 010011001
+ {9, 1600}, // 010011010
+ {9, 1728}, // 010011011
+ {7, 18}, {7, 18}, {7, 18}, {7, 18}, // 0100111xx
+ {7, 24}, {7, 24}, {7, 24}, {7, 24}, // 0101000xx
+ {8, 49}, {8, 49}, // 01010010x
+ {8, 50}, {8, 50}, // 01010011x
+ {8, 51}, {8, 51}, // 01010100x
+ {8, 52}, {8, 52}, // 01010101x
+ {7, 25}, {7, 25}, {7, 25}, {7, 25}, // 0101011xx
+ {8, 55}, {8, 55}, // 01011000x
+ {8, 56}, {8, 56}, // 01011001x
+ {8, 57}, {8, 57}, // 01011010x
+ {8, 58}, {8, 58}, // 01011011x
+ {6, 192}, {6, 192}, {6, 192}, {6, 192}, // 010111xxx
+ {6, 192}, {6, 192}, {6, 192}, {6, 192},
+ {6, 1664}, {6, 1664}, {6, 1664}, {6, 1664}, // 011000xxx
+ {6, 1664}, {6, 1664}, {6, 1664}, {6, 1664},
+ {8, 448}, {8, 448}, // 01100100x
+ {8, 512}, {8, 512}, // 01100101x
+ {9, 704}, // 011001100
+ {9, 768}, // 011001101
+ {8, 640}, {8, 640}, // 01100111x
+ {8, 576}, {8, 576}, // 01101000x
+ {9, 832}, // 011010010
+ {9, 896}, // 011010011
+ {9, 960}, // 011010100
+ {9, 1024}, // 011010101
+ {9, 1088}, // 011010110
+ {9, 1152}, // 011010111
+ {9, 1216}, // 011011000
+ {9, 1280}, // 011011001
+ {9, 1344}, // 011011010
+ {9, 1408}, // 011011011
+ {7, 256}, {7, 256}, {7, 256}, {7, 256}, // 0110111xx
+ {4, 2}, {4, 2}, {4, 2}, {4, 2}, // 0111xxxxx
+ {4, 2}, {4, 2}, {4, 2}, {4, 2},
+ {4, 2}, {4, 2}, {4, 2}, {4, 2},
+ {4, 2}, {4, 2}, {4, 2}, {4, 2},
+ {4, 2}, {4, 2}, {4, 2}, {4, 2},
+ {4, 2}, {4, 2}, {4, 2}, {4, 2},
+ {4, 2}, {4, 2}, {4, 2}, {4, 2},
+ {4, 2}, {4, 2}, {4, 2}, {4, 2},
+ {4, 3}, {4, 3}, {4, 3}, {4, 3}, // 1000xxxxx
+ {4, 3}, {4, 3}, {4, 3}, {4, 3},
+ {4, 3}, {4, 3}, {4, 3}, {4, 3},
+ {4, 3}, {4, 3}, {4, 3}, {4, 3},
+ {4, 3}, {4, 3}, {4, 3}, {4, 3},
+ {4, 3}, {4, 3}, {4, 3}, {4, 3},
+ {4, 3}, {4, 3}, {4, 3}, {4, 3},
+ {4, 3}, {4, 3}, {4, 3}, {4, 3},
+ {5, 128}, {5, 128}, {5, 128}, {5, 128}, // 10010xxxx
+ {5, 128}, {5, 128}, {5, 128}, {5, 128},
+ {5, 128}, {5, 128}, {5, 128}, {5, 128},
+ {5, 128}, {5, 128}, {5, 128}, {5, 128},
+ {5, 8}, {5, 8}, {5, 8}, {5, 8}, // 10011xxxx
+ {5, 8}, {5, 8}, {5, 8}, {5, 8},
+ {5, 8}, {5, 8}, {5, 8}, {5, 8},
+ {5, 8}, {5, 8}, {5, 8}, {5, 8},
+ {5, 9}, {5, 9}, {5, 9}, {5, 9}, // 10100xxxx
+ {5, 9}, {5, 9}, {5, 9}, {5, 9},
+ {5, 9}, {5, 9}, {5, 9}, {5, 9},
+ {5, 9}, {5, 9}, {5, 9}, {5, 9},
+ {6, 16}, {6, 16}, {6, 16}, {6, 16}, // 101010xxx
+ {6, 16}, {6, 16}, {6, 16}, {6, 16},
+ {6, 17}, {6, 17}, {6, 17}, {6, 17}, // 101011xxx
+ {6, 17}, {6, 17}, {6, 17}, {6, 17},
+ {4, 4}, {4, 4}, {4, 4}, {4, 4}, // 1011xxxxx
+ {4, 4}, {4, 4}, {4, 4}, {4, 4},
+ {4, 4}, {4, 4}, {4, 4}, {4, 4},
+ {4, 4}, {4, 4}, {4, 4}, {4, 4},
+ {4, 4}, {4, 4}, {4, 4}, {4, 4},
+ {4, 4}, {4, 4}, {4, 4}, {4, 4},
+ {4, 4}, {4, 4}, {4, 4}, {4, 4},
+ {4, 4}, {4, 4}, {4, 4}, {4, 4},
+ {4, 5}, {4, 5}, {4, 5}, {4, 5}, // 1100xxxxx
+ {4, 5}, {4, 5}, {4, 5}, {4, 5},
+ {4, 5}, {4, 5}, {4, 5}, {4, 5},
+ {4, 5}, {4, 5}, {4, 5}, {4, 5},
+ {4, 5}, {4, 5}, {4, 5}, {4, 5},
+ {4, 5}, {4, 5}, {4, 5}, {4, 5},
+ {4, 5}, {4, 5}, {4, 5}, {4, 5},
+ {4, 5}, {4, 5}, {4, 5}, {4, 5},
+ {6, 14}, {6, 14}, {6, 14}, {6, 14}, // 110100xxx
+ {6, 14}, {6, 14}, {6, 14}, {6, 14},
+ {6, 15}, {6, 15}, {6, 15}, {6, 15}, // 110101xxx
+ {6, 15}, {6, 15}, {6, 15}, {6, 15},
+ {5, 64}, {5, 64}, {5, 64}, {5, 64}, // 11011xxxx
+ {5, 64}, {5, 64}, {5, 64}, {5, 64},
+ {5, 64}, {5, 64}, {5, 64}, {5, 64},
+ {5, 64}, {5, 64}, {5, 64}, {5, 64},
+ {4, 6}, {4, 6}, {4, 6}, {4, 6}, // 1110xxxxx
+ {4, 6}, {4, 6}, {4, 6}, {4, 6},
+ {4, 6}, {4, 6}, {4, 6}, {4, 6},
+ {4, 6}, {4, 6}, {4, 6}, {4, 6},
+ {4, 6}, {4, 6}, {4, 6}, {4, 6},
+ {4, 6}, {4, 6}, {4, 6}, {4, 6},
+ {4, 6}, {4, 6}, {4, 6}, {4, 6},
+ {4, 6}, {4, 6}, {4, 6}, {4, 6},
+ {4, 7}, {4, 7}, {4, 7}, {4, 7}, // 1111xxxxx
+ {4, 7}, {4, 7}, {4, 7}, {4, 7},
+ {4, 7}, {4, 7}, {4, 7}, {4, 7},
+ {4, 7}, {4, 7}, {4, 7}, {4, 7},
+ {4, 7}, {4, 7}, {4, 7}, {4, 7},
+ {4, 7}, {4, 7}, {4, 7}, {4, 7},
+ {4, 7}, {4, 7}, {4, 7}, {4, 7},
+ {4, 7}, {4, 7}, {4, 7}, {4, 7}
+};
+
+//------------------------------------------------------------------------
+// black run lengths
+//------------------------------------------------------------------------
+
+// 10-13 bit codes (upper 6 bits are 0)
+static CCITTCode blackTab1[128] = {
+ {-1, -1}, {-1, -1}, // 000000000000x
+ {12, ccittEOL}, {12, ccittEOL}, // 000000000001x
+ {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 00000000001xx
+ {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 00000000010xx
+ {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 00000000011xx
+ {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 00000000100xx
+ {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 00000000101xx
+ {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 00000000110xx
+ {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 00000000111xx
+ {11, 1792}, {11, 1792}, {11, 1792}, {11, 1792}, // 00000001000xx
+ {12, 1984}, {12, 1984}, // 000000010010x
+ {12, 2048}, {12, 2048}, // 000000010011x
+ {12, 2112}, {12, 2112}, // 000000010100x
+ {12, 2176}, {12, 2176}, // 000000010101x
+ {12, 2240}, {12, 2240}, // 000000010110x
+ {12, 2304}, {12, 2304}, // 000000010111x
+ {11, 1856}, {11, 1856}, {11, 1856}, {11, 1856}, // 00000001100xx
+ {11, 1920}, {11, 1920}, {11, 1920}, {11, 1920}, // 00000001101xx
+ {12, 2368}, {12, 2368}, // 000000011100x
+ {12, 2432}, {12, 2432}, // 000000011101x
+ {12, 2496}, {12, 2496}, // 000000011110x
+ {12, 2560}, {12, 2560}, // 000000011111x
+ {10, 18}, {10, 18}, {10, 18}, {10, 18}, // 0000001000xxx
+ {10, 18}, {10, 18}, {10, 18}, {10, 18},
+ {12, 52}, {12, 52}, // 000000100100x
+ {13, 640}, // 0000001001010
+ {13, 704}, // 0000001001011
+ {13, 768}, // 0000001001100
+ {13, 832}, // 0000001001101
+ {12, 55}, {12, 55}, // 000000100111x
+ {12, 56}, {12, 56}, // 000000101000x
+ {13, 1280}, // 0000001010010
+ {13, 1344}, // 0000001010011
+ {13, 1408}, // 0000001010100
+ {13, 1472}, // 0000001010101
+ {12, 59}, {12, 59}, // 000000101011x
+ {12, 60}, {12, 60}, // 000000101100x
+ {13, 1536}, // 0000001011010
+ {13, 1600}, // 0000001011011
+ {11, 24}, {11, 24}, {11, 24}, {11, 24}, // 00000010111xx
+ {11, 25}, {11, 25}, {11, 25}, {11, 25}, // 00000011000xx
+ {13, 1664}, // 0000001100100
+ {13, 1728}, // 0000001100101
+ {12, 320}, {12, 320}, // 000000110011x
+ {12, 384}, {12, 384}, // 000000110100x
+ {12, 448}, {12, 448}, // 000000110101x
+ {13, 512}, // 0000001101100
+ {13, 576}, // 0000001101101
+ {12, 53}, {12, 53}, // 000000110111x
+ {12, 54}, {12, 54}, // 000000111000x
+ {13, 896}, // 0000001110010
+ {13, 960}, // 0000001110011
+ {13, 1024}, // 0000001110100
+ {13, 1088}, // 0000001110101
+ {13, 1152}, // 0000001110110
+ {13, 1216}, // 0000001110111
+ {10, 64}, {10, 64}, {10, 64}, {10, 64}, // 0000001111xxx
+ {10, 64}, {10, 64}, {10, 64}, {10, 64}
+};
+
+// 7-12 bit codes (upper 4 bits are 0)
+static CCITTCode blackTab2[192] = {
+ {8, 13}, {8, 13}, {8, 13}, {8, 13}, // 00000100xxxx
+ {8, 13}, {8, 13}, {8, 13}, {8, 13},
+ {8, 13}, {8, 13}, {8, 13}, {8, 13},
+ {8, 13}, {8, 13}, {8, 13}, {8, 13},
+ {11, 23}, {11, 23}, // 00000101000x
+ {12, 50}, // 000001010010
+ {12, 51}, // 000001010011
+ {12, 44}, // 000001010100
+ {12, 45}, // 000001010101
+ {12, 46}, // 000001010110
+ {12, 47}, // 000001010111
+ {12, 57}, // 000001011000
+ {12, 58}, // 000001011001
+ {12, 61}, // 000001011010
+ {12, 256}, // 000001011011
+ {10, 16}, {10, 16}, {10, 16}, {10, 16}, // 0000010111xx
+ {10, 17}, {10, 17}, {10, 17}, {10, 17}, // 0000011000xx
+ {12, 48}, // 000001100100
+ {12, 49}, // 000001100101
+ {12, 62}, // 000001100110
+ {12, 63}, // 000001100111
+ {12, 30}, // 000001101000
+ {12, 31}, // 000001101001
+ {12, 32}, // 000001101010
+ {12, 33}, // 000001101011
+ {12, 40}, // 000001101100
+ {12, 41}, // 000001101101
+ {11, 22}, {11, 22}, // 00000110111x
+ {8, 14}, {8, 14}, {8, 14}, {8, 14}, // 00000111xxxx
+ {8, 14}, {8, 14}, {8, 14}, {8, 14},
+ {8, 14}, {8, 14}, {8, 14}, {8, 14},
+ {8, 14}, {8, 14}, {8, 14}, {8, 14},
+ {7, 10}, {7, 10}, {7, 10}, {7, 10}, // 0000100xxxxx
+ {7, 10}, {7, 10}, {7, 10}, {7, 10},
+ {7, 10}, {7, 10}, {7, 10}, {7, 10},
+ {7, 10}, {7, 10}, {7, 10}, {7, 10},
+ {7, 10}, {7, 10}, {7, 10}, {7, 10},
+ {7, 10}, {7, 10}, {7, 10}, {7, 10},
+ {7, 10}, {7, 10}, {7, 10}, {7, 10},
+ {7, 10}, {7, 10}, {7, 10}, {7, 10},
+ {7, 11}, {7, 11}, {7, 11}, {7, 11}, // 0000101xxxxx
+ {7, 11}, {7, 11}, {7, 11}, {7, 11},
+ {7, 11}, {7, 11}, {7, 11}, {7, 11},
+ {7, 11}, {7, 11}, {7, 11}, {7, 11},
+ {7, 11}, {7, 11}, {7, 11}, {7, 11},
+ {7, 11}, {7, 11}, {7, 11}, {7, 11},
+ {7, 11}, {7, 11}, {7, 11}, {7, 11},
+ {7, 11}, {7, 11}, {7, 11}, {7, 11},
+ {9, 15}, {9, 15}, {9, 15}, {9, 15}, // 000011000xxx
+ {9, 15}, {9, 15}, {9, 15}, {9, 15},
+ {12, 128}, // 000011001000
+ {12, 192}, // 000011001001
+ {12, 26}, // 000011001010
+ {12, 27}, // 000011001011
+ {12, 28}, // 000011001100
+ {12, 29}, // 000011001101
+ {11, 19}, {11, 19}, // 00001100111x
+ {11, 20}, {11, 20}, // 00001101000x
+ {12, 34}, // 000011010010
+ {12, 35}, // 000011010011
+ {12, 36}, // 000011010100
+ {12, 37}, // 000011010101
+ {12, 38}, // 000011010110
+ {12, 39}, // 000011010111
+ {11, 21}, {11, 21}, // 00001101100x
+ {12, 42}, // 000011011010
+ {12, 43}, // 000011011011
+ {10, 0}, {10, 0}, {10, 0}, {10, 0}, // 0000110111xx
+ {7, 12}, {7, 12}, {7, 12}, {7, 12}, // 0000111xxxxx
+ {7, 12}, {7, 12}, {7, 12}, {7, 12},
+ {7, 12}, {7, 12}, {7, 12}, {7, 12},
+ {7, 12}, {7, 12}, {7, 12}, {7, 12},
+ {7, 12}, {7, 12}, {7, 12}, {7, 12},
+ {7, 12}, {7, 12}, {7, 12}, {7, 12},
+ {7, 12}, {7, 12}, {7, 12}, {7, 12},
+ {7, 12}, {7, 12}, {7, 12}, {7, 12}
+};
+
+// 2-6 bit codes
+static CCITTCode blackTab3[64] = {
+ {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 0000xx
+ {6, 9}, // 000100
+ {6, 8}, // 000101
+ {5, 7}, {5, 7}, // 00011x
+ {4, 6}, {4, 6}, {4, 6}, {4, 6}, // 0010xx
+ {4, 5}, {4, 5}, {4, 5}, {4, 5}, // 0011xx
+ {3, 1}, {3, 1}, {3, 1}, {3, 1}, // 010xxx
+ {3, 1}, {3, 1}, {3, 1}, {3, 1},
+ {3, 4}, {3, 4}, {3, 4}, {3, 4}, // 011xxx
+ {3, 4}, {3, 4}, {3, 4}, {3, 4},
+ {2, 3}, {2, 3}, {2, 3}, {2, 3}, // 10xxxx
+ {2, 3}, {2, 3}, {2, 3}, {2, 3},
+ {2, 3}, {2, 3}, {2, 3}, {2, 3},
+ {2, 3}, {2, 3}, {2, 3}, {2, 3},
+ {2, 2}, {2, 2}, {2, 2}, {2, 2}, // 11xxxx
+ {2, 2}, {2, 2}, {2, 2}, {2, 2},
+ {2, 2}, {2, 2}, {2, 2}, {2, 2},
+ {2, 2}, {2, 2}, {2, 2}, {2, 2}
+};
diff --git a/pdf2swf/xpdf/Stream.cc b/pdf2swf/xpdf/Stream.cc
new file mode 100644
index 00000000..0afcc94a
--- /dev/null
+++ b/pdf2swf/xpdf/Stream.cc
@@ -0,0 +1,3449 @@
+//========================================================================
+//
+// Stream.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#ifndef WIN32
+#include <unistd.h>
+#endif
+#include <string.h>
+#include <ctype.h>
+#include "gmem.h"
+#include "gfile.h"
+#include "config.h"
+#include "Error.h"
+#include "Object.h"
+#ifndef NO_DECRYPTION
+#include "Decrypt.h"
+#endif
+#include "Stream.h"
+#include "Stream-CCITT.h"
+
+#ifdef __DJGPP__
+static GBool setDJSYSFLAGS = gFalse;
+#endif
+
+#ifdef VMS
+#if (__VMS_VER < 70000000)
+extern "C" int unlink(char *filename);
+#endif
+#ifdef __GNUC__
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+#endif
+#endif
+
+#ifdef MACOS
+#include "StuffItEngineLib.h"
+#endif
+
+//------------------------------------------------------------------------
+// Stream (base class)
+//------------------------------------------------------------------------
+
+Stream::Stream() {
+ ref = 1;
+}
+
+Stream::~Stream() {
+}
+
+void Stream::close() {
+}
+
+int Stream::getRawChar() {
+ error(-1, "Internal: called getRawChar() on non-predictor stream");
+ return EOF;
+}
+
+char *Stream::getLine(char *buf, int size) {
+ int i;
+ int c;
+
+ if (lookChar() == EOF)
+ return NULL;
+ for (i = 0; i < size - 1; ++i) {
+ c = getChar();
+ if (c == EOF || c == '\n')
+ break;
+ if (c == '\r') {
+ if ((c = lookChar()) == '\n')
+ getChar();
+ break;
+ }
+ buf[i] = c;
+ }
+ buf[i] = '\0';
+ return buf;
+}
+
+GString *Stream::getPSFilter(char *indent) {
+ return new GString();
+}
+
+Stream *Stream::addFilters(Object *dict) {
+ Object obj, obj2;
+ Object params, params2;
+ Stream *str;
+ int i;
+
+ str = this;
+ dict->dictLookup("Filter", &obj);
+ if (obj.isNull()) {
+ obj.free();
+ dict->dictLookup("F", &obj);
+ }
+ dict->dictLookup("DecodeParms", &params);
+ if (params.isNull()) {
+ params.free();
+ dict->dictLookup("DP", &params);
+ }
+ if (obj.isName()) {
+ str = makeFilter(obj.getName(), str, &params);
+ } else if (obj.isArray()) {
+ for (i = 0; i < obj.arrayGetLength(); ++i) {
+ obj.arrayGet(i, &obj2);
+ if (params.isArray())
+ params.arrayGet(i, &params2);
+ else
+ params2.initNull();
+ if (obj2.isName()) {
+ str = makeFilter(obj2.getName(), str, &params2);
+ } else {
+ error(getPos(), "Bad filter name");
+ str = new EOFStream(str);
+ }
+ obj2.free();
+ params2.free();
+ }
+ } else if (!obj.isNull()) {
+ error(getPos(), "Bad 'Filter' attribute in stream");
+ }
+ obj.free();
+ params.free();
+
+ return str;
+}
+
+Stream *Stream::makeFilter(char *name, Stream *str, Object *params) {
+ int pred; // parameters
+ int colors;
+ int bits;
+ int early;
+ int encoding;
+ GBool endOfLine, byteAlign, endOfBlock, black;
+ int columns, rows;
+ Object obj;
+
+ if (!strcmp(name, "ASCIIHexDecode") || !strcmp(name, "AHx")) {
+ str = new ASCIIHexStream(str);
+ } else if (!strcmp(name, "ASCII85Decode") || !strcmp(name, "A85")) {
+ str = new ASCII85Stream(str);
+ } else if (!strcmp(name, "LZWDecode") || !strcmp(name, "LZW")) {
+ pred = 1;
+ columns = 1;
+ colors = 1;
+ bits = 8;
+ early = 1;
+ if (params->isDict()) {
+ params->dictLookup("Predictor", &obj);
+ if (obj.isInt())
+ pred = obj.getInt();
+ obj.free();
+ params->dictLookup("Columns", &obj);
+ if (obj.isInt())
+ columns = obj.getInt();
+ obj.free();
+ params->dictLookup("Colors", &obj);
+ if (obj.isInt())
+ colors = obj.getInt();
+ obj.free();
+ params->dictLookup("BitsPerComponent", &obj);
+ if (obj.isInt())
+ bits = obj.getInt();
+ obj.free();
+ params->dictLookup("EarlyChange", &obj);
+ if (obj.isInt())
+ early = obj.getInt();
+ obj.free();
+ }
+ str = new LZWStream(str, pred, columns, colors, bits, early);
+ } else if (!strcmp(name, "RunLengthDecode") || !strcmp(name, "RL")) {
+ str = new RunLengthStream(str);
+ } else if (!strcmp(name, "CCITTFaxDecode") || !strcmp(name, "CCF")) {
+ encoding = 0;
+ endOfLine = gFalse;
+ byteAlign = gFalse;
+ columns = 1728;
+ rows = 0;
+ endOfBlock = gTrue;
+ black = gFalse;
+ if (params->isDict()) {
+ params->dictLookup("K", &obj);
+ if (obj.isInt()) {
+ encoding = obj.getInt();
+ }
+ obj.free();
+ params->dictLookup("EndOfLine", &obj);
+ if (obj.isBool()) {
+ endOfLine = obj.getBool();
+ }
+ obj.free();
+ params->dictLookup("EncodedByteAlign", &obj);
+ if (obj.isBool()) {
+ byteAlign = obj.getBool();
+ }
+ obj.free();
+ params->dictLookup("Columns", &obj);
+ if (obj.isInt()) {
+ columns = obj.getInt();
+ }
+ obj.free();
+ params->dictLookup("Rows", &obj);
+ if (obj.isInt()) {
+ rows = obj.getInt();
+ }
+ obj.free();
+ params->dictLookup("EndOfBlock", &obj);
+ if (obj.isBool()) {
+ endOfBlock = obj.getBool();
+ }
+ obj.free();
+ params->dictLookup("BlackIs1", &obj);
+ if (obj.isBool()) {
+ black = obj.getBool();
+ }
+ obj.free();
+ }
+ str = new CCITTFaxStream(str, encoding, endOfLine, byteAlign,
+ columns, rows, endOfBlock, black);
+ } else if (!strcmp(name, "DCTDecode") || !strcmp(name, "DCT")) {
+ str = new DCTStream(str);
+ } else if (!strcmp(name, "FlateDecode") || !strcmp(name, "Fl")) {
+ pred = 1;
+ columns = 1;
+ colors = 1;
+ bits = 8;
+ if (params->isDict()) {
+ params->dictLookup("Predictor", &obj);
+ if (obj.isInt())
+ pred = obj.getInt();
+ obj.free();
+ params->dictLookup("Columns", &obj);
+ if (obj.isInt())
+ columns = obj.getInt();
+ obj.free();
+ params->dictLookup("Colors", &obj);
+ if (obj.isInt())
+ colors = obj.getInt();
+ obj.free();
+ params->dictLookup("BitsPerComponent", &obj);
+ if (obj.isInt())
+ bits = obj.getInt();
+ obj.free();
+ }
+ str = new FlateStream(str, pred, columns, colors, bits);
+ } else {
+ error(getPos(), "Unknown filter '%s'", name);
+ str = new EOFStream(str);
+ }
+ return str;
+}
+
+//------------------------------------------------------------------------
+// BaseStream
+//------------------------------------------------------------------------
+
+BaseStream::BaseStream(Object *dict) {
+ this->dict = *dict;
+#ifndef NO_DECRYPTION
+ decrypt = NULL;
+#endif
+}
+
+BaseStream::~BaseStream() {
+ dict.free();
+#ifndef NO_DECRYPTION
+ if (decrypt)
+ delete decrypt;
+#endif
+}
+
+#ifndef NO_DECRYPTION
+void BaseStream::doDecryption(Guchar *fileKey, int objNum, int objGen) {
+ decrypt = new Decrypt(fileKey, objNum, objGen);
+}
+#endif
+
+//------------------------------------------------------------------------
+// FilterStream
+//------------------------------------------------------------------------
+
+FilterStream::FilterStream(Stream *str) {
+ this->str = str;
+}
+
+FilterStream::~FilterStream() {
+}
+
+void FilterStream::close() {
+ str->close();
+}
+
+void FilterStream::setPos(int pos) {
+ error(-1, "Internal: called setPos() on FilterStream");
+}
+
+//------------------------------------------------------------------------
+// ImageStream
+//------------------------------------------------------------------------
+
+ImageStream::ImageStream(Stream *str, int width, int nComps, int nBits) {
+ int imgLineSize;
+
+ this->str = str;
+ this->width = width;
+ this->nComps = nComps;
+ this->nBits = nBits;
+
+ nVals = width * nComps;
+ if (nBits == 1) {
+ imgLineSize = (nVals + 7) & ~7;
+ } else {
+ imgLineSize = nVals;
+ }
+ imgLine = (Guchar *)gmalloc(imgLineSize * sizeof(Guchar));
+ imgIdx = nVals;
+}
+
+ImageStream::~ImageStream() {
+ gfree(imgLine);
+}
+
+void ImageStream::reset() {
+ str->reset();
+}
+
+GBool ImageStream::getPixel(Guchar *pix) {
+ Gulong buf, bitMask;
+ int bits;
+ int c;
+ int i;
+
+ if (imgIdx >= nVals) {
+
+ // read one line of image pixels
+ if (nBits == 1) {
+ for (i = 0; i < nVals; i += 8) {
+ c = str->getChar();
+ imgLine[i+0] = (Guchar)((c >> 7) & 1);
+ imgLine[i+1] = (Guchar)((c >> 6) & 1);
+ imgLine[i+2] = (Guchar)((c >> 5) & 1);
+ imgLine[i+3] = (Guchar)((c >> 4) & 1);
+ imgLine[i+4] = (Guchar)((c >> 3) & 1);
+ imgLine[i+5] = (Guchar)((c >> 2) & 1);
+ imgLine[i+6] = (Guchar)((c >> 1) & 1);
+ imgLine[i+7] = (Guchar)(c & 1);
+ }
+ } else if (nBits == 8) {
+ for (i = 0; i < nVals; ++i) {
+ imgLine[i] = str->getChar();
+ }
+ } else {
+ bitMask = (1 << nBits) - 1;
+ buf = 0;
+ bits = 0;
+ for (i = 0; i < nVals; ++i) {
+ if (bits < nBits) {
+ buf = (buf << 8) | (str->getChar() & 0xff);
+ bits += 8;
+ }
+ imgLine[i] = (Guchar)((buf >> (bits - nBits)) & bitMask);
+ bits -= nBits;
+ }
+ }
+
+ // reset to start of line
+ imgIdx = 0;
+ }
+
+ for (i = 0; i < nComps; ++i)
+ pix[i] = imgLine[imgIdx++];
+ return gTrue;
+}
+
+void ImageStream::skipLine() {
+ int n, i;
+
+ n = (nVals * nBits + 7) >> 3;
+ for (i = 0; i < n; ++i) {
+ str->getChar();
+ }
+}
+
+//------------------------------------------------------------------------
+// StreamPredictor
+//------------------------------------------------------------------------
+
+StreamPredictor::StreamPredictor(Stream *str, int predictor,
+ int width, int nComps, int nBits) {
+ this->str = str;
+ this->predictor = predictor;
+ this->width = width;
+ this->nComps = nComps;
+ this->nBits = nBits;
+
+ nVals = width * nComps;
+ pixBytes = (nComps * nBits + 7) >> 3;
+ rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
+ predLine = (Guchar *)gmalloc(rowBytes);
+ memset(predLine, 0, rowBytes);
+ predIdx = rowBytes;
+}
+
+StreamPredictor::~StreamPredictor() {
+ gfree(predLine);
+}
+
+int StreamPredictor::lookChar() {
+ if (predIdx >= rowBytes) {
+ if (!getNextLine()) {
+ return EOF;
+ }
+ }
+ return predLine[predIdx];
+}
+
+int StreamPredictor::getChar() {
+ if (predIdx >= rowBytes) {
+ if (!getNextLine()) {
+ return EOF;
+ }
+ }
+ return predLine[predIdx++];
+}
+
+GBool StreamPredictor::getNextLine() {
+ int curPred;
+ Guchar upLeftBuf[4];
+ int left, up, upLeft, p, pa, pb, pc;
+ int c;
+ Gulong inBuf, outBuf, bitMask;
+ int inBits, outBits;
+ int i, j, k;
+
+ // get PNG optimum predictor number
+ if (predictor == 15) {
+ if ((curPred = str->getRawChar()) == EOF) {
+ return gFalse;
+ }
+ curPred += 10;
+ } else {
+ curPred = predictor;
+ }
+
+ // read the raw line, apply PNG (byte) predictor
+ upLeftBuf[0] = upLeftBuf[1] = upLeftBuf[2] = upLeftBuf[3] = 0;
+ for (i = pixBytes; i < rowBytes; ++i) {
+ upLeftBuf[3] = upLeftBuf[2];
+ upLeftBuf[2] = upLeftBuf[1];
+ upLeftBuf[1] = upLeftBuf[0];
+ upLeftBuf[0] = predLine[i];
+ if ((c = str->getRawChar()) == EOF) {
+ break;
+ }
+ switch (curPred) {
+ case 11: // PNG sub
+ predLine[i] = predLine[i - pixBytes] + (Guchar)c;
+ break;
+ case 12: // PNG up
+ predLine[i] = predLine[i] + (Guchar)c;
+ break;
+ case 13: // PNG average
+ predLine[i] = ((predLine[i - pixBytes] + predLine[i]) >> 1) +
+ (Guchar)c;
+ break;
+ case 14: // PNG Paeth
+ left = predLine[i - pixBytes];
+ up = predLine[i];
+ upLeft = upLeftBuf[pixBytes];
+ p = left + up - upLeft;
+ if ((pa = p - left) < 0)
+ pa = -pa;
+ if ((pb = p - up) < 0)
+ pb = -pb;
+ if ((pc = p - upLeft) < 0)
+ pc = -pc;
+ if (pa <= pb && pa <= pc)
+ predLine[i] = pa + (Guchar)c;
+ else if (pb <= pc)
+ predLine[i] = pb + (Guchar)c;
+ else
+ predLine[i] = pc + (Guchar)c;
+ break;
+ case 10: // PNG none
+ default: // no predictor or TIFF predictor
+ predLine[i] = (Guchar)c;
+ break;
+ }
+ }
+
+ // apply TIFF (component) predictor
+ //~ this is completely untested
+ if (predictor == 2) {
+ if (nBits == 1) {
+ inBuf = predLine[pixBytes - 1];
+ for (i = pixBytes; i < rowBytes; i += 8) {
+ // 1-bit add is just xor
+ inBuf = (inBuf << 8) | predLine[i];
+ predLine[i] ^= inBuf >> nComps;
+ }
+ } else if (nBits == 8) {
+ for (i = pixBytes; i < rowBytes; ++i) {
+ predLine[i] += predLine[i - nComps];
+ }
+ } else {
+ upLeftBuf[0] = upLeftBuf[1] = upLeftBuf[2] = upLeftBuf[3] = 0;
+ bitMask = (1 << nBits) - 1;
+ inBuf = outBuf = 0;
+ inBits = outBits = 0;
+ j = k = pixBytes;
+ for (i = 0; i < nVals; ++i) {
+ if (inBits < nBits) {
+ inBuf = (inBuf << 8) | (predLine[j++] & 0xff);
+ inBits += 8;
+ }
+ upLeftBuf[3] = upLeftBuf[2];
+ upLeftBuf[2] = upLeftBuf[1];
+ upLeftBuf[1] = upLeftBuf[0];
+ upLeftBuf[0] = (upLeftBuf[nComps] +
+ (inBuf >> (inBits - nBits))) & bitMask;
+ outBuf = (outBuf << nBits) | upLeftBuf[0];
+ inBits -= nBits;
+ outBits += nBits;
+ if (outBits > 8) {
+ predLine[k++] = (Guchar)(outBuf >> (outBits - 8));
+ }
+ }
+ if (outBits > 0) {
+ predLine[k++] = (Guchar)(outBuf << (8 - outBits));
+ }
+ }
+ }
+
+ // reset to start of line
+ predIdx = pixBytes;
+
+ return gTrue;
+}
+
+//------------------------------------------------------------------------
+// FileStream
+//------------------------------------------------------------------------
+
+FileStream::FileStream(FILE *f, int start, int length, Object *dict):
+ BaseStream(dict) {
+ this->f = f;
+ this->start = start;
+ this->length = length;
+ bufPtr = bufEnd = buf;
+ bufPos = start;
+ savePos = -1;
+}
+
+FileStream::~FileStream() {
+ close();
+}
+
+Stream *FileStream::makeSubStream(int start, int length, Object *dict) {
+ return new FileStream(f, start, length, dict);
+}
+
+void FileStream::reset() {
+ savePos = (int)ftell(f);
+ fseek(f, start, SEEK_SET);
+ bufPtr = bufEnd = buf;
+ bufPos = start;
+#ifndef NO_DECRYPTION
+ if (decrypt)
+ decrypt->reset();
+#endif
+}
+
+void FileStream::close() {
+ if (savePos >= 0) {
+ fseek(f, savePos, SEEK_SET);
+ savePos = -1;
+ }
+}
+
+GBool FileStream::fillBuf() {
+ int n;
+#ifndef NO_DECRYPTION
+ char *p;
+#endif
+
+ bufPos += bufEnd - buf;
+ bufPtr = bufEnd = buf;
+ if (length >= 0 && bufPos >= start + length) {
+ return gFalse;
+ }
+ if (length >= 0 && bufPos + fileStreamBufSize > start + length) {
+ n = start + length - bufPos;
+ } else {
+ n = fileStreamBufSize;
+ }
+ n = fread(buf, 1, n, f);
+ bufEnd = buf + n;
+ if (bufPtr >= bufEnd) {
+ return gFalse;
+ }
+#ifndef NO_DECRYPTION
+ if (decrypt) {
+ for (p = buf; p < bufEnd; ++p) {
+ *p = (char)decrypt->decryptByte((Guchar)*p);
+ }
+ }
+#endif
+ return gTrue;
+}
+
+void FileStream::setPos(int pos1) {
+ long size;
+
+ if (pos1 >= 0) {
+ fseek(f, pos1, SEEK_SET);
+ bufPos = pos1;
+ } else {
+ fseek(f, 0, SEEK_END);
+ size = ftell(f);
+ if (pos1 < -size)
+ pos1 = (int)(-size);
+ fseek(f, pos1, SEEK_END);
+ bufPos = (int)ftell(f);
+ }
+ bufPtr = bufEnd = buf;
+}
+
+void FileStream::moveStart(int delta) {
+ this->start += delta;
+ bufPtr = bufEnd = buf;
+ bufPos = start;
+}
+
+//------------------------------------------------------------------------
+// EmbedStream
+//------------------------------------------------------------------------
+
+EmbedStream::EmbedStream(Stream *str, Object *dict):
+ BaseStream(dict) {
+ this->str = str;
+}
+
+EmbedStream::~EmbedStream() {
+}
+
+Stream *EmbedStream::makeSubStream(int start, int length, Object *dict) {
+ error(-1, "Internal: called makeSubStream() on EmbedStream");
+ return NULL;
+}
+
+void EmbedStream::setPos(int pos) {
+ error(-1, "Internal: called setPos() on EmbedStream");
+}
+
+int EmbedStream::getStart() {
+ error(-1, "Internal: called getStart() on EmbedStream");
+ return 0;
+}
+
+void EmbedStream::moveStart(int start) {
+ error(-1, "Internal: called moveStart() on EmbedStream");
+}
+
+//------------------------------------------------------------------------
+// ASCIIHexStream
+//------------------------------------------------------------------------
+
+ASCIIHexStream::ASCIIHexStream(Stream *str):
+ FilterStream(str) {
+ buf = EOF;
+ eof = gFalse;
+}
+
+ASCIIHexStream::~ASCIIHexStream() {
+ delete str;
+}
+
+void ASCIIHexStream::reset() {
+ str->reset();
+ buf = EOF;
+ eof = gFalse;
+}
+
+int ASCIIHexStream::lookChar() {
+ int c1, c2, x;
+
+ if (buf != EOF)
+ return buf;
+ if (eof) {
+ buf = EOF;
+ return EOF;
+ }
+ do {
+ c1 = str->getChar();
+ } while (isspace(c1));
+ if (c1 == '>') {
+ eof = gTrue;
+ buf = EOF;
+ return buf;
+ }
+ do {
+ c2 = str->getChar();
+ } while (isspace(c2));
+ if (c2 == '>') {
+ eof = gTrue;
+ c2 = '0';
+ }
+ if (c1 >= '0' && c1 <= '9') {
+ x = (c1 - '0') << 4;
+ } else if (c1 >= 'A' && c1 <= 'F') {
+ x = (c1 - 'A' + 10) << 4;
+ } else if (c1 >= 'a' && c1 <= 'f') {
+ x = (c1 - 'a' + 10) << 4;
+ } else if (c1 == EOF) {
+ eof = gTrue;
+ x = 0;
+ } else {
+ error(getPos(), "Illegal character <%02x> in ASCIIHex stream", c1);
+ x = 0;
+ }
+ if (c2 >= '0' && c2 <= '9') {
+ x += c2 - '0';
+ } else if (c2 >= 'A' && c2 <= 'F') {
+ x += c2 - 'A' + 10;
+ } else if (c2 >= 'a' && c2 <= 'f') {
+ x += c2 - 'a' + 10;
+ } else if (c2 == EOF) {
+ eof = gTrue;
+ x = 0;
+ } else {
+ error(getPos(), "Illegal character <%02x> in ASCIIHex stream", c2);
+ }
+ buf = x & 0xff;
+ return buf;
+}
+
+GString *ASCIIHexStream::getPSFilter(char *indent) {
+ GString *s;
+
+ s = str->getPSFilter(indent);
+ s->append(indent)->append("/ASCIIHexDecode filter\n");
+ return s;
+}
+
+GBool ASCIIHexStream::isBinary(GBool last) {
+ return str->isBinary(gFalse);
+}
+
+//------------------------------------------------------------------------
+// ASCII85Stream
+//------------------------------------------------------------------------
+
+ASCII85Stream::ASCII85Stream(Stream *str):
+ FilterStream(str) {
+ index = n = 0;
+ eof = gFalse;
+}
+
+ASCII85Stream::~ASCII85Stream() {
+ delete str;
+}
+
+void ASCII85Stream::reset() {
+ str->reset();
+ index = n = 0;
+ eof = gFalse;
+}
+
+int ASCII85Stream::lookChar() {
+ int k;
+ Gulong t;
+
+ if (index >= n) {
+ if (eof)
+ return EOF;
+ index = 0;
+ do {
+ c[0] = str->getChar();
+ } while (c[0] == '\n' || c[0] == '\r');
+ if (c[0] == '~' || c[0] == EOF) {
+ eof = gTrue;
+ n = 0;
+ return EOF;
+ } else if (c[0] == 'z') {
+ b[0] = b[1] = b[2] = b[3] = 0;
+ n = 4;
+ } else {
+ for (k = 1; k < 5; ++k) {
+ do {
+ c[k] = str->getChar();
+ } while (c[k] == '\n' || c[k] == '\r');
+ if (c[k] == '~' || c[k] == EOF)
+ break;
+ }
+ n = k - 1;
+ if (k < 5 && (c[k] == '~' || c[k] == EOF)) {
+ for (++k; k < 5; ++k)
+ c[k] = 0x21 + 84;
+ eof = gTrue;
+ }
+ t = 0;
+ for (k = 0; k < 5; ++k)
+ t = t * 85 + (c[k] - 0x21);
+ for (k = 3; k >= 0; --k) {
+ b[k] = (int)(t & 0xff);
+ t >>= 8;
+ }
+ }
+ }
+ return b[index];
+}
+
+GString *ASCII85Stream::getPSFilter(char *indent) {
+ GString *s;
+
+ s = str->getPSFilter(indent);
+ s->append(indent)->append("/ASCII85Decode filter\n");
+ return s;
+}
+
+GBool ASCII85Stream::isBinary(GBool last) {
+ return str->isBinary(gFalse);
+}
+
+//------------------------------------------------------------------------
+// LZWStream
+//------------------------------------------------------------------------
+
+LZWStream::LZWStream(Stream *str, int predictor1, int columns1, int colors1,
+ int bits1, int early1):
+ FilterStream(str) {
+ if (predictor1 != 1) {
+ pred = new StreamPredictor(this, predictor1, columns1, colors1, bits1);
+ } else {
+ pred = NULL;
+ }
+ early = early1;
+ zPipe = NULL;
+ bufPtr = bufEnd = buf;
+}
+
+LZWStream::~LZWStream() {
+ if (zPipe) {
+#ifdef HAVE_POPEN
+ pclose(zPipe);
+#else
+ fclose(zPipe);
+#endif
+ zPipe = NULL;
+ unlink(zName->getCString());
+ delete zName;
+ }
+ if (pred) {
+ delete pred;
+ }
+ delete str;
+}
+
+int LZWStream::getChar() {
+ if (pred) {
+ return pred->getChar();
+ }
+ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff);
+}
+
+int LZWStream::lookChar() {
+ if (pred) {
+ return pred->lookChar();
+ }
+ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff);
+}
+
+int LZWStream::getRawChar() {
+ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff);
+}
+
+void LZWStream::reset() {
+ FILE *f;
+ GString *zCmd;
+
+ //----- close old LZW stream
+ if (zPipe) {
+#ifdef HAVE_POPEN
+ pclose(zPipe);
+#else
+ fclose(zPipe);
+#endif
+ zPipe = NULL;
+ unlink(zName->getCString());
+ delete zName;
+ }
+
+ //----- tell Delorie runtime to spawn a new instance of COMMAND.COM
+ // to run gzip
+#if __DJGPP__
+ if (!setDJSYSFLAGS) {
+ setenv("DJSYSFLAGS", "0x0002", 0);
+ setDJSYSFLAGS = gTrue;
+ }
+#endif
+
+ //----- create the .Z file
+ if (!openTempFile(&zName, &f, "wb", ".Z")) {
+ error(getPos(), "Couldn't create temporary file for LZW stream");
+ return;
+ }
+ dumpFile(f);
+ fclose(f);
+
+ //----- execute uncompress / gzip
+ zCmd = new GString(uncompressCmd);
+ zCmd->append(' ');
+ zCmd->append(zName);
+#if defined(MACOS)
+ long magicCookie;
+ // first we open the engine up
+ OSErr err = OpenSITEngine(kUseExternalEngine, &magicCookie);
+ // if we found it - let's use it!
+ if (!err && magicCookie) {
+ // make sure we have the correct version of the Engine
+ if (GetSITEngineVersion(magicCookie) >= kFirstSupportedEngine) {
+ FSSpec myFSS;
+ Str255 pName;
+ strcpy((char *)pName, zName->getCString());
+ c2pstr((char *)pName);
+ FSMakeFSSpec(0, 0, pName, &myFSS);
+ short ftype = DetermineFileType(magicCookie, &myFSS);
+ OSErr expandErr = ExpandFSSpec(magicCookie, ftype, &myFSS,
+ NULL, NULL, kCreateFolderNever,
+ kDeleteOriginal, kTextConvertSmart);
+ }
+ }
+#elif defined(HAVE_POPEN)
+ if (!(zPipe = popen(zCmd->getCString(), POPEN_READ_MODE))) {
+ error(getPos(), "Couldn't popen '%s'", zCmd->getCString());
+ unlink(zName->getCString());
+ delete zName;
+ return;
+ }
+#else // HAVE_POPEN
+#ifdef VMS
+ if (!system(zCmd->getCString())) {
+#else
+ if (system(zCmd->getCString())) {
+#endif
+ error(getPos(), "Couldn't execute '%s'", zCmd->getCString());
+ unlink(zName->getCString());
+ delete zName;
+ return;
+ }
+ zName->del(zName->getLength() - 2, 2);
+ if (!(zPipe = fopen(zName->getCString(), "rb"))) {
+ error(getPos(), "Couldn't open uncompress file '%s'", zName->getCString());
+ unlink(zName->getCString());
+ delete zName;
+ return;
+ }
+#endif // HAVE_POPEN
+
+ //----- clean up
+ delete zCmd;
+
+ //----- initialize buffer
+ bufPtr = bufEnd = buf;
+}
+
+void LZWStream::dumpFile(FILE *f) {
+ int outCodeBits; // size of output code
+ int outBits; // max output code
+ int outBuf[8]; // output buffer
+ int outData; // temporary output buffer
+ int inCode, outCode; // input and output codes
+ int nextCode; // next code index
+ GBool eof; // set when EOF is reached
+ GBool clear; // set if table needs to be cleared
+ GBool first; // indicates first code word after clear
+ int i, j;
+
+ str->reset();
+
+ // magic number
+ fputc(0x1f, f);
+ fputc(0x9d, f);
+
+ // max code length, block mode flag
+ fputc(0x8c, f);
+
+ // init input side
+ inCodeBits = 9;
+ inputBuf = 0;
+ inputBits = 0;
+ eof = gFalse;
+
+ // init output side
+ outCodeBits = 9;
+
+ // clear table
+ first = gTrue;
+ nextCode = 258;
+
+ clear = gFalse;
+ do {
+ for (i = 0; i < 8; ++i) {
+ // check for table overflow
+ if (nextCode + early > 0x1001) {
+ inCode = 256;
+
+ // read input code
+ } else {
+ do {
+ inCode = getCode();
+ if (inCode == EOF) {
+ eof = gTrue;
+ inCode = 0;
+ }
+ } while (first && inCode == 256);
+ }
+
+ // compute output code
+ if (inCode < 256) {
+ outCode = inCode;
+ } else if (inCode == 256) {
+ outCode = 256;
+ clear = gTrue;
+ } else if (inCode == 257) {
+ outCode = 0;
+ eof = gTrue;
+ } else {
+ outCode = inCode - 1;
+ }
+ outBuf[i] = outCode;
+
+ // next code index
+ if (first)
+ first = gFalse;
+ else
+ ++nextCode;
+
+ // check input code size
+ if (nextCode + early == 0x200)
+ inCodeBits = 10;
+ else if (nextCode + early == 0x400) {
+ inCodeBits = 11;
+ } else if (nextCode + early == 0x800) {
+ inCodeBits = 12;
+ }
+
+ // check for eof/clear
+ if (eof)
+ break;
+ if (clear) {
+ i = 8;
+ break;
+ }
+ }
+
+ // write output block
+ outData = 0;
+ outBits = 0;
+ j = 0;
+ while (j < i || outBits > 0) {
+ if (outBits < 8 && j < i) {
+ outData = outData | (outBuf[j++] << outBits);
+ outBits += outCodeBits;
+ }
+ fputc(outData & 0xff, f);
+ outData >>= 8;
+ outBits -= 8;
+ }
+
+ // check output code size
+ if (nextCode - 1 == 512 ||
+ nextCode - 1 == 1024 ||
+ nextCode - 1 == 2048 ||
+ nextCode - 1 == 4096) {
+ outCodeBits = inCodeBits;
+ }
+
+ // clear table if necessary
+ if (clear) {
+ inCodeBits = 9;
+ outCodeBits = 9;
+ first = gTrue;
+ nextCode = 258;
+ clear = gFalse;
+ }
+ } while (!eof);
+}
+
+int LZWStream::getCode() {
+ int c;
+ int code;
+
+ while (inputBits < inCodeBits) {
+ if ((c = str->getChar()) == EOF)
+ return EOF;
+ inputBuf = (inputBuf << 8) | (c & 0xff);
+ inputBits += 8;
+ }
+ code = (inputBuf >> (inputBits - inCodeBits)) & ((1 << inCodeBits) - 1);
+ inputBits -= inCodeBits;
+ return code;
+}
+
+GBool LZWStream::fillBuf() {
+ int n;
+
+ if (!zPipe)
+ return gFalse;
+ if ((n = fread(buf, 1, 256, zPipe)) < 256) {
+#ifdef HAVE_POPEN
+ pclose(zPipe);
+#else
+ fclose(zPipe);
+#endif
+ zPipe = NULL;
+ unlink(zName->getCString());
+ delete zName;
+ }
+ bufPtr = buf;
+ bufEnd = buf + n;
+ return n > 0;
+}
+
+GString *LZWStream::getPSFilter(char *indent) {
+ GString *s;
+
+ if (pred) {
+ return NULL;
+ }
+ s = str->getPSFilter(indent);
+ s->append(indent)->append("/LZWDecode filter\n");
+ return s;
+}
+
+GBool LZWStream::isBinary(GBool last) {
+ return str->isBinary(gTrue);
+}
+
+//------------------------------------------------------------------------
+// RunLengthStream
+//------------------------------------------------------------------------
+
+RunLengthStream::RunLengthStream(Stream *str):
+ FilterStream(str) {
+ bufPtr = bufEnd = buf;
+ eof = gFalse;
+}
+
+RunLengthStream::~RunLengthStream() {
+ delete str;
+}
+
+void RunLengthStream::reset() {
+ str->reset();
+ bufPtr = bufEnd = buf;
+ eof = gFalse;
+}
+
+GString *RunLengthStream::getPSFilter(char *indent) {
+ GString *s;
+
+ s = str->getPSFilter(indent);
+ s->append(indent)->append("/RunLengthDecode filter\n");
+ return s;
+}
+
+GBool RunLengthStream::isBinary(GBool last) {
+ return str->isBinary(gTrue);
+}
+
+GBool RunLengthStream::fillBuf() {
+ int c;
+ int n, i;
+
+ if (eof)
+ return gFalse;
+ c = str->getChar();
+ if (c == 0x80 || c == EOF) {
+ eof = gTrue;
+ return gFalse;
+ }
+ if (c < 0x80) {
+ n = c + 1;
+ for (i = 0; i < n; ++i)
+ buf[i] = (char)str->getChar();
+ } else {
+ n = 0x101 - c;
+ c = str->getChar();
+ for (i = 0; i < n; ++i)
+ buf[i] = (char)c;
+ }
+ bufPtr = buf;
+ bufEnd = buf + n;
+ return gTrue;
+}
+
+//------------------------------------------------------------------------
+// CCITTFaxStream
+//------------------------------------------------------------------------
+
+CCITTFaxStream::CCITTFaxStream(Stream *str, int encoding, GBool endOfLine,
+ GBool byteAlign, int columns, int rows,
+ GBool endOfBlock, GBool black):
+ FilterStream(str) {
+ this->encoding = encoding;
+ this->endOfLine = endOfLine;
+ this->byteAlign = byteAlign;
+ this->columns = columns;
+ this->rows = rows;
+ this->endOfBlock = endOfBlock;
+ this->black = black;
+ refLine = (short *)gmalloc((columns + 3) * sizeof(short));
+ codingLine = (short *)gmalloc((columns + 2) * sizeof(short));
+
+ eof = gFalse;
+ row = 0;
+ nextLine2D = encoding < 0;
+ inputBits = 0;
+ codingLine[0] = 0;
+ codingLine[1] = refLine[2] = columns;
+ a0 = 1;
+
+ buf = EOF;
+}
+
+CCITTFaxStream::~CCITTFaxStream() {
+ delete str;
+ gfree(refLine);
+ gfree(codingLine);
+}
+
+void CCITTFaxStream::reset() {
+ int n;
+
+ str->reset();
+ eof = gFalse;
+ row = 0;
+ nextLine2D = encoding < 0;
+ inputBits = 0;
+ codingLine[0] = 0;
+ codingLine[1] = refLine[2] = columns;
+ a0 = 1;
+ buf = EOF;
+
+ // get initial end-of-line marker and 2D encoding tag
+ if (endOfBlock) {
+ if (lookBits(12) == 0x001) {
+ eatBits(12);
+ }
+ } else {
+ for (n = 0; n < 11 && lookBits(n) == 0; ++n) ;
+ if (n == 11 && lookBits(12) == 0x001) {
+ eatBits(12);
+ }
+ }
+ if (encoding > 0) {
+ nextLine2D = !lookBits(1);
+ eatBits(1);
+ }
+}
+
+int CCITTFaxStream::lookChar() {
+ short code1, code2, code3;
+ int a0New;
+#if 0 //~
+ GBool err;
+#endif
+ GBool gotEOL;
+ int ret;
+ int bits, i;
+
+ // if at eof just return EOF
+ if (eof && codingLine[a0] >= columns) {
+ return EOF;
+ }
+
+ // read the next row
+#if 0 //~
+ err = gFalse;
+#endif
+ if (codingLine[a0] >= columns) {
+
+ // 2-D encoding
+ if (nextLine2D) {
+ for (i = 0; codingLine[i] < columns; ++i)
+ refLine[i] = codingLine[i];
+ refLine[i] = refLine[i + 1] = columns;
+ b1 = 1;
+ a0New = codingLine[a0 = 0] = 0;
+ do {
+ code1 = getTwoDimCode();
+ switch (code1) {
+ case twoDimPass:
+ if (refLine[b1] < columns) {
+ a0New = refLine[b1 + 1];
+ b1 += 2;
+ }
+ break;
+ case twoDimHoriz:
+ if ((a0 & 1) == 0) {
+ code1 = code2 = 0;
+ do {
+ code1 += code3 = getWhiteCode();
+ } while (code3 >= 64);
+ do {
+ code2 += code3 = getBlackCode();
+ } while (code3 >= 64);
+ } else {
+ code1 = code2 = 0;
+ do {
+ code1 += code3 = getBlackCode();
+ } while (code3 >= 64);
+ do {
+ code2 += code3 = getWhiteCode();
+ } while (code3 >= 64);
+ }
+ codingLine[a0 + 1] = a0New + code1;
+ ++a0;
+ a0New = codingLine[a0 + 1] = codingLine[a0] + code2;
+ ++a0;
+ while (refLine[b1] <= codingLine[a0] && refLine[b1] < columns)
+ b1 += 2;
+ break;
+ case twoDimVert0:
+ a0New = codingLine[++a0] = refLine[b1];
+ if (refLine[b1] < columns) {
+ ++b1;
+ while (refLine[b1] <= codingLine[a0] && refLine[b1] < columns)
+ b1 += 2;
+ }
+ break;
+ case twoDimVertR1:
+ a0New = codingLine[++a0] = refLine[b1] + 1;
+ if (refLine[b1] < columns) {
+ ++b1;
+ while (refLine[b1] <= codingLine[a0] && refLine[b1] < columns)
+ b1 += 2;
+ }
+ break;
+ case twoDimVertL1:
+ a0New = codingLine[++a0] = refLine[b1] - 1;
+ --b1;
+ while (refLine[b1] <= codingLine[a0] && refLine[b1] < columns)
+ b1 += 2;
+ break;
+ case twoDimVertR2:
+ a0New = codingLine[++a0] = refLine[b1] + 2;
+ if (refLine[b1] < columns) {
+ ++b1;
+ while (refLine[b1] <= codingLine[a0] && refLine[b1] < columns)
+ b1 += 2;
+ }
+ break;
+ case twoDimVertL2:
+ a0New = codingLine[++a0] = refLine[b1] - 2;
+ --b1;
+ while (refLine[b1] <= codingLine[a0] && refLine[b1] < columns)
+ b1 += 2;
+ break;
+ case twoDimVertR3:
+ a0New = codingLine[++a0] = refLine[b1] + 3;
+ if (refLine[b1] < columns) {
+ ++b1;
+ while (refLine[b1] <= codingLine[a0] && refLine[b1] < columns)
+ b1 += 2;
+ }
+ break;
+ case twoDimVertL3:
+ a0New = codingLine[++a0] = refLine[b1] - 3;
+ --b1;
+ while (refLine[b1] <= codingLine[a0] && refLine[b1] < columns)
+ b1 += 2;
+ break;
+ case EOF:
+ eof = gTrue;
+ codingLine[a0 = 0] = columns;
+ return EOF;
+ default:
+ error(getPos(), "Bad 2D code %04x in CCITTFax stream", code1);
+#if 0 //~
+ err = gTrue;
+ break;
+#else
+ eof = gTrue;
+ return EOF;
+#endif
+ }
+ } while (codingLine[a0] < columns);
+
+ // 1-D encoding
+ } else {
+ codingLine[a0 = 0] = 0;
+ while (1) {
+ code1 = 0;
+ do {
+ code1 += code3 = getWhiteCode();
+ } while (code3 >= 64);
+ codingLine[a0+1] = codingLine[a0] + code1;
+ ++a0;
+ if (codingLine[a0] >= columns)
+ break;
+ code2 = 0;
+ do {
+ code2 += code3 = getBlackCode();
+ } while (code3 >= 64);
+ codingLine[a0+1] = codingLine[a0] + code2;
+ ++a0;
+ if (codingLine[a0] >= columns)
+ break;
+ }
+ }
+
+ if (codingLine[a0] != columns) {
+ error(getPos(), "CCITTFax row is wrong length (%d)", codingLine[a0]);
+#if 0 //~
+ err = gTrue;
+#endif
+ }
+
+ // byte-align the row
+ if (byteAlign) {
+ inputBits &= ~7;
+ }
+
+ // check for end-of-line marker, skipping over any extra zero bits
+ gotEOL = gFalse;
+ if (!endOfBlock && row == rows - 1) {
+ eof = gTrue;
+ } else {
+ code1 = lookBits(12);
+ while (code1 == 0) {
+ eatBits(1);
+ code1 = lookBits(12);
+ }
+ if (code1 == 0x001) {
+ eatBits(12);
+ gotEOL = gTrue;
+ } else if (code1 == EOF) {
+ eof = gTrue;
+ }
+ }
+
+ // get 2D encoding tag
+ if (!eof && encoding > 0) {
+ nextLine2D = !lookBits(1);
+ eatBits(1);
+ }
+
+ // check for end-of-block marker
+ if (endOfBlock && gotEOL) {
+ code1 = lookBits(12);
+ if (code1 == 0x001) {
+ eatBits(12);
+ if (encoding > 0) {
+ lookBits(1);
+ eatBits(1);
+ }
+ if (encoding >= 0) {
+ for (i = 0; i < 4; ++i) {
+ code1 = lookBits(12);
+ if (code1 != 0x001) {
+ error(getPos(), "Bad RTC code in CCITTFax stream");
+ }
+ eatBits(12);
+ if (encoding > 0) {
+ lookBits(1);
+ eatBits(1);
+ }
+ }
+ }
+ eof = gTrue;
+ }
+ }
+
+#if 0 //~
+ // This looks for an end-of-line marker after an error, however
+ // some (most?) CCITT streams in PDF files don't use end-of-line
+ // markers, and the just-plow-on technique works better in those
+ // cases.
+ else if (err) {
+ do {
+ if (code1 == EOF) {
+ eof = gTrue;
+ return EOF;
+ }
+ eatBits(1);
+ code1 = look13Bits();
+ } while ((code1 >> 1) != 0x001);
+ eatBits(12);
+ codingLine[++a0] = columns;
+ if (encoding > 0) {
+ eatBits(1);
+ nextLine2D = !(code1 & 1);
+ }
+ }
+#endif
+
+ a0 = 0;
+ outputBits = codingLine[1] - codingLine[0];
+ if (outputBits == 0) {
+ a0 = 1;
+ outputBits = codingLine[2] - codingLine[1];
+ }
+
+ ++row;
+ }
+
+ // get a byte
+ if (outputBits >= 8) {
+ ret = ((a0 & 1) == 0) ? 0xff : 0x00;
+ if ((outputBits -= 8) == 0) {
+ ++a0;
+ if (codingLine[a0] < columns) {
+ outputBits = codingLine[a0 + 1] - codingLine[a0];
+ }
+ }
+ } else {
+ bits = 8;
+ ret = 0;
+ do {
+ if (outputBits > bits) {
+ i = bits;
+ bits = 0;
+ if ((a0 & 1) == 0) {
+ ret |= 0xff >> (8 - i);
+ }
+ outputBits -= i;
+ } else {
+ i = outputBits;
+ bits -= outputBits;
+ if ((a0 & 1) == 0) {
+ ret |= (0xff >> (8 - i)) << bits;
+ }
+ outputBits = 0;
+ ++a0;
+ if (codingLine[a0] < columns) {
+ outputBits = codingLine[a0 + 1] - codingLine[a0];
+ }
+ }
+ } while (bits > 0 && codingLine[a0] < columns);
+ }
+ buf = black ? (ret ^ 0xff) : ret;
+ return buf;
+}
+
+short CCITTFaxStream::getTwoDimCode() {
+ short code;
+ CCITTCode *p;
+ int n;
+
+ code = 0; // make gcc happy
+ if (endOfBlock) {
+ code = lookBits(7);
+ p = &twoDimTab1[code];
+ if (p->bits > 0) {
+ eatBits(p->bits);
+ return p->n;
+ }
+ } else {
+ for (n = 1; n <= 7; ++n) {
+ code = lookBits(n);
+ if (n < 7) {
+ code <<= 7 - n;
+ }
+ p = &twoDimTab1[code];
+ if (p->bits == n) {
+ eatBits(n);
+ return p->n;
+ }
+ }
+ }
+ error(getPos(), "Bad two dim code (%04x) in CCITTFax stream", code);
+ return EOF;
+}
+
+short CCITTFaxStream::getWhiteCode() {
+ short code;
+ CCITTCode *p;
+ int n;
+
+ code = 0; // make gcc happy
+ if (endOfBlock) {
+ code = lookBits(12);
+ if ((code >> 5) == 0) {
+ p = &whiteTab1[code];
+ } else {
+ p = &whiteTab2[code >> 3];
+ }
+ if (p->bits > 0) {
+ eatBits(p->bits);
+ return p->n;
+ }
+ } else {
+ for (n = 1; n <= 9; ++n) {
+ code = lookBits(n);
+ if (n < 9) {
+ code <<= 9 - n;
+ }
+ p = &whiteTab2[code];
+ if (p->bits == n) {
+ eatBits(n);
+ return p->n;
+ }
+ }
+ for (n = 11; n <= 12; ++n) {
+ code = lookBits(n);
+ if (n < 12) {
+ code <<= 12 - n;
+ }
+ p = &whiteTab1[code];
+ if (p->bits == n) {
+ eatBits(n);
+ return p->n;
+ }
+ }
+ }
+ error(getPos(), "Bad white code (%04x) in CCITTFax stream", code);
+ // eat a bit and return a positive number so that the caller doesn't
+ // go into an infinite loop
+ eatBits(1);
+ return 1;
+}
+
+short CCITTFaxStream::getBlackCode() {
+ short code;
+ CCITTCode *p;
+ int n;
+
+ code = 0; // make gcc happy
+ if (endOfBlock) {
+ code = lookBits(13);
+ if ((code >> 7) == 0) {
+ p = &blackTab1[code];
+ } else if ((code >> 9) == 0) {
+ p = &blackTab2[(code >> 1) - 64];
+ } else {
+ p = &blackTab3[code >> 7];
+ }
+ if (p->bits > 0) {
+ eatBits(p->bits);
+ return p->n;
+ }
+ } else {
+ for (n = 2; n <= 6; ++n) {
+ code = lookBits(n);
+ if (n < 6) {
+ code <<= 6 - n;
+ }
+ p = &blackTab3[code];
+ if (p->bits == n) {
+ eatBits(n);
+ return p->n;
+ }
+ }
+ for (n = 7; n <= 12; ++n) {
+ code = lookBits(n);
+ if (n < 12) {
+ code <<= 12 - n;
+ }
+ if (code >= 64) {
+ p = &blackTab2[code - 64];
+ if (p->bits == n) {
+ eatBits(n);
+ return p->n;
+ }
+ }
+ }
+ for (n = 10; n <= 13; ++n) {
+ code = lookBits(n);
+ if (n < 13) {
+ code <<= 13 - n;
+ }
+ p = &blackTab1[code];
+ if (p->bits == n) {
+ eatBits(n);
+ return p->n;
+ }
+ }
+ }
+ error(getPos(), "Bad black code (%04x) in CCITTFax stream", code);
+ // eat a bit and return a positive number so that the caller doesn't
+ // go into an infinite loop
+ eatBits(1);
+ return 1;
+}
+
+short CCITTFaxStream::lookBits(int n) {
+ int c;
+
+ while (inputBits < n) {
+ if ((c = str->getChar()) == EOF) {
+ if (inputBits == 0) {
+ return EOF;
+ }
+ // near the end of the stream, the caller may ask for more bits
+ // than are available, but there may still be a valid code in
+ // however many bits are available -- we need to return correct
+ // data in this case
+ return (inputBuf << (n - inputBits)) & (0xffff >> (16 - n));
+ }
+ inputBuf = (inputBuf << 8) + c;
+ inputBits += 8;
+ }
+ return (inputBuf >> (inputBits - n)) & (0xffff >> (16 - n));
+}
+
+GString *CCITTFaxStream::getPSFilter(char *indent) {
+ GString *s;
+ char s1[50];
+
+ s = str->getPSFilter(indent);
+ s->append(indent)->append("<< ");
+ if (encoding != 0) {
+ sprintf(s1, "/K %d ", encoding);
+ s->append(s1);
+ }
+ if (endOfLine) {
+ s->append("/EndOfLine true ");
+ }
+ if (byteAlign) {
+ s->append("/EncodedByteAlign true ");
+ }
+ sprintf(s1, "/Columns %d ", columns);
+ s->append(s1);
+ if (rows != 0) {
+ sprintf(s1, "/Rows %d ", rows);
+ s->append(s1);
+ }
+ if (!endOfBlock) {
+ s->append("/EndOfBlock false ");
+ }
+ if (black) {
+ s->append("/BlackIs1 true ");
+ }
+ s->append(">> /CCITTFaxDecode filter\n");
+ return s;
+}
+
+GBool CCITTFaxStream::isBinary(GBool last) {
+ return str->isBinary(gTrue);
+}
+
+//------------------------------------------------------------------------
+// DCTStream
+//------------------------------------------------------------------------
+
+// IDCT constants (20.12 fixed point format)
+#ifndef FP_IDCT
+#define dctCos1 4017 // cos(pi/16)
+#define dctSin1 799 // sin(pi/16)
+#define dctCos3 3406 // cos(3*pi/16)
+#define dctSin3 2276 // sin(3*pi/16)
+#define dctCos6 1567 // cos(6*pi/16)
+#define dctSin6 3784 // sin(6*pi/16)
+#define dctSqrt2 5793 // sqrt(2)
+#define dctSqrt1d2 2896 // sqrt(2) / 2
+#endif
+
+// IDCT constants
+#ifdef FP_IDCT
+#define dctCos1 0.98078528 // cos(pi/16)
+#define dctSin1 0.19509032 // sin(pi/16)
+#define dctCos3 0.83146961 // cos(3*pi/16)
+#define dctSin3 0.55557023 // sin(3*pi/16)
+#define dctCos6 0.38268343 // cos(6*pi/16)
+#define dctSin6 0.92387953 // sin(6*pi/16)
+#define dctSqrt2 1.41421356 // sqrt(2)
+#define dctSqrt1d2 0.70710678 // sqrt(2) / 2
+#endif
+
+// color conversion parameters (16.16 fixed point format)
+#define dctCrToR 91881 // 1.4020
+#define dctCbToG -22553 // -0.3441363
+#define dctCrToG -46802 // -0.71413636
+#define dctCbToB 116130 // 1.772
+
+// clip [-256,511] --> [0,255]
+#define dctClipOffset 256
+static Guchar dctClip[768];
+static int dctClipInit = 0;
+
+// zig zag decode map
+static int dctZigZag[64] = {
+ 0,
+ 1, 8,
+ 16, 9, 2,
+ 3, 10, 17, 24,
+ 32, 25, 18, 11, 4,
+ 5, 12, 19, 26, 33, 40,
+ 48, 41, 34, 27, 20, 13, 6,
+ 7, 14, 21, 28, 35, 42, 49, 56,
+ 57, 50, 43, 36, 29, 22, 15,
+ 23, 30, 37, 44, 51, 58,
+ 59, 52, 45, 38, 31,
+ 39, 46, 53, 60,
+ 61, 54, 47,
+ 55, 62,
+ 63
+};
+
+DCTStream::DCTStream(Stream *str):
+ FilterStream(str) {
+ int i, j;
+
+ width = height = 0;
+ mcuWidth = mcuHeight = 0;
+ numComps = 0;
+ comp = 0;
+ x = y = dy = 0;
+ for (i = 0; i < 4; ++i)
+ for (j = 0; j < 32; ++j)
+ rowBuf[i][j] = NULL;
+
+ if (!dctClipInit) {
+ for (i = -256; i < 0; ++i)
+ dctClip[dctClipOffset + i] = 0;
+ for (i = 0; i < 256; ++i)
+ dctClip[dctClipOffset + i] = i;
+ for (i = 256; i < 512; ++i)
+ dctClip[dctClipOffset + i] = 255;
+ dctClipInit = 1;
+ }
+}
+
+DCTStream::~DCTStream() {
+ int i, j;
+
+ delete str;
+ for (i = 0; i < numComps; ++i)
+ for (j = 0; j < mcuHeight; ++j)
+ gfree(rowBuf[i][j]);
+}
+
+void DCTStream::reset() {
+ str->reset();
+ if (!readHeader()) {
+ y = height;
+ return;
+ }
+ restartMarker = 0xd0;
+ restart();
+}
+
+int DCTStream::getChar() {
+ int c;
+
+ c = lookChar();
+ if (c == EOF)
+ return EOF;
+ if (++comp == numComps) {
+ comp = 0;
+ if (++x == width) {
+ x = 0;
+ ++y;
+ ++dy;
+ }
+ }
+ if (y == height)
+ readTrailer();
+ return c;
+}
+
+int DCTStream::lookChar() {
+ if (y >= height)
+ return EOF;
+ if (dy >= mcuHeight) {
+ if (!readMCURow()) {
+ y = height;
+ return EOF;
+ }
+ comp = 0;
+ x = 0;
+ dy = 0;
+ }
+ return rowBuf[comp][dy][x];
+}
+
+void DCTStream::restart() {
+ int i;
+
+ inputBits = 0;
+ restartCtr = restartInterval;
+ for (i = 0; i < numComps; ++i)
+ compInfo[i].prevDC = 0;
+}
+
+GBool DCTStream::readMCURow() {
+ Guchar data[64];
+ Guchar *p1, *p2;
+ int pY, pCb, pCr, pR, pG, pB;
+ int h, v, horiz, vert, hSub, vSub;
+ int x1, x2, y2, x3, y3, x4, y4, x5, y5, cc, i;
+ int c;
+
+ for (x1 = 0; x1 < width; x1 += mcuWidth) {
+
+ // deal with restart marker
+ if (restartInterval > 0 && restartCtr == 0) {
+ c = readMarker();
+ if (c != restartMarker) {
+ error(getPos(), "Bad DCT data: incorrect restart marker");
+ return gFalse;
+ }
+ if (++restartMarker == 0xd8)
+ restartMarker = 0xd0;
+ restart();
+ }
+
+ // read one MCU
+ for (cc = 0; cc < numComps; ++cc) {
+ h = compInfo[cc].hSample;
+ v = compInfo[cc].vSample;
+ horiz = mcuWidth / h;
+ vert = mcuHeight / v;
+ hSub = horiz / 8;
+ vSub = vert / 8;
+ for (y2 = 0; y2 < mcuHeight; y2 += vert) {
+ for (x2 = 0; x2 < mcuWidth; x2 += horiz) {
+ if (!readDataUnit(&dcHuffTables[compInfo[cc].dcHuffTable],
+ &acHuffTables[compInfo[cc].acHuffTable],
+ quantTables[compInfo[cc].quantTable],
+ &compInfo[cc].prevDC,
+ data))
+ return gFalse;
+ if (hSub == 1 && vSub == 1) {
+ for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
+ p1 = &rowBuf[cc][y2+y3][x1+x2];
+ p1[0] = data[i];
+ p1[1] = data[i+1];
+ p1[2] = data[i+2];
+ p1[3] = data[i+3];
+ p1[4] = data[i+4];
+ p1[5] = data[i+5];
+ p1[6] = data[i+6];
+ p1[7] = data[i+7];
+ }
+ } else if (hSub == 2 && vSub == 2) {
+ for (y3 = 0, i = 0; y3 < 16; y3 += 2, i += 8) {
+ p1 = &rowBuf[cc][y2+y3][x1+x2];
+ p2 = &rowBuf[cc][y2+y3+1][x1+x2];
+ p1[0] = p1[1] = p2[0] = p2[1] = data[i];
+ p1[2] = p1[3] = p2[2] = p2[3] = data[i+1];
+ p1[4] = p1[5] = p2[4] = p2[5] = data[i+2];
+ p1[6] = p1[7] = p2[6] = p2[7] = data[i+3];
+ p1[8] = p1[9] = p2[8] = p2[9] = data[i+4];
+ p1[10] = p1[11] = p2[10] = p2[11] = data[i+5];
+ p1[12] = p1[13] = p2[12] = p2[13] = data[i+6];
+ p1[14] = p1[15] = p2[14] = p2[15] = data[i+7];
+ }
+ } else {
+ i = 0;
+ for (y3 = 0, y4 = 0; y3 < 8; ++y3, y4 += vSub) {
+ for (x3 = 0, x4 = 0; x3 < 8; ++x3, x4 += hSub) {
+ for (y5 = 0; y5 < vSub; ++y5)
+ for (x5 = 0; x5 < hSub; ++x5)
+ rowBuf[cc][y2+y4+y5][x1+x2+x4+x5] = data[i];
+ ++i;
+ }
+ }
+ }
+ }
+ }
+ }
+ --restartCtr;
+
+ // color space conversion
+ if (colorXform) {
+ // convert YCbCr to RGB
+ if (numComps == 3) {
+ for (y2 = 0; y2 < mcuHeight; ++y2) {
+ for (x2 = 0; x2 < mcuWidth; ++x2) {
+ pY = rowBuf[0][y2][x1+x2];
+ pCb = rowBuf[1][y2][x1+x2] - 128;
+ pCr = rowBuf[2][y2][x1+x2] - 128;
+ pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
+ rowBuf[0][y2][x1+x2] = dctClip[dctClipOffset + pR];
+ pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr + 32768) >> 16;
+ rowBuf[1][y2][x1+x2] = dctClip[dctClipOffset + pG];
+ pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
+ rowBuf[2][y2][x1+x2] = dctClip[dctClipOffset + pB];
+ }
+ }
+ // convert YCbCrK to CMYK (K is passed through unchanged)
+ } else if (numComps == 4) {
+ for (y2 = 0; y2 < mcuHeight; ++y2) {
+ for (x2 = 0; x2 < mcuWidth; ++x2) {
+ pY = rowBuf[0][y2][x1+x2];
+ pCb = rowBuf[1][y2][x1+x2] - 128;
+ pCr = rowBuf[2][y2][x1+x2] - 128;
+ pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
+ rowBuf[0][y2][x1+x2] = 255 - dctClip[dctClipOffset + pR];
+ pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr + 32678) >> 16;
+ rowBuf[1][y2][x1+x2] = 255 - dctClip[dctClipOffset + pG];
+ pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
+ rowBuf[2][y2][x1+x2] = 255 - dctClip[dctClipOffset + pB];
+ }
+ }
+ }
+ }
+ }
+ return gTrue;
+}
+
+// This IDCT algorithm is taken from:
+// Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz,
+// "Practical Fast 1-D DCT Algorithms with 11 Multiplications",
+// IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989,
+// 988-991.
+// The stage numbers mentioned in the comments refer to Figure 1 in this
+// paper.
+#ifndef FP_IDCT
+GBool DCTStream::readDataUnit(DCTHuffTable *dcHuffTable,
+ DCTHuffTable *acHuffTable,
+ Guchar quantTable[64], int *prevDC,
+ Guchar data[64]) {
+ int tmp1[64];
+ int v0, v1, v2, v3, v4, v5, v6, v7, t;
+ int run, size, amp;
+ int c;
+ int i, j;
+
+ // Huffman decode and dequantize
+ size = readHuffSym(dcHuffTable);
+ if (size == 9999)
+ return gFalse;
+ if (size > 0) {
+ amp = readAmp(size);
+ if (amp == 9999)
+ return gFalse;
+ } else {
+ amp = 0;
+ }
+ tmp1[0] = (*prevDC += amp) * quantTable[0];
+ for (i = 1; i < 64; ++i)
+ tmp1[i] = 0;
+ i = 1;
+ while (i < 64) {
+ run = 0;
+ while ((c = readHuffSym(acHuffTable)) == 0xf0 && run < 0x30)
+ run += 0x10;
+ if (c == 9999)
+ return gFalse;
+ if (c == 0x00) {
+ break;
+ } else {
+ run += (c >> 4) & 0x0f;
+ size = c & 0x0f;
+ amp = readAmp(size);
+ if (amp == 9999)
+ return gFalse;
+ i += run;
+ j = dctZigZag[i++];
+ tmp1[j] = amp * quantTable[j];
+ }
+ }
+
+ // inverse DCT on rows
+ for (i = 0; i < 64; i += 8) {
+
+ // stage 4
+ v0 = (dctSqrt2 * tmp1[i+0] + 128) >> 8;
+ v1 = (dctSqrt2 * tmp1[i+4] + 128) >> 8;
+ v2 = tmp1[i+2];
+ v3 = tmp1[i+6];
+ v4 = (dctSqrt1d2 * (tmp1[i+1] - tmp1[i+7]) + 128) >> 8;
+ v7 = (dctSqrt1d2 * (tmp1[i+1] + tmp1[i+7]) + 128) >> 8;
+ v5 = tmp1[i+3] << 4;
+ v6 = tmp1[i+5] << 4;
+
+ // stage 3
+ t = (v0 - v1+ 1) >> 1;
+ v0 = (v0 + v1 + 1) >> 1;
+ v1 = t;
+ t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8;
+ v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8;
+ v3 = t;
+ t = (v4 - v6 + 1) >> 1;
+ v4 = (v4 + v6 + 1) >> 1;
+ v6 = t;
+ t = (v7 + v5 + 1) >> 1;
+ v5 = (v7 - v5 + 1) >> 1;
+ v7 = t;
+
+ // stage 2
+ t = (v0 - v3 + 1) >> 1;
+ v0 = (v0 + v3 + 1) >> 1;
+ v3 = t;
+ t = (v1 - v2 + 1) >> 1;
+ v1 = (v1 + v2 + 1) >> 1;
+ v2 = t;
+ t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12;
+ v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12;
+ v7 = t;
+ t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12;
+ v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12;
+ v6 = t;
+
+ // stage 1
+ tmp1[i+0] = v0 + v7;
+ tmp1[i+7] = v0 - v7;
+ tmp1[i+1] = v1 + v6;
+ tmp1[i+6] = v1 - v6;
+ tmp1[i+2] = v2 + v5;
+ tmp1[i+5] = v2 - v5;
+ tmp1[i+3] = v3 + v4;
+ tmp1[i+4] = v3 - v4;
+ }
+
+ // inverse DCT on columns
+ for (i = 0; i < 8; ++i) {
+
+ // stage 4
+ v0 = (dctSqrt2 * tmp1[0*8+i] + 2048) >> 12;
+ v1 = (dctSqrt2 * tmp1[4*8+i] + 2048) >> 12;
+ v2 = tmp1[2*8+i];
+ v3 = tmp1[6*8+i];
+ v4 = (dctSqrt1d2 * (tmp1[1*8+i] - tmp1[7*8+i]) + 2048) >> 12;
+ v7 = (dctSqrt1d2 * (tmp1[1*8+i] + tmp1[7*8+i]) + 2048) >> 12;
+ v5 = tmp1[3*8+i];
+ v6 = tmp1[5*8+i];
+
+ // stage 3
+ t = (v0 - v1 + 1) >> 1;
+ v0 = (v0 + v1 + 1) >> 1;
+ v1 = t;
+ t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12;
+ v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12;
+ v3 = t;
+ t = (v4 - v6 + 1) >> 1;
+ v4 = (v4 + v6 + 1) >> 1;
+ v6 = t;
+ t = (v7 + v5 + 1) >> 1;
+ v5 = (v7 - v5 + 1) >> 1;
+ v7 = t;
+
+ // stage 2
+ t = (v0 - v3 + 1) >> 1;
+ v0 = (v0 + v3 + 1) >> 1;
+ v3 = t;
+ t = (v1 - v2 + 1) >> 1;
+ v1 = (v1 + v2 + 1) >> 1;
+ v2 = t;
+ t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12;
+ v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12;
+ v7 = t;
+ t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12;
+ v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12;
+ v6 = t;
+
+ // stage 1
+ tmp1[0*8+i] = v0 + v7;
+ tmp1[7*8+i] = v0 - v7;
+ tmp1[1*8+i] = v1 + v6;
+ tmp1[6*8+i] = v1 - v6;
+ tmp1[2*8+i] = v2 + v5;
+ tmp1[5*8+i] = v2 - v5;
+ tmp1[3*8+i] = v3 + v4;
+ tmp1[4*8+i] = v3 - v4;
+ }
+
+ // convert to 8-bit integers
+ for (i = 0; i < 64; ++i)
+ data[i] = dctClip[dctClipOffset + 128 + ((tmp1[i] + 8) >> 4)];
+
+ return gTrue;
+}
+#endif
+
+#ifdef FP_IDCT
+GBool DCTStream::readDataUnit(DCTHuffTable *dcHuffTable,
+ DCTHuffTable *acHuffTable,
+ Guchar quantTable[64], int *prevDC,
+ Guchar data[64]) {
+ double tmp1[64];
+ double v0, v1, v2, v3, v4, v5, v6, v7, t;
+ int run, size, amp;
+ int c;
+ int i, j;
+
+ // Huffman decode and dequantize
+ size = readHuffSym(dcHuffTable);
+ if (size == 9999)
+ return gFalse;
+ if (size > 0) {
+ amp = readAmp(size);
+ if (amp == 9999)
+ return gFalse;
+ } else {
+ amp = 0;
+ }
+ tmp1[0] = (*prevDC += amp) * quantTable[0];
+ for (i = 1; i < 64; ++i)
+ tmp1[i] = 0;
+ i = 1;
+ while (i < 64) {
+ run = 0;
+ while ((c = readHuffSym(acHuffTable)) == 0xf0 && run < 0x30)
+ run += 0x10;
+ if (c == 9999)
+ return gFalse;
+ if (c == 0x00) {
+ break;
+ } else {
+ run += (c >> 4) & 0x0f;
+ size = c & 0x0f;
+ amp = readAmp(size);
+ if (amp == 9999)
+ return gFalse;
+ i += run;
+ j = dctZigZag[i++];
+ tmp1[j] = amp * quantTable[j];
+ }
+ }
+
+ // inverse DCT on rows
+ for (i = 0; i < 64; i += 8) {
+
+ // stage 4
+ v0 = dctSqrt2 * tmp1[i+0];
+ v1 = dctSqrt2 * tmp1[i+4];
+ v2 = tmp1[i+2];
+ v3 = tmp1[i+6];
+ v4 = dctSqrt1d2 * (tmp1[i+1] - tmp1[i+7]);
+ v7 = dctSqrt1d2 * (tmp1[i+1] + tmp1[i+7]);
+ v5 = tmp1[i+3];
+ v6 = tmp1[i+5];
+
+ // stage 3
+ t = 0.5 * (v0 - v1);
+ v0 = 0.5 * (v0 + v1);
+ v1 = t;
+ t = v2 * dctSin6 + v3 * dctCos6;
+ v2 = v2 * dctCos6 - v3 * dctSin6;
+ v3 = t;
+ t = 0.5 * (v4 - v6);
+ v4 = 0.5 * (v4 + v6);
+ v6 = t;
+ t = 0.5 * (v7 + v5);
+ v5 = 0.5 * (v7 - v5);
+ v7 = t;
+
+ // stage 2
+ t = 0.5 * (v0 - v3);
+ v0 = 0.5 * (v0 + v3);
+ v3 = t;
+ t = 0.5 * (v1 - v2);
+ v1 = 0.5 * (v1 + v2);
+ v2 = t;
+ t = v4 * dctSin3 + v7 * dctCos3;
+ v4 = v4 * dctCos3 - v7 * dctSin3;
+ v7 = t;
+ t = v5 * dctSin1 + v6 * dctCos1;
+ v5 = v5 * dctCos1 - v6 * dctSin1;
+ v6 = t;
+
+ // stage 1
+ tmp1[i+0] = v0 + v7;
+ tmp1[i+7] = v0 - v7;
+ tmp1[i+1] = v1 + v6;
+ tmp1[i+6] = v1 - v6;
+ tmp1[i+2] = v2 + v5;
+ tmp1[i+5] = v2 - v5;
+ tmp1[i+3] = v3 + v4;
+ tmp1[i+4] = v3 - v4;
+ }
+
+ // inverse DCT on columns
+ for (i = 0; i < 8; ++i) {
+
+ // stage 4
+ v0 = dctSqrt2 * tmp1[0*8+i];
+ v1 = dctSqrt2 * tmp1[4*8+i];
+ v2 = tmp1[2*8+i];
+ v3 = tmp1[6*8+i];
+ v4 = dctSqrt1d2 * (tmp1[1*8+i] - tmp1[7*8+i]);
+ v7 = dctSqrt1d2 * (tmp1[1*8+i] + tmp1[7*8+i]);
+ v5 = tmp1[3*8+i];
+ v6 = tmp1[5*8+i];
+
+ // stage 3
+ t = 0.5 * (v0 - v1);
+ v0 = 0.5 * (v0 + v1);
+ v1 = t;
+ t = v2 * dctSin6 + v3 * dctCos6;
+ v2 = v2 * dctCos6 - v3 * dctSin6;
+ v3 = t;
+ t = 0.5 * (v4 - v6);
+ v4 = 0.5 * (v4 + v6);
+ v6 = t;
+ t = 0.5 * (v7 + v5);
+ v5 = 0.5 * (v7 - v5);
+ v7 = t;
+
+ // stage 2
+ t = 0.5 * (v0 - v3);
+ v0 = 0.5 * (v0 + v3);
+ v3 = t;
+ t = 0.5 * (v1 - v2);
+ v1 = 0.5 * (v1 + v2);
+ v2 = t;
+ t = v4 * dctSin3 + v7 * dctCos3;
+ v4 = v4 * dctCos3 - v7 * dctSin3;
+ v7 = t;
+ t = v5 * dctSin1 + v6 * dctCos1;
+ v5 = v5 * dctCos1 - v6 * dctSin1;
+ v6 = t;
+
+ // stage 1
+ tmp1[0*8+i] = v0 + v7;
+ tmp1[7*8+i] = v0 - v7;
+ tmp1[1*8+i] = v1 + v6;
+ tmp1[6*8+i] = v1 - v6;
+ tmp1[2*8+i] = v2 + v5;
+ tmp1[5*8+i] = v2 - v5;
+ tmp1[3*8+i] = v3 + v4;
+ tmp1[4*8+i] = v3 - v4;
+ }
+
+ // convert to 8-bit integers
+ for (i = 0; i < 64; ++i)
+ data[i] = dctClip[dctClipOffset + (int)(tmp1[i] + 128.5)];
+
+ return gTrue;
+}
+#endif
+
+int DCTStream::readHuffSym(DCTHuffTable *table) {
+ Gushort code;
+ int bit;
+ int codeBits;
+
+ code = 0;
+ codeBits = 0;
+ do {
+ // add a bit to the code
+ if ((bit = readBit()) == EOF)
+ return 9999;
+ code = (code << 1) + bit;
+ ++codeBits;
+
+ // look up code
+ if (code - table->firstCode[codeBits] < table->numCodes[codeBits]) {
+ code -= table->firstCode[codeBits];
+ return table->sym[table->firstSym[codeBits] + code];
+ }
+ } while (codeBits < 16);
+
+ error(getPos(), "Bad Huffman code in DCT stream");
+ return 9999;
+}
+
+int DCTStream::readAmp(int size) {
+ int amp, bit;
+ int bits;
+
+ amp = 0;
+ for (bits = 0; bits < size; ++bits) {
+ if ((bit = readBit()) == EOF)
+ return 9999;
+ amp = (amp << 1) + bit;
+ }
+ if (amp < (1 << (size - 1)))
+ amp -= (1 << size) - 1;
+ return amp;
+}
+
+int DCTStream::readBit() {
+ int bit;
+ int c, c2;
+
+ if (inputBits == 0) {
+ if ((c = str->getChar()) == EOF)
+ return EOF;
+ if (c == 0xff) {
+ do {
+ c2 = str->getChar();
+ } while (c2 == 0xff);
+ if (c2 != 0x00) {
+ error(getPos(), "Bad DCT data: missing 00 after ff");
+ return EOF;
+ }
+ }
+ inputBuf = c;
+ inputBits = 8;
+ }
+ bit = (inputBuf >> (inputBits - 1)) & 1;
+ --inputBits;
+ return bit;
+}
+
+GBool DCTStream::readHeader() {
+ GBool doScan;
+ int minHSample, minVSample;
+ int bufWidth;
+ int n;
+ int c = 0;
+ int i, j;
+
+ width = height = 0;
+ numComps = 0;
+ numQuantTables = 0;
+ numDCHuffTables = 0;
+ numACHuffTables = 0;
+ colorXform = 0;
+ gotAdobeMarker = gFalse;
+ restartInterval = 0;
+
+ // read headers
+ doScan = gFalse;
+ while (!doScan) {
+ c = readMarker();
+ switch (c) {
+ case 0xc0: // SOF0
+ if (!readFrameInfo())
+ return gFalse;
+ break;
+ case 0xc4: // DHT
+ if (!readHuffmanTables())
+ return gFalse;
+ break;
+ case 0xd8: // SOI
+ break;
+ case 0xda: // SOS
+ if (!readScanInfo())
+ return gFalse;
+ doScan = gTrue;
+ break;
+ case 0xdb: // DQT
+ if (!readQuantTables())
+ return gFalse;
+ break;
+ case 0xdd: // DRI
+ if (!readRestartInterval())
+ return gFalse;
+ break;
+ case 0xee: // APP14
+ if (!readAdobeMarker())
+ return gFalse;
+ break;
+ case EOF:
+ error(getPos(), "Bad DCT header");
+ return gFalse;
+ default:
+ // skip APPn / COM / etc.
+ if (c >= 0xe0) {
+ n = read16() - 2;
+ for (i = 0; i < n; ++i)
+ str->getChar();
+ } else {
+ error(getPos(), "Unknown DCT marker <%02x>", c);
+ return gFalse;
+ }
+ break;
+ }
+ }
+
+ // compute MCU size
+ mcuWidth = minHSample = compInfo[0].hSample;
+ mcuHeight = minVSample = compInfo[0].vSample;
+ for (i = 1; i < numComps; ++i) {
+ if (compInfo[i].hSample < minHSample)
+ minHSample = compInfo[i].hSample;
+ if (compInfo[i].vSample < minVSample)
+ minVSample = compInfo[i].vSample;
+ if (compInfo[i].hSample > mcuWidth)
+ mcuWidth = compInfo[i].hSample;
+ if (compInfo[i].vSample > mcuHeight)
+ mcuHeight = compInfo[i].vSample;
+ }
+ for (i = 0; i < numComps; ++i) {
+ compInfo[i].hSample /= minHSample;
+ compInfo[i].vSample /= minVSample;
+ }
+ mcuWidth = (mcuWidth / minHSample) * 8;
+ mcuHeight = (mcuHeight / minVSample) * 8;
+
+ // allocate buffers
+ bufWidth = ((width + mcuWidth - 1) / mcuWidth) * mcuWidth;
+ for (i = 0; i < numComps; ++i)
+ for (j = 0; j < mcuHeight; ++j)
+ rowBuf[i][j] = (Guchar *)gmalloc(bufWidth * sizeof(Guchar));
+
+ // figure out color transform
+ if (!gotAdobeMarker && numComps == 3) {
+ if (compInfo[0].id == 1 && compInfo[1].id == 2 && compInfo[2].id == 3) {
+ colorXform = 1;
+ }
+ }
+
+ // initialize counters
+ comp = 0;
+ x = 0;
+ y = 0;
+ dy = mcuHeight;
+
+ return gTrue;
+}
+
+GBool DCTStream::readFrameInfo() {
+ int length;
+ int prec;
+ int i;
+ int c;
+
+ length = read16() - 2;
+ prec = str->getChar();
+ height = read16();
+ width = read16();
+ numComps = str->getChar();
+ length -= 6;
+ if (prec != 8) {
+ error(getPos(), "Bad DCT precision %d", prec);
+ return gFalse;
+ }
+ for (i = 0; i < numComps; ++i) {
+ compInfo[i].id = str->getChar();
+ compInfo[i].inScan = gFalse;
+ c = str->getChar();
+ compInfo[i].hSample = (c >> 4) & 0x0f;
+ compInfo[i].vSample = c & 0x0f;
+ compInfo[i].quantTable = str->getChar();
+ compInfo[i].dcHuffTable = 0;
+ compInfo[i].acHuffTable = 0;
+ }
+ return gTrue;
+}
+
+GBool DCTStream::readScanInfo() {
+ int length;
+ int scanComps, id, c;
+ int i, j;
+
+ length = read16() - 2;
+ scanComps = str->getChar();
+ --length;
+ if (length != 2 * scanComps + 3) {
+ error(getPos(), "Bad DCT scan info block");
+ return gFalse;
+ }
+ for (i = 0; i < scanComps; ++i) {
+ id = str->getChar();
+ for (j = 0; j < numComps; ++j) {
+ if (id == compInfo[j].id)
+ break;
+ }
+ if (j == numComps) {
+ error(getPos(), "Bad DCT component ID in scan info block");
+ return gFalse;
+ }
+ compInfo[j].inScan = gTrue;
+ c = str->getChar();
+ compInfo[j].dcHuffTable = (c >> 4) & 0x0f;
+ compInfo[j].acHuffTable = c & 0x0f;
+ }
+ str->getChar();
+ str->getChar();
+ str->getChar();
+ return gTrue;
+}
+
+GBool DCTStream::readQuantTables() {
+ int length;
+ int i;
+ int index;
+
+ length = read16() - 2;
+ while (length > 0) {
+ index = str->getChar();
+ if ((index & 0xf0) || index >= 4) {
+ error(getPos(), "Bad DCT quantization table");
+ return gFalse;
+ }
+ if (index == numQuantTables)
+ numQuantTables = index + 1;
+ for (i = 0; i < 64; ++i)
+ quantTables[index][dctZigZag[i]] = str->getChar();
+ length -= 65;
+ }
+ return gTrue;
+}
+
+GBool DCTStream::readHuffmanTables() {
+ DCTHuffTable *tbl;
+ int length;
+ int index;
+ Gushort code;
+ Guchar sym;
+ int i;
+ int c;
+
+ length = read16() - 2;
+ while (length > 0) {
+ index = str->getChar();
+ --length;
+ if ((index & 0x0f) >= 4) {
+ error(getPos(), "Bad DCT Huffman table");
+ return gFalse;
+ }
+ if (index & 0x10) {
+ index &= 0x0f;
+ if (index >= numACHuffTables)
+ numACHuffTables = index+1;
+ tbl = &acHuffTables[index];
+ } else {
+ if (index >= numDCHuffTables)
+ numDCHuffTables = index+1;
+ tbl = &dcHuffTables[index];
+ }
+ sym = 0;
+ code = 0;
+ for (i = 1; i <= 16; ++i) {
+ c = str->getChar();
+ tbl->firstSym[i] = sym;
+ tbl->firstCode[i] = code;
+ tbl->numCodes[i] = c;
+ sym += c;
+ code = (code + c) << 1;
+ }
+ length -= 16;
+ for (i = 0; i < sym; ++i)
+ tbl->sym[i] = str->getChar();
+ length -= sym;
+ }
+ return gTrue;
+}
+
+GBool DCTStream::readRestartInterval() {
+ int length;
+
+ length = read16();
+ if (length != 4) {
+ error(getPos(), "Bad DCT restart interval");
+ return gFalse;
+ }
+ restartInterval = read16();
+ return gTrue;
+}
+
+GBool DCTStream::readAdobeMarker() {
+ int length, i;
+ char buf[12];
+ int c;
+
+ length = read16();
+ if (length != 14)
+ goto err;
+ for (i = 0; i < 12; ++i) {
+ if ((c = str->getChar()) == EOF)
+ goto err;
+ buf[i] = c;
+ }
+ if (strncmp(buf, "Adobe", 5))
+ goto err;
+ colorXform = buf[11];
+ gotAdobeMarker = gTrue;
+ return gTrue;
+
+ err:
+ error(getPos(), "Bad DCT Adobe APP14 marker");
+ return gFalse;
+}
+
+GBool DCTStream::readTrailer() {
+ int c;
+
+ c = readMarker();
+ if (c != 0xd9) { // EOI
+ error(getPos(), "Bad DCT trailer");
+ return gFalse;
+ }
+ return gTrue;
+}
+
+int DCTStream::readMarker() {
+ int c;
+
+ do {
+ do {
+ c = str->getChar();
+ } while (c != 0xff);
+ do {
+ c = str->getChar();
+ } while (c == 0xff);
+ } while (c == 0x00);
+ return c;
+}
+
+int DCTStream::read16() {
+ int c1, c2;
+
+ if ((c1 = str->getChar()) == EOF)
+ return EOF;
+ if ((c2 = str->getChar()) == EOF)
+ return EOF;
+ return (c1 << 8) + c2;
+}
+
+GString *DCTStream::getPSFilter(char *indent) {
+ GString *s;
+
+ s = str->getPSFilter(indent);
+ s->append(indent)->append("<< >> /DCTDecode filter\n");
+ return s;
+}
+
+GBool DCTStream::isBinary(GBool last) {
+ return str->isBinary(gTrue);
+}
+
+//------------------------------------------------------------------------
+// FlateStream
+//------------------------------------------------------------------------
+
+int FlateStream::codeLenCodeMap[flateMaxCodeLenCodes] = {
+ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
+};
+
+FlateDecode FlateStream::lengthDecode[flateMaxLitCodes-257] = {
+ {0, 3},
+ {0, 4},
+ {0, 5},
+ {0, 6},
+ {0, 7},
+ {0, 8},
+ {0, 9},
+ {0, 10},
+ {1, 11},
+ {1, 13},
+ {1, 15},
+ {1, 17},
+ {2, 19},
+ {2, 23},
+ {2, 27},
+ {2, 31},
+ {3, 35},
+ {3, 43},
+ {3, 51},
+ {3, 59},
+ {4, 67},
+ {4, 83},
+ {4, 99},
+ {4, 115},
+ {5, 131},
+ {5, 163},
+ {5, 195},
+ {5, 227},
+ {0, 258}
+};
+
+FlateDecode FlateStream::distDecode[flateMaxDistCodes] = {
+ { 0, 1},
+ { 0, 2},
+ { 0, 3},
+ { 0, 4},
+ { 1, 5},
+ { 1, 7},
+ { 2, 9},
+ { 2, 13},
+ { 3, 17},
+ { 3, 25},
+ { 4, 33},
+ { 4, 49},
+ { 5, 65},
+ { 5, 97},
+ { 6, 129},
+ { 6, 193},
+ { 7, 257},
+ { 7, 385},
+ { 8, 513},
+ { 8, 769},
+ { 9, 1025},
+ { 9, 1537},
+ {10, 2049},
+ {10, 3073},
+ {11, 4097},
+ {11, 6145},
+ {12, 8193},
+ {12, 12289},
+ {13, 16385},
+ {13, 24577}
+};
+
+FlateStream::FlateStream(Stream *str, int predictor1, int columns1,
+ int colors1, int bits1):
+ FilterStream(str) {
+ if (predictor1 != 1) {
+ pred = new StreamPredictor(this, predictor1, columns1, colors1, bits1);
+ } else {
+ pred = NULL;
+ }
+}
+
+FlateStream::~FlateStream() {
+ if (pred) {
+ delete pred;
+ }
+ delete str;
+}
+
+void FlateStream::reset() {
+ int cmf, flg;
+
+ index = 0;
+ remain = 0;
+ codeBuf = 0;
+ codeSize = 0;
+ compressedBlock = gFalse;
+ endOfBlock = gTrue;
+ eof = gTrue;
+
+ str->reset();
+
+ // read header
+ //~ need to look at window size?
+ endOfBlock = eof = gTrue;
+ cmf = str->getChar();
+ flg = str->getChar();
+ if (cmf == EOF || flg == EOF)
+ return;
+ if ((cmf & 0x0f) != 0x08) {
+ error(getPos(), "Unknown compression method in flate stream");
+ return;
+ }
+ if ((((cmf << 8) + flg) % 31) != 0) {
+ error(getPos(), "Bad FCHECK in flate stream");
+ return;
+ }
+ if (flg & 0x20) {
+ error(getPos(), "FDICT bit set in flate stream");
+ return;
+ }
+
+ eof = gFalse;
+}
+
+int FlateStream::getChar() {
+ int c;
+
+ if (pred) {
+ return pred->getChar();
+ }
+ while (remain == 0) {
+ if (endOfBlock && eof)
+ return EOF;
+ readSome();
+ }
+ c = buf[index];
+ index = (index + 1) & flateMask;
+ --remain;
+ return c;
+}
+
+int FlateStream::lookChar() {
+ int c;
+
+ if (pred) {
+ return pred->lookChar();
+ }
+ while (remain == 0) {
+ if (endOfBlock && eof)
+ return EOF;
+ readSome();
+ }
+ c = buf[index];
+ return c;
+}
+
+int FlateStream::getRawChar() {
+ int c;
+
+ while (remain == 0) {
+ if (endOfBlock && eof)
+ return EOF;
+ readSome();
+ }
+ c = buf[index];
+ index = (index + 1) & flateMask;
+ --remain;
+ return c;
+}
+
+GString *FlateStream::getPSFilter(char *indent) {
+ return NULL;
+}
+
+GBool FlateStream::isBinary(GBool last) {
+ return str->isBinary(gTrue);
+}
+
+void FlateStream::readSome() {
+ int code1, code2;
+ int len, dist;
+ int i, j, k;
+ int c;
+
+ if (endOfBlock) {
+ if (!startBlock())
+ return;
+ }
+
+ if (compressedBlock) {
+ if ((code1 = getHuffmanCodeWord(&litCodeTab)) == EOF)
+ goto err;
+ if (code1 < 256) {
+ buf[index] = code1;
+ remain = 1;
+ } else if (code1 == 256) {
+ endOfBlock = gTrue;
+ remain = 0;
+ } else {
+ code1 -= 257;
+ code2 = lengthDecode[code1].bits;
+ if (code2 > 0 && (code2 = getCodeWord(code2)) == EOF)
+ goto err;
+ len = lengthDecode[code1].first + code2;
+ if ((code1 = getHuffmanCodeWord(&distCodeTab)) == EOF)
+ goto err;
+ code2 = distDecode[code1].bits;
+ if (code2 > 0 && (code2 = getCodeWord(code2)) == EOF)
+ goto err;
+ dist = distDecode[code1].first + code2;
+ i = index;
+ j = (index - dist) & flateMask;
+ for (k = 0; k < len; ++k) {
+ buf[i] = buf[j];
+ i = (i + 1) & flateMask;
+ j = (j + 1) & flateMask;
+ }
+ remain = len;
+ }
+
+ } else {
+ len = (blockLen < flateWindow) ? blockLen : flateWindow;
+ for (i = 0, j = index; i < len; ++i, j = (j + 1) & flateMask) {
+ if ((c = str->getChar()) == EOF) {
+ endOfBlock = eof = gTrue;
+ break;
+ }
+ buf[j] = c & 0xff;
+ }
+ remain = i;
+ blockLen -= len;
+ if (blockLen == 0)
+ endOfBlock = gTrue;
+ }
+
+ return;
+
+err:
+ error(getPos(), "Unexpected end of file in flate stream");
+ endOfBlock = eof = gTrue;
+ remain = 0;
+}
+
+GBool FlateStream::startBlock() {
+ int blockHdr;
+ int c;
+ int check;
+
+ // read block header
+ blockHdr = getCodeWord(3);
+ if (blockHdr & 1)
+ eof = gTrue;
+ blockHdr >>= 1;
+
+ // uncompressed block
+ if (blockHdr == 0) {
+ compressedBlock = gFalse;
+ if ((c = str->getChar()) == EOF)
+ goto err;
+ blockLen = c & 0xff;
+ if ((c = str->getChar()) == EOF)
+ goto err;
+ blockLen |= (c & 0xff) << 8;
+ if ((c = str->getChar()) == EOF)
+ goto err;
+ check = c & 0xff;
+ if ((c = str->getChar()) == EOF)
+ goto err;
+ check |= (c & 0xff) << 8;
+ if (check != (~blockLen & 0xffff))
+ error(getPos(), "Bad uncompressed block length in flate stream");
+ codeBuf = 0;
+ codeSize = 0;
+
+ // compressed block with fixed codes
+ } else if (blockHdr == 1) {
+ compressedBlock = gTrue;
+ loadFixedCodes();
+
+ // compressed block with dynamic codes
+ } else if (blockHdr == 2) {
+ compressedBlock = gTrue;
+ if (!readDynamicCodes())
+ goto err;
+
+ // unknown block type
+ } else {
+ goto err;
+ }
+
+ endOfBlock = gFalse;
+ return gTrue;
+
+err:
+ error(getPos(), "Bad block header in flate stream");
+ endOfBlock = eof = gTrue;
+ return gFalse;
+}
+
+void FlateStream::loadFixedCodes() {
+ int i;
+
+ // set up code arrays
+ litCodeTab.codes = allCodes;
+ distCodeTab.codes = allCodes + flateMaxLitCodes;
+
+ // initialize literal code table
+ for (i = 0; i <= 143; ++i)
+ litCodeTab.codes[i].len = 8;
+ for (i = 144; i <= 255; ++i)
+ litCodeTab.codes[i].len = 9;
+ for (i = 256; i <= 279; ++i)
+ litCodeTab.codes[i].len = 7;
+ for (i = 280; i <= 287; ++i)
+ litCodeTab.codes[i].len = 8;
+ compHuffmanCodes(&litCodeTab, flateMaxLitCodes);
+
+ // initialize distance code table
+ for (i = 0; i <= 5; ++i) {
+ distCodeTab.start[i] = 0;
+ }
+ for (i = 6; i <= flateMaxHuffman+1; ++i) {
+ distCodeTab.start[i] = flateMaxDistCodes;
+ }
+ for (i = 0; i < flateMaxDistCodes; ++i) {
+ distCodeTab.codes[i].len = 5;
+ distCodeTab.codes[i].code = i;
+ distCodeTab.codes[i].val = i;
+ }
+}
+
+GBool FlateStream::readDynamicCodes() {
+ int numCodeLenCodes;
+ int numLitCodes;
+ int numDistCodes;
+ FlateCode codeLenCodes[flateMaxCodeLenCodes];
+ FlateHuffmanTab codeLenCodeTab;
+ int len, repeat, code;
+ int i;
+
+ // read lengths
+ if ((numLitCodes = getCodeWord(5)) == EOF)
+ goto err;
+ numLitCodes += 257;
+ if ((numDistCodes = getCodeWord(5)) == EOF)
+ goto err;
+ numDistCodes += 1;
+ if ((numCodeLenCodes = getCodeWord(4)) == EOF)
+ goto err;
+ numCodeLenCodes += 4;
+ if (numLitCodes > flateMaxLitCodes ||
+ numDistCodes > flateMaxDistCodes ||
+ numCodeLenCodes > flateMaxCodeLenCodes)
+ goto err;
+
+ // read code length code table
+ codeLenCodeTab.codes = codeLenCodes;
+ for (i = 0; i < flateMaxCodeLenCodes; ++i)
+ codeLenCodes[i].len = 0;
+ for (i = 0; i < numCodeLenCodes; ++i) {
+ if ((codeLenCodes[codeLenCodeMap[i]].len = getCodeWord(3)) == -1)
+ goto err;
+ }
+ compHuffmanCodes(&codeLenCodeTab, flateMaxCodeLenCodes);
+
+ // set up code arrays
+ litCodeTab.codes = allCodes;
+ distCodeTab.codes = allCodes + numLitCodes;
+
+ // read literal and distance code tables
+ len = 0;
+ repeat = 0;
+ i = 0;
+ while (i < numLitCodes + numDistCodes) {
+ if ((code = getHuffmanCodeWord(&codeLenCodeTab)) == EOF)
+ goto err;
+ if (code == 16) {
+ if ((repeat = getCodeWord(2)) == EOF)
+ goto err;
+ for (repeat += 3; repeat > 0; --repeat)
+ allCodes[i++].len = len;
+ } else if (code == 17) {
+ if ((repeat = getCodeWord(3)) == EOF)
+ goto err;
+ len = 0;
+ for (repeat += 3; repeat > 0; --repeat)
+ allCodes[i++].len = 0;
+ } else if (code == 18) {
+ if ((repeat = getCodeWord(7)) == EOF)
+ goto err;
+ len = 0;
+ for (repeat += 11; repeat > 0; --repeat)
+ allCodes[i++].len = 0;
+ } else {
+ allCodes[i++].len = len = code;
+ }
+ }
+ compHuffmanCodes(&litCodeTab, numLitCodes);
+ compHuffmanCodes(&distCodeTab, numDistCodes);
+
+ return gTrue;
+
+err:
+ error(getPos(), "Bad dynamic code table in flate stream");
+ return gFalse;
+}
+
+// On entry, the <tab->codes> array contains the lengths of each code,
+// stored in code value order. This function computes the code words.
+// The result is sorted in order of (1) code length and (2) code word.
+// The length values are no longer valid. The <tab->start> array is
+// filled with the indexes of the first code of each length.
+void FlateStream::compHuffmanCodes(FlateHuffmanTab *tab, int n) {
+ int numLengths[flateMaxHuffman+1];
+ int nextCode[flateMaxHuffman+1];
+ int nextIndex[flateMaxHuffman+2];
+ int code;
+ int i, j;
+
+ // count number of codes for each code length
+ for (i = 0; i <= flateMaxHuffman; ++i)
+ numLengths[i] = 0;
+ for (i = 0; i < n; ++i)
+ ++numLengths[tab->codes[i].len];
+
+ // compute first index for each length
+ tab->start[0] = nextIndex[0] = 0;
+ for (i = 1; i <= flateMaxHuffman + 1; ++i)
+ tab->start[i] = nextIndex[i] = tab->start[i-1] + numLengths[i-1];
+
+ // compute first code for each length
+ code = 0;
+ numLengths[0] = 0;
+ for (i = 1; i <= flateMaxHuffman; ++i) {
+ code = (code + numLengths[i-1]) << 1;
+ nextCode[i] = code;
+ }
+
+ // compute the codes -- this permutes the codes array from value
+ // order to length/code order
+ for (i = 0; i < n; ++i) {
+ j = nextIndex[tab->codes[i].len]++;
+ if (tab->codes[i].len == 0)
+ tab->codes[j].code = 0;
+ else
+ tab->codes[j].code = nextCode[tab->codes[i].len]++;
+ tab->codes[j].val = i;
+ }
+}
+
+int FlateStream::getHuffmanCodeWord(FlateHuffmanTab *tab) {
+ int len;
+ int code;
+ int c;
+ int i, j;
+
+ code = 0;
+ for (len = 1; len <= flateMaxHuffman; ++len) {
+
+ // add a bit to the code
+ if (codeSize == 0) {
+ if ((c = str->getChar()) == EOF)
+ return EOF;
+ codeBuf = c & 0xff;
+ codeSize = 8;
+ }
+ code = (code << 1) | (codeBuf & 1);
+ codeBuf >>= 1;
+ --codeSize;
+
+ // look for code
+ i = tab->start[len];
+ j = tab->start[len + 1];
+ if (i < j && code >= tab->codes[i].code && code <= tab->codes[j-1].code) {
+ i += code - tab->codes[i].code;
+ return tab->codes[i].val;
+ }
+ }
+
+ // not found
+ error(getPos(), "Bad code (%04x) in flate stream", code);
+ return EOF;
+}
+
+int FlateStream::getCodeWord(int bits) {
+ int c;
+
+ while (codeSize < bits) {
+ if ((c = str->getChar()) == EOF)
+ return EOF;
+ codeBuf |= (c & 0xff) << codeSize;
+ codeSize += 8;
+ }
+ c = codeBuf & ((1 << bits) - 1);
+ codeBuf >>= bits;
+ codeSize -= bits;
+ return c;
+}
+
+//------------------------------------------------------------------------
+// EOFStream
+//------------------------------------------------------------------------
+
+EOFStream::EOFStream(Stream *str):
+ FilterStream(str) {
+}
+
+EOFStream::~EOFStream() {
+ delete str;
+}
+
+//------------------------------------------------------------------------
+// FixedLengthEncoder
+//------------------------------------------------------------------------
+
+FixedLengthEncoder::FixedLengthEncoder(Stream *str, int length1):
+ FilterStream(str) {
+ length = length1;
+ count = 0;
+}
+
+FixedLengthEncoder::~FixedLengthEncoder() {
+ if (str->isEncoder())
+ delete str;
+}
+
+void FixedLengthEncoder::reset() {
+ str->reset();
+ count = 0;
+}
+
+void FixedLengthEncoder::close() {
+}
+
+int FixedLengthEncoder::getChar() {
+ if (length >= 0 && count >= length)
+ return EOF;
+ ++count;
+ return str->getChar();
+}
+
+int FixedLengthEncoder::lookChar() {
+ if (length >= 0 && count >= length)
+ return EOF;
+ return str->getChar();
+}
+
+//------------------------------------------------------------------------
+// ASCII85Encoder
+//------------------------------------------------------------------------
+
+ASCII85Encoder::ASCII85Encoder(Stream *str):
+ FilterStream(str) {
+ bufPtr = bufEnd = buf;
+ lineLen = 0;
+ eof = gFalse;
+}
+
+ASCII85Encoder::~ASCII85Encoder() {
+ if (str->isEncoder())
+ delete str;
+}
+
+void ASCII85Encoder::reset() {
+ str->reset();
+ bufPtr = bufEnd = buf;
+ lineLen = 0;
+ eof = gFalse;
+}
+
+void ASCII85Encoder::close() {
+}
+
+GBool ASCII85Encoder::fillBuf() {
+ Gulong t;
+ char buf1[5];
+ int c;
+ int n, i;
+
+ if (eof)
+ return gFalse;
+ t = 0;
+ for (n = 0; n < 4; ++n) {
+ if ((c = str->getChar()) == EOF)
+ break;
+ t = (t << 8) + c;
+ }
+ bufPtr = bufEnd = buf;
+ if (n > 0) {
+ if (n == 4 && t == 0) {
+ *bufEnd++ = 'z';
+ if (++lineLen == 65) {
+ *bufEnd++ = '\n';
+ lineLen = 0;
+ }
+ } else {
+ if (n < 4)
+ t <<= 8 * (4 - n);
+ for (i = 4; i >= 0; --i) {
+ buf1[i] = (char)(t % 85 + 0x21);
+ t /= 85;
+ }
+ for (i = 0; i <= n; ++i) {
+ *bufEnd++ = buf1[i];
+ if (++lineLen == 65) {
+ *bufEnd++ = '\n';
+ lineLen = 0;
+ }
+ }
+ }
+ }
+ if (n < 4) {
+ *bufEnd++ = '~';
+ *bufEnd++ = '>';
+ eof = gTrue;
+ }
+ return bufPtr < bufEnd;
+}
+
+//------------------------------------------------------------------------
+// RunLengthEncoder
+//------------------------------------------------------------------------
+
+RunLengthEncoder::RunLengthEncoder(Stream *str):
+ FilterStream(str) {
+ bufPtr = bufEnd = nextEnd = buf;
+ eof = gFalse;
+}
+
+RunLengthEncoder::~RunLengthEncoder() {
+ if (str->isEncoder())
+ delete str;
+}
+
+void RunLengthEncoder::reset() {
+ str->reset();
+ bufPtr = bufEnd = nextEnd = buf;
+ eof = gFalse;
+}
+
+void RunLengthEncoder::close() {
+}
+
+//
+// When fillBuf finishes, buf[] looks like this:
+// +-----+--------------+-----------------+--
+// + tag | ... data ... | next 0, 1, or 2 |
+// +-----+--------------+-----------------+--
+// ^ ^ ^
+// bufPtr bufEnd nextEnd
+//
+GBool RunLengthEncoder::fillBuf() {
+ int c, c1, c2;
+ int n;
+
+ // already hit EOF?
+ if (eof)
+ return gFalse;
+
+ // grab two bytes
+ if (nextEnd < bufEnd + 1) {
+ if ((c1 = str->getChar()) == EOF) {
+ eof = gTrue;
+ return gFalse;
+ }
+ } else {
+ c1 = bufEnd[0] & 0xff;
+ }
+ if (nextEnd < bufEnd + 2) {
+ if ((c2 = str->getChar()) == EOF) {
+ eof = gTrue;
+ buf[0] = 0;
+ buf[1] = c1;
+ bufPtr = buf;
+ bufEnd = &buf[2];
+ return gTrue;
+ }
+ } else {
+ c2 = bufEnd[1] & 0xff;
+ }
+
+ // check for repeat
+ c = 0; // make gcc happy
+ if (c1 == c2) {
+ n = 2;
+ while (n < 128 && (c = str->getChar()) == c1)
+ ++n;
+ buf[0] = (char)(257 - n);
+ buf[1] = c1;
+ bufEnd = &buf[2];
+ if (c == EOF) {
+ eof = gTrue;
+ } else if (n < 128) {
+ buf[2] = c;
+ nextEnd = &buf[3];
+ } else {
+ nextEnd = bufEnd;
+ }
+
+ // get up to 128 chars
+ } else {
+ buf[1] = c1;
+ buf[2] = c2;
+ n = 2;
+ while (n < 128) {
+ if ((c = str->getChar()) == EOF) {
+ eof = gTrue;
+ break;
+ }
+ ++n;
+ buf[n] = c;
+ if (buf[n] == buf[n-1])
+ break;
+ }
+ if (buf[n] == buf[n-1]) {
+ buf[0] = (char)(n-2-1);
+ bufEnd = &buf[n-1];
+ nextEnd = &buf[n+1];
+ } else {
+ buf[0] = (char)(n-1);
+ bufEnd = nextEnd = &buf[n+1];
+ }
+ }
+ bufPtr = buf;
+ return gTrue;
+}
diff --git a/pdf2swf/xpdf/Stream.h b/pdf2swf/xpdf/Stream.h
new file mode 100644
index 00000000..50345bb0
--- /dev/null
+++ b/pdf2swf/xpdf/Stream.h
@@ -0,0 +1,723 @@
+//========================================================================
+//
+// Stream.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef STREAM_H
+#define STREAM_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include <stdio.h>
+#include "gtypes.h"
+#include "Object.h"
+
+#ifndef NO_DECRYPTION
+class Decrypt;
+#endif
+class BaseStream;
+
+//------------------------------------------------------------------------
+
+enum StreamKind {
+ strFile,
+ strASCIIHex,
+ strASCII85,
+ strLZW,
+ strRunLength,
+ strCCITTFax,
+ strDCT,
+ strFlate,
+ strWeird // internal-use stream types
+};
+
+//------------------------------------------------------------------------
+// Stream (base class)
+//------------------------------------------------------------------------
+
+class Stream {
+public:
+
+ // Constructor.
+ Stream();
+
+ // Destructor.
+ virtual ~Stream();
+
+ // Reference counting.
+ int incRef() { return ++ref; }
+ int decRef() { return --ref; }
+
+ // Get kind of stream.
+ virtual StreamKind getKind() = 0;
+
+ // Reset stream to beginning.
+ virtual void reset() = 0;
+
+ // Close down the stream.
+ virtual void close();
+
+ // Get next char from stream.
+ virtual int getChar() = 0;
+
+ // Peek at next char in stream.
+ virtual int lookChar() = 0;
+
+ // Get next char from stream without using the predictor.
+ // This is only used by StreamPredictor.
+ virtual int getRawChar();
+
+ // Get next line from stream.
+ virtual char *getLine(char *buf, int size);
+
+ // Get current position in file.
+ virtual int getPos() = 0;
+
+ // Go to a position in the stream.
+ virtual void setPos(int pos1) = 0;
+
+ // Get PostScript command for the filter(s).
+ virtual GString *getPSFilter(char *indent);
+
+ // Does this stream type potentially contain non-printable chars?
+ virtual GBool isBinary(GBool last = gTrue) = 0;
+
+ // Get the BaseStream or EmbedStream of this stream.
+ virtual BaseStream *getBaseStream() = 0;
+
+ // Get the dictionary associated with this stream.
+ virtual Dict *getDict() = 0;
+
+ // Is this an encoding filter?
+ virtual GBool isEncoder() { return gFalse; }
+
+ // Add filters to this stream according to the parameters in <dict>.
+ // Returns the new stream.
+ Stream *addFilters(Object *dict);
+
+private:
+
+ Stream *makeFilter(char *name, Stream *str, Object *params);
+
+ int ref; // reference count
+};
+
+//------------------------------------------------------------------------
+// BaseStream
+//
+// This is the base class for all streams that read directly from a file.
+//------------------------------------------------------------------------
+
+class BaseStream: public Stream {
+public:
+
+ BaseStream(Object *dict);
+ virtual ~BaseStream();
+ virtual Stream *makeSubStream(int start, int length, Object *dict) = 0;
+ virtual void setPos(int pos1) = 0;
+ virtual BaseStream *getBaseStream() { return this; }
+ virtual Dict *getDict() { return dict.getDict(); }
+
+ // Get/set position of first byte of stream within the file.
+ virtual int getStart() = 0;
+ virtual void moveStart(int delta) = 0;
+
+#ifndef NO_DECRYPTION
+ // Set decryption for this stream.
+ void doDecryption(Guchar *fileKey, int objNum, int objGen);
+#endif
+
+#ifndef NO_DECRYPTION
+protected:
+
+ Decrypt *decrypt;
+#endif
+
+private:
+
+ Object dict;
+};
+
+//------------------------------------------------------------------------
+// FilterStream
+//
+// This is the base class for all streams that filter another stream.
+//------------------------------------------------------------------------
+
+class FilterStream: public Stream {
+public:
+
+ FilterStream(Stream *str);
+ virtual ~FilterStream();
+ virtual void close();
+ virtual int getPos() { return str->getPos(); }
+ virtual void setPos(int pos);
+ virtual BaseStream *getBaseStream() { return str->getBaseStream(); }
+ virtual Dict *getDict() { return str->getDict(); }
+
+protected:
+
+ Stream *str;
+};
+
+//------------------------------------------------------------------------
+// ImageStream
+//------------------------------------------------------------------------
+
+class ImageStream {
+public:
+
+ // Create an image stream object for an image with the specified
+ // parameters. Note that these are the actual image parameters,
+ // which may be different from the predictor parameters.
+ ImageStream(Stream *str, int width, int nComps, int nBits);
+
+ ~ImageStream();
+
+ // Reset the stream.
+ void reset();
+
+ // Gets the next pixel from the stream. <pix> should be able to hold
+ // at least nComps elements. Returns false at end of file.
+ GBool getPixel(Guchar *pix);
+
+ // Skip an entire line from the image.
+ void skipLine();
+
+private:
+
+ Stream *str; // base stream
+ int width; // pixels per line
+ int nComps; // components per pixel
+ int nBits; // bits per component
+ int nVals; // components per line
+ Guchar *imgLine; // line buffer
+ int imgIdx; // current index in imgLine
+};
+
+//------------------------------------------------------------------------
+// StreamPredictor
+//------------------------------------------------------------------------
+
+class StreamPredictor {
+public:
+
+ // Create a predictor object. Note that the parameters are for the
+ // predictor, and may not match the actual image parameters.
+ StreamPredictor(Stream *str, int predictor,
+ int width, int nComps, int nBits);
+
+ ~StreamPredictor();
+
+ int lookChar();
+ int getChar();
+
+private:
+
+ GBool getNextLine();
+
+ Stream *str; // base stream
+ int predictor; // predictor
+ int width; // pixels per line
+ int nComps; // components per pixel
+ int nBits; // bits per component
+ int nVals; // components per line
+ int pixBytes; // bytes per pixel
+ int rowBytes; // bytes per line
+ Guchar *predLine; // line buffer
+ int predIdx; // current index in predLine
+};
+
+//------------------------------------------------------------------------
+// FileStream
+//------------------------------------------------------------------------
+
+#define fileStreamBufSize 256
+
+class FileStream: public BaseStream {
+public:
+
+ FileStream(FILE *f, int start, int length, Object *dict);
+ virtual ~FileStream();
+ virtual Stream *makeSubStream(int start, int length, Object *dict);
+ virtual StreamKind getKind() { return strFile; }
+ virtual void reset();
+ virtual void close();
+ virtual int getChar()
+ { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
+ virtual int lookChar()
+ { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
+ virtual int getPos() { return bufPos + (bufPtr - buf); }
+ virtual void setPos(int pos1);
+ virtual GBool isBinary(GBool last = gTrue) { return last; }
+ virtual int getStart() { return start; }
+ virtual void moveStart(int delta);
+
+private:
+
+ GBool fillBuf();
+
+ FILE *f;
+ int start;
+ int length;
+ char buf[fileStreamBufSize];
+ char *bufPtr;
+ char *bufEnd;
+ int bufPos;
+ int savePos;
+};
+
+//------------------------------------------------------------------------
+// EmbedStream
+//
+// This is a special stream type used for embedded streams (inline
+// images). It reads directly from the base stream -- after the
+// EmbedStream is deleted, reads from the base stream will proceed where
+// the BaseStream left off. Note that this is very different behavior
+// that creating a new FileStream (using makeSubStream).
+//------------------------------------------------------------------------
+
+class EmbedStream: public BaseStream {
+public:
+
+ EmbedStream(Stream *str, Object *dict);
+ virtual ~EmbedStream();
+ virtual Stream *makeSubStream(int start, int length, Object *dict);
+ virtual StreamKind getKind() { return str->getKind(); }
+ virtual void reset() {}
+ virtual int getChar() { return str->getChar(); }
+ virtual int lookChar() { return str->lookChar(); }
+ virtual int getPos() { return str->getPos(); }
+ virtual void setPos(int pos);
+ virtual GBool isBinary(GBool last = gTrue) { return last; }
+ virtual int getStart();
+ virtual void moveStart(int delta);
+
+private:
+
+ Stream *str;
+};
+
+//------------------------------------------------------------------------
+// ASCIIHexStream
+//------------------------------------------------------------------------
+
+class ASCIIHexStream: public FilterStream {
+public:
+
+ ASCIIHexStream(Stream *str);
+ virtual ~ASCIIHexStream();
+ virtual StreamKind getKind() { return strASCIIHex; }
+ virtual void reset();
+ virtual int getChar()
+ { int c = lookChar(); buf = EOF; return c; }
+ virtual int lookChar();
+ virtual GString *getPSFilter(char *indent);
+ virtual GBool isBinary(GBool last = gTrue);
+
+private:
+
+ int buf;
+ GBool eof;
+};
+
+//------------------------------------------------------------------------
+// ASCII85Stream
+//------------------------------------------------------------------------
+
+class ASCII85Stream: public FilterStream {
+public:
+
+ ASCII85Stream(Stream *str);
+ virtual ~ASCII85Stream();
+ virtual StreamKind getKind() { return strASCII85; }
+ virtual void reset();
+ virtual int getChar()
+ { int ch = lookChar(); ++index; return ch; }
+ virtual int lookChar();
+ virtual GString *getPSFilter(char *indent);
+ virtual GBool isBinary(GBool last = gTrue);
+
+private:
+
+ int c[5];
+ int b[4];
+ int index, n;
+ GBool eof;
+};
+
+//------------------------------------------------------------------------
+// LZWStream
+//------------------------------------------------------------------------
+
+class LZWStream: public FilterStream {
+public:
+
+ LZWStream(Stream *str, int predictor1, int columns1, int colors1,
+ int bits1, int early1);
+ virtual ~LZWStream();
+ virtual StreamKind getKind() { return strLZW; }
+ virtual void reset();
+ virtual int getChar();
+ virtual int lookChar();
+ virtual int getRawChar();
+ virtual GString *getPSFilter(char *indent);
+ virtual GBool isBinary(GBool last = gTrue);
+
+private:
+
+ StreamPredictor *pred; // predictor
+ int early; // early parameter
+ FILE *zPipe; // uncompress pipe
+ GString *zName; // .Z file name
+ int inputBuf; // input buffer
+ int inputBits; // number of bits in input buffer
+ int inCodeBits; // size of input code
+ char buf[256]; // buffer
+ char *bufPtr; // next char to read
+ char *bufEnd; // end of buffer
+
+ void dumpFile(FILE *f);
+ int getCode();
+ GBool fillBuf();
+};
+
+//------------------------------------------------------------------------
+// RunLengthStream
+//------------------------------------------------------------------------
+
+class RunLengthStream: public FilterStream {
+public:
+
+ RunLengthStream(Stream *str);
+ virtual ~RunLengthStream();
+ virtual StreamKind getKind() { return strRunLength; }
+ virtual void reset();
+ virtual int getChar()
+ { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
+ virtual int lookChar()
+ { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
+ virtual GString *getPSFilter(char *indent);
+ virtual GBool isBinary(GBool last = gTrue);
+
+private:
+
+ char buf[128]; // buffer
+ char *bufPtr; // next char to read
+ char *bufEnd; // end of buffer
+ GBool eof;
+
+ GBool fillBuf();
+};
+
+//------------------------------------------------------------------------
+// CCITTFaxStream
+//------------------------------------------------------------------------
+
+struct CCITTCodeTable;
+
+class CCITTFaxStream: public FilterStream {
+public:
+
+ CCITTFaxStream(Stream *str, int encoding, GBool endOfLine,
+ GBool byteAlign, int columns, int rows,
+ GBool endOfBlock, GBool black);
+ virtual ~CCITTFaxStream();
+ virtual StreamKind getKind() { return strCCITTFax; }
+ virtual void reset();
+ virtual int getChar()
+ { int c = lookChar(); buf = EOF; return c; }
+ virtual int lookChar();
+ virtual GString *getPSFilter(char *indent);
+ virtual GBool isBinary(GBool last = gTrue);
+
+private:
+
+ int encoding; // 'K' parameter
+ GBool endOfLine; // 'EndOfLine' parameter
+ GBool byteAlign; // 'EncodedByteAlign' parameter
+ int columns; // 'Columns' parameter
+ int rows; // 'Rows' parameter
+ GBool endOfBlock; // 'EndOfBlock' parameter
+ GBool black; // 'BlackIs1' parameter
+ GBool eof; // true if at eof
+ GBool nextLine2D; // true if next line uses 2D encoding
+ int row; // current row
+ int inputBuf; // input buffer
+ int inputBits; // number of bits in input buffer
+ short *refLine; // reference line changing elements
+ int b1; // index into refLine
+ short *codingLine; // coding line changing elements
+ int a0; // index into codingLine
+ int outputBits; // remaining ouput bits
+ int buf; // character buffer
+
+ short getTwoDimCode();
+ short getWhiteCode();
+ short getBlackCode();
+ short lookBits(int n);
+ void eatBits(int n) { inputBits -= n; }
+};
+
+//------------------------------------------------------------------------
+// DCTStream
+//------------------------------------------------------------------------
+
+// DCT component info
+struct DCTCompInfo {
+ int id; // component ID
+ GBool inScan; // is this component in the current scan?
+ int hSample, vSample; // horiz/vert sampling resolutions
+ int quantTable; // quantization table number
+ int dcHuffTable, acHuffTable; // Huffman table numbers
+ int prevDC; // DC coefficient accumulator
+};
+
+// DCT Huffman decoding table
+struct DCTHuffTable {
+ Guchar firstSym[17]; // first symbol for this bit length
+ Gushort firstCode[17]; // first code for this bit length
+ Gushort numCodes[17]; // number of codes of this bit length
+ Guchar sym[256]; // symbols
+};
+
+class DCTStream: public FilterStream {
+public:
+
+ DCTStream(Stream *str);
+ virtual ~DCTStream();
+ virtual StreamKind getKind() { return strDCT; }
+ virtual void reset();
+ virtual int getChar();
+ virtual int lookChar();
+ virtual GString *getPSFilter(char *indent);
+ virtual GBool isBinary(GBool last = gTrue);
+ Stream *getRawStream() { return str; }
+
+private:
+
+ int width, height; // image size
+ int mcuWidth, mcuHeight; // size of min coding unit, in data units
+ DCTCompInfo compInfo[4]; // info for each component
+ int numComps; // number of components in image
+ int colorXform; // need YCbCr-to-RGB transform?
+ GBool gotAdobeMarker; // set if APP14 Adobe marker was present
+ int restartInterval; // restart interval, in MCUs
+ Guchar quantTables[4][64]; // quantization tables
+ int numQuantTables; // number of quantization tables
+ DCTHuffTable dcHuffTables[4]; // DC Huffman tables
+ DCTHuffTable acHuffTables[4]; // AC Huffman tables
+ int numDCHuffTables; // number of DC Huffman tables
+ int numACHuffTables; // number of AC Huffman tables
+ Guchar *rowBuf[4][32]; // buffer for one MCU
+ int comp, x, y, dy; // current position within image/MCU
+ int restartCtr; // MCUs left until restart
+ int restartMarker; // next restart marker
+ int inputBuf; // input buffer for variable length codes
+ int inputBits; // number of valid bits in input buffer
+
+ void restart();
+ GBool readMCURow();
+ GBool readDataUnit(DCTHuffTable *dcHuffTable, DCTHuffTable *acHuffTable,
+ Guchar quantTable[64], int *prevDC, Guchar data[64]);
+ int readHuffSym(DCTHuffTable *table);
+ int readAmp(int size);
+ int readBit();
+ GBool readHeader();
+ GBool readFrameInfo();
+ GBool readScanInfo();
+ GBool readQuantTables();
+ GBool readHuffmanTables();
+ GBool readRestartInterval();
+ GBool readAdobeMarker();
+ GBool readTrailer();
+ int readMarker();
+ int read16();
+};
+
+//------------------------------------------------------------------------
+// FlateStream
+//------------------------------------------------------------------------
+
+#define flateWindow 32768 // buffer size
+#define flateMask (flateWindow-1)
+#define flateMaxHuffman 15 // max Huffman code length
+#define flateMaxCodeLenCodes 19 // max # code length codes
+#define flateMaxLitCodes 288 // max # literal codes
+#define flateMaxDistCodes 30 // max # distance codes
+
+// Huffman code table entry
+struct FlateCode {
+ int len; // code length in bits
+ int code; // code word
+ int val; // value represented by this code
+};
+
+// Huffman code table
+struct FlateHuffmanTab {
+ int start[flateMaxHuffman+2]; // indexes of first code of each length
+ FlateCode *codes; // codes, sorted by length and code word
+};
+
+// Decoding info for length and distance code words
+struct FlateDecode {
+ int bits; // # extra bits
+ int first; // first length/distance
+};
+
+class FlateStream: public FilterStream {
+public:
+
+ FlateStream(Stream *str, int predictor1, int columns1,
+ int colors1, int bits1);
+ virtual ~FlateStream();
+ virtual StreamKind getKind() { return strFlate; }
+ virtual void reset();
+ virtual int getChar();
+ virtual int lookChar();
+ virtual int getRawChar();
+ virtual GString *getPSFilter(char *indent);
+ virtual GBool isBinary(GBool last = gTrue);
+
+private:
+
+ StreamPredictor *pred; // predictor
+ Guchar buf[flateWindow]; // output data buffer
+ int index; // current index into output buffer
+ int remain; // number valid bytes in output buffer
+ int codeBuf; // input buffer
+ int codeSize; // number of bits in input buffer
+ FlateCode // literal and distance codes
+ allCodes[flateMaxLitCodes + flateMaxDistCodes];
+ FlateHuffmanTab litCodeTab; // literal code table
+ FlateHuffmanTab distCodeTab; // distance code table
+ GBool compressedBlock; // set if reading a compressed block
+ int blockLen; // remaining length of uncompressed block
+ GBool endOfBlock; // set when end of block is reached
+ GBool eof; // set when end of stream is reached
+
+ static int // code length code reordering
+ codeLenCodeMap[flateMaxCodeLenCodes];
+ static FlateDecode // length decoding info
+ lengthDecode[flateMaxLitCodes-257];
+ static FlateDecode // distance decoding info
+ distDecode[flateMaxDistCodes];
+
+ void readSome();
+ GBool startBlock();
+ void loadFixedCodes();
+ GBool readDynamicCodes();
+ void compHuffmanCodes(FlateHuffmanTab *tab, int n);
+ int getHuffmanCodeWord(FlateHuffmanTab *tab);
+ int getCodeWord(int bits);
+};
+
+//------------------------------------------------------------------------
+// EOFStream
+//------------------------------------------------------------------------
+
+class EOFStream: public FilterStream {
+public:
+
+ EOFStream(Stream *str);
+ virtual ~EOFStream();
+ virtual StreamKind getKind() { return strWeird; }
+ virtual void reset() {}
+ virtual int getChar() { return EOF; }
+ virtual int lookChar() { return EOF; }
+ virtual GString *getPSFilter(char *indent) { return NULL; }
+ virtual GBool isBinary(GBool last = gTrue) { return gFalse; }
+};
+
+//------------------------------------------------------------------------
+// FixedLengthEncoder
+//------------------------------------------------------------------------
+
+class FixedLengthEncoder: public FilterStream {
+public:
+
+ FixedLengthEncoder(Stream *str, int length1);
+ ~FixedLengthEncoder();
+ virtual StreamKind getKind() { return strWeird; }
+ virtual void reset();
+ virtual void close();
+ virtual int getChar();
+ virtual int lookChar();
+ virtual GString *getPSFilter(char *indent) { return NULL; }
+ virtual GBool isBinary(GBool last = gTrue) { return gFalse; }
+ virtual GBool isEncoder() { return gTrue; }
+
+private:
+
+ int length;
+ int count;
+};
+
+//------------------------------------------------------------------------
+// ASCII85Encoder
+//------------------------------------------------------------------------
+
+class ASCII85Encoder: public FilterStream {
+public:
+
+ ASCII85Encoder(Stream *str);
+ virtual ~ASCII85Encoder();
+ virtual StreamKind getKind() { return strWeird; }
+ virtual void reset();
+ virtual void close();
+ virtual int getChar()
+ { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
+ virtual int lookChar()
+ { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
+ virtual GString *getPSFilter(char *indent) { return NULL; }
+ virtual GBool isBinary(GBool last = gTrue) { return gFalse; }
+ virtual GBool isEncoder() { return gTrue; }
+
+private:
+
+ char buf[8];
+ char *bufPtr;
+ char *bufEnd;
+ int lineLen;
+ GBool eof;
+
+ GBool fillBuf();
+};
+
+//------------------------------------------------------------------------
+// RunLengthEncoder
+//------------------------------------------------------------------------
+
+class RunLengthEncoder: public FilterStream {
+public:
+
+ RunLengthEncoder(Stream *str);
+ virtual ~RunLengthEncoder();
+ virtual StreamKind getKind() { return strWeird; }
+ virtual void reset();
+ virtual void close();
+ virtual int getChar()
+ { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
+ virtual int lookChar()
+ { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
+ virtual GString *getPSFilter(char *indent) { return NULL; }
+ virtual GBool isBinary(GBool last = gTrue) { return gFalse; }
+ virtual GBool isEncoder() { return gTrue; }
+
+private:
+
+ char buf[131];
+ char *bufPtr;
+ char *bufEnd;
+ char *nextEnd;
+ GBool eof;
+
+ GBool fillBuf();
+};
+
+#endif
diff --git a/pdf2swf/xpdf/XRef.cc b/pdf2swf/xpdf/XRef.cc
new file mode 100644
index 00000000..d70b9f20
--- /dev/null
+++ b/pdf2swf/xpdf/XRef.cc
@@ -0,0 +1,592 @@
+//========================================================================
+//
+// XRef.cc
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <ctype.h>
+#include "gmem.h"
+#include "Object.h"
+#include "Stream.h"
+#include "Lexer.h"
+#include "Parser.h"
+#include "Dict.h"
+#ifndef NO_DECRYPTION
+#include "Decrypt.h"
+#endif
+#include "Error.h"
+#include "XRef.h"
+
+//------------------------------------------------------------------------
+
+#define xrefSearchSize 1024 // read this many bytes at end of file
+ // to look for 'startxref'
+
+#ifndef NO_DECRYPTION
+//------------------------------------------------------------------------
+// Permission bits
+//------------------------------------------------------------------------
+
+#define permPrint (1<<2)
+#define permChange (1<<3)
+#define permCopy (1<<4)
+#define permNotes (1<<5)
+#define defPermFlags 0xfffc
+#endif
+
+//------------------------------------------------------------------------
+// The global xref table
+//------------------------------------------------------------------------
+
+XRef *xref = NULL;
+
+//------------------------------------------------------------------------
+// XRef
+//------------------------------------------------------------------------
+
+XRef::XRef(BaseStream *str, GString *userPassword) {
+ XRef *oldXref;
+ int pos;
+ int i;
+
+ ok = gTrue;
+ size = 0;
+ entries = NULL;
+ streamEnds = NULL;
+ streamEndsLen = 0;
+
+ // get rid of old xref (otherwise it will try to fetch the Root object
+ // in the new document, using the old xref)
+ oldXref = xref;
+ xref = NULL;
+
+ // read the trailer
+ this->str = str;
+ start = str->getStart();
+ pos = readTrailer();
+
+ // if there was a problem with the trailer,
+ // try to reconstruct the xref table
+ if (pos == 0) {
+ if (!(ok = constructXRef())) {
+ xref = oldXref;
+ return;
+ }
+
+ // trailer is ok - read the xref table
+ } else {
+ entries = (XRefEntry *)gmalloc(size * sizeof(XRefEntry));
+ for (i = 0; i < size; ++i) {
+ entries[i].offset = -1;
+ entries[i].used = gFalse;
+ }
+ while (readXRef(&pos)) ;
+
+ // if there was a problem with the xref table,
+ // try to reconstruct it
+ if (!ok) {
+ gfree(entries);
+ size = 0;
+ entries = NULL;
+ if (!(ok = constructXRef())) {
+ xref = oldXref;
+ return;
+ }
+ }
+ }
+
+ // set up new xref table
+ xref = this;
+
+ // check for encryption
+#ifndef NO_DECRYPTION
+ encrypted = gFalse;
+#endif
+ if (checkEncrypted(userPassword)) {
+ ok = gFalse;
+ xref = oldXref;
+ return;
+ }
+}
+
+XRef::~XRef() {
+ gfree(entries);
+ trailerDict.free();
+ if (streamEnds) {
+ gfree(streamEnds);
+ }
+}
+
+// Read startxref position, xref table size, and root. Returns
+// first xref position.
+int XRef::readTrailer() {
+ Parser *parser;
+ Object obj;
+ char buf[xrefSearchSize+1];
+ int n, pos, pos1;
+ char *p;
+ int c;
+ int i;
+
+ // read last xrefSearchSize bytes
+ str->setPos(-xrefSearchSize);
+ for (n = 0; n < xrefSearchSize; ++n) {
+ if ((c = str->getChar()) == EOF)
+ break;
+ buf[n] = c;
+ }
+ buf[n] = '\0';
+
+ // find startxref
+ for (i = n - 9; i >= 0; --i) {
+ if (!strncmp(&buf[i], "startxref", 9))
+ break;
+ }
+ if (i < 0)
+ return 0;
+ for (p = &buf[i+9]; isspace(*p); ++p) ;
+ pos = lastXRefPos = atoi(p);
+
+ // find trailer dict by looking after first xref table
+ // (NB: we can't just use the trailer dict at the end of the file --
+ // this won't work for linearized files.)
+ str->setPos(start + pos);
+ for (i = 0; i < 4; ++i)
+ buf[i] = str->getChar();
+ if (strncmp(buf, "xref", 4))
+ return 0;
+ pos1 = pos + 4;
+ while (1) {
+ str->setPos(start + pos1);
+ for (i = 0; i < 35; ++i) {
+ if ((c = str->getChar()) == EOF)
+ return 0;
+ buf[i] = c;
+ }
+ if (!strncmp(buf, "trailer", 7))
+ break;
+ p = buf;
+ while (isspace(*p)) ++p;
+ while ('0' <= *p && *p <= '9') ++p;
+ while (isspace(*p)) ++p;
+ n = atoi(p);
+ while ('0' <= *p && *p <= '9') ++p;
+ while (isspace(*p)) ++p;
+ if (p == buf)
+ return 0;
+ pos1 += (p - buf) + n * 20;
+ }
+ pos1 += 7;
+
+ // read trailer dict
+ obj.initNull();
+ parser = new Parser(new Lexer(str->makeSubStream(start + pos1, -1, &obj)));
+ parser->getObj(&trailerDict);
+ if (trailerDict.isDict()) {
+ trailerDict.dictLookupNF("Size", &obj);
+ if (obj.isInt())
+ size = obj.getInt();
+ else
+ pos = 0;
+ obj.free();
+ trailerDict.dictLookupNF("Root", &obj);
+ if (obj.isRef()) {
+ rootNum = obj.getRefNum();
+ rootGen = obj.getRefGen();
+ } else {
+ pos = 0;
+ }
+ obj.free();
+ } else {
+ pos = 0;
+ }
+ delete parser;
+
+ // return first xref position
+ return pos;
+}
+
+// Read an xref table and the prev pointer from the trailer.
+GBool XRef::readXRef(int *pos) {
+ Parser *parser;
+ Object obj, obj2;
+ char s[20];
+ GBool more;
+ int first, n, i, j;
+ int c;
+
+ // seek to xref in stream
+ str->setPos(start + *pos);
+
+ // make sure it's an xref table
+ while ((c = str->getChar()) != EOF && isspace(c)) ;
+ s[0] = (char)c;
+ s[1] = (char)str->getChar();
+ s[2] = (char)str->getChar();
+ s[3] = (char)str->getChar();
+ if (!(s[0] == 'x' && s[1] == 'r' && s[2] == 'e' && s[3] == 'f'))
+ goto err2;
+
+ // read xref
+ while (1) {
+ while ((c = str->lookChar()) != EOF && isspace(c))
+ str->getChar();
+ if (c == 't')
+ break;
+ for (i = 0; (c = str->getChar()) != EOF && isdigit(c) && i < 20; ++i)
+ s[i] = (char)c;
+ if (i == 0)
+ goto err2;
+ s[i] = '\0';
+ first = atoi(s);
+ while ((c = str->lookChar()) != EOF && isspace(c))
+ str->getChar();
+ for (i = 0; (c = str->getChar()) != EOF && isdigit(c) && i < 20; ++i)
+ s[i] = (char)c;
+ if (i == 0)
+ goto err2;
+ s[i] = '\0';
+ n = atoi(s);
+ while ((c = str->lookChar()) != EOF && isspace(c))
+ str->getChar();
+ for (i = first; i < first + n; ++i) {
+ for (j = 0; j < 20; ++j) {
+ if ((c = str->getChar()) == EOF)
+ goto err2;
+ s[j] = (char)c;
+ }
+ if (entries[i].offset < 0) {
+ s[10] = '\0';
+ entries[i].offset = atoi(s);
+ s[16] = '\0';
+ entries[i].gen = atoi(&s[11]);
+ if (s[17] == 'n')
+ entries[i].used = gTrue;
+ else if (s[17] == 'f')
+ entries[i].used = gFalse;
+ else
+ goto err2;
+#if 1 //~
+ //~ PDF files of patents from the IBM Intellectual Property
+ //~ Network have a bug: the xref table claims to start at 1
+ //~ instead of 0.
+ if (i == 1 && first == 1 &&
+ entries[1].offset == 0 && entries[1].gen == 65535 &&
+ !entries[1].used) {
+ i = first = 0;
+ entries[0] = entries[1];
+ entries[1].offset = -1;
+ }
+#endif
+ }
+ }
+ }
+
+ // read prev pointer from trailer dictionary
+ obj.initNull();
+ parser = new Parser(new Lexer(str->makeSubStream(str->getPos(), -1, &obj)));
+ parser->getObj(&obj);
+ if (!obj.isCmd("trailer"))
+ goto err1;
+ obj.free();
+ parser->getObj(&obj);
+ if (!obj.isDict())
+ goto err1;
+ obj.getDict()->lookupNF("Prev", &obj2);
+ if (obj2.isInt()) {
+ *pos = obj2.getInt();
+ more = gTrue;
+ } else {
+ more = gFalse;
+ }
+ obj.free();
+ obj2.free();
+
+ delete parser;
+ return more;
+
+ err1:
+ obj.free();
+ err2:
+ ok = gFalse;
+ return gFalse;
+}
+
+// Attempt to construct an xref table for a damaged file.
+GBool XRef::constructXRef() {
+ Parser *parser;
+ Object obj;
+ char buf[256];
+ int pos;
+ int num, gen;
+ int newSize;
+ int streamEndsSize;
+ char *p;
+ int i;
+ GBool gotRoot;
+
+ error(0, "PDF file is damaged - attempting to reconstruct xref table...");
+ gotRoot = gFalse;
+ streamEndsLen = streamEndsSize = 0;
+
+ str->reset();
+ while (1) {
+ pos = str->getPos();
+ if (!str->getLine(buf, 256)) {
+ break;
+ }
+ p = buf;
+
+ // got trailer dictionary
+ if (!strncmp(p, "trailer", 7)) {
+ obj.initNull();
+ parser = new Parser(new Lexer(
+ str->makeSubStream(start + pos + 7, -1, &obj)));
+ if (!trailerDict.isNone())
+ trailerDict.free();
+ parser->getObj(&trailerDict);
+ if (trailerDict.isDict()) {
+ trailerDict.dictLookupNF("Root", &obj);
+ if (obj.isRef()) {
+ rootNum = obj.getRefNum();
+ rootGen = obj.getRefGen();
+ gotRoot = gTrue;
+ }
+ obj.free();
+ } else {
+ pos = 0;
+ }
+ delete parser;
+
+ // look for object
+ } else if (isdigit(*p)) {
+ num = atoi(p);
+ do {
+ ++p;
+ } while (*p && isdigit(*p));
+ if (isspace(*p)) {
+ do {
+ ++p;
+ } while (*p && isspace(*p));
+ if (isdigit(*p)) {
+ gen = atoi(p);
+ do {
+ ++p;
+ } while (*p && isdigit(*p));
+ if (isspace(*p)) {
+ do {
+ ++p;
+ } while (*p && isspace(*p));
+ if (!strncmp(p, "obj", 3)) {
+ if (num >= size) {
+ newSize = (num + 1 + 255) & ~255;
+ entries = (XRefEntry *)
+ grealloc(entries, newSize * sizeof(XRefEntry));
+ for (i = size; i < newSize; ++i) {
+ entries[i].offset = -1;
+ entries[i].used = gFalse;
+ }
+ size = newSize;
+ }
+ if (!entries[num].used || gen >= entries[num].gen) {
+ entries[num].offset = pos - start;
+ entries[num].gen = gen;
+ entries[num].used = gTrue;
+ }
+ }
+ }
+ }
+ }
+
+ } else if (!strncmp(p, "endstream", 9)) {
+ if (streamEndsLen == streamEndsSize) {
+ streamEndsSize += 64;
+ streamEnds = (int *)grealloc(streamEnds, streamEndsSize * sizeof(int));
+ }
+ streamEnds[streamEndsLen++] = pos;
+ }
+ }
+
+ if (gotRoot)
+ return gTrue;
+
+ error(-1, "Couldn't find trailer dictionary");
+ return gFalse;
+}
+
+#ifndef NO_DECRYPTION
+GBool XRef::checkEncrypted(GString *userPassword) {
+ Object encrypt, ownerKey, userKey, permissions, fileID, fileID1;
+ GBool encrypted1;
+ GBool ret;
+
+ ret = gFalse;
+
+ permFlags = defPermFlags;
+ trailerDict.dictLookup("Encrypt", &encrypt);
+ if ((encrypted1 = encrypt.isDict())) {
+ ret = gTrue;
+ encrypt.dictLookup("O", &ownerKey);
+ encrypt.dictLookup("U", &userKey);
+ encrypt.dictLookup("P", &permissions);
+ trailerDict.dictLookup("ID", &fileID);
+ if (ownerKey.isString() && ownerKey.getString()->getLength() == 32 &&
+ userKey.isString() && userKey.getString()->getLength() == 32 &&
+ permissions.isInt() &&
+ fileID.isArray()) {
+ permFlags = permissions.getInt();
+ fileID.arrayGet(0, &fileID1);
+ if (fileID1.isString()) {
+ if (Decrypt::makeFileKey(ownerKey.getString(), userKey.getString(),
+ permFlags, fileID1.getString(),
+ userPassword, fileKey)) {
+ ret = gFalse;
+ } else {
+ error(-1, "Incorrect user password");
+ }
+ } else {
+ error(-1, "Weird encryption info");
+ }
+ fileID1.free();
+ } else {
+ error(-1, "Weird encryption info");
+ }
+ ownerKey.free();
+ userKey.free();
+ permissions.free();
+ fileID.free();
+ }
+ encrypt.free();
+
+ // this flag has to be set *after* we read the O/U/P strings
+ encrypted = encrypted1;
+
+ return ret;
+}
+#else
+GBool XRef::checkEncrypted(GString *userPassword) {
+ Object obj;
+ GBool encrypted;
+
+ trailerDict.dictLookup("Encrypt", &obj);
+ if ((encrypted = !obj.isNull())) {
+ error(-1, "PDF file is encrypted and cannot be displayed");
+ error(-1, "* Decryption support is currently not included in xpdf");
+ error(-1, "* due to legal restrictions: the U.S.A. still has bogus");
+ error(-1, "* export controls on cryptography software.");
+ }
+ obj.free();
+ return encrypted;
+}
+#endif
+
+GBool XRef::okToPrint() {
+#ifndef NO_DECRYPTION
+ if (!(permFlags & permPrint)) {
+ return gFalse;
+ }
+#endif
+ return gTrue;
+}
+
+GBool XRef::okToChange() {
+#ifndef NO_DECRYPTION
+ if (!(permFlags & permChange)) {
+ return gFalse;
+ }
+#endif
+ return gTrue;
+}
+
+GBool XRef::okToCopy() {
+#ifndef NO_DECRYPTION
+ if (!(permFlags & permCopy)) {
+ return gFalse;
+ }
+#endif
+ return gTrue;
+}
+
+GBool XRef::okToAddNotes() {
+#ifndef NO_DECRYPTION
+ if (!(permFlags & permNotes)) {
+ return gFalse;
+ }
+#endif
+ return gTrue;
+}
+
+Object *XRef::fetch(int num, int gen, Object *obj) {
+ XRefEntry *e;
+ Parser *parser;
+ Object obj1, obj2, obj3;
+
+ // check for bogus ref - this can happen in corrupted PDF files
+ if (num < 0 || num >= size) {
+ obj->initNull();
+ return obj;
+ }
+
+ e = &entries[num];
+ if (e->gen == gen && e->offset >= 0) {
+ obj1.initNull();
+ parser = new Parser(new Lexer(
+ str->makeSubStream(start + e->offset, -1, &obj1)));
+ parser->getObj(&obj1);
+ parser->getObj(&obj2);
+ parser->getObj(&obj3);
+ if (obj1.isInt() && obj1.getInt() == num &&
+ obj2.isInt() && obj2.getInt() == gen &&
+ obj3.isCmd("obj")) {
+#ifndef NO_DECRYPTION
+ parser->getObj(obj, encrypted ? fileKey : (Guchar *)NULL, num, gen);
+#else
+ parser->getObj(obj);
+#endif
+ } else {
+ obj->initNull();
+ }
+ obj1.free();
+ obj2.free();
+ obj3.free();
+ delete parser;
+ } else {
+ obj->initNull();
+ }
+ return obj;
+}
+
+Object *XRef::getDocInfo(Object *obj) {
+ return trailerDict.dictLookup("Info", obj);
+}
+
+int XRef::getStreamEnd(int start) {
+ int a, b, m;
+
+ if (streamEndsLen == 0 ||
+ start > streamEnds[streamEndsLen - 1]) {
+ return -1;
+ }
+
+ a = -1;
+ b = streamEndsLen - 1;
+ // invariant: streamEnds[a] < start <= streamEnds[b]
+ while (b - a > 1) {
+ m = (a + b) / 2;
+ if (start <= streamEnds[m]) {
+ b = m;
+ } else {
+ a = m;
+ }
+ }
+ return streamEnds[b];
+}
diff --git a/pdf2swf/xpdf/XRef.h b/pdf2swf/xpdf/XRef.h
new file mode 100644
index 00000000..e2260d0c
--- /dev/null
+++ b/pdf2swf/xpdf/XRef.h
@@ -0,0 +1,112 @@
+//========================================================================
+//
+// XRef.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef XREF_H
+#define XREF_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "gtypes.h"
+#include "Object.h"
+
+class Dict;
+class Stream;
+
+//------------------------------------------------------------------------
+// XRef
+//------------------------------------------------------------------------
+
+struct XRefEntry {
+ int offset;
+ int gen;
+ GBool used;
+};
+
+class XRef {
+public:
+
+ // Constructor. Read xref table from stream.
+ XRef(BaseStream *str, GString *userPassword);
+
+ // Destructor.
+ ~XRef();
+
+ // Is xref table valid?
+ GBool isOk() { return ok; }
+
+ // Is the file encrypted?
+#ifndef NO_DECRYPTION
+ GBool isEncrypted() { return encrypted; }
+#else
+ GBool isEncrypted() { return gFalse; }
+#endif
+
+ // Check various permissions.
+ GBool okToPrint();
+ GBool okToChange();
+ GBool okToCopy();
+ GBool okToAddNotes();
+
+ // Get catalog object.
+ Object *getCatalog(Object *obj) { return fetch(rootNum, rootGen, obj); }
+
+ // Fetch an indirect reference.
+ Object *fetch(int num, int gen, Object *obj);
+
+ // Return the document's Info dictionary (if any).
+ Object *getDocInfo(Object *obj);
+
+ // Return the number of objects in the xref table.
+ int getNumObjects() { return size; }
+
+ // Return the offset of the last xref table.
+ int getLastXRefPos() { return lastXRefPos; }
+
+ // Return the catalog object reference.
+ int getRootNum() { return rootNum; }
+ int getRootGen() { return rootGen; }
+
+ // Get end position for a stream in a damaged file.
+ // Returns -1 if unknown or file is not damaged.
+ int getStreamEnd(int start);
+
+private:
+
+ BaseStream *str; // input stream
+ int start; // offset in file (to allow for garbage
+ // at beginning of file)
+ XRefEntry *entries; // xref entries
+ int size; // size of <entries> array
+ int rootNum, rootGen; // catalog dict
+ GBool ok; // true if xref table is valid
+ Object trailerDict; // trailer dictionary
+ int lastXRefPos; // offset of last xref table
+ int *streamEnds; // 'endstream' positions - only used in
+ // damaged files
+ int streamEndsLen; // number of valid entries in streamEnds
+#ifndef NO_DECRYPTION
+ GBool encrypted; // true if file is encrypted
+ int permFlags; // permission bits
+ Guchar fileKey[16]; // file decryption key
+#endif
+
+ int readTrailer();
+ GBool readXRef(int *pos);
+ GBool constructXRef();
+ GBool checkEncrypted(GString *userPassword);
+};
+
+//------------------------------------------------------------------------
+// The global xref table
+//------------------------------------------------------------------------
+
+extern XRef *xref;
+
+#endif
diff --git a/pdf2swf/xpdf/config.h b/pdf2swf/xpdf/config.h
new file mode 100644
index 00000000..c09d8f5a
--- /dev/null
+++ b/pdf2swf/xpdf/config.h
@@ -0,0 +1,115 @@
+//========================================================================
+//
+// config.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+//------------------------------------------------------------------------
+// general constants
+//------------------------------------------------------------------------
+
+// xpdf version
+#define xpdfVersion "0.92"
+
+// supported PDF version
+#define supportedPDFVersionStr "1.3"
+#define supportedPDFVersionNum 1.3
+
+// copyright notice
+#define xpdfCopyright "Copyright 1996-2000 Derek B. Noonburg"
+
+// default paper size (in points) for PostScript output
+#ifdef A4_PAPER
+#define defPaperWidth 595 // ISO A4 (210x297 mm)
+#define defPaperHeight 842
+#else
+#define defPaperWidth 612 // American letter (8.5x11")
+#define defPaperHeight 792
+#endif
+
+// config file name
+#if defined(VMS)
+#define xpdfConfigFile "xpdfrc"
+#else
+#define xpdfConfigFile ".xpdfrc"
+#endif
+
+//------------------------------------------------------------------------
+// X-related constants
+//------------------------------------------------------------------------
+
+// default maximum size of color cube to allocate
+#define defaultRGBCube 5
+
+// number of X server fonts to cache
+#define serverFontCacheSize 16
+
+// number of Type 1 (t1lib) fonts to cache
+#define t1FontCacheSize 32
+
+// number of TrueType (FreeType) fonts to cache
+#define ttFontCacheSize 32
+
+//------------------------------------------------------------------------
+// popen
+//------------------------------------------------------------------------
+
+#ifdef _MSC_VER
+#define popen _popen
+#define pclose _pclose
+#endif
+
+#if defined(VMS) || defined(VMCMS) || defined(DOS) || defined(OS2) || defined(WIN32) || defined(__DJGPP__) || defined(__CYGWIN32) || defined(MACOS)
+#define POPEN_READ_MODE "rb"
+#else
+#define POPEN_READ_MODE "r"
+#endif
+
+//------------------------------------------------------------------------
+// uncompress program
+//------------------------------------------------------------------------
+
+#ifdef HAVE_POPEN
+
+// command to uncompress to stdout
+# ifdef USE_GZIP
+# define uncompressCmd "gzip -d -c -q"
+# else
+# ifdef __EMX__
+# define uncompressCmd "compress -d -c"
+# else
+# define uncompressCmd "uncompress -c"
+# endif // __EMX__
+# endif // USE_GZIP
+
+#else // HAVE_POPEN
+
+// command to uncompress a file
+# ifdef USE_GZIP
+# define uncompressCmd "gzip -d -q"
+# else
+# define uncompressCmd "uncompress"
+# endif // USE_GZIP
+
+#endif // HAVE_POPEN
+
+//------------------------------------------------------------------------
+// Win32 stuff
+//------------------------------------------------------------------------
+
+#ifdef CDECL
+#undef CDECL
+#endif
+
+#ifdef _MSC_VER
+#define CDECL __cdecl
+#else
+#define CDECL
+#endif
+
+#endif
diff --git a/pdf2swf/xpdf/gfile.cc b/pdf2swf/xpdf/gfile.cc
new file mode 100644
index 00000000..cc0324c2
--- /dev/null
+++ b/pdf2swf/xpdf/gfile.cc
@@ -0,0 +1,643 @@
+//========================================================================
+//
+// gfile.cc
+//
+// Miscellaneous file and directory name manipulation.
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#include "../../config.h"
+#ifdef WIN32
+ extern "C" {
+# ifndef _MSC_VER
+# include <kpathsea/win32lib.h>
+# endif
+ }
+#else // !WIN32
+# if defined(MACOS)
+# include <sys/stat.h>
+# elif !defined(ACORN)
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <fcntl.h>
+# endif
+# include <limits.h>
+# include <string.h>
+# if !defined(VMS) && !defined(ACORN) && !defined(MACOS)
+# include <pwd.h>
+# endif
+# if defined(VMS) && (__DECCXX_VER < 50200000)
+# include <unixlib.h>
+# endif
+#endif // WIN32
+#include "GString.h"
+#include "gfile.h"
+
+// Some systems don't define this, so just make it something reasonably
+// large.
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+//------------------------------------------------------------------------
+
+GString *getHomeDir() {
+#ifdef VMS
+ //---------- VMS ----------
+ return new GString("SYS$LOGIN:");
+
+#elif defined(__EMX__) || defined(WIN32)
+ //---------- OS/2+EMX and Win32 ----------
+ char *s;
+ GString *ret;
+
+ if ((s = getenv("HOME")))
+ ret = new GString(s);
+ else
+ ret = new GString(".");
+ return ret;
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ return new GString("@");
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ return new GString(":");
+
+#else
+ //---------- Unix ----------
+ char *s;
+ struct passwd *pw;
+ GString *ret;
+
+ if ((s = getenv("HOME"))) {
+ ret = new GString(s);
+ } else {
+ if ((s = getenv("USER")))
+ pw = getpwnam(s);
+ else
+ pw = getpwuid(getuid());
+ if (pw)
+ ret = new GString(pw->pw_dir);
+ else
+ ret = new GString(".");
+ }
+ return ret;
+#endif
+}
+
+GString *getCurrentDir() {
+ char buf[PATH_MAX+1];
+
+#if defined(__EMX__)
+ if (_getcwd2(buf, sizeof(buf)))
+#elif defined(WIN32)
+ if (GetCurrentDirectory(sizeof(buf), buf))
+#elif defined(ACORN)
+ if (strcpy(buf, "@"))
+#elif defined(MACOS)
+ if (strcpy(buf, ":"))
+#else
+ if (getcwd(buf, sizeof(buf)))
+#endif
+ return new GString(buf);
+ return new GString();
+}
+
+GString *appendToPath(GString *path, char *fileName) {
+#if defined(VMS)
+ //---------- VMS ----------
+ //~ this should handle everything necessary for file
+ //~ requesters, but it's certainly not complete
+ char *p0, *p1, *p2;
+ char *q1;
+
+ p0 = path->getCString();
+ p1 = p0 + path->getLength() - 1;
+ if (!strcmp(fileName, "-")) {
+ if (*p1 == ']') {
+ for (p2 = p1; p2 > p0 && *p2 != '.' && *p2 != '['; --p2) ;
+ if (*p2 == '[')
+ ++p2;
+ path->del(p2 - p0, p1 - p2);
+ } else if (*p1 == ':') {
+ path->append("[-]");
+ } else {
+ path->clear();
+ path->append("[-]");
+ }
+ } else if ((q1 = strrchr(fileName, '.')) && !strncmp(q1, ".DIR;", 5)) {
+ if (*p1 == ']') {
+ path->insert(p1 - p0, '.');
+ path->insert(p1 - p0 + 1, fileName, q1 - fileName);
+ } else if (*p1 == ':') {
+ path->append('[');
+ path->append(']');
+ path->append(fileName, q1 - fileName);
+ } else {
+ path->clear();
+ path->append(fileName, q1 - fileName);
+ }
+ } else {
+ if (*p1 != ']' && *p1 != ':')
+ path->clear();
+ path->append(fileName);
+ }
+ return path;
+
+#elif defined(WIN32)
+ //---------- Win32 ----------
+ GString *tmp;
+ char buf[256];
+ char *fp;
+
+ tmp = new GString(path);
+ tmp->append('/');
+ tmp->append(fileName);
+ GetFullPathName(tmp->getCString(), sizeof(buf), buf, &fp);
+ delete tmp;
+ path->clear();
+ path->append(buf);
+ return path;
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ char *p;
+ int i;
+
+ path->append(".");
+ i = path->getLength();
+ path->append(fileName);
+ for (p = path->getCString() + i; *p; ++p) {
+ if (*p == '/') {
+ *p = '.';
+ } else if (*p == '.') {
+ *p = '/';
+ }
+ }
+ return path;
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ char *p;
+ int i;
+
+ path->append(":");
+ i = path->getLength();
+ path->append(fileName);
+ for (p = path->getCString() + i; *p; ++p) {
+ if (*p == '/') {
+ *p = ':';
+ } else if (*p == '.') {
+ *p = ':';
+ }
+ }
+ return path;
+
+#elif defined(__EMX__)
+ //---------- OS/2+EMX ----------
+ int i;
+
+ // appending "." does nothing
+ if (!strcmp(fileName, "."))
+ return path;
+
+ // appending ".." goes up one directory
+ if (!strcmp(fileName, "..")) {
+ for (i = path->getLength() - 2; i >= 0; --i) {
+ if (path->getChar(i) == '/' || path->getChar(i) == '\\' ||
+ path->getChar(i) == ':')
+ break;
+ }
+ if (i <= 0) {
+ if (path->getChar(0) == '/' || path->getChar(0) == '\\') {
+ path->del(1, path->getLength() - 1);
+ } else if (path->getLength() >= 2 && path->getChar(1) == ':') {
+ path->del(2, path->getLength() - 2);
+ } else {
+ path->clear();
+ path->append("..");
+ }
+ } else {
+ if (path->getChar(i-1) == ':')
+ ++i;
+ path->del(i, path->getLength() - i);
+ }
+ return path;
+ }
+
+ // otherwise, append "/" and new path component
+ if (path->getLength() > 0 &&
+ path->getChar(path->getLength() - 1) != '/' &&
+ path->getChar(path->getLength() - 1) != '\\')
+ path->append('/');
+ path->append(fileName);
+ return path;
+
+#else
+ //---------- Unix ----------
+ int i;
+
+ // appending "." does nothing
+ if (!strcmp(fileName, "."))
+ return path;
+
+ // appending ".." goes up one directory
+ if (!strcmp(fileName, "..")) {
+ for (i = path->getLength() - 2; i >= 0; --i) {
+ if (path->getChar(i) == '/')
+ break;
+ }
+ if (i <= 0) {
+ if (path->getChar(0) == '/') {
+ path->del(1, path->getLength() - 1);
+ } else {
+ path->clear();
+ path->append("..");
+ }
+ } else {
+ path->del(i, path->getLength() - i);
+ }
+ return path;
+ }
+
+ // otherwise, append "/" and new path component
+ if (path->getLength() > 0 &&
+ path->getChar(path->getLength() - 1) != '/')
+ path->append('/');
+ path->append(fileName);
+ return path;
+#endif
+}
+
+GString *grabPath(char *fileName) {
+#ifdef VMS
+ //---------- VMS ----------
+ char *p;
+
+ if ((p = strrchr(fileName, ']')))
+ return new GString(fileName, p + 1 - fileName);
+ if ((p = strrchr(fileName, ':')))
+ return new GString(fileName, p + 1 - fileName);
+ return new GString();
+
+#elif defined(__EMX__) || defined(WIN32)
+ //---------- OS/2+EMX and Win32 ----------
+ char *p;
+
+ if ((p = strrchr(fileName, '/')))
+ return new GString(fileName, p - fileName);
+ if ((p = strrchr(fileName, '\\')))
+ return new GString(fileName, p - fileName);
+ if ((p = strrchr(fileName, ':')))
+ return new GString(fileName, p + 1 - fileName);
+ return new GString();
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ char *p;
+
+ if ((p = strrchr(fileName, '.')))
+ return new GString(fileName, p - fileName);
+ return new GString();
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ char *p;
+
+ if ((p = strrchr(fileName, ':')))
+ return new GString(fileName, p - fileName);
+ return new GString();
+
+#else
+ //---------- Unix ----------
+ char *p;
+
+ if ((p = strrchr(fileName, '/')))
+ return new GString(fileName, p - fileName);
+ return new GString();
+#endif
+}
+
+GBool isAbsolutePath(char *path) {
+#ifdef VMS
+ //---------- VMS ----------
+ return strchr(path, ':') ||
+ (path[0] == '[' && path[1] != '.' && path[1] != '-');
+
+#elif defined(__EMX__) || defined(WIN32)
+ //---------- OS/2+EMX and Win32 ----------
+ return path[0] == '/' || path[0] == '\\' || path[1] == ':';
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ return path[0] == '$';
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ return path[0] != ':';
+
+#else
+ //---------- Unix ----------
+ return path[0] == '/';
+#endif
+}
+
+GString *makePathAbsolute(GString *path) {
+#ifdef VMS
+ //---------- VMS ----------
+ char buf[PATH_MAX+1];
+
+ if (!isAbsolutePath(path->getCString())) {
+ if (getcwd(buf, sizeof(buf))) {
+ path->insert(0, buf);
+ }
+ }
+ return path;
+
+#elif defined(WIN32)
+ //---------- Win32 ----------
+ char buf[_MAX_PATH];
+ char *fp;
+
+ buf[0] = '\0';
+ if (!GetFullPathName(path->getCString(), _MAX_PATH, buf, &fp)) {
+ path->clear();
+ return path;
+ }
+ path->clear();
+ path->append(buf);
+ return path;
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ path->insert(0, '@');
+ return path;
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ path->del(0, 1);
+ return path;
+
+#else
+ //---------- Unix and OS/2+EMX ----------
+ struct passwd *pw;
+ char buf[PATH_MAX+1];
+ GString *s;
+ char *p1, *p2;
+ int n;
+
+ if (path->getChar(0) == '~') {
+ if (path->getChar(1) == '/' ||
+#ifdef __EMX__
+ path->getChar(1) == '\\' ||
+#endif
+ path->getLength() == 1) {
+ path->del(0, 1);
+ s = getHomeDir();
+ path->insert(0, s);
+ delete s;
+ } else {
+ p1 = path->getCString() + 1;
+#ifdef __EMX__
+ for (p2 = p1; *p2 && *p2 != '/' && *p2 != '\\'; ++p2) ;
+#else
+ for (p2 = p1; *p2 && *p2 != '/'; ++p2) ;
+#endif
+ if ((n = p2 - p1) > PATH_MAX)
+ n = PATH_MAX;
+ strncpy(buf, p1, n);
+ buf[n] = '\0';
+ if ((pw = getpwnam(buf))) {
+ path->del(0, p2 - p1 + 1);
+ path->insert(0, pw->pw_dir);
+ }
+ }
+ } else if (!isAbsolutePath(path->getCString())) {
+ if (getcwd(buf, sizeof(buf))) {
+#ifndef __EMX__
+ path->insert(0, '/');
+#endif
+ path->insert(0, buf);
+ }
+ }
+ return path;
+#endif
+}
+
+time_t getModTime(char *fileName) {
+#ifdef WIN32
+ //~ should implement this, but it's (currently) only used in xpdf
+ return 0;
+#else
+ struct stat statBuf;
+
+ if (stat(fileName, &statBuf)) {
+ return 0;
+ }
+ return statBuf.st_mtime;
+#endif
+}
+static char tmpbuf[128];
+static char* mktmpname(char*ptr) {
+// used to be mktemp. This does remove the warnings, but
+// It's not exactly an improvement.
+ sprintf(tmpbuf, "%08x%08x",lrand48(),lrand48());
+ return tmpbuf;
+}
+GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
+#if defined(VMS) || defined(__EMX__) || defined(WIN32) || defined(ACORN) || defined(MACOS)
+ //---------- non-Unix ----------
+ char *s;
+
+ // There is a security hole here: an attacker can create a symlink
+ // with this file name after the tmpnam call and before the fopen
+ // call. I will happily accept fixes to this function for non-Unix
+ // OSs.
+ if (!(s = mktmpname(NULL))) {
+ return gFalse;
+ }
+ *name = new GString(s);
+ if (ext) {
+ (*name)->append(ext);
+ }
+ if (!(*f = fopen((*name)->getCString(), mode))) {
+ delete (*name);
+ return gFalse;
+ }
+ return gTrue;
+#else
+ //---------- Unix ----------
+ char *s, *p;
+ int fd;
+
+ if (ext) {
+ if (!(s = mktmpname(NULL))) {
+ return gFalse;
+ }
+ *name = new GString(s);
+ s = (*name)->getCString();
+ if ((p = strrchr(s, '.'))) {
+ (*name)->del(p - s, (*name)->getLength() - (p - s));
+ }
+ (*name)->append(ext);
+ fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
+ } else {
+#if HAVE_MKSTEMP
+ if ((s = getenv("TMPDIR"))) {
+ *name = new GString(s);
+ } else {
+ *name = new GString("/tmp");
+ }
+ (*name)->append("/XXXXXX");
+ fd = mkstemp((*name)->getCString());
+#else // HAVE_MKSTEMP
+ if (!(s = mktmpname(NULL))) {
+ return gFalse;
+ }
+ *name = new GString(s);
+ fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
+#endif // HAVE_MKSTEMP
+ }
+ if (fd < 0 || !(*f = fdopen(fd, mode))) {
+ delete *name;
+ return gFalse;
+ }
+ return gTrue;
+#endif
+}
+
+//------------------------------------------------------------------------
+// GDir and GDirEntry
+//------------------------------------------------------------------------
+
+GDirEntry::GDirEntry(char *dirPath, char *name1, GBool doStat) {
+#ifdef VMS
+ char *p;
+#elif defined(WIN32)
+ int fa;
+ GString *s;
+#elif defined(ACORN)
+#else
+ struct stat st;
+ GString *s;
+#endif
+
+ name = new GString(name1);
+ dir = gFalse;
+ if (doStat) {
+#ifdef VMS
+ if (!strcmp(name1, "-") ||
+ ((p = strrchr(name1, '.')) && !strncmp(p, ".DIR;", 5)))
+ dir = gTrue;
+#elif defined(ACORN)
+#else
+ s = new GString(dirPath);
+ appendToPath(s, name1);
+#ifdef WIN32
+ fa = GetFileAttributes(s->getCString());
+ dir = (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY));
+#else
+ if (stat(s->getCString(), &st) == 0)
+ dir = S_ISDIR(st.st_mode);
+#endif
+ delete s;
+#endif
+ }
+}
+
+GDirEntry::~GDirEntry() {
+ delete name;
+}
+
+GDir::GDir(char *name, GBool doStat1) {
+ path = new GString(name);
+ doStat = doStat1;
+#if defined(WIN32)
+ GString *tmp;
+
+ tmp = path->copy();
+ tmp->append("/*.*");
+ hnd = FindFirstFile(tmp->getCString(), &ffd);
+ delete tmp;
+#elif defined(ACORN)
+#elif defined(MACOS)
+#else
+ dir = opendir(name);
+#ifdef VMS
+ needParent = strchr(name, '[') != NULL;
+#endif
+#endif
+}
+
+GDir::~GDir() {
+ delete path;
+#if defined(WIN32)
+ if (hnd) {
+ FindClose(hnd);
+ hnd = NULL;
+ }
+#elif defined(ACORN)
+#elif defined(MACOS)
+#else
+ if (dir)
+ closedir(dir);
+#endif
+}
+
+GDirEntry *GDir::getNextEntry() {
+ struct dirent *ent;
+ GDirEntry *e;
+
+ e = NULL;
+#if defined(WIN32)
+ e = new GDirEntry(path->getCString(), ffd.cFileName, doStat);
+ if (hnd && !FindNextFile(hnd, &ffd)) {
+ FindClose(hnd);
+ hnd = NULL;
+ }
+#elif defined(ACORN)
+#elif defined(MACOS)
+#else
+ if (dir) {
+#ifdef VMS
+ if (needParent) {
+ e = new GDirEntry(path->getCString(), "-", doStat);
+ needParent = gFalse;
+ return e;
+ }
+#endif
+ ent = readdir(dir);
+#ifndef VMS
+ if (ent && !strcmp(ent->d_name, "."))
+ ent = readdir(dir);
+#endif
+ if (ent)
+ e = new GDirEntry(path->getCString(), ent->d_name, doStat);
+ }
+#endif
+ return e;
+}
+
+void GDir::rewind() {
+#ifdef WIN32
+ GString *tmp;
+
+ if (hnd)
+ FindClose(hnd);
+ tmp = path->copy();
+ tmp->append("/*.*");
+ hnd = FindFirstFile(tmp->getCString(), &ffd);
+#elif defined(ACORN)
+#elif defined(MACOS)
+#else
+ if (dir)
+ rewinddir(dir);
+#ifdef VMS
+ needParent = strchr(path->getCString(), '[') != NULL;
+#endif
+#endif
+}
diff --git a/pdf2swf/xpdf/gfile.h b/pdf2swf/xpdf/gfile.h
new file mode 100644
index 00000000..28289fb1
--- /dev/null
+++ b/pdf2swf/xpdf/gfile.h
@@ -0,0 +1,132 @@
+//========================================================================
+//
+// gfile.h
+//
+// Miscellaneous file and directory name manipulation.
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef GFILE_H
+#define GFILE_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include "../../config.h"
+#if defined(WIN32)
+# include <sys/stat.h>
+# ifdef FPTEX
+# include <win32lib.h>
+# else
+# include <windows.h>
+# endif
+#elif defined(ACORN)
+#elif defined(MACOS)
+# include <ctime.h>
+#else
+# include <unistd.h>
+# include <sys/types.h>
+# ifdef VMS
+# include "vms_dirent.h"
+# elif HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(d) strlen((d)->d_name)
+# else
+# define dirent direct
+# define NAMLEN(d) (d)->d_namlen
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+# endif
+#endif
+#include "gtypes.h"
+
+class GString;
+
+//------------------------------------------------------------------------
+
+// Get home directory path.
+extern GString *getHomeDir();
+
+// Get current directory.
+extern GString *getCurrentDir();
+
+// Append a file name to a path string. <path> may be an empty
+// string, denoting the current directory). Returns <path>.
+extern GString *appendToPath(GString *path, char *fileName);
+
+// Grab the path from the front of the file name. If there is no
+// directory component in <fileName>, returns an empty string.
+extern GString *grabPath(char *fileName);
+
+// Is this an absolute path or file name?
+extern GBool isAbsolutePath(char *path);
+
+// Make this path absolute by prepending current directory (if path is
+// relative) or prepending user's directory (if path starts with '~').
+GString *makePathAbsolute(GString *path);
+
+// Get the modification time for <fileName>. Returns 0 if there is an
+// error.
+time_t getModTime(char *fileName);
+
+// Create a temporary file and open it for writing. If <ext> is not
+// NULL, it will be used as the file name extension. Returns both the
+// name and the file pointer. For security reasons, all writing
+// should be done to the returned file pointer; the file may be
+// reopened later for reading, but not for writing. The <mode> string
+// should be "w" or "wb". Returns true on success.
+GBool openTempFile(GString **name, FILE **f, char *mode, char *ext);
+
+//------------------------------------------------------------------------
+// GDir and GDirEntry
+//------------------------------------------------------------------------
+
+class GDirEntry {
+public:
+
+ GDirEntry(char *dirPath, char *name1, GBool doStat);
+ ~GDirEntry();
+ GString *getName() { return name; }
+ GBool isDir() { return dir; }
+
+private:
+
+ GString *name; // dir/file name
+ GBool dir; // is it a directory?
+};
+
+class GDir {
+public:
+
+ GDir(char *name, GBool doStat1 = gTrue);
+ ~GDir();
+ GDirEntry *getNextEntry();
+ void rewind();
+
+private:
+
+ GString *path; // directory path
+ GBool doStat; // call stat() for each entry?
+#if defined(WIN32)
+ WIN32_FIND_DATA ffd;
+ HANDLE hnd;
+#elif defined(ACORN)
+#elif defined(MACOS)
+#else
+ DIR *dir; // the DIR structure from opendir()
+#ifdef VMS
+ GBool needParent; // need to return an entry for [-]
+#endif
+#endif
+};
+
+#endif
diff --git a/pdf2swf/xpdf/gmem.c b/pdf2swf/xpdf/gmem.c
new file mode 100644
index 00000000..cac386bc
--- /dev/null
+++ b/pdf2swf/xpdf/gmem.c
@@ -0,0 +1,203 @@
+/*
+ * gmem.c
+ *
+ * Memory routines with out-of-memory checking.
+ *
+ * Copyright 1996 Derek B. Noonburg
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include "gmem.h"
+
+#ifdef DEBUG_MEM
+
+typedef struct _GMemHdr {
+ int size;
+ int index;
+ struct _GMemHdr *next;
+} GMemHdr;
+
+#define gMemHdrSize ((sizeof(GMemHdr) + 7) & ~7)
+#define gMemTrlSize (sizeof(long))
+
+#if gmemTrlSize==8
+#define gMemDeadVal 0xdeadbeefdeadbeef
+#else
+#define gMemDeadVal 0xdeadbeef
+#endif
+
+/* round data size so trailer will be aligned */
+#define gMemDataSize(size) \
+ ((((size) + gMemTrlSize - 1) / gMemTrlSize) * gMemTrlSize)
+
+#define gMemNLists 64
+#define gMemListShift 4
+#define gMemListMask (gMemNLists - 1)
+static GMemHdr *gMemList[gMemNLists] = {
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+};
+
+static int gMemIndex = 0;
+static int gMemAlloc = 0;
+
+#endif /* DEBUG_MEM */
+
+void *gmalloc(int size) {
+#ifdef DEBUG_MEM
+ int size1;
+ char *mem;
+ GMemHdr *hdr;
+ void *data;
+ int lst;
+ long *trl, *p;
+
+ if (size == 0)
+ return NULL;
+ size1 = gMemDataSize(size);
+ if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) {
+ fprintf(stderr, "Out of memory\n");
+ exit(1);
+ }
+ hdr = (GMemHdr *)mem;
+ data = (void *)(mem + gMemHdrSize);
+ trl = (long *)(mem + gMemHdrSize + size1);
+ hdr->size = size;
+ hdr->index = gMemIndex++;
+ lst = ((int)hdr >> gMemListShift) & gMemListMask;
+ hdr->next = gMemList[lst];
+ gMemList[lst] = hdr;
+ ++gMemAlloc;
+ for (p = (long *)data; p <= trl; ++p)
+ *p = gMemDeadVal;
+ return data;
+#else
+ void *p;
+
+ if (size == 0)
+ return NULL;
+ if (!(p = malloc(size))) {
+ fprintf(stderr, "Out of memory\n");
+ exit(1);
+ }
+ return p;
+#endif
+}
+
+void *grealloc(void *p, int size) {
+#ifdef DEBUG_MEM
+ GMemHdr *hdr;
+ void *q;
+ int oldSize;
+
+ if (size == 0) {
+ if (p)
+ gfree(p);
+ return NULL;
+ }
+ if (p) {
+ hdr = (GMemHdr *)((char *)p - gMemHdrSize);
+ oldSize = hdr->size;
+ q = gmalloc(size);
+ memcpy(q, p, size < oldSize ? size : oldSize);
+ gfree(p);
+ } else {
+ q = gmalloc(size);
+ }
+ return q;
+#else
+ void *q;
+
+ if (size == 0) {
+ if (p)
+ free(p);
+ return NULL;
+ }
+ if (p)
+ q = realloc(p, size);
+ else
+ q = malloc(size);
+ if (!q) {
+ fprintf(stderr, "Out of memory\n");
+ exit(1);
+ }
+ return q;
+#endif
+}
+
+void gfree(void *p) {
+#ifdef DEBUG_MEM
+ int size;
+ GMemHdr *hdr;
+ GMemHdr *prevHdr, *q;
+ int lst;
+ long *trl, *clr;
+
+ if (p) {
+ hdr = (GMemHdr *)((char *)p - gMemHdrSize);
+ lst = ((int)hdr >> gMemListShift) & gMemListMask;
+ for (prevHdr = NULL, q = gMemList[lst]; q; prevHdr = q, q = q->next) {
+ if (q == hdr)
+ break;
+ }
+ if (q) {
+ if (prevHdr)
+ prevHdr->next = hdr->next;
+ else
+ gMemList[lst] = hdr->next;
+ --gMemAlloc;
+ size = gMemDataSize(hdr->size);
+ trl = (long *)((char *)hdr + gMemHdrSize + size);
+ if (*trl != gMemDeadVal) {
+ fprintf(stderr, "Overwrite past end of block %d at address %p\n",
+ hdr->index, p);
+ }
+ for (clr = (long *)hdr; clr <= trl; ++clr)
+ *clr = gMemDeadVal;
+ free(hdr);
+ } else {
+ fprintf(stderr, "Attempted to free bad address %p\n", p);
+ }
+ }
+#else
+ if (p)
+ free(p);
+#endif
+}
+
+#ifdef DEBUG_MEM
+void gMemReport(FILE *f) {
+ GMemHdr *p;
+ int lst;
+
+ fprintf(f, "%d memory allocations in all\n", gMemIndex);
+ if (gMemAlloc > 0) {
+ fprintf(f, "%d memory blocks left allocated:\n", gMemAlloc);
+ fprintf(f, " index size\n");
+ fprintf(f, "-------- --------\n");
+ for (lst = 0; lst < gMemNLists; ++lst) {
+ for (p = gMemList[lst]; p; p = p->next)
+ fprintf(f, "%8d %8d\n", p->index, p->size);
+ }
+ } else {
+ fprintf(f, "No memory blocks left allocated\n");
+ }
+}
+#endif
+
+char *copyString(char *s) {
+ char *s1;
+
+ s1 = (char *)gmalloc(strlen(s) + 1);
+ strcpy(s1, s);
+ return s1;
+}
diff --git a/pdf2swf/xpdf/gmem.h b/pdf2swf/xpdf/gmem.h
new file mode 100644
index 00000000..732726d4
--- /dev/null
+++ b/pdf2swf/xpdf/gmem.h
@@ -0,0 +1,54 @@
+/*
+ * gmem.h
+ *
+ * Memory routines with out-of-memory checking.
+ *
+ * Copyright 1996 Derek B. Noonburg
+ */
+
+#ifndef GMEM_H
+#define GMEM_H
+
+#include <stdio.h>
+#include "../../config.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Same as malloc, but prints error message and exits if malloc()
+ * returns NULL.
+ */
+extern void *gmalloc(int size);
+
+/*
+ * Same as realloc, but prints error message and exits if realloc()
+ * returns NULL. If <p> is NULL, calls malloc instead of realloc().
+ */
+extern void *grealloc(void *p, int size);
+
+/*
+ * Same as free, but checks for and ignores NULL pointers.
+ */
+extern void gfree(void *p);
+
+#ifdef DEBUG_MEM
+/*
+ * Report on unfreed memory.
+ */
+extern void gMemReport(FILE *f);
+#else
+#define gMemReport(f)
+#endif
+
+/*
+ * Allocate memory and copy a string into it.
+ */
+extern char *copyString(char *s);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/pdf2swf/xpdf/gtypes.h b/pdf2swf/xpdf/gtypes.h
new file mode 100644
index 00000000..65932674
--- /dev/null
+++ b/pdf2swf/xpdf/gtypes.h
@@ -0,0 +1,29 @@
+/*
+ * gtypes.h
+ *
+ * Some useful simple types.
+ *
+ * Copyright 1996 Derek B. Noonburg
+ */
+
+#ifndef GTYPES_H
+#define GTYPES_H
+
+/*
+ * These have stupid names to avoid conflicts with some (but not all)
+ * C++ compilers which define them.
+ */
+typedef int GBool;
+#define gTrue 1
+#define gFalse 0
+
+/*
+ * These have stupid names to avoid conflicts with <sys/types.h>,
+ * which on various systems defines some random subset of these.
+ */
+typedef unsigned char Guchar;
+typedef unsigned short Gushort;
+typedef unsigned int Guint;
+typedef unsigned long Gulong;
+
+#endif
diff --git a/release.in b/release.in
new file mode 100644
index 00000000..2a959ee9
--- /dev/null
+++ b/release.in
@@ -0,0 +1,167 @@
+#!/bin/sh
+datadir=@datadir@
+name=@PACKAGE@-@VERSION@
+rm -f ${name}
+rm -f ${name}.tar
+rm -f ${name}.tar.gz
+ln -s ./ ${name}
+tar -chf ${name}.tar \
+${name}/src/swfcombine.1 \
+${name}/src/swfcombine.c \
+${name}/src/swfstrings.1 \
+${name}/src/swfstrings.c \
+${name}/src/swfdump.1 \
+${name}/src/swfdump.c \
+${name}/src/bitio.c \
+${name}/src/bitio.h \
+${name}/src/types.h \
+${name}/src/args.h \
+${name}/src/flash.c \
+${name}/src/flash.h \
+${name}/src/combine.c \
+${name}/src/combine.h \
+${name}/src/settings.h \
+${name}/src/reloc.c \
+${name}/src/reloc.h \
+${name}/src/Makefile.in \
+${name}/src/Makefile.am \
+${name}/lib/example/box.c \
+${name}/lib/example/jpegtest.c \
+${name}/lib/example/shape1.c \
+${name}/lib/example/texbox.c \
+${name}/lib/example/texbox_ac.c \
+${name}/lib/example/transtest.c \
+${name}/lib/modules/swfdump.c \
+${name}/lib/modules/swfobject.c \
+${name}/lib/modules/swfshape.c \
+${name}/lib/modules/swftext.c \
+${name}/lib/modules/swfbutton.c \
+${name}/lib/modules/swfbits.c \
+${name}/lib/modules/swftools.c \
+${name}/lib/modules/swfcgi.c \
+${name}/lib/rfxswf.c \
+${name}/lib/rfxswf.h \
+${name}/lib/log.c \
+${name}/lib/log.h \
+${name}/lib/Makefile.am \
+${name}/lib/Makefile.in \
+${name}/pdf2swf/Makefile.in \
+${name}/pdf2swf/fonts/Makefile.in \
+${name}/pdf2swf/fonts/Makefile.am \
+${name}/pdf2swf/fonts/n021003l.pfb \
+${name}/pdf2swf/fonts/n021023l.pfb \
+${name}/pdf2swf/fonts/n021004l.pfb \
+${name}/pdf2swf/fonts/n021024l.pfb \
+${name}/pdf2swf/fonts/n019003l.pfb \
+${name}/pdf2swf/fonts/n019023l.pfb \
+${name}/pdf2swf/fonts/n019004l.pfb \
+${name}/pdf2swf/fonts/n019024l.pfb \
+${name}/pdf2swf/fonts/n022003l.pfb \
+${name}/pdf2swf/fonts/n022023l.pfb \
+${name}/pdf2swf/fonts/n022004l.pfb \
+${name}/pdf2swf/fonts/n022024l.pfb \
+${name}/pdf2swf/fonts/s050000l.pfb \
+${name}/pdf2swf/fonts/d050000l.pfb \
+${name}/pdf2swf/fonts/n021003l.afm \
+${name}/pdf2swf/fonts/n021023l.afm \
+${name}/pdf2swf/fonts/n021004l.afm \
+${name}/pdf2swf/fonts/n021024l.afm \
+${name}/pdf2swf/fonts/n019003l.afm \
+${name}/pdf2swf/fonts/n019023l.afm \
+${name}/pdf2swf/fonts/n019004l.afm \
+${name}/pdf2swf/fonts/n019024l.afm \
+${name}/pdf2swf/fonts/n022003l.afm \
+${name}/pdf2swf/fonts/n022023l.afm \
+${name}/pdf2swf/fonts/n022004l.afm \
+${name}/pdf2swf/fonts/n022024l.afm \
+${name}/pdf2swf/fonts/s050000l.afm \
+${name}/pdf2swf/fonts/d050000l.afm \
+${name}/pdf2swf/fonts/FontDataBase \
+${name}/pdf2swf/swfoutput.h \
+${name}/pdf2swf/swfoutput.cc \
+${name}/pdf2swf/swfoutput_x11.cc \
+${name}/pdf2swf/pdfswf.h \
+${name}/pdf2swf/pdfswf.cc \
+${name}/pdf2swf/spline.h \
+${name}/pdf2swf/spline.cc \
+${name}/pdf2swf/args.h \
+${name}/pdf2swf/pdf2swf.cc \
+${name}/pdf2swf/Makefile.am \
+${name}/pdf2swf/xpdf/Array.cc \
+${name}/pdf2swf/xpdf/Array.h \
+${name}/pdf2swf/xpdf/Catalog.cc \
+${name}/pdf2swf/xpdf/Catalog.h \
+${name}/pdf2swf/xpdf/CompactFontInfo.h \
+${name}/pdf2swf/xpdf/Decrypt.cc \
+${name}/pdf2swf/xpdf/Decrypt.h \
+${name}/pdf2swf/xpdf/Dict.cc \
+${name}/pdf2swf/xpdf/Dict.h \
+${name}/pdf2swf/xpdf/Error.cc \
+${name}/pdf2swf/xpdf/Error.h \
+${name}/pdf2swf/xpdf/FontEncoding.cc \
+${name}/pdf2swf/xpdf/FontEncoding.h \
+${name}/pdf2swf/xpdf/FontFile.cc \
+${name}/pdf2swf/xpdf/FontFile.h \
+${name}/pdf2swf/xpdf/FontInfo.h \
+${name}/pdf2swf/xpdf/FormWidget.cc \
+${name}/pdf2swf/xpdf/FormWidget.h \
+${name}/pdf2swf/xpdf/GString.cc \
+${name}/pdf2swf/xpdf/GString.h \
+${name}/pdf2swf/xpdf/Gfx.cc \
+${name}/pdf2swf/xpdf/Gfx.h \
+${name}/pdf2swf/xpdf/GfxFont.cc \
+${name}/pdf2swf/xpdf/GfxFont.h \
+${name}/pdf2swf/xpdf/GfxState.cc \
+${name}/pdf2swf/xpdf/GfxState.h \
+${name}/pdf2swf/xpdf/Lexer.cc \
+${name}/pdf2swf/xpdf/Lexer.h \
+${name}/pdf2swf/xpdf/Link.cc \
+${name}/pdf2swf/xpdf/Link.h \
+${name}/pdf2swf/xpdf/Object.cc \
+${name}/pdf2swf/xpdf/Object.h \
+${name}/pdf2swf/xpdf/OutputDev.cc \
+${name}/pdf2swf/xpdf/OutputDev.h \
+${name}/pdf2swf/xpdf/PDFDoc.cc \
+${name}/pdf2swf/xpdf/PDFDoc.h \
+${name}/pdf2swf/xpdf/Page.cc \
+${name}/pdf2swf/xpdf/Page.h \
+${name}/pdf2swf/xpdf/Params.cc \
+${name}/pdf2swf/xpdf/Params.h \
+${name}/pdf2swf/xpdf/Parser.cc \
+${name}/pdf2swf/xpdf/Parser.h \
+${name}/pdf2swf/xpdf/StdFontInfo.h \
+${name}/pdf2swf/xpdf/Stream-CCITT.h \
+${name}/pdf2swf/xpdf/Stream.cc \
+${name}/pdf2swf/xpdf/Stream.h \
+${name}/pdf2swf/xpdf/XRef.cc \
+${name}/pdf2swf/xpdf/XRef.h \
+${name}/pdf2swf/xpdf/config.h \
+${name}/pdf2swf/xpdf/gfile.cc \
+${name}/pdf2swf/xpdf/gfile.h \
+${name}/pdf2swf/xpdf/gmem.c \
+${name}/pdf2swf/xpdf/gmem.h \
+${name}/pdf2swf/xpdf/gtypes.h \
+${name}/pdf2swf/xpdf/Makefile.am \
+${name}/pdf2swf/xpdf/Makefile.in \
+${name}/pdf2swf/pdf2swf.1 \
+${name}/pdf2swf/swfoutput.cc \
+${name}/configure.in \
+${name}/install-sh \
+${name}/mkinstalldirs \
+${name}/missing \
+${name}/configure \
+${name}/aclocal.m4 \
+${name}/config.h.in \
+${name}/stamp-h.in \
+${name}/Makefile.am \
+${name}/Makefile.in \
+${name}/INSTALL \
+${name}/COPYING \
+${name}/NEWS \
+${name}/README \
+${name}/AUTHORS \
+${name}/ChangeLog \
+${name}/release.in \
+${name}/TODO
+gzip ${name}.tar
+rm -f ${name}
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 00000000..6b50cee5
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,13 @@
+## Process this file with automake to produce Makefile.in
+bin_PROGRAMS = swfcombine swfstrings swfdump
+swfdump_SOURCES = swfdump.c
+swfcombine_SOURCES = bitio.c bitio.h reloc.c reloc.h combine.c combine.h flash.c flash.h swfcombine.c types.h
+swfstrings_SOURCES = swfstrings.c
+swfdump_LINK = $(CCLD) ../lib/rfxswf.o -o $@
+swfcombine_LINK = $(CCLD) ../lib/log.o -o $@
+swfstrings_LINK = $(CCLD) ../lib/log.o ../lib/rfxswf.o -o $@
+##LIBS =
+##swfcombine_LIBS =
+##swfstrings_LIBS = -ljpeg
+man_MANS = swfcombine.1 swfstrings.1 swfdump.1
+
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 00000000..d87977be
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,383 @@
+# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AWK = @AWK@
+CC = @CC@
+CPP = @CPP@
+CXX = @CXX@
+EXEEXT = @EXEEXT@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+bin_PROGRAMS = swfcombine swfstrings swfdump
+swfdump_SOURCES = swfdump.c
+swfcombine_SOURCES = bitio.c bitio.h reloc.c reloc.h combine.c combine.h flash.c flash.h swfcombine.c types.h
+swfstrings_SOURCES = swfstrings.c
+swfdump_LINK = $(CCLD) ../lib/rfxswf.o -o $@
+swfcombine_LINK = $(CCLD) ../lib/log.o -o $@
+swfstrings_LINK = $(CCLD) ../lib/log.o ../lib/rfxswf.o -o $@
+man_MANS = swfcombine.1 swfstrings.1 swfdump.1
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+bin_PROGRAMS = swfcombine$(EXEEXT) swfstrings$(EXEEXT) swfdump$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I..
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+swfcombine_OBJECTS = bitio.o reloc.o combine.o flash.o swfcombine.o
+swfcombine_LDADD = $(LDADD)
+swfcombine_DEPENDENCIES =
+swfcombine_LDFLAGS =
+swfstrings_OBJECTS = swfstrings.o
+swfstrings_LDADD = $(LDADD)
+swfstrings_DEPENDENCIES =
+swfstrings_LDFLAGS =
+swfdump_OBJECTS = swfdump.o
+swfdump_LDADD = $(LDADD)
+swfdump_DEPENDENCIES =
+swfdump_LDFLAGS =
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+man1dir = $(mandir)/man1
+MANS = $(man_MANS)
+
+NROFF = nroff
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+DEP_FILES = .deps/bitio.P .deps/combine.P .deps/flash.P .deps/reloc.P \
+.deps/swfcombine.P .deps/swfdump.P .deps/swfstrings.P
+SOURCES = $(swfcombine_SOURCES) $(swfstrings_SOURCES) $(swfdump_SOURCES)
+OBJECTS = $(swfcombine_OBJECTS) $(swfstrings_OBJECTS) $(swfdump_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .o .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+mostlyclean-binPROGRAMS:
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+distclean-binPROGRAMS:
+
+maintainer-clean-binPROGRAMS:
+
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ list='$(bin_PROGRAMS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+swfcombine$(EXEEXT): $(swfcombine_OBJECTS) $(swfcombine_DEPENDENCIES)
+ @rm -f swfcombine$(EXEEXT)
+ $(swfcombine_LINK) $(swfcombine_LDFLAGS) $(swfcombine_OBJECTS) $(swfcombine_LDADD) $(LIBS)
+
+swfstrings$(EXEEXT): $(swfstrings_OBJECTS) $(swfstrings_DEPENDENCIES)
+ @rm -f swfstrings$(EXEEXT)
+ $(swfstrings_LINK) $(swfstrings_LDFLAGS) $(swfstrings_OBJECTS) $(swfstrings_LDADD) $(LIBS)
+
+swfdump$(EXEEXT): $(swfdump_OBJECTS) $(swfdump_DEPENDENCIES)
+ @rm -f swfdump$(EXEEXT)
+ $(swfdump_LINK) $(swfdump_LDFLAGS) $(swfdump_OBJECTS) $(swfdump_LDADD) $(LIBS)
+
+install-man1:
+ $(mkinstalldirs) $(DESTDIR)$(man1dir)
+ @list='$(man1_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+ done
+
+uninstall-man1:
+ @list='$(man1_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+ rm -f $(DESTDIR)$(man1dir)/$$inst; \
+ done
+install-man: $(MANS)
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-man1
+uninstall-man:
+ @$(NORMAL_UNINSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) uninstall-man1
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = src
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+ @echo '$(COMPILE) -c $<'; \
+ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
+
+%.lo: %.c
+ @echo '$(LTCOMPILE) -c $<'; \
+ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am: install-binPROGRAMS
+install-exec: install-exec-am
+
+install-data-am: install-man
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-binPROGRAMS uninstall-man
+uninstall: uninstall-am
+all-am: Makefile $(PROGRAMS) $(MANS)
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
+ mostlyclean-tags mostlyclean-depend mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-binPROGRAMS clean-compile clean-tags clean-depend \
+ clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \
+ distclean-depend distclean-generic clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-binPROGRAMS \
+ maintainer-clean-compile maintainer-clean-tags \
+ maintainer-clean-depend maintainer-clean-generic \
+ distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile install-man1 uninstall-man1 install-man \
+uninstall-man tags mostlyclean-tags distclean-tags clean-tags \
+maintainer-clean-tags distdir mostlyclean-depend distclean-depend \
+clean-depend maintainer-clean-depend info-am info dvi-am dvi check \
+check-am installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/args.h b/src/args.h
new file mode 100644
index 00000000..a5699df4
--- /dev/null
+++ b/src/args.h
@@ -0,0 +1,63 @@
+/* args.h
+ Routines to simplify argument handling
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#ifndef __args_h__
+#define __args_h__
+
+extern int args_callback_option(char*,char*);
+extern int args_callback_longoption(char*,char*);
+extern int args_callback_command(char*,char*);
+extern void args_callback_usage(char*name);
+
+int argn;
+char**argv;
+
+void processargs(int argn2,char**argv2)
+{
+ int t;
+ if(argn2==1)
+ {
+ args_callback_usage(argv2[0]);
+ exit(1);
+ }
+ for(t=1;t<argn2;t++)
+ {
+ char*next;
+ if(t<argn2-1) next=argv2[t+1];
+ else next=0;
+
+ if(argv2[t][0]=='-')
+ {
+ if(argv2[t][1]=='-')
+ {
+ if(!strcmp(&argv2[t][2],"help"))
+ {
+ args_callback_usage(argv2[0]);
+ exit(1);
+ }
+ t+=args_callback_longoption(&argv2[t][2],next);
+ }
+ else
+ {
+ if(strchr("?h",argv2[t][1]))
+ {
+ args_callback_usage(argv2[0]);
+ exit(1);
+ }
+ t+=args_callback_option(&argv2[t][1],next);
+ }
+ }
+ else
+ {
+ t+=args_callback_command(argv2[t],next);
+ }
+ }
+}
+
+#endif //__args_h__
diff --git a/src/bitio.c b/src/bitio.c
new file mode 100644
index 00000000..871fb804
--- /dev/null
+++ b/src/bitio.c
@@ -0,0 +1,187 @@
+/* bitio.c
+ Various routines for reading and writing bit- and bytewise, from and to memory.
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#include "bitio.h"
+
+static uchar*data;
+static int datalength;
+static int datapos;
+
+void resetbits();
+
+void reader_init(uchar*newdata, int newlength)
+{
+ data = newdata;
+ datalength = newlength;
+ datapos = 0;
+ resetbits();
+}
+void skip(int length)
+{
+ datapos += length;
+}
+static u8 bitpos=8,mybyte;
+static u8 bitmem=0;
+void resetbits()
+{
+ bitpos=8;
+}
+
+void input1(void*target)
+{
+ *(uchar*)target = *(uchar*)&data[datapos];
+ datapos ++;
+}
+void input2(void*target)
+{
+ *(unsigned short int*)target = *(unsigned short int*)&data[datapos];
+ datapos += 2;
+}
+void input4(void*target)
+{
+ *(unsigned int*)target = *(unsigned int*)&data[datapos];
+ datapos += 4;
+}
+uchar*getinputpos()
+{
+ return &data[datapos];
+}
+int getinputlength()
+{
+ return datalength;
+}
+void setinputpos(uchar*pos)
+{
+ datapos = pos-data;
+}
+
+u32 readbit()
+{
+ if(bitpos==8)
+ {
+ bitpos=0;
+ input1(&mybyte);
+ }
+ return (mybyte>>(7-bitpos++))&1;
+}
+void readbits(u32*val,int num)
+{
+ int t;
+ *val=0;
+ for(t=0;t<num;t++)
+ {
+ *val<<=1;
+ *val|=readbit();
+ }
+}
+
+void readsbits(s32*val,int num)
+{
+ u32 x;
+ readbits(&x, num);
+ if((x>>(num-1))&1)
+ {
+ x|=(0xffffffff<<num);
+ }
+ *(s32*)val=x;
+}
+
+u32 getbits(int num)
+{
+ u32 x;
+ readbits(&x,num);
+ return x;
+}
+
+s32 getsbits(int num)
+{
+ s32 x;
+ readsbits(&x,num);
+ return x;
+}
+
+u16 readu8()
+{
+ u8 a;
+ input1(&a);
+ return a;
+}
+
+u16 readu16()
+{
+ u8 a,b;
+ // I'm not using input2(&a) here because our input is
+ // little endian.
+ input1(&a);
+ input1(&b);
+ return ((u16)b)*256+a;
+}
+
+void writer_init(struct writer_t*w, u8*data, int maxlength)
+{
+ w->data = data;
+ w->maxlength = maxlength;
+ w->pos = 0;
+ w->bitpos = 0;
+ w->mybyte = 0;
+}
+
+void writer_write(struct writer_t*w, void*data, int length)
+{
+ memcpy(&w->data[w->pos], data, length);
+ w->pos += length;
+}
+
+void writer_writeu8(struct writer_t*w, u8 value)
+{
+ writer_resetbits(w);
+ writer_write(w, &value, 1);
+}
+
+void writer_writeu16(struct writer_t*w, u16 value)
+{
+ writer_resetbits(w);
+ writer_write(w, &value, 2);
+}
+
+void* writer_getpos(struct writer_t*w)
+{
+ return &w->data[w->pos];
+}
+
+void writer_resetbits(struct writer_t*w)
+{
+ if(w->bitpos)
+ writer_write(w, &w->mybyte, 1);
+ w->bitpos = 0;
+ w->mybyte = 0;
+}
+
+void writer_writebit(struct writer_t*w, int bit)
+{
+ if(w->bitpos==8)
+ {
+ writer_write(w, &w->mybyte, 1);
+ w->bitpos = 0;
+ w->mybyte = 0;
+ }
+ if(bit&1)
+ w->mybyte |= 1 << (7 - w->bitpos);
+ w->bitpos ++;
+}
+
+void writer_writebits(struct writer_t*w, u32 data, int bits)
+{
+ int t;
+ for(t=0;t<bits;t++)
+ {
+ writer_writebit(w, (data >> (bits-t-1))&1);
+ }
+}
+
diff --git a/src/bitio.h b/src/bitio.h
new file mode 100644
index 00000000..c9ec2383
--- /dev/null
+++ b/src/bitio.h
@@ -0,0 +1,51 @@
+/* bitio.h
+ Header file for bitio.c.
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#ifndef __bitio_h__
+#define __bitio_h__
+
+#include "types.h"
+
+void resetbits();
+void reader_init(uchar*newdata, int newlength);
+void skip(int length);
+void input1(void*target);
+void input2(void*target);
+void input4(void*target);
+
+uchar*getinputpos();
+int getinputlength();
+void setinputpos(uchar*pos);
+
+u32 readbit();
+void readbits(u32*val,int num);
+void readsbits(s32*val,int num);
+u32 getbits(int num);
+s32 getsbits(int num);
+u16 readu8();
+u16 readu16();
+
+struct writer_t {
+ u8* data;
+ int maxlength;
+ int pos;
+ int bitpos;
+ u8 mybyte;
+};
+
+void writer_init(struct writer_t*w, u8*data, int maxlength);
+void writer_write(struct writer_t*w, void*data, int length);
+void* writer_getpos(struct writer_t*w);
+void writer_writebit(struct writer_t*w, int bit);
+void writer_writebits(struct writer_t*w, u32 data, int bits);
+void writer_writeu8(struct writer_t*w, u8 value);
+void writer_writeu16(struct writer_t*w, u16 value);
+void writer_resetbits(struct writer_t*w);
+
+#endif //__bitio_h__
diff --git a/src/combine.c b/src/combine.c
new file mode 100644
index 00000000..a6120066
--- /dev/null
+++ b/src/combine.c
@@ -0,0 +1,398 @@
+/* combine.c
+ Implements combine(), which merges two swfs in memory.
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <memory.h>
+#include "../lib/log.h"
+#include "./flash.h"
+#include "./reloc.h"
+#include "./settings.h"
+
+// TODO:
+// * readers should be object-oriented
+
+static char* tag_placeobject2_name (struct swf_tag* tag)
+{
+ struct PlaceObject2 plo2;
+ placeobject2_init (&plo2, tag);
+ return plo2.name;
+}
+
+static u16 tag_placeobject2_character (struct swf_tag* tag)
+{
+ struct PlaceObject2 plo2;
+ placeobject2_init (&plo2, tag);
+ return plo2.id;
+}
+
+static struct swffile master;
+static struct swffile slave;
+
+static int masterids[65536];
+
+static int get_free_id()
+{
+ int t;
+ for (t=1;t<65536;t++)
+ {
+ if(masterids[t] == -1)
+ {
+ masterids[t] = 1;
+ return t;
+ }
+ }
+ return -1;
+}
+
+void changedepth(struct swf_tag*tag, int add)
+{
+ if(tag->id == TAGID_PLACEOBJECT)
+ (*(u16*)&tag->data[2]) += add;
+ if(tag->id == TAGID_PLACEOBJECT2)
+ (*(u16*)&tag->data[1]) += add;
+ if(tag->id == TAGID_REMOVEOBJECT)
+ (*(u16*)&tag->data[2]) += add;
+ if(tag->id == TAGID_REMOVEOBJECT2)
+ (*(u16*)&tag->data[0]) += add;
+}
+
+/* applies the config move and scale parameters to
+ * a matrix. (If settings would provide a rotation,
+ * this would be a matrix concatenation/multiplication
+ * routine. In this case, it's just element-wise multiplication.
+ */
+void matrix_adjust(struct MATRIX*m)
+{
+ if(config.scalex != 1 || config.scaley != 1)
+ {
+ if(!m->hasscale) {
+ m->hasscale = 1;
+ m->a[0][0] = config.scalex;
+ m->a[1][1] = config.scaley;
+ } else {
+ m->a[0][0] *= config.scalex;
+ m->a[1][1] *= config.scaley;
+ }
+ if(m->hasrotate) {
+ m->a[0][1] *= config.scalex;
+ m->a[1][0] *= config.scaley;
+ }
+ m->b[0] *= config.scalex;
+ m->b[1] *= config.scaley;
+ }
+/* printf("hasscale: %d\n",m->hasscale);
+ printf("hasrotate: %d\n", m->hasrotate);
+ printf("move: %d %d\n", m->b[0],m->b[1]);
+ printf("rot: %f %f\n",m->a[0][0],m->a[0][1]);
+ printf(" %f %f\n",m->a[1][0],m->a[1][1]);*/
+ m->b[0] += config.movex;
+ m->b[1] += config.movey;
+}
+
+void write_changepos(struct swf_tag*tag, struct writer_t*w)
+{
+ if(config.movex || config.movey || config.scalex != 1 || config.scaley != 1)
+ {
+ switch(tag->id)
+ {
+ case TAGID_PLACEOBJECT: {
+ struct PlaceObject p;
+ placeobject_init(&p, tag);
+ matrix_adjust(&p.matrix);
+ placeobject_write(&p, w);
+ break;
+ }
+ case TAGID_PLACEOBJECT2: {
+ struct PlaceObject2 p;
+ placeobject2_init(&p, tag);
+ if(!p.hasmatrix) {
+ p.hasmatrix = 1;
+ MATRIX_init(&p.matrix);
+ }
+ matrix_adjust(&p.matrix);
+ placeobject2_write(&p, w);
+ break;
+ }
+ default:
+ writer_write(w, tag->fulldata, tag->fulllength);
+ }
+ }
+ else
+ {
+ writer_write(w, tag->fulldata, tag->fulllength);
+ }
+}
+
+uchar * combine(uchar*masterdata, int masterlength, char*slavename, uchar*slavedata, int slavelength, int*newlength)
+{
+ char master_flash = 0;
+ char slave_flash = 0;
+
+ logf("<debug> move x (%d)", config.movex);
+ logf("<debug> move y (%d)", config.movey);
+ logf("<debug> scale x (%d)", config.scalex);
+ logf("<debug> scale y (%d)", config.scaley);
+
+ memset(masterids, -1, sizeof(masterids));
+
+ if(masterlength < 3)
+ {
+ logf("<fatal> the master file is too small (%d bytes)", masterlength);
+ return 0;
+ }
+ if(slavelength < 3)
+ {
+ logf("<fatal> the slave file is too small (%d bytes)", slavelength);
+ return 0;
+ }
+ if(masterdata[2] == 'S' &&
+ masterdata[1] == 'W' &&
+ masterdata[0] == 'F')
+ {
+ logf("<notice> the master file is flash (swf) format\n");
+ master_flash = 1;
+ }
+ if(slavedata[2] == 'S' &&
+ slavedata[1] == 'W' &&
+ slavedata[0] == 'F')
+ {
+ logf("<notice> the slave file is flash (swf) format\n");
+ slave_flash = 1;
+ }
+
+ if(master_flash && slave_flash)
+ {
+ int length;
+ int pos=0;
+ u16 tmp;
+ u32 tmp32;
+ u32*tagidpos;
+ u8*startpos;
+ u32*headlength;
+ uchar*newdata;
+ int spriteid = -1;
+ int replaceddefine = -1;
+ struct writer_t w;
+
+ read_swf(&master, masterdata, masterlength);
+
+ length = masterlength + slavelength*2 + 128; // this is a guess, but a good guess.
+ newdata = malloc(length);
+ writer_init(&w, newdata, length);
+
+ if(!newdata) {
+ logf("<fatal> Couldn't allocate %d bytes of memory", length);
+ return 0;
+ }
+
+ // set the idtab
+ pos = 0;
+ do {
+ int tag = master.tags[pos].id;
+ if(is_defining_tag(tag)) {
+ int defineid = getidfromtag(&master.tags[pos]);
+ logf("<debug> tagid %02x defines object %d", tag, defineid);
+ masterids[defineid] = 1;
+ } else if(tag == TAGID_PLACEOBJECT2) {
+ char * name = tag_placeobject2_name(&master.tags[pos]);
+ int id = tag_placeobject2_character(&master.tags[pos]);
+
+ if(name)
+ logf("<verbose> tagid %02x places object %d named \"%s\"", tag, id, name);
+ else
+ logf("<verbose> tagid %02x places object %d (no name)", tag, id);
+
+ if (name && !strcmp(name,slavename)) {
+ if(id>=0) {
+ spriteid = id;
+ logf("<notice> Slave file attached to object %d.", id);
+ }
+ }
+ }
+ }
+ while(master.tags[pos++].id != 0);
+
+ swf_relocate (slavedata, slavelength, masterids);
+
+ read_swf(&slave, slavedata, slavelength);
+
+ // write header
+
+ writer_write(&w, "FWS",3);
+ headlength = (u32*)(writer_getpos(&w) + 1);
+ writer_write(&w, master.header.headerdata, master.header.headerlength);
+
+ // write sprite(1)
+
+ pos = 0;
+ while(slave.tags[pos].id != 0) {
+ struct swf_tag * tag = &slave.tags[pos];
+ if(!is_sprite_tag(tag->id)) {
+ logf("<debug> processing sprite tag %02x", slave.tags[pos].id);
+ if(is_defining_tag(tag->id))
+ {
+ logf("<debug> [sprite defs] write tag %02x (%d bytes in body)",
+ tag->id, tag->length);
+ writer_write(&w, tag->fulldata, tag->fulllength);
+ }
+ else
+ {
+ switch(tag->id)
+ {case TAGID_DEFINEFONTINFO:
+ {
+ /* define font info is not a defining tag, in that
+ * it doesn't define a new id, but rather extends
+ * an existing one. It also isn't a sprite tag.
+ * Anyway we can't throw it out, so we just pass it
+ * through.
+ */
+ break;
+ }
+ case TAGID_EXPORTASSETS:
+ logf("<debug> deliberately ignoring EXPORTASSETS tag");
+ break;
+ case TAGID_ENABLEDEBUGGER:
+ logf("<debug> deliberately ignoring ENABLEDEBUGGER tag");
+ break;
+ case TAGID_BACKGROUNDCOLOR:
+ logf("<debug> deliberately ignoring BACKGROUNDCOLOR tag");
+ break;
+ case 40:
+ case 49:
+ case 51:
+ logf("<notice> found tag %d. This is a Generator template, isn't it?", slave.tags[pos].id);
+ break;
+ default:
+ logf("<notice> funny tag: %d is neither defining nor sprite", slave.tags[pos].id);
+ }
+ }
+ }
+ pos++;
+ }
+
+ // write master (1)
+ pos = 0;
+ do {
+ if(is_defining_tag(master.tags[pos].id))
+ {
+ logf("<debug> [master] write tag %02x (%d bytes in body)",
+ master.tags[pos].id, master.tags[pos].length);
+ if( getidfromtag(&master.tags[pos]) == spriteid)
+ {
+ if(config.overlay)
+ {
+ *(u16*)master.tags[pos].data = replaceddefine = get_free_id();
+ writer_write(&w, master.tags[pos].fulldata, master.tags[pos].fulllength);
+ } else {
+ /* don't write this tag */
+ logf("<verbose> replacing tag %d id %d with sprite", master.tags[pos].id
+ ,spriteid);
+ }
+ } else {
+ writer_write(&w, master.tags[pos].fulldata, master.tags[pos].fulllength);
+ }
+ }
+ }
+ while(master.tags[pos++].id != 0);
+
+ // write slave(2) (header)
+ tmp = 0x3f + (TAGID_DEFINESPRITE << 6);
+ writer_write(&w, &tmp, 2);
+ tagidpos = (u32*)writer_getpos(&w);
+ writer_write(&w, &tmp32, 4);
+
+ startpos = (u8*)writer_getpos(&w);
+
+ if (spriteid<0)
+ {
+ logf("<warning> Didn't find anything named %s in file. No substitutions will occur.", slavename);
+ spriteid = get_free_id();
+ }
+
+ logf ("<notice> sprite id is %d", spriteid);
+ tmp = spriteid;
+ writer_write(&w, &tmp, 2);
+ tmp = slave.header.count;
+ writer_write(&w, &tmp, 2);
+
+
+ // write slave(2) (body)
+ pos = 0;
+ tmp = slave.header.count;
+ logf("<debug> %d frames to go",tmp);
+
+ if(config.clip) {
+ tmp = 7 + (TAGID_PLACEOBJECT2 << 6);
+ writer_write(&w, &tmp, 2);
+ tmp = 2+64; //flags: character + clipaction
+ writer_write(&w, &tmp, 1);
+ tmp = 0; //depth
+ writer_write(&w, &tmp,2);
+ tmp = replaceddefine; //id
+ writer_write(&w, &tmp,2);
+ tmp = 65535; //clipdepth
+ writer_write(&w, &tmp,2);
+ }
+
+ if(config.overlay) {
+ tmp = 5 + (TAGID_PLACEOBJECT2 << 6);
+ writer_write(&w, &tmp, 2);
+ tmp = 2; //flags: character
+ writer_write(&w, &tmp, 1);
+ tmp = 0; //depth
+ writer_write(&w, &tmp,2);
+ tmp = replaceddefine; //id
+ writer_write(&w, &tmp,2);
+ }
+
+ do {
+ struct swf_tag * tag = &slave.tags[pos];
+ if (is_sprite_tag(tag->id)) {
+
+ changedepth(tag, +1);
+ logf("<debug> [sprite main] write tag %02x (%d bytes in body)",
+ slave.tags[pos].id, slave.tags[pos].length);
+ write_changepos(tag, &w);
+
+ if(tag->id == TAGID_SHOWFRAME)
+ {
+ tmp--;
+ logf("<debug> %d frames to go",tmp);
+ }
+ }
+ }
+ while(slave.tags[pos++].id != TAGID_END);
+
+ *tagidpos = (u8*)writer_getpos(&w) - startpos; // set length of sprite (in header)
+ logf("<verbose> sprite length is %d",*tagidpos);
+
+ // write master (2)
+ pos = 0;
+ do {
+ if(!is_defining_tag(master.tags[pos].id))
+ {
+ logf("<debug> [master] write tag %02x (%d bytes in body)",
+ master.tags[pos].id, master.tags[pos].length);
+ writer_write(&w, master.tags[pos].fulldata, master.tags[pos].fulllength);
+ }
+ }
+ while(master.tags[pos++].id != 0);
+
+ tmp32 = (u8*)writer_getpos(&w) - (u8*)newdata; //length
+ *newlength = tmp32;
+ *headlength = tmp32; // set the header to the correct length
+
+ return newdata; //length
+ }
+
+ *newlength = 0;
+ return 0;
+}
diff --git a/src/combine.h b/src/combine.h
new file mode 100644
index 00000000..d522771d
--- /dev/null
+++ b/src/combine.h
@@ -0,0 +1,14 @@
+/* combine.h
+ Header file for combine.c
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#ifndef __combine_h__
+#define __combine_h__
+unsigned char * combine(unsigned char*masterdata, int masterlength,
+ char*slavename, unsigned char*slavedata, int slavelength, int*newlength);
+#endif //__combine_h__
diff --git a/src/flash.c b/src/flash.c
new file mode 100644
index 00000000..fff82843
--- /dev/null
+++ b/src/flash.c
@@ -0,0 +1,528 @@
+/* flash.c
+ Various routines for reading and writing swf files and tags.
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#include "flash.h"
+#include "bitio.h"
+
+void swf_init(uchar*newdata, int newlength)
+{
+ reader_init (&newdata[3], newlength - 3);
+}
+
+struct flash_header swf_read_header()
+{
+ struct flash_header head;
+ u16 rate;
+ u16 count;
+ char version;
+ int length;
+ u8* oldpos = getinputpos();
+
+ input1(&version);
+ head.version = version;
+ input4(&length);
+ head.length = length;
+
+ resetbits();
+ head.boundingBox = readRECT();
+ input2(&rate);
+ head.rate = rate;
+ input2(&count);
+ head.count = count;
+
+ head.headerlength = getinputpos() - oldpos;
+ head.headerdata = oldpos;
+
+ return head;
+}
+
+struct RGB readRGB()
+{
+ struct RGB rgb;
+ input1(&rgb.r);
+ input1(&rgb.g);
+ input1(&rgb.b);
+ return rgb;
+}
+
+struct RGBA readRGBA()
+{
+ struct RGBA rgba;
+ input1(&rgba.r);
+ input1(&rgba.g);
+ input1(&rgba.b);
+ input1(&rgba.a);
+ return rgba;
+}
+
+struct GRADIENT readGRADIENT(int shape)
+{
+ struct GRADIENT gradient;
+ int t;
+ gradient.num = readu8();
+ for(t=0;t<gradient.num;t++)
+ {
+ gradient.ratios[t] = readu8();
+ if(shape>=3)
+ gradient.rgb[t] = readRGB();
+ else
+ gradient.rgba[t] = readRGBA();
+ }
+}
+
+struct RECT readRECT()
+{
+ u32 a;
+ struct RECT r;
+ s32 b;
+ readbits(&a,5);
+ readsbits(&b,a);
+ r.x1=b;
+ readsbits(&b,a);
+ r.x2=b;
+ readsbits(&b,a);
+ r.y1=b;
+ readsbits(&b,a);
+ r.y2=b;
+ return r;
+}
+
+
+void writeRECT(u8**pos, struct RECT*r)
+{
+ struct writer_t w;
+ int t=0;
+ writer_init(&w, *pos, 256);
+ writer_writebits(&w, 31, 5); //FIXME:count
+ writer_writebits(&w, r->x1, 31);
+ writer_writebits(&w, r->x2, 31);
+ writer_writebits(&w, r->y1, 31);
+ writer_writebits(&w, r->y2, 31);
+ writer_resetbits(&w);
+ *pos = writer_getpos(&w);
+}
+
+struct CXFORM readCXFORM()
+{
+ struct CXFORM c;
+ int bits;
+ c.hasadd=readbit();
+ c.hasmult=readbit();
+ bits=getbits(4);
+ c.alpha = 0;
+
+ if (c.hasmult)
+ {
+ c.rmult=getsbits(bits)/65536.0;
+ c.gmult=getsbits(bits)/65536.0;
+ c.bmult=getsbits(bits)/65536.0;
+ if(c.alpha)
+ c.amult=getsbits(bits)/65536.0;
+ }
+ if (c.hasadd)
+ {
+ c.radd=getsbits(bits)/65536.0;
+ c.gadd=getsbits(bits)/65536.0;
+ c.badd=getsbits(bits)/65536.0;
+ if(c.alpha)
+ c.aadd=getsbits(bits)/65536.0;
+ }
+ return c;
+}
+
+void CXFORM_write(struct CXFORM *obj, struct writer_t*w)
+{
+ int bits = 15;
+ writer_writebit(w,obj->hasadd);
+ writer_writebit(w,obj->hasmult);
+ writer_writebits(w, bits, 4);
+ if (obj->hasmult)
+ {
+ writer_writebits(w, obj->rmult, bits);
+ writer_writebits(w, obj->gmult, bits);
+ writer_writebits(w, obj->bmult, bits);
+ if(obj->alpha)
+ writer_writebits(w, obj->amult, 4);
+ }
+ if (obj->hasadd)
+ {
+ writer_writebits(w, obj->radd, bits);
+ writer_writebits(w, obj->gadd, bits);
+ writer_writebits(w, obj->badd, bits);
+ if(obj->alpha)
+ writer_writebits(w, obj->aadd, 4);
+ }
+}
+
+unsigned char* readSTRING()
+{
+ unsigned char*now = getinputpos();
+ char a;
+ do
+ {
+ input1(&a);
+ }
+ while(a);
+ return now;
+}
+void MATRIX_init(struct MATRIX*m)
+{
+ m->hasrotate = 0;
+ m->hasscale = 0;
+ m->b[0] = 0;
+ m->b[1] = 0;
+ m->a[0][0] = 1;
+ m->a[1][1] = 1;
+ m->a[1][0] = 0;
+ m->a[0][1] = 0;
+}
+struct MATRIX readMATRIX()
+{
+ struct MATRIX m;
+ u8 hasrotate;
+ u8 translatebits;
+ u32 translatex;
+ u32 translatey;
+
+ m.a[0][0] = m.a[1][1] = 1;
+ m.a[0][1] = m.a[1][0] = 0;
+ m.hasscale=readbit();
+ if(m.hasscale)
+ {
+ u8 scalebits=getbits(5);
+ s32 scalex=getsbits(scalebits);
+ s32 scaley=getsbits(scalebits);
+ m.a[0][0]=scalex/65536.0;
+ m.a[1][1]=scaley/65536.0;
+ }
+ m.hasrotate=readbit();
+ if(m.hasrotate)
+ {
+ u8 rotbits=getbits(5);
+ s32 rotateskew0=getsbits(rotbits);
+ s32 rotateskew1=getsbits(rotbits);
+ m.a[0][1]=rotateskew0/65536.0;
+ m.a[1][0]=rotateskew1/65536.0;
+ }
+
+ translatebits=getbits(5);
+ translatex=getsbits(translatebits);
+ translatey=getsbits(translatebits);
+ m.b[0]=translatex;
+ m.b[1]=translatey;
+
+ return m;
+}
+
+void MATRIX_write(struct MATRIX * m , struct writer_t*w)
+{
+ writer_writebit (w, m->hasscale);
+ if(m->hasscale)
+ {
+ int bits = 31;
+ writer_writebits(w, bits, 5);
+ writer_writebits(w, (u32)(m->a[0][0]*65536.0), bits);
+ writer_writebits(w, (u32)(m->a[1][1]*65536.0), bits);
+ }
+ writer_writebit (w, m->hasrotate);
+ if(m->hasrotate)
+ {
+ int bits = 31;
+ writer_writebits(w, bits, 5);
+ writer_writebits(w, (u32)(m->a[0][1]*65536.0), bits);
+ writer_writebits(w, (u32)(m->a[1][0]*65536.0), bits);
+ }
+
+ //translate
+ {
+ int bits = 31;
+ writer_writebits(w, bits, 5);
+ writer_writebits(w, (u32)(m->b[0]), bits);
+ writer_writebits(w, (u32)(m->b[1]), bits);
+ }
+}
+
+
+int swf_read_tag(struct swf_tag* swftag)
+{
+ u8*pos2,*pos = getinputpos();
+ u16 tag;
+ u32 taglength;
+ u32 tagid;
+ int t;
+
+ input2(&tag);
+
+ taglength = tag & 0x3f;
+ if (taglength == 0x3f)
+ {
+ input4(&taglength);
+ }
+
+ swftag->id=tag>>6;
+ swftag->length = taglength;
+ swftag->data = getinputpos();
+ skip(taglength);
+ pos2 = getinputpos();
+ swftag->fulllength = pos2 - pos;
+ swftag->fulldata = pos;
+ return 1;
+}
+
+int swf_count_tags()
+{
+ u8*pos = getinputpos();
+ int t=0;
+ struct swf_tag tag;
+
+ while(1)
+ {
+ swf_read_tag(&tag);
+ t++;
+ if (tag.id == 0)
+ break;
+ }
+
+ setinputpos(pos);
+ return t;
+}
+
+void placeobject_init (struct PlaceObject*obj, struct swf_tag*tag)
+{
+ reader_init (tag->data, tag->length);
+ obj -> id = readu16();
+ obj -> depth = readu16();
+ obj -> matrix = readMATRIX();
+ obj -> hascxform = (getinputpos() < &tag->data[tag->length]);
+ if(obj -> hascxform)
+ obj -> cxform = readCXFORM();
+}
+
+void placeobject_write (struct PlaceObject*obj, struct writer_t*w)
+{
+ u16 taghead = 0x3f | TAGID_PLACEOBJECT<<6;
+ u8*pos;
+ u8*lenpos;
+ writer_resetbits(w);
+ writer_write(w, &taghead, 2);
+ lenpos = writer_getpos(w);
+
+ writer_write(w, &taghead, 2);
+ writer_write(w, &taghead, 2);
+
+ pos = writer_getpos(w);
+
+ writer_write(w, &obj->id, 2);
+ writer_write(w, &obj->depth, 2);
+ MATRIX_write(&obj->matrix, w);
+
+ if(obj->hascxform)
+ {
+ CXFORM_write(&obj->cxform, w);
+ }
+ writer_resetbits(w);
+
+ *(u32*)lenpos = (u8*)writer_getpos(w) - pos;
+}
+
+void placeobject2_init (struct PlaceObject2*obj,struct swf_tag*tag)
+{
+ u8 b;
+ reader_init (tag->data, tag->length);
+ b=readu8();
+ obj->reserved= (b>>7)&1;
+ obj->hasclipactions= (b>>6)&1;
+ obj->hasname= (b>>5)&1;
+ obj->hasratio= (b>>4)&1;
+ obj->hascolortransform=(b>>3)&1;
+ obj->hasmatrix= (b>>2)&1;
+ obj->hascharacter= (b>>1)&1;
+ obj->hasmove= (b>>0)&1;
+
+ obj->depth = readu16();
+ obj->id = -1;
+ if(obj->hascharacter) {
+ obj->id = readu16();
+ }
+ if(obj->hasmatrix) {
+ obj->matrix = readMATRIX();
+ }
+ if(obj->hascolortransform) {
+ obj->cxform = readCXFORM();
+ }
+ if(obj->hasratio) {
+ obj->ratio=readu16();
+ }
+ obj->name = 0;
+ if(obj->hasname) {
+ obj->name=readSTRING();
+ }
+ if(obj->hasclipactions) {
+ obj->clipactions=readu16();
+ }
+}
+
+void placeobject2_write (struct PlaceObject2*obj, struct writer_t*w)
+{
+ u8 flags = obj->reserved<<7 | obj->hasclipactions<<6 | obj->hasname<<5 | obj->hasratio<<4 |
+ obj->hascolortransform<<3 | obj->hasmatrix<<2 | obj->hascharacter<<1 | obj->hasmove;
+ u16 taghead = 0x3f | TAGID_PLACEOBJECT2<<6;
+ u8*pos;
+ u8*lenpos;
+ writer_resetbits(w);
+ writer_write(w, &taghead, 2);
+ lenpos = writer_getpos(w);
+ writer_write(w, &taghead, 2);
+ writer_write(w, &taghead, 2);
+
+ pos = writer_getpos(w);
+
+ writer_writeu8(w, flags);
+ writer_writeu16(w, obj->depth);
+ if(obj->hascharacter)
+ writer_writeu16(w, obj->id);
+ if(obj->hasmatrix)
+ MATRIX_write(&obj->matrix, w);
+ if(obj->hascolortransform)
+ CXFORM_write(&obj->cxform, w);
+ if(obj->hasratio)
+ writer_writeu16(w, obj->ratio);
+ writer_resetbits(w);
+ if(obj->hasname)
+ writer_write(w, obj->name, strlen(obj->name) + 1);
+ if(obj->hasclipactions)
+ writer_writeu16(w, obj->clipactions);
+ writer_resetbits(w);
+ *(u32*)lenpos = (u8*)writer_getpos(w) - pos;
+}
+
+void read_swf(struct swffile*swf, uchar*data, int length)
+{
+ int pos;
+ struct flash_header head;
+ int tagnum;
+ swf_init(data, length);
+ head = swf_read_header(data);
+ logf("<debug> [HEADER] the version is %d", head.version);
+ logf("<debug> [HEADER] the length is %d", head.length);
+ logf("<debug> [HEADER] the boundingBox is %d:%d:%d:%d",
+ head.boundingBox.x1,head.boundingBox.y1,
+ head.boundingBox.x2,head.boundingBox.y2);
+ logf("<debug> [HEADER] the rate (frames/second) is %d", head.rate);
+ logf("<debug> [HEADER] the count (frame number) is %d", head.count);
+
+ tagnum = swf_count_tags();
+ swf->tags = (struct swf_tag*)malloc(sizeof(struct swf_tag)*tagnum);
+
+ logf("<debug> [HEADER] the file consists of %d tags", tagnum);
+
+ pos = 0;
+ while(1)
+ {
+ struct swf_tag tag;
+ swf_read_tag(&tag);
+ logf("<debug> read tag %02x (%d bytes)", tag.id, tag.length);
+ swf->tags[pos] = tag;
+ pos++;
+ if(tag.id == TAGID_END)
+ break;
+ }
+ swf->tagnum = tagnum;
+ swf->header = head;
+}
+
+int definingtagids[] =
+{TAGID_DEFINESHAPE,
+ TAGID_DEFINESHAPE2,
+ TAGID_DEFINESHAPE3,
+ TAGID_DEFINEMORPHSHAPE,
+ TAGID_DEFINEFONT,
+ TAGID_DEFINEFONT2,
+ TAGID_DEFINETEXT,
+ TAGID_DEFINETEXT2,
+ TAGID_DEFINEEDITTEXT,
+ TAGID_DEFINEBITS,
+ TAGID_DEFINEBITSJPEG2,
+ TAGID_DEFINEBITSJPEG3,
+ TAGID_DEFINEBITSLOSSLESS,
+ TAGID_DEFINEBITSLOSSLESS2,
+ TAGID_DEFINEMOVIE,
+ TAGID_DEFINESPRITE,
+ TAGID_DEFINEBUTTON,
+ TAGID_DEFINEBUTTON2,
+ TAGID_DEFINESOUND,
+ -1
+};
+
+// tags which may be used inside a sprite definition
+int spritetagids[] =
+{TAGID_SHOWFRAME,
+ TAGID_PLACEOBJECT,
+ TAGID_PLACEOBJECT2,
+ TAGID_REMOVEOBJECT,
+ TAGID_REMOVEOBJECT2, //?
+ TAGID_DOACTION,
+ TAGID_STARTSOUND,
+ TAGID_FRAMELABEL,
+ TAGID_SOUNDSTREAMHEAD,
+ TAGID_SOUNDSTREAMHEAD2,
+ TAGID_SOUNDSTREAMBLOCK,
+ TAGID_END,
+ -1
+};
+
+int getidfromtag(struct swf_tag* tag)
+{
+ // todo: check for more than one id
+ return *(u16*)tag->data;
+}
+
+void setidintag(struct swf_tag* tag, int id)
+{
+ *(u16*)tag->data = id;
+}
+
+char is_sprite_tag (int id)
+{
+
+ int t=0;
+ while(spritetagids[t]>=0)
+ {
+ if(spritetagids[t] == id)
+ return 1;
+ t++;
+ }
+ return 0;
+}
+
+char is_defining_tag (int id)
+{
+
+ int t=0;
+ while(definingtagids[t]>=0)
+ {
+ if(definingtagids[t] == id)
+ return 1;
+ t++;
+ }
+ return 0;
+}
+
+struct swf_tag* duptag(struct swf_tag*tag)
+{
+ struct swf_tag* newtag = (struct swf_tag*)malloc(sizeof(struct swf_tag));
+ newtag->id = tag->id;
+ newtag->fulldata = (u8*)malloc(tag->fulllength);
+ newtag->fulllength = tag->fulllength;
+ newtag->data = newtag->fulldata + (tag->data - tag->fulldata);
+ newtag->length = tag->length;
+ memcpy(newtag->fulldata, tag->fulldata, tag->fulllength);
+ return newtag;
+}
+
diff --git a/src/flash.h b/src/flash.h
new file mode 100644
index 00000000..255aeff5
--- /dev/null
+++ b/src/flash.h
@@ -0,0 +1,196 @@
+/* flash.h
+ Header file for flash.c
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#ifndef __flash_h__
+#define __flash_h__
+
+#include "types.h"
+
+#define TAGID_END 0
+#define TAGID_SHOWFRAME 1
+#define TAGID_DEFINESHAPE 2
+#define TAGID_PLACEOBJECT 4
+#define TAGID_REMOVEOBJECT 5
+#define TAGID_DEFINEBITS 6
+#define TAGID_DEFINEBUTTON 7
+#define TAGID_JPEGTABLES 8
+#define TAGID_BACKGROUNDCOLOR 9
+#define TAGID_DEFINEFONT 10
+#define TAGID_DEFINETEXT 11
+#define TAGID_DOACTION 12
+#define TAGID_DEFINEFONTINFO 13
+#define TAGID_DEFINESOUND 14
+#define TAGID_STARTSOUND 15
+#define TAGID_SOUNDSTREAMHEAD 18
+#define TAGID_SOUNDSTREAMHEAD2 18
+#define TAGID_SOUNDSTREAMBLOCK 19
+#define TAGID_DEFINEBITSLOSSLESS 20
+#define TAGID_DEFINEBITSJPEG2 21
+#define TAGID_DEFINESHAPE2 22
+#define TAGID_PROTECT 24
+#define TAGID_PLACEOBJECT2 26
+#define TAGID_REMOVEOBJECT2 28
+#define TAGID_DEFINESHAPE3 32
+#define TAGID_DEFINETEXT2 33
+#define TAGID_DEFINEBUTTON2 34
+#define TAGID_DEFINEBITSJPEG3 35
+#define TAGID_DEFINEBITSLOSSLESS2 36
+#define TAGID_DEFINEEDITTEXT 37
+#define TAGID_DEFINEMOVIE 38
+#define TAGID_DEFINESPRITE 39
+#define TAGID_FRAMELABEL 43
+#define TAGID_DEFINEMORPHSHAPE 46
+#define TAGID_DEFINEFONT2 48
+#define TAGID_EXPORTASSETS 56
+#define TAGID_IMPORTASSETS 57
+#define TAGID_ENABLEDEBUGGER 58
+
+#include "bitio.h"
+
+struct swf_tag;
+struct RECT;
+struct RGB;
+struct MATRIX;
+struct CXFORM;
+struct CLIPACTIONS;
+
+struct swf_tag
+{
+ u8 id;
+ u32 length;
+ u8*data;
+ u32 fulllength; // includes id
+ u8*fulldata; // likewise
+};
+
+struct RGB
+{
+ byte r,g,b;
+};
+
+struct RGBA
+{
+ byte r,g,b,a;
+};
+
+struct RECT
+{
+ int x1, y1, x2, y2;
+};
+
+struct MATRIX
+{
+ u8 hasscale;
+ u8 hasrotate;
+ float a[2][2];
+ int b[2];
+};
+
+struct CXFORM
+{
+ u8 hasadd;
+ u8 hasmult;
+ float rmult, gmult, bmult, amult;
+ float radd, gadd, badd, aadd;
+ u8 alpha;
+};
+
+struct GRADIENT
+{
+ int num;
+ u8 ratios[8];
+ struct RGB rgb[8];
+ struct RGBA rgba[8];
+};
+
+struct RECT readRECT();
+struct RGB readRGB();
+struct MATRIX readMATRIX();
+unsigned char* readSTRING();
+struct CXFORM readCXFORM();
+struct CLIPACTIONS readCLIPACTIONS();
+
+void writeRECT(u8**pos, struct RECT*r);
+
+void swf_init(uchar*newdata, int newlength);
+struct flash_header
+{
+ int version;
+ u32 length;
+ struct RECT boundingBox;
+ u16 rate;
+ u16 count;
+
+ u8*headerdata;
+ int headerlength;
+};
+
+struct swffile
+{
+ struct flash_header header;
+ int tagnum;
+ struct swf_tag* tags;
+};
+
+struct flash_header swf_read_header();
+struct RGB readRGB();
+struct RGBA readRGBA();
+struct GRADIENT readGRADIENT(int shape);
+struct RECT readRECT();
+struct CXFORM readCXFORM();
+struct MATRIX readMATRIX();
+unsigned char* readSTRING();
+int swf_read_tag(struct swf_tag* swftag);
+int swf_count_tags();
+
+
+struct PlaceObject
+{
+ u16 id;
+ u16 depth;
+ struct MATRIX matrix;
+ struct CXFORM cxform;
+ u8 hascxform;
+};
+
+struct PlaceObject2
+{
+ u8 reserved;
+ u8 hasclipactions;
+ u8 hasname;
+ u8 hasratio;
+ u8 hascolortransform;
+ u8 hasmatrix;
+ u8 hascharacter;
+ u8 hasmove;
+
+ u16 depth;
+ int id;
+ struct MATRIX matrix;
+ struct CXFORM cxform;
+ u16 ratio;
+ char * name;
+ u16 clipactions;
+};
+
+
+void placeobject_init (struct PlaceObject*obj, struct swf_tag*tag);
+void placeobject_write (struct PlaceObject*obj, struct writer_t*w);
+
+void placeobject2_init (struct PlaceObject2*obj, struct swf_tag*tag);
+
+void read_swf(struct swffile*swf, uchar*data, int length);
+
+int getidfromtag(struct swf_tag* tag);
+void setidintag(struct swf_tag* tag, int id);
+char is_sprite_tag (int id);
+char is_defining_tag (int id);
+struct swf_tag* duptag(struct swf_tag*tag);
+
+#endif //__flash_h__
diff --git a/src/reloc.c b/src/reloc.c
new file mode 100644
index 00000000..2f82afa5
--- /dev/null
+++ b/src/reloc.c
@@ -0,0 +1,285 @@
+/* reloc.h
+ Implements swf_relocate(), which changes the id range of a swf file in
+ memory.
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#include "flash.h"
+
+static struct swffile file;
+
+int slaveids[65536];
+
+
+void map_ids_mem(u8*mem, int length);
+static struct swf_tag* map_ids(struct swf_tag*tag)
+{
+ map_ids_mem(tag->fulldata, tag->fulllength);
+ return tag;
+}
+
+void maponeid(void*idpos)
+{
+ u16*idptr = (u16*)idpos;
+ if(slaveids[*idptr]<0) {
+ logf("<error> Trying to map id never encountered before: id=%d", *idptr);
+ return ;
+ }
+ logf("<debug> mapping %d to %d", *idptr, slaveids[*idptr]);
+ *idptr = slaveids[*idptr];
+}
+
+
+// take a memory region which contains a tag, and
+// map the ids inside this tag to new values
+void map_ids_mem(u8*mem, int length)
+{
+ int num=1;
+ struct swf_tag newtag_instance;
+ struct swf_tag*newtag = &newtag_instance;
+ reader_init (mem, length);
+ swf_read_tag(newtag);
+
+ switch(newtag->id)
+ {
+ case TAGID_PLACEOBJECT:
+ maponeid(&newtag->data[0]);
+ break;
+ case TAGID_PLACEOBJECT2:
+ // only if placeflaghascharacter
+ if(!(newtag->data[0]&2))
+ break;
+ maponeid(&newtag->data[3]);
+ break;
+ case TAGID_REMOVEOBJECT:
+ maponeid(&newtag->data[0]);
+ break;
+ case TAGID_STARTSOUND:
+ maponeid(&newtag->data[0]);
+ break;
+ case TAGID_DEFINESPRITE: {
+ u8*mem = &newtag->data[4];
+ int len = newtag->length-4;
+
+ while(1) {
+ u8*fmem = mem;
+ int flen = len;
+ struct swf_tag sprtag;
+
+ reader_init (mem, len);
+ swf_read_tag (&sprtag);
+
+ mem = getinputpos();
+ len = getinputlength();
+
+ if(sprtag.id == TAGID_END)
+ break;
+
+ map_ids_mem (fmem,flen);
+ }
+ }
+ break;
+ case TAGID_DEFINEBUTTON2: // has some font ids in the button records
+ num++;
+ //fallthrough
+ case TAGID_DEFINEBUTTON:
+ reader_init (newtag->data, newtag->length);
+ readu16(); //button id
+ if(num>1)
+ {
+ readu8(); //flag
+ readu16(); //offset
+ }
+ while(1)
+ {
+ u16 charid;
+ if(!readu8()) //flags
+ break;
+ charid = *(u16*)getinputpos();
+ maponeid(getinputpos());
+ readu16(); //char
+ readu16(); //layer
+ readMATRIX();
+ readCXFORM();
+ }
+ // ...
+ break;
+ case TAGID_DEFINEEDITTEXT: {
+ u8 flags1,flags2;
+ reader_init (newtag->data, newtag->length);
+ readu16(); //id
+ readRECT(); //bounding box
+ resetbits();
+ flags1 = readu8();
+ flags2 = readu8();
+ if(flags1 & 128)
+ maponeid(getinputpos());
+ }
+ break;
+ case TAGID_DEFINETEXT2:
+ num ++;
+ case TAGID_DEFINETEXT: {
+ int glyphbits, advancebits;
+ reader_init (newtag->data, newtag->length);
+ readu16(); //id
+ readRECT(); //bounding box
+ readMATRIX(); //matrix
+ resetbits();
+ glyphbits = readu8(); //glyphbits
+ advancebits = readu8(); //advancebits
+ while(1) {
+ u16 flags = getbits(8);
+ printf("define text flags: %02x\n", flags);
+ if(!flags) break;
+ if(flags & 128) // text style record
+ {
+ if(flags & 8) { // hasfont
+ maponeid(getinputpos());
+ resetbits();
+ readu16();
+ }
+ if(flags & 4) { // hascolor
+ if(num==1) readRGB();
+ else readRGBA();
+ }
+ if(flags & 2) { //has x offset
+ resetbits();
+ readu16();
+ }
+ if(flags & 1) { //has y offset
+ resetbits();
+ readu16();
+ }
+ if(flags & 8) { //has height
+ resetbits();
+ readu16();
+ }
+ } else { // glyph record
+ getbits(glyphbits);
+ getbits(advancebits);
+ break;
+ }
+ }
+ break;
+ }
+ case TAGID_DEFINEFONTINFO:
+ maponeid(&newtag->data[0]);
+ break;
+
+ case TAGID_DEFINESHAPE3: // these thingies might have bitmap ids in their fillstyles
+ num++; //fallthrough
+ case TAGID_DEFINESHAPE2:
+ num++; //fallthrough
+ case TAGID_DEFINESHAPE: {
+ u16 count;
+ int t;
+ struct RECT r;
+ reader_init (newtag->data, newtag->length);
+ readu16(); // id;
+ r = readRECT(); // bounds
+// printf("%d shape bounds: %d %d %d %d\n",newtag->id,r.x1,r.y1,r.x2,r.y2);
+ resetbits();
+ count = readu8();
+ if(count == 0xff && num>1)
+ count = readu16();
+// printf("%d fillstyles\n", count);
+ for(t=0;t<count;t++)
+ {
+ int type;
+ u8*pos;
+ pos=getinputpos();
+// printf("%02x %02x %02x %02x %02x %02x %02x %02x\n",
+// pos[0],pos[1],pos[2],pos[3],pos[4],pos[5],pos[6],pos[7]);
+ type = readu8(); //type
+// printf("fillstyle %d is type 0x%02x\n", t, type);
+ if(type == 0) {
+ if(num == 3)
+ readRGBA();
+ else
+ readRGB();
+ }
+ if(type == 0x10 || type == 0x12)
+ {
+ readMATRIX();
+ resetbits();
+ readGRADIENT(num);
+ }
+ if(type == 0x40 || type == 0x41)
+ {
+ resetbits();
+ // we made it.
+ if(*(u16*)getinputpos() != 65535)
+ maponeid(getinputpos());
+
+ readu16();
+ readMATRIX();
+ }
+ //...
+ }
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+static int*bitmap;
+
+static int get_free_id()
+{
+ int t;
+ for (t=1;t<65536;t++)
+ {
+ if(bitmap[t] == -1)
+ {
+ bitmap[t] = 1;
+ return t;
+ }
+ }
+ return -1;
+}
+
+void swf_relocate (u8*data, int length, int*_bitmap)
+{
+ int pos;
+ bitmap = _bitmap;
+ read_swf(&file, data, length);
+ memset(slaveids, -1, sizeof(slaveids));
+
+ pos = 0;
+ while(file.tags[pos].id != 0) {
+ struct swf_tag*tag = &file.tags[pos];
+
+ map_ids(&file.tags[pos]);
+
+ if(is_defining_tag(tag->id))
+ {
+ int newid;
+ int id;
+
+ id = getidfromtag(tag); //own id
+
+ if(bitmap[id] < 0) { //free
+ newid = id;
+ }
+ else {
+ newid = get_free_id(id);
+ }
+ bitmap[newid] = 1;
+ slaveids[id] = newid;
+
+ logf("<debug> sprite id %d mapped to %d",id, newid);
+
+ setidintag(tag, newid);
+
+ logf("<debug> [sprite defs] write tag %02x (%d bytes in body)",
+ tag->id, tag->length);
+ }
+ pos++;
+ }
+}
+
diff --git a/src/reloc.h b/src/reloc.h
new file mode 100644
index 00000000..8624c440
--- /dev/null
+++ b/src/reloc.h
@@ -0,0 +1,14 @@
+/* reloc.h
+ Header file for reloc.c
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#ifndef __swf_reallocate__
+#define __swf_reallocate__
+void swf_relocate (u8*data, int length, int*bitmap);
+#endif // __swf_reallocate__
+
diff --git a/src/settings.h b/src/settings.h
new file mode 100644
index 00000000..da73a716
--- /dev/null
+++ b/src/settings.h
@@ -0,0 +1,26 @@
+/* args.h
+ Settings for swfcombine. This is deliberately not named "config.h" to
+ avoid conflicts with GNU autoconf.
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#ifndef __config_h__
+#define __config_h__
+struct config_t
+{
+ char overlay;
+ char alloctest;
+ char clip;
+ char stack;
+ int loglevel;
+ int movex;
+ int movey;
+ float scalex;
+ float scaley;
+};
+extern struct config_t config;
+#endif
diff --git a/src/swfcombine.1 b/src/swfcombine.1
new file mode 100644
index 00000000..d1e484e2
--- /dev/null
+++ b/src/swfcombine.1
@@ -0,0 +1,83 @@
+.TH swfcombine "1" "October 2001" "swfcombine" "swftools"
+.SH NAME
+swfcombine - a tool for combining swf (flash) files
+.SH Synopsis
+.B swfcombine
+[\fIoptions\fR] [\fImasterfile.swf\fR] [\fIslavename1=\fR][\fIslavefile1.swf\fR] ... [\fIslavenameN=\fR][\fIslavefileN.swf\fR]
+.SH DESCRIPTION
+Take two or more SWF files, and combine them into a new SWF. SWFs can either
+be stacked (no masterfile is present) or inserted (into the masterfile).
+.PP
+SWF files are animation files which can be displayed in Web Browsers using
+the Flash Plugin.
+.LP
+For template mechanisms, it's often convenient to separate the processes
+of generating small animation fragments, and merging them all into a big
+movie. swfcombine can be used to perform the latter.
+.SH OPTIONS
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Print short help message and exit
+.\".TP
+.\" \fB\-\-version\fR
+.\" Print version info and exit
+.TP
+\fB\-o\fR, \fB\-\-output\fR \fIfilename\fR
+Explicitly specify output file. (otherwise, output.swf will be used)
+.TP
+\fB\-l\fR, \fB\-\-overlay\fR
+Don't remove any master objects, only overlay new objects.
+.TP
+\fB\-c\fR, \fB\-\-clip\fR
+Clip the slave objects by the corresponding master objects.
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+Be verbose. Use more than one -v for greater effect.
+.TP
+\fB\-t\fR, \fB\-\-stack\fR
+Don't assume the first file is a master file. Instead, store each
+file in a seperate frame.
+.TP
+\fB\-x\fR, \fB\-\-xpos\fR \fIxpos\fR
+(move x) Adjust position of slave by xpos twips (1/20 pixel).
+.TP
+\fB\-y\fR, \fB\-\-ypos\fR \fIypos\fR
+(move y) Adjust position of slave by ypos twips (1/20 pixel).
+.TP
+\fB\-s\fR, \fB\-\-scale\fR \fIscale\fR
+(scale) Adjust size of slave by scale%
+.PP
+.SH Combining two or more .swf files using a master file
+Of the flash files to be combined, all except one will be packed into a sprite
+structure (Movieclip) which will then be inserted into the master .swf file.
+This means that, in terms of trees, when combining several flash files,
+one will form the root of the tree, while the others will be
+appended to the root as a subnode.
+The user has to specify which of the files will become the root
+of the tree ("master") and which will be the appended nodes ("slaves").
+The slave files must all have a name, which is then used to determine
+their exact position inside the master file.
+The slave files will then be converted into sprites, inserted into the
+master file, and all PlaceObject tags in the master file which match the
+name of the slave file will be updated to correctly display the slave sprite.
+.SH Combining (stacking) one or more .swf files without a master
+The flash files will be inserted in seperate frames. They will still be
+packed into Movieclips, therefore the outputfile will have exactly as many
+frames as there were inputfiles. Also, the files don't need to have names.
+If you want to access the Movieclips, their names are frameXX, where XX is
+the decimal number of the file, starting by zero (00).
+
+.SH EXAMPLES
+
+Create two flash movies. Insert some rectangle into one of them, and give
+it a name. (E.g. "foo") Now call
+
+swfcombine -o combined.swf master.swf foo:slave.swf
+
+As a result, the slave movie should be visible inside the master movie
+at the position where the rectangle used to be.
+
+.SH AUTHOR
+
+Matthias Kramm <kramm@quiss.org>
+
diff --git a/src/swfcombine.c b/src/swfcombine.c
new file mode 100644
index 00000000..77597b66
--- /dev/null
+++ b/src/swfcombine.c
@@ -0,0 +1,431 @@
+/* swfcombine.c
+ main routine for swfcombine(1), which is a tool for merging .swf-files.
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "args.h"
+#include "combine.h"
+#include "settings.h"
+#include "types.h"
+#include "flash.h"
+
+char * master_filename = 0;
+char * master_name = 0;
+char * slave_filename[128];
+char * slave_name[128];
+int slave_movex[128];
+int slave_movey[128];
+float slave_scalex[128];
+float slave_scaley[128];
+int numslaves = 0;
+
+char * outputname = "output.swf";
+
+int args_callback_option(char*name,char*val) {
+ if(!strcmp(name,"c"))
+ {
+ config.clip = 1;
+ return 0;
+ }
+ else if(!strcmp(name,"l"))
+ {
+ config.overlay = 1;
+ return 0;
+ }
+ else if (!strcmp(name, "o"))
+ {
+ outputname = val;
+ return 1;
+ }
+ else if (!strcmp(name, "v"))
+ {
+ config.loglevel ++;
+ return 0;
+ }
+ else if (!strcmp(name, "a"))
+ {
+ config.alloctest = 1;
+ return 0;
+ }
+ else if (!strcmp(name, "x"))
+ {
+ config.movex = atoi(val);
+ return 1;
+ }
+ else if (!strcmp(name, "y"))
+ {
+ config.movey = atoi(val);
+ return 1;
+ }
+ else if (!strcmp(name, "s"))
+ {
+ config.scalex = config.scaley = atoi(val)/100.0;
+ return 1;
+ }
+ else if (!strcmp(name, "t"))
+ {
+ if(master_filename) {
+ fprintf(stderr, "error with arguments. Try --help.\n");
+ exit(1);
+ }
+ config.stack = 1;
+ master_filename = "__none__";
+ return 0;
+ }
+ else if (!strcmp(name, "V"))
+ {
+ printf("swfcombine - part of swftools 0.0.1\n");
+ exit(0);
+ }
+ else
+ {
+ fprintf(stderr, "Unknown option: -%s\n", name);
+ exit(1);
+ }
+}
+
+struct options_t
+{
+ char*shortoption;
+ char*longoption;
+} options[] =
+{{"o","output"},
+ {"s","scale"},
+ {"x","xpos"},
+ {"y","ypos"},
+ {"l","overlay"},
+ {"v","verbose"},
+ {"V","version"},
+ {"c","clip"},
+};
+
+int args_callback_longoption(char*name,char*val) {
+ int t;
+ for(t=0;t<sizeof(options)/sizeof(struct options_t);t++)
+ if(!strcmp(options[t].longoption, name))
+ return args_callback_option(options[t].shortoption,val);
+ fprintf(stderr, "Unknown option: --%s\n", name);
+ exit(1);
+}
+
+int args_callback_command(char*name, char*val) {
+ char*myname = strdup(name);
+ char*filename;
+ filename = strchr(myname, '=');
+ if(filename) {
+ *filename = 0;
+ filename++;
+ } else {
+ // argument has no explicit name field. guess one from the file name
+ char*path = strrchr(myname, '/');
+ char*ext = strrchr(myname, '.');
+ if(!path) path = myname;
+ else path ++;
+ if(ext) *ext = 0;
+ myname = path;
+ filename = name;
+ }
+
+ if(!master_filename) {
+
+ master_filename = filename;
+ master_name = myname;
+ } else {
+ logf("<verbose> slave entity %s (named \"%s\")\n", filename, myname);
+
+ slave_filename[numslaves] = filename;
+ slave_name[numslaves] = myname;
+ slave_movex[numslaves] = config.movex;
+ slave_movey[numslaves] = config.movey;
+ slave_scalex[numslaves] = config.scalex;
+ slave_scaley[numslaves] = config.scaley;
+ config.movex = config.movey = 0;
+ config.scalex = config.scaley = 1.0;
+ numslaves ++;
+ }
+ return 0;
+}
+
+void args_callback_usage(char*name)
+{
+ printf("Usage: %s [-l] [-o outputfile] [name=]masterfile [-x xpos] [-y ypos] [-s scale] [name1=]slavefile1 .. [-x xpos] [-y ypos] [-s scale] [nameN=]slavefileN\n", name);
+ printf("\n");
+ printf("-o outputfile explicitly specify output file. (otherwise, output.swf will be used)\n");
+ printf("-l (overlay) Don't remove any master objects, only overlay new objects\n");
+ printf("-c (clip) Clip the slave objects by the corresponding master objects\n");
+ printf("-v (verbose) Use more than one -v for greater effect \n");
+ printf("-x xpos (move x) Adjust position of slave by xpos twips (1/20 pixel)\n");
+ printf("-y ypos (move y) Adjust position of slave by ypos twips (1/20 pixel)\n");
+ printf("-s scale (scale) Adjust size of slave by scale%\n");
+ printf("\n");
+}
+
+/* read a whole file in memory */
+char* fi_slurp(FILE*fi, unsigned int * setlength)
+{
+ char * mem;
+ long long int length; //;)
+ long long int pos = 0;
+ fseek(fi,0,SEEK_END);
+ length = ftell(fi);
+ fseek(fi,0,SEEK_SET);
+ if(!length)
+ return 0;
+ mem = malloc(length);
+ if(!mem)
+ return 0;
+ while(!feof(fi))
+ {
+ pos += fread(&mem[pos], 1, 65536, fi);
+ }
+ if (setlength)
+ *setlength = length;
+ return mem;
+}
+
+void fi_dump(FILE*fi, void*_mem, int length)
+{
+ char*mem = (char*)_mem;
+ int pos = 0;
+ while(pos < length)
+ {
+ int size = 65536;
+ if (size > (length - pos))
+ size = (length - pos);
+ pos += fwrite(&mem[pos], 1, size, fi);
+ }
+}
+
+void makestackmaster(u8**masterdata, int*masterlength)
+{
+ u8 head[] = {'F','W','S'};
+ u8 *pos;
+ u32 * fixpos;
+ int t;
+ struct RECT box;
+ int strlength = 0;
+ int fileversion = 1;
+
+ logf("<error> stacking doesn't work yet. Prepare for problems.");
+
+ /* scan all slaves for bounding box */
+ for(t=0;t<numslaves;t++)
+ {
+ FILE*fi=fopen(slave_filename[t],"rb");
+ u8 data[256];
+ int ret;
+ struct flash_header head;
+ strlength += strlen(slave_name[t]) + 9;
+ if(!fi) {
+ logf("<fatal> Couldn't open %s.", slave_filename[t]);
+ exit(1);
+ }
+ ret = fread(data,1,256,fi);
+ if(ret < 13) {
+ logf("<fatal> File %s is to small (%d bytes)", slave_filename[t], ret);
+ exit(1);
+ }
+ swf_init(data,256);
+ head = swf_read_header();
+ logf("<verbose> File %s has bounding box %d:%d:%d:%d\n",
+ slave_filename[t],
+ head.boundingBox.x1, head.boundingBox.y1,
+ head.boundingBox.x2, head.boundingBox.y2);
+ if(head.version > fileversion)
+ fileversion = head.version;
+ if(!t)
+ box = head.boundingBox;
+ else {
+ if(head.boundingBox.x1 < box.x1)
+ box.x1 = head.boundingBox.x1;
+ if(head.boundingBox.y1 < box.y1)
+ box.y1 = head.boundingBox.y1;
+ if(head.boundingBox.x2 > box.x2)
+ box.x2 = head.boundingBox.x2;
+ if(head.boundingBox.y2 > box.y2)
+ box.y2 = head.boundingBox.y2;
+ }
+ logf("<verbose> New master bounding box is %d:%d:%d:%d\n",
+ box.x1, box.y1,
+ box.x2, box.y2);
+ fclose(fi);
+ }
+
+ /* we don't have a master, so we create one ourselves. */
+ /* (please notice the philosophical content) */
+ *masterlength = (numslaves + 1) * 32 + strlength;
+ *masterdata = (u8*)malloc(*masterlength);
+ pos = *masterdata;
+ memcpy(pos, head, sizeof(head));
+ pos += sizeof(head);
+ *pos++ = fileversion;
+ fixpos = (u32*)pos;
+ *(u32*)pos = 0x12345678; // to be overwritten
+ pos += 4;
+ writeRECT(&pos, &box);
+ *(u16*)pos = 0x2000; // framerate
+ pos += 2;
+ *(u16*)pos = numslaves;
+ pos += 2;
+ for(t=0;t<numslaves;t++)
+ {
+ char buf[128];
+ int namelen;
+
+ if(1) {
+ sprintf(buf, "Frame%02d", t);
+ slave_name[t] = strdup(buf);
+ }
+ namelen = strlen(slave_name[t]);
+
+ *(u16*)&pos[0] = (u16)(TAGID_DEFINESPRITE<<6) + 6;
+ *(u16*)&pos[2] = t+1; //ID
+ *(u16*)&pos[4] = 0; // Frames
+ *(u16*)&pos[6] = 0; // TAG1
+ *(u16*)&pos[8] = (u16)(TAGID_PLACEOBJECT2<<6) + 6 + namelen;
+ *(u16*)&pos[10]= 34; //flags: id+name
+ *(u16*)&pos[11]= 1; // depth
+ *(u16*)&pos[13]= t+1; // id
+ sprintf(&pos[15],slave_name[t]);
+ pos += 15 + namelen + 1;
+ *(u16*)&pos[0]= (u16)(TAGID_SHOWFRAME<<6) + 0;
+ pos += 2;
+ if(t!=numslaves-1)
+ {
+ *(u16*)&pos[0]= (u16)(TAGID_REMOVEOBJECT2<<6) + 2;
+ *(u16*)&pos[2]= 1; // depth;
+ pos += 4;
+ }
+ }
+ *(u16*)pos = TAGID_END<<6 + 0;
+ *masterlength = pos - *masterdata;
+ *fixpos = *masterlength;
+}
+
+struct config_t config;
+int main(int argn, char *argv[])
+{
+ FILE*fi;
+ u8*masterdata;
+ unsigned int masterlength;
+ u8*slavedata;
+ unsigned int slavelength;
+ u8*newdata;
+ unsigned int newlength;
+ int t;
+
+ config.overlay = 0;
+ config.alloctest = 0;
+ config.clip = 0;
+ config.loglevel = 2;
+ config.movex = 0;
+ config.movey = 0;
+ config.scalex = 1.0;
+ config.scaley = 1.0;
+ config.stack = 0;
+
+ processargs(argn, argv);
+ initLog(0,-1,0,0,-1,config.loglevel);
+
+ if(config.stack) {
+
+ if(config.overlay) {
+ logf("<error> Can't combine -l and -t");
+ exit(1);
+ }
+ if(config.clip) {
+ logf("<error> Can't combine -c and -t");
+ exit(1);
+ }
+ logf("<verbose> (stacking) %d files found\n", numslaves);
+
+ makestackmaster(&masterdata,&masterlength);
+
+ logf("<verbose> Generated %d bytes of master data", masterlength);
+ }
+ else {
+ logf("<verbose> master entity %s (named \"%s\")\n", master_filename, master_name);
+ fi = fopen(master_filename, "rb");
+ if(!fi) {
+ fprintf(stderr, "Failed to open %s\n", master_filename);
+ return 1;
+ }
+ masterdata = fi_slurp(fi, &masterlength);
+ if(!masterdata) {
+ fprintf(stderr, "Failed to read from %s\n", master_filename);
+ return 1;
+ }
+ logf("<debug> Read %d bytes from masterfile\n", masterlength);
+ fclose(fi);
+ }
+
+ for(t=0;t<numslaves;t++)
+ logf("<verbose> slave entity(%d) %s (named \"%s\")\n", t+1, slave_filename[t], slave_name[t]);
+
+ if (config.alloctest)
+ {
+ int*bitmap = malloc(sizeof(int)*65536);
+ memset(bitmap, -1, 65536*sizeof(int));
+ memset(bitmap, 1, 101*sizeof(int));
+ swf_relocate(masterdata, masterlength, bitmap);
+ newdata = masterdata;
+ newlength = masterlength;
+ free(bitmap);
+ }
+ else
+ {
+ if (!numslaves)
+ {
+ logf("<error> You must have at least one slave entity.");
+ return 0;
+ }
+ for(t = 0; t < numslaves; t++)
+ {
+ config.movex = slave_movex[t];
+ config.movey = slave_movey[t];
+ config.scalex = slave_scalex[t];
+ config.scaley = slave_scaley[t];
+
+ logf("<notice> Combine [%s]%s and [%s]%s", master_name, master_filename,
+ slave_name[t], slave_filename[t]);
+ fi = fopen(slave_filename[t], "rb");
+ if(!fi) {
+ fprintf(stderr, "Failed to open %s\n", slave_filename[t]);
+ return 1;
+ }
+ slavedata = fi_slurp(fi, &slavelength);
+ if(!slavedata) {
+ fprintf(stderr, "Failed to read from %s\n", slave_filename[t]);
+ return 1;
+ }
+ logf("<debug> Read %d bytes from slavefile\n", slavelength);
+ fclose(fi);
+
+ newdata = combine(masterdata, masterlength, slave_name[t], slavedata, slavelength, &newlength);
+ if(!newdata) {
+ logf("<fatal> Aborting.");
+ return 1;
+ }
+
+ free(masterdata);
+ masterdata = newdata;
+ masterlength = newlength;
+ }
+ }
+
+ logf("<debug> New File is %d bytes \n", newlength);
+ if(newdata && newlength) {
+ FILE*fi = fopen(outputname, "wb");
+ fi_dump(fi, newdata, newlength);
+ fclose(fi);
+ }
+ return 0;
+}
+
diff --git a/src/swfdump.1 b/src/swfdump.1
new file mode 100644
index 00000000..0918cb16
--- /dev/null
+++ b/src/swfdump.1
@@ -0,0 +1,23 @@
+.TH swfdump "1" "October 2001" "swfdump" "swftools"
+.SH NAME
+swfdump - a tool for displaying information about flash files
+.SH Synopsis
+.B swfdump
+[\fIoptions\fR] [\fIfile.swf\fR]
+.SH DESCRIPTION
+swfdump shows ids, names and depths of objects defined in the SWF file.
+.PP
+SWF files are animation files which can be displayed in Web Browsers using
+the Flash Plugin.
+.SH OPTIONS
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Print short help message and exit
+.\".TP
+.\" \fB\-\-version\fR
+.\" Print version info and exit
+
+.SH AUTHOR
+
+Matthias Kramm <kramm@quiss.org>
+
diff --git a/src/swfdump.c b/src/swfdump.c
new file mode 100644
index 00000000..fc9fda1b
--- /dev/null
+++ b/src/swfdump.c
@@ -0,0 +1,109 @@
+/* swfdump.c
+ Shows the structure of a swf file
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#include <stdio.h>
+#include <fcntl.h>
+#include "../lib/rfxswf.h"
+#include "args.h"
+
+char * filename = 0;
+
+/* idtab stores the ids which are defined in the file. This allows us
+ to detect errors in the file. (i.e. ids which are defined more than
+ once */
+char idtab[65536];
+
+int args_callback_option(char*name,char*val)
+{
+}
+int args_callback_longoption(char*name,char*val)
+{
+}
+void args_callback_usage(char*name)
+{
+ printf("Usage: %s file.swf\n", name);
+ printf("\n");
+}
+int args_callback_command(char*name,char*val)
+{
+ if(filename) {
+ fprintf(stderr, "Only one file allowed. You supplied at least two. (%s and %s)\n",
+ filename, name);
+ }
+ filename = name;
+ return 0;
+}
+
+int main (int argc,char ** argv)
+{
+ SWF swf;
+ TAG*tag;
+ int f;
+ char prefix[128];
+ prefix[0] = 0;
+ memset(idtab,0,65536);
+
+ processargs(argc, argv);
+
+ f = open(filename,O_RDONLY);
+
+ if (f<0)
+ {
+ perror("Couldn't open file: ");
+ exit(1);
+ }
+ if FAILED(ReadSWF(f,&swf))
+ {
+ fprintf(stderr,"%s is not a valid SWF file or contains errors.\n",filename);
+ close(f);
+ exit(1);
+ }
+ close(f);
+
+ tag = swf.FirstTag;
+
+ while(tag) {
+ printf("[%02x] %s%s", tag->id, prefix, getTagName(tag));
+ if(isDefiningTag(tag)) {
+ U16 id = GetDefineID(tag);
+ printf(" defines id %04x", id);
+ if(idtab[id])
+ fprintf(stderr, "Error: Id %04x is defined more than once.\n", id);
+ idtab[id] = 1;
+ }
+ else if(tag->id == ST_PLACEOBJECT ||
+ tag->id == ST_PLACEOBJECT2) {
+ printf(" places id %04x at depth %04x", GetPlaceID(tag), GetDepth(tag));
+ if(GetName(tag))
+ printf(" name \"%s\"",GetName(tag));
+ }
+ else if(tag->id == ST_REMOVEOBJECT) {
+ printf(" removes id %04x from depth %04x", GetPlaceID(tag), GetDepth(tag));
+ }
+ else if(tag->id == ST_REMOVEOBJECT2) {
+ printf(" removes object from depth %04x", GetDepth(tag));
+ }
+
+ printf("\n");
+
+ if(tag->id == ST_DEFINESPRITE)
+ {
+ sprintf(prefix, " ");
+ }
+ if(tag->id == ST_END)
+ {
+ sprintf(prefix, "");
+ }
+ tag = tag->next;
+ }
+
+ FreeTags(&swf);
+ return 0;
+}
+
diff --git a/src/swfstrings.1 b/src/swfstrings.1
new file mode 100644
index 00000000..0ab12a7b
--- /dev/null
+++ b/src/swfstrings.1
@@ -0,0 +1,24 @@
+.TH swfstrings "1" "October 2001" "swfstrings" "swftools"
+.SH NAME
+swfstrings - a tool for extracting text out of swf files.
+.SH Synopsis
+.B swfstrings
+[\fIoptions\fR] [\fIfile.swf\fR]
+.SH DESCRIPTION
+swfstrings extracts text out of DEFINETEXT tags of the .swf file. It also
+displays the fonts being used.
+.PP
+SWF files are animation files which can be displayed in Web Browsers using
+the Flash Plugin.
+.SH OPTIONS
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Print short help message and exit
+.\".TP
+.\" \fB\-\-version\fR
+.\" Print version info and exit
+
+.SH AUTHOR
+
+Rainer Böhme <rfxswf@reflex-studio.de>
+
diff --git a/src/swfstrings.c b/src/swfstrings.c
new file mode 100644
index 00000000..2bf1d9a8
--- /dev/null
+++ b/src/swfstrings.c
@@ -0,0 +1,54 @@
+/* swfstrings.c
+ Scans a swf file for strings
+
+ Part of the swftools package.
+
+ Copyright (c) 2000,2001 Rainer Böhme <rfxswf@reflex-studio.de>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#include <stdio.h>
+#include <fcntl.h>
+#include "../lib/rfxswf.h"
+
+SWF swf;
+
+void fontcallback(U16 id,U8 * name)
+{ LPSWFFONT font;
+ LPTAG t;
+
+ FontExtract(&swf,id,&font);
+ printf("#< %s %s %s>\n",name,FontIsBold(font)?"bold":"",FontIsItalic(font)?"italic":"");
+
+ t = swf.FirstTag;
+
+ while (t)
+ { TextPrintDefineText(t,font);
+ t = NextTag(t);
+ }
+
+ FontFree(font);
+}
+
+int main (int argc,char ** argv)
+{ int f;
+
+ if (argc>1)
+ { f = open(argv[1],O_RDONLY);
+ if (f>=0)
+ { if FAILED(ReadSWF(f,&swf))
+ { fprintf(stderr,"%s is not a valid SWF file or contains errors.\n",argv[1]);
+ close(f);
+ }
+ else
+ { close(f);
+ FontEnumerate(&swf,&fontcallback);
+ FreeTags(&swf);
+ }
+ } else fprintf(stderr,"File not found: %s\n",argv[1]);
+ }
+ else fprintf(stderr,"\nreflex SWF Text Scan Utility\n(w) 2000 by Rainer Boehme <rb@reflex-studio.de>\n\nUsage: %s filename.swf\n", argv[0]);
+
+ return 0;
+}
+
diff --git a/src/types.h b/src/types.h
new file mode 100644
index 00000000..a5b540d7
--- /dev/null
+++ b/src/types.h
@@ -0,0 +1,33 @@
+/* types.h
+ Some typedefs to make life simpler. If this file causes you problems, you might
+ try to remove all #include "types.h" and live with what configure does define.
+
+ Part of the swftools package.
+
+ Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
+
+ This file is distributed under the GPL, see file COPYING for details */
+
+#ifndef __types_h__
+#define __types_h__
+typedef long unsigned w32;
+typedef short unsigned w16;
+typedef unsigned char u8;
+typedef signed char s8;
+typedef short unsigned u16;
+typedef short signed s16;
+typedef long unsigned u32;
+typedef long signed s32;
+typedef long long unsigned u64;
+typedef long long signed s64;
+typedef unsigned char byte;
+typedef unsigned char uchar;
+typedef signed char sbyte;
+typedef unsigned short int word;
+typedef signed short int sword;
+typedef unsigned long int dword;
+typedef signed long int sdword;
+typedef signed short int integer;
+typedef signed long int longint;
+typedef long double extended;
+#endif // __types_h__
diff --git a/stamp-h.in b/stamp-h.in
new file mode 100644
index 00000000..9788f702
--- /dev/null
+++ b/stamp-h.in
@@ -0,0 +1 @@
+timestamp