pax_global_header00006660000000000000000000000064134106250410014506gustar00rootroot0000000000000052 comment=f48a74b507b82fe3bfbd34764a1e29b11ca7656f fntsample-release-5.3/000077500000000000000000000000001341062504100147645ustar00rootroot00000000000000fntsample-release-5.3/.travis.yml000066400000000000000000000006161341062504100171000ustar00rootroot00000000000000sudo: false dist: trusty language: c compiler: - gcc - clang addons: apt: packages: - gawk - libcairo2-dev - unicode-data - libglib2.0-dev - pkg-config - libfreetype6-dev - libpango1.0-dev - gettext - cmake script: - mkdir build - cd build - cmake .. -DCMAKE_C_FLAGS=-Werror - make VERBOSE=1 - ./fntsample --help - make DESTDIR=tmp install - ls -lR tmp fntsample-release-5.3/CMakeLists.txt000066400000000000000000000047561341062504100175400ustar00rootroot00000000000000cmake_minimum_required(VERSION 3.0) project(fntsample C) set(CMAKE_C_STANDARD 99) include(CheckCCompilerFlag) include(GNUInstallDirs) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") find_package(PkgConfig REQUIRED) find_package(Intl REQUIRED) find_package(Gettext REQUIRED) find_package(Iconv REQUIRED) pkg_check_modules(pkgs REQUIRED cairo fontconfig freetype2 glib-2.0 pangocairo>=1.16 pangoft2) find_program(AWK NAMES gawk awk mawk) if(NOT AWK) message(FATAL_ERROR "awk is required to build the program but was not found.") endif() find_file(UNICODE_BLOCKS Blocks.txt PATHS /usr/share/unicode DOC "Unicode blocks file" NO_DEFAULT_PATH) if(NOT UNICODE_BLOCKS) message(FATAL_ERROR "Unicode blocks file (Blocks.txt) not found. \ Use -DUNICODE_BLOCKS= to specify location of this file. \ Blocks.txt file is available at Unicode site: http://unicode.org/Public/UNIDATA/Blocks.txt" ) endif() string(TIMESTAMP DATE "%Y-%m-%d" UTC) set(CMAKE_REQUIRED_FLAGS -Wl,--as-needed) check_c_compiler_flag("" HAVE_AS_NEEDED) #empty because we are testing a linker flag if(HAVE_AS_NEEDED) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") endif() add_compile_options(-Wall -W -Wwrite-strings -Wstrict-prototypes -pedantic) configure_file(config.h.in config.h @ONLY) configure_file(fntsample.1.in fntsample.1 @ONLY) configure_file(pdfoutline.1.in pdfoutline.1 @ONLY) configure_file(pdfoutline.pl pdfoutline @ONLY) include_directories(fntsample ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${Intl_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${pkgs_INCLUDE_DIRS} ) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/unicode_blocks.c COMMAND ${AWK} -f genblocks.awk ${UNICODE_BLOCKS} > ${CMAKE_CURRENT_BINARY_DIR}/unicode_blocks.c DEPENDS ${UNICODE_BLOCKS} genblocks.awk WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} VERBATIM ) set(SOURCES fntsample.c read_blocks.c unicode_blocks.h ${CMAKE_CURRENT_BINARY_DIR}/unicode_blocks.c ${CMAKE_CURRENT_BINARY_DIR}/config.h ) add_executable(fntsample ${SOURCES}) target_link_libraries(fntsample m ${Intl_LIBRARIES} ${Iconv_LIBRARIES} ${pkgs_LIBRARIES} ) install(TARGETS fntsample DESTINATION ${CMAKE_INSTALL_BINDIR}) install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/pdfoutline" DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES "${PROJECT_BINARY_DIR}/fntsample.1" "${PROJECT_BINARY_DIR}/pdfoutline.1" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") add_subdirectory(po) fntsample-release-5.3/COPYING000066400000000000000000001043741341062504100160300ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. 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 them 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 prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. 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. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU 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 that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. 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. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 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. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. 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 state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 3 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, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program 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, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU 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 Lesser General Public License instead of this License. But first, please read . fntsample-release-5.3/ChangeLog000066400000000000000000000053151341062504100165420ustar00rootroot00000000000000Changes in version 5.3 * Support reproducible builds with PDF output (Khaled Hosny) Changes in version 5.2 * Fix handling of non-ASCII characters in pdfoutline Changes in version 5.1 * Make writing outlines with Cairo actually work * Fix typos Changes in version 5.0 * Add command line flag that allows to use pango for text layout (by Khaled Hosny, requires pango >= 1.37) * Add possiblility to create PDF outline directly using cairo (by Khaled Hosny, requires cairo >= 1.15.4) * Switch to CMake as build system * Add command line flag for loading Unicode blocks file during runtime. Changes in version 4.1: * Detect iconv and add LIBICONV to LDADD * Detect support for -Wl,--as-needed in configure * Those changes fix compilation on OS X Changes in version 4.0: * Add a --no-embed option * Fix broken handling of font names Changes in version 3.2: * Add support for SVG output (works correctly only for single page output) Changes in version 3.1: * Add support for files that contain multiple fonts, like TrueType Collections (.ttc) * Link with libm to avoid compilation failure with gold linker * Use silent-rules feature of automake 1.11 Changes in version 3.0: * Make it buildable with mawk again. * Switch to GPLv3. * Added localization support using gettext. * Added Ukrainian translation. * Added font scaling for fonts with large vertical metrics, to better work with fonts like TibetanMachine Changes in version 2.8: * It is now possible to use file Blocks.txt with dos line endings, like in zipped Unicode 5.1 UCD. Changes in version 2.7: * configure now checks for pangocairo >= 1.16, older pango does not have pango_layout_get_line_readonly() required by fntsample * Fixed crash (segmentation fault) with some values for -i (and maybe -x) Changes in version 2.6: * pango is now used for drawing headers and numbers in font samples * Font sizes are now tunable using "--style" option. Default font size for digits was made smaller for better look with fonts containing glyphs outside BMP Changes in version 2.5: * Added support for compiling with non-default fontconfig location * Added support for long options * Made some optimizations to text layout, this should make generated PDFs smaller * Added options for selecting Unicode ranges to include in samples (-i and -x) Changes in version 2.4: * Added script for making pdf files with bookmarks (pdfoutline) and option for fntsample to print bookmarks information (-l). pdfoutline requires perl and PDF::API2 library Changes in version 2.3: * Added "#include " to get definition of getopt() Changes in version 2.2: * Added support for fonts other than TrueType/OpenType * Improved errors handling fntsample-release-5.3/Messages.sh000077500000000000000000000010051341062504100170660ustar00rootroot00000000000000#! /bin/sh # Run this file to update message catalogs under po/ # # This file is in the public domain. set -e XGETTEXT="xgettext --keyword=_ --keyword=N_ --keyword=__ --keyword=__x --default-domain=fntsample --add-comments=TRANSLATORS: --foreign-user --package-name fntsample --msgid-bugs-address=eugen@debian.org" MSGMERGE="msgmerge --backup=none --update --verbose" ${XGETTEXT} fntsample.c read_blocks.c pdfoutline.pl -o po/fntsample.pot for po_file in po/*.po do ${MSGMERGE} ${po_file} po/fntsample.pot done fntsample-release-5.3/README.rst000066400000000000000000000047731341062504100164660ustar00rootroot00000000000000fntsample ========= |build| |license| .. |build| image:: https://travis-ci.org/eugmes/fntsample.svg?branch=master :target: https://travis-ci.org/eugmes/fntsample .. |license| image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg :alt: License: GPL v3 :target: https://www.gnu.org/licenses/gpl-3.0 ``fntsample`` is a tool that can be used to make font samples that show coverage of the font and are similar in appearance to `Unicode Charts `_. It was developed for use with `DejaVu Fonts `_ project. ``fntsample`` is licensed under `GPL `_ version 3 or later. .. image:: screenshot.png :alt: Output example Features -------- * Support for various font formats using `FreeType `_ library, including TrueType, OpenType, and Type1. * Creating samples in PDF, PostScript, and SVG formats. * Adding outlines with Unicode block names for PDF samples. * Selection of code ranges to show in charts. * Comparing of two font files with highlighting of added glyphs. * Runs on Linux and other Unix-like systems. Download -------- Releases are available from `releases page `_. For source code releases for versions before 5.0 visit the `old project page `_. The source code and issues tracker are accessible via the `project page `_. Building -------- The following libraries are required to build ``fntsample``: `cairo `_, `fontconfig `_, `FreeType2 `_, `GLib `_, `Pango `_. They should be available in most Linux distributions. Additionally Unicode `blocks `_ file is required. `CMake `_ is used to build the code. In the directory with source code execute:: % mkdir build % cd build % cmake .. -DUNICODE_BLOCKS=/path/to/Blocks.txt % make % make install The last step will install files under ``/usr/local`` by default. This can be overridden by adding ``-DCMAKE_INSTALL_PREFIX=/another/prefix`` to the ``cmake`` invocation. Usage ----- The basic usage for ``fntsample`` looks as follows:: % fntsample -f /file/to/font/file.ttf -o output.pdf For more advanced usage consult the man pages for ``fntsample`` and ``pdfoutline``. fntsample-release-5.3/cmake/000077500000000000000000000000001341062504100160445ustar00rootroot00000000000000fntsample-release-5.3/cmake/FindIconv.cmake000066400000000000000000000012741341062504100207310ustar00rootroot00000000000000find_path(Iconv_INCLUDE_DIR NAMES "iconv.h" DOC "iconv include directory") mark_as_advanced(Iconv_INCLUDE_DIR) find_library(Iconv_LIBRARY iconv libiconv libiconv-2 c DOC "iconv library") mark_as_advanced(Iconv_LIBRARY) include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Iconv FOUND_VAR Iconv_FOUND REQUIRED_VARS Iconv_INCLUDE_DIR FAIL_MESSAGE "Failed to find libiconv") if(Iconv_FOUND) set(Iconv_INCLUDE_DIRS "${Iconv_INCLUDE_DIR}") if(Iconv_LIBRARY) set(Iconv_LIBRARIES "${Iconv_LIBRARY}") else() unset(Iconv_LIBRARIES) endif() endif() fntsample-release-5.3/config.h.in000066400000000000000000000001321341062504100170030ustar00rootroot00000000000000#define PACKAGE "@CMAKE_PROJECT_NAME@" #define LOCALEDIR "@CMAKE_INSTALL_FULL_LOCALEDIR@" fntsample-release-5.3/fntsample.1.in000066400000000000000000000113431341062504100174460ustar00rootroot00000000000000.\" -*- nroff -*- .TH fntsample 1 @DATE@ .SH NAME fntsample \- PDF and PostScript font samples generator \" macros .de SAMPLE .br .RS .nf .nh .. .de ESAMPLE .hy .fi .RE .. .SH SYNOPSIS .B fntsample .BI "[ " OPTIONS " ]" .BI "\-f " FONT-FILE " \-o " OUTPUT-FILE .br .B fntsample \-h .SH DESCRIPTION .B fntsample program can be used to generate font samples that show Unicode coverage of the font and are similar in appearance to Unicode charts. Samples can be saved into PDF (default) or PostScript file. .SH OPTIONS .B fntsample supports the following options. .TP .BI "\-\-blocks\-file, \-b " BLOCKS-FILE Read Unicode blocks information from .IR BLOCKS-FILE . .TP .BI "\-\-font\-file, \-f " FONT-FILE Make samples of .IR FONT-FILE . .TP .BI "\-\-font\-index, \-n " IDX Font index for \fIFONT-FILE\fP specified using \fB\-\-font\-file\fP option. Useful for files that contain multiple fonts, like TrueType Collections (.ttc). By default font with index 0 is used. .TP .BI "\-\-output\-file, \-o " OUTPUT-FILE Write output to .IR OUTPUT-FILE . .TP .BI "\-\-other\-font\-file, \-d " OTHER-FONT Compare .I FONT-FILE with .IR OTHER-FONT . Glyphs added to .I FONT-FILE will be highlighted. .TP .BI "\-\-other\-index, \-m " IDX Font index for \fIOTHER-FONT\fP specified using \fB\-\-other\-font\-file\fP option. .TP .BI "\-\-postscript\-output, \-s" Use PostScript format for output instead of PDF. .TP .BI "\-\-svg, \-g" Use SVG format for output. The generated document contains one page. Use range selection options to specify which. .TP .BI "\-\-print\-outline, \-l" Print document outlines data to standard output. This data can be used to add outlines (aka bookmarks) to resulting PDF file with \fBpdfoutline\fP program. .TP .BI "\-\-write\-outline, \-w" Write document outlines directly (only in PDF output), requires \fBcairo\fP >= 1.15.4. .TP .BI "\-\-use\-pango, \-p" Use Pango for drawing glyph cells. Pango applies OpenType layout which may be more bullet proof than just relaying on the font's cmap. This especially important for fonts that rely on OpenType layout for showing even the base forms of the glyphs. .TP .BI "\-\-include\-range, \-i " RANGE Show characters in \fIRANGE\fP. .TP .BI "\-\-exclude\-range, \-x " RANGE Do not show characters in \fIRANGE\fP. .TP .BI "\-\-style, \-t \(dq" STYLE ": " VAL "\(dq" Set \fISTYLE\fP to value \fIVAL\fP. Run \fBfntsample\fP with option \fB\-\-help\fP to see list of styles and default values. .TP .BI "\-\-no\-embed, \-e" Draw the outlines of the glyphs instead of embedding them in the PDF file. This can be used when embedding the font is not desired or not allowed. .TP .BI "\-\-help, \-h" Display help text and exit. .P Parameter \fIRANGE\fP for \fB\-i\fP and \fB\-x\fP can be given as one integer or a pair of integers delimited by minus sign (\-). Integers can be specified in decimal, hexadecimal (0x...) or octal (0...) format. One integer of a pair can be missing (\-N can be used to specify all characters with codes less or equal to N, and N\- for all characters with codes greather or equal to N). Multiple \fB\-i\fP and \fB\-x\fP options can be used. .SH COLORS Glyph cells can have one of several background colors. Meaning of those colors is following: .TP .B white normal glyph present in the font, this includes space glyphs that are usually invisible; .TP .B gray this glyph is defined in Unicode but not present in the font; .TP .B blue this is a control character; .TP .B black this glyph is not defined in Unicode; .TP .B yellow this is a new glyph (only when used with \fB\-d\fP). .SH ENVIRONMENT .TP .B SOURCE_DATE_EPOCH If $\fBSOURCE_DATE_EPOCH\fP is set, its value is interpreted as Unix timestamp to be used for creation date of generated PDF files. This is useful for making builds that use \fBfntsample\fP reproducible. .SH EXAMPLES .RI "Make PDF samples for " font.ttf " and write them to file " samples.pdf : .SAMPLE fntsample \-f font.ttf \-o samples.pdf .ESAMPLE .PP .RI "Make PDF samples for " font.ttf ", compare it with " oldfont.ttf .RI "and highlight new glyphs. Write output to file " samples.pdf : .SAMPLE fntsample \-f font.ttf \-d oldfont.ttf \-o samples.pdf .ESAMPLE .PP .RI "Make PostScript samples for " font.ttf " and write output to file " samples.ps . Show only glyphs for characters with codes less or equal to U+04FF but exclude U+0370\-U+03FF: .SAMPLE fntsample \-f font.ttf \-s \-o samples.ps \-i \-0x04FF \-x 0x0370\-0x03FF .ESAMPLE .PP .RI "Make PDF samples for " font.ttf " and save output to file " samples.pdf " adding outlines to it:" .SAMPLE fntsample \-f font.ttf \-o temp.pdf \-l > outlines.txt pdfoutline temp.pdf outlines.txt samples.pdf .ESAMPLE .SH AUTHOR Copyright \(co 2007-2017 Eugeniy Meshcheryakov .br Homepage: .SH SEE ALSO .PP .BR pdfoutline (1) fntsample-release-5.3/fntsample.c000066400000000000000000000732161341062504100171320ustar00rootroot00000000000000/* Copyright © 2007-2010 Євгеній Мещеряков * * 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 3 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, see . */ #include #include #include FT_FREETYPE_H #include FT_SFNT_NAMES_H #include FT_TRUETYPE_IDS_H #include FT_TYPE1_TABLES_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "unicode_blocks.h" #include "config.h" #if PANGO_VERSION_CHECK(1,37,0) #define CAN_DRAW_WITH_PANGO #endif #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,15,4) #define CAN_USE_CAIRO_OUTLINES #endif #define _(str) gettext(str) #define A4_WIDTH (8.3*72) #define A4_HEIGHT (11.7*72) #define xmin_border (72.0/1.5) #define ymin_border (72.0) #define cell_width ((A4_WIDTH - 2*xmin_border) / 16) #define cell_height ((A4_HEIGHT - 2*ymin_border) / 16) #define CELL_X(x_min, N) ((x_min) + cell_width * ((N) / 16)) #define CELL_Y(N) (ymin_border + cell_height * ((N) % 16)) static struct option longopts[] = { {"blocks-file", 1, 0, 'b'}, {"font-file", 1, 0, 'f'}, {"output-file", 1, 0, 'o'}, {"help", 0, 0, 'h'}, {"other-font-file", 1, 0, 'd'}, {"postscript-output", 0, 0, 's'}, {"svg", 0, 0, 'g'}, {"print-outline", 0, 0, 'l'}, {"write-outline", 0, 0, 'w'}, {"include-range", 1, 0, 'i'}, {"exclude-range", 1, 0, 'x'}, {"style", 1, 0, 't'}, {"font-index", 1, 0, 'n'}, {"other-index", 1, 0, 'm'}, {"no-embed", 0, 0, 'e'}, {"use-pango", 0, 0, 'p'}, {0, 0, 0, 0} }; struct range { uint32_t first; uint32_t last; bool include; struct range *next; }; static const char *font_file_name; static const char *other_font_file_name; static const char *output_file_name; static bool postscript_output; static bool svg_output; static bool print_outline; static bool write_outline; static bool no_embed; static bool use_pango; static struct range *ranges; static struct range *last_range; static int font_index; static int other_index; struct fntsample_style { const char *const name; const char *const default_val; char *val; }; static struct fntsample_style styles[] = { { "header-font", "Sans Bold 12", NULL }, { "font-name-font", "Serif Bold 12", NULL }, { "table-numbers-font", "Sans 10", NULL }, { "cell-numbers-font", "Mono 8", NULL }, { NULL, NULL, NULL } }; static PangoFontDescription *header_font; static PangoFontDescription *font_name_font; static PangoFontDescription *table_numbers_font; static PangoFontDescription *cell_numbers_font; static double cell_label_offset; static double cell_glyph_bot_offset; static double glyph_baseline_offset; static double font_scale; static const struct unicode_block *unicode_blocks; static void usage(const char *); static struct fntsample_style *find_style(const char *name) { struct fntsample_style *style = styles; for (; style->name; style++) { if (!strcmp(name, style->name)) return style; } return NULL; } static int set_style(const char *name, const char *val) { struct fntsample_style *style; char *new_val; style = find_style(name); if (!style) return -1; new_val = strdup(val); if (!new_val) return -1; if (style->val) free(style->val); style->val = new_val; return 0; } static const char *get_style(const char *name) { struct fntsample_style *style = find_style(name); if (!style) return NULL; return style->val ? style->val : style->default_val; } static int parse_style_string(char *s) { char *n; n = strchr(s, ':'); if (!n) return -1; *n++ = '\0'; return set_style(s, n); } /* * Update output range. * * Returns -1 on error. */ static int add_range(char *range, bool include) { struct range *r; uint32_t first = 0, last = 0xffffffff; char *minus; char *endptr; minus = strchr(range, '-'); if (minus) { if (minus != range) { *minus = '\0'; first = strtoul(range, &endptr, 0); if (*endptr) return -1; } if (*(minus + 1)) { last = strtoul(minus + 1, &endptr, 0); if (*endptr) return -1; } else if (minus == range) return -1; } else { first = strtoul(range, &endptr, 0); if (*endptr) return -1; last = first; } if (first > last) return -1; r = malloc(sizeof(*r)); if (!r) return -1; r->first = first; r->last = last; r->include = include; r->next = NULL; if (ranges) last_range->next = r; else ranges = r; last_range = r; return 0; } /* * Check if character with the given code belongs * to output range specified by the user. */ static bool in_range(uint32_t c) { bool in = ranges ? (!ranges->include) : 1; struct range *r; for (r = ranges; r; r = r->next) { if ((c >= r->first) && (c <= r->last)) in = r->include; } return in; } /* * Get glyph index for the next glyph from the given font face, that * represents character from output range specified by the user. * * Returns character code, updates 'idx'. * 'idx' can became 0 if there are no more glyphs. */ static FT_ULong get_next_char(FT_Face face, FT_ULong charcode, FT_UInt *idx) { FT_ULong rval = charcode; do { rval = FT_Get_Next_Char(face, rval, idx); } while (*idx && !in_range(rval)); return rval; } /* * Locate first character from the given font face that belongs * to the user-specified output range. * * Returns character code, updates 'idx' with glyph index. * Glyph index can became 0 if there are no matching glyphs in the font. */ static FT_ULong get_first_char(FT_Face face, FT_UInt *idx) { FT_ULong rval; rval = FT_Get_First_Char(face, idx); if (*idx && !in_range(rval)) rval = get_next_char(face, rval, idx); return rval; } /* * Create Pango layout for the given text. * Updates 'r' with text extents. * Returned layout should be freed using g_object_unref(). */ static PangoLayout *layout_text(cairo_t *cr, PangoFontDescription *ftdesc, const char *text, PangoRectangle *r) { PangoLayout *layout; layout = pango_cairo_create_layout (cr); pango_layout_set_font_description(layout, ftdesc); pango_layout_set_text(layout, text, -1); pango_layout_get_extents(layout, r, NULL); return layout; } static void parse_options(int argc, char * const argv[]) { for (;;) { int c; int n; c = getopt_long(argc, argv, "b:f:o:hd:sglwi:x:t:n:m:ep", longopts, NULL); if (c == -1) break; switch (c) { case 'b': if (unicode_blocks) { fprintf(stderr, _("Unicode blocks file should be given at most once!\n")); exit(1); } unicode_blocks = read_blocks(optarg, &n); if (n == 0) { fprintf(stderr, _("Failed to load any blocks from the blocks file!\n")); exit(6); } break; case 'f': if (font_file_name) { fprintf(stderr, _("Font file name should be given only once!\n")); exit(1); } font_file_name = optarg; break; case 'o': if (output_file_name) { fprintf(stderr, _("Output file name should be given only once!\n")); exit(1); } output_file_name = optarg; break; case 'h': usage(argv[0]); exit(0); break; case 'd': if (other_font_file_name) { fprintf(stderr, _("Font file name should be given only once!\n")); exit(1); } other_font_file_name = optarg; break; case 's': postscript_output = true; break; case 'g': svg_output = true; break; case 'l': print_outline = true; break; case 'w': write_outline = true; #ifndef CAN_USE_CAIRO_OUTLINES fprintf(stderr, _("Cairo >= 1.15.4 is required for this option!\n")); exit(1); #endif break; case 'i': case 'x': if (add_range(optarg, c == 'i')) { usage(argv[0]); exit(1); } break; case 't': if (parse_style_string(optarg) == -1) { usage(argv[0]); exit(1); } break; case 'n': font_index = atoi(optarg); break; case 'm': other_index = atoi(optarg); break; case 'e': no_embed = true; break; case 'p': #ifdef CAN_DRAW_WITH_PANGO use_pango = true; #else fprintf(stderr, _("Pango >= 1.37 is required for this option!\n")); exit(1); #endif break; case '?': default: usage(argv[0]); exit(1); break; } } if (!font_file_name || !output_file_name) { usage(argv[0]); exit(1); } if (font_index < 0 || other_index < 0) { fprintf(stderr, _("Font index should be non-negative!\n")); exit(1); } if (postscript_output && svg_output) { fprintf(stderr, _("-s and -g cannot be used together!\n")); exit(1); } if (!unicode_blocks) unicode_blocks = static_unicode_blocks; } /* * Locate unicode block that contains given character code. * Returns this block or NULL if not found. */ static const struct unicode_block *get_unicode_block(unsigned long charcode) { const struct unicode_block *block; for (block = unicode_blocks; block->name; block++) { if ((charcode >= block->start) && (charcode <= block->end)) return block; } return NULL; } /* * Check if the given character code belongs to the given Unicode block. */ static bool is_in_block(unsigned long charcode, const struct unicode_block *block) { return ((charcode >= block->start) && (charcode <= block->end)); } /* * Format and print/write outline information, if requested by the user. */ static void outline(cairo_surface_t *surface, int level, int page, const char *text) { if (print_outline) printf("%d %d %s\n", level, page, text); #ifdef CAN_USE_CAIRO_OUTLINES if (write_outline && cairo_surface_get_type(surface) == CAIRO_SURFACE_TYPE_PDF) { char *dest = NULL; int len = 0; len = snprintf(dest, 0, "page=%d", page); dest = malloc(len + 1); sprintf(dest, "page=%d", page); cairo_pdf_surface_add_outline(surface, level, text, dest, CAIRO_PDF_OUTLINE_FLAG_OPEN); } #else (void)surface; #endif } /* * Draw header of a page. * Header shows font name and current Unicode block. */ static void draw_header(cairo_t *cr, const char *face_name, const char *block_name) { PangoLayout *layout; PangoRectangle r; layout = layout_text(cr, font_name_font, face_name, &r); cairo_move_to(cr, (A4_WIDTH - (double)r.width/PANGO_SCALE)/2.0, 30.0); pango_cairo_show_layout_line(cr, pango_layout_get_line_readonly(layout, 0)); g_object_unref(layout); layout = layout_text(cr, header_font, block_name, &r); cairo_move_to(cr, (A4_WIDTH - (double)r.width/PANGO_SCALE)/2.0, 50.0); pango_cairo_show_layout_line(cr, pango_layout_get_line_readonly(layout, 0)); g_object_unref(layout); } /* * Highlight the cell with given coordinates. * Used to highlight new glyphs. */ static void highlight_cell(cairo_t *cr, double x, double y) { cairo_save(cr); cairo_set_source_rgb(cr, 1.0, 1.0, 0.6); cairo_rectangle(cr, x, y, cell_width, cell_height); cairo_fill(cr); cairo_restore(cr); } /* * Try to place glyph with the given index at the middle of the cell. * Changes argument 'glyph' */ static void position_glyph(cairo_t *cr, double x, double y, unsigned long idx, cairo_glyph_t *glyph) { cairo_text_extents_t extents; *glyph = (cairo_glyph_t){idx, 0, 0}; cairo_glyph_extents(cr, glyph, 1, &extents); glyph->x += x + (cell_width - extents.width)/2.0 - extents.x_bearing; glyph->y += y + glyph_baseline_offset; } /* * Draw table grid with row and column numbers. */ static void draw_grid(cairo_t *cr, unsigned int x_cells, unsigned long block_start) { unsigned int i; double x_min = (A4_WIDTH - x_cells * cell_width) / 2; double x_max = (A4_WIDTH + x_cells * cell_width) / 2; char buf[17]; PangoLayout *layout; PangoRectangle r; #define TABLE_H (A4_HEIGHT - ymin_border * 2) cairo_set_line_width(cr, 1.0); cairo_rectangle(cr, x_min, ymin_border, x_max - x_min, TABLE_H); cairo_move_to(cr, x_min, ymin_border); cairo_line_to(cr, x_min, ymin_border - 15.0); cairo_move_to(cr, x_max, ymin_border); cairo_line_to(cr, x_max, ymin_border - 15.0); cairo_stroke(cr); cairo_set_line_width(cr, 0.5); /* draw horizontal lines */ for (i = 1; i < 16; i++) { cairo_move_to(cr, x_min, 72.0 + i * TABLE_H/16); cairo_line_to(cr, x_max, 72.0 + i * TABLE_H/16); } /* draw vertical lines */ for (i = 1; i < x_cells; i++) { cairo_move_to(cr, x_min + i * cell_width, ymin_border); cairo_line_to(cr, x_min + i * cell_width, A4_HEIGHT - ymin_border); } cairo_stroke(cr); /* draw glyph numbers */ buf[1] = '\0'; #define hexdigs "0123456789ABCDEF" for (i = 0; i < 16; i++) { buf[0] = hexdigs[i]; layout = layout_text(cr, table_numbers_font, buf, &r); cairo_move_to(cr, x_min - (double)PANGO_RBEARING(r)/PANGO_SCALE - 5.0, 72.0 + (i+0.5) * TABLE_H/16 + (double)PANGO_DESCENT(r)/PANGO_SCALE/2); pango_cairo_show_layout_line(cr, pango_layout_get_line_readonly(layout, 0)); cairo_move_to(cr, x_min + x_cells * cell_width + 5.0, 72.0 + (i+0.5) * TABLE_H/16 + (double)PANGO_DESCENT(r)/PANGO_SCALE/2); pango_cairo_show_layout_line(cr, pango_layout_get_line_readonly(layout, 0)); g_object_unref(layout); } for (i = 0; i < x_cells; i++) { snprintf(buf, sizeof(buf), "%03lX", block_start / 16 + i); layout = layout_text(cr, table_numbers_font, buf, &r); cairo_move_to(cr, x_min + i*cell_width + (cell_width - (double)r.width/PANGO_SCALE)/2, ymin_border - 5.0); pango_cairo_show_layout_line(cr, pango_layout_get_line_readonly(layout, 0)); g_object_unref(layout); } } /* * Fill empty cell. Color of the fill depends on the character properties. */ static void fill_empty_cell(cairo_t *cr, double x, double y, unsigned long charcode) { cairo_save(cr); if (g_unichar_isdefined(charcode)) { if (g_unichar_iscntrl(charcode)) cairo_set_source_rgb(cr, 0.0, 0.0, 0.5); else cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); } cairo_rectangle(cr, x, y, cell_width, cell_height); cairo_fill(cr); cairo_restore(cr); } /* * Draw label with character code. */ static void draw_charcode(cairo_t *cr, double x, double y, FT_ULong charcode) { char buf[9]; PangoLayout *layout; PangoRectangle r; snprintf(buf, sizeof(buf), "%04lX", charcode); layout = layout_text(cr, cell_numbers_font, buf, &r); cairo_move_to(cr, x + (cell_width - (double)r.width/PANGO_SCALE)/2.0, y + cell_height - cell_label_offset); pango_cairo_show_layout_line(cr, pango_layout_get_line_readonly(layout, 0)); g_object_unref(layout); } /* * Draws tables for all characters in the given Unicode block. * Use font described by face and ft_face. Start from character * with given charcode (it should belong to the given Unicode * block). After return 'charcode' equals the last character code * of the block. * * Returns number of pages drawn. */ static int draw_unicode_block(cairo_t *cr, cairo_scaled_font_t *font, FT_Face ft_face, const char *fontname, unsigned long *charcode, const struct unicode_block *block, FT_Face ft_other_face) { FT_UInt idx; unsigned long prev_charcode; unsigned long prev_cell; int npages = 0; #ifdef CAN_DRAW_WITH_PANGO FcConfig *fc_config = NULL; PangoFontMap *fontmap = NULL; PangoContext *context = NULL; PangoLayout *layout = NULL; PangoFontDescription *font_desc = NULL; if (use_pango) { fc_config = FcConfigCreate(); FcConfigAppFontAddFile(fc_config, (FcChar8 *) font_file_name); fontmap = pango_cairo_font_map_new_for_font_type(CAIRO_FONT_TYPE_FT); pango_fc_font_map_set_config(PANGO_FC_FONT_MAP(fontmap), fc_config); context = pango_font_map_create_context(fontmap); pango_cairo_update_context (cr, context); font_desc = pango_font_description_new(); layout = pango_layout_new (context); pango_layout_set_font_description(layout, font_desc); pango_layout_set_width(layout, cell_width * PANGO_SCALE); pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER); } #endif idx = FT_Get_Char_Index(ft_face, *charcode); do { unsigned long offset = ((*charcode - block->start) / 0x100) * 0x100; unsigned long tbl_start = block->start + offset; unsigned long tbl_end = tbl_start + 0xFF > block->end ? block->end + 1 : tbl_start + 0x100; unsigned int rows = (tbl_end - tbl_start) / 16; double x_min = (A4_WIDTH - rows * cell_width) / 2; unsigned long i; bool filled_cells[256]; /* 16x16 glyphs max */ /* XXX WARNING: not reentrant! */ static cairo_glyph_t glyphs[256]; unsigned int nglyphs = 0; cairo_save(cr); draw_header(cr, fontname, block->name); prev_cell = tbl_start - 1; memset(filled_cells, '\0', sizeof(filled_cells)); if (!use_pango) cairo_set_scaled_font(cr, font); /* * Fill empty cells and calculate coordinates of the glyphs. * Also highlight cells if needed. */ do { /* the current glyph position in the table */ int charpos = *charcode - tbl_start; /* fill empty cells before the current glyph */ for (i = prev_cell + 1; i < *charcode; i++) { int pos = i - tbl_start; fill_empty_cell(cr, CELL_X(x_min, pos), CELL_Y(pos), i); } /* if it is new glyph - highlight the cell */ if (ft_other_face && !FT_Get_Char_Index(ft_other_face, *charcode)) highlight_cell(cr, CELL_X(x_min, charpos), CELL_Y(charpos)); /* For now just position glyphs. They will be shown later, * to make output more efficient. */ if (!use_pango) { position_glyph(cr, CELL_X(x_min, charpos), CELL_Y(charpos), idx, &glyphs[nglyphs++]); } else { #ifdef CAN_DRAW_WITH_PANGO char buf[9]; gint len; double baseline; len = g_unichar_to_utf8((gunichar) *charcode, buf); pango_layout_set_text(layout, buf, len); baseline = pango_layout_get_baseline (layout) / PANGO_SCALE; cairo_move_to(cr, CELL_X(x_min, charpos), CELL_Y(charpos) + glyph_baseline_offset - baseline); if (no_embed) pango_cairo_layout_path(cr, layout); else pango_cairo_show_layout(cr, layout); #endif } filled_cells[charpos] = true; prev_charcode = *charcode; prev_cell = *charcode; *charcode = get_next_char(ft_face, *charcode, &idx); } while (idx && (*charcode < tbl_end) && is_in_block(*charcode, block)); /* Fill remaining empty cells */ for (i = prev_cell + 1; i < tbl_end; i++) { int pos = i - tbl_start; fill_empty_cell(cr, CELL_X(x_min, pos), CELL_Y(pos), i); } /* Show previously positioned glyphs */ if (!use_pango) { if (no_embed) { cairo_save(cr); cairo_glyph_path (cr, glyphs, nglyphs); cairo_fill(cr); cairo_restore(cr); } else { cairo_show_glyphs(cr, glyphs, nglyphs); } } for (i = 0; i < tbl_end - tbl_start; i++) if (filled_cells[i]) draw_charcode(cr, CELL_X(x_min, i), CELL_Y(i), i + tbl_start); draw_grid(cr, rows, tbl_start); npages++; cairo_show_page(cr); cairo_restore(cr); } while (idx && is_in_block(*charcode, block)); #ifdef CAN_DRAW_WITH_PANGO if (use_pango) { g_object_unref(layout); g_object_unref(context); g_object_unref(fontmap); pango_font_description_free(font_desc); FcConfigDestroy(fc_config); } #endif *charcode = prev_charcode; return npages; } /* * The main drawing function. */ static void draw_glyphs(cairo_t *cr, cairo_scaled_font_t *font, FT_Face ft_face, const char *fontname, FT_Face ft_other_face) { FT_ULong charcode; FT_UInt idx; const struct unicode_block *block; int pageno = 1; cairo_surface_t *surface = cairo_get_target(cr); outline(surface, 0, pageno, fontname); charcode = get_first_char(ft_face, &idx); while (idx) { block = get_unicode_block(charcode); if (block) { int npages; outline(surface, 1, pageno, block->name); npages = draw_unicode_block(cr, font, ft_face, fontname, &charcode, block, ft_other_face); pageno += npages; } charcode = get_next_char(ft_face, charcode, &idx); } } /* * Print usage instructions and default values for styles */ static void usage(const char *cmd) { const struct fntsample_style *style; fprintf(stderr, _("Usage: %s [ OPTIONS ] -f FONT-FILE -o OUTPUT-FILE\n" " %s -h\n\n") , cmd, cmd); fprintf(stderr, _("Options:\n" " --blocks-file, -b BLOCKS-FILE Read Unicode blocks information from BLOCKS-FILE\n" " --font-file, -f FONT-FILE Create samples of FONT-FILE\n" " --font-index, -n IDX Font index in FONT-FILE\n" " --output-file, -o OUTPUT-FILE Save samples to OUTPUT-FILE\n" " --help, -h Show this information message and exit\n" " --other-font-file, -d OTHER-FONT Compare FONT-FILE with OTHER-FONT and highlight added glyphs\n" " --other-index, -m IDX Font index in OTHER-FONT\n" " --postscript-output, -s Use PostScript format for output instead of PDF\n" " --svg, -g Use SVG format for output\n" " --print-outline, -l Print document outlines data to standard output\n" " --write-outline, -w Write document outlines (only in PDF output)\n" " --no-embed, -e Don't embed the font in the output file, draw the glyphs instead\n" " --use-pango -p Use Pango for drawing glyph cells\n" " --include-range, -i RANGE Show characters in RANGE\n" " --exclude-range, -x RANGE Do not show characters in RANGE\n" " --style, -t \"STYLE: VAL\" Set STYLE to value VAL\n")); fprintf(stderr, _("\nSupported styles (and default values):\n")); for (style = styles; style->name; style++) fprintf(stderr, "\t%s (%s)\n", style->name, style->default_val); } /* * Try to get font name for a given font face. * Returned name should be free()'d after use. * If function cannot allocate memory, it terminates the program. */ static const char *get_font_name(FT_Face face) { FT_Error error; char *fontname = NULL; /* try SFNT format */ unsigned num_names = FT_Get_Sfnt_Name_Count(face); iconv_t u16to8 = iconv_open("UTF-8", "UTF-16BE"); for (unsigned i = 0; i < num_names; i++) { FT_SfntName name; error = FT_Get_Sfnt_Name(face, i, &name); if (error) continue; if (name.name_id == TT_NAME_ID_FULL_NAME && name.platform_id == TT_PLATFORM_MICROSOFT && name.encoding_id == TT_MS_ID_UNICODE_CS) { fontname = malloc(name.string_len * 2 + 1); char *bufptr = fontname; size_t inbytes = name.string_len; size_t outbytes = name.string_len * 2; if (iconv(u16to8, (char**)&name.string, &inbytes, &bufptr, &outbytes) == (size_t)-1) continue; *bufptr = '\0'; } } iconv_close(u16to8); if (fontname) return fontname; /* try Type1 format */ PS_FontInfoRec fontinfo; error = FT_Get_PS_Font_Info(face, &fontinfo); if (!error) { if (fontinfo.full_name) { fontname = strdup(fontinfo.full_name); if (!fontname) { perror("strdup"); exit(1); } return fontname; } } /* fallback */ const char *family_name = face->family_name ? face->family_name : "Unknown"; const char *style_name = face->style_name ? face->style_name : ""; size_t len = strlen(family_name) + strlen(style_name) + 1/* for space */; fontname = malloc(len + 1); if (!fontname) { perror("malloc"); exit(1); } sprintf(fontname, "%s %s", family_name, style_name); return fontname; } /* * Initialize fonts used to print table heders and character codes. */ static void init_pango_fonts(void) { /* FIXME is this correct? */ PangoCairoFontMap *map = (PangoCairoFontMap *) pango_cairo_font_map_get_default(); pango_cairo_font_map_set_resolution(map, 72.0); header_font = pango_font_description_from_string(get_style("header-font")); font_name_font = pango_font_description_from_string(get_style("font-name-font")); table_numbers_font = pango_font_description_from_string(get_style("table-numbers-font")); cell_numbers_font = pango_font_description_from_string(get_style("cell-numbers-font")); } /* * Calculate various offsets. */ static void calculate_offsets(cairo_t *cr) { PangoRectangle extents; /* Assume that vertical extents does not depend on actual text */ PangoLayout *l = layout_text(cr, cell_numbers_font, "0123456789ABCDEF", &extents); g_object_unref(l); /* Unsolved mistery of pango's font metrics.... */ double digits_ascent = pango_units_to_double(PANGO_DESCENT(extents)); double digits_descent = -pango_units_to_double(PANGO_ASCENT(extents)); cell_label_offset = digits_descent + 2; cell_glyph_bot_offset = cell_label_offset + digits_ascent + 2; } /* * Create cairo scaled font with the best size (hopefuly...) */ static cairo_scaled_font_t *create_default_font(FT_Face ft_face) { cairo_font_face_t *cr_face = cairo_ft_font_face_create_for_ft_face(ft_face, 0); cairo_matrix_t font_matrix; cairo_matrix_t ctm; cairo_font_options_t *options = cairo_font_options_create(); cairo_scaled_font_t *cr_font; cairo_font_extents_t extents; /* First create font with size 1 and measure it */ cairo_matrix_init_identity(&font_matrix); cairo_matrix_init_identity(&ctm); /* Turn off rounding, so we can get real metrics */ cairo_font_options_set_hint_metrics(options, CAIRO_HINT_METRICS_OFF); cr_font = cairo_scaled_font_create(cr_face, &font_matrix, &ctm, options); cairo_scaled_font_extents(cr_font, &extents); /* Use some magic to find the best font size... */ double tgt_size = cell_height - cell_glyph_bot_offset - 2; if (tgt_size <= 0) { fprintf(stderr, _("Not enough space for rendering glyphs. Make cell font smaller.\n")); exit(5); } double act_size = extents.ascent + extents.descent; if (act_size <= 0) { fprintf(stderr, _("The font has strange metrics: ascent + descent = %g\n"), act_size); exit(5); } font_scale = tgt_size / act_size; if (font_scale > 1) font_scale = trunc(font_scale); // just to make numbers nicer if (font_scale > 20) font_scale = 20; // Do not make font larger than in previous versions cairo_scaled_font_destroy(cr_font); /* Create the font once again, but this time scaled */ cairo_matrix_init_scale(&font_matrix, font_scale, font_scale); cr_font = cairo_scaled_font_create(cr_face, &font_matrix, &ctm, options); cairo_scaled_font_extents(cr_font, &extents); glyph_baseline_offset = (tgt_size - (extents.ascent + extents.descent)) / 2 + 2 + extents.ascent; return cr_font; } int main(int argc, char **argv) { cairo_surface_t *surface; cairo_t *cr; FT_Error error; FT_Library library; FT_Face face, other_face = NULL; const char *fontname; /* full name of the font */ cairo_status_t cr_status; cairo_scaled_font_t *cr_font; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); parse_options(argc, argv); error = FT_Init_FreeType(&library); if (error) { /* TRANSLATORS: 'freetype' is a name of a library, and should be left untranslated */ fprintf(stderr, _("%s: freetype error\n"), argv[0]); exit(3); } error = FT_New_Face(library, font_file_name, font_index, &face); if (error) { fprintf(stderr, _("%s: failed to open font file %s\n"), argv[0], font_file_name); exit(4); } fontname = get_font_name(face); if (other_font_file_name) { error = FT_New_Face(library, other_font_file_name, other_index, &other_face); if (error) { fprintf(stderr, _("%s: failed to create new font face\n"), argv[0]); exit(4); } } if (postscript_output) surface = cairo_ps_surface_create(output_file_name, A4_WIDTH, A4_HEIGHT); else if (svg_output) surface = cairo_svg_surface_create(output_file_name, A4_WIDTH, A4_HEIGHT); else { surface = cairo_pdf_surface_create(output_file_name, A4_WIDTH, A4_HEIGHT); /* A4 paper */ #ifdef CAN_USE_CAIRO_OUTLINES char buffer[25]; char *endptr; char *source_date_epoch; unsigned long long epoch; time_t now; struct tm *build_time; source_date_epoch = getenv("SOURCE_DATE_EPOCH"); if (source_date_epoch) { errno = 0; epoch = strtoull(source_date_epoch, &endptr, 10); if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0)) || (errno != 0 && epoch == 0)) { fprintf(stderr, _("Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n"), strerror(errno)); exit(1); } if (endptr == source_date_epoch) { fprintf(stderr, _("Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n"), endptr); exit(1); } if (*endptr != '\0') { fprintf(stderr, _("Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n"), endptr); exit(1); } if (epoch > ULONG_MAX) { fprintf(stderr, _("Environment variable $SOURCE_DATE_EPOCH: must be <= %lu but saw: %llu\n"), ULONG_MAX, epoch); exit(1); } now = (time_t)epoch; build_time = gmtime(&now); strftime(buffer, 25, "%Y-%m-%dT%H:%M:%S%z", build_time); cairo_pdf_surface_set_metadata(surface, CAIRO_PDF_METADATA_CREATE_DATE, buffer); } #endif } cr_status = cairo_surface_status(surface); if (cr_status != CAIRO_STATUS_SUCCESS) { /* TRANSLATORS: 'cairo' is a name of a library, and should be left untranslated */ fprintf(stderr, _("%s: failed to create cairo surface: %s\n"), argv[0], cairo_status_to_string(cr_status)); exit(1); } cr = cairo_create(surface); cr_status = cairo_status(cr); if (cr_status != CAIRO_STATUS_SUCCESS) { fprintf(stderr, _("%s: cairo_create failed: %s\n"), argv[0], cairo_status_to_string(cr_status)); exit(1); } cairo_surface_destroy(surface); init_pango_fonts(); calculate_offsets(cr); cr_font = create_default_font(face); cr_status = cairo_scaled_font_status(cr_font); if (cr_status != CAIRO_STATUS_SUCCESS) { fprintf(stderr, _("%s: failed to create scaled font: %s\n"), argv[0], cairo_status_to_string(cr_status)); exit(1); } cairo_set_source_rgb(cr, 0.0, 0.0, 0.0); draw_glyphs(cr, cr_font, face, fontname, other_face); cairo_destroy(cr); return 0; } fntsample-release-5.3/genblocks.awk000066400000000000000000000007711341062504100174440ustar00rootroot00000000000000# This file is in public domain # Author: Eugeniy Meshcheryakov BEGIN { print "#include \"unicode_blocks.h\"" print "" print "const struct unicode_block static_unicode_blocks[] = {" } /^[^#]/ { if (split($0, a, /\.\.|; /) == 3) { # remove any ^M characters, like ones in dos line breaks # NOTE: gsub() is used because mawk does not support gensub() gsub(/\r/, "", a[3]) print "\t{0x" a[1] ", 0x" a[2] ", \"" a[3] "\"},"; } } END { print "\t{0, 0, NULL}," print "};" } fntsample-release-5.3/pdfoutline.1.in000066400000000000000000000027211341062504100176260ustar00rootroot00000000000000.\" -*- nroff -*- .TH pdfoutline 1 @DATE@ .SH NAME pdfoutline \- add outlines (aka bookmarks) to PDF files \" macros .de SAMPLE .br .RS .nf .nh .. .de ESAMPLE .hy .fi .RE .. .SH SYNOPSIS .B pdfoutline .I input.pdf outlines.txt output.pdf .SH DESCRIPTION \fBpdfoutline\fP reads input file given as first argument, adds outlines from text file given as second argument, and saves result to file with name given as third argument. .P File with outlines information should consist of lines in the following format: .SAMPLE \fI\fP \fI\fP Outline text .ESAMPLE .P \fI\fP and \fI\fP should be integers. Each field should be separated by exactly one space symbol. All values for \fI\fP should be greater or equal than that of the first line. Page numeration starts with 1. .P Outlines file can contain comments that start with # in first column. Comments and empty lines are ignored. The text is expected to be in UTF-8 encoding. .SH OPTIONS .B pdfoutline accepts no options. .SH EXAMPLES Here is example of outlines data file: .SAMPLE 0 1 Document title 1 1 Chapter 1 2 1 Chapter 1.1 2 2 Chapter 1.2 1 3 Chapter 2 .ESAMPLE .P Using this file will result in outlines like the following: .SAMPLE Document title +-Chapter 1 | +-Chapter 1.1 | +-Chapter 1.2 +-Chapter 2 .ESAMPLE .SH AUTHOR .B pdfoutline author is Eugeniy Meshcheryakov .br \fBpdfoutline\fP is part of \fBfntsample\fP and can be downoaded from . fntsample-release-5.3/pdfoutline.pl000077500000000000000000000051171341062504100175010ustar00rootroot00000000000000#! /usr/bin/perl -w # This file is in public domain # Author: Eugeniy Meshcheryakov # # This program adds outlines to pdf files. # Usage: pdfoutline input.pdf outline.txt out.pdf # # File given as second argument should contain outline information in # form: # # Some text # # where and are integers. Values for should be greater # or equal than that of first line. Page numeration starts with 1. # # Outlines file can contain comments that start with # in first column. Comments # and empty lines are ignored. # # Example file: # 0 1 Document title # 1 1 Chapter 1 # 2 1 Chapter 1.1 # 2 2 Chapter 1.2 # 1 3 Chapter 2 # # This file will result in outline like the following: # # Document title # +-Chapter 1 # | +-Chapter 1.1 # | +-Chapter 1.2 # +-Chapter 2 use strict; use PDF::API2; use Locale::TextDomain('@CMAKE_PROJECT_NAME@', '@CMAKE_INSTALL_FULL_LOCALEDIR@'); use POSIX qw(:locale_h); use Encode qw(encode); use subs qw(add_outlines); sub usage() { printf(__"Usage: %s input.pdf outline.txt out.pdf\n", $0); } # get first non-empty non-comment line sub get_line($) { my $F = shift; my $line; while ($line = <$F>) { chomp $line; # skip comments ... next if $line =~ /^#/; # ... and empty lines next if $line =~ /^$/; last; } return $line; } # Encode string to UTF-16BE with BOM if it contains non-ASCII characters sub encode_pdf_text($) { my $str = shift; if ($str !~ /[^[:ascii:]]/) { return $str; } else { return encode("UTF-16", $str); } } sub add_outlines($$$$) { my $pdf = shift; my $parent = shift; my $line = shift; my $F = shift; my $cur_outline; my ($level) = split / /, $line; MAINLOOP: while ($line) { my ($new_level, $page, $text) = split / /, $line, 3; if ($new_level > $level) { $line = add_outlines($pdf, $cur_outline, $line, $F); next MAINLOOP; } elsif ($new_level < $level) { return $line; } else { $cur_outline = $parent->outline; $cur_outline->title(encode_pdf_text($text)); # FIXME it should be posible to make it easier my $pdfpage = $pdf->{pagestack}->[$page - 1]; $cur_outline->dest($pdfpage); } $line = get_line($F); } } setlocale(LC_ALL, ''); if ($#ARGV != 2) { usage; exit 1; } my $inputfile = $ARGV[0]; my $outlinefile = $ARGV[1]; my $outputfile = $ARGV[2]; my $pdf = PDF::API2->open($inputfile); open(OUTLINE, "<:encoding(UTF-8)", $outlinefile) or die __x("Cannot open outline file '{outlinefile}'", outlinefile => $outlinefile); my $line = get_line(*OUTLINE); add_outlines($pdf, $pdf->outlines, $line, *OUTLINE) if $line; $pdf->saveas($outputfile); exit 0; fntsample-release-5.3/po/000077500000000000000000000000001341062504100154025ustar00rootroot00000000000000fntsample-release-5.3/po/CMakeLists.txt000066400000000000000000000014471341062504100201500ustar00rootroot00000000000000set(LANGUAGES uk) add_custom_target(pofiles) function(process_po_files _langs) foreach(_lang ${_langs}) set(_po_file "${CMAKE_CURRENT_SOURCE_DIR}/${_lang}.po") set(_gmo_file "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo") set(_gmo_file_tgt "${_lang}.gmo") add_custom_command(OUTPUT ${_gmo_file} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} ${_po_file} -o ${_gmo_file} DEPENDS ${_po_file} COMMENT "Compiling ${_lang}.po to ${_lang}.gmo" VERBATIM) install(FILES ${_gmo_file} DESTINATION "${CMAKE_INSTALL_LOCALEDIR}/${_lang}/LC_MESSAGES/" RENAME "${CMAKE_PROJECT_NAME}.mo") add_custom_target(${_gmo_file_tgt} ALL DEPENDS ${_gmo_file}) add_dependencies(pofiles ${_gmo_file_tgt}) endforeach() endfunction() process_po_files(${LANGUAGES}) fntsample-release-5.3/po/fntsample.pot000066400000000000000000000076021341062504100201240ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # This file is put in the public domain. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: fntsample\n" "Report-Msgid-Bugs-To: eugen@debian.org\n" "POT-Creation-Date: 2017-10-22 01:32+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: fntsample.c:331 #, c-format msgid "Unicode blocks file should be given at most once!\n" msgstr "" #: fntsample.c:337 #, c-format msgid "Failed to load any blocks from the blocks file!\n" msgstr "" #: fntsample.c:343 fntsample.c:361 #, c-format msgid "Font file name should be given only once!\n" msgstr "" #: fntsample.c:350 #, c-format msgid "Output file name should be given only once!\n" msgstr "" #: fntsample.c:378 #, c-format msgid "Cairo >= 1.15.4 is required for this option!\n" msgstr "" #: fntsample.c:408 #, c-format msgid "Pango >= 1.37 is required for this option!\n" msgstr "" #: fntsample.c:424 #, c-format msgid "Font index should be non-negative!\n" msgstr "" #: fntsample.c:428 #, c-format msgid "-s and -g cannot be used together!\n" msgstr "" #: fntsample.c:825 #, c-format msgid "" "Usage: %s [ OPTIONS ] -f FONT-FILE -o OUTPUT-FILE\n" " %s -h\n" "\n" msgstr "" #: fntsample.c:827 #, c-format msgid "" "Options:\n" " --blocks-file, -b BLOCKS-FILE Read Unicode blocks information from " "BLOCKS-FILE\n" " --font-file, -f FONT-FILE Create samples of FONT-FILE\n" " --font-index, -n IDX Font index in FONT-FILE\n" " --output-file, -o OUTPUT-FILE Save samples to OUTPUT-FILE\n" " --help, -h Show this information message and " "exit\n" " --other-font-file, -d OTHER-FONT Compare FONT-FILE with OTHER-FONT and " "highlight added glyphs\n" " --other-index, -m IDX Font index in OTHER-FONT\n" " --postscript-output, -s Use PostScript format for output " "instead of PDF\n" " --svg, -g Use SVG format for output\n" " --print-outline, -l Print document outlines data to " "standard output\n" " --write-outline, -w Write document outlines (only in PDF " "output)\n" " --no-embed, -e Don't embed the font in the output " "file, draw the glyphs instead\n" " --use-pango -p Use Pango for drawing glyph cells\n" " --include-range, -i RANGE Show characters in RANGE\n" " --exclude-range, -x RANGE Do not show characters in RANGE\n" " --style, -t \"STYLE: VAL\" Set STYLE to value VAL\n" msgstr "" #: fntsample.c:844 #, c-format msgid "" "\n" "Supported styles (and default values):\n" msgstr "" #: fntsample.c:972 #, c-format msgid "Not enough space for rendering glyphs. Make cell font smaller.\n" msgstr "" #: fntsample.c:977 #, c-format msgid "The font has strange metrics: ascent + descent = %g\n" msgstr "" #. TRANSLATORS: 'freetype' is a name of a library, and should be left untranslated #: fntsample.c:1016 #, c-format msgid "%s: freetype error\n" msgstr "" #: fntsample.c:1022 #, c-format msgid "%s: failed to open font file %s\n" msgstr "" #: fntsample.c:1031 #, c-format msgid "%s: failed to create new font face\n" msgstr "" #. TRANSLATORS: 'cairo' is a name of a library, and should be left untranslated #: fntsample.c:1046 #, c-format msgid "%s: failed to create cairo surface: %s\n" msgstr "" #: fntsample.c:1054 #, c-format msgid "%s: cairo_create failed: %s\n" msgstr "" #: fntsample.c:1066 #, c-format msgid "%s: failed to create scaled font: %s\n" msgstr "" #: pdfoutline.pl:41 #, perl-format msgid "Usage: %s input.pdf outline.txt out.pdf\n" msgstr "" #: pdfoutline.pl:102 #, perl-brace-format msgid "Cannot open outline file '{outlinefile}'" msgstr "" fntsample-release-5.3/po/uk.po000066400000000000000000000172771341062504100163770ustar00rootroot00000000000000# This file is put in the public domain. # # Євгеній Мещеряков , 2008. # Eugeniy Meshcheryakov , 2009, 2010, 2017. msgid "" msgstr "" "Project-Id-Version: fntsample\n" "Report-Msgid-Bugs-To: eugen@debian.org\n" "POT-Creation-Date: 2017-10-22 01:32+0200\n" "PO-Revision-Date: 2017-10-25 17:33+0100\n" "Last-Translator: Eugeniy Meshcheryakov \n" "Language-Team: Ukrainian <>\n" "Language: uk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 2.0\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<" "=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: fntsample.c:331 #, c-format msgid "Unicode blocks file should be given at most once!\n" msgstr "Файл блоків Unicode можна вказувати тільки один раз!\n" #: fntsample.c:337 #, c-format msgid "Failed to load any blocks from the blocks file!\n" msgstr "Не вдалося завантажити жодного блока з файлу блоків!\n" #: fntsample.c:343 fntsample.c:361 #, c-format msgid "Font file name should be given only once!\n" msgstr "Назву файлу шрифтів потрібно вказувати тільки один раз!\n" #: fntsample.c:350 #, c-format msgid "Output file name should be given only once!\n" msgstr "Назву файлу результату потрібно вказувати тільки один раз!\n" #: fntsample.c:378 #, c-format msgid "Cairo >= 1.15.4 is required for this option!\n" msgstr "Для цієї опції потрібно Cairo >= 1.15.4!\n" #: fntsample.c:408 #, c-format msgid "Pango >= 1.37 is required for this option!\n" msgstr "Для цієї опції потрібно Pango >= 1.37!\n" #: fntsample.c:424 #, c-format msgid "Font index should be non-negative!\n" msgstr "Індекс шрифту повинен бути ненегативним!\n" #: fntsample.c:428 #, c-format msgid "-s and -g cannot be used together!\n" msgstr "Не можна одночасно використовувати -s та -g!\n" #: fntsample.c:825 #, c-format msgid "" "Usage: %s [ OPTIONS ] -f FONT-FILE -o OUTPUT-FILE\n" " %s -h\n" "\n" msgstr "" "Використання: %s [ ОПЦІЇ ] -f ФАЙЛ-ШРИФТУ -o ФАЙЛ-РЕЗУЛЬТАТУ\n" " %s -h\n" "\n" #: fntsample.c:827 #, c-format msgid "" "Options:\n" " --blocks-file, -b BLOCKS-FILE Read Unicode blocks information from " "BLOCKS-FILE\n" " --font-file, -f FONT-FILE Create samples of FONT-FILE\n" " --font-index, -n IDX Font index in FONT-FILE\n" " --output-file, -o OUTPUT-FILE Save samples to OUTPUT-FILE\n" " --help, -h Show this information message and " "exit\n" " --other-font-file, -d OTHER-FONT Compare FONT-FILE with OTHER-FONT and " "highlight added glyphs\n" " --other-index, -m IDX Font index in OTHER-FONT\n" " --postscript-output, -s Use PostScript format for output " "instead of PDF\n" " --svg, -g Use SVG format for output\n" " --print-outline, -l Print document outlines data to " "standard output\n" " --write-outline, -w Write document outlines (only in PDF " "output)\n" " --no-embed, -e Don't embed the font in the output " "file, draw the glyphs instead\n" " --use-pango -p Use Pango for drawing glyph cells\n" " --include-range, -i RANGE Show characters in RANGE\n" " --exclude-range, -x RANGE Do not show characters in RANGE\n" " --style, -t \"STYLE: VAL\" Set STYLE to value VAL\n" msgstr "" "Опції:\n" " --blocks-file, -b ФАЙЛ-БЛОКІВ Читати інформацію про блоки Unicode" " з ФАЙЛУ-БЛОКІВ\n" " --font-file, -f ФАЙЛ-ШРИФТУ Створити зразки ФАЙЛУ-ШРИФТУ\n" " --font-index, -n ІНД Індекс шрифту в ФАЙЛІ-ШРИФТУ\n" " --output-file, -o ФАЙЛ-РЕЗУЛЬТАТУ Зберегти зразки в ФАЙЛ-РЕЗУЛЬТАТУ\n" " --help, -h Показати це інформаційне " "повідомлення і вийти\n" " --other-font-file, -d ІНШИЙ-ШРИФТ Порівняти цей ФАЙЛУ-ШРИФТУ з ІНШИМ-" "ШРИФТОМ і виділити додані символи\n" " --other-index, -m ІНД Індекс шрифту в ІНШОМУ-ШРИФТІ\n" " --postscript-output, -s Використовувати формат PostScript " "замість PDF\n" " --svg, -g Використовувати формат SVG\n" " --print-outline, -l Друкувати зміст документа на " "стандартний вивід\n" " --write-outline, -w Створити зміст документа (тільки " "для формату PDF)\n" " --no-embed, -e Не вбудовувати шрифти, натомість " "малювати символи\n" " --use-pango -p Використовувати Pango для " "креслення символів\n" " --include-range, -i ПРОМІЖОК Показати символи з ПРОМІЖКУ\n" " --exclude-range, -x ПРОМІЖОК Не показувати символи з ПРОМІЖКУ\n" " --style, -t \"СТИЛЬ: ЗНАЧ\" Встановити ЗНАЧЕННЯ СТИЛЮ\n" #: fntsample.c:844 #, c-format msgid "" "\n" "Supported styles (and default values):\n" msgstr "" "\n" "Підтримувані стилі (та значення за замовчанням):\n" #: fntsample.c:972 #, c-format msgid "Not enough space for rendering glyphs. Make cell font smaller.\n" msgstr "" "Недостатньо місця для відображення символів. Зробіть шрифт комірок меншим.\n" #: fntsample.c:977 #, c-format msgid "The font has strange metrics: ascent + descent = %g\n" msgstr "Шрифт має дивні метрики: ascent + descent = %g\n" #. TRANSLATORS: 'freetype' is a name of a library, and should be left untranslated #: fntsample.c:1016 #, c-format msgid "%s: freetype error\n" msgstr "%s: помилка freetype\n" #: fntsample.c:1022 #, c-format msgid "%s: failed to open font file %s\n" msgstr "%s: неможливо відкрити файл шрифту %s\n" #: fntsample.c:1031 #, c-format msgid "%s: failed to create new font face\n" msgstr "%s: неможливо створити новий шрифт\n" #. TRANSLATORS: 'cairo' is a name of a library, and should be left untranslated #: fntsample.c:1046 #, c-format msgid "%s: failed to create cairo surface: %s\n" msgstr "%s: неможливо створити нову поверхню cairo: %s\n" #: fntsample.c:1054 #, c-format msgid "%s: cairo_create failed: %s\n" msgstr "%s: помилка при виконанні cairo_create: %s\n" #: fntsample.c:1066 #, c-format msgid "%s: failed to create scaled font: %s\n" msgstr "%s: неможливо створити масштабований шрифт: %s\n" #: pdfoutline.pl:41 #, perl-format msgid "Usage: %s input.pdf outline.txt out.pdf\n" msgstr "Використання: %s оригінальний.pdf зміст.txt результат.pdf\n" #: pdfoutline.pl:102 #, perl-brace-format msgid "Cannot open outline file '{outlinefile}'" msgstr "Неможливо відкрити файл змісту '{outlinefile}'" fntsample-release-5.3/read_blocks.c000066400000000000000000000027011341062504100174000ustar00rootroot00000000000000#include "unicode_blocks.h" #include #include #include struct unicode_block *read_blocks(const char *file_name, int *n) { int nalloc = 256; struct unicode_block *blocks = calloc(nalloc, sizeof(struct unicode_block)); *n = 0; FILE *input_file = fopen(file_name, "r"); if (!input_file) { perror("fopen"); exit(7); } char *line = NULL; size_t len = 0; ssize_t nread; while ((nread = getline(&line, &len, input_file)) != -1) { unsigned long block_start, block_end; char block_name[256]; if (nread >= (ssize_t)sizeof(block_name)) continue; int matched = sscanf(line, "%lx..%lx; %[^\r\n]", &block_start, &block_end, block_name); if (matched == 3) { struct unicode_block *b = blocks + *n; b->start = block_start; b->end = block_end; b->name = strdup(block_name); if (b->name == NULL) { perror("strdup"); exit(8); } *n += 1; if (*n >= nalloc) { int new_nalloc = nalloc + 256; struct unicode_block *new_blocks = realloc(blocks, new_nalloc * sizeof(struct unicode_block)); if (new_blocks == NULL) { perror("realloc"); exit(9); } memset(new_blocks + nalloc, 0, (new_nalloc - nalloc) * sizeof(struct unicode_block)); nalloc = new_nalloc; blocks = new_blocks; } } } free(line); if (*n == 0) { free(blocks); return NULL; } else if (*n < nalloc) { blocks = realloc(blocks, *n * sizeof(struct unicode_block)); } return blocks; } fntsample-release-5.3/screenshot.png000066400000000000000000000567351341062504100176670ustar00rootroot00000000000000PNG  IHDR7pԛsRGB pHYs+tIME/)W IDATx}w\WeM@QP+Xņ+F^bO4ElX01`WD SPT "mYe찈1yu;3w= 0 B/47nSv0Q` ӞClQj7CE{X2wVh=Z֨(Ihh>@vphe7̝P^E^'le҈$2 /,]YM뢖)(H޾}kbbR^^njjjkkK[O޿_VV֣GZl]]]]]]KKˢN:x{l֭_xcǎN:UUUaFcg͚E{@ شiSvB)))GdZZZ={Rv'BQQQ}uss"RPYBЮ(mW(?Hb ð1cTTThήe˖UUU{H$`׮]!oo/DիWgff:::} ֭\qttx3g`cu| dv'i^䫲)(Yv,zF;͂ˮ!b}}wՅ[XXXYY G677q\$رcԨQ֭3gBHWW!󵵵***zə3g<ꚟAEE1bΝ;O%qU@cU,֝~eڱz@ (--۷o1bDPP R)ܶgooAD">6lG˨!$ɨ$UTTL0aРANpOLL>|8H߆Ae—@2P~CXnQۼy3,Whs`H:;iTWW=z&999,,l۶m/FyxxfeejժK.7oAAA-[СΝ;GGG'''wǏC!==?x <?sǎq z7|SZZ \]] lllڶmmiivʮL- 丼ts=\.8Nŋ/~vB J #A,P(pg1ˎ#8/hZ 9ʍY׮]߾}llq`=1j`#fƂ.2|Č>#pԋ65L0nʻWMc gÑ`q/PPkWv0Ke);oX,nڏ1P3ی2VkS`i\Ε.pp)Gp댲dk >iՐpBx~U,=1adƍ'N3gNdd${U 3Ǟ={&NHqTHv˩' L0a۶m(=ÜЊ ---1 #mE1Fi$?Mnf#ʿUmr1 ۿ?B֒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}rT*XɭJrt %TyAK&IR7II?&F1Q:~SAM)5*Gm\@2G1 {СC̙󣣣՝=RITLǛGq<""b,uMSW>dȐSE){Us7!RK*?}cl%7g#""aTK|ȥ3dȐ7oޘ_vtiT K/dΓZMwZQ>@܊Q V^mii9dU?޽{6lsxDXB[^~, `$E"QLLZ#XlY@@իo߾]]]M_X#W222/^sNYjjj͛7nܸ~ϗdZZZuuu#G\~}S ^~=j(X#>|PZZzy*# ,?{,""bڴiܵׯ:tѱ:$$dرbm۶ X|ȑׯ_C)r(ȭcoop‰'zxx8;;;V.3$i>;w]_HSm?;;`:b5MUWK&țA F/5"#V.E` J )\7l]<_;Y{xy=h!N>''';rĐ=t:1$?vl4?~[P?|ׯǎ|0իWkkk`4 $IzXW $ɣG ,//ooo{<V+|^RT*ޞ uqZ}-$YeZDzMMMMMMp8Uş4 R*].=|`0׮P( 0I/yx6@lб@  D"aKVYYWk )o6 ^]]]m2L&SMMMyyNUUב#86.fǏg.3͇uX c 6mcc3/dmӈ>`vaN4baIN4=q3ugffsO=`A&>ŕq  P*J$1 r۷o%ݱ"|i`0%%ɵX:nssB I}jQ*^Z]]MFx|N0ρX5z(*|P($b>!Ó kN+xb8qmiiYXXxܦּ^o}}}0(7]T S'OL&Νԭt:]WW{23͛wd2J˗/@HBLq{Gh)B!:jI%ixljtYdookzQԇL&_H<3FwqRɡ|>o3L.3LHhrHdss͛7X̙3<ޑBt:Ng*z%Ud*#& hqg),RF9zE{ZmZe\rH$:=k iIENDB`fntsample-release-5.3/unicode_blocks.h000066400000000000000000000006021341062504100201160ustar00rootroot00000000000000/* * This file is in public domain * Author: Eugeniy Meshcheryakov */ #ifndef UNICODE_BLOCKS_H #define UNICODE_BLOCKS_H #include struct unicode_block { unsigned long start; unsigned long end; const char *name; }; extern const struct unicode_block static_unicode_blocks[]; struct unicode_block *read_blocks(const char *file_name, int *n); #endif