pax_global_header00006660000000000000000000000064130007417120014505gustar00rootroot0000000000000052 comment=f82e945d8a30adb893f670155c62bef652e23048 master-0.7.3/000077500000000000000000000000001300074171200130075ustar00rootroot00000000000000master-0.7.3/COPYING000066400000000000000000001045131300074171200140460ustar00rootroot00000000000000 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 . master-0.7.3/Flags.mk000066400000000000000000000016411300074171200143760ustar00rootroot00000000000000 AM_VALAFLAGS = \ --target-glib 2.38 \ --pkg gmodule-2.0 \ --pkg glib-2.0 \ --pkg gio-2.0 \ --pkg gtk+-3.0 \ --pkg gee-0.8 \ --pkg json-glib-1.0 \ --pkg Gucharmap-2.90 \ --pkg libxml-2.0 \ --pkg pango \ --pkg sqlite3 AM_CFLAGS = \ -w \ -DLOCALEDIR=\""$(localedir)"\" \ $(XML_CFLAGS) \ $(FREETYPE_CFLAGS) \ $(FONTCONFIG_CFLAGS) \ $(GOBJECT_CFLAGS) \ $(GLIB_CFLAGS) \ $(GMODULE_CFLAGS) \ $(GIO_CFLAGS) \ $(CAIRO_CFLAGS) \ $(GTK_CFLAGS) \ $(PANGO_CFLAGS) \ $(PANGOCAIRO_CFLAGS) \ $(PANGOFT2_CFLAGS) \ $(GEE_CFLAGS) \ $(GUCHARMAP_CFLAGS) \ $(JSONGLIB_CFLAGS) \ $(SQLITE3_CFLAGS) AM_LDADD = \ -lm \ -lpthread \ $(XML_LIBS) \ $(FREETYPE_LIBS) \ $(FONTCONFIG_LIBS) \ $(GOBJECT_LIBS) \ $(GLIB_LIBS) \ $(GMODULE_LIBS) \ $(GIO_LIBS) \ $(CAIRO_LIBS) \ $(GTK_LIBS) \ $(PANGO_LIBS) \ $(PANGOCAIRO_LIBS) \ $(PANGOFT2_LIBS) \ $(GEE_LIBS) \ $(GUCHARMAP_LIBS) \ $(JSONGLIB_LIBS) \ $(SQLITE3_LIBS) master-0.7.3/INSTALL000066400000000000000000000366051300074171200140520ustar00rootroot00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands './configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. master-0.7.3/Makefile.am000066400000000000000000000031321300074171200150420ustar00rootroot00000000000000 SUBDIRS = \ data \ lib \ src \ tests \ extensions \ help \ po ACLOCAL_AMFLAGS = -I m4 CONFIG_STATUS_DEPENDENCIES = \ lib/UX/Utils/Utils.vala.in \ lib/FontConfig/Sources.vala.in \ lib/Common/About.vala.in \ lib/Common/Settings.vala.in \ lib/Common/Constants.vala.in \ lib/Common/Database.vala.in \ lib/Common/Collections.vala.in \ src/font-manager/Migration.vala.in \ src/font-manager/Application.vala.in \ src/font-manager/Main.vala.in \ src/font-viewer/Application.vala.in EXTRA_DIST = \ po/insert-header.sin \ po/Makefile.in.in \ po/HEADER \ po/POTFILES.in \ po/POTFILES.readme \ po/POTFILES.skip \ help/insert-header.sin \ help/HEADER \ Flags.mk DISTCLEANFILES = \ po/Makefile \ po/Makefile.in \ po/POTFILES \ po/*stamp* MAINTAINERCLEANFILES = \ aclocal.m4 \ compile \ config.guess \ config.sub \ configure \ depcomp \ install-sh \ ltmain.sh \ missing \ py-compile \ Makefile.in \ po/Makefile* \ po/POTFILES \ po/*stamp* update_pot_header = \ $(SED) -f insert-header.sin -i $1 && \ $(SED) -i 's/PACKAGE/${PACKAGE_NAME}/g' $1 && \ $(SED) -i 's/VERSION/${PACKAGE_VERSION}/g' $1 $(PACKAGE_NAME).pot: cd $(abs_top_srcdir)/po/ && \ rm -f $@ && \ $(MAKE) update-po && \ $(call update_pot_header,$@) && \ cd $(abs_top_srcdir)/help && \ rm -f $@ && \ $(MAKE) pot && \ $(call update_pot_header,$@) && \ $(MAKE) repo && \ cd $(abs_srcdir) maintainer-clean-local: -rm -rf m4 autom4te.cache $(PACKAGE_NAME)-$(PACKAGE_VERSION)* BUILD find . -name .libs -exec rm -rf {} \; find . -name .deps -exec rm -rf {} \; all: $(PACKAGE_NAME).pot .PHONY: $(PACKAGE_NAME).pot master-0.7.3/README000066400000000000000000000056161300074171200136770ustar00rootroot00000000000000 _____ _ __ __ | ___|__ _ __ | |_ | \/ | __ _ _ __ __ _ __ _ ___ _ __ | |_ / _ \| '_ \| __| | |\/| |/ _` | '_ \ / _` |/ _` |/ _ \ '__| | _| (_) | | | | |_ | | | | (_| | | | | (_| | (_| | __/ | |_| \___/|_| |_|\__| |_| |_|\__,_|_| |_|\__,_|\__, |\___|_| |___/ A simple font management application for GTK+ Desktop Environments |============================= Version 0.7.3 ==================================| Features that are expected to work at this time: Migration of fonts and collections from the previous version Font Previews Enabling / Disabling Fonts Creating / Deleting / Enabling / Disabling of Font Collections Font Installation - By drag and drop (Preferred method) - By using the file selector Note : Drag and drop should allow installation of not only individual font files but also entire directories and archives. The file selector unfortunately will not allow selection of directories. Font removal Note : Font Manager only allows for removal of fonts owned by the user and installed in the default user font directory. Removal of fonts owned by others is not supported. Removal of fonts installed elsewhere is not supported. Font directory monitoring Note : Font Manager should reload itself anytime fonts are installed or removed either through the application or any other method. Font Sources Adding / Removing font folders. Note : Fonts in these folders should be available for preview in the application even if they are not enabled system wide. Opening Font Files The application can be set as the default handler for font files. When called with the path to a font file it will launch a font viewer. The font viewer is very simple and is only intended for previewing and installing individual font files. File Manager Extensions When the font viewer is running you should be able to preview font files by simply selecting them in the file manager. To enable an extension pass --enable-pycompile --with-nautilus, --with-thunar or --with-nemo to configure. For more details and known issues see the README file in the extensions directory. Missing / Planned features : Help contents Character map details viewer Database search FontConfig editor - session-wide settings - per font settings - aliases (low priority) Exporting Collections - proof sheet - html? KNOWN ISSUES Some themes do not render as intended. This is a problem with the theme. Unless the issue also occurs when using Adwaita, or most other themes... master-0.7.3/autogen.sh000077500000000000000000000257731300074171200150260ustar00rootroot00000000000000#!/bin/sh # Run this to generate all the initial makefiles, etc. PKG_NAME=font-manager srcdir=`dirname $0` [ -z "$srcdir" ] && srcdir=. # default version requirements ... test "$REQUIRED_AUTOMAKE_VERSION" || REQUIRED_AUTOMAKE_VERSION=1.11.2 test "$REQUIRED_AUTORECONF_VERSION" || REQUIRED_AUTORECONF_VERSION=2.53 test "$REQUIRED_GLIB_GETTEXT_VERSION" || REQUIRED_GLIB_GETTEXT_VERSION=2.2.0 test "$REQUIRED_INTLTOOL_VERSION" || REQUIRED_INTLTOOL_VERSION=0.25 test "$REQUIRED_PKG_CONFIG_VERSION" || REQUIRED_PKG_CONFIG_VERSION=0.14.0 test "$REQUIRED_GTK_DOC_VERSION" || REQUIRED_GTK_DOC_VERSION=1.0 # a list of required m4 macros. Package can set an initial value test "$REQUIRED_M4MACROS" || REQUIRED_M4MACROS= # Not all echo versions allow -n, so we check what is possible. This test is # based on the one in autoconf. ECHO_C= ECHO_N= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ;; *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac # some terminal codes ... if tty 1>/dev/null 2>&1; then boldface="`tput bold 2>/dev/null`" normal="`tput sgr0 2>/dev/null`" else boldface= normal= fi printbold() { echo $ECHO_N "$boldface" $ECHO_C echo "$@" echo $ECHO_N "$normal" $ECHO_C } printerr() { echo "$@" >&2 } # Usage: # compare_versions MIN_VERSION ACTUAL_VERSION # returns true if ACTUAL_VERSION >= MIN_VERSION compare_versions() { ch_min_version=$1 ch_actual_version=$2 ch_status=0 IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="." set $ch_actual_version for ch_min in $ch_min_version; do ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes if [ -z "$ch_min" ]; then break; fi if [ -z "$ch_cur" ]; then ch_status=1; break; fi if [ $ch_cur -gt $ch_min ]; then break; fi if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi done IFS="$ch_save_IFS" return $ch_status } # Usage: # version_check PACKAGE VARIABLE CHECKPROGS MIN_VERSION SOURCE # checks to see if the package is available version_check() { vc_package=$1 vc_variable=$2 vc_checkprogs=$3 vc_min_version=$4 vc_source=$5 vc_status=1 local ${vc_variable}_VERSION vc_checkprog=`eval echo "\\$$vc_variable"` if [ -n "$vc_checkprog" ]; then printbold "using $vc_checkprog for $vc_package" return 0 fi printbold "checking for $vc_package >= $vc_min_version..." for vc_checkprog in $vc_checkprogs; do echo $ECHO_N " testing $vc_checkprog... " $ECHO_C if $vc_checkprog --version < /dev/null > /dev/null 2>&1; then vc_actual_version=`$vc_checkprog --version | head -n 1 | \ sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'` if compare_versions $vc_min_version $vc_actual_version; then echo "found $vc_actual_version" # set variables eval "$vc_variable=$vc_checkprog; \ ${vc_variable}_VERSION=$vc_actual_version" vc_status=0 break else echo "too old (found version $vc_actual_version)" fi else echo "not found." fi done if [ "$vc_status" != 0 ]; then printerr "***Error***: You must have $vc_package >= $vc_min_version installed" printerr " to build $PKG_NAME. Download the appropriate package for" printerr " from your distribution or get the source tarball at" printerr " $vc_source" printerr exit $vc_status fi return $vc_status } # Usage: # require_m4macro filename.m4 # adds filename.m4 to the list of required macros require_m4macro() { case "$REQUIRED_M4MACROS" in $1\ * | *\ $1\ * | *\ $1) ;; *) REQUIRED_M4MACROS="$REQUIRED_M4MACROS $1" ;; esac } # Usage: # add_to_cm_macrodirs dirname # Adds the dir to $cm_macrodirs, if it's not there yet. add_to_cm_macrodirs() { case $cm_macrodirs in "$1 "* | *" $1 "* | *" $1") ;; *) cm_macrodirs="$cm_macrodirs $1";; esac } # Usage: # print_m4macros_error # Prints an error message saying that autoconf macros were misused print_m4macros_error() { printerr "***Error***: some autoconf macros required to build $PKG_NAME" printerr " were not found in your aclocal path, or some forbidden" printerr " macros were found. Perhaps you need to adjust your" printerr " ACLOCAL_PATH?" printerr } # Usage: # check_m4macros # Checks that all the requested macro files are in the aclocal macro path # Uses REQUIRED_M4MACROS and ACLOCAL_PATH variables. check_m4macros() { # construct list of macro directories cm_macrodirs=`aclocal --print-ac-dir` # aclocal also searches a version specific dir, eg. /usr/share/aclocal-1.9 # but it contains only Automake's own macros, so we can ignore it. # Read the dirlist file if [ -s $cm_macrodirs/dirlist ]; then cm_dirlist=`sed 's/[ ]*#.*//;/^$/d' $cm_macrodirs/dirlist` if [ -n "$cm_dirlist" ] ; then for cm_dir in $cm_dirlist; do if [ -d $cm_dir ]; then add_to_cm_macrodirs $cm_dir fi done fi fi # Parse $ACLOCAL_PATH IFS="${IFS= }"; save_IFS="$IFS"; IFS=":" for dir in ${ACLOCAL_PATH}; do add_to_cm_macrodirs "$dir" done IFS="$save_IFS" cm_status=0 if [ -n "$REQUIRED_M4MACROS" ]; then printbold "Checking for required M4 macros..." # check that each macro file is in one of the macro dirs for cm_macro in $REQUIRED_M4MACROS; do cm_macrofound=false for cm_dir in $cm_macrodirs; do if [ -f "$cm_dir/$cm_macro" ]; then cm_macrofound=true break fi # The macro dir in Cygwin environments may contain a file # called dirlist containing other directories to look in. if [ -f "$cm_dir/dirlist" ]; then for cm_otherdir in `cat $cm_dir/dirlist`; do if [ -f "$cm_otherdir/$cm_macro" ]; then cm_macrofound=true break fi done fi done if $cm_macrofound; then : else printerr " $cm_macro not found" cm_status=1 fi done fi if [ "$cm_status" != 0 ]; then print_m4macros_error exit $cm_status fi } want_glib_gettext=false want_intltool=false want_pkg_config=false want_gtk_doc=false want_maintainer_mode=false version_check automake AUTOMAKE automake $REQUIRED_AUTOMAKE_VERSION \ "http://ftp.gnu.org/pub/gnu/automake/automake-$REQUIRED_AUTOMAKE_VERSION.tar.xz" version_check autoreconf AUTORECONF autoreconf $REQUIRED_AUTORECONF_VERSION \ "http://ftp.gnu.org/pub/gnu/autoconf/autoconf-$REQUIRED_AUTORECONF_VERSION.tar.xz" find_configure_files() { configure_ac= if test -f "$1/configure.ac"; then configure_ac="$1/configure.ac" elif test -f "$1/configure.in"; then configure_ac="$1/configure.in" fi if test "x$configure_ac" != x; then echo "$configure_ac" autoconf -t 'AC_CONFIG_SUBDIRS:$1' "$configure_ac" | while read dir; do find_configure_files "$1/$dir" done fi } configure_files="`find_configure_files $srcdir`" for configure_ac in $configure_files; do dirname=`dirname $configure_ac` if [ -f $dirname/NO-AUTO-GEN ]; then echo skipping $dirname -- flagged as no auto-gen continue fi if grep "^AM_GLIB_GNU_GETTEXT" $configure_ac >/dev/null; then want_glib_gettext=true fi if grep "^AC_PROG_INTLTOOL" $configure_ac >/dev/null || grep "^IT_PROG_INTLTOOL" $configure_ac >/dev/null; then want_intltool=true fi if grep "^PKG_CHECK_MODULES" $configure_ac >/dev/null; then want_pkg_config=true fi if grep "^GTK_DOC_CHECK" $configure_ac >/dev/null; then want_gtk_doc=true fi # check that AM_MAINTAINER_MODE is used if grep "^AM_MAINTAINER_MODE" $configure_ac >/dev/null; then want_maintainer_mode=true fi if grep "^YELP_HELP_INIT" $configure_ac >/dev/null; then require_m4macro yelp.m4 fi if grep "^APPDATA_XML" $configure_ac >/dev/null; then require_m4macro appdata-xml.m4 fi if grep "^APPSTREAM_XML" $configure_ac >/dev/null; then require_m4macro appstream-xml.m4 fi done if $want_glib_gettext; then version_check glib-gettext GLIB_GETTEXTIZE glib-gettextize $REQUIRED_GLIB_GETTEXT_VERSION \ "ftp://ftp.gtk.org/pub/gtk/v2.2/glib-$REQUIRED_GLIB_GETTEXT_VERSION.tar.gz" require_m4macro glib-gettext.m4 fi if $want_intltool; then version_check intltool INTLTOOLIZE intltoolize $REQUIRED_INTLTOOL_VERSION \ "http://ftp.gnome.org/pub/GNOME/sources/intltool/" require_m4macro intltool.m4 fi if $want_pkg_config; then version_check pkg-config PKG_CONFIG pkg-config $REQUIRED_PKG_CONFIG_VERSION \ "'http://www.freedesktop.org/software/pkgconfig/releases/pkgconfig-$REQUIRED_PKG_CONFIG_VERSION.tar.gz" require_m4macro pkg.m4 fi if $want_gtk_doc; then version_check gtk-doc GTKDOCIZE gtkdocize $REQUIRED_GTK_DOC_VERSION \ "http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/" require_m4macro gtk-doc.m4 fi check_m4macros topdir=`pwd` for configure_ac in $configure_files; do dirname=`dirname $configure_ac` basename=`basename $configure_ac` if [ -f $dirname/NO-AUTO-GEN ]; then echo skipping $dirname -- flagged as no auto-gen elif [ ! -w $dirname ]; then echo skipping $dirname -- directory is read only else printbold "Processing $configure_ac" cd $dirname # if the AC_CONFIG_MACRO_DIR() macro is used, create that directory # This is a automake bug fixed in automake 1.13.2 # See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13514 m4dir=`autoconf --trace 'AC_CONFIG_MACRO_DIR:$1'` if [ -n "$m4dir" ]; then mkdir -p $m4dir fi if grep "^AM_GLIB_GNU_GETTEXT" $basename >/dev/null; then printbold "Running $GLIB_GETTEXTIZE... Ignore non-fatal messages." echo "no" | $GLIB_GETTEXTIZE --force --copy || exit 1 fi if grep "^GTK_DOC_CHECK" $basename >/dev/null; then printbold "Running $GTKDOCIZE..." $GTKDOCIZE --copy || exit 1 fi if grep "^AC_PROG_INTLTOOL" $basename >/dev/null || grep "^IT_PROG_INTLTOOL" $basename >/dev/null; then printbold "Running $INTLTOOLIZE..." $INTLTOOLIZE --force --copy --automake || exit 1 fi # Now that all the macros are sorted, run autoreconf ... printbold "Running autoreconf..." autoreconf --verbose --force --install -Wno-portability || exit 1 cd "$topdir" fi done conf_flags="" if $want_maintainer_mode; then conf_flags="--enable-maintainer-mode" fi if test x$NOCONFIGURE = x; then if [ "$#" = 0 ]; then printerr printbold "** Warning **" printerr printerr " Running \`configure' with no arguments." printerr " If you wish to pass any to it, please specify them on the" printerr " "\`$0\'" command line." printerr sleep 3 fi printbold Running $srcdir/configure $conf_flags "$@" ... $srcdir/configure $conf_flags "$@" || exit 1 else echo Skipping configure process. fi master-0.7.3/build-aux/000077500000000000000000000000001300074171200147015ustar00rootroot00000000000000master-0.7.3/build-aux/Makefile000066400000000000000000000072751300074171200163540ustar00rootroot00000000000000 PACKAGE_NAME = font-manager PACKAGE_VERSION = 0.7.3 abs_top_srcdir = $(shell realpath ../) abs_srcdir = $(shell realpath .) SED = $(shell which sed) POTFILES.readme: echo "Do not edit POTFILES.* directly. See build-aux directory" > $(abs_top_srcdir)/po/$@ POTFILES.in: find $(abs_top_srcdir) -name "*.vala*" -print | $(SED) -e 's|$(abs_top_srcdir)/||g' -e 's/\.in//g' | sort | uniq > $(abs_top_srcdir)/po/$@ ; echo "[type: gettext/glade]data/ApplicationMenu.ui" >> $(abs_top_srcdir)/po/$@ ; echo "data/org.gnome.FontManager.appdata.xml.in" >> $(abs_top_srcdir)/po/$@ ; echo "data/org.gnome.FontManager.desktop.in" >> $(abs_top_srcdir)/po/$@ ; echo "" >> $(abs_top_srcdir)/po/$@ ; $(SED) -i 's|\.\./||g' $(abs_top_srcdir)/po/$@ ; POTFILES.skip: find $(abs_top_srcdir) -name "*.vala*" -print | $(SED) -e 's|$(abs_top_srcdir)/||g' -e 's/\.in//g' | sort | uniq | $(SED) 's/.vala/.c/g' > $(abs_top_srcdir)/po/$@ ; $(SED) -i 's|\.\./||g' $(abs_top_srcdir)/po/$@ ; echo "lib/Glue/Enums.c" >> $(abs_top_srcdir)/po/$@ ; POT: cd $(abs_top_srcdir) && \ test -e Makefile || ./autogen.sh && \ make $(PACKAGE_NAME).pot && \ cd $(abs_srcdir) write_sources = \ for i in `find . -type f -name '*.vala*' -print | $(SED) 's/\.in//g' | sort | uniq`; \ do \ echo "$$i \\" >> $1 ; \ done && \ $(SED) -i -e 's/^\.\// /g' -e '$$ s/\\//' $1 ValaSources.mk: cd $(abs_top_srcdir)/lib && \ echo "# Do not edit directly. See build-aux directory" > $@ && \ echo "" >> $@ && \ echo "libfontmanager_la_VALASOURCES = \\" >> $@ && \ $(call write_sources,$@) && \ cd $(abs_top_srcdir)/src/$(PACKAGE_NAME) && \ echo "# Do not edit directly. See build-aux directory" > $@ && \ echo "" >> $@ && \ echo "font_manager_VALASOURCES = \\" >> $@ && \ $(call write_sources,$@) && \ cd $(abs_srcdir) License.h: license/genheader.py $(abs_top_srcdir)/lib/Glue Vendor.h: vendor/genheader.py $(abs_top_srcdir)/lib/Glue update-headers: License.h Vendor.h update-po: POTFILES.readme POTFILES.in POTFILES.skip POT update-sources: ValaSources.mk update: update-headers update-po update-sources # Fedora RPM packaging rpm-prep: @echo -e "\n**** Need to ensure rpmdevtools are installed\n"; pkexec dnf install rpmdevtools @echo -e "\n**** Need to ensure build dependencies are installed\n"; pkexec dnf builddep $(abs_top_srcdir)/fedora/$(PACKAGE_NAME).spec cd $(abs_top_srcdir) && \ test -e Makefile || ./autogen.sh && \ make dist-bzip2 && \ rpmdev-setuptree && \ cp *.bz2 ~/rpmbuild/SOURCES/ && \ cp fedora/$(PACKAGE_NAME).spec ~/rpmbuild/SPECS/ && \ cd $(abs_srcdir) rm -f ~/rpmbuild/SRPMS/$(PACKAGE_NAME)*.src.rpm rpm: rpm-prep rpmbuild -bb ~/rpmbuild/SPECS/$(PACKAGE_NAME).spec srpm: rpm-prep rpmbuild -bs ~/rpmbuild/SPECS/$(PACKAGE_NAME).spec copr-build: srpm @echo -e "\n**** Need to ensure copr-cli is installed\n"; pkexec dnf install copr-cli copr-cli build --nowait jerrycasiano/FontManager ~/rpmbuild/SRPMS/$(PACKAGE_NAME)*.src.rpm # Debian? packaging # Tested on Ubuntu deb: @echo "\n**** Need to ensure build dependencies are installed\n"; sudo apt-get install devscripts equivs cd $(abs_top_srcdir) && \ mk-build-deps $(abs_top_srcdir)/debian/control && \ sudo dpkg -i $(abs_top_srcdir)/*.deb && rm $(abs_top_srcdir)/*.deb && \ test -e Makefile || ./autogen.sh && \ make dist-bzip2 && \ rm -rf BUILD && \ mkdir BUILD && \ mv $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.bz2 BUILD/$(PACKAGE_NAME)_$(PACKAGE_VERSION).orig.tar.bz2 && \ cd BUILD && \ tar -xvf $(PACKAGE_NAME)_$(PACKAGE_VERSION).orig.tar.bz2 && \ cp -Rpf ../debian $(PACKAGE_NAME)-$(PACKAGE_VERSION) && \ cp -pf ../autogen.sh $(PACKAGE_NAME)-$(PACKAGE_VERSION) && \ cd $(abs_top_srcdir)/BUILD/$(PACKAGE_NAME)-$(PACKAGE_VERSION) && \ debuild -us -uc && \ cd $(abs_srcdir) master-0.7.3/build-aux/license/000077500000000000000000000000001300074171200163235ustar00rootroot00000000000000master-0.7.3/build-aux/license/Aladdin.json000077500000000000000000000004161300074171200205560ustar00rootroot00000000000000{ "License" : [ { "Name" : "Aladdin Free Public License", "URL" : "http://pages.cs.wisc.edu/~ghost/doc/AFPL/6.01/Public.htm", "Keywords" : [ "Aladdin", null ] } ] } master-0.7.3/build-aux/license/Apache.json000077500000000000000000000004641300074171200204060ustar00rootroot00000000000000{ "License" : [ { "Name" : "Apache 2.0", "URL" : "http://www.apache.org/licenses/LICENSE-2.0", "Keywords" : [ "Apache", "Apache License", "Apache 2 License", null ] } ] } master-0.7.3/build-aux/license/Arphic.json000077500000000000000000000006071300074171200204320ustar00rootroot00000000000000{ "License" : [ { "Name" : "Arphic Public License", "URL" : "http://ftp.gnu.org/gnu/non-gnu/chinese-fonts-truetype/LICENSE", "Keywords" : [ "ARPHIC PUBLIC LICENSE", "Arphic Public License", "文鼎公眾授權書", "Arphic", null ] } ] } master-0.7.3/build-aux/license/Bitstream.json000077500000000000000000000004771300074171200211630ustar00rootroot00000000000000{ "License" : [ { "Name" : "Bitstream Vera License", "URL" : "http://www-old.gnome.org/fonts/#Final_Bitstream_Vera_Fonts", "Keywords" : [ "Bitstream", "Vera", "DejaVu", null ] } ] } master-0.7.3/build-aux/license/CC.json000077500000000000000000000025231300074171200175100ustar00rootroot00000000000000{ "License" : [ { "Name" : "CC-BY-SA", "URL" : "http://creativecommons.org/licenses/by-sa/3.0/", "Keywords" : [ "Creative Commons Attribution ShareAlike", "Creative-Commons-Attribution-ShareAlike", "Creative Commons Attribution Share Alike", "Creative-Commons-Attribution-Share-Alike", "Creative Commons BY SA", "Creative-Commons-BY-SA", "CC BY SA", "CC-BY-SA", null ] }, { "Name" : "CC-BY", "URL" : "http://creativecommons.org/licenses/by/3.0/", "Keywords" : [ "Creative Commons Attribution", "Creative-Commons-Attribution", "CC BY", "CC-BY", null ] }, { "Name" : "CC-0", "URL" : "http://creativecommons.org/publicdomain/zero/1.0/", "Keywords" : [ "Creative Commons Zero", "Creative-Commons-Zero", "Creative Commons 0", "Creative-Commons-0", "CC Zero", "CC-Zero", "CC 0", "CC-0", null ] } ] } master-0.7.3/build-aux/license/Freeware.json000077500000000000000000000004061300074171200207610ustar00rootroot00000000000000{ "License" : [ { "Name" : "Freeware", "URL" : "http://en.wikipedia.org/wiki/Freeware", "Keywords" : [ "freeware", "free ware", null ] } ] } master-0.7.3/build-aux/license/GNU.json000077500000000000000000000027041300074171200176550ustar00rootroot00000000000000{ "License" : [ { "Name" : "GPL with font exception", "URL" : "http://www.gnu.org/copyleft/gpl.html", "Keywords" : [ "LiberationFontLicense", "with font exception", "Liberation font software", "LIBERATION is a trademark of Red Hat", "this font does not by itself cause the resulting document to be covered by the GNU", null ] }, { "Name" : "GNU General Public License", "URL" : "http://www.gnu.org/copyleft/gpl.html", "Keywords" : [ "GPL", "GNU Public License", "GNU GENERAL PUBLIC LICENSE", "GNU General Public License", "General Public License", "GNU copyleft", "GNU", "www.gnu.org", "Licencia Pública General de GNU", "free as in free-speech", "free as in free speech", "languagegeek.com", null ] }, { "Name" : "GNU Lesser General Public License", "URL" : "http://www.gnu.org/licenses/lgpl.html", "Keywords" : [ "LGPL", "GNU Lesser General Public License", "Lesser General Public License", null ] } ] } master-0.7.3/build-aux/license/GUST.json000077500000000000000000000003741300074171200200070ustar00rootroot00000000000000{ "License" : [ { "Name" : "GUST Font License", "URL" : "http://tug.org/fonts/licenses/GUST-FONT-LICENSE.txt", "Keywords" : [ "GUST", null ] } ] } master-0.7.3/build-aux/license/IPA.json000077500000000000000000000005321300074171200176320ustar00rootroot00000000000000{ "License" : [ { "Name" : "IPA", "URL" : "http://opensource.org/licenses/ipafont.html", "Keywords" : [ "IPA License", "Information-technology Promotion Agency", "(IPA)", " IPA ", null ] } ] } master-0.7.3/build-aux/license/M+.json000077500000000000000000000004171300074171200174720ustar00rootroot00000000000000{ "License" : [ { "Name" : "M+ Fonts Project License", "URL" : "http://mplus-fonts.sourceforge.jp/webfonts/#license", "Keywords" : [ "M+ FONTS PROJECT", null ] } ] } master-0.7.3/build-aux/license/MIT.json000066400000000000000000000004501300074171200176460ustar00rootroot00000000000000{ "License" : [ { "Name" : "MIT License", "URL" : "http://www.opensource.org/licenses/mit-license.php", "Keywords" : [ "M.I.T.", "Software without restriction,", null ] } ] } master-0.7.3/build-aux/license/Magenta.json000077500000000000000000000004101300074171200205700ustar00rootroot00000000000000{ "License" : [ { "Name" : "Magenta Open License", "URL" : "http://www.ellak.gr/pub/fonts/mgopen/index.en.html#license", "Keywords" : [ "MgOpen", null ] } ] } master-0.7.3/build-aux/license/Monotype.json000077500000000000000000000005431300074171200210350ustar00rootroot00000000000000{ "License" : [ { "Name" : "Monotype Imaging EULA", "URL" : "http://www.fonts.com/info/legal/eula/monotype-imaging", "Keywords" : [ "valuable asset of Monotype", "Monotype Typography", "www.monotype.com", null ] } ] } master-0.7.3/build-aux/license/OFL.json000077500000000000000000000007441300074171200176460ustar00rootroot00000000000000{ "License" : [ { "Name" : "SIL Open Font License", "URL" : "http://scripts.sil.org/OFL", "Keywords" : [ "OFL", "Open Font License", "scripts.sil.org/OFL", "openfont", "open font", "NHN Corporation", "American Mathematical Society", "http://www.ams.org", null ] } ] } master-0.7.3/build-aux/license/Public.json000077500000000000000000000004511300074171200204370ustar00rootroot00000000000000{ "License" : [ { "Name" : "Public Domain (not a license)", "URL" : "http://en.wikipedia.org/wiki/Public_domain", "Keywords" : [ "public domain", "Public Domain", null ] } ] } master-0.7.3/build-aux/license/Stix.json000077500000000000000000000005231300074171200201500ustar00rootroot00000000000000{ "License" : [ { "Name" : "STIX Font License", "URL" : "http://www.aip.org/stixfonts/user_license.html", "Keywords" : [ "2007 by the STI Pub Companies", "the derivative work will carry a different name", null ] } ] } master-0.7.3/build-aux/license/UFL.json000077500000000000000000000005121300074171200176450ustar00rootroot00000000000000{ "License" : [ { "Name" : "Ubuntu Font License 1.0", "URL" : "http://font.ubuntu.com/ufl/ubuntu-font-licence-1.0.txt", "Keywords" : [ "Ubuntu Font Licence 1.0", "UBUNTU FONT LICENCE Version 1.0", null ] } ] } master-0.7.3/build-aux/license/Utopia.json000077500000000000000000000005321300074171200204620ustar00rootroot00000000000000{ "License" : [ { "Name" : "License to TeX Users Group for the Utopia Typeface", "URL" : "http://tug.org/fonts/utopia/LICENSE-utopia.txt", "Keywords" : [ "The Utopia fonts are freely available; see http://tug.org/fonts/utopia", null ] } ] } master-0.7.3/build-aux/license/X.json000077500000000000000000000004241300074171200174300ustar00rootroot00000000000000{ "License" : [ { "Name" : "XFree86 License", "URL" : "http://www.xfree86.org/legal/licenses.html", "Keywords" : [ "XFree86", "X Consortium", null ] } ] } master-0.7.3/build-aux/license/Z-Unknown.json000077500000000000000000000002601300074171200210650ustar00rootroot00000000000000{ "License" : [ { "Name" : "Unknown License", "URL": null, "Keywords" : [ null ] } ] } master-0.7.3/build-aux/license/genheader.py000077500000000000000000000066631300074171200206350ustar00rootroot00000000000000#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2009 - 2016 Jerry Casiano # # 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 . # # Author: # Jerry Casiano import io import os import json import sys NOTICE = """/* * * Do not edit directly. See build-aux directory *""" CREDITS = """ * * Open source license information courtesy of * * // * // The Fontaine Font Analysis Project * // * // Copyright (c) 2009 by Edward H. Trager * // All Rights Reserved * // * // Released under the GNU GPL version 2.0 or later. * // * * See http://www.unifont.org/fontaine/ for more information. * * Special thanks to Edward H. Trager, and of course everyone * involved with the Open Font Library for all their efforts. :-) * * http://www.openfontlibrary.org/ * */ """ HEADER = """ G_BEGIN_DECLS #define MAX_KEYWORD_ENTRIES 25 static const struct { const gchar *license; const gchar *license_url; const gchar *keywords[MAX_KEYWORD_ENTRIES]; } LicenseData[] = { """ FOOTER = """ }; #define LICENSE_ENTRIES G_N_ELEMENTS(LicenseData) gint get_license_type(const gchar *license, const gchar *copyright, const gchar * url); gchar * get_license_name (gint license_type); gchar * get_license_url (gint license_type); G_END_DECLS """ def write_license_entry (tmp, val) : if val is None: tmp.write(" NULL,\n") else: tmp.write(" \"{0}\",\n".format(val)) def get_license_entries () : license_dir = os.path.dirname(os.path.realpath(__file__)) tmp = io.StringIO() filelist = os.listdir(license_dir) filelist.sort() for filename in filelist: if not filename.endswith(".json"): continue filepath = os.path.join(license_dir, filename) try: with open(filepath) as raw: obj = json.load(raw) for l in obj["License"]: tmp.write("\n {\n") write_license_entry(tmp, l["Name"]) write_license_entry(tmp, l["URL"]) tmp.write(" {\n") for k in l["Keywords"]: if k is None: tmp.write(" NULL\n") break else: tmp.write(" ") write_license_entry(tmp, k) tmp.write(" }\n },\n") except: print("Failed to load license : {0} : Skipping...".format(filepath)) contents = tmp.getvalue() tmp.close() return contents if __name__ == "__main__": with open(os.path.join(sys.argv[1], "License.h"), "w") as header_file: header_file.write(NOTICE) header_file.write(CREDITS) header_file.write(HEADER) header_file.write(get_license_entries()) header_file.write(FOOTER) master-0.7.3/build-aux/vendor/000077500000000000000000000000001300074171200161765ustar00rootroot00000000000000master-0.7.3/build-aux/vendor/Example.py000077500000000000000000000006421300074171200201500ustar00rootroot00000000000000#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Will be inserted as a comment above the vendor list, if not None CREDIT = "Various Sources" # Expected to return [(id, name), ...] # id is the unique vendor id to match against # name is the full vendor name def list_vendors () : return [ (b"ACG", b"Monotype Imaging"), (b"B?", b"Bigelow & Holmes"), (b"FJ", b"Fujitsu"), (b"RICO", b"Ricoh") ] master-0.7.3/build-aux/vendor/MicrosoftTypography.cache000066400000000000000000000430611300074171200232230ustar00rootroot00000000000000[(b'!ETF', b'!Exclamachine Type Foundry'), (b'$pro', b'CheapProFonts'), (b'1ASC', b'Ascender Corporation'), (b'1BOU', b'Boutros International'), (b'1KTF', b'Kief Type Foundry'), (b'2DLT', b'2D Typo'), (b'2REB', b'2Rebels'), (b'39BC', b"Finley's Barcode Fonts"), (b'3ip', b'Three Islands Press'), (b'4FEB', b'4th february'), (b'5PTS', b'Five Points Technology'), (b'918', b'RavenType'), (b'A&S;', b'Art&Sign; Studio'), (b'A2', b'A2-Type'), (b'aaff', b'AstroAcademia Font Foundry'), (b'ABBO', b'Arabic Dictionary Lab'), (b'ABC', b'Altek Instruments'), (b'ABOU', b'Aboutype, Inc.'), (b'ACUT', b'Acute Type'), (b'ADBE', b'Adobe'), (b'ADBO', b'Adobe'), (b'ADG', b'Apply Design Group'), (b'AE', b'AE Type'), (b'AEF', b'Altered Ego Fonts'), (b'AGFA', b'Monotype Imaging (replaced by MONO)'), (b'AID', b'Artistic Imposter Design'), (b'AJPT', b'Alan Jay Prescott Typography'), (b'AKOF', b'AKOFAType'), (b'ALFA', b'Alphabets'), (b'ALPH', b'Alphameric Broadcast Solutions Limited'), (b'ALPN', b'Alpona Portal'), (b'ALS', b'Art. Lebedev Studio'), (b'alte', b'Altemus'), (b'ALTS', b'Altsys / Made with Fontographer'), (b'AMUT', b'Kwesi Amuti'), (b'ANDO', b'Osam Ando'), (b'anty', b'Anatoletype'), (b'AOP', b'an Art Of Pengwyn'), (b'APLY', b'Apply Interactive'), (b'APOS', b'Apostrophic Laboratories'), (b'APPL', b'Apple'), (b'ARBX', b'Arabetics'), (b'ARCH', b'Architext'), (b'ARIN', b'Aring Typeface AB'), (b'ARPH', b'Arphic Technology Co.'), (b'ARS', b'EN ARS Ltd.'), (b'ArTy', b'Archive Type'), (b'ASL', b'Abneil Software Ltd fonts'), (b'ASSA', b'astype'), (b'ASYM', b'Applied Symbols'), (b'ATEC', b'Page Technology Marketing, Inc.'), (b'ATF', b'American Type Founders Collection'), (b'ATF1', b'Australian Type Foundry'), (b'ATFS', b"Andrew Tyler's fonts"), (b'AURE', b'Aure Font Design'), (b'AUTO', b'Autodidakt'), (b'AVFF', b'Agust\xc3\xadn Varela Font Factory'), (b'AVP', b'Aviation Partners'), (b'AZLS', b'Azalea Software, Inc.'), (b'B&H;', b'Bigelow & Holmes'), (b'BARS', b'CIA (BAR CODES) UK'), (b'BASE', b'Baseline Fonts'), (b'BAT', b'BUREAU DES AFFAIRES TYPOGRAPHIQUES'), (b'BCP', b'Expert Labels Ltd.'), (b'BDX', b'Studio Christian Bordeaux'), (b'BERT', b'Berthold'), (b'BITM', b'Bitmap Software'), (b'BITS', b'Bitstream'), (b'bizf', b'Bizfonts.com'), (b'BL', b'Binnenland'), (b'BLAB', b'BaseLab'), (b'BLAH', b"Mister Bla's Fontworx"), (b'BLCK', b'Black Foundry'), (b'BLI', b'Blissym Language Institute'), (b'BLV', b'Bladvulling'), (b'BOLD', b'Bold Monday'), (b'BORW', b'em2 Solutions'), (b'BOYB', b'BoyBeaver Fonts'), (b'BRDV', b'BoardVantage, Inc.'), (b'BREM', b'Mark Bremmer'), (b'BROS', b'Michael Brosnan'), (b'BRTC', b'ITSCO - Bar Code Fonts'), (b'BS', b'Barcodesoft'), (b'BSYV', b'Ben Syverson'), (b'BUBU', b'BUBULogix'), (b'BWFW', b'B/W Fontworks'), (b'C&B;', b'Coppers & Brasses'), (b'C&C;', b'Carter & Cone'), (b'C&G;', b'C&G; Inc.'), (b'C21', b'Club 21'), (b'CAK', b'pluginfonts.com'), (b'CAM', b'Camelot Typefaces'), (b'CANO', b'Canon'), (b'CASL', b'H.W. Caslon & Company Ltd.'), (b'CATG', b'CAT-Fonts Germany'), (b'CB', b'Christian B\xc3\xbcning'), (b'CBDO', b'Borges Lettering & Design'), (b'CDAC', b'Centre for Development of Advanced Computing'), (b'cdd', b'Crazy Diamond Design'), (b'CDFP', b'VT2000 Technical Services'), (b'CELB', b'Celebrity Fontz'), (b'CF', b'Colophon Foundry'), (b'CFA', b'Computer Fonts Australia'), (b'CFF', b'Characters Font Foundry'), (b'CJCJ', b'Creative Juncture'), (b'CKTP', b'CakeType'), (b'CLM', b'Culmus Project'), (b'CMJK', b'Slanted Hall'), (b'COMM', b'Commercial Type'), (b'CONR', b'Connare.com'), (b'COOL', b'Cool Fonts'), (b'CORD', b'corduroy'), (b'CR8', b'CR8 Software Solutions'), (b'CRRT', b'Carrot Type'), (b'CT', b'CastleType'), (b'CTDL', b'China Type Designs Ltd.'), (b'CTL', b'Chaitanya Type Library'), (b'cwwf', b'Computers World Wide/AC Capital Funding'), (b'CYPE', b'Club Type'), (b'CYRE', b'Cyreal'), (b'DADA', b'Dada Studio'), (b'DAMA', b'Dalton Maag Limited'), (b'DB', b'Daniel Bruce'), (b'DBFF', b'DesignBase'), (b'DD', b'Devon DeLapp'), (b'Deco', b'DecoType (replaced by DT)'), (b'DELV', b'Delve Fonts'), (b'dezc', b'Dezcom'), (b'DFS', b'Datascan Font Service Ltd'), (b'DGL', b'Digital Graphic Labs foundry'), (b'DOM', b'Dukom Design'), (b'DS', b'Dainippon Screen Mfg. Co., Inc.'), (b'DSBV', b'Datascan bv'), (b'DSCI', b'Design Science Inc.'), (b'DSGN', b'DizajnDesign'), (b'DSKY', b'Jacek Dziubinski'), (b'DSSR', b'Dresser Johnson'), (b'DSST', b'Dubina Nikolay'), (b'DST', b'DSType'), (b'DSTE', b'Dieste'), (b'DT', b'DecoType'), (b'DTC', b'Digital Typeface Corp.'), (b'DTF', b'Dunwich Type Founders'), (b'DTL', b'Dutch Type Library'), (b'DTPS', b'DTP-Software'), (b'dtpT', b'dtpTypes Limited'), (b'DUXB', b'Duxbury Systems, Inc.'), (b'DYNA', b'DynaComware'), (b'ECAL', b'ECAL Typefaces'), (b'EDBI', b'edilbiStudio'), (b'EDGE', b'Rivers Edge Corp.'), (b'EF', b'Elsner+Flake'), (b'EFF', b'Electronic Font Foundry'), (b'EFI', b'Elfring Fonts Inc.'), (b'EFNT', b'E Fonts L.L.C.'), (b'EFWS', b'eFilm World'), (b'EKIO', b'Ekioh'), (b'ELSE', b'Elseware'), (b'EMGR', b'Emigre'), (b'EPSN', b'Epson'), (b'ESIG', b'E-Signature'), (b'ETIO', b'Ethiopian Font Foundry'), (b'EVER', b'Evertype'), (b'FA', b'FontArte Type Foundry'), (b'FAFO', b'FamiraFonts'), (b'FAPA', b'FamiljenPangea'), (b'FAT', b'Fatype'), (b'FBI', b'The Font Bureau, Inc.'), (b'FCAB', b'The Font Cabinet'), (b'FCAN', b'fontage canada'), (b'FCTP', b'Facetype'), (b'FDI', b'FDI fonts.info'), (b'FEED', b'Studio Feed Inc.'), (b'FeoN', b'Fe\xc3\xb2rag N\xc3\xaccBhr\xc3\xacde'), (b'FGOD', b'FontGod'), (b'FJTY', b'Frank Jonen - Illustration & Typography'), (b'FMFO', b'Fontmill Foundry'), (b'FMST', b'Formist'), (b'FNTF', b'Fontfoundry'), (b'FoFa', b'FontFabrik'), (b'FONT', b'Font Source'), (b'FORM', b'Formation Type Foundry'), (b'FOUN', b'The Foundry'), (b'FP', b'The Fontpad'), (b'FRJN', b'Frere-Jones Type'), (b'FRML', b'formlos'), (b'FRTH', b'Forthcome'), (b'FS', b'Formula Solutions'), (b'FSE', b'Font Source Europe'), (b'FSI', b'FontShop International'), (b'FSL', b'FontSurfer Ltd'), (b'fsmi', b'Fontsmith'), (b'FTF', b'Fontef'), (b'FTFT', b'FontFont'), (b'FTGD', b'Font Garden'), (b'FTH', b'For the Hearts'), (b'FTN', b'Fountain'), (b'FTPT', b'Fontpartners'), (b'FWKS', b'Fontworks'), (b'FWRE', b'Fontware Limited'), (b'FY', b'Fontyou'), (b'GAF', b'Glifo Art Fonts Inc.'), (b'GALA', b'Gal\xc3\xa1pagos Design Group, Inc.'), (b'GALO', b'Gerald Gallo'), (b'GARI', b'Gary Ritchie'), (b'GATF', b'Greater Albion Typefounders'), (b'GD', b'GD Fonts'), (b'GF', b'GarageFonts'), (b'GIA', b'Georgian Internet Avenue'), (b'GLCF', b'GLC foundry'), (b'GLYF', b'Glyph Systems'), (b'GNU', b'Free Software Foundation, Inc.'), (b'GOAT', b'Dingbat Dungeon'), (b'GOGO', b'Fonts-A-Go-Go'), (b'GOHE', b'GoHebrew, division of GoME2.com Inc.'), (b'GOOG', b'Google'), (b'GPI', b'Gamma Productions, Inc.'), (b'GRAF', b'Grafikarna d.o.o.'), (b'GRCR', b'Graphicore'), (b'GREY', b'Greyletter'), (b'GRIL', b'Grilled cheese'), (b'GRIM', b'Legacy publishing'), (b'grro', b'grafikk R\xc3\x98ren'), (b'GT', b'Graphity!'), (b'GTYP', b'G-Type'), (b'H', b'Hurme Design'), (b'H&FJ;', b'Hoefler & Frere-Jones'), (b'HA', b'HoboArt'), (b'HAD', b'Hoffmann Angelic Design'), (b'HAIL', b'Hail Design'), (b'HanS', b'HanStyle'), (b'HAUS', b'TypeHaus'), (b'HEB', b'Sivan Toledo'), (b'HFJ', b'Hoefler & Frere-Jones (replaced by H&FJ;)'), (b'HIH', b'HiH Retrofonts'), (b'HILL', b'Hill Systems'), (b'HJZ', b'Hans J. Zinken'), (b'HL', b'High-Logic'), (b'HM', b'Haiku Monkey'), (b'HoP', b'House of Pretty'), (b'HOUS', b'House Industries'), (b'HP', b'Hewlett-Packard'), (b'HS', b'HermesSOFT Company'), (b'HT', b'Huerta Tipogr\xc3\xa1fica'), (b'HTF', b'The Hoefler Type Foundry, Inc.'), (b'HVD', b'HVD Fonts GmbH'), (b'HXTP', b'Hexatype'), (b'HY', b'HanYang Information & Communication'), (b'IBM', b'IBM'), (b'IDAU', b'IDAutomation.com, Inc.'), (b'IDEA', b'Glenn Campbell t/a Idea Studio'), (b'IDEE', b'IDEE TYPOGRAFICA'), (b'IDF', b'International Digital Fonts'), (b'IFF', b'Indian Font Factory'), (b'IKOF', b'IKOffice GmbH'), (b'ILP', b'Indigenous Languages Project'), (b'IMPR', b'Impress'), (b'INGT', b'Ingrimayne Type'), (b'INRA', b'INRAY Inc.'), (b'INTR', b'Interstitial Entertainment'), (b'INVC', b'Invoice Central'), (b'INVD', b'TYPE INVADERS'), (b'ISE', b'ISE-Aditi Info. Pvt . Ltd.'), (b'ITC', b'ITC'), (b'ITF', b'Red Rooster Collection (ITF, Inc.)'), (b'ITFO', b'Indian Type Foundry'), (b'ITSM', b'Simon Stratford'), (b'JABM', b"JAB'M Foundry"), (b'JAF', b'Just Another Foundry'), (b'JAKE', b'Jake Tilson Studio'), (b'JBLT', b'JEAN-BAPTISTE LEV\xc3\x89E TYPOGRAPHY'), (b'JDB', b'Jeff Bensch'), (b'jeff', b'jeff-levine'), (b'JF', b'Jan Fromm'), (b'JHA', b'Jan Henrik Arnold'), (b'JHF', b'JH Fonts'), (b'JP', b'Jamra Patel'), (b'JPTT', b'Jeremy Tankard Typography Ltd'), (b'JWTM', b'Type Matters'), (b'JY', b'JIYUKOBO Ltd.'), (b'KATF', b'Kingsley/ATF'), (b'KBNT', b'Kombinat-Typefounders'), (b'KDW', b'Kinuta Font Factory'), (b'KF', b'Karakta Fonthome'), (b'KLIM', b'Klim Typographic Design'), (b'KLTF', b'Karsten Luecke'), (b'KNST', b'Konst.ru'), (b'KNTR', b'Kontour'), (b'KOP', b'Leo Koppelkamm'), (b'KORK', b'Khork O\xc3\x9c'), (b'KOVL', b'Koval Type Foundry'), (b'KrKo', b'Kreative Software'), (b'KRND', b'Karandash Type & Graphics Foundry'), (b'KTF', b'Kustomtype'), (b'KUBA', b'Kuba Tatarkiewicz'), (b'LAIT', b'la laiterie'), (b'LANS', b'Lanston Type Company'), (b'LARA', b'Larabiefonts'), (b'LAUD', b'Carolina Laudon'), (b'LAYT', b'LAYOUT SARL'), (b'LEAF', b'Interleaf, Inc.'), (b'LETR', b'Letraset'), (b'lewd', b'Lettering World LLC'), (b'LFS', b'Letters from Sweden'), (b'LGX', b'Logix Research Institute, Inc.'), (b'LHF', b'Letterhead Fonts'), (b'LIND', b'Lindenberg Software LLC'), (b'LING', b"Linguist's Software"), (b'LINO', b'Linotype GmbH'), (b'LIVE', b'Livedesign'), (b'LNGU', b'LangusteFonts'), (b'LNTO', b'Lineto'), (b'LORO', b'LoRo Productions'), (b'LP', b'LetterPerfect Fonts'), (b'LT', b'Le Typophage'), (b'LTF', b'Liberty Type Foundry'), (b'Ltrm', b'Lettermin type and design'), (b'LTRX', b'Lighttracks'), (b'LTTR', b'LettError'), (b'LUD', b'Ludlow'), (b'LuFo', b'LucasFonts'), (b'LUSH', b'Lush Type'), (b'LUV', b'iLUVfonts'), (b'MACR', b'Macromedia / Made with Fontographer'), (b'MADT', b'MADType'), (b'MagD', b'Magus Digital'), (b'MANS', b'Aring Typeface AB'), (b'MAPS', b"Tom Mouat's Map Symbol Fonts"), (b'MATE', b'TypeMates'), (b'MATS', b'Match Fonts'), (b'MC', b'Cerajewski Computer Consulting'), (b'MCHL', b'Michal Sahar'), (b'MCKL', b'MCKL'), (b'MCOW', b'Mountaincow'), (b'MDSN', b'Moraitis Design'), (b'MEH', b'Steve Mehallo'), (b'MEIR', b'Meir Sadan'), (b'MESA', b'FontMesa,'), (b'MF', b'Magic Fonts'), (b'MFNT', b'Masterfont'), (b'MG', b'Milieu Grotesque'), (b'MGD', b'Matt Grey Design'), (b'MILL', b'Millan'), (b'MJ', b'Majus Corporation'), (b'MJR', b'Majur Inc.'), (b'MLBU', b'Malibu Dream Designs, LLC'), (b'MLGC', b'Micrologic Software'), (b'mlss', b'Mark Simonson Studio LLC'), (b'MMFT', b'Michel M.'), (b'MMIK', b'Monomonnik'), (b'MNCK', b'Mine Creek'), (b'MNKR', b'Monokrom Skriftforlag AS'), (b'MODI', b'Modular Infotech Private Limited.'), (b'MOHT', b'Al Mohtaraf Assaudi Ltd'), (b'MOJI', b'Mojijuku'), (b'MONB', b'Monib'), (b'MONE', b'Meta One Limited'), (b'MONO', b'Monotype Imaging'), (b'MOON', b'Moonlight Type and Technolog'), (b'MOTA', b'Mota Italic'), (b'MRSW', b'Morisawa & Company, Ltd.'), (b'MRV', b'Morovia Corporation'), (b'MS', b'Microsoft Corp.'), (b'MSCH', b'Guitar-Injection'), (b'MSCR', b'Majus Corporation'), (b'MSE', b'MSE-iT'), (b'MT', b'Monotype Imaging (replaced by MONO)'), (b'MTF', b'Miss Tiina Fonts'), (b'MTY', b'Motoya Co. ,LTD.'), (b'MUTF', b'Murasu Systems Sdn. Bhd'), (b'MVB', b'MVB Fonts'), (b'MVTP', b'Mauve Type'), (b'MVty', b'MV Typo'), (b'MW', b'Michael Want'), (b'MYFO', b'MyFonts.com'), (b'NB', b'No Bodoni Typography'), (b'ncnd', b'&cond;'), (b'NDCT', b'Neufville Digital Corporatype'), (b'NDTC', b'Neufville Digital'), (b'NEC', b'NEC Corporation'), (b'NEWL', b'Newlyn'), (b'NICK', b"Nick's Fonts"), (b'NIS', b'NIS Corporation'), (b'NORF', b'Norfok Incredible Font Design'), (b'NOVA', b'NOVATYPE'), (b'NP', b'Nipponia'), (b'ODSR', b'Oddsorts'), (b'OHG', b'Our House Graphic Design'), (b'OHNO', b'OH no Type Company'), (b'OKAY', b'Okay Type'), (b'OPTM', b'Optimo'), (b'OPTO', b'Opto'), (b'ORBI', b'Orbit Enterprises, Inc.'), (b'ORK1', b'Ork1'), (b'OSFC', b'Out Of Step Font Company'), (b'OURT', b'Ourtype'), (b'P22', b'P22 Inc.'), (b'PARA', b'ParaType Inc.'), (b'PDWX', b'Parsons Design Workx'), (b'PECI', b'Pecita'), (b'PF', b"Phil's Fonts, Inc."), (b'PINT', b'PintassilgoPrints'), (b'PIXL', b'Pixilate'), (b'PKDD', b'Philip Kelly Digital Design'), (b'PLAT', b'PLATINUM technology'), (b'PRFS', b'Production First Software'), (b'PRGR', b'Paragraph'), (b'PROD', b'Production Type'), (b'PROT', b'PROTOTYPO'), (b'PRTF', b'Process Type Foundry'), (b'PSIS', b'PhotoShopIsland.com'), (b'PSY', b'PSY/OPS'), (b'PT', b'Playtype APS'), (b'PTF', b'Porchez Typofonderie'), (b'PTMI', b'Page Technology Marketing, Inc.'), (b'PTYP', b'preussTYPE'), (b'PYRS', b'PYRS Fontlab Ltd. / Made with FontLab'), (b'QMSI', b'QMS/Imagen'), (b'QRAT', b'Quadrat Communications'), (b'QTYP', b'Qtypography'), (b'READ', b'ReadyType'), (b'REAL', b'Underware'), (b'RES', b'Resultat'), (b'RJPS', b'Reall Graphics'), (b'RKFN', b'R K Fonts'), (b'RL', b'Ruben Holthuijsen'), (b'RLTF', b'Rebeletter Studios'), (b'RMU', b'RMU TypeDesign'), (b'robo', b'Buro Petr van Blokland'), (b'ROBU', b'SC ROBU DESIGN S.R.L.'), (b'ROHH', b'ROHH studio'), (b'RRT', b'Red Rooster Collection (ITF, Inc.)'), (b'RSJ', b'RSJ Software'), (b'RST', b'Rosetta'), (b'RUDY', b'RudynFluffy'), (b'RYOB', b'Ryobi Limited'), (b'SAJA', b'Saja Typeworks'), (b'SALT', b'Solonka Type Foundry'), (b'SAND', b'Sandoll'), (b'SAPL', b'Fonderie sans plomb'), (b'SATY', b'Samuelstype Design AB'), (b'SAX', b's.a.x. Software gmbh'), (b'SbB', b'Sketchbook B'), (b'SBT', b'SelfBuild Type Foundry'), (b'SCTO', b'Schick Toikka'), (b'SE', b'St\xc3\xa9phane Elbaz'), (b'Sean', b'The FontSite'), (b'SFS', b'Sarumadhu Services Pvt. Ltd.'), (b'SFUN', b'Software Union'), (b'SG', b'Scooter Graphics'), (b'SHAM', b'ShamFonts / Shamrock Int.'), (b'SHFT', b'Shift'), (b'SHOT', b'Shotype'), (b'SHRP', b'Sharp Type'), (b'SHS', b'Shahab Siavash Studio'), (b'SHUB', b'The Software Hub'), (b'SIG', b'vLetter, Inc'), (b'SIL', b'SIL International (SIL)'), (b'SIT', b'Summit Information Technologies Pvt.Ltd,'), (b'SKP', b'Essqu\xc3\xa9 Productions'), (b'skz', b"Celtic Lady's Fonts"), (b'SL', b'Silesian Letters'), (b'Slab', b'Schriftlabor'), (b'SMC', b'Swathanthra Malayalam Computing'), (b'SN', b'SourceNet'), (b'SOHO', b'Soft Horizons'), (b'SOS', b'Standing Ovations Software'), (b'SPRT', b'Sports Fonts'), (b'STC', b'Sorkin Type Co'), (b'STF', b'Brian Sooy & Co + Sooy Type Foundry'), (b'Stor', b'Storm Type Foundry'), (b'STYP', b'Stone Type Foundry'), (b'SUNW', b'sunwalk fontworks'), (b'SVTD', b'Synthview'), (b'SWFT', b'Swfte International'), (b'SWTY', b'Swiss Typefaces'), (b'SXRA', b'Page42 Type Foundry'), (b'SYDA', b'Shree Muktananda Ashram'), (b'SYN', b'SynFonts'), (b'SYRC', b'Syriac Computing Institute'), (b'TBFF', b'TrueBlue Font Foundry'), (b'TC', b'Typeco'), (b'TCH', b'Darryl Cook'), (b'TD', b'Typedepot'), (b'TDR', b'Tansin A. Darcos & Co.'), (b'TERM', b'Terminal Design, Inc.'), (b'TF', b'Treacyfaces / Headliners'), (b'TF3D', b'TattooFont3D'), (b'TFAC', b'Typefactory'), (b'TFND', b'Typefounding'), (b'THIN', b'Thinstroke Design LLC'), (b'TILD', b'Tilde, SIA'), (b'TIMO', b'Tim Romano'), (b'TIMR', b'Tim Rolands'), (b'TIPO', b'Tipo'), (b'TIRO', b'Tiro Typeworks'), (b'TJS', b'Typejockeys'), (b'TL', b'Typeland'), (b'TLIN', b'Teeline Fonts'), (b'TMF', b'The MicroFoundry'), (b'TMT', b'TypeMyType Comm. V.'), (b'TNTY', b'tntypography'), (b'TOPP', b'Toppan Printing Co., Ltd.'), (b'TPDP', b'Type Department'), (b'TPMA', b'typoma'), (b'TPSP', b'Type Supply'), (b'TPTA', b'TPTQ Arabic'), (b'TPTC', b'Test Pilot Collective'), (b'TPTQ', b'Typotheque'), (b'TR', b'Type Revivals'), (b'TRAF', b'Traffictype'), (b'TREE', b'Treeflow'), (b'TS', b'TamilSoft Corporation'), (b'TSPC', b'Typespec Ltd'), (b'TSTY', b'Torleiv Georg Sverdrup'), (b'TT', b'TypeTogether'), (b'TTG', b'Twardoch Typography'), (b'TTY', b'Tipotype'), (b'TYCU', b'TypeCulture'), (b'TYFR', b'typographies.fr'), (b'TYME', b'type me! Font Foundry'), (b'TYPA', b'Typadelic'), (b'TYPE', b'Type Associates Pty Ltd'), (b'TYPO', b'Typodermic'), (b'TYPR', b'Type Project'), (b'TYRE', b'typerepublic'), (b'UA', b'UnAuthorized Type'), (b'ULA', b'Montserrat Typeface'), (b'UNDT', b'\xc3\x9cNDT'), (b'URW', b'URW++'), (b'UT', b'Unitype Inc'), (b'VINT', b'Vinterstille'), (b'VJ', b'eDESIGNzone'), (b'VKP', b'Vijay K. Patel'), (b'VLKF', b'Visualogik Technology & Design'), (b'VLNL', b'VetteLetters.nl'), (b'VMT', b'VMType'), (b'VOG', b'Martin Vogel'), (b'VROM', b'Vladimir Romanov'), (b'VS', b'VorSicht GmbH'), (b'VT', b'VISUALTYPE SRL'), (b'VTF', b'Velvetyne Type Foundry'), (b'WASP', b'Wasp Barcode Technologies'), (b'WILL', b'Willerstorfer Font Foundry'), (b'WL', b'Writ Large Fonts'), (b'WM', b'Webmakers India'), (b'XFC', b'Xerox Font Services'), (b'XOTH', b'Xoth Morello'), (b'XYZ', b'XYZ Type LLC'), (b'Y&Y;', b'Y&Y;, Inc.'), (b'YDS', b'Yellow Design Studio'), (b'YN', b'Yanone'), (b'YOFF', b'Your Own Font Foundry'), (b'YOKO', b'Yokokaku'), (b'YOUR', b'YourFonts.com'), (b'ZANE', b'Unrender'), (b'ZeGr', b'Zebra Font Factory'), (b'zeta', b'Tangram Studio'), (b'ZSFT', b'Zsoft')] master-0.7.3/build-aux/vendor/MicrosoftTypography.py000077500000000000000000000042171300074171200226130ustar00rootroot00000000000000#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2009 - 2016 Jerry Casiano # # 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 . # # Author: # Jerry Casiano import urllib.request try: from bs4 import SoupStrainer from bs4 import BeautifulSoup except ImportError: import __main__ print("Error : {}\n".format(__main__.__file__)) print(" This script depends on BeautifulSoup 4.") print(" http://www.crummy.com/software/BeautifulSoup/\n") exit(1) # Microsoft Vendor Listing # Excellent, only?!, source of font foundry information URL = "http://www.microsoft.com/typography/links/vendorlist.aspx" CREDIT = "Courtesy of Microsoft Typography - {}".format(URL) USER_AGENT = "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" def list_vendors () : req = urllib.request.Request(URL) req.remove_header("User-agent") req.add_header("User-agent", USER_AGENT) with urllib.request.urlopen(req) as raw_data: raw_html = raw_data.read() vendor_list = SoupStrainer(id = "VendorList") # Certain versions of the default parser (lxml) choke here... vendor_table = BeautifulSoup(raw_html, "html.parser", parse_only = vendor_list, from_encoding = "utf-8") for anchor in vendor_table("a"): anchor.replaceWith("") for row in vendor_table("tr"): entry = row.find("td") vendor_id = entry.get_text(strip = True).encode("utf-8") vendor = entry.find_next("td").get_text(strip = True).encode("utf-8") yield (vendor_id, vendor) return master-0.7.3/build-aux/vendor/genheader.py000077500000000000000000000107261300074171200205030ustar00rootroot00000000000000#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2009 - 2016 Jerry Casiano # # 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 . # # Author: # Jerry Casiano import io import os import sys from pprint import pprint NOTICE = """/* * * Do not edit directly. See build-aux directory * */ """ HEADER = """ G_BEGIN_DECLS #define MAX_VENDOR_ID_LENGTH 5 #define MAX_VENDOR_LENGTH 100 static const struct { const gchar vendor_id[MAX_VENDOR_LENGTH]; const gchar vendor[MAX_VENDOR_LENGTH]; } /* Order is significant. */ NoticeData [] = { /* Notice data sourced from fcfreetype.c - http://www.freetype.org/ */ {"Adobe", "adobe"}, {"Adobe", "Adobe"}, {"Bigelow", "b&h"}, {"Bigelow", "Bigelow & Holmes"}, {"Bitstream", "Bitstream"}, {"Font21", "hwan"}, {"Font21", "Hwan"}, {"Gnat", "culmus"}, {"HanYang System", "hanyang"}, {"HanYang System", "HanYang Information & Communication"}, {"IBM", "IBM"}, {"International Typeface Corporation", "itc"}, {"International Typeface Corporation", "ITC"}, {"Linotype", "linotype"}, {"Linotype", "Linotype GmbH"}, {"Microsoft", "microsoft"}, {"Microsoft", "Microsoft Corporation"}, {"Monotype", "Monotype Imaging"}, {"Omega", "omega"}, {"Omega", "Omega"}, {"Tiro Typeworks", "Tiro Typeworks"}, {"URW", "URW"}, {"XFree86", "XFree86"}, {"Xorg", "xorg"} }; static const struct { const gchar vendor_id[MAX_VENDOR_ID_LENGTH]; const gchar vendor[MAX_VENDOR_LENGTH]; } VendorData[] = { """ FOOTER = """}; #define NOTICE_ENTRIES G_N_ELEMENTS(NoticeData) #define VENDOR_ENTRIES G_N_ELEMENTS(VendorData) gchar * get_vendor_from_notice(const gchar *notice); gchar * get_vendor_from_vendor_id(const gchar vendor[MAX_VENDOR_ID_LENGTH]); G_END_DECLS """ vendor_dir = os.path.dirname(os.path.realpath(__file__)) def get_vendor_entries () : sys.path.append(vendor_dir) module_names = [os.path.splitext(p)[0] for p in os.listdir(vendor_dir) if p.endswith(".py") and p != "genheader.py"] resources = map(__import__, module_names) tmp = io.StringIO() for module in resources: name = module.__name__ try: if module.CREDIT is not None: tmp.write("\n /* {} */\n".format(module.CREDIT)) else: tmp.write("\n") try: vendor_list = list(module.list_vendors()) except: vendor_list = [] if len(vendor_list) == 0: with open(os.path.join(vendor_dir, "{}.cache".format(name))) as cache: vendor_list = eval(cache.read()) print("Using cached vendor information for {}".format(name)) for vendor_id, vendor in iter(vendor_list): if len(vendor) > 50: vendor = "{}...".format(vendor[:47]) tmp.write(" {{\"{0}\", \"{1}\"}},\n".format(vendor_id.decode("utf-8", "strict"), vendor.decode("utf-8", "strict"))) tmp.write("\n") if name != "Example": try: with open(os.path.join(vendor_dir, "{}.cache".format(name)), "w") as cache: pprint(list(vendor_list), cache) except: pass except: print("Failed to load vendor resource : {0} : Skipping...".format(name)) contents = tmp.getvalue() tmp.close() return contents if __name__ == "__main__": with open(os.path.join(sys.argv[1], "Vendor.h"), "w") as header_file: header_file.write(NOTICE) header_file.write(HEADER) header_file.write(get_vendor_entries()) header_file.write(FOOTER) build_cache = os.path.join(vendor_dir, "__pycache__") if os.path.exists(build_cache): import shutil shutil.rmtree(build_cache) import glob for f in glob.glob("*.pyc"): os.remove(f) master-0.7.3/build-aux/zanata.xml000066400000000000000000000017721300074171200167100ustar00rootroot00000000000000 https://translate.zanata.org/ font-manager master gettext ../ ../ {path}/{locale_with_underscore}.po {path}/{locale_with_underscore}/{locale_with_underscore}.po rm -rf .zanata-cache make update-po rm -rf .zanata-cache master-0.7.3/configure.ac000066400000000000000000000147041300074171200153030ustar00rootroot00000000000000dnl dnl Font Manager dnl dnl Simple font management for Gtk+ desktops dnl dnl Copyright (C) 2009 - 2016 Jerry Casiano dnl dnl dnl Initialize autoconf dnl AC_PREREQ([2.69]) AC_INIT( [font-manager], [0.7.3], [https://github.com/FontManager/master/issues], [font-manager], [http://fontmanager.github.io/], ) AC_CONFIG_MACRO_DIR([m4]) AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \${ACLOCAL_FLAGS}"]) dnl dnl Initialize automake dnl AM_INIT_AUTOMAKE([1.11 foreign subdir-objects dist-bzip2]) AM_SILENT_RULES([yes]) dnl dnl Check for basics dnl AC_PROG_CC() AM_PROG_LIBTOOL dnl 0.34 -> incompatible changes in json-glib vapi dnl 0.28 -> incompatible changes in Gtk.TextBuffer API AM_PROG_VALAC( [0.34], [AC_SUBST(VALA_034_OR_LATER, [" -D VALA_034_OR_LATER"])], [AM_PROG_VALAC( [0.28], [:], AC_MSG_ERROR([ Build requirements (valac) were not met: Please install Vala >= 0.28 and try again. https://wiki.gnome.org/Projects/Vala ]) )] ) C_PROG_INSTALL() AC_PROG_MKDIR_P() AC_PROG_SED() dnl dnl i18n dnl AM_GLIB_GNU_GETTEXT() GETTEXT_PACKAGE=AC_PACKAGE_NAME AC_SUBST([GETTEXT_PACKAGE]) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain]) dnl dnl Call to intltoolize chokes on indentation dnl IT_PROG_INTLTOOL() dnl dnl Initialize libtool dnl LT_INIT() dnl dnl Check for libraries. dnl PKG_PROG_PKG_CONFIG() PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.9) PKG_CHECK_MODULES(FREETYPE, freetype2 >= 2.5) PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.1) PKG_CHECK_MODULES(GOBJECT, gobject-2.0 >= 2.4) PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.4) PKG_CHECK_MODULES(JSONGLIB, json-glib-1.0 >= 0.15) PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= 2.4) PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.4) PKG_CHECK_MODULES(CAIRO, cairo >= 1.1) PKG_CHECK_MODULES(GTK_316, gtk+-3.0 >= 3.16) PKG_CHECK_MODULES(PANGO, pango >= 1.3) PKG_CHECK_MODULES(PANGOCAIRO, pangocairo >= 1.3) PKG_CHECK_MODULES(PANGOFT2, pangoft2 >= 1.3) PKG_CHECK_MODULES(GEE, gee-0.8 >= 0.14) PKG_CHECK_MODULES(GUCHARMAP, gucharmap-2.90 >= 3.12) PKG_CHECK_MODULES(SQLITE3, sqlite3 >= 3.8) dnl dnl GSettings support dnl GLIB_GSETTINGS() dnl dnl Check for yelp-tools dnl AC_CHECK_PROG(YELP_TOOLS, "yelp-build", yes) if test "x$YELP_TOOLS" != "xyes"; then AC_MSG_ERROR([ Application requirements (yelp-tools) were not met: Please install yelp-tools and try again. https://wiki.gnome.org/Apps/Yelp/Tools ]) fi dnl dnl Initialize yelp support dnl YELP_HELP_INIT() dnl dnl Check for supporting applications dnl file_roller_support="no" AC_ARG_WITH([file-roller], AS_HELP_STRING([--with-file-roller], [file-roller support])) AS_IF([test "x$with_file_roller" = "xyes"], [ AC_SUBST(HAVE_FILE_ROLLER, [" -D HAVE_FILE_ROLLER"]), file_roller_support="yes" ]) dnl dnl Optional Extensions dnl # Don't check for extension requirements to avoid build deps. AC_ARG_WITH([nautilus], AS_HELP_STRING([--with-nautilus], [Install Nautilus extension])) AC_ARG_WITH([nemo], AS_HELP_STRING([--with-nemo], [Install Nemo extension])) AC_ARG_WITH([thunarx], AS_HELP_STRING([--with-thunarx], [Install Thunar extension])) AM_CONDITIONAL(COMPILE_PYTHON_EXTENSIONS, [test '']) AM_CONDITIONAL(INSTALL_NAUTILUS_EXTENSION, [test '']) AM_CONDITIONAL(INSTALL_NEMO_EXTENSION, [test '']) AM_CONDITIONAL(INSTALL_THUNAR_EXTENSION, [test '']) file_browser_support="no" AS_IF( [test "x$with_nautilus" = "xyes" -o "x$with_nemo" = "xyes" -o "x$with_thunarx" = "xyes"], [file_browser_support="yes"] ) dnl dnl Debian policy discourages shipping compiled python files. dnl Red Hat policy encourages shipping compiled python files. dnl Others, who knows? dnl AC_ARG_ENABLE([pycompile], AS_HELP_STRING([--disable-pycompile], [Disable compilation of Python extensions])) AS_IF([test "x$file_browser_support" != "xno" -a "x$enable_pycompile" != "xno"], [ AM_PATH_PYTHON AM_CONDITIONAL([COMPILE_PYTHON_EXTENSIONS], [test "x$enable_pycompile" != "xno"]) ]) AM_CONDITIONAL([INSTALL_NAUTILUS_EXTENSION],[test "x$with_nautilus" = "xyes"]) AM_CONDITIONAL([INSTALL_NEMO_EXTENSION],[test "x$with_nemo" = "xyes"]) AM_CONDITIONAL([INSTALL_THUNAR_EXTENSION], [test "x$with_thunarx" = "xyes"]) dnl dnl Output files dnl AC_CONFIG_FILES([ Makefile extensions/Makefile help/Makefile lib/Makefile lib/Common/About.vala lib/Common/Collections.vala lib/Common/Constants.vala lib/Common/Database.vala lib/Common/Settings.vala lib/FontConfig/Sources.vala lib/Glue/Makefile lib/UX/Utils/Utils.vala po/Makefile.in data/Makefile data/org.gnome.FontManager.appdata.xml data/org.gnome.FontManager.desktop data/org.gnome.FontViewer.desktop help/font-manager.1 src/Makefile src/font-manager/Makefile src/font-manager/Application.vala src/font-manager/Main.vala src/font-manager/Migration.vala src/font-viewer/Makefile src/font-viewer/Application.vala tests/Makefile ]) AC_OUTPUT dnl dnl Useful? information dnl echo " Font Manager $PACKAGE_VERSION C compiler: ${CC} Vala compiler: ${VALAC} Installation prefix: ${prefix} Archive Support: $file_roller_support File Browser Support: $file_browser_support " AS_IF([test "x$with_nautilus" = "xyes"], [ echo " The Nautilus file manager extension requires nautilus-python Nautilus python bindings are available on most distributions. https://wiki.gnome.org/Projects/NautilusPython " ]) AS_IF([test "x$with_nemo" = "xyes"], [ echo " The Nemo file manager extension requires nemo-python https://github.com/linuxmint/nemo-extensions/tree/master/nemo-python " ]) AS_IF([test "x$with_thunarx" = "xyes"], [ echo " The Thunar file manager extension requires thunarx-python http://goodies.xfce.org/projects/bindings/thunarx-python Ubuntu/Debian users should see README file in extensions/ " ]) master-0.7.3/data/000077500000000000000000000000001300074171200137205ustar00rootroot00000000000000master-0.7.3/data/ApplicationMenu.ui000077500000000000000000000045221300074171200173550ustar00rootroot00000000000000
_Help app.help F1 _About app.about _Quit app.quit <Primary>q
_About app.about _Quit app.quit <Primary>q
master-0.7.3/data/FontManager.css000066400000000000000000000020571300074171200166370ustar00rootroot00000000000000/* FontManager.css * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ * { -GtkPaned-handle-size: 0; } .red { background-color: #ff0000; } .green { background-color: #008000; } .blue { background-color: #0000ff; } .gray { background-color: #808080; } .separator { padding: 0px; } master-0.7.3/data/FontManagerGResource.xml000077500000000000000000000022231300074171200204640ustar00rootroot00000000000000 FontManager.css ApplicationMenu.ui icons/null.svg icons/opentype.svg icons/truetype.svg icons/type1.svg icons/16x16/actions/info-symbolic.svg icons/16x16/actions/info-symbolic-rtl.svg icons/16x16/actions/stock-eye-symbolic.svg icons/16x16/actions/stock-eye-symbolic-rtl.svg icons/16x16/actions/document-send-symbolic.svg master-0.7.3/data/Makefile.am000066400000000000000000000035151300074171200157600ustar00rootroot00000000000000 gsettings_SCHEMAS = \ org.gnome.FontManager.gschema.xml \ org.gnome.FontViewer.gschema.xml desktopdir = $(datadir)/applications dist_desktop_in_files = \ org.gnome.FontManager.desktop.in \ org.gnome.FontViewer.desktop.in dist_desktop_DATA = $(dist_desktop_in_files:.desktop.in=.desktop) appdatadir = $(datarootdir)/appdata appdata_in_files = org.gnome.FontManager.appdata.xml.in appdata_DATA = $(appdata_in_files:.xml.in=.xml) # Without an icon the application is vetoed by appstream appicondir = $(datadir)/font-manager/icons dist_appicon_DATA = preferences-desktop-font.svg @GSETTINGS_RULES@ @INTLTOOL_DESKTOP_RULE@ @INTLTOOL_XML_RULE@ org.gnome.FontManager.service: $(AM_V_GEN) (echo '[D-BUS Service]'; \ echo 'Name=org.gnome.FontManager'; \ echo 'Exec=${bindir}/$(PACKAGE_NAME) --gapplication-service') > $@.tmp && \ mv $@.tmp $@ org.gnome.FontViewer.service: $(AM_V_GEN) (echo '[D-BUS Service]'; \ echo 'Name=org.gnome.FontViewer'; \ echo 'Exec=${pkglibexecdir}/font-viewer --gapplication-service') > $@.tmp && \ mv $@.tmp $@ dbusservicedir = $(datadir)/dbus-1/services dbusservice_DATA = \ org.gnome.FontManager.service \ org.gnome.FontViewer.service CLEANFILES = \ $(appdata_DATA) \ $(dist_desktop_DATA) \ $(dbusservice_DATA) \ gschemas.compiled DISTCLEANFILES = \ $(appdata_DATA) \ $(dist_desktop_DATA) \ $(dbusservice_DATA) EXTRA_DIST = \ icons \ FontManagerGResource.xml \ FontManager.css \ ApplicationMenu.ui \ $(gsettings_SCHEMAS) \ $(dist_desktop_in_files) \ $(appdata_in_files) MAINTAINERCLEANFILES = \ Makefile.in # Allow running without installation compile-gsettings-schemas: $(GLIB_COMPILE_SCHEMAS) ./ all: compile-gsettings-schemas org.gnome.FontManager.service org.gnome.FontViewer.service $(SED) -i 's|\@PKGLIBEXECDIR\@|${pkglibexecdir}|g' org.gnome.FontViewer.desktop .PHONY: compile-gsettings-schemas master-0.7.3/data/icons/000077500000000000000000000000001300074171200150335ustar00rootroot00000000000000master-0.7.3/data/icons/16x16/000077500000000000000000000000001300074171200156205ustar00rootroot00000000000000master-0.7.3/data/icons/16x16/actions/000077500000000000000000000000001300074171200172605ustar00rootroot00000000000000master-0.7.3/data/icons/16x16/actions/document-send-symbolic.svg000066400000000000000000000112171300074171200243670ustar00rootroot00000000000000 image/svg+xml Gnome Symbolic Icon Theme Gnome Symbolic Icon Theme master-0.7.3/data/icons/16x16/actions/info-symbolic-rtl.svg000066400000000000000000000037141300074171200233570ustar00rootroot00000000000000 image/svg+xml master-0.7.3/data/icons/16x16/actions/info-symbolic.svg000066400000000000000000000037141300074171200225600ustar00rootroot00000000000000 image/svg+xml master-0.7.3/data/icons/16x16/actions/stock-eye-symbolic-rtl.svg000066400000000000000000000067631300074171200243360ustar00rootroot00000000000000 image/svg+xml Gnome Symbolic Icon Theme Gnome Symbolic Icon Theme master-0.7.3/data/icons/16x16/actions/stock-eye-symbolic.svg000066400000000000000000000067631300074171200235370ustar00rootroot00000000000000 image/svg+xml Gnome Symbolic Icon Theme Gnome Symbolic Icon Theme master-0.7.3/data/icons/null.svg000066400000000000000000000030451300074171200165300ustar00rootroot00000000000000 image/svg+xml master-0.7.3/data/icons/opentype.svg000066400000000000000000000136771300074171200174350ustar00rootroot00000000000000 image/svg+xml master-0.7.3/data/icons/truetype.svg000066400000000000000000000072671300074171200174510ustar00rootroot00000000000000 image/svg+xml master-0.7.3/data/icons/type1.svg000066400000000000000000000160141300074171200166200ustar00rootroot00000000000000 image/svg+xml master-0.7.3/data/org.gnome.FontManager.appdata.xml.in000066400000000000000000000033451300074171200225600ustar00rootroot00000000000000 JerryCasiano_at_gmail.com org.gnome.FontManager.desktop CC0-1.0 GPL-3.0+ Font Manager A simple font management application for Gtk+ Desktop Environments

Font Manager is intended to provide a way for average users to easily manage desktop fonts, without having to resort to command line tools or editing configuration files by hand.

While designed primarily with the Gnome Desktop Environment in mind, it should work well with other Gtk+ desktop environments.

Font Manager is NOT a professional-grade font management solution.

El propósito de Font Manager es permitir que los usuarios de a pie gestionen con facilidad los tipos de letra de sus equipos, sin necesidad de recurrir a herramientas de consola ni a editar archivos de configuración a mano.

Aunque el diseño de la aplicación se basó en el entorno de escritorio de Gnome, esta debe funcionar correctamente en otras plataformas que utilicen Gtk+.

Font Manager NO es una aplicación de gestión tipográfica de nivel profesional.

@PACKAGE_URL@ http://raw.githubusercontent.com/FontManager/resources/master/font-manager_default-theme.png
master-0.7.3/data/org.gnome.FontManager.desktop.in000066400000000000000000000006511300074171200220150ustar00rootroot00000000000000[Desktop Entry] Type=Application Version=1.0 Name=Font Manager GenericName=Font Manager Comment=Preview, Compare and Manage Fonts Icon=preferences-desktop-font DBusActivatable=true Exec=@PACKAGE_NAME@ %u Terminal=false MimeType=application/x-font-ttf;application/x-font-type1;application/x-font-otf; Categories=GTK;GNOME;Utility;Graphics;Viewer;Publishing; Keywords=Graphics;Viewer;GNOME;GTK;Publishing; StartupNotify=true master-0.7.3/data/org.gnome.FontManager.gschema.xml000077500000000000000000000171641300074171200221570ustar00rootroot00000000000000 "Manage" Mode Possible modes are Manage, Browse and Compare. true Layout type false for default layout, true for 3 column layout true Layout type Switch to wide layout when window is maximized true Use CSD false to disable Client Side Decorations Window position On screen position of the main window. (x, y) (-1, -1) Window size Width and height of the main window. (700, 480) Sidebar size Size of the sidebar in pixels. 200 Sidebar Mode Possible modes are Category and Collection. "Category" Content area size Position of the content pane. 150 Content area size Position of the content pane. 150 Content area size Position of the content pane. 150 Preview font size Size point to use in the preview area. 10.0 Preview Mode Possible modes are Preview, Waterfall and Body Text. "Waterfall" Selected preview page Last selected preview page 0 Preview text Last preview text used "DEFAULT" Browser font size Size point to use in Browse mode. 12.0 Compare font size Size point to use in Compare mode. 12.0 Compare mode foreground color Color to use for foreground (text color) in RGB format. "rgb(0,0,0)" Compare mode background color Color to use for background in RGB format "rgb(255,255,255)" Compare list Array of string containing font descriptions to compare. [] Character Map font size Size point to use in Character Map Mode. 14.0 Character Map Mode Possible modes are Script and Block "Script" Selected Script Last selected script in Character Map mode "56" Selected Unicode Block Last selected unicode block in Character Map mode "1" Selected Category Last selected category "0" Selected Collection Last selected collection "0" Selected Font Last selected Font "0" master-0.7.3/data/org.gnome.FontViewer.desktop.in000066400000000000000000000006761300074171200217130ustar00rootroot00000000000000[Desktop Entry] Type=Application Version=1.0 Name=Font Viewer GenericName=Font Viewer Comment=Full featured font file preview application Icon=preferences-desktop-font DBusActivatable=true Exec=@PKGLIBEXECDIR@/font-viewer %u Terminal=false MimeType=application/x-font-ttf;application/x-font-type1;application/x-font-otf; Categories=GTK;GNOME;Utility;Graphics;Viewer;Publishing; Keywords=Graphics;Viewer;GNOME;GTK;Publishing; StartupNotify=true master-0.7.3/data/org.gnome.FontViewer.gschema.xml000077500000000000000000000050421300074171200220360ustar00rootroot00000000000000 "Waterfall" Preview Mode Possible modes are Preview, Waterfall and Body Text. Window position On screen position of the main window. (x, y) (-1, -1) Window size Width and height of the main window. (600, 400) Preview font size Size point to use in the preview area. 10.0 Preview text Last preview text used "DEFAULT" Character Map font size Size point to use in Character Map Mode. 16.0 master-0.7.3/data/preferences-desktop-font.svg000066400000000000000000000507741300074171200213720ustar00rootroot00000000000000 image/svg+xml Width: 2pxBlur: 12Opacity: 60 A A master-0.7.3/debian/000077500000000000000000000000001300074171200142315ustar00rootroot00000000000000master-0.7.3/debian/changelog000066400000000000000000000003111300074171200160760ustar00rootroot00000000000000font-manager (0.7.3-1ubuntu1) UNRELEASED; urgency=medium * Refer to https://github.com/FontManager/master/commits/master. -- JerryCasiano Sun, 19 Jun 2016 19:46:39 -0400 master-0.7.3/debian/compat000066400000000000000000000000021300074171200154270ustar00rootroot000000000000009 master-0.7.3/debian/control000066400000000000000000000041501300074171200156340ustar00rootroot00000000000000Source: font-manager Priority: optional Maintainer: Jerry Casiano Build-Depends: dpkg (>= 1.15.7.2), dh-autoreconf, debhelper (>= 9), automake (>= 1.14), autoconf (>= 2.69), autotools-dev, valac (>= 0.24), intltool, libxml2-dev, libfreetype6-dev, libfontconfig1-dev, libglib2.0-dev, libjson-glib-dev, libcairo2-dev, libgtk-3-dev (>= 3.12), libpango1.0-dev, libgee-0.8-dev, libgucharmap-2-90-dev, libsqlite3-dev, libgirepository1.0-dev, file-roller, yelp-tools, python, python-gobject, python-nautilus (>= 1.0) Standards-Version: 3.9.6 Section: graphics Homepage: http://fontmanager.github.io/ Package: font-manager Architecture: any Depends: font-manager-common, font-viewer, yelp, file-roller, ${misc:Depends}, ${shlibs:Depends} Suggests: nautilus-font-manager Description: Simple font management application for Gtk+ Desktop Environments Font Manager is intended to provide a way for average users to easily manage desktop fonts, without having to resort to command line tools or editing configuration files by hand. While designed primarily with the GNOME Desktop Environment in mind, it should work well with other Gtk+ desktop environments. . Font Manager is NOT a professional-grade font management solution. Package: font-manager-common Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends} Description: Common files required by font-manager and font-viewer . This package provides common files such as libraries, translations, help files, etc. Package: font-viewer Architecture: any Multi-Arch: same Depends: font-manager-common, ${shlibs:Depends}, ${misc:Depends} Description: Full featured font file preview application for GTK+ Desktop Environments . This package provides the font-viewer component of font-manager. Package: nautilus-font-manager Architecture: all Depends: font-viewer, nautilus (>= 3.0), python-gobject, python-dbus, python-nautilus (>= 1.0), ${misc:Depends} Description: Nautilus extension for Font Manager . This package provides integration with the Nautilus file manager. master-0.7.3/debian/copyright000066400000000000000000000016221300074171200161650ustar00rootroot00000000000000Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Font Manager Upstream-Contact: Jerry Casiano Source: http://fontmanager.github.io/ Files: * Copyright: 2009 - 2016 Jerry Casiano License: GPL-3+ 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 package 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. . On Debian systems, the full text of the GNU General Public License version 3 can be found in the file `/usr/share/common-licenses/GPL-3'. master-0.7.3/debian/docs000066400000000000000000000000071300074171200151010ustar00rootroot00000000000000README master-0.7.3/debian/font-manager-common.install000066400000000000000000000002471300074171200214700ustar00rootroot00000000000000usr/lib/*/font-manager/libfontmanager-0.7.3.so usr/lib/*/font-manager/libfontmanager.so usr/share/help/*/font-manager/* usr/share/locale/*/LC_MESSAGES/font-manager.mo master-0.7.3/debian/font-manager-common.lintian-overrides000066400000000000000000000002021300074171200234470ustar00rootroot00000000000000font-manager-common binary: postinst-has-useless-call-to-ldconfig font-manager-common binary: postrm-has-useless-call-to-ldconfig master-0.7.3/debian/font-manager.install000066400000000000000000000004611300074171200202000ustar00rootroot00000000000000usr/bin/font-manager usr/share/appdata/org.gnome.FontManager.appdata.xml usr/share/glib-2.0/schemas/org.gnome.FontManager.gschema.xml usr/share/applications/org.gnome.FontManager.desktop usr/share/dbus-1/services/org.gnome.FontManager.service usr/share/font-manager/icons/preferences-desktop-font.svg master-0.7.3/debian/font-manager.manpages000066400000000000000000000000241300074171200203200ustar00rootroot00000000000000help/font-manager.1 master-0.7.3/debian/font-viewer.install000066400000000000000000000003121300074171200200620ustar00rootroot00000000000000usr/lib/*/font-manager/font-viewer usr/share/glib-2.0/schemas/org.gnome.FontViewer.gschema.xml usr/share/applications/org.gnome.FontViewer.desktop usr/share/dbus-1/services/org.gnome.FontViewer.service master-0.7.3/debian/nautilus-font-manager.install000066400000000000000000000000661300074171200220430ustar00rootroot00000000000000usr/share/nautilus-python/extensions/font-manager.py master-0.7.3/debian/nautilus-font-manager.postinst000066400000000000000000000023311300074171200222550ustar00rootroot00000000000000#!/bin/sh # postinst script for nautilus-font-manager # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) python -m compileall /usr/share/nautilus-python/extensions/ python -O -m compileall /usr/share/nautilus-python/extensions/ ;; abort-upgrade|abort-remove|abort-deconfigure) python -m compileall /usr/share/nautilus-python/extensions/ python -O -m compileall /usr/share/nautilus-python/extensions/ ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 master-0.7.3/debian/nautilus-font-manager.postrm000066400000000000000000000020661300074171200217230ustar00rootroot00000000000000#!/bin/sh # postrm script for nautilus-font-manager # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) rm -f /usr/share/nautilus-python/extensions/font-manager.pyc rm -f /usr/share/nautilus-python/extensions/font-manager.pyo ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 master-0.7.3/debian/postinst000066400000000000000000000020541300074171200160400ustar00rootroot00000000000000#!/bin/sh # postinst script for font-manager # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) glib-compile-schemas /usr/share/glib-2.0/schemas ;; abort-upgrade|abort-remove|abort-deconfigure) glib-compile-schemas /usr/share/glib-2.0/schemas ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 master-0.7.3/debian/postrm000066400000000000000000000017341300074171200155050ustar00rootroot00000000000000#!/bin/sh # postrm script for font-manager # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) glib-compile-schemas /usr/share/glib-2.0/schemas ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 master-0.7.3/debian/rules000077500000000000000000000005071300074171200153130ustar00rootroot00000000000000#!/usr/bin/make -f # -*- makefile -*- DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) %: dh $@ --with autoreconf override_dh_autoreconf: dh_autoreconf --as-needed ./autogen.sh -- --with-nautilus --with-file-roller override_dh_auto_configure: dh_auto_configure -- --with-nautilus --with-file-roller master-0.7.3/debian/source/000077500000000000000000000000001300074171200155315ustar00rootroot00000000000000master-0.7.3/debian/source/format000077500000000000000000000000141300074171200167420ustar00rootroot000000000000003.0 (quilt) master-0.7.3/debian/source/options000066400000000000000000000001231300074171200171430ustar00rootroot00000000000000# Do not generate diff for changes in autogen.sh extend-diff-ignore = "autogen.sh" master-0.7.3/extensions/000077500000000000000000000000001300074171200152065ustar00rootroot00000000000000master-0.7.3/extensions/Makefile.am000066400000000000000000000014711300074171200172450ustar00rootroot00000000000000 if INSTALL_NAUTILUS_EXTENSION extension_nautilus_dir = ${datarootdir}/nautilus-python/extensions/ if COMPILE_PYTHON_EXTENSIONS extension_nautilus__PYTHON = Nautilus/$(PACKAGE_NAME).py else extension_nautilus__DATA = Nautilus/$(PACKAGE_NAME).py endif endif if INSTALL_NEMO_EXTENSION extension_nemo_dir = ${datarootdir}/nemo-python/extensions/ if COMPILE_PYTHON_EXTENSIONS extension_nemo__PYTHON = Nemo/$(PACKAGE_NAME).py else extension_nemo__DATA = Nemo/$(PACKAGE_NAME).py endif endif if INSTALL_THUNAR_EXTENSION extension_thunar_dir = ${datarootdir}/thunarx-python/extensions/ if COMPILE_PYTHON_EXTENSIONS extension_thunar__PYTHON = Thunar/$(PACKAGE_NAME).py else extension_thunar__DATA = Thunar/$(PACKAGE_NAME).py endif endif EXTRA_DIST = \ Nautilus \ Nemo \ Thunar \ README MAINTAINERCLEANFILES = \ ./Makefile.in master-0.7.3/extensions/Nautilus/000077500000000000000000000000001300074171200170125ustar00rootroot00000000000000master-0.7.3/extensions/Nautilus/font-manager.py000066400000000000000000000044701300074171200217470ustar00rootroot00000000000000# -*- coding: utf-8 -*- # # Copyright (C) 2009 - 2016 Jerry Casiano # # This file is part of Font Manager. # # Font Manager 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. # # Font Manager 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 Font Manager. If not, see . # # Author: # Jerry Casiano import dbus from dbus.mainloop.glib import DBusGMainLoop from gi.repository import GObject, Nautilus SupportedMimeTypes = [ "application/x-font-ttf", "application/x-font-ttc", "application/x-font-otf", "application/x-font-type1" ] def is_font_file (f): return f.get_mime_type() in SupportedMimeTypes class FontViewer (GObject.GObject, Nautilus.MenuProvider): Active = False def __init__ (self): print("Initializing nautilus-font-manager extension") DBusGMainLoop(set_as_default=True) self.bus = dbus.SessionBus() self.bus.watch_name_owner('org.gnome.FontViewer', FontViewer.set_state) def get_file_items (self, window, files): if FontViewer.Active and len(files) == 1: selected_file = files[0] if is_font_file(selected_file): try: proxy = self.bus.get_object('org.gnome.FontViewer', '/org/gnome/FontViewer') ready = proxy.get_dbus_method('Ready', 'org.gnome.FontViewer') if ready(): show_uri = proxy.get_dbus_method('ShowUri', 'org.gnome.FontViewer') show_uri('{0}'.format(selected_file.get_activation_uri())) except: pass return def get_background_items (self, window, folder): return @staticmethod def set_state (s): if s.strip() != '': FontViewer.Active = True else: FontViewer.Active = False return master-0.7.3/extensions/Nemo/000077500000000000000000000000001300074171200161045ustar00rootroot00000000000000master-0.7.3/extensions/Nemo/font-manager.py000066400000000000000000000044541300074171200210430ustar00rootroot00000000000000# -*- coding: utf-8 -*- # # Copyright (C) 2009 - 2016 Jerry Casiano # # This file is part of Font Manager. # # Font Manager 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. # # Font Manager 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 Font Manager. If not, see . # # Author: # Jerry Casiano import dbus from dbus.mainloop.glib import DBusGMainLoop from gi.repository import GObject, Nemo SupportedMimeTypes = [ "application/x-font-ttf", "application/x-font-ttc", "application/x-font-otf", "application/x-font-type1" ] def is_font_file (f): return f.get_mime_type() in SupportedMimeTypes class FontViewer (GObject.GObject, Nemo.MenuProvider): Active = False def __init__ (self): print("Initializing nemo-font-manager extension") DBusGMainLoop(set_as_default=True) self.bus = dbus.SessionBus() self.bus.watch_name_owner('org.gnome.FontViewer', FontViewer.set_state) def get_file_items (self, window, files): if FontViewer.Active and len(files) == 1: selected_file = files[0] if is_font_file(selected_file): try: proxy = self.bus.get_object('org.gnome.FontViewer', '/org/gnome/FontViewer') ready = proxy.get_dbus_method('Ready', 'org.gnome.FontViewer') if ready(): show_uri = proxy.get_dbus_method('ShowUri', 'org.gnome.FontViewer') show_uri('{0}'.format(selected_file.get_activation_uri())) except: pass return def get_background_items (self, window, folder): return @staticmethod def set_state (s): if s.strip() != '': FontViewer.Active = True else: FontViewer.Active = False return master-0.7.3/extensions/README000066400000000000000000000027621300074171200160750ustar00rootroot00000000000000These file manager extensions are intended to provide integration with popular GTK+ file managers and the font-viewer component of font-manager. While the font-viewer is open you should be able to preview font files simply by selecting them. To install, copy the extension to one of the following directories. You may need to create the directory if it doesn't exist. Nautilus: /usr/share/nautilus-python/extensions/ ~/.local/share/nautilus-python/extensions/ Thunar: /usr/share/thunarx-python/extensions/ ~/.local/share/thunarx-python/extensions/ Nemo: /usr/share/nemo-python/extensions/ ~/.local/share/nemo-python/extensions/ If you installed the extension to a system directory, compile the extension For example: python -m compileall /usr/share/nautilus-python/extensions/ python -O -m compileall /usr/share/nautilus-python/extensions/ Nautilus python bindings are available on most distributions. https://wiki.gnome.org/Projects/NautilusPython For Thunar python bindings http://goodies.xfce.org/projects/bindings/thunarx-python Ubuntu/Debian users can find thunarx-python in the RabbitVCS PPA. For Nemo python bindings https://github.com/linuxmint/nemo-extensions/tree/master/nemo-python KNOWN ISSUES Ubuntu/Debian users *may* need to create a symbolic link to prevent Thunar from crashing. sudo ln -sf /usr/lib/i386-linux-gnu/libpython2.7.so.1 /usr/lib/libpython2.7.so.1.0 This is not an issue specific to this extension. ` master-0.7.3/extensions/Thunar/000077500000000000000000000000001300074171200164475ustar00rootroot00000000000000master-0.7.3/extensions/Thunar/font-manager.py000066400000000000000000000044411300074171200214020ustar00rootroot00000000000000# -*- coding: utf-8 -*- # # Copyright (C) 2009 - 2016 Jerry Casiano # # This file is part of Font Manager. # # Font Manager 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. # # Font Manager 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 Font Manager. If not, see . # # Author: # Jerry Casiano import dbus import thunarx from dbus.mainloop.glib import DBusGMainLoop SupportedMimeTypes = [ "application/x-font-ttf", "application/x-font-ttc", "application/x-font-otf", "application/x-font-type1" ] def is_font_file (f): return f.get_mime_type() in SupportedMimeTypes class FontViewer (thunarx.MenuProvider): Active = False def __init__ (self): DBusGMainLoop(set_as_default=True) self.bus = dbus.SessionBus() self.bus.watch_name_owner('org.gnome.FontViewer', FontViewer.set_state) def get_file_actions (self, window, files): if FontViewer.Active and len(files) == 1: selected_file = files[0] if is_font_file(selected_file): if (selected_file.get_location().get_path() is None): return try: proxy = self.bus.get_object('org.gnome.FontViewer', '/org/gnome/FontViewer') ready = proxy.get_dbus_method('Ready', 'org.gnome.FontViewer') if ready(): show_uri = proxy.get_dbus_method('ShowUri', 'org.gnome.FontViewer') show_uri('{0}'.format(selected_file.get_uri())) except: pass return def get_folder_actions (self, window, folder): return @staticmethod def set_state (s): if s.strip() != '': FontViewer.Active = True else: FontViewer.Active = False return master-0.7.3/fedora/000077500000000000000000000000001300074171200142475ustar00rootroot00000000000000master-0.7.3/fedora/font-manager.spec000066400000000000000000000135371300074171200175120ustar00rootroot00000000000000%define MajorVersion 0 %define MinorVersion 7 %define MicroVersion 3 %define DBusName org.gnome.FontManager %define DBusName2 org.gnome.FontViewer %define DownloadURL https://github.com/FontManager/master/releases/download Name: font-manager Version: %{MajorVersion}.%{MinorVersion}.%{MicroVersion} Release: 9 Summary: A simple font management application for Gtk+ Desktop Environments License: GPLv3+ Url: http://fontmanager.github.io/ Source0: %{DownloadURL}/%{version}/%{name}-%{version}.tar.bz2 BuildRequires: cairo-devel BuildRequires: file-roller BuildRequires: fontconfig-devel BuildRequires: freetype-devel BuildRequires: glib2-devel BuildRequires: gobject-introspection-devel BuildRequires: gtk3-devel >= 3.12 BuildRequires: gucharmap-devel BuildRequires: intltool BuildRequires: json-glib-devel BuildRequires: libappstream-glib BuildRequires: libgee-devel BuildRequires: libxml2-devel BuildRequires: pango-devel BuildRequires: sqlite-devel BuildRequires: vala >= 0.24 BuildRequires: yelp-tools Requires: fontconfig Requires: file-roller Requires: font-manager-common Requires: font-viewer Requires: freetype Requires: gtk3 >= 3.12 Requires: gucharmap-libs Requires: json-glib Requires: libgee Requires: sqlite Requires: yelp %description Font Manager is intended to provide a way for average users to easily manage desktop fonts, without having to resort to command line tools or editing configuration files by hand. While designed primarily with the Gnome Desktop Environment in mind, it should work well with other Gtk+ desktop environments. Font Manager is NOT a professional-grade font management solution. %package -n %{name}-common Summary: Common files used by font-manager %description -n %{name}-common This package contains common files such as libraries, help files, translations, etc. These files are required by font-manager and font-viewer. %package -n font-viewer Summary: Full featured font file preview application for GTK+ Desktop Environments Requires: font-manager-common >= %{version} %description -n font-viewer This package contains the font-viewer component of font-manager. %package -n nautilus-font-manager BuildArch: noarch Summary: Nautilus extension for font-manager Requires: font-viewer >= %{version} Requires: font-manager-common >= %{version} Requires: nautilus-python Requires: dbus-python %description -n nautilus-font-manager This package provides integration with the Nautilus file manager. %package -n nemo-font-manager BuildArch: noarch Summary: Nemo extension for Font Manager Requires: font-viewer >= %{version} Requires: font-manager-common >= %{version} Requires: nemo-python Requires: dbus-python %description -n nemo-font-manager This package provides integration with the Nemo file manager. %package -n thunarx-font-manager BuildArch: noarch Summary: Thunar extension for Font Manager Requires: font-viewer >= %{version} Requires: font-manager-common >= %{version} Requires: thunarx-python Requires: dbus-python %description -n thunarx-font-manager This package provides integration with the Thunar file manager. %prep %setup -q %build %configure --disable-schemas-compile --with-file-roller --with-nautilus --with-nemo --with-thunarx make %check appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata.xml %install %make_install %find_lang %name %posttrans /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %files %{_bindir}/%{name} %{_datadir}/appdata/%{DBusName}.appdata.xml %{_datadir}/applications/%{DBusName}.desktop %{_datadir}/dbus-1/services/%{DBusName}.service %{_datadir}/glib-2.0/schemas/%{DBusName}.gschema.xml %{_datadir}/%{name}/icons/preferences-desktop-font.svg %{_mandir}/man1/%{name}.* %files -n %{name}-common -f %{name}.lang %doc README %{_libdir}/%{name} %{_datadir}/help/*/%{name} %files -n font-viewer %{_libexecdir}/%{name}/font-viewer %{_datadir}/applications/%{DBusName2}.desktop %{_datadir}/dbus-1/services/%{DBusName2}.service %{_datadir}/glib-2.0/schemas/%{DBusName2}.gschema.xml %files -n nautilus-font-manager %{_datadir}/nautilus-python/extensions/%{name}.py* %files -n nemo-font-manager %{_datadir}/nemo-python/extensions/%{name}.py* %files -n thunarx-font-manager %{_datadir}/thunarx-python/extensions/%{name}.py* %changelog * Sun Oct 16 2016 JerryCasiano 0.7.3-9 - Fix extension requirements * Sat Jun 4 2016 JerryCasiano 0.7.3-8 - Fix initial window size issue on Gtk+ > 3.18 * Wed Jun 1 2016 JerryCasiano 0.7.3-7 - Add Polish translation provided by Piotr Strębski * Thu May 26 2016 JerryCasiano 0.7.3-6 - Add manual page * Thu Apr 21 2016 JerryCasiano 0.7.3-5 - Drop build deps for python extensions - Enable all extensions - Update to latest git * Sat Mar 5 2016 JerryCasiano 0.7.3-4 - Update to latest git to include new features. - Added preference pane. * Wed Jan 06 2016 JerryCasiano 0.7.3-3 - Update to latest git to include bug fixes. * Wed Dec 23 2015 JerryCasiano 0.7.3-2 - Leigh Scott enabled nemo extension for actual Fedora package - Must *work* on Cinnamon... * Tue Dec 8 2015 JerryCasiano 0.7.3-1 - Update to testing branch 0.7.3 * Sat Jun 06 2015 JerryCasiano 0.7.2-5 - Add missing Requires for Nautilus extension. * Sat Jun 06 2015 JerryCasiano 0.7.2-4 - Add missing BuildRequires for file-roller. Fails to mock. * Tue Jun 02 2015 JerryCasiano 0.7.2-3 - Adhere to https://fedoraproject.org/wiki/Packaging:AppData * Thu May 28 2015 JerryCasiano 0.7.2-2 - Add missing Requires * Sun Jan 25 2015 JerryCasiano 0.7.2-1 - Update to 0.7.2 * Sat Dec 13 2014 JerryCasiano 0.7.1-1 - Initial build. master-0.7.3/help/000077500000000000000000000000001300074171200137375ustar00rootroot00000000000000master-0.7.3/help/C/000077500000000000000000000000001300074171200141215ustar00rootroot00000000000000master-0.7.3/help/C/index.page000066400000000000000000000033551300074171200160740ustar00rootroot00000000000000 Font Manager Simple font management for GTK+ desktop environments Jerry Casiano JerryCasiano@gmail.com 2009-2016

GNU General Public License Version 3

<media type="image" mime="image/png" src="media/logo.png">Font Manager logo</media> Font Manager Help has not been implemented yet.

If you would like to help this project by providing help documentation please see Project Mallard for more information.

If you do decide to help, please file an issue at https://github.com/FontManager/master/issues detailing what you intend to work on.

Thank you.

Localization

If you would like to help this application reach more users in their native language please see Zanata for more information.

You can also file an issue at https://github.com/FontManager/master/issues and attach any translated files there.

master-0.7.3/help/C/media/000077500000000000000000000000001300074171200152005ustar00rootroot00000000000000master-0.7.3/help/C/media/logo.png000066400000000000000000000065151300074171200166550ustar00rootroot00000000000000‰PNG  IHDR77¨ÛÒFsBIT|dˆ IDAThÝš[ŒÇu†¿ª¾ÌÌÎÃ]ÞDŠ¥µ[FCŒ Kf”0‘¨8PÂ$€äÑïü– /yHÀ$A1`ÙÁÚ˜’¬H¢e-mZ”,QŠD›Ü¥x‘{árw¹;ܙàIJü2-B$7|êÈ‘#¿J z­Lî\ǽ{÷ÖOœ8ñ'[·n½KJéI)ÑZ—Zøÿ²I)Ö­µšžž>¹{÷î¯8p =66õ=¼sçÎ*°}rròkI’hó+Ô’$Ñ“““_¶g8€Ìr§OŸ®ìÚµË>|øK£££•RQE Œ1•1úš1!Zk„!z}€=ÏóüÑÑу‡>¹ÿþ¿Éðt}€V«áæÍ›ïTE¦R© i­K'+Nr³Á)¥Î+¥¤ÛívkµšÊ䯷Z­HÁ:uÊÖ !BÀcŒÑZ ;˜;¨ÕäͶª3Žc‚ è›;l…ð2ù×:uj@´Ûmã8öí ˜`tÁ~ÍΩµîÍiû\92ùË/zù\§Ó€´QÑ}¹¤êf€u™Eë()eHÀFuY©TDœ•SJi ³–ãÖ¡í€îäöÚ=ÿ| œÉ{÷«â\%~gœ³©V«¦Nc„£²ë>0?•6@’¨JOŠREI)Kçv#¨Ã8ÈŒ‰9pÂ>dylÔŠ”t5[v^œ¢«VÃ^_%(¥ú\@JIEø¾ße[ù\¹qJJÀšq- Ñi %­Ó[!µÖ(¥zý.âDñAë ž'¹uK“Z5ÈNijÁ---¡µ& Ãìy¯gU›ë\ùs´ÌÌ(\ó5X´JÿídVËîs¶imŸo¿ü.ÿðìkTÃe4ýå'¸ïÖ[èt#ÂÀëó<c ëׯÇ÷ýœ¢ì}¥TÎr9Zv»]Hû ½¶@ùAñ=·¥ÝéûgæùÎ+'ذ®Jc(dêò³óKcH…ù±â8&I’^psçrSD&¿ÌðôEËœÆ].‹–\K¤”âÄP«„Œ}ï‡Ì-¬àIÁòµˆ$Ñ|8½ˆÖšÀ—½yŠgWWN—9d…,‰GQ$p¢å V¤dñzÐ;HMµò“÷Ïóãg3¿Ô­ |Á…©Ú+B’(”1øR2yá2‰Jð²hìŽ_V8¯--Ë|®ï…""MÊ4ëÊ*¡OëÒÆ^x›Í# žüü½¬oT1Z3ºcq¬ÐÊ …àlë Q” eZ¸ŠsåskÞ²ûe>׋–ea·‹ŠÈmR;QÌy—.Ìò;Šûï¾ååApçŽÄ*Á”p¦5KÙ|–§_™ %tí–-¯#°é›¬HËÕwÓ³ïINNLñ­ßâ®OÞ¾ÏÞMà `¤9D³^%ŠR ZS ,_ë’Ú­®ëÖepjK DZµX_´,¤HѼ™† ÄJñÌ¿ÿ­4ý槸ëÛYnw ¥†j·o¡Û€Jg?œ!‚Š,—•ßâÉYNdRò¡2šæÎ¤(¥©ÕBž{õ=Þ|ïŸÝÊ<¶›N§C¦µ¢ÒšF­ÊmÛ6ТÔÇfâüL&pÀº‘\™üyËYy“$‘k¡@Ù¡µ‘ZÎóS³W{þM„€§÷† ëjiþ‚$Ipû¶:Qœ­ çf1Úô~» nd¹LþRZf«¬ƒ³KšâàRJâ8¡R©ðoÏgâü ß?Ê#~’•N)EZ­C¢B¤K £3p39PkU®õ’>ZA`ﮉ–q÷%ú˜¢^¯òÖ{çø¯£' }Ÿ?û£Ï!¤À“©R…HR„€Ã 6 ×ét0·°Ììür¶ò¸¾,ƒ’¸Å“w#ǵ÷ìò£¨a!ÝnÌw^z‹‰s3|òAn»e8ÍeÚ AiC¢ F¤[vÍu5¶oiÒéDÙª[1qnß“=¯Õrölñø.-ËÀ¹ÍúVǹ¥ÄqB£1ÄKGßãÅ£'ÙØâýÉ)þò¿‹Êí5Ú±ly¦™›_Îú4q¢™87Ã#ŸÙ…1:W@_/r:à„¥enåz´´ý™ãæè¨´¡V ™½r•o>ÎJ·K£Vá'ÿý‘²fH} 4-×â$fâÜ4Bzié¶2ZÚ9Ë•-yŠ–+j®gQcxõõS¼rì§üÞgïá ¿½O ¤˜pB@'4†jŒ¿yš±çÞ lxıâlkŽ8Ž3øk·œ­-s–Ë~H,yŠà x’©ÙEþù?`Û¦õ<µï>ö=òëh• =;¬ 0ý­•BzRÀá#洛Š,.­pifžÃR¿$K6°\XXèßf°”í~¹°Gºlžäëß}‰óS|ñ‰‡xtÏ]\™_$ð= v5.œ‰RßÓªUEsÝ›‡ëœ½8GàK–¯­0yá2Û·l ŠuYÓÒîzeò›z½¬Î9Õºß h!@)Eú¼û³{þ8wܺ‰/>ñ ¾„J>ï¥G¾/ Ÿ0ð©„>FnÛ6Ìp³ÎJ'Bz’«Ë>8Ï÷QZ—R³P@¸ˆE†'_¡˜lU`n°—B¶PV¤üÓ×0¿ØæñGïe÷Ý·³Ô^ÉʰtÏÒ=lÄÕiÙÏJ'fýú!F6 Ñ鯾ÇR»Ã™Ö Bx(¥K-–'/·h·ÛÀ/˜ ÀÐéÆÔkcÏçè›§ùµ;¶òÇ¿ÿ‹W¯etU9)®$R:YÀ¶ÍM|OEé6^ëÒíkí4¯:;ÑkIa®ú\–ôúRÝdM·Ì I£QãäÄƾú›FêŒ?”‚j5à_Æ~ÀåùežÚ÷Ÿßsík+¾—Û\²à|ßãõ·'ùæ o0¼aˆŸ™bx}lÜPçüÅyþêïÿá¾OoãÉßz`•b…~P…Rš l¢N’ôß)Jï^øþÛüÝ¿¾D³Q# |_òáÔ–9Ÿ•‚g¾ù}žùÖ1†jR †ì·!hMÍóÎOÏ3we™¿ý‹?NŒ”VÙý +MNm¹º¡)eo+;­ó<*IÇìß»›/üîÃÒ5›1à{R¤KžÍÃu¤ç12Ò¤ØV)*øòŸîãÏŸ~,œÊh€Þ*Þ÷$ÊF>‰2ø¾708ò›2ËY³:T̯×<Ï# Cvݹ‘#iž’’l}´ÑD‘BgÛ箿¹à„lÞ¸¡·5/ÒÕiNiô˜ž¾Œ²÷!Ò‚T8ç,—í±÷¢¥ÕŠ›1ZkV:1ó Ëmú*+c ¾ç!„Aëò­v °Ó5ÓwÛ}!$I¢ÐZõÞí_ý„eï @Øon÷ÜÉ‹Ñɽ®TÂôcaOÛöY›°í†’fû¥Hǰ†ÏÕ«É?Ýb'§ð²2Ðâð. # # Author: # Jerry Casiano master-0.7.3/help/Makefile.am000077500000000000000000000005241300074171200157770ustar00rootroot00000000000000man1_MANS = \ $(PACKAGE_NAME).1 EXTRA_DIST = \ $(PACKAGE_NAME).1.in @YELP_HELP_RULES@ HELP_ID = $(PACKAGE_NAME) HELP_FILES = \ index.page HELP_MEDIA = \ media/logo.png HELP_LINGUAS = \ ar \ pl MAINTAINERCLEANFILES = \ $(PACKAGE_NAME).pot \ ./Makefile.in dist-hook: cd $(distdir) && find . -name *.stamp* -exec rm -f {} \; master-0.7.3/help/ar/000077500000000000000000000000001300074171200143415ustar00rootroot00000000000000master-0.7.3/help/ar/ar.po000066400000000000000000000075431300074171200153140ustar00rootroot00000000000000# Khaled Hosny , 2016. #zanata msgid "" msgstr "" "Project-Id-Version: font-manager 0.7.3\n" "POT-Creation-Date: 2016-10-16 12:57-0400\n" "PO-Revision-Date: 2016-08-05 07:11-0400\n" "Last-Translator: Khaled Hosny \n" "Language-Team: Arabic\n" "Language: ar\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Zanata 3.9.3\n" "Plural-Forms: nplurals=6; plural= n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" #. Put one translator per line, in the form NAME , YEAR1, YEAR2 msgctxt "_" msgid "translator-credits" msgstr "خالد حسني ØŒ ٢٠١٦" #. (itstool) path: info/title #: C/index.page:4 msgctxt "text" msgid "Font Manager" msgstr "مدير الخطوط" #. (itstool) path: info/desc #: C/index.page:5 msgid "Simple font management for GTK+ desktop environments" msgstr "إدارة بسيطة للخطوط لبيئات سطح مكتك جتك+" #. (itstool) path: credit/name #: C/index.page:7 msgid "Jerry Casiano" msgstr "" #. (itstool) path: credit/years #: C/index.page:9 msgid "2009-2016" msgstr "٢٠٠٩–٢٠١٦" #. (itstool) path: license/p #: C/index.page:12 msgid "" "GNU " "General Public License Version 3" msgstr "" "رخصة جنو " "العمومية إصدارة Ù£" #. (itstool) path: title/media #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.page:18 msgctxt "_" msgid "external ref='media/logo.png' md5='9f2f97653d18778001fcf0c180dcf12d'" msgstr "external ref='media/logo.png' md5='9f2f97653d18778001fcf0c180dcf12d'" #. (itstool) path: page/title #: C/index.page:17 msgid "" "Font Manager " "logo Font Manager" msgstr "" "شعار مدير " "الخطوط مدير الخطوط" #. (itstool) path: note/title #: C/index.page:22 msgid "Help has not been implemented yet." msgstr "المساعدة لم تÙكتب بعد." #. (itstool) path: note/p #: C/index.page:23 msgid "" "If you would like to help this project by providing help documentation " "please see Project Mallard " "for more information." msgstr "" "إذا كنت ترغب ÙÙŠ مساعدة هذا المشروع بالعمل على التوثيق ÙØ±Ø¬Ø§Ø¡ راجع مشروع مالرد لمزيد من المعلومات." #. (itstool) path: note/p #: C/index.page:24 msgid "" "If you do decide to help, please file an issue at https://github.com/FontManager/master/" "issues detailing what you intend to work on." msgstr "" #. (itstool) path: note/p #: C/index.page:25 msgid "Thank you." msgstr "شكرا" #. (itstool) path: note/title #: C/index.page:28 msgid "Localization" msgstr "التوطين" #. (itstool) path: note/p #: C/index.page:29 msgid "" "If you would like to help this application reach more users in their native " "language please see Zanata for more information." msgstr "" #. (itstool) path: note/p #: C/index.page:30 msgid "" "You can also file an issue at https://github.com/FontManager/master/issues and " "attach any translated files there." msgstr "" master-0.7.3/help/font-manager.1.in000066400000000000000000000026521300074171200170110ustar00rootroot00000000000000.TH @PACKAGE_NAME@ 1 "@PACKAGE_VERSION@" "@PACKAGE_NAME@(1)" "@PACKAGE_VERSION@" .SH NAME \fB@PACKAGE_NAME@\fP - Simple font management for GTK+ desktop environments .SH SYNOPSIS \fB@PACKAGE_NAME@\fP [\fB\-a\fP|\fB-v\fP|\fB\-\-list\fP|\fB\-\-list\-full\fP] [\fB\-e|\fB\-d\fP \fIfamily\fP] [\fB\-i\fP ...] .SH DESCRIPTION \fB@PACKAGE_NAME@\fP is intended to provide a way for average users to easily manage desktop fonts, without having to resort to command line tools or editing configuration files by hand. While designed primarily with the Gnome Desktop Environment in mind, it should work well with other Gtk+ desktop environments. .SH OPTIONS .TP .BR \-a ", " \-\-about About the application .TP .BR \-v ", " \-\-version Show application version .TP .BR \-\-list List available font families .TP .BR \-\-list\-full Full listing including face information (JSON) .TP .BR \-e ", " \-\-enable " " \fIfamily\fP Enable specified font family .TP .BR \-d ", " \-\-disable " " \fIfamily\fP Disable specified font family .TP .BR \-i ", " \-\-install " " \fIfilepath\fP Space separated list of files to install .SH LIMITATIONS \fB@PACKAGE_NAME@\fP is a user level application, it will not allow installation to, or removal of fonts from, anywhere other than the default user font directory. However, the application does allow users to disable system fonts and also makes it easy to add font directories. .SH AUTHOR Jerry Casiano master-0.7.3/help/insert-header.sin000066400000000000000000000012421300074171200172030ustar00rootroot00000000000000# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. # /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } master-0.7.3/help/pl/000077500000000000000000000000001300074171200143525ustar00rootroot00000000000000master-0.7.3/help/pl/pl.po000066400000000000000000000107771300074171200153410ustar00rootroot00000000000000# Piotr Strebski , 2016. #zanata msgid "" msgstr "" "Project-Id-Version: font-manager 0.7.3\n" "POT-Creation-Date: 2016-10-16 12:57-0400\n" "PO-Revision-Date: 2016-06-10 04:31-0400\n" "Last-Translator: Piotr Strebski \n" "Language-Team: Polish\n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Zanata 3.9.3\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2)\n" #. Put one translator per line, in the form NAME , YEAR1, YEAR2 msgctxt "_" msgid "translator-credits" msgstr "Piotr StrÄ™bski , 2016" #. (itstool) path: info/title #: C/index.page:4 msgctxt "text" msgid "Font Manager" msgstr "ZarzÄ…dzanie czcionkami" #. (itstool) path: info/desc #: C/index.page:5 msgid "Simple font management for GTK+ desktop environments" msgstr "Proste zarzÄ…dzanie czcionkami dla Å›rodowisk pulpitowych GTK+" #. (itstool) path: credit/name #: C/index.page:7 msgid "Jerry Casiano" msgstr "Jerry Casiano" #. (itstool) path: credit/years #: C/index.page:9 msgid "2009-2016" msgstr "2009-2016" #. (itstool) path: license/p #: C/index.page:12 msgid "" "GNU " "General Public License Version 3" msgstr "" "Ogólna " "Licencja Publiczna GNU, wersja 3" #. (itstool) path: title/media #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.page:18 msgctxt "_" msgid "external ref='media/logo.png' md5='9f2f97653d18778001fcf0c180dcf12d'" msgstr "external ref='media/logo.png' md5='9f2f97653d18778001fcf0c180dcf12d'" #. (itstool) path: page/title #: C/index.page:17 msgid "" "Font Manager " "logo Font Manager" msgstr "" "Logo " "ZarzÄ…dzania czcionkami ZarzÄ…dzanie czcionkami" #. (itstool) path: note/title #: C/index.page:22 msgid "Help has not been implemented yet." msgstr "Pomoc nie zostaÅ‚a jeszcze zaimplementowana." #. (itstool) path: note/p #: C/index.page:23 msgid "" "If you would like to help this project by providing help documentation " "please see Project Mallard " "for more information." msgstr "" "JeÅ›li masz ochotÄ™ pomóc temu projektowi poprzez dostarczenie dokumentacji " "pomocowej, prosimy odwiedzić stronÄ™ Projektu Mallard po wiÄ™cej informacji." #. (itstool) path: note/p #: C/index.page:24 msgid "" "If you do decide to help, please file an issue at https://github.com/FontManager/master/" "issues detailing what you intend to work on." msgstr "" "JeÅ›li zdecydowaÅ‚eÅ› siÄ™ pomóc, prosimy o wypeÅ‚nienie zgÅ‚oszenia na https://github.com/" "FontManager/master/issues szczegółowo podajÄ…c czym zamierzasz siÄ™ " "zająć." #. (itstool) path: note/p #: C/index.page:25 msgid "Thank you." msgstr "DziÄ™kujemy." #. (itstool) path: note/title #: C/index.page:28 msgid "Localization" msgstr "Lokalizacja" #. (itstool) path: note/p #: C/index.page:29 msgid "" "If you would like to help this application reach more users in their native " "language please see Zanata for more information." msgstr "" "JeÅ›li chcesz pomóc w dostarczaniu tego programu możliwie najwiÄ™kszej iloÅ›ci " "osób w ich rodzimym jÄ™zyku prosimy o odwiedzenie strony Zanata celem " "uzyskania wiÄ™cej informacji." #. (itstool) path: note/p #: C/index.page:30 msgid "" "You can also file an issue at https://github.com/FontManager/master/issues and " "attach any translated files there." msgstr "" "Możesz także dokonać zgÅ‚oszenia na https://github.com/FontManager/master/issues i dodać do niego przetÅ‚umaczone pliki." master-0.7.3/lib/000077500000000000000000000000001300074171200135555ustar00rootroot00000000000000master-0.7.3/lib/Common/000077500000000000000000000000001300074171200150055ustar00rootroot00000000000000master-0.7.3/lib/Common/About.vala.in000077500000000000000000000053541300074171200173430ustar00rootroot00000000000000/* About.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace About { public const string NAME = _("Font Manager"); public const string ICON = "font-x-generic"; public const string COMMENT = _("Simple font management for GTK+ desktop environments"); public const string VERSION = "@PACKAGE_VERSION@"; public const string HOMEPAGE = "@PACKAGE_URL@"; public const string COPYRIGHT = "Copyright (C) 2009 - 2016 Jerry Casiano"; public const string LICENSE = _(""" 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 . """); public const string [] AUTHORS = { AUTHOR, null }; public const string [] DOCUMENTERS = { AUTHOR, null }; public const string [] ARTISTS = { null }; public const string TRANSLATORS = "translator-credits"; } public void show_version () { stdout.printf("%s %s\n", About.NAME, About.VERSION); return; } public void show_about () { stdout.printf("\n %s - %s\n\n\t\t %s\n%s\n", About.NAME, About.COMMENT, About.COPYRIGHT, About.LICENSE); return; } } master-0.7.3/lib/Common/ArchiveManager.vala000077500000000000000000000116601300074171200205350ustar00rootroot00000000000000/* ArchiveManager.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ #if HAVE_FILE_ROLLER /* Mimetypes that are likely to cause an error, unlikely to contain usable fonts. * i.e. * Windows .FON files are classified as "application/x-ms-dos-executable" * but file-roller is unlikely to extract one successfully. * */ const string [] ARCHIVE_IGNORE_LIST = { "application/x-ms-dos-executable" }; [DBus (name = "org.gnome.ArchiveManager1")] interface DBusService : Object { public signal void progress (double percent, string message); public abstract void add_to_archive (string archive, string [] files, bool use_progress_dialog) throws IOError; public abstract void compress (string [] files, string destination, bool use_progress_dialog) throws IOError; public abstract void extract (string archive, string destination, bool use_progress_dialog) throws IOError; public abstract void extract_here (string archive, bool use_progress_dialog) throws IOError; /* Valid actions -> "create", "create_single_file", "extract" */ public abstract HashTable [] get_supported_types (string action) throws IOError; } public class ArchiveManager : Object { public signal void progress (string? message, int processed, int total); DBusService? service = null; public void post_error_message (Error e) { critical("Archive Manager : %s", e.message); } void init () { try { service = Bus.get_proxy_sync(BusType.SESSION, "org.gnome.ArchiveManager1", "/org/gnome/ArchiveManager1"); service.progress.connect((p, m) => { progress(m, (int) p, 100); }); debug("Success contacting Archive Manager service."); } catch (IOError e) { warning("Failed to contact Archive Manager service."); warning("Features which depend on Archive Manager will not function correctly."); post_error_message(e); } return; } DBusService file_roller { get { init(); return service; } } public bool add_to_archive (string archive, string [] uris, bool use_progress_dialog = true) { debug("Archive Manager - Add to archive : %s", archive); try { file_roller.add_to_archive(archive, uris, use_progress_dialog); return true; } catch (IOError e) { post_error_message(e); } return false; } public bool compress (string [] uris, string destination, bool use_progress_dialog = true) { debug("Archive Manager - Compress : %s", destination); try { file_roller.compress(uris, destination, use_progress_dialog); return true; } catch (IOError e) { post_error_message(e); } return false; } public bool extract (string archive, string destination, bool use_progress_dialog = true) { debug("Archive Manager - Extract %s to %s", archive, destination); try { file_roller.extract(archive, destination, use_progress_dialog); return true; } catch (IOError e) { post_error_message(e); } return false; } public bool extract_here (string archive, bool use_progress_dialog = true) { debug("Archive Manager - Extract here : %s", archive); try { file_roller.extract_here(archive, use_progress_dialog); return true; } catch (IOError e) { post_error_message(e); } return false; } public Gee.ArrayList get_supported_types (string action = "extract") { debug("Archive Manager - Get supported types"); var _supported_types = new Gee.ArrayList (); try { HashTable [] array = file_roller.get_supported_types(action); foreach (var hashtable in array) { if (hashtable.get("mime-type") in ARCHIVE_IGNORE_LIST) continue; _supported_types.add(hashtable.get("mime-type")); } } catch (Error e) { post_error_message(e); } return _supported_types; } } #endif /* HAVE_FILE_ROLLER */ master-0.7.3/lib/Common/Cacheable.vala000077500000000000000000000041531300074171200175070ustar00rootroot00000000000000/* Cacheable.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ public class Cacheable : Object, Json.Serializable { public virtual bool deserialize_property (string prop_name, out Value val, ParamSpec pspec, Json.Node node) { val = Value(pspec.value_type); if (node.is_null()) return true; val = node.get_value(); return true; } #if VALA_034_OR_LATER public unowned ParamSpec? find_property (string name) { #else public unowned ParamSpec find_property (string name) { #endif return this.get_class().find_property(name); } public ParamSpec [] list_properties () { return this.get_class().list_properties(); } public virtual Json.Node serialize_property (string prop_name, Value val, ParamSpec pspec) { Json.Node node; /* XXX : Value.strdup_contents() is marked unstable */ if (val.strdup_contents() == "NULL") node = new Json.Node(Json.NodeType.NULL); else { node = new Json.Node(Json.NodeType.VALUE); node.set_value(val); } return node; } } master-0.7.3/lib/Common/Collections.vala.in000066400000000000000000000105541300074171200205420ustar00rootroot00000000000000/* Collections.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class Collections : Cacheable { public Gee.HashMap entries { get; set; } public static string get_cache_file () { string dirpath = Path.build_filename(Environment.get_user_config_dir(), "@PACKAGE_NAME@"); string filepath = Path.build_filename(dirpath, "Collections.json"); DirUtils.create_with_parents(dirpath ,0755); return filepath; } public Collections () { entries = new Gee.HashMap (); } public void update (FontConfig.Reject reject) { return; } public void rename_collection (Collection collection, string new_name) { string old_name = collection.name; collection.name = new_name; if (this.entries.has_key(old_name)) { this.entries.set(collection.name, collection); this.entries.unset(old_name); } return; } public Gee.HashSet get_full_contents () { var full_contents = new Gee.HashSet (); foreach (var entry in entries.values) full_contents.add_all(entry.get_full_contents()); return full_contents; } public override bool deserialize_property (string prop_name, out Value val, ParamSpec pspec, Json.Node node) { if (pspec.value_type == typeof(Gee.HashMap)) { val = Value(pspec.value_type); var collections = new Gee.HashMap (); node.get_object().foreach_member((obj, name, node) => { collections[name] = (Collection) Json.gobject_deserialize(typeof(Collection), node); }); val.set_object(collections); return true; } else return base.deserialize_property(prop_name, out val, pspec, node); } public override Json.Node serialize_property (string prop_name, Value val, ParamSpec pspec) { if (pspec.value_type == typeof(Gee.HashMap)) { var node = new Json.Node(Json.NodeType.OBJECT); var obj = new Json.Object(); foreach (var collection in entries.values) obj.set_member(collection.name.escape(""), Json.gobject_serialize(collection)); node.set_object(obj); return node; } else return base.serialize_property(prop_name, val, pspec); } public bool cache () { if (!write_json_file(Json.gobject_serialize(this), get_cache_file(), false)) { warning("Failed to save collection cache file."); return false; } return true; } } public Collections load_collections () { Collections? collections = null; string cache = Collections.get_cache_file(); File group_cache = File.new_for_path(cache); if (group_cache.query_exists()) collections = (Collections) Json.gobject_deserialize(typeof(Collections), load_json_file(cache)); if (collections != null) return collections; else return new Collections(); } } master-0.7.3/lib/Common/Constants.vala.in000077500000000000000000000427661300074171200202550ustar00rootroot00000000000000/* Constants.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public const string TMP_TMPL = "font-manager_XXXXXX"; public const string AUTHOR = "Jerry Casiano "; } string get_package_config_dir () { string config_dir = Path.build_filename(Environment.get_user_config_dir(), "@PACKAGE_NAME@"); if (DirUtils.create_with_parents(config_dir, 0755) != 0) critical("Failed to create %s!".printf(config_dir)); return config_dir; } public const string DEFAULT_COLLECTION_NAME = _("Enter Collection Name"); public const string DEFAULT_FONT = "Sans"; /* XXX: Probably most of this file belongs elsewhere */ public const string DEFAULT_PREVIEW_TEXT = """ %s ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 1234567890.:,;(*!?') """; /* Any margins or padding set in code should be adjustable from one spot */ public const int MINIMUM_MARGIN_SIZE = 2; public const int DEFAULT_MARGIN_SIZE = 24; public const double DEFAULT_PREVIEW_SIZE = 10; public const double MIN_FONT_SIZE = 6.0; public const double MAX_FONT_SIZE = 96.0; public const string LOREM_IPSUM = """ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent sed tristique nunc. Sed augue dolor, posuere a auctor quis, dignissim sed est. Aliquam convallis, orci nec posuere lacinia, risus libero mattis velit, a consectetur orci felis venenatis neque. Praesent id lacinia massa. Nam risus diam, faucibus vitae pulvinar eget, scelerisque nec nisl. Integer dolor ligula, placerat id elementum id, venenatis sed massa. Vestibulum at convallis libero. Curabitur at molestie justo. Mauris convallis odio rutrum elit aliquet quis fermentum velit tempus. Ut porttitor lectus at dui iaculis in vestibulum eros tristique. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ut dui massa, at aliquet leo. Cras sagittis pulvinar nunc. Fusce eget felis ut dolor blandit scelerisque non eget risus. Nunc elementum ipsum id lacus porttitor accumsan. Suspendisse at quam ligula, ultrices bibendum massa. Mauris feugiat, orci non fermentum congue, libero est rutrum sem, non dignissim justo urna at turpis. Donec non varius augue. Fusce id enim ligula, sit amet mattis urna. Ut sodales augue tristique tortor lobortis vestibulum. Maecenas quis tortor lacus. Etiam varius hendrerit bibendum. Nullam pretium nulla in sem blandit vel facilisis felis fermentum. Integer aliquet leo nec nunc sollicitudin congue. In hac habitasse platea dictumst. Curabitur mattis nibh ac velit euismod condimentum. Pellentesque volutpat, neque ac congue fermentum, turpis metus posuere turpis, ac facilisis velit lectus sed diam. Etiam dui diam, tempus vitae fringilla quis, tincidunt ac libero. Quisque sollicitudin eros sit amet lorem semper nec imperdiet ante vehicula. Proin a vulputate sem. Aliquam erat volutpat. Vestibulum congue pulvinar eros eu vestibulum. Phasellus metus mauris, suscipit tristique ullamcorper laoreet, viverra eget libero. Donec id nibh justo. Aliquam sagittis ultricies erat. Integer sed purus felis. Pellentesque leo nisi, sagittis non tincidunt vitae, porta quis eros. Pellentesque ut ornare erat. Vivamus semper sodales suscipit. Praesent placerat eleifend nibh quis tristique. Aenean ullamcorper pellentesque ultrices. Nunc eu risus turpis, in condimentum dui. Aliquam erat volutpat. Phasellus sagittis mattis diam, sit amet pharetra lacus cursus non. Vestibulum sed est id velit rhoncus imperdiet. Aliquam dictum, arcu at tincidunt condimentum, metus ligula molestie lorem, eget congue tortor est ut massa. Duis ut pulvinar nisl. Aenean sodales purus id risus hendrerit sit amet mattis sem blandit. Aenean feugiat dapibus mattis. Praesent non nibh magna. Nulla facilisi. Nam elementum malesuada sagittis. Cras et tellus augue, non rhoncus libero. Suspendisse ut nulla mauris. Suspendisse potenti. Nulla neque leo, condimentum nec posuere non, elementum sit amet lorem. Integer ut ante libero, a tristique quam. Nulla libero nibh, bibendum eget blandit non, viverra in velit. Duis sit amet ipsum in massa imperdiet interdum. Phasellus venenatis consequat lectus eget facilisis. Quisque ullamcorper rutrum erat at egestas. Integer pharetra pulvinar odio, sagittis imperdiet ligula aliquam suscipit. Aenean rutrum convallis felis, at rhoncus lectus tincidunt et. Morbi mattis risus eu quam suscipit ut tempus nunc pellentesque. Ut adipiscing, nibh nec pharetra fringilla, diam diam hendrerit neque, quis pretium tellus ligula ut dolor. Nullam dictum, libero in molestie convallis, nunc arcu imperdiet risus, vitae laoreet risus ipsum in ligula. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec molestie, quam ut adipiscing consequat, risus sem facilisis nisi, ut aliquet sapien est a sapien. Quisque sed enim justo, sit amet volutpat urna. Integer faucibus, velit sit amet aliquam fermentum, turpis massa facilisis nunc, eu vulputate lorem sapien at sapien. Quisque sed lacus non massa varius fermentum. Fusce non consectetur odio. Integer tincidunt tincidunt ullamcorper. In hac habitasse platea dictumst. Donec tellus est, feugiat in auctor sed, sodales non urna. Curabitur semper cursus eros, id hendrerit tortor pulvinar at. Mauris gravida odio vel lorem mattis varius. Donec vulputate aliquam dui et dignissim. Pellentesque consectetur nisi sit amet libero consectetur quis imperdiet libero tristique. Praesent nec enim ante. Proin quam mauris, vehicula vel lobortis at, tempor vitae augue. Sed ut urna vel eros facilisis mollis vulputate at nisl. Integer lobortis magna vitae urna varius tristique. In hac habitasse platea dictumst. Sed ac molestie ante. Fusce ultrices laoreet felis ac lobortis. Curabitur a vulputate risus. Suspendisse auctor pulvinar semper. Mauris nec ipsum vitae justo malesuada tincidunt. In suscipit porttitor nibh, at convallis justo ultrices ac. Sed vitae turpis vel quam malesuada gravida a non ante. Suspendisse sit amet felis sit amet nisl lacinia ultrices ut vitae tellus. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Sed interdum porta dui, in placerat arcu porttitor vel. Nullam justo velit, blandit ut accumsan id, ullamcorper sed lacus. Nullam scelerisque tellus vitae nisi placerat sollicitudin. Integer massa erat, facilisis sed porta eu, porttitor at leo. Praesent mauris mi, tincidunt id cursus et, consequat sit amet arcu. Sed posuere erat nec nunc hendrerit id semper quam facilisis. Curabitur pretium placerat neque at sodales. Etiam augue eros, dictum eu adipiscing in, aliquam quis dui. Pellentesque auctor sem mattis magna faucibus vulputate. Nam arcu purus, eleifend eget sagittis ac, posuere a lorem. Aenean urna magna, viverra quis commodo vitae, gravida eget arcu. Maecenas ut turpis magna, mattis gravida risus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec eu libero sem. Donec eget nibh id turpis convallis tincidunt. Fusce vulputate tempor tempor. Nunc eleifend metus in augue rhoncus sodales. Nam vel enim at neque tristique accumsan. Nunc ac venenatis massa. Morbi gravida facilisis odio sit amet venenatis. Maecenas sodales euismod nisi eu bibendum. Duis tempor pulvinar diam, nec mollis risus viverra quis. Nullam ipsum mauris, fringilla eget vulputate a, euismod ac urna. Nam eu eros sapien. Phasellus et eros lorem. Quisque varius porta pharetra. Donec vel libero euismod arcu pharetra tincidunt. Sed sit amet neque erat. Mauris dictum nisi quis risus tincidunt pellentesque. Maecenas accumsan elit rhoncus tortor elementum pretium. Donec dictum convallis lectus in fermentum. Mauris accumsan, turpis ac consectetur varius, lacus metus sagittis neque, in tincidunt dui enim id diam. Aenean lacinia eros nec enim cursus at porttitor quam suscipit. Nam quam turpis, iaculis et congue non, dignissim nec neque. Mauris nec erat erat, vitae ornare velit. Aenean suscipit, eros eu cursus imperdiet, felis lacus lobortis metus, ac laoreet tellus nunc id arcu. Etiam libero mi, pellentesque in feugiat nec, tincidunt in sapien. Fusce eu mi sed libero ullamcorper congue. Suspendisse eu sem sed arcu pulvinar vestibulum vel in lorem. Phasellus aliquam elementum iaculis. Etiam dictum luctus nisi sit amet mattis. Mauris mollis placerat varius. Cras ultricies elit eget lectus sagittis sit amet rutrum enim tempus. Vivamus a risus pharetra nibh dapibus volutpat vitae sed arcu. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque a augue nibh, nec congue metus. Integer elementum, purus sit amet vehicula gravida, mi magna hendrerit turpis, at aliquam purus velit eget tortor. Integer suscipit posuere massa, quis cursus massa tincidunt id. Integer placerat quam quis massa dapibus egestas at eu lorem. Aenean quis nunc sed massa lobortis tincidunt. Phasellus quis sem dolor. Phasellus auctor ipsum at ligula euismod eu sagittis justo dapibus. Pellentesque pulvinar, magna eget interdum eleifend, urna lectus adipiscing dui, eu cursus nulla tellus in lacus. Vivamus quis urna magna, a placerat est. Nullam justo tellus, elementum at viverra at, posuere quis magna. Sed non est sed nibh blandit tincidunt. Fusce nec sem a mi mollis condimentum. Nulla ut lacinia tellus. Vestibulum iaculis fermentum risus, vel lobortis lorem posuere quis. Donec consequat ligula et arcu faucibus sed tempor sem ullamcorper. Curabitur sapien odio, egestas non congue id, dapibus non nisl. Nam euismod, massa eu laoreet tincidunt, velit mi pharetra dolor, laoreet suscipit quam erat vel felis. Praesent vulputate ipsum et elit scelerisque rhoncus. Nam ligula magna, gravida ac varius at, facilisis vitae ipsum. Praesent eleifend eleifend massa, tincidunt pharetra felis tincidunt nec. Etiam eu sapien lorem. Donec euismod faucibus erat a semper. Duis pharetra nulla at libero sollicitudin sed vestibulum diam egestas. Nam dignissim quam et massa placerat ac tincidunt nulla dapibus. Curabitur mi mi, sagittis id pharetra sed, semper eu ligula. Phasellus eu venenatis elit. Ut mi libero, pharetra in vestibulum et, blandit ac purus. Donec sit amet scelerisque massa. Morbi commodo nisi non mi rhoncus vel pharetra lorem rutrum. Nulla eget arcu augue. Nunc ullamcorper, sapien ut imperdiet imperdiet, lorem mauris commodo justo, sit amet sodales nisl sem id turpis. Sed interdum sem dictum neque ullamcorper varius. Nulla elementum pharetra scelerisque. Fusce ut augue non mauris suscipit consectetur id vel justo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus metus nulla, tempus facilisis pharetra ut, aliquam a arcu. Morbi porttitor posuere rutrum. Nulla facilisi. Nam risus lorem, varius at fermentum id, euismod eget tellus. Quisque ut interdum leo. Etiam eget neque urna, vitae iaculis ante. Curabitur semper nisl vel orci hendrerit accumsan. Phasellus vel mi ac tellus rhoncus viverra sit amet lobortis mauris. Vestibulum pharetra tristique enim, a mattis dolor consequat quis. Aenean auctor, mi quis rhoncus iaculis, urna ante condimentum ligula, ac feugiat ipsum diam sit amet libero. Donec ac sapien ut quam ultrices pellentesque. Aenean venenatis ornare enim sed congue. Integer nec est massa. Pellentesque tincidunt justo at magna dictum blandit. Maecenas ipsum velit, condimentum ut pharetra quis, aliquet consequat tellus. Mauris faucibus augue ut massa faucibus id hendrerit justo rutrum. Donec accumsan odio vel turpis dignissim mattis. Suspendisse magna eros, tempus vel commodo eu, aliquet sed libero. Ut fermentum dui quis lorem scelerisque lobortis. Aliquam volutpat odio id velit malesuada condimentum. Nulla facilisi. Donec sed nisi eget risus adipiscing rutrum. Duis egestas scelerisque eleifend. Mauris neque ligula, ullamcorper sed tincidunt aliquet, facilisis non dolor. Mauris eget elit leo. Donec suscipit, felis sed auctor tincidunt, arcu velit posuere elit, malesuada molestie libero quam nec mauris. Morbi non nunc faucibus sem rutrum aliquam eget nec nisi. Donec iaculis, arcu at elementum sollicitudin, libero enim dictum tellus, et pellentesque turpis erat aliquet dolor. Etiam et magna in nisi pharetra consectetur. Phasellus accumsan volutpat nibh non dictum. Pellentesque pretium tellus id neque ultricies iaculis. Ut a libero eget dolor porttitor hendrerit. Integer eleifend elit quis turpis lacinia vitae scelerisque leo gravida. Curabitur tempor eros vitae velit ultrices ornare. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris tristique erat ac arcu gravida non dictum magna aliquam. Phasellus eu velit quis est ullamcorper pharetra. Aenean vestibulum gravida urna, vitae posuere libero dapibus ac. Etiam a massa eget felis tincidunt pellentesque. Nulla facilisi. Nullam odio dui, commodo eu vulputate quis, feugiat in ipsum. Sed sed viverra sapien. Mauris consectetur neque ut mauris feugiat et rhoncus purus gravida. Nam nibh sem, iaculis at lacinia vitae, faucibus lobortis mauris. Maecenas ornare urna sit amet eros blandit pulvinar. Suspendisse nisi massa, ornare vitae vestibulum eget, dictum nec leo. Phasellus et risus risus. Suspendisse potenti. Donec imperdiet eleifend dui tincidunt sodales. Morbi ac erat nisi. Maecenas mi ante, rutrum at rhoncus viverra, facilisis quis turpis. Ut in lacus diam, ac euismod quam. Etiam auctor ultricies consectetur. Vivamus semper, sem nec posuere eleifend, tortor lorem sagittis urna, eu iaculis tortor leo et ligula. Nam vitae libero tellus, vitae rutrum nulla. Phasellus suscipit massa eget mauris pharetra adipiscing. Donec mattis sem in leo sollicitudin vitae tempus lorem tincidunt. Fusce sagittis metus sit amet ante scelerisque ut vulputate felis venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla dictum arcu eget metus sagittis faucibus. Nulla eget mauris a tellus ornare dictum ac eu massa. Vestibulum dapibus, turpis non adipiscing convallis, nisi turpis pharetra elit, ac tincidunt sem dui sit amet lacus. Pellentesque ac mi lacus, volutpat cursus leo. Ut ac sollicitudin nibh. Phasellus et porta risus. Ut a neque quam. Aliquam euismod diam vitae felis sodales pellentesque non sit amet ipsum. In lorem arcu, posuere at elementum at, malesuada in mauris. In viverra adipiscing adipiscing. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed ut lacus purus, non egestas quam. Curabitur convallis, ipsum quis egestas varius, odio tellus accumsan ipsum, et interdum eros felis posuere lorem. Fusce congue viverra quam, sed ullamcorper orci euismod non. Vestibulum semper turpis eu turpis mollis eget aliquam turpis dapibus. Praesent volutpat justo eget ligula facilisis non fermentum lorem consequat. Phasellus ac diam erat. Phasellus nisi leo, aliquet posuere facilisis eu, mattis non tellus. Pellentesque eros metus, pretium venenatis pharetra vel, ullamcorper ac est. Sed massa ante, fermentum in tincidunt ac, eleifend eget turpis. Nullam commodo dui at quam pulvinar a luctus sapien pretium. In hendrerit pretium consectetur. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam aliquet erat vel lorem feugiat tincidunt. Ut eget magna lectus. Aliquam augue eros, gravida vel commodo vel, interdum sit amet sapien. Sed nec turpis enim, a faucibus orci. Nullam non lectus risus, vitae laoreet metus. Praesent in erat dui. Ut ac laoreet nibh. Sed tortor eros, ultrices eu dapibus et, tristique in quam. Vivamus id lacinia lacus. Sed et elit mi. Nullam erat purus, posuere at mollis in, tempor ut risus. Vivamus sollicitudin scelerisque vehicula. Morbi nec volutpat nulla. Sed venenatis ligula nec magna luctus sagittis. Ut faucibus diam in lorem vulputate id porta turpis venenatis. Duis tempus cursus erat, sit amet sollicitudin erat faucibus sit amet. Donec facilisis, orci eget ultricies semper, elit ante euismod purus, at pretium turpis metus ac sapien. Pellentesque quis sem eget ante congue gravida at sit amet erat. Nam condimentum arcu ut urna scelerisque et fermentum mauris sagittis. In mauris lectus, accumsan eu malesuada eu, congue at nulla. Nulla dui elit, sodales non fermentum eget, iaculis vitae est. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi arcu eros, ultricies a hendrerit a, faucibus in nibh. Vestibulum diam sapien, facilisis et placerat a, sodales ut leo. In luctus ligula quis purus scelerisque varius ac id eros. Mauris consequat pulvinar diam at commodo. Vestibulum lobortis viverra quam, quis posuere est tincidunt nec. Vestibulum ac elit non ligula faucibus pretium laoreet vel erat. Fusce sodales, erat et condimentum luctus, justo lorem gravida tortor, eget consequat orci risus ac metus. Sed pulvinar pretium felis et porta. Aliquam erat volutpat. Integer pellentesque aliquam odio eu facilisis. Aenean ultrices felis eget risus tempus pulvinar. Pellentesque eros mi, gravida vel condimentum nec, ornare ac neque. Phasellus risus ligula, vehicula non varius non, tincidunt at arcu. Quisque at quam a lorem aliquet tempus vel non sapien. """; master-0.7.3/lib/Common/Database.vala.in000066400000000000000000000362221300074171200177700ustar00rootroot00000000000000/* Database.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ public const string CREATE_SQL = """CREATE TABLE IF NOT EXISTS Fonts ( uid INTEGER PRIMARY KEY, family TEXT, style TEXT, slant INTEGER, weight INTEGER, width INTEGER, spacing INTEGER, findex INTEGER, filepath TEXT, owner INTEGER, filetype TEXT, filesize TEXT, checksum TEXT, version TEXT, psname TEXT, description TEXT, vendor TEXT, copyright TEXT, license_type TEXT, license_data TEXT, license_url TEXT, panose TEXT, font_description TEXT ); """; namespace FontManager { static Database? db = null; internal string get_database_file () { string dirpath = Path.build_filename(Environment.get_user_cache_dir(), "font-manager"); string filepath = Path.build_filename(dirpath, "%s.sqlite".printf("font-manager")); DirUtils.create_with_parents(dirpath, 0755); return filepath; } internal void builder_append (StringBuilder builder, string? val) { if (val == null) return; builder.append(" "); builder.append(val); return; } public Database get_database() throws DatabaseError { if (db != null) return db; db = new Database(); db.file = get_database_file(); db.execute_query(CREATE_SQL); db.check_result(db.stmt.step(), "Initialize database if needed", Sqlite.DONE); db.close(); return db; } public void prune_path_from_database (Database db, string path) throws DatabaseError { db.reset(); db.table = "Fonts"; db.remove("filepath LIKE \"%s%\"".printf(path)); db.vacuum(); db.close(); return; } public void sync_fonts_table (Database db, Gee.ArrayList installed_fonts, ProgressCallback? progress = null) throws DatabaseError { debug("Starting database synchronization : Font table"); int processed = 0; int total = installed_fonts.size; var known_files = get_known_files(db); bool empty = (known_files.size == 0); db.begin_transaction(); db.execute_query("""INSERT OR REPLACE INTO Fonts VALUES (NULL,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);"""); foreach (var font in installed_fonts) { if (empty || !(font.filepath in known_files)) { var fileinfo = new FontInfo.from_filepath(font.filepath, font.index); db.check_result(db.stmt.bind_text(1, font.family), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(2, font.style), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_int(3, font.slant), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_int(4, font.weight), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_int(5, font.width), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_int(6, font.spacing), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_int(7, font.index), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(8, font.filepath), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_int(9, fileinfo.owner), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(10, fileinfo.filetype), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(11, fileinfo.filesize), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(12, fileinfo.checksum), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(13, fileinfo.version), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(14, fileinfo.psname), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(15, fileinfo.description), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(16, fileinfo.vendor), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(17, fileinfo.copyright), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(18, fileinfo.license_type), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(19, fileinfo.license_data), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(20, fileinfo.license_url), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(21, fileinfo.panose), "bind_*", Sqlite.OK); db.check_result(db.stmt.bind_text(22, font.description), "bind_*", Sqlite.OK); db.check_result(db.stmt.step(), "apply_bindings", Sqlite.DONE); } processed++; if (progress != null) progress(font.to_string(), processed, total); db.stmt.reset(); } db.commit_transaction(); debug("Database synchronization complete : Font table"); return; } Gee.HashSet get_known_files (Database db) { var results = new Gee.HashSet (); db.reset(); db.table = "Fonts"; db.select = "filepath"; db.unique = true; try { db.execute_query(); foreach (var row in db) results.add(row.column_text(0)); } catch (DatabaseError e) { critical("Database Error : %s", e.message); //show_error_message(_("There was an error accessing the database"), e); } db.close(); return results; } void get_matching_families_and_fonts (Database db, Gee.HashSet families, Gee.HashSet descriptions, string? search = null) throws DatabaseError { db.reset(); db.table = "Fonts"; db.select = "family, font_description"; db.search = search; db.unique = true; db.execute_query(); var active = FontConfig.list_families(); foreach (var row in db) { if (row.column_text(0) in active) { families.add(row.column_text(0)); descriptions.add(row.column_text(1)); } } db.close(); return; } FontInfo? get_fontinfo_from_db_entry (Database db, string filepath) throws DatabaseError { db.reset(); db.table = "Fonts"; db.select = "*"; db.search = "filepath=\"%s\"".printf(filepath); db.unique = true; db.execute_query(); if (db.stmt.step() != Sqlite.ROW) return null; var res = new FontInfo(); unowned ObjectClass obj_cls = res.get_class(); int cols = db.stmt.column_count (); var val = Value(typeof(string)); for (int i = 0; i < cols; i++) { if (db.stmt.column_type(i) != Sqlite.TEXT) continue; string name = db.stmt.column_name(i); val = db.stmt.column_text(i); if (obj_cls.find_property(name) != null) ((Object) res).set_property(name, val); } val.unset(); return res; } /* Error mapping/checking originally from Shotwell code */ public errordomain DatabaseError { ERROR, BACKING, MEMORY, ABORT, LIMITS, TYPESPEC } /* * Thin wrapper to make sqlite easier to work with? */ public class Database : Object { public Sqlite.Database db; public Sqlite.Statement stmt; public string? search { get { return _search; } set { if (value != null) _search = """WHERE %s""".printf(value); else _search = ""; } } public string? sort { get { return _sort; } set { if (value != null) _sort = """ORDER BY %s""".printf(value); else _sort = ""; } } public string file { get; set; default = ":memory:"; } public string table { get; set; default = "sqlite_master"; } public string select { get; set; default = "*"; } public int limit { get; set; default = -1; } public bool unique { get; set; default = false; } public int result { get; protected set; default = Sqlite.OK; } bool in_transaction = false; protected string _search = ""; protected string _sort = ""; ~ Database () { close(); } public int get_version () throws DatabaseError { execute_query("PRAGMA user_version;"); if (stmt.step() == Sqlite.ROW) return stmt.column_int(0); return 0; } public void set_version (int version) throws DatabaseError { string sql = "PRAGMA user_version = %i;".printf(version); execute_query(sql); check_result(stmt.step(), "set version", Sqlite.DONE); return; } public void open () throws DatabaseError ensures (db != null) { if (db != null) return; check_result(Sqlite.Database.open_v2(file, out db, Sqlite.OPEN_READWRITE | Sqlite.OPEN_CREATE, null), "open_v2"); return; } public void close () { stmt = null; db = null; return; } public void reset () { table = "sqlite_master"; select = "*"; limit = -1; unique = false; search = null; sort = null; } public string build_select_query () { var builder = new StringBuilder("SELECT"); if (unique) builder_append(builder, "DISTINCT"); builder_append(builder, select); builder_append(builder, "FROM"); builder_append(builder, table); builder_append(builder, search); builder_append(builder, sort); if (limit > 0) builder_append(builder, "LIMIT %s".printf(limit.to_string())); return builder.str; } public void begin_transaction () throws DatabaseError { if (in_transaction) return; open(); check_result(db.exec("BEGIN"), "begin_transaction"); in_transaction = true; return; } public void commit_transaction () throws DatabaseError { if (!in_transaction) throw new DatabaseError.ERROR("Not in transaction - nothing to commit."); check_result(db.exec("COMMIT"), "commit_transaction"); close(); in_transaction = false; return; } public void vacuum () throws DatabaseError { open(); check_result(db.exec("VACUUM"), "vacuum"); close(); return; } public void execute_query (string? query = null) throws DatabaseError { open(); string? sql = query; if (sql == null) sql = build_select_query(); verbose("SQLite : %s".printf(sql)); check_result(db.prepare_v2(sql, -1, out stmt), "prepare_v2", Sqlite.OK); return; } public void remove (string condition) throws DatabaseError { execute_query("""DELETE FROM %s WHERE %s""".printf(table, condition)); check_result(stmt.step(), "remove"); close(); return; } public int get_row_count () throws DatabaseError { open(); check_result(db.prepare_v2("""SELECT COUNT(*) FROM %s""".printf(table), -1, out stmt), "get_row_count", Sqlite.OK); check_result(stmt.step(), "get_row_count"); int res = stmt.column_int(0); close(); return res; } public Iterator iterator () { return new Iterator(this); } public class Iterator { Database db; public Iterator (Database db) { this.db = db; } ~ Iterator () { db.close(); db = null; } public unowned Sqlite.Statement? next_value () { if (db.stmt.step() != Sqlite.ROW) db.stmt = null; return db.stmt; } } public void check_result (int result, string method, int expected = -1) throws DatabaseError { this.result = result; string msg = "SQLite : (%s) [%d] - %s\n".printf(method, result, db.errmsg()); if (expected != -1 && expected != result) throw new DatabaseError.ERROR(msg); switch (result) { case Sqlite.OK: case Sqlite.DONE: case Sqlite.ROW: return; case Sqlite.PERM: case Sqlite.BUSY: case Sqlite.READONLY: case Sqlite.IOERR: case Sqlite.CORRUPT: case Sqlite.CANTOPEN: case Sqlite.NOLFS: case Sqlite.AUTH: case Sqlite.FORMAT: case Sqlite.NOTADB: throw new DatabaseError.BACKING(msg); case Sqlite.NOMEM: throw new DatabaseError.MEMORY(msg); case Sqlite.ABORT: case Sqlite.LOCKED: case Sqlite.INTERRUPT: throw new DatabaseError.ABORT(msg); case Sqlite.FULL: case Sqlite.EMPTY: case Sqlite.TOOBIG: case Sqlite.CONSTRAINT: case Sqlite.RANGE: throw new DatabaseError.LIMITS(msg); case Sqlite.SCHEMA: case Sqlite.MISMATCH: throw new DatabaseError.TYPESPEC(msg); case Sqlite.ERROR: case Sqlite.INTERNAL: case Sqlite.MISUSE: default: throw new DatabaseError.ERROR(msg); } } } } master-0.7.3/lib/Common/FontData.vala000066400000000000000000000022651300074171200173570ustar00rootroot00000000000000/* FontData.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public struct FontData { public File file; public FontConfig.Font font; public FontInfo fontinfo; public FontData (File file) { this.file = file; font = FontConfig.get_font_from_file(file.get_path()); fontinfo = new FontInfo.from_filepath(file.get_path()); } } } master-0.7.3/lib/Common/FontInfo.vala000077500000000000000000000101601300074171200173750ustar00rootroot00000000000000/* FontInfo.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { /* Words commonly found in font version strings, exclude these */ internal const string [] VERSION_STRING_EXCLUDES = { "Version", "version", "Revision", "revision", ";FFEdit", "$Revision", "$:", "$" }; public class FontInfo : Cacheable { public int owner { get; set; default = 0; } public string? filetype { get; set; default = null; } /* FreeType file type */ public string? filesize { get; set; default = null; } /* Suitable for display */ public string? checksum { get; set; default = null; } /* MD5 */ public string? version { get; set; default = null; } public string? psname { get; set; default = null; } /* PostScript name */ public string? description { get; set; default = null; } /* Design description */ public string? vendor { get; set; default = null; } public string? copyright { get; set; default = null; } public string? license_type { get; set; default = null; } public string? license_data { get; set; default = null; } /* Embedded license data */ public string? license_url { get; set; default = null; } public string panose { get; set; default = null; } public int status; public FontInfo.from_filepath (string filepath, int index = 0) { status = FreeType.query_file_info(this, filepath, index); post(filepath); return; } void post (string filepath) { if (status != 0) { warning("Failed to gather information for %s : %i", filepath, status); return; } /* A lot of font files have garbage in their version string so ... */ do_version_mangling(); /* CFF doesn't really mean much... */ if (filetype == "CFF" && (filepath.has_suffix(".otf") || filepath.has_suffix(".ttf"))) filetype = "OpenType"; return; } void do_version_mangling () { if (version == null) { version = "1.0"; return; } /* * Strip commonly found words from version string so that * we're left with just a number whenever possible. */ foreach (var e in VERSION_STRING_EXCLUDES) version = version.replace(e, ""); version = version.strip(); /* * If version contains ; or : it's likely to contain other info * Try to grab just the version number */ if (version.contains(";")) { string [] v_array = version.split(";"); version = v_array[0]; if (!version.contains(".")) foreach (string s in v_array) if (s.contains(".") && !(s.get_char().isalpha())) version = s; } else if (version.contains(":")) { string [] v_array = version.split(" "); version = "1.0"; foreach (string s in v_array) if (s.contains(".") && !(s.get_char().isalpha())) version = s; } return; } } } master-0.7.3/lib/Common/JsonWriter.vala000077500000000000000000000063011300074171200177630ustar00rootroot00000000000000/* JsonWriter.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ class JsonWriter : Json.Generator { public bool compress { get; set; default = false; } public JsonWriter (Json.Node root) { Object(root: root); } public new bool to_file (string filepath, bool use_backup = false) { try { File file = File.new_for_path(filepath); FileOutputStream stream = file.replace( null, use_backup, FileCreateFlags.REPLACE_DESTINATION, null); File parent = file.get_parent(); if (!parent.query_exists()) parent.make_directory_with_parents(); if (compress) { indent = 0; pretty = false; var compressor = new ZlibCompressor(ZlibCompressorFormat.ZLIB); var compressed_stream = new ConverterOutputStream (stream, compressor); to_stream(compressed_stream, null); } else { indent = 4; pretty = true; to_stream(stream, null); } return true; } catch (Error e) { warning(e.message); return false; } } } /** * Convenience function. * Equivalent to #Json.Writer.to_file() */ public bool write_json_file (Json.Node root, string filepath, bool compress = false, bool backup = false) { var writer = new JsonWriter(root); writer.compress = compress; return writer.to_file(filepath, backup); } /** * @return #Json.Node or #null if file failed to load */ public Json.Node? load_json_file (string filepath, bool compressed = false) { try { var parser = new Json.Parser(); if (compressed) { var stream = File.new_for_path(filepath).read(); var decompressor = new ZlibDecompressor(ZlibCompressorFormat.ZLIB); var uncompressed_stream = new ConverterInputStream(stream, decompressor); parser.load_from_stream(uncompressed_stream); } else parser.load_from_file(filepath); return parser.get_root(); } catch (Error e) { warning("\nFailed to load cache file : %s\n%s : skipping...", filepath, e.message); } return null; } master-0.7.3/lib/Common/Logger.vala000066400000000000000000000204351300074171200170750ustar00rootroot00000000000000/* Logger.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace Logging { public void setup (string domain, LogLevel level = LogLevel.WARN) { Logger.initialize(domain); Logger.DisplayLevel = level; return; } } /* Originally from libplank. */ // // Copyright (C) 2011 Robert Dyer // /** * Displays a verbose log message to the console. * * @param msg the log message to display */ public void verbose (string msg, ...) { Logger.write(LogLevel.VERBOSE, Logger.format_message(msg.vprintf(va_list()))); return; } /** * Controls what messages show in the console log. */ public enum LogLevel { /** * Extra debugging info. A *LOT* of messages. */ VERBOSE, /** * Debugging messages that help track what the application is doing. */ DEBUG, /** * General information messages. Similar to debug but perhaps useful to non-debug users. */ INFO, /** * Messages that also show a libnotify message. */ NOTIFY, /** * Any messsage that is a warning. */ WARN, /** * Any message considered an error. These can be recovered from but might make the application function abnormally. */ ERROR, /** * Any message considered fatal. These generally break the application. */ FATAL; public string to_string () { switch (this) { case DEBUG: case VERBOSE: return "DEBUG"; case WARN: return "WARNING"; case ERROR: return "ERROR"; case FATAL: return "FATAL"; default: return "INFO"; } } } public enum ConsoleColor { BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, } /** * A logging class to display all console messages in a nice colored format. */ public class Logger : Object { class LogMessage : Object { public LogLevel level { get; construct; } public string message { get; construct; } public LogMessage (LogLevel level, string message) { Object (level : level, message : message); } } /** * The current log level. Controls what log messages actually appear on the console. */ public static LogLevel DisplayLevel { get; set; default = LogLevel.WARN; } public static ErrorCallback? ErrorHandler { get; set; default = null; } static string name { get; set; } static Object? queue_lock = null; static Gee.ArrayList log_queue; static bool is_writing; static Regex? re = null; /** * Initializes the logger for the application. * * @param app_name the name of the application */ public static void initialize (string app_name) { name = app_name; is_writing = false; log_queue = new Gee.ArrayList (); try { re = new Regex("""[(]?.*?([^/]*?)(\.2)?\.vala(:\d+)[)]?:\s*(.*)"""); } catch { } Log.set_default_handler (glib_log_func); } public static string format_message (string msg) { if (re != null && re.match(msg)) { var parts = re.split(msg); if (DisplayLevel <= LogLevel.DEBUG) return "[%s%s] %s".printf (parts[1], parts[3], parts[4]); else return "%s".printf (parts[4]); } return msg; } /** * Displays a log message using libnotify. Also displays on the console. * * @param msg the log message to display * @param icon the icon to display in the notification */ public static void notification (string msg, string icon = "") { // TODO display the message using libnotify write(LogLevel.NOTIFY, format_message (msg)); } static string get_time () { var now = new DateTime.now_local (); return "%.2d:%.2d:%.2d".printf(now.get_hour (), now.get_minute (), now.get_second ()); } public static void write (LogLevel level, string msg) { if (level < DisplayLevel) return; if (is_writing) { lock(queue_lock) log_queue.add(new LogMessage (level, msg)); } else { is_writing = true; if (log_queue.size > 0) { var logs = log_queue; lock(queue_lock) log_queue = new Gee.ArrayList (); foreach(var log in logs) print_log(log); } print_log(new LogMessage (level, msg)); is_writing = false; } } static void print_log (LogMessage log) { set_color_for_level(log.level); stdout.printf("[%s %s]", log.level.to_string (), get_time ()); reset_color(); stdout.printf(" %s\n", log.message); } static void set_color_for_level (LogLevel level) { switch (level) { case LogLevel.VERBOSE: set_foreground (ConsoleColor.CYAN); break; case LogLevel.DEBUG: set_foreground (ConsoleColor.GREEN); break; case LogLevel.INFO: set_foreground (ConsoleColor.BLUE); break; case LogLevel.NOTIFY: set_foreground (ConsoleColor.MAGENTA); break; case LogLevel.WARN: default: set_foreground (ConsoleColor.YELLOW); break; case LogLevel.ERROR: set_foreground (ConsoleColor.RED); break; case LogLevel.FATAL: set_background (ConsoleColor.RED); set_foreground (ConsoleColor.WHITE); break; } } public static void reset_color () { stdout.printf ("\x001b[0m"); } public static void set_foreground (ConsoleColor color) { set_color (color, true); } public static void set_background (ConsoleColor color) { set_color (color, false); } static void set_color (ConsoleColor color, bool isForeground) { var color_code = color + 30 + 60; if (!isForeground) color_code += 10; stdout.printf ("\x001b[%dm", color_code); } static void glib_log_func (string? d, LogLevelFlags flags, string msg) { var domain = ""; if (d != null) domain = "[%s] ".printf(d ?? ""); var message = msg.replace("\n", "").replace("\r", ""); message = "%s%s".printf(domain, message); switch (flags) { case LogLevelFlags.LEVEL_CRITICAL: write(LogLevel.FATAL, format_message(message)); write(LogLevel.FATAL, format_message("%s will not function properly.".printf(name))); if (ErrorHandler != null) ErrorHandler(message); break; case LogLevelFlags.LEVEL_ERROR: write(LogLevel.ERROR, format_message(message)); if (ErrorHandler != null) ErrorHandler(message); break; case LogLevelFlags.LEVEL_INFO: case LogLevelFlags.LEVEL_MESSAGE: write(LogLevel.INFO, format_message(message)); break; case LogLevelFlags.LEVEL_DEBUG: write (LogLevel.DEBUG, format_message(message)); break; case LogLevelFlags.LEVEL_WARNING: default: write(LogLevel.WARN, format_message(message)); break; } } } master-0.7.3/lib/Common/Settings.vala.in000066400000000000000000000051151300074171200200610ustar00rootroot00000000000000/* Settings.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ const string [] POSSIBLE_SCHEMA_DIRS = { "@prefix@/share/glib-2.0/schemas", "@abs_top_srcdir@/data" }; public Settings? get_gsettings (string schema_id) { SettingsSchema? schema; SettingsSchemaSource schema_source = SettingsSchemaSource.get_default(); schema = schema_source.lookup(schema_id, true); if (schema == null) { debug("No valid schema in default source. Checking for fallbacks"); var possible_schema_dirs = new Array (); string user_data_dir = Environment.get_user_data_dir(); string user_schema_dir = Path.build_filename(user_data_dir, "glib-2.0", "schemas"); possible_schema_dirs.append_val(user_schema_dir); foreach (var dir in POSSIBLE_SCHEMA_DIRS) possible_schema_dirs.append_val(dir); for (int i = 0; i < possible_schema_dirs.length; i++) { string dir = possible_schema_dirs.index(i); { File d = File.new_for_path(dir); if (!d.query_exists()) continue; } try { debug("Checking for schema in %s", dir); schema_source = new SettingsSchemaSource.from_directory(dir, null, false); } catch (Error e) { debug("Failed to create schema source for %s : %s", dir, e.message); continue; } schema = schema_source.lookup(schema_id, true); if (schema != null) { debug("Loading schema with id %s from %s", schema_id, dir); break; } } } if (schema == null) { critical("Failed to find valid settings schema! Unable to store settings."); return null; } return new Settings.full(schema, null, null); } master-0.7.3/lib/Common/Utils.vala000077500000000000000000000117561300074171200167670ustar00rootroot00000000000000/* Utils.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ public delegate void ReloadFunc (); public delegate void MenuCallback (); [CCode (has_target = false)] public delegate void ProgressCallback (string? message, int processed, int total); [CCode (has_target = false)] public delegate void ErrorCallback (string message); namespace FontManager { public enum DragTargetType { FAMILY, COLLECTION, EXTERNAL } public const Gdk.DragAction AppDragActions = Gdk.DragAction.COPY; public const Gtk.TargetEntry [] AppDragTargets = { { "font-family", Gtk.TargetFlags.SAME_APP, DragTargetType.FAMILY }, { "text/uri-list", 0, DragTargetType.EXTERNAL } }; } public struct MenuEntry { public string action_name; public string display_name; public string detailed_action_name; public string? accelerator; public MenuCallbackWrapper method; public MenuEntry (string name, string label, string detailed_signal, string? accel, MenuCallbackWrapper cbw) { action_name = name; display_name = label; detailed_action_name = detailed_signal; accelerator = accel; method = cbw; } } public class MenuCallbackWrapper { public MenuCallback run; public MenuCallbackWrapper (MenuCallback c) { run = () => { c(); }; } } public void add_action_from_menu_entry (ActionMap map, MenuEntry entry) { var action = new SimpleAction(entry.action_name, null); action.activate.connect((a, p) => { entry.method.run(); } ); map.add_action(action); return; } public File []? get_command_line_files (ApplicationCommandLine cl) { VariantDict options = cl.get_options_dict(); Variant argv = options.lookup_value("", VariantType.BYTESTRING_ARRAY); if (argv == null) return null; string* [] filelist = argv.get_bytestring_array(); if (filelist.length == 0) return null; File [] files = null; foreach (var file in filelist) files += cl.create_file_for_arg(file); return files; } public int get_command_line_status (string cmd) { try { int exit_status; Process.spawn_command_line_sync(cmd, null, null, out exit_status); return exit_status; } catch (Error e) { warning("Execution of %s failed : %s", cmd, e.message); return -1; } } public string? get_command_line_output (string cmd) { try { string std_out; Process.spawn_command_line_sync(cmd, out std_out); return std_out; } catch (Error e) { warning("Execution of %s failed : %s", cmd, e.message); return null; } } public string get_user_font_dir () { return Path.build_filename(Environment.get_user_data_dir(), "fonts"); } public string get_localized_pangram () { return Pango.Language.get_default().get_sample_string(); } public string get_localized_preview_text () { return DEFAULT_PREVIEW_TEXT.printf(get_localized_pangram()); } public string get_local_time () { DateTime creation_time = new DateTime.now_local(); return "%s".printf(creation_time.format("%c")); } public int natural_cmp (string a, string b) { return strcmp(a.collate_key_for_filename(-1), b.collate_key_for_filename(-1)); } public string get_file_extension (string path) { var arr = path.split_set("."); return "%s".printf(arr[arr.length - 1]); } public Gee.ArrayList sorted_list_from_collection (Gee.Collection iter) { var l = new Gee.ArrayList (); l.add_all(iter); l.sort((CompareDataFunc) natural_cmp); return l; } public bool remove_directory (File? dir, bool recursive = true) { if (dir == null) return false; try { if (recursive) { FileInfo fileinfo; var enumerator = dir.enumerate_children(FileAttribute.STANDARD_NAME, FileQueryInfoFlags.NONE); while ((fileinfo = enumerator.next_file ()) != null) { try { dir.get_child(fileinfo.get_name()).delete(); } catch (Error e) { remove_directory(dir.get_child(fileinfo.get_name()), recursive); } } } dir.delete(); return true; } catch (Error e) { warning(e.message); } return false; } master-0.7.3/lib/Filters/000077500000000000000000000000001300074171200151655ustar00rootroot00000000000000master-0.7.3/lib/Filters/Category.vala000077500000000000000000000065461300074171200176250ustar00rootroot00000000000000/* Category.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class Category : Filter { public string? condition { get; set; default = null; } public Gee.HashSet descriptions { get; set; } public Gee.ArrayList children { get; set; } public Category (string name, string? comment = null, string? icon = null, string? condition = null) { Object(name: name, icon: icon, comment: comment, condition: condition); families = new Gee.HashSet (); descriptions = new Gee.HashSet (); children = new Gee.ArrayList (); } public virtual void update (Database db) { families.clear(); descriptions.clear(); try { get_matching_families_and_fonts(db, families, descriptions, condition); if (children != null) foreach (var child in children) child.update(db); } catch (DatabaseError e) { warning ("%s category results invalid", name); critical("Database error : %s", e.message); //show_error_message(_("There was an error accessing the database"), e); } return; } /* Don't cache any results - Categories are dynamic */ public override bool deserialize_property (string prop_name, out Value val, ParamSpec pspec, Json.Node node) { if (pspec.value_type == typeof(Gee.HashSet) || pspec.value_type == typeof(Gee.ArrayList)) { val = Value(pspec.value_type); if (pspec.value_type == typeof(Gee.HashSet)) val.set_object(new Gee.HashSet ()); else val.set_object(new Gee.ArrayList ()); return true; } else return base.deserialize_property(prop_name, out val, pspec, node); } public override Json.Node serialize_property (string prop_name, Value val, ParamSpec pspec) { if (pspec.value_type == typeof(Gee.HashSet) || pspec.value_type == typeof(Gee.ArrayList)) { var node = new Json.Node(Json.NodeType.OBJECT); return node; } else return base.serialize_property(prop_name, val, pspec); } } } master-0.7.3/lib/Filters/Collection.vala000077500000000000000000000106271300074171200201360ustar00rootroot00000000000000/* Collection.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class Collection : Filter { public Gee.ArrayList children { get; set; } public Collection (string? name) { Object(name: name); families = new Gee.HashSet (); children = new Gee.ArrayList (); /* XXX : Translatable string as default for argument generates broken vapi ? */ if (name == null) name = _("New Collection"); } public int size () { return get_full_contents().size; } public void clear_children () { foreach (var child in children) child.clear_children(); children.clear(); return; } public void set_active_from_fonts (FontConfig.Reject reject) { active = false; foreach (var family in families) if (!(family in reject)) { active = true; break; } foreach (var child in children) child.set_active_from_fonts(reject); return; } void add_child_contents (Collection child, Gee.HashSet full_contents) { full_contents.add_all(child.families); foreach(var _child in child.children) add_child_contents(_child, full_contents); return; } public Gee.HashSet get_full_contents () { var full_contents = new Gee.HashSet (); full_contents.add_all(families); foreach (var child in children) add_child_contents(child, full_contents); return full_contents; } public void update (FontConfig.Reject reject) { if (active) reject.remove_all(families); else reject.add_all(families); reject.save(); foreach (var child in children) { child.active = active; child.update(reject); } return; } public override bool deserialize_property (string prop_name, out Value val, ParamSpec pspec, Json.Node node) { if (pspec.value_type == typeof(Gee.ArrayList)) { val = Value(pspec.value_type); var res = new Gee.ArrayList (); node.get_object().foreach_member((obj, name, node) => { res.add((Collection) Json.gobject_deserialize(typeof(Collection), node)); }); val.set_object(res); return true; } else return base.deserialize_property(prop_name, out val, pspec, node); } public override Json.Node serialize_property (string prop_name, Value val, ParamSpec pspec) { if (pspec.value_type == typeof(Gee.ArrayList)) { var node = new Json.Node(Json.NodeType.OBJECT); var obj = new Json.Object(); foreach (var collection in children) obj.set_member(collection.name.escape(""), Json.gobject_serialize(collection)); node.set_object(obj); return node; } else return base.serialize_property(prop_name, val, pspec); } } } master-0.7.3/lib/Filters/Disabled.vala000066400000000000000000000022721300074171200175440ustar00rootroot00000000000000/* Disabled.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class Disabled : Category { public Disabled () { base(_("Disabled"), _("Fonts which have been disabled"), "list-remove", null); } public new void update (Database db, FontConfig.Reject reject) { base.update(db); families.retain_all(reject); return; } } } master-0.7.3/lib/Filters/Filter.vala000077500000000000000000000053771300074171200172760ustar00rootroot00000000000000/* Filter.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { int sort_on_index (Filter a, Filter b) { return (a.index - b.index); } public abstract class Filter : Cacheable { public string? name { get; set; } public string? icon { get; set; default = null; } public string comment { get; set; } public Gee.HashSet families { get; set; } public int index { get; set; default = 0; } public bool active { get; set; default = true; } construct { comment = _("Created : %s").printf(get_local_time()); } public override bool deserialize_property (string prop_name, out Value val, ParamSpec pspec, Json.Node node) { if (pspec.value_type == typeof(Gee.HashSet)) { val = Value(pspec.value_type); var res = new Gee.HashSet (); node.get_array().foreach_element((array, index, node) => { res.add(array.get_string_element(index)); }); val.set_object(res); return true; } else return base.deserialize_property(prop_name, out val, pspec, node); } public override Json.Node serialize_property (string prop_name, Value val, ParamSpec pspec) { if (pspec.value_type == typeof(Gee.HashSet)) { var node = new Json.Node(Json.NodeType.ARRAY); var array = new Json.Array.sized((uint) families.size); foreach (var font in families) array.add_string_element(font); node.set_array(array); return node; } else return base.serialize_property(prop_name, val, pspec); } } } master-0.7.3/lib/Filters/SearchResult.vala000077500000000000000000000017401300074171200204430ustar00rootroot00000000000000/* SearchResult.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class SearchResult : Category { public SearchResult (string name) { base(name); } } } master-0.7.3/lib/Filters/Unsorted.vala000077500000000000000000000023061300074171200176410ustar00rootroot00000000000000/* Unsorted.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class Unsorted : Category { public Unsorted () { base(_("Unsorted"), _("Fonts not present in any collection"), "dialog-question", null); } public new void update (Database db, Gee.HashSet sorted) { base.update(db); families.remove_all(sorted); return; } } } master-0.7.3/lib/FontConfig/000077500000000000000000000000001300074171200156115ustar00rootroot00000000000000master-0.7.3/lib/FontConfig/Alias.vala000066400000000000000000000176701300074171200175220ustar00rootroot00000000000000/* Alias.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /** * Standard aliases. * * These should never appear in font listings. */ public const string [] DEFAULT_ALIASES = { "Cursive", "cursive", "Fantasy", "fantasy", "Monospace", "monospace", "Sans", "sans", "Sans-Serif", "sans-serif", "Serif", "serif" }; /** * AliasElement - Represents a Fontconfig element. * * Alias elements provide a shorthand notation for the set of common * match operations needed to substitute one font family for another. * They contain a element followed * by optional , and elements. * Fonts matching the element are edited to prepend the list of * ed families before the matching , * append the able families after the matching * and append the families to the end of the family list. * * * TARGET_FAMILY_NAME * * * PREPENDED_TO_LIST * THIS_ONE_TOO * * * APPENDED_IMEDIATELY_AFTER_TARGET * * * APPENDED_TO_END_OF_LIST * * * */ public class AliasElement : Object { public string? family { get; set; } public Gee.HashSet prefer { get; set; } public Gee.HashSet accept { get; set; } public Gee.HashSet @default { get; set; } construct { prefer = new Gee.HashSet (); accept = new Gee.HashSet (); @default = new Gee.HashSet (); } public AliasElement (string? family) { Object(family: family); } } /** * Aliases - Represents a Fontconfig configuration file * * @config_dir directory to store configuration file * @target_file filename following the form [3][0-9]*.conf * * Is actually a #Gee.HashMap holding #AliasElement entries. * Provides methods to save() / load() configuration files. */ public class Aliases : Gee.HashMap { /** * Aliases:config_dir: * * Should be set to one of the directories monitored by Fontconfig for * configuration files. * * Default value : #get_package_config_dir() */ public string config_dir { get; set; default = get_package_config_dir(); } /** * Aliases:target_file: * * Should be set to a filename in the form [3][0-9]*.conf * * Default value : "39-Alias.conf" */ public string target_file { get; set; default = "39-Alias.conf"; } /** * Convenience method to add a new #AliasElement */ public void add (string family_name) { base.set(family_name, new AliasElement(family_name)); return; } /** * Remove an alias element by name. */ public bool remove (string family_name) { return base.unset(family_name); } /** * @return returns the filepath used to store aliases */ public string get_filepath () { return Path.build_filename(config_dir, target_file); } /** * Saves current configuration to file. */ public bool save () { var writer = new XmlWriter(get_filepath()); foreach (var entry in this.entries) write_alias_element(writer, entry.value); return (writer.close() >= 0); } /** * Load saved configuration from file. */ public void load () { clear(); string filepath = get_filepath(); Xml.Parser.init(); verbose("Xml.Parser : Opening : %s", filepath); Xml.Doc * doc = Xml.Parser.parse_file(filepath); if (doc == null) { /* File not found */ debug("Xml.Parser : File not found : %s", filepath); Xml.Parser.cleanup(); return; } Xml.XPath.Context ctx = new Xml.XPath.Context(doc); Xml.XPath.Object * res = ctx.eval_expression("//alias"); for (int i = 0; i < res->nodesetval->length (); i++) { AliasElement ae = parse_alias_node(res->nodesetval->item(i)); this[ae.family] = ae; debug("Loaded alias entry for %s", ae.family); } verbose("Xml.Parser : Closing : %s", filepath); delete res; delete doc; Xml.Parser.cleanup(); return; } const string [] AE_PROPS = { "prefer", "accept", "default" }; AliasElement parse_alias_node (Xml.Node * alias_node) { var ae = new AliasElement(null); for (Xml.Node * iter = alias_node->children; iter != null; iter = iter->next) { if (iter->type == Xml.ElementType.ELEMENT_NODE) { if (iter->name == "family") { ae.family = iter->get_content(); } else { unowned ObjectClass obj_cls = ((Object) ae).get_class(); ParamSpec? pspec = obj_cls.find_property(iter->name); if (pspec != null && pspec.name in AE_PROPS) { var l = new Gee.HashSet (); /* Object.get (name, out value ...); */ ((Object) ae).get(pspec.name, out l); for (Xml.Node * _iter = iter->children; _iter != null; _iter = _iter->next) { if (_iter->type == Xml.ElementType.ELEMENT_NODE) { if (_iter->name == "family") l.add(_iter->get_content()); } } } else { verbose("Skipping unknown element : %s", iter->name); } } } } return ae; } void write_alias_element (XmlWriter writer, AliasElement ae) { if (ae.family == null) return; writer.start_element("alias"); writer.write_element("family", ae.family); foreach (var prop in AE_PROPS) { writer.start_element(prop); var l = new Gee.HashSet (); /* Object.get (name, out value ...); */ ((Object) ae).get(prop, out l); foreach (string f in l) writer.write_element("family", f); writer.end_element(); } writer.end_element(); return; } } } master-0.7.3/lib/FontConfig/Common.vala000066400000000000000000000154101300074171200177070ustar00rootroot00000000000000/* Common.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /** * @return version number of Fontconfig library */ public string get_version_string () { string raw = FcGetVersion().to_string(); return "%c.%c%c.%s".printf(raw.get(0), raw.get(1), raw.get(2), raw.substring(3)); } /** * @return the current users fontconfig configuration directory */ public string get_config_dir () { string config_dir = Path.build_filename(Environment.get_user_config_dir(), "fontconfig", "conf.d"); if (DirUtils.create_with_parents(config_dir, 0755) != 0) critical("Failed to create %s!".printf(config_dir)); return config_dir; } /** * load_user_fontconfig_files: * * Load any user configuration files which do not interfere with our * ability to render fonts properly. */ public void load_user_fontconfig_files () { string [] exclude = { "39-Alias.conf", "78-Reject.conf" }; try { string config_dir = get_config_dir(); File directory = File.new_for_path(config_dir); FileEnumerator enumerator = directory.enumerate_children(FileAttribute.STANDARD_NAME, 0); GLib.FileInfo file_info; while ((file_info = enumerator.next_file ()) != null) { string filename = file_info.get_name(); if (filename.has_suffix(".conf")) { if (filename in exclude) continue; string filepath = Path.build_filename(config_dir, filename); if (!load_config(filepath)) warning("Fontconfig : Failed to parse file : %s", filepath); } } } catch (Error e) { critical(e.message); } return; } /** * load_user_font_sources: * * Adds user configured font sources (directories) to our FcConfig so that * we can render fonts which are not actually "installed". * It also ensures the default font directory is included. */ public bool load_user_font_sources (Source [] sources) { clear_app_fonts(); bool res = true; foreach (var source in sources) { if (source.available && !add_app_font_dir(source.path)) { res = false; warning("Failed to register user font source! : %s", source.path); } else { verbose("Added source to configuration : %s", source.path); } } string default_user_font_dir_path = Path.build_filename(Environment.get_user_data_dir(), "fonts"); { File default_user_font_dir = File.new_for_path(default_user_font_dir_path); if (!default_user_font_dir.query_exists()) /* Means the user does not have a default font directory yet, create it */ try { default_user_font_dir.make_directory_with_parents(); } catch (Error e) { warning("Attempt to create default font directory failed : %s", default_user_font_dir_path); critical(e.message); } } if (!add_app_font_dir(default_user_font_dir_path)) { res = false; warning("Failed to register user font source! : %s", default_user_font_dir_path); } else { verbose("Added default user font directory to configuration"); } return res; } /** * Update Fontconfig font caches */ public bool update_cache () { return FcCacheUpdate(); } /** * list_families: * * @return #Gee.ArrayList of available font families */ public Gee.ArrayList list_families () { return FcListFamilies(); } /** * list_files: * * @return #Gee.ArrayList of available font files */ public Gee.ArrayList list_files () { return FcListFiles(); } /** * list_dirs: * * @return #Gee.ArrayList of available font directories */ public Gee.ArrayList list_dirs (bool recursive = false) { return FcListDirs(recursive); } /** * list_user_dirs: * * @return #Gee.ArrayList of available font directories owned by user */ public Gee.ArrayList list_user_dirs () { return FcListUserDirs(); } /** * enable_user_config: * * Whether to load Fontconfig configuration files from users home directory */ public bool enable_user_config (bool enable = true) { return FcEnableUserConfig(enable); } /** * add_app_font: * * Adds filepath to application specific FcConfig. */ public bool add_app_font (string filepath) { return FcAddAppFont(filepath); } /** * add_app_font_dir: * * Adds dir to application specific FcConfig. */ public bool add_app_font_dir (string dir) { return FcAddAppFontDir(dir); } /** * clear_app_fonts: * * Remove any fonts added using add_app_font / add_app_font_dir */ public void clear_app_fonts () { FcClearAppFonts(); return; } /** * load_config: * * Parse and load given filepath. * Should be valid Fonconfig configuration file. */ public bool load_config (string filepath) { return FcLoadConfig(filepath); } } /* Defined in fontconfig.h */ extern int FcGetVersion(); /* Defined in _Common_.c */ extern Gee.ArrayList FcListFamilies (); extern Gee.ArrayList FcListFiles (); extern Gee.ArrayList FcListDirs (bool recursive); extern Gee.ArrayList FcListUserDirs (); extern bool FcEnableUserConfig (bool enable); extern bool FcAddAppFont (string filepath); extern bool FcAddAppFontDir (string dir); extern void FcClearAppFonts (); extern bool FcLoadConfig (string filepath); extern bool FcCacheUpdate (); master-0.7.3/lib/FontConfig/Directories.vala000077500000000000000000000035041300074171200207370ustar00rootroot00000000000000/* Directories.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /** * Directories - Represents a Fontconfig configuration file * * @config_dir directory to store configuration file * @target_file filename following the form [0][0-9]*.conf * * elements contain a directory name which will be scanned * for font files to include in the set of available fonts. * * Is actually a #Gee.HashSet holding directory paths. * Provides methods to save() / load() configuration files. */ public class Directories : Selections { public Directories () { target_element = "dir"; target_file = "09-Directories.conf"; } protected override void parse (Xml.Node * root) { parse_node(root->children); } protected override void write_node (XmlWriter writer) { foreach (string path in this) writer.write_element(target_element, Markup.escape_text(path.strip())); return; } } } master-0.7.3/lib/FontConfig/Enums.vala000077500000000000000000000141441300074171200175540ustar00rootroot00000000000000/* Enums.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { public enum Weight { THIN = 0, EXTRALIGHT = 40, ULTRALIGHT = 40, LIGHT = 50, BOOK = 75, REGULAR = 80, NORMAL = 80, MEDIUM = 100, DEMIBOLD = 180, SEMIBOLD = 180, BOLD = 200, EXTRABOLD = 205, BLACK = 210, HEAVY = 210, EXTRABLACK = 215, ULTRABLACK = 215; public bool defined () { bool res; switch (this) { case THIN: case ULTRALIGHT: case LIGHT: case BOOK: case REGULAR: case MEDIUM: case SEMIBOLD: case BOLD: case EXTRABOLD: case BLACK: case ULTRABLACK: res = true; break; default: res = false; break; } return res; } public string? to_string () { switch (this) { case THIN: return _("Thin"); case ULTRALIGHT: return _("Ultra-Light"); case LIGHT: return _("Light"); case BOOK: return _("Book"); case MEDIUM: return _("Medium"); case SEMIBOLD: return _("Semi-Bold"); case BOLD: return _("Bold"); case EXTRABOLD: return _("Ultra-Bold"); case HEAVY: return _("Heavy"); case ULTRABLACK: return _("Ultra-Heavy"); default: return null; } } } public enum Slant { ROMAN = 0, ITALIC = 100, OBLIQUE = 110; public string? to_string () { switch (this) { case ITALIC: return _("Italic"); case OBLIQUE: return _("Oblique"); default: return null; } } } public enum Width { ULTRACONDENSED = 50, EXTRACONDENSED = 63, CONDENSED = 75, SEMICONDENSED = 87, NORMAL = 100, SEMIEXPANDED = 113, EXPANDED = 125, EXTRAEXPANDED = 150, ULTRAEXPANDED = 200; public string? to_string () { switch (this) { case ULTRACONDENSED: return _("Ultra-Condensed"); case EXTRACONDENSED: return _("Extra-Condensed"); case CONDENSED: return _("Condensed"); case SEMICONDENSED: return _("Semi-Condensed"); case SEMIEXPANDED: return _("Semi-Expanded"); case EXPANDED: return _("Expanded"); case EXTRAEXPANDED: return _("Extra-Expanded"); case ULTRAEXPANDED: return _("Ultra-Expanded"); default: return null; } } } public enum Spacing { PROPORTIONAL = 0, DUAL = 90, MONO = 100, CHARCELL = 110; public string? to_string () { switch (this) { case PROPORTIONAL: return _("Proportional"); case DUAL: return _("Dual Width"); case MONO: return _("Monospace"); case CHARCELL: return _("Charcell"); default: return null; } } } public enum SubpixelOrder { UNKNOWN, RGB, BGR, VRGB, VBGR, NONE; public string to_string () { switch (this) { case UNKNOWN: return _("Unknown"); case RGB: return _("RGB"); case BGR: return _("BGR"); case VRGB: return _("VRGB"); case VBGR: return _("VBGR"); default: return _("None"); } } } public enum HintStyle { NONE, SLIGHT, MEDIUM, FULL; public string to_string () { switch (this) { case SLIGHT: return _("Slight"); case MEDIUM: return _("Medium"); case FULL: return _("Full"); default: return _("None"); } } } public enum LCDFilter { NONE, DEFAULT, LIGHT, LEGACY; public string to_string () { switch (this) { case DEFAULT: return _("Default"); case LIGHT: return _("Light"); case LEGACY: return _("Legacy"); default: return _("None"); } } } } master-0.7.3/lib/FontConfig/Families.vala000066400000000000000000000054611300074171200202150ustar00rootroot00000000000000/* Families.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { internal Gee.ArrayList sorted_list_from_collection (Gee.Collection iter) { var l = new Gee.ArrayList (); l.add_all(iter); l.sort((CompareDataFunc) natural_cmp); return l; } public class Families : Gee.HashMap { public signal void progress (string? message, int processed, int total); public void update () { this.clear(); var families = list_families(); var total = families.size; var processed = 0; foreach (var family in families) { this[family] = new Family(family); processed++; progress(_("Loading available font families"), processed, total); } } public string to_data () { var builder = new Json.Builder(); builder.begin_object(); foreach (var key in this.list()) { builder.set_member_name(key); builder.add_value(Json.gobject_serialize(this[key])); } builder.end_object(); var generator = new JsonWriter(builder.get_root()); size_t len; string res = generator.to_data(out len); return res; } public Gee.ArrayList list () { return sorted_list_from_collection(keys); } public Gee.ArrayList list_fonts () { var fonts = new Gee.ArrayList (); foreach (var family in this.values) fonts.add_all(family.faces.values); return fonts; } public Gee.HashSet list_font_descriptions () { var l = list_fonts(); var descriptions = new Gee.HashSet (); foreach (var font in l) { descriptions.add(font.family); descriptions.add(font.description); } return descriptions; } } } master-0.7.3/lib/FontConfig/Family.vala000066400000000000000000000113251300074171200177010ustar00rootroot00000000000000/* Family.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /* Most common font styles, we try to select one of these if possible */ public const string [] DEFAULT_VARIANTS = { "Regular", "Roman", "Medium", "Normal", "Book" }; public int sort_families (Family a, Family b) { return natural_cmp(a.name, b.name); } /** * Family: */ public class Family : Cacheable { public string name { get; protected set; } /** * Family:description: * * A valid #Pango.FontDescription string for this */ public string description { get; protected set; } public bool has_bold { get; private set; default = false; } public bool has_italic { get; private set; default = false; } public Gee.HashMap faces { get; protected set; } public Family (string name) { this.name = description = name; this.init(); } protected virtual void init () { faces = new Gee.HashMap (); foreach (var face in list_fonts(name)) { faces[face.style] = face; if (((Weight) face.weight) >= Weight.DEMIBOLD) has_bold = true; if (((Slant) face.slant) != Slant.ROMAN) has_italic = true; } return; } /** * list_faces: * * @return sorted #Gee.ArrayList of #FontConfig.Font in this */ public Gee.ArrayList list_faces () { var fontlist = new Gee.ArrayList (); fontlist.add_all(faces.values); fontlist.sort((CompareDataFunc) sort_fonts); return fontlist; } /** * get_default_variant: * * @return the default #FontConfig.Font for this */ public Font get_default_variant () { var fontlist = list_faces(); /* Try to find default variant */ foreach (Font font in fontlist) { string style = font.description; if (style == name) return font; foreach (var variant in DEFAULT_VARIANTS) if (style.contains(variant)) return font; } /* Better than nothing */ return fontlist[0]; } public override bool deserialize_property (string prop_name, out Value val, ParamSpec pspec, Json.Node node) { if (pspec.value_type == typeof(Gee.HashMap)) { val = Value(pspec.value_type); var facemap = new Gee.HashMap (); node.get_object().foreach_member((obj, name, node) => { facemap[name] = (Font) Json.gobject_deserialize(typeof(Font), node); }); val.set_object(facemap); return true; } else return base.deserialize_property(prop_name, out val, pspec, node); } public override Json.Node serialize_property (string prop_name, Value val, ParamSpec pspec) { if (pspec.value_type == typeof(Gee.HashMap)) { var node = new Json.Node(Json.NodeType.OBJECT); var obj = new Json.Object(); foreach (Font face in faces.values) obj.set_member(face.style.escape(""), Json.gobject_serialize(face)); node.set_object(obj); return node; } else return base.serialize_property(prop_name, val, pspec); } } } master-0.7.3/lib/FontConfig/Font.vala000066400000000000000000000056141300074171200173720ustar00rootroot00000000000000/* Font.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /* XXX : This function re-defined here to avoid pulling in other files when generating ../Glue/_Glue_.h */ internal int natural_cmp (string a, string b) { return strcmp(a.collate_key_for_filename(-1), b.collate_key_for_filename(-1)); } public int sort_fonts (Font a, Font b) { if (a.weight != b.weight) return a.weight - b.weight; else if (a.slant != b.slant) return a.slant - b.slant; else if (a.width != b.width) return a.width - b.width; else if (a.style != b.style) return natural_cmp(a.style, b.style); else return 0; } /** * Font: */ public class Font : Cacheable { public string? filepath { get; set; default = null; } public int index { get; set; default = 0; } public string? family { get; set; default = null;} public string? style { get; set; default = null; } public int slant { get; set; default = 0; } public int weight { get; set; default = 80; } public int width { get; set; default = 100; } public int spacing { get; set; default = 0; } public int owner { get; set; default = -1; } public string? description { get; set; default = null; } public string to_filename () { return to_string().replace(" ", "_").replace("-", "_"); } public string to_string () { var builder = new StringBuilder(family); builder_append(builder, ((Weight) weight).to_string()); builder_append(builder, ((Slant) slant).to_string()); builder_append(builder, ((Width) width).to_string()); var result = builder.str.strip(); if (result == family) result = "%s %s".printf(result, style); return result; } internal void builder_append (StringBuilder builder, string? val) { if (val == null) return; builder.append(" "); builder.append(val); return; } } } master-0.7.3/lib/FontConfig/MonitoredFiles.vala000066400000000000000000000073211300074171200214040ustar00rootroot00000000000000/* MonitoredFiles.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ /** * MonitoredFiles * * add() paths to monitor and connect to the changed signal to be notified. */ public class MonitoredFiles : Object { /** * Per GLib.FileMonitor.changed 2.46.2 * * In all cases file will be a child of the monitored directory. * For renames, file will be the old name and other_file is the new name. * For "moved in" events, file is the name of the file that appeared and * other_file is the old name that it was moved from (in another directory). * For "moved out" events, file is the name of the file that used to be in * this directory and other_file is the name of the file at its new location. */ public signal void changed (File file, File? other_file, FileMonitorEvent event_type); public int size { get { return monitors.size; } } Gee.HashMap monitors; VolumeMonitor volume_monitor; /* Only notifies if the mounts default path is interesting */ void notify_on_mount_event (Mount mount) { string? path = mount.get_default_location().get_path(); if (path == null || monitors.size < 1) return; foreach (var s in monitors.keys) { if (s.contains(path)) { changed(mount.get_root(), null, FileMonitorEvent.CHANGED); } } return; } construct { monitors = new Gee.HashMap (); volume_monitor = VolumeMonitor.get(); volume_monitor.mount_added.connect((m) => { notify_on_mount_event(m); }); volume_monitor.mount_changed.connect((m) => { notify_on_mount_event(m); }); volume_monitor.mount_removed.connect((m) => { notify_on_mount_event(m); }); changed.connect((f, of, ev) => { debug("FileMonitor Event : %s", f.get_path()); }); } public new FileMonitor? get (string path) { return monitors.get(path); } public bool contains (string path) { return monitors.has_key(path); } public bool add (string path) { if (this.contains(path)) return true; try { File file = File.new_for_path(path); FileMonitor monitor = file.monitor(FileMonitorFlags.WATCH_MOUNTS); assert(monitor != null); monitors.set(path, monitor); assert(monitors.get(path) != null); monitor.changed.connect((f, of, ev) => { changed(f, of, ev); }); monitor.set_rate_limit(3000); } catch (Error e) { warning("Failed to create FileMonitor for %s : %s", path, e.message); return false; } if (!(monitors.has_key(path))) return false; return true; } public bool remove (string path) { return (monitors.get(path).cancel() && monitors.unset(path)); } } master-0.7.3/lib/FontConfig/Properties.vala000077500000000000000000000362671300074171200206330ustar00rootroot00000000000000/* Properties.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /** * FontProperties: * * @family name of font family * @font #FontConfig.font * @less limit configuration to point sizes smaller than * @more limit configuration to point sizes larger than * * If only family is set, configuration will apply to all variations. * If font is set, configuration will apply only to that specific variation. * */ public class FontProperties : DefaultProperties { /** * FontProperties::changed: * * Emitted when family or font has changed. */ public signal void changed (); public double less { get; set; default = 0.0; } public double more { get; set; default = 0.0; } /** * FontProperties:family: * * Name of font family this configuration will apply to. */ public string? family { get { return _family; } set { _family = value; reset_properties(); load(); changed(); Idle.add(() => { this.modified = false; return this.modified; }); } } /** * FontProperties:font: * * #FontConfig.Font this configuration will apply to. */ public Font? font { get { return _font; } set { _font = value; if (_font != null) _family = _font.family; else _family = null; reset_properties(); load(); changed(); Idle.add(() => { this.modified = false; return this.modified; }); } } string? _family = null; Font? _font = null; public FontProperties () { skip_assignment.add("family"); skip_assignment.add("font"); skip_assignment.add("less"); skip_assignment.add("more"); } public override void reset_properties () { less = 0.0; more = 0.0; base.reset_properties(); return; } public new string get_config_file (bool get_default = false) { if (font != null && !get_default) return Path.build_filename(get_config_dir(), "29-%s.conf".printf(font.to_filename())); else if (family != null) return Path.build_filename(get_config_dir(), "29-%s.conf".printf(family)); else return base.get_config_file(); } public override bool load () { target_file = "19-DefaultProperties.conf"; base.load(); if (family != null) { target_file = "29-%s.conf".printf(family); base.load(); } if (font != null) { target_file = "29-%s.conf".printf(font.to_filename()); base.load(); } return true; } protected override void parse_test_node (Xml.Node * iter) { string? ptype = null; string? pval = null; for (Xml.Attr * prop = iter->properties; prop != null; prop = prop->next) { if (prop->name == "name" && prop->children->content == "size") continue; else if (prop->name == "compare" && prop->children->content == "less" || prop->children->content == "more") { for (Xml.Node * val = iter->children; val != null; val = val->next) { if (val->name == "double") { ptype = prop->children->content; pval = val->get_content(); break; } } } else break; } if (pval != null) if (ptype == "less") less = double.parse(pval); else if (ptype == "more") more = double.parse(pval); return; } void write_comparison (XmlWriter writer, string name, string test, string type, string val) { writer.start_element("test"); writer.write_attribute("name", name); writer.write_attribute("compare", test); writer.write_element(type, val); writer.end_element(); return; } protected override void write_match_criteria (XmlWriter writer) { if (family == null && font == null) return; writer.start_element("test"); writer.write_attribute("name", "family"); writer.write_element("string", family); writer.end_element(); if (less != 0.0) write_comparison(writer, "size", "less", "double", less.to_string()); if (more != 0.0) write_comparison(writer, "size", "more", "double", more.to_string()); if (font == null) return; write_comparison(writer, "slant", "eq", "int", font.slant.to_string()); write_comparison(writer, "weight", "eq", "int", font.weight.to_string()); write_comparison(writer, "width", "eq", "int", font.width.to_string()); return; } } /** * DisplayProperties: */ public class DisplayProperties : Properties { public int rgba { get; set; default = 1; } public int lcdfilter { get; set; default = 1; } public double scale { get; set; default = 1.00; } public double dpi { get; set; default = 96; } public DisplayProperties () { target_file = "19-DisplayProperties.conf"; load(); } public override void reset_properties () { rgba = 1; lcdfilter = 1; scale = 1.00; dpi = 96; return; } } /** * DefaultProperties: */ public class DefaultProperties : Properties { public int hintstyle { get; set; default = 0; } public bool antialias { get; set; default = false; } public bool hinting { get; set; default = false; } public bool autohint { get; set; default = false; } public bool embeddedbitmap { get; set; default = false; } public bool modified { get; set; default = false; } public DefaultProperties () { target_file = "19-DefaultProperties.conf"; load(); skip_assignment.add("modified"); notify.connect((pspec) => { if (pspec.name == "modified") return; if (!skip_assignment.contains(pspec.name)) modified = true; }); } public override void reset_properties () { hintstyle = 0; antialias = false; hinting = false; autohint = false; embeddedbitmap = false; modified = false; return; } } /** * Properties - Represents Fontconfig configuration properties * * By default this class will generate entries for all of it's * properties if their type is a valid Fontconfig type useable in a * configuration file. * * * property_value * * * add() property names to skip_assignment to ignore them. * * Provides methods to save() / load() configuration files. * * write_match_criteria() will be called during save() before write_assignments() * and should be overriden to match desired font or family patterns */ public abstract class Properties : Object { public string? target_file { get; protected set; default = "19-Properties.conf"; } public string? target_dir { get; set; default = get_config_dir(); } protected Gee.ArrayList skip_assignment; construct { skip_assignment = new Gee.ArrayList (); skip_assignment.add("target-file"); skip_assignment.add("target-dir"); } protected string get_config_file () { return Path.build_filename(target_dir, target_file); } public virtual void reset_properties () { return; } public virtual bool load () { string target = get_config_file(); if (FileUtils.test(target, FileTest.EXISTS)) { load_assignments(target); return true; } /* File not found */ return false; } public virtual bool save () { var writer = new XmlWriter(get_config_file()); writer.start_element("match"); writer.write_attribute("target", "font"); write_match_criteria(writer); write_assignments(writer); writer.end_element(); return (writer.close() >= 0); } public virtual bool discard () { string target = get_config_file(); if (FileUtils.test(target, FileTest.EXISTS) && FileUtils.remove(target) != 0) return false; reset_properties(); return true; } protected virtual void load_assignments (string target_file) { Xml.Parser.init(); verbose("Xml.Parser : Opening : %s", target_file); Xml.Doc * doc = Xml.Parser.parse_file(target_file); if (doc == null) { /* File not found */ Xml.Parser.cleanup(); return; } Xml.Node * root = doc->get_root_element(); if (root == null) { /* Empty doc */ delete doc; Xml.Parser.cleanup(); return; } for (Xml.Node * iter = root->children; iter != null; iter=iter->next) if (iter->name == "match") { parse_node(iter); break; } verbose("Xml.Parser : Closing : %s", target_file); delete doc; Xml.Parser.cleanup(); return; } protected virtual void parse_edit_node (Xml.Node * iter) { string? pname = null; string? pval = null; for (Xml.Attr * prop = iter->properties; prop != null; prop = prop->next) { if (prop->name == "name") { pname = prop->children->content; break; } } for (Xml.Node * val = iter->children; val != null; val = val->next) { pval = val->get_content(); if (pval == null) continue; if (val->name == "bool") this.set(pname, bool.parse(pval)); else if (val->name == "int") this.set(pname, int.parse(pval)); else if (val->name == "double") this.set(pname, double.parse(pval)); else if (val->name == "string") this.set(pname, pval); } return; } protected virtual void parse_test_node (Xml.Node * iter) { return; } protected virtual void parse_node (Xml.Node * node) { for (Xml.Node * iter = node->children; iter != null; iter=iter->next) { /* Spaces between tags are also nodes, discard them */ if (iter->type != Xml.ElementType.ELEMENT_NODE) continue; else if (iter->name == "edit") parse_edit_node(iter); else if (iter->name == "test") parse_test_node(iter); } return; } protected virtual string? type_to_string (Type t) { switch (t.name()) { case "gint": return "int"; case "gboolean": return "bool"; case "gchararray": return "string"; case "gdouble": return "double"; default: return null; } } protected virtual string? value_to_string (string type, Value val) { switch(type) { case "int": return ((int) val).to_string(); case "bool": return ((bool) val).to_string(); case "string": return ((string) val); case "double": return "%.1f".printf((double) val); default: return null; } } protected virtual void write_assignment (XmlWriter writer, string name, string type, string val) { writer.start_element("edit"); writer.write_attribute("name", name); writer.write_attribute("mode", "assign"); writer.write_attribute("binding", "same"); writer.write_element(type, val); writer.end_element(); return; } protected virtual void write_assignments (XmlWriter writer) { foreach (var pspec in this.get_class().list_properties()) { if (pspec.name in skip_assignment) continue; string? type = type_to_string(pspec.value_type); if (type == null) continue; Value val = Value(pspec.value_type); this.get_property(pspec.name, ref val); string? res = value_to_string(type, val); if (res != null) write_assignment(writer, pspec.name, type, res); val.unset(); } return; } protected virtual void write_match_criteria (XmlWriter writer) { return; } } } master-0.7.3/lib/FontConfig/Selections.vala000077500000000000000000000175711300074171200206040ustar00rootroot00000000000000/* Selections.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /** * {@inheritDoc} */ public class Accept : Selections { public Accept () { target_element = "acceptfont"; target_file = "79-Accept.conf"; } } /** * {@inheritDoc} */ public class Reject : Selections { public Reject () { target_element = "rejectfont"; target_file = "78-Reject.conf"; } } /** * Selections - Represents a Fontconfig configuration file. * * @config_dir directory to store configuration file * @target_file filename following the form [7][0-9]*.conf * @target_element or * * The selectfont element is used to black/white list fonts from being * listed or matched against. It holds acceptfont and rejectfont elements. * * Fonts matched by an acceptfont element are "whitelisted"; * such fonts are explicitly included in the set of fonts used to * resolve list and match requests; including them in this list protects * them from being "blacklisted" by a rejectfont element. * Acceptfont elements include glob and pattern elements which are used * to match fonts. * * Fonts matched by an rejectfont element are "blacklisted"; * such fonts are excluded from the set of fonts used to resolve list * and match requests as if they didn't exist in the system. * Rejectfont elements include glob and pattern elements which are * used to match fonts. * * * * * * * * * * * * * Is actually a #Gee.HashSet holding family names. * Provides methods to save() / load() configuration files. * * elements are unsupported. */ public abstract class Selections : Gee.HashSet { public signal void changed (); /** * Selections:target_file: * * Should be set to a filename in the form [7][0-9]*.conf * * Default value : "70-Selections.conf" */ public string target_file { get; set; default = "70-Selections.conf"; } /** * Selections:config_dir: * * Should be set to one of the directories monitored by Fontconfig * for configuration files. * * Default value : #get_config_dir() */ public string config_dir { get; set; default = get_config_dir(); } /** * Selections:target_element; * * Valid values: or */ public string target_element { get; set; default = ""; } FileMonitor? monitor = null; public override bool add (string key) { debug("Add selection : %s : %s", target_element, key); return base.add(key); } public override bool remove (string key) { debug("Remove selection : %s : %s", target_element, key); return base.remove(key); } public string get_filepath () { return Path.build_filename(config_dir, target_file); } public virtual bool save () { var writer = new XmlWriter(get_filepath()); write_node(writer); return (writer.close() >= 0); } public virtual bool load () { clear(); if (monitor != null) monitor = null; string path = get_filepath(); File file = File.new_for_path(path); if (!file.query_exists()) return false; Xml.Parser.init(); verbose("Xml.Parser : Opening : %s", path); Xml.Doc * doc = Xml.Parser.parse_file(path); if (doc == null) { /* File not found */ Xml.Parser.cleanup(); return false; } Xml.Node * root = doc->get_root_element(); if (root == null) { /* Empty doc */ delete doc; Xml.Parser.cleanup(); return false; } parse(root); verbose("Xml.Parser : Closing : %s", path); delete doc; Xml.Parser.cleanup(); verbose("Adding file monitor for : %s", path); try { monitor = file.monitor_file(FileMonitorFlags.NONE); monitor.changed.connect((f, of, ev) => { debug("Filesystem change detected : %s", path); monitor.cancel(); Idle.add(() => { this.changed(); return false; }); }); } catch (IOError e) { warning("Failed to create FileMonitor for %s", path); critical("FileMonitor creation failed : %s", e.message); } return true; } protected virtual void parse (Xml.Node * root) { for (Xml.Node * iter = root->children; iter != null; iter = iter->next) { /* Spaces between tags are also nodes, discard them */ if (iter->type != Xml.ElementType.ELEMENT_NODE) continue; if (iter->name == "selectfont") for (Xml.Node * node = iter->children; node != null; node = node->next) if (node->name == target_element) parse_node(node->children); } } void write_patelt (XmlWriter writer, string name, string element_type, string val) { writer.start_element("pattern"); writer.start_element("patelt"); writer.write_attribute("name", name); writer.write_element(element_type, val); writer.end_element(); writer.end_element(); return; } protected virtual void write_node (XmlWriter writer) { writer.start_element("selectfont"); writer.start_element(target_element); foreach (string font in this) write_patelt(writer, "family", "string", font.strip()); writer.end_element(); writer.end_element(); return; } protected virtual void parse_node (Xml.Node * node) { for (Xml.Node * iter = node; iter != null; iter = iter->next) { /* Spaces between tags are also nodes, discard them */ if (iter->type != Xml.ElementType.ELEMENT_NODE) continue; string content = iter->get_content().strip(); if (content == "") continue; else this.add(content); } return; } } } master-0.7.3/lib/FontConfig/Sources.vala.in000066400000000000000000000215501300074171200205110ustar00rootroot00000000000000/* Sources.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /** * Source - Represents a font directory * * @active true if source is enabled for other applications * @name suitable for display * @path full path to directory * @available whether source actually exists * icon_name icon name representing source state * * Their purpose is to allow an application to track font directories * configured by the user, so that their contents can be previewed in * the application even when disabled for others. * * Sources are disabled by default. */ public class Source : Object { public new string name { get; private set; } public new bool active { get; set; default = false; } public string? path { get; private set; default = null; } File? _file = null; public File? file { get { return _file; } set { _file = value; update(); } } public bool available { get { if (file == null) return false; return file.query_exists(); } } public string icon_name { get { if (available) return "folder-symbolic"; else return "action-unavailable-symbolic"; } } public Source (File? f = null) { Object(file: f); } /** * Returns the path to source parent directory or "Source Unavailable" */ public string get_dirname () { return path != null ? Path.get_dirname(path) : _("Source Unavailable"); } public void update () { name = "FontConfigSource"; path = null; active = false; if (file == null) return; path = file.get_path(); try { FileInfo info = file.query_info(FileAttribute.STANDARD_DISPLAY_NAME, FileQueryInfoFlags.NONE); name = Markup.escape_text(info.get_display_name()); } catch (Error e) { name = _("Source Unavailable"); } return; } } /** * Sources - Represents an application specific configuration file * * @config_dir directory to store configuration file * @target_file filename * * elements contain the full path to a directory containing * font files which should be available for preview within the application * and easily enabled for others. * * Is actually a #Gee.HashSet holding directory paths. * Provides methods to save() / load() configuration files. * * @seealso load_user_font_sources () */ public class Sources : Gee.HashSet { public signal void changed (File? file, FileMonitorEvent? event); public signal void removed (string path); public string config_dir { get; set; default = get_package_config_dir(); } public string target_file { get; set; default = "Sources.xml"; } public string target_element { get; set; default = "source"; } /** * Sources:active: * * Internal copy of #Directories, kept in order to update FontConfig * directory configuration whenever a #Source is activated. */ public Directories active { get; private set;} MonitoredFiles monitors; public Sources () { active = new Directories(); monitors = new MonitoredFiles(); monitors.changed.connect((f, of, ev) => { this.update(); this.changed(f, ev); }); } public string get_filepath () { return Path.build_filename(config_dir, target_file); } public new bool contains (string path) { foreach (var source in this) if (source.path.contains(path)) return true; return false; } public void update () { foreach (var source in this) { source.update(); source.active = (source.path in active); } return; } public bool add_from_path (string dirpath) { return add(new Source(File.new_for_path(dirpath))); } public new bool add (Source source) { if (this.contains(source.path)) return true; if (source.path in active) source.active = true; source.notify["active"].connect(() => { source_activated(source); }); monitors.add(source.path); this.changed(source.file, FileMonitorEvent.CREATED); return base.add(source); } public new bool remove (Source source) { if (active.contains(source.path)) { active.remove(source.path); active.save(); } this.removed(source.path); this.changed(source.file, FileMonitorEvent.DELETED); return (monitors.remove(source.path) && base.remove(source)); } void source_activated (Source source) { if (source.active) active.add(source.path); else if (source.path in active) active.remove(source.path); active.save(); return; } void add_sources_from_directories () { foreach (var path in active) add_from_path(path); return; } public bool load () { string target = get_filepath(); { File file = File.new_for_path(target); if (!file.query_exists()) return false; } Xml.Parser.init(); verbose("Xml.Parser : Opening : %s", target); Xml.Doc * doc = Xml.Parser.parse_file(target); if (doc == null) { /* File not found */ Xml.Parser.cleanup(); return false; } Xml.Node * root = doc->get_root_element(); if (root == null) { /* Empty doc */ delete doc; Xml.Parser.cleanup(); return false; } parse_node(root->children); verbose("Xml.Parser : Closing : %s", target); delete doc; Xml.Parser.cleanup(); active.load(); add_sources_from_directories(); return true; } public bool save () { /* XmlWriter not used here because this is application specific */ var writer = new Xml.TextWriter.filename(get_filepath()); writer.set_indent(true); writer.set_indent_string(" "); writer.start_document(); writer.write_string("\n"); writer.write_comment(_(" Generated by Font Manager. Do NOT edit this file. ")); writer.start_element("Sources"); write_node(writer); writer.end_element(); writer.end_document(); return (writer.flush() >= 0); } protected void write_node (Xml.TextWriter writer) { foreach (var source in this) writer.write_element(target_element, Markup.escape_text(source.path.strip())); return; } protected void parse_node (Xml.Node * node) { for (Xml.Node * iter = node; iter != null; iter = iter->next) { /* Spaces between tags are also nodes, discard them */ if (iter->type != Xml.ElementType.ELEMENT_NODE) continue; string content = iter->get_content().strip(); if (content == "") continue; debug("Loading source : %s", content); add_from_path(content); } return; } } } master-0.7.3/lib/FontConfig/XmlWriter.vala000077500000000000000000000033151300074171200204200ustar00rootroot00000000000000/* XmlWriter.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /** * Convenience wrapper for Xml.TextWriter * Sets default options, document type string and comment. */ public class XmlWriter : Xml.TextWriter { public XmlWriter (string filepath) { base.filename(filepath); set_indent(true); set_indent_string(" "); start_document(); write_string("\n"); write_comment(_(" Generated by Font Manager. Do NOT edit this file. ")); start_element("fontconfig"); } ~ XmlWriter () { this.close(); } /** * Returns the bytes written (may be 0 because of buffering) * or -1 in case of error */ public int close () { end_element(); end_document(); return flush(); } } } master-0.7.3/lib/FontConfig/_Common_.c000066400000000000000000000146631300074171200175150ustar00rootroot00000000000000/* _Common_.c * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ #include #include #include #include #include static void g_free0(gpointer p) { g_free(p); g_nullify_pointer(&p); } static int get_file_owner (const gchar * filepath) { int owner; GFile *fhandle = g_file_new_for_path(filepath); GFileInfo * finfo = g_file_query_info(fhandle, G_FILE_ATTRIBUTE_OWNER_USER, G_FILE_QUERY_INFO_NONE, NULL, NULL); if (finfo == NULL) { owner = g_access(filepath, W_OK); } else { owner = g_strcmp0(g_file_info_get_attribute_string(finfo, G_FILE_ATTRIBUTE_OWNER_USER), g_get_user_name()); g_object_unref(finfo); } g_object_unref(fhandle); return owner; } gboolean FcCacheUpdate (void) { FcConfigDestroy(FcConfigGetCurrent()); return !FcConfigUptoDate(NULL) && FcInitReinitialize(); } GeeArrayList * FcListFamilies(void) { int i; FcPattern * pattern; FcFontSet * fontset; FcObjectSet * objectset = 0; GeeArrayList * famlist = gee_array_list_new(G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free0, NULL, NULL, NULL); g_assert(FcInit()); pattern = FcNameParse((FcChar8 *) ":"); objectset = FcObjectSetBuild (FC_FAMILY, NULL); fontset = FcFontList(NULL, pattern, objectset); for (i = 0; i < fontset->nfont; i++) { FcChar8 * family; if (FcPatternGetString(fontset->fonts[i], FC_FAMILY, 0, &family) == FcResultMatch) { if (gee_abstract_collection_contains((GeeAbstractCollection *) famlist, family)) continue; else gee_abstract_collection_add((GeeAbstractCollection *) famlist, family); } } if (objectset) FcObjectSetDestroy(objectset); if (pattern) FcPatternDestroy(pattern); if (fontset) FcFontSetDestroy(fontset); return famlist; } GeeArrayList * FcListFiles(void) { int i; FcPattern * pattern; FcFontSet * fontset; FcObjectSet * objectset = 0; GeeArrayList * filelist = gee_array_list_new(G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free0, NULL, NULL, NULL); g_assert(FcInit()); pattern = FcNameParse((FcChar8 *) ":"); objectset = FcObjectSetBuild (FC_FILE, NULL); fontset = FcFontList(NULL, pattern, objectset); for (i = 0; i < fontset->nfont; i++) { FcChar8 * file; if (FcPatternGetString(fontset->fonts[i], FC_FILE, 0, &file) == FcResultMatch) gee_abstract_collection_add((GeeAbstractCollection *) filelist, file); } if (objectset) FcObjectSetDestroy(objectset); if (pattern) FcPatternDestroy(pattern); if (fontset) FcFontSetDestroy(fontset); return filelist; } GeeArrayList * FcListDirs(gboolean recursive) { FcChar8 * directory; FcStrList * fdlist; GeeArrayList * dirlist = gee_array_list_new(G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free0, NULL, NULL, NULL); g_assert(FcInit()); if (recursive) fdlist = FcConfigGetFontDirs(NULL); else fdlist = FcConfigGetConfigDirs(NULL); while ((directory = FcStrListNext(fdlist))) gee_abstract_collection_add((GeeAbstractCollection *) dirlist, directory); FcStrListDone(fdlist); return dirlist; } GeeArrayList * FcListUserDirs(void) { FcChar8 * directory; FcStrList * fdlist; GeeArrayList * dirlist = gee_array_list_new(G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free0, NULL, NULL, NULL); g_assert(FcInit()); fdlist = FcConfigGetConfigDirs(NULL); while ((directory = FcStrListNext(fdlist))) if (get_file_owner((const gchar *) directory) == 0) gee_abstract_collection_add((GeeAbstractCollection *) dirlist, directory); FcStrListDone(fdlist); return dirlist; } gboolean FcEnableUserConfig(gboolean enable) { g_assert(FcInit()); gboolean result = FcConfigEnableHome(enable); return result; } gboolean FcAddAppFont(const gchar * filepath) { g_assert(FcInit()); gboolean result = FcConfigAppFontAddFile(NULL, (FcChar8 *) filepath); return result; } gboolean FcAddAppFontDir(const gchar * dir) { g_assert(FcInit()); gboolean result = FcConfigAppFontAddDir(NULL, (FcChar8 *) dir); return result; } void FcClearAppFonts(void) { g_assert(FcInit()); FcConfigAppFontClear(NULL); return; } gboolean FcLoadConfig(const gchar * filepath) { g_assert(FcInit()); gboolean result = FcConfigParseAndLoad(FcConfigGetCurrent(), (FcChar8 *) filepath, FALSE); return result; } master-0.7.3/lib/Glue/000077500000000000000000000000001300074171200144515ustar00rootroot00000000000000master-0.7.3/lib/Glue/Glue.vala000077500000000000000000000033501300074171200162160ustar00rootroot00000000000000/* Glue.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FreeType { public int num_faces (string filepath) { return (int) get_face_count(filepath); } public int query_file_info (FontManager.FontInfo fileinfo, string filepath, int index = 0) { return (int) get_file_info(fileinfo, filepath, index); } } namespace FontConfig { public Font? get_font_from_file (string filepath, int index = 0) { /* Ensure absolute path */ return FcGetFontFromFile(File.new_for_path(filepath).get_path(), index); } public Gee.ArrayList list_fonts (string? family_name = null) { return FcListFonts(family_name); } } /* Defined in _Glue_.c */ extern long get_face_count (string filepath); extern int get_file_info (FontManager.FontInfo * fileinfo, string filepath, int index); extern FontConfig.Font? FcGetFontFromFile (string filepath, int index); extern Gee.ArrayList FcListFonts (string? family_name); master-0.7.3/lib/Glue/License.c000066400000000000000000000031551300074171200162030ustar00rootroot00000000000000/* License.c * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ #include #include #include "License.h" gint get_license_type(const gchar * license, const gchar * copyright, const gchar * url) { gint i; for (i = 0; i < LICENSE_ENTRIES; i++) { gint l = 0; while (LicenseData[i].keywords[l]) { if ((copyright && g_strrstr(copyright, LicenseData[i].keywords[l])) || (license && g_strrstr(license, LicenseData[i].keywords[l])) || (url && g_strrstr(url, LicenseData[i].keywords[l]))) return i; l++; } } return LICENSE_ENTRIES - 1; } gchar * get_license_name (gint license_type) { return g_strdup(LicenseData[license_type].license); } gchar * get_license_url (gint license_type) { return g_strdup(LicenseData[license_type].license_url); } master-0.7.3/lib/Glue/License.h000066400000000000000000000157501300074171200162140ustar00rootroot00000000000000/* * * Do not edit directly. See build-aux directory * * * Open source license information courtesy of * * // * // The Fontaine Font Analysis Project * // * // Copyright (c) 2009 by Edward H. Trager * // All Rights Reserved * // * // Released under the GNU GPL version 2.0 or later. * // * * See http://www.unifont.org/fontaine/ for more information. * * Special thanks to Edward H. Trager, and of course everyone * involved with the Open Font Library for all their efforts. :-) * * http://www.openfontlibrary.org/ * */ G_BEGIN_DECLS #define MAX_KEYWORD_ENTRIES 25 static const struct { const gchar *license; const gchar *license_url; const gchar *keywords[MAX_KEYWORD_ENTRIES]; } LicenseData[] = { { "Aladdin Free Public License", "http://pages.cs.wisc.edu/~ghost/doc/AFPL/6.01/Public.htm", { "Aladdin", NULL } }, { "Apache 2.0", "http://www.apache.org/licenses/LICENSE-2.0", { "Apache", "Apache License", "Apache 2 License", NULL } }, { "Arphic Public License", "http://ftp.gnu.org/gnu/non-gnu/chinese-fonts-truetype/LICENSE", { "ARPHIC PUBLIC LICENSE", "Arphic Public License", "文鼎公眾授權書", "Arphic", NULL } }, { "Bitstream Vera License", "http://www-old.gnome.org/fonts/#Final_Bitstream_Vera_Fonts", { "Bitstream", "Vera", "DejaVu", NULL } }, { "CC-BY-SA", "http://creativecommons.org/licenses/by-sa/3.0/", { "Creative Commons Attribution ShareAlike", "Creative-Commons-Attribution-ShareAlike", "Creative Commons Attribution Share Alike", "Creative-Commons-Attribution-Share-Alike", "Creative Commons BY SA", "Creative-Commons-BY-SA", "CC BY SA", "CC-BY-SA", NULL } }, { "CC-BY", "http://creativecommons.org/licenses/by/3.0/", { "Creative Commons Attribution", "Creative-Commons-Attribution", "CC BY", "CC-BY", NULL } }, { "CC-0", "http://creativecommons.org/publicdomain/zero/1.0/", { "Creative Commons Zero", "Creative-Commons-Zero", "Creative Commons 0", "Creative-Commons-0", "CC Zero", "CC-Zero", "CC 0", "CC-0", NULL } }, { "Freeware", "http://en.wikipedia.org/wiki/Freeware", { "freeware", "free ware", NULL } }, { "GPL with font exception", "http://www.gnu.org/copyleft/gpl.html", { "LiberationFontLicense", "with font exception", "Liberation font software", "LIBERATION is a trademark of Red Hat", "this font does not by itself cause the resulting document to be covered by the GNU", NULL } }, { "GNU General Public License", "http://www.gnu.org/copyleft/gpl.html", { "GPL", "GNU Public License", "GNU GENERAL PUBLIC LICENSE", "GNU General Public License", "General Public License", "GNU copyleft", "GNU", "www.gnu.org", "Licencia Pública General de GNU", "free as in free-speech", "free as in free speech", "languagegeek.com", NULL } }, { "GNU Lesser General Public License", "http://www.gnu.org/licenses/lgpl.html", { "LGPL", "GNU Lesser General Public License", "Lesser General Public License", NULL } }, { "GUST Font License", "http://tug.org/fonts/licenses/GUST-FONT-LICENSE.txt", { "GUST", NULL } }, { "IPA", "http://opensource.org/licenses/ipafont.html", { "IPA License", "Information-technology Promotion Agency", "(IPA)", " IPA ", NULL } }, { "M+ Fonts Project License", "http://mplus-fonts.sourceforge.jp/webfonts/#license", { "M+ FONTS PROJECT", NULL } }, { "MIT License", "http://www.opensource.org/licenses/mit-license.php", { "M.I.T.", "Software without restriction,", NULL } }, { "Magenta Open License", "http://www.ellak.gr/pub/fonts/mgopen/index.en.html#license", { "MgOpen", NULL } }, { "Monotype Imaging EULA", "http://www.fonts.com/info/legal/eula/monotype-imaging", { "valuable asset of Monotype", "Monotype Typography", "www.monotype.com", NULL } }, { "SIL Open Font License", "http://scripts.sil.org/OFL", { "OFL", "Open Font License", "scripts.sil.org/OFL", "openfont", "open font", "NHN Corporation", "American Mathematical Society", "http://www.ams.org", NULL } }, { "Public Domain (not a license)", "http://en.wikipedia.org/wiki/Public_domain", { "public domain", "Public Domain", NULL } }, { "STIX Font License", "http://www.aip.org/stixfonts/user_license.html", { "2007 by the STI Pub Companies", "the derivative work will carry a different name", NULL } }, { "Ubuntu Font License 1.0", "http://font.ubuntu.com/ufl/ubuntu-font-licence-1.0.txt", { "Ubuntu Font Licence 1.0", "UBUNTU FONT LICENCE Version 1.0", NULL } }, { "License to TeX Users Group for the Utopia Typeface", "http://tug.org/fonts/utopia/LICENSE-utopia.txt", { "The Utopia fonts are freely available; see http://tug.org/fonts/utopia", NULL } }, { "XFree86 License", "http://www.xfree86.org/legal/licenses.html", { "XFree86", "X Consortium", NULL } }, { "Unknown License", NULL, { NULL } }, }; #define LICENSE_ENTRIES G_N_ELEMENTS(LicenseData) gint get_license_type(const gchar *license, const gchar *copyright, const gchar * url); gchar * get_license_name (gint license_type); gchar * get_license_url (gint license_type); G_END_DECLS master-0.7.3/lib/Glue/Makefile.am000066400000000000000000000005621300074171200165100ustar00rootroot00000000000000 GLUE_DEPS = \ $(abs_top_srcdir)/lib/FontConfig/Font.vala \ $(abs_top_srcdir)/lib/FontConfig/Enums.vala \ $(abs_top_srcdir)/lib/Common/Cacheable.vala \ $(abs_top_srcdir)/lib/Common/FontInfo.vala _Glue_.h: ${VALAC} \ --pkg=pango \ --pkg=gee-0.8 \ --pkg=json-glib-1.0 \ $(GLUE_DEPS) \ Glue.vala \ -C -H $@ all: _Glue_.h MAINTAINERCLEANFILES = \ Makefile.in master-0.7.3/lib/Glue/Vendor.c000066400000000000000000000035611300074171200160570ustar00rootroot00000000000000/* Vendor.c * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ #include #include #include "Vendor.h" static gboolean vendor_matches(const gchar vendor[MAX_VENDOR_ID_LENGTH], const gchar * vendor_id) { gboolean result; GString * a, * b; /* vendor is not necessarily NUL-terminated. */ a = g_string_new_len((const gchar *) vendor, MAX_VENDOR_ID_LENGTH); b = g_string_new_len((const gchar *) vendor_id, MAX_VENDOR_ID_LENGTH); result = g_string_equal(a, b); g_string_free(a, TRUE); g_string_free(b, TRUE); return result; } gchar * get_vendor_from_notice(const gchar * notice) { gint i; if (notice) for(i = 0; i < NOTICE_ENTRIES; i++) if (g_strrstr(notice, NoticeData[i].vendor_id)) return g_strdup(NoticeData[i].vendor); return NULL; } gchar * get_vendor_from_vendor_id(const gchar vendor[MAX_VENDOR_ID_LENGTH]) { gint i; if (vendor) for(i = 0; i < VENDOR_ENTRIES; i++) if (vendor_matches(vendor, VendorData[i].vendor_id)) return g_strdup(VendorData[i].vendor); return NULL; } master-0.7.3/lib/Glue/Vendor.h000066400000000000000000000467771300074171200161040ustar00rootroot00000000000000/* * * Do not edit directly. See build-aux directory * */ G_BEGIN_DECLS #define MAX_VENDOR_ID_LENGTH 5 #define MAX_VENDOR_LENGTH 100 static const struct { const gchar vendor_id[MAX_VENDOR_LENGTH]; const gchar vendor[MAX_VENDOR_LENGTH]; } /* Order is significant. */ NoticeData [] = { /* Notice data sourced from fcfreetype.c - http://www.freetype.org/ */ {"Bigelow", "Bigelow & Holmes"}, {"Adobe", "Adobe"}, {"Bitstream", "Bitstream"}, {"Monotype", "Monotype Imaging"}, {"Linotype", "Linotype GmbH"}, {"LINOTYPE-HELL", "Linotype GmbH"}, {"IBM", "IBM"}, {"URW", "URW"}, {"International Typeface Corporation", "ITC"}, {"Tiro Typeworks", "Tiro Typeworks"}, {"XFree86", "XFree86"}, {"Microsoft", "Microsoft Corporation"}, {"Omega", "Omega"}, {"Font21", "Hwan"}, {"HanYang System", "HanYang Information & Communication"} }; static const struct { const gchar vendor_id[MAX_VENDOR_ID_LENGTH]; const gchar vendor[MAX_VENDOR_LENGTH]; } VendorData[] = { /* Various Sources */ {"ACG", "Monotype Imaging"}, {"B?", "Bigelow & Holmes"}, {"FJ", "Fujitsu"}, {"RICO", "Ricoh"}, /* Courtesy of Microsoft Typography - http://www.microsoft.com/typography/links/vendorlist.aspx */ {"!ETF", "!Exclamachine Type Foundry"}, {"$pro", "CheapProFonts"}, {"1ASC", "Ascender Corporation"}, {"1BOU", "Boutros International"}, {"1KTF", "Kief Type Foundry"}, {"2DLT", "2D Typo"}, {"2REB", "2Rebels"}, {"39BC", "Finley's Barcode Fonts"}, {"3ip", "Three Islands Press"}, {"4FEB", "4th february"}, {"5PTS", "Five Points Technology"}, {"918", "RavenType"}, {"A&S;", "Art&Sign; Studio"}, {"A2", "A2-Type"}, {"aaff", "AstroAcademia Font Foundry"}, {"ABBO", "Arabic Dictionary Lab"}, {"ABC", "Altek Instruments"}, {"ABOU", "Aboutype, Inc."}, {"ACUT", "Acute Type"}, {"ADBE", "Adobe"}, {"ADBO", "Adobe"}, {"ADG", "Apply Design Group"}, {"AE", "AE Type"}, {"AEF", "Altered Ego Fonts"}, {"AGFA", "Monotype Imaging (replaced by MONO)"}, {"AID", "Artistic Imposter Design"}, {"AJPT", "Alan Jay Prescott Typography"}, {"AKOF", "AKOFAType"}, {"ALFA", "Alphabets"}, {"ALPH", "Alphameric Broadcast Solutions Limited"}, {"ALPN", "Alpona Portal"}, {"ALS", "Art. Lebedev Studio"}, {"alte", "Altemus"}, {"ALTS", "Altsys / Made with Fontographer"}, {"AMUT", "Kwesi Amuti"}, {"ANDO", "Osam Ando"}, {"anty", "Anatoletype"}, {"AOP", "an Art Of Pengwyn"}, {"APLY", "Apply Interactive"}, {"APOS", "Apostrophic Laboratories"}, {"APPL", "Apple"}, {"ARBX", "Arabetics"}, {"ARCH", "Architext"}, {"ARIN", "Aring Typeface AB"}, {"ARPH", "Arphic Technology Co."}, {"ARS", "EN ARS Ltd."}, {"ArTy", "Archive Type"}, {"ASL", "Abneil Software Ltd fonts"}, {"ASSA", "astype"}, {"ASYM", "Applied Symbols"}, {"ATEC", "Page Technology Marketing, Inc."}, {"ATF", "American Type Founders Collection"}, {"ATF1", "Australian Type Foundry"}, {"ATFS", "Andrew Tyler's fonts"}, {"AURE", "Aure Font Design"}, {"AUTO", "Autodidakt"}, {"AVFF", "Agustín Varela Font Factory"}, {"AVP", "Aviation Partners"}, {"AZLS", "Azalea Software, Inc."}, {"B&H;", "Bigelow & Holmes"}, {"BARS", "CIA (BAR CODES) UK"}, {"BASE", "Baseline Fonts"}, {"BAT", "BUREAU DES AFFAIRES TYPOGRAPHIQUES"}, {"BCP", "Expert Labels Ltd."}, {"BDX", "Studio Christian Bordeaux"}, {"BERT", "Berthold"}, {"BITM", "Bitmap Software"}, {"BITS", "Bitstream"}, {"bizf", "Bizfonts.com"}, {"BL", "Binnenland"}, {"BLAB", "BaseLab"}, {"BLAH", "Mister Bla's Fontworx"}, {"BLCK", "Black Foundry"}, {"BLI", "Blissym Language Institute"}, {"BLV", "Bladvulling"}, {"BOLD", "Bold Monday"}, {"BORW", "em2 Solutions"}, {"BOYB", "BoyBeaver Fonts"}, {"BRDV", "BoardVantage, Inc."}, {"BREM", "Mark Bremmer"}, {"BROS", "Michael Brosnan"}, {"BRTC", "ITSCO - Bar Code Fonts"}, {"BS", "Barcodesoft"}, {"BSYV", "Ben Syverson"}, {"BUBU", "BUBULogix"}, {"BWFW", "B/W Fontworks"}, {"C&B;", "Coppers & Brasses"}, {"C&C;", "Carter & Cone"}, {"C&G;", "C&G; Inc."}, {"C21", "Club 21"}, {"CAK", "pluginfonts.com"}, {"CAM", "Camelot Typefaces"}, {"CANO", "Canon"}, {"CASL", "H.W. Caslon & Company Ltd."}, {"CATG", "CAT-Fonts Germany"}, {"CB", "Christian Büning"}, {"CBDO", "Borges Lettering & Design"}, {"CDAC", "Centre for Development of Advanced Computing"}, {"cdd", "Crazy Diamond Design"}, {"CDFP", "VT2000 Technical Services"}, {"CELB", "Celebrity Fontz"}, {"CF", "Colophon Foundry"}, {"CFA", "Computer Fonts Australia"}, {"CFF", "Characters Font Foundry"}, {"CJCJ", "Creative Juncture"}, {"CKTP", "CakeType"}, {"CLM", "Culmus Project"}, {"CMJK", "Slanted Hall"}, {"COMM", "Commercial Type"}, {"CONR", "Connare.com"}, {"COOL", "Cool Fonts"}, {"CORD", "corduroy"}, {"CR8", "CR8 Software Solutions"}, {"CRRT", "Carrot Type"}, {"CT", "CastleType"}, {"CTDL", "China Type Designs Ltd."}, {"CTL", "Chaitanya Type Library"}, {"cwwf", "Computers World Wide/AC Capital Funding"}, {"CYPE", "Club Type"}, {"CYRE", "Cyreal"}, {"DADA", "Dada Studio"}, {"DAMA", "Dalton Maag Limited"}, {"DB", "Daniel Bruce"}, {"DBFF", "DesignBase"}, {"DD", "Devon DeLapp"}, {"Deco", "DecoType (replaced by DT)"}, {"DELV", "Delve Fonts"}, {"dezc", "Dezcom"}, {"DFS", "Datascan Font Service Ltd"}, {"DGL", "Digital Graphic Labs foundry"}, {"DOM", "Dukom Design"}, {"DS", "Dainippon Screen Mfg. Co., Inc."}, {"DSBV", "Datascan bv"}, {"DSCI", "Design Science Inc."}, {"DSGN", "DizajnDesign"}, {"DSKY", "Jacek Dziubinski"}, {"DSSR", "Dresser Johnson"}, {"DSST", "Dubina Nikolay"}, {"DST", "DSType"}, {"DSTE", "Dieste"}, {"DT", "DecoType"}, {"DTC", "Digital Typeface Corp."}, {"DTF", "Dunwich Type Founders"}, {"DTL", "Dutch Type Library"}, {"DTPS", "DTP-Software"}, {"dtpT", "dtpTypes Limited"}, {"DUXB", "Duxbury Systems, Inc."}, {"DYNA", "DynaComware"}, {"ECAL", "ECAL Typefaces"}, {"EDBI", "edilbiStudio"}, {"EDGE", "Rivers Edge Corp."}, {"EF", "Elsner+Flake"}, {"EFF", "Electronic Font Foundry"}, {"EFI", "Elfring Fonts Inc."}, {"EFNT", "E Fonts L.L.C."}, {"EFWS", "eFilm World"}, {"EKIO", "Ekioh"}, {"ELSE", "Elseware"}, {"EMGR", "Emigre"}, {"EPSN", "Epson"}, {"ESIG", "E-Signature"}, {"ETIO", "Ethiopian Font Foundry"}, {"EVER", "Evertype"}, {"FA", "FontArte Type Foundry"}, {"FAFO", "FamiraFonts"}, {"FAPA", "FamiljenPangea"}, {"FAT", "Fatype"}, {"FBI", "The Font Bureau, Inc."}, {"FCAB", "The Font Cabinet"}, {"FCAN", "fontage canada"}, {"FCTP", "Facetype"}, {"FDI", "FDI fonts.info"}, {"FEED", "Studio Feed Inc."}, {"FeoN", "Feòrag NìcBhrìde"}, {"FGOD", "FontGod"}, {"FJTY", "Frank Jonen - Illustration & Typography"}, {"FMFO", "Fontmill Foundry"}, {"FMST", "Formist"}, {"FNTF", "Fontfoundry"}, {"FoFa", "FontFabrik"}, {"FONT", "Font Source"}, {"FORM", "Formation Type Foundry"}, {"FOUN", "The Foundry"}, {"FP", "The Fontpad"}, {"FRJN", "Frere-Jones Type"}, {"FRML", "formlos"}, {"FRTH", "Forthcome"}, {"FS", "Formula Solutions"}, {"FSE", "Font Source Europe"}, {"FSI", "FontShop International"}, {"FSL", "FontSurfer Ltd"}, {"fsmi", "Fontsmith"}, {"FTF", "Fontef"}, {"FTFT", "FontFont"}, {"FTGD", "Font Garden"}, {"FTH", "For the Hearts"}, {"FTN", "Fountain"}, {"FTPT", "Fontpartners"}, {"FWKS", "Fontworks"}, {"FWRE", "Fontware Limited"}, {"FY", "Fontyou"}, {"GAF", "Glifo Art Fonts Inc."}, {"GALA", "Galápagos Design Group, Inc."}, {"GALO", "Gerald Gallo"}, {"GARI", "Gary Ritchie"}, {"GATF", "Greater Albion Typefounders"}, {"GD", "GD Fonts"}, {"GF", "GarageFonts"}, {"GIA", "Georgian Internet Avenue"}, {"GLCF", "GLC foundry"}, {"GLYF", "Glyph Systems"}, {"GNU", "Free Software Foundation, Inc."}, {"GOAT", "Dingbat Dungeon"}, {"GOGO", "Fonts-A-Go-Go"}, {"GOHE", "GoHebrew, division of GoME2.com Inc."}, {"GOOG", "Google"}, {"GPI", "Gamma Productions, Inc."}, {"GRAF", "Grafikarna d.o.o."}, {"GRCR", "Graphicore"}, {"GREY", "Greyletter"}, {"GRIL", "Grilled cheese"}, {"GRIM", "Legacy publishing"}, {"grro", "grafikk RØren"}, {"GT", "Graphity!"}, {"GTYP", "G-Type"}, {"H", "Hurme Design"}, {"H&FJ;", "Hoefler & Frere-Jones"}, {"HA", "HoboArt"}, {"HAD", "Hoffmann Angelic Design"}, {"HAIL", "Hail Design"}, {"HanS", "HanStyle"}, {"HAUS", "TypeHaus"}, {"HEB", "Sivan Toledo"}, {"HFJ", "Hoefler & Frere-Jones (replaced by H&FJ;)"}, {"HIH", "HiH Retrofonts"}, {"HILL", "Hill Systems"}, {"HJZ", "Hans J. Zinken"}, {"HL", "High-Logic"}, {"HM", "Haiku Monkey"}, {"HoP", "House of Pretty"}, {"HOUS", "House Industries"}, {"HP", "Hewlett-Packard"}, {"HS", "HermesSOFT Company"}, {"HT", "Huerta Tipográfica"}, {"HTF", "The Hoefler Type Foundry, Inc."}, {"HVD", "HVD Fonts GmbH"}, {"HXTP", "Hexatype"}, {"HY", "HanYang Information & Communication"}, {"IBM", "IBM"}, {"IDAU", "IDAutomation.com, Inc."}, {"IDEA", "Glenn Campbell t/a Idea Studio"}, {"IDEE", "IDEE TYPOGRAFICA"}, {"IDF", "International Digital Fonts"}, {"IFF", "Indian Font Factory"}, {"IKOF", "IKOffice GmbH"}, {"ILP", "Indigenous Languages Project"}, {"IMPR", "Impress"}, {"INGT", "Ingrimayne Type"}, {"INRA", "INRAY Inc."}, {"INTR", "Interstitial Entertainment"}, {"INVC", "Invoice Central"}, {"INVD", "TYPE INVADERS"}, {"ISE", "ISE-Aditi Info. Pvt . Ltd."}, {"ITC", "ITC"}, {"ITF", "Red Rooster Collection (ITF, Inc.)"}, {"ITFO", "Indian Type Foundry"}, {"ITSM", "Simon Stratford"}, {"JABM", "JAB'M Foundry"}, {"JAF", "Just Another Foundry"}, {"JAKE", "Jake Tilson Studio"}, {"JBLT", "JEAN-BAPTISTE LEVÉE TYPOGRAPHY"}, {"JDB", "Jeff Bensch"}, {"jeff", "jeff-levine"}, {"JF", "Jan Fromm"}, {"JHA", "Jan Henrik Arnold"}, {"JHF", "JH Fonts"}, {"JP", "Jamra Patel"}, {"JPTT", "Jeremy Tankard Typography Ltd"}, {"JWTM", "Type Matters"}, {"JY", "JIYUKOBO Ltd."}, {"KATF", "Kingsley/ATF"}, {"KBNT", "Kombinat-Typefounders"}, {"KDW", "Kinuta Font Factory"}, {"KF", "Karakta Fonthome"}, {"KLIM", "Klim Typographic Design"}, {"KLTF", "Karsten Luecke"}, {"KNST", "Konst.ru"}, {"KNTR", "Kontour"}, {"KOP", "Leo Koppelkamm"}, {"KORK", "Khork OÜ"}, {"KOVL", "Koval Type Foundry"}, {"KrKo", "Kreative Software"}, {"KRND", "Karandash Type & Graphics Foundry"}, {"KTF", "Kustomtype"}, {"KUBA", "Kuba Tatarkiewicz"}, {"LAIT", "la laiterie"}, {"LANS", "Lanston Type Company"}, {"LARA", "Larabiefonts"}, {"LAUD", "Carolina Laudon"}, {"LAYT", "LAYOUT SARL"}, {"LEAF", "Interleaf, Inc."}, {"LETR", "Letraset"}, {"lewd", "Lettering World LLC"}, {"LFS", "Letters from Sweden"}, {"LGX", "Logix Research Institute, Inc."}, {"LHF", "Letterhead Fonts"}, {"LIND", "Lindenberg Software LLC"}, {"LING", "Linguist's Software"}, {"LINO", "Linotype GmbH"}, {"LIVE", "Livedesign"}, {"LNGU", "LangusteFonts"}, {"LNTO", "Lineto"}, {"LORO", "LoRo Productions"}, {"LP", "LetterPerfect Fonts"}, {"LT", "Le Typophage"}, {"LTF", "Liberty Type Foundry"}, {"Ltrm", "Lettermin type and design"}, {"LTRX", "Lighttracks"}, {"LTTR", "LettError"}, {"LUD", "Ludlow"}, {"LuFo", "LucasFonts"}, {"LUSH", "Lush Type"}, {"LUV", "iLUVfonts"}, {"MACR", "Macromedia / Made with Fontographer"}, {"MADT", "MADType"}, {"MagD", "Magus Digital"}, {"MANS", "Aring Typeface AB"}, {"MAPS", "Tom Mouat's Map Symbol Fonts"}, {"MATE", "TypeMates"}, {"MATS", "Match Fonts"}, {"MC", "Cerajewski Computer Consulting"}, {"MCHL", "Michal Sahar"}, {"MCKL", "MCKL"}, {"MCOW", "Mountaincow"}, {"MDSN", "Moraitis Design"}, {"MEH", "Steve Mehallo"}, {"MEIR", "Meir Sadan"}, {"MESA", "FontMesa,"}, {"MF", "Magic Fonts"}, {"MFNT", "Masterfont"}, {"MG", "Milieu Grotesque"}, {"MGD", "Matt Grey Design"}, {"MILL", "Millan"}, {"MJ", "Majus Corporation"}, {"MJR", "Majur Inc."}, {"MLBU", "Malibu Dream Designs, LLC"}, {"MLGC", "Micrologic Software"}, {"mlss", "Mark Simonson Studio LLC"}, {"MMFT", "Michel M."}, {"MMIK", "Monomonnik"}, {"MNCK", "Mine Creek"}, {"MNKR", "Monokrom Skriftforlag AS"}, {"MODI", "Modular Infotech Private Limited."}, {"MOHT", "Al Mohtaraf Assaudi Ltd"}, {"MOJI", "Mojijuku"}, {"MONB", "Monib"}, {"MONE", "Meta One Limited"}, {"MONO", "Monotype Imaging"}, {"MOON", "Moonlight Type and Technolog"}, {"MOTA", "Mota Italic"}, {"MRSW", "Morisawa & Company, Ltd."}, {"MRV", "Morovia Corporation"}, {"MS", "Microsoft Corp."}, {"MSCH", "Guitar-Injection"}, {"MSCR", "Majus Corporation"}, {"MSE", "MSE-iT"}, {"MT", "Monotype Imaging (replaced by MONO)"}, {"MTF", "Miss Tiina Fonts"}, {"MTY", "Motoya Co. ,LTD."}, {"MUTF", "Murasu Systems Sdn. Bhd"}, {"MVB", "MVB Fonts"}, {"MVTP", "Mauve Type"}, {"MVty", "MV Typo"}, {"MW", "Michael Want"}, {"MYFO", "MyFonts.com"}, {"NB", "No Bodoni Typography"}, {"ncnd", "&cond;"}, {"NDCT", "Neufville Digital Corporatype"}, {"NDTC", "Neufville Digital"}, {"NEC", "NEC Corporation"}, {"NEWL", "Newlyn"}, {"NICK", "Nick's Fonts"}, {"NIS", "NIS Corporation"}, {"NORF", "Norfok Incredible Font Design"}, {"NOVA", "NOVATYPE"}, {"NP", "Nipponia"}, {"ODSR", "Oddsorts"}, {"OHG", "Our House Graphic Design"}, {"OHNO", "OH no Type Company"}, {"OKAY", "Okay Type"}, {"OPTM", "Optimo"}, {"OPTO", "Opto"}, {"ORBI", "Orbit Enterprises, Inc."}, {"ORK1", "Ork1"}, {"OSFC", "Out Of Step Font Company"}, {"OURT", "Ourtype"}, {"P22", "P22 Inc."}, {"PARA", "ParaType Inc."}, {"PDWX", "Parsons Design Workx"}, {"PECI", "Pecita"}, {"PF", "Phil's Fonts, Inc."}, {"PINT", "PintassilgoPrints"}, {"PIXL", "Pixilate"}, {"PKDD", "Philip Kelly Digital Design"}, {"PLAT", "PLATINUM technology"}, {"PRFS", "Production First Software"}, {"PRGR", "Paragraph"}, {"PROD", "Production Type"}, {"PROT", "PROTOTYPO"}, {"PRTF", "Process Type Foundry"}, {"PSIS", "PhotoShopIsland.com"}, {"PSY", "PSY/OPS"}, {"PT", "Playtype APS"}, {"PTF", "Porchez Typofonderie"}, {"PTMI", "Page Technology Marketing, Inc."}, {"PTYP", "preussTYPE"}, {"PYRS", "PYRS Fontlab Ltd. / Made with FontLab"}, {"QMSI", "QMS/Imagen"}, {"QRAT", "Quadrat Communications"}, {"QTYP", "Qtypography"}, {"READ", "ReadyType"}, {"REAL", "Underware"}, {"RES", "Resultat"}, {"RJPS", "Reall Graphics"}, {"RKFN", "R K Fonts"}, {"RL", "Ruben Holthuijsen"}, {"RLTF", "Rebeletter Studios"}, {"RMU", "RMU TypeDesign"}, {"robo", "Buro Petr van Blokland"}, {"ROBU", "SC ROBU DESIGN S.R.L."}, {"ROHH", "ROHH studio"}, {"RRT", "Red Rooster Collection (ITF, Inc.)"}, {"RSJ", "RSJ Software"}, {"RST", "Rosetta"}, {"RUDY", "RudynFluffy"}, {"RYOB", "Ryobi Limited"}, {"SAJA", "Saja Typeworks"}, {"SALT", "Solonka Type Foundry"}, {"SAND", "Sandoll"}, {"SAPL", "Fonderie sans plomb"}, {"SATY", "Samuelstype Design AB"}, {"SAX", "s.a.x. Software gmbh"}, {"SbB", "Sketchbook B"}, {"SBT", "SelfBuild Type Foundry"}, {"SCTO", "Schick Toikka"}, {"SE", "Stéphane Elbaz"}, {"Sean", "The FontSite"}, {"SFS", "Sarumadhu Services Pvt. Ltd."}, {"SFUN", "Software Union"}, {"SG", "Scooter Graphics"}, {"SHAM", "ShamFonts / Shamrock Int."}, {"SHFT", "Shift"}, {"SHOT", "Shotype"}, {"SHRP", "Sharp Type"}, {"SHS", "Shahab Siavash Studio"}, {"SHUB", "The Software Hub"}, {"SIG", "vLetter, Inc"}, {"SIL", "SIL International (SIL)"}, {"SIT", "Summit Information Technologies Pvt.Ltd,"}, {"SKP", "Essqué Productions"}, {"skz", "Celtic Lady's Fonts"}, {"SL", "Silesian Letters"}, {"Slab", "Schriftlabor"}, {"SMC", "Swathanthra Malayalam Computing"}, {"SN", "SourceNet"}, {"SOHO", "Soft Horizons"}, {"SOS", "Standing Ovations Software"}, {"SPRT", "Sports Fonts"}, {"STC", "Sorkin Type Co"}, {"STF", "Brian Sooy & Co + Sooy Type Foundry"}, {"Stor", "Storm Type Foundry"}, {"STYP", "Stone Type Foundry"}, {"SUNW", "sunwalk fontworks"}, {"SVTD", "Synthview"}, {"SWFT", "Swfte International"}, {"SWTY", "Swiss Typefaces"}, {"SXRA", "Page42 Type Foundry"}, {"SYDA", "Shree Muktananda Ashram"}, {"SYN", "SynFonts"}, {"SYRC", "Syriac Computing Institute"}, {"TBFF", "TrueBlue Font Foundry"}, {"TC", "Typeco"}, {"TCH", "Darryl Cook"}, {"TD", "Typedepot"}, {"TDR", "Tansin A. Darcos & Co."}, {"TERM", "Terminal Design, Inc."}, {"TF", "Treacyfaces / Headliners"}, {"TF3D", "TattooFont3D"}, {"TFAC", "Typefactory"}, {"TFND", "Typefounding"}, {"THIN", "Thinstroke Design LLC"}, {"TILD", "Tilde, SIA"}, {"TIMO", "Tim Romano"}, {"TIMR", "Tim Rolands"}, {"TIPO", "Tipo"}, {"TIRO", "Tiro Typeworks"}, {"TJS", "Typejockeys"}, {"TL", "Typeland"}, {"TLIN", "Teeline Fonts"}, {"TMF", "The MicroFoundry"}, {"TMT", "TypeMyType Comm. V."}, {"TNTY", "tntypography"}, {"TOPP", "Toppan Printing Co., Ltd."}, {"TPDP", "Type Department"}, {"TPMA", "typoma"}, {"TPSP", "Type Supply"}, {"TPTA", "TPTQ Arabic"}, {"TPTC", "Test Pilot Collective"}, {"TPTQ", "Typotheque"}, {"TR", "Type Revivals"}, {"TRAF", "Traffictype"}, {"TREE", "Treeflow"}, {"TS", "TamilSoft Corporation"}, {"TSPC", "Typespec Ltd"}, {"TSTY", "Torleiv Georg Sverdrup"}, {"TT", "TypeTogether"}, {"TTG", "Twardoch Typography"}, {"TTY", "Tipotype"}, {"TYCU", "TypeCulture"}, {"TYFR", "typographies.fr"}, {"TYME", "type me! Font Foundry"}, {"TYPA", "Typadelic"}, {"TYPE", "Type Associates Pty Ltd"}, {"TYPO", "Typodermic"}, {"TYPR", "Type Project"}, {"TYRE", "typerepublic"}, {"UA", "UnAuthorized Type"}, {"ULA", "Montserrat Typeface"}, {"UNDT", "ÜNDT"}, {"URW", "URW++"}, {"UT", "Unitype Inc"}, {"VINT", "Vinterstille"}, {"VJ", "eDESIGNzone"}, {"VKP", "Vijay K. Patel"}, {"VLKF", "Visualogik Technology & Design"}, {"VLNL", "VetteLetters.nl"}, {"VMT", "VMType"}, {"VOG", "Martin Vogel"}, {"VROM", "Vladimir Romanov"}, {"VS", "VorSicht GmbH"}, {"VT", "VISUALTYPE SRL"}, {"VTF", "Velvetyne Type Foundry"}, {"WASP", "Wasp Barcode Technologies"}, {"WILL", "Willerstorfer Font Foundry"}, {"WL", "Writ Large Fonts"}, {"WM", "Webmakers India"}, {"XFC", "Xerox Font Services"}, {"XOTH", "Xoth Morello"}, {"XYZ", "XYZ Type LLC"}, {"Y&Y;", "Y&Y;, Inc."}, {"YDS", "Yellow Design Studio"}, {"YN", "Yanone"}, {"YOFF", "Your Own Font Foundry"}, {"YOKO", "Yokokaku"}, {"YOUR", "YourFonts.com"}, {"ZANE", "Unrender"}, {"ZeGr", "Zebra Font Factory"}, {"zeta", "Tangram Studio"}, {"ZSFT", "Zsoft"}, }; #define NOTICE_ENTRIES G_N_ELEMENTS(NoticeData) #define VENDOR_ENTRIES G_N_ELEMENTS(VendorData) gchar * get_vendor_from_notice(const gchar *notice); gchar * get_vendor_from_vendor_id(const gchar vendor[MAX_VENDOR_ID_LENGTH]); G_END_DECLS master-0.7.3/lib/Glue/_Glue_.c000077500000000000000000000334221300074171200160160ustar00rootroot00000000000000/* _Glue_.c * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ #include #include #include #include #include #include #include FT_FREETYPE_H #include FT_TYPES_H #include FT_BDF_H #include FT_SFNT_NAMES_H #include FT_TRUETYPE_IDS_H #include FT_TRUETYPE_TABLES_H #include FT_TYPE1_TABLES_H #include FT_XFREE86_H #include #include #include #include #include "_Glue_.h" #include "License.h" #include "Vendor.h" #define UTF16BE_2_UTF8(s) \ g_convert((const gchar *) s.string, s.string_len, "UTF-8", "UTF-16BE", NULL, NULL, NULL) \ static void g_free0(gpointer p) { g_free(p); g_nullify_pointer(&p); } static int get_file_owner (const gchar * filepath) { int owner; GFile *fhandle = g_file_new_for_path(filepath); GFileInfo * finfo = g_file_query_info(fhandle, G_FILE_ATTRIBUTE_OWNER_USER, G_FILE_QUERY_INFO_NONE, NULL, NULL); if (finfo == NULL) { owner = g_access(filepath, W_OK); } else { owner = g_strcmp0(g_file_info_get_attribute_string(finfo, G_FILE_ATTRIBUTE_OWNER_USER), g_get_user_name()); g_object_unref(finfo); } g_object_unref(fhandle); return owner; } static void get_font_details_from_pattern (FontConfigFont * font, FcPattern * pattern) { int index; int slant; int weight; int width; int spacing; FcChar8 * file; FcChar8 * family; FcChar8 * style; g_assert(FcInit()); g_assert(FcPatternGetString(pattern, FC_FILE, 0, &file) == FcResultMatch); font_config_font_set_filepath(font, (const gchar *) file); font_config_font_set_owner(font, get_file_owner((const gchar *) file)); g_assert(FcPatternGetString(pattern, FC_FAMILY, 0, &family) == FcResultMatch); font_config_font_set_family(font, (const gchar *) family); if (FcPatternGetInteger(pattern, FC_INDEX, 0, &index) != FcResultMatch) index = 0; font_config_font_set_index(font, index); if (FcPatternGetInteger(pattern, FC_SPACING, 0, &spacing) != FcResultMatch) spacing = FC_PROPORTIONAL; font_config_font_set_spacing(font, spacing); if (FcPatternGetInteger(pattern, FC_SLANT, 0, &slant) != FcResultMatch) slant = FC_SLANT_ROMAN; font_config_font_set_slant(font, slant); if (FcPatternGetInteger(pattern, FC_WEIGHT, 0, &weight) != FcResultMatch) weight = FC_WEIGHT_MEDIUM; font_config_font_set_weight(font, weight); if (FcPatternGetInteger(pattern, FC_WIDTH, 0, &width) != FcResultMatch) width = FC_WIDTH_NORMAL; font_config_font_set_width(font, width); if (FcPatternGetString (pattern, FC_STYLE, 0, &style) != FcResultMatch) { /* Use the same style Pango would if none is given */ if (weight <= FC_WEIGHT_MEDIUM) { if (slant == FC_SLANT_ROMAN) font_config_font_set_style(font, "Regular"); else font_config_font_set_style(font, "Italic"); } else { if (slant == FC_SLANT_ROMAN) font_config_font_set_style(font, "Bold"); else font_config_font_set_style(font, "Bold Italic"); } } else { font_config_font_set_style(font, (const gchar *) style); } PangoFontDescription * descr = pango_fc_font_description_from_pattern(pattern, FALSE); gchar * desc_string = pango_font_description_to_string(descr); font_config_font_set_description(font, desc_string); pango_font_description_free(descr); g_free0(desc_string); return; } long get_face_count(const char *filepath) { FT_Face face; FT_Library library; FT_Error error; FT_Long num_faces; error = FT_Init_FreeType(&library); if (error) /* Index 0 is always valid */ return 1; error = FT_New_Face(library, filepath, 0, &face); if (error) { FT_Done_FreeType(library); return 1; } num_faces = face->num_faces; FT_Done_Face(face); FT_Done_FreeType(library); return num_faces; } FontConfigFont * FcGetFontFromFile (gchar * filepath, int index) { g_assert(FcInit()); int count; FontConfigFont * font = font_config_font_new(); FcBlanks * blanks = FcBlanksCreate(); FcPattern * pattern = FcFreeTypeQuery((const FcChar8 *) filepath, index, blanks, &count); if (!pattern) { g_warning("Failed to create FontConfig pattern for file : %s", filepath); if (font) g_object_unref(font); if (blanks) FcBlanksDestroy(blanks); return NULL; } else { get_font_details_from_pattern(font, pattern); } if (blanks) FcBlanksDestroy(blanks); if (pattern) FcPatternDestroy(pattern); return font; } GeeArrayList * FcListFonts(gchar * family_name) { int i; FcPattern * pattern; FcFontSet * fontset; FcObjectSet * objectset = 0; GeeArrayList * fontlist = gee_array_list_new(G_TYPE_OBJECT, NULL, NULL, NULL, NULL, NULL); g_assert(FcInit()); if (family_name) pattern = FcPatternBuild (NULL, FC_FAMILY, FcTypeString, family_name, NULL); else pattern = FcNameParse((FcChar8 *) ":"); objectset = FcObjectSetBuild (FC_FILE, FC_INDEX, FC_FAMILY, FC_STYLE, FC_SLANT, FC_WEIGHT, FC_WIDTH, FC_SPACING, NULL); fontset = FcFontList(NULL, pattern, objectset); for (i = 0; i < fontset->nfont; i++) { FontConfigFont * font = font_config_font_new(); get_font_details_from_pattern(font, fontset->fonts[i]); gee_abstract_collection_add((GeeAbstractCollection *) fontlist, font); } if (objectset) FcObjectSetDestroy(objectset); if (pattern) FcPatternDestroy(pattern); if (fontset) FcFontSetDestroy(fontset); return fontlist; } /* Mostly lifted from fontilus by James Henstridge. Thanks. :-) */ static void get_sfnt_info(FontManagerFontInfo * fileinfo, const FT_Face face) { gint index, namecount = FT_Get_Sfnt_Name_Count(face); gchar * vendor = NULL; for (index = 0; index < namecount; index++) { FT_SfntName sname; if (FT_Get_Sfnt_Name(face, index, &sname) != 0) continue; /* Only handle the unicode names for US langid */ if (!(sname.platform_id == TT_PLATFORM_MICROSOFT && sname.encoding_id == TT_MS_ID_UNICODE_CS && sname.language_id == TT_MS_LANGID_ENGLISH_UNITED_STATES)) continue; gchar * val = UTF16BE_2_UTF8(sname); switch (sname.name_id) { case TT_NAME_ID_COPYRIGHT: font_manager_font_info_set_copyright(fileinfo, val); break; case TT_NAME_ID_VERSION_STRING: font_manager_font_info_set_version(fileinfo, val); break; case TT_NAME_ID_DESCRIPTION: font_manager_font_info_set_description(fileinfo, val); break; case TT_NAME_ID_LICENSE: font_manager_font_info_set_license_data(fileinfo, val); break; case TT_NAME_ID_LICENSE_URL: font_manager_font_info_set_license_url(fileinfo, val); break; case TT_NAME_ID_TRADEMARK: if (!vendor) vendor = UTF16BE_2_UTF8(sname); break; case TT_NAME_ID_MANUFACTURER: if (vendor) g_free0(vendor); vendor = UTF16BE_2_UTF8(sname); break; default: break; } g_free0(val); } if (vendor) { if (!font_manager_font_info_get_vendor(fileinfo)) { gchar * _vendor = get_vendor_from_notice(vendor); if (_vendor) { font_manager_font_info_set_vendor(fileinfo, _vendor); g_free0(_vendor); } } g_free0(vendor); } } static void get_ps_info(FontManagerFontInfo * fileinfo, PS_FontInfoRec ps_info, const FT_Face face) { if (!font_manager_font_info_get_version(fileinfo)) font_manager_font_info_set_version(fileinfo, ps_info.version); if (ps_info.notice && g_utf8_validate(ps_info.notice, -1, NULL)) { if (!font_manager_font_info_get_copyright(fileinfo)) font_manager_font_info_set_copyright(fileinfo, ps_info.notice); if (!font_manager_font_info_get_vendor(fileinfo)) { gchar * _vendor = get_vendor_from_notice(ps_info.notice); if (_vendor) { font_manager_font_info_set_vendor(fileinfo, _vendor); g_free0(_vendor); } } } } FT_Error get_file_info(FontManagerFontInfo *fileinfo, const gchar * filepath, gint index) { FT_Face face; FT_Library library; FT_Error error; PS_FontInfoRec ps_info; BDF_PropertyRec prop; gsize filesize = 0; gchar * font = NULL; if (G_UNLIKELY(!g_file_get_contents(filepath, &font, &filesize, NULL))) { g_warning("Failed to load file : %s", filepath); return FT_Err_Cannot_Open_Resource; } error = FT_Init_FreeType(&library); if (G_UNLIKELY(error)) return error; error = FT_New_Memory_Face(library, (const FT_Byte *) font, (FT_Long) filesize, index, &face); if (G_UNLIKELY(error)) { g_warning("Failed to create FT_Face for file : %s", filepath); return error; } font_manager_font_info_set_owner(fileinfo, get_file_owner(filepath)); font_manager_font_info_set_filetype(fileinfo, FT_Get_X11_Font_Format(face)); gchar * _size = g_format_size(filesize); font_manager_font_info_set_filesize(fileinfo, _size); g_free0(_size); gchar * _md5 = g_compute_checksum_for_data(G_CHECKSUM_MD5, (const guchar *) font, filesize); font_manager_font_info_set_checksum(fileinfo, _md5); g_free0(_md5); font_manager_font_info_set_psname(fileinfo, FT_Get_Postscript_Name(face)); TT_OS2 * os2 = (TT_OS2 *) FT_Get_Sfnt_Table(face, ft_sfnt_os2); if (G_LIKELY(os2 && os2->version >= 0x0001 && os2->version != 0xffff)) { gchar * _vendor = get_vendor_from_vendor_id((gchar *) os2->achVendID); font_manager_font_info_set_vendor(fileinfo, _vendor); g_free0(_vendor); gchar * panose = g_strdup_printf("%i:%i:%i:%i:%i:%i:%i:%i:%i:%i", os2->panose[0], os2->panose[1], os2->panose[2], os2->panose[3], os2->panose[4], os2->panose[5], os2->panose[6], os2->panose[7], os2->panose[8], os2->panose[9]); font_manager_font_info_set_panose(fileinfo, panose); g_free0(panose); } if (G_LIKELY(FT_IS_SFNT(face))) get_sfnt_info(fileinfo, face); if (FT_Get_PS_Font_Info(face, &ps_info) == 0) get_ps_info(fileinfo, ps_info, face); gint lic_type = get_license_type(font_manager_font_info_get_license_data(fileinfo), font_manager_font_info_get_copyright(fileinfo), font_manager_font_info_get_license_url(fileinfo)); gchar * _name = get_license_name(lic_type); font_manager_font_info_set_license_type(fileinfo, _name); g_free0(_name); if (!font_manager_font_info_get_license_url(fileinfo)) { gchar * _url = get_license_url(lic_type); if (_url) font_manager_font_info_set_license_url(fileinfo, _url); g_free0(_url); } if (!font_manager_font_info_get_version(fileinfo)) { TT_Header * head = (TT_Header *) FT_Get_Sfnt_Table (face, ft_sfnt_head); if (head) if (head->Font_Revision) { gchar * rev = g_strdup_printf("%f", (float) head->Font_Revision); font_manager_font_info_set_version(fileinfo, rev); g_free0(rev); } } if (!font_manager_font_info_get_vendor(fileinfo)) { int result = FT_Get_BDF_Property(face, "FOUNDRY", &prop); if(result == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) font_manager_font_info_set_vendor(fileinfo, prop.u.atom); else font_manager_font_info_set_vendor(fileinfo, "Unknown Vendor"); } FT_Done_Face(face); error = FT_Done_FreeType(library); g_free0(font); return error; } master-0.7.3/lib/Glue/_Glue_.h000066400000000000000000000265111300074171200160210ustar00rootroot00000000000000/* _Glue_.h generated by valac 0.30.0, the Vala compiler, do not modify */ #ifndef _____GLUE__H__ #define _____GLUE__H__ #include #include #include #include #include #include #include G_BEGIN_DECLS #define TYPE_CACHEABLE (cacheable_get_type ()) #define CACHEABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CACHEABLE, Cacheable)) #define CACHEABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CACHEABLE, CacheableClass)) #define IS_CACHEABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CACHEABLE)) #define IS_CACHEABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CACHEABLE)) #define CACHEABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CACHEABLE, CacheableClass)) typedef struct _Cacheable Cacheable; typedef struct _CacheableClass CacheableClass; #define FONT_CONFIG_TYPE_FONT (font_config_font_get_type ()) #define FONT_CONFIG_FONT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_CONFIG_TYPE_FONT, FontConfigFont)) #define FONT_CONFIG_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_CONFIG_TYPE_FONT, FontConfigFontClass)) #define FONT_CONFIG_IS_FONT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_CONFIG_TYPE_FONT)) #define FONT_CONFIG_IS_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_CONFIG_TYPE_FONT)) #define FONT_CONFIG_FONT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_CONFIG_TYPE_FONT, FontConfigFontClass)) typedef struct _FontConfigFont FontConfigFont; typedef struct _FontConfigFontClass FontConfigFontClass; typedef struct _CacheablePrivate CacheablePrivate; typedef struct _FontConfigFontPrivate FontConfigFontPrivate; #define FONT_CONFIG_TYPE_WEIGHT (font_config_weight_get_type ()) #define FONT_CONFIG_TYPE_SLANT (font_config_slant_get_type ()) #define FONT_CONFIG_TYPE_WIDTH (font_config_width_get_type ()) #define FONT_CONFIG_TYPE_SPACING (font_config_spacing_get_type ()) #define FONT_CONFIG_TYPE_SUBPIXEL_ORDER (font_config_subpixel_order_get_type ()) #define FONT_CONFIG_TYPE_HINT_STYLE (font_config_hint_style_get_type ()) #define FONT_CONFIG_TYPE_LCD_FILTER (font_config_lcd_filter_get_type ()) #define FONT_MANAGER_TYPE_FONT_INFO (font_manager_font_info_get_type ()) #define FONT_MANAGER_FONT_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_FONT_INFO, FontManagerFontInfo)) #define FONT_MANAGER_FONT_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_FONT_INFO, FontManagerFontInfoClass)) #define FONT_MANAGER_IS_FONT_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_FONT_INFO)) #define FONT_MANAGER_IS_FONT_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_FONT_INFO)) #define FONT_MANAGER_FONT_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_FONT_INFO, FontManagerFontInfoClass)) typedef struct _FontManagerFontInfo FontManagerFontInfo; typedef struct _FontManagerFontInfoClass FontManagerFontInfoClass; typedef struct _FontManagerFontInfoPrivate FontManagerFontInfoPrivate; struct _Cacheable { GObject parent_instance; CacheablePrivate * priv; }; struct _CacheableClass { GObjectClass parent_class; gboolean (*deserialize_property) (Cacheable* self, const gchar* prop_name, GValue* val, GParamSpec* pspec, JsonNode* node); JsonNode* (*serialize_property) (Cacheable* self, const gchar* prop_name, GValue* val, GParamSpec* pspec); }; struct _FontConfigFont { Cacheable parent_instance; FontConfigFontPrivate * priv; }; struct _FontConfigFontClass { CacheableClass parent_class; }; typedef enum { FONT_CONFIG_WEIGHT_THIN = 0, FONT_CONFIG_WEIGHT_EXTRALIGHT = 40, FONT_CONFIG_WEIGHT_ULTRALIGHT = 40, FONT_CONFIG_WEIGHT_LIGHT = 50, FONT_CONFIG_WEIGHT_BOOK = 75, FONT_CONFIG_WEIGHT_REGULAR = 80, FONT_CONFIG_WEIGHT_NORMAL = 80, FONT_CONFIG_WEIGHT_MEDIUM = 100, FONT_CONFIG_WEIGHT_DEMIBOLD = 180, FONT_CONFIG_WEIGHT_SEMIBOLD = 180, FONT_CONFIG_WEIGHT_BOLD = 200, FONT_CONFIG_WEIGHT_EXTRABOLD = 205, FONT_CONFIG_WEIGHT_BLACK = 210, FONT_CONFIG_WEIGHT_HEAVY = 210, FONT_CONFIG_WEIGHT_EXTRABLACK = 215, FONT_CONFIG_WEIGHT_ULTRABLACK = 215 } FontConfigWeight; typedef enum { FONT_CONFIG_SLANT_ROMAN = 0, FONT_CONFIG_SLANT_ITALIC = 100, FONT_CONFIG_SLANT_OBLIQUE = 110 } FontConfigSlant; typedef enum { FONT_CONFIG_WIDTH_ULTRACONDENSED = 50, FONT_CONFIG_WIDTH_EXTRACONDENSED = 63, FONT_CONFIG_WIDTH_CONDENSED = 75, FONT_CONFIG_WIDTH_SEMICONDENSED = 87, FONT_CONFIG_WIDTH_NORMAL = 100, FONT_CONFIG_WIDTH_SEMIEXPANDED = 113, FONT_CONFIG_WIDTH_EXPANDED = 125, FONT_CONFIG_WIDTH_EXTRAEXPANDED = 150, FONT_CONFIG_WIDTH_ULTRAEXPANDED = 200 } FontConfigWidth; typedef enum { FONT_CONFIG_SPACING_PROPORTIONAL = 0, FONT_CONFIG_SPACING_DUAL = 90, FONT_CONFIG_SPACING_MONO = 100, FONT_CONFIG_SPACING_CHARCELL = 110 } FontConfigSpacing; typedef enum { FONT_CONFIG_SUBPIXEL_ORDER_UNKNOWN, FONT_CONFIG_SUBPIXEL_ORDER_RGB, FONT_CONFIG_SUBPIXEL_ORDER_BGR, FONT_CONFIG_SUBPIXEL_ORDER_VRGB, FONT_CONFIG_SUBPIXEL_ORDER_VBGR, FONT_CONFIG_SUBPIXEL_ORDER_NONE } FontConfigSubpixelOrder; typedef enum { FONT_CONFIG_HINT_STYLE_NONE, FONT_CONFIG_HINT_STYLE_SLIGHT, FONT_CONFIG_HINT_STYLE_MEDIUM, FONT_CONFIG_HINT_STYLE_FULL } FontConfigHintStyle; typedef enum { FONT_CONFIG_LCD_FILTER_NONE, FONT_CONFIG_LCD_FILTER_DEFAULT, FONT_CONFIG_LCD_FILTER_LIGHT, FONT_CONFIG_LCD_FILTER_LEGACY } FontConfigLCDFilter; struct _FontManagerFontInfo { Cacheable parent_instance; FontManagerFontInfoPrivate * priv; gint status; }; struct _FontManagerFontInfoClass { CacheableClass parent_class; }; GType cacheable_get_type (void) G_GNUC_CONST; GType font_config_font_get_type (void) G_GNUC_CONST; gint font_config_sort_fonts (FontConfigFont* a, FontConfigFont* b); gchar* font_config_font_to_filename (FontConfigFont* self); gchar* font_config_font_to_string (FontConfigFont* self); FontConfigFont* font_config_font_new (void); FontConfigFont* font_config_font_construct (GType object_type); const gchar* font_config_font_get_filepath (FontConfigFont* self); void font_config_font_set_filepath (FontConfigFont* self, const gchar* value); gint font_config_font_get_index (FontConfigFont* self); void font_config_font_set_index (FontConfigFont* self, gint value); const gchar* font_config_font_get_family (FontConfigFont* self); void font_config_font_set_family (FontConfigFont* self, const gchar* value); const gchar* font_config_font_get_style (FontConfigFont* self); void font_config_font_set_style (FontConfigFont* self, const gchar* value); gint font_config_font_get_slant (FontConfigFont* self); void font_config_font_set_slant (FontConfigFont* self, gint value); gint font_config_font_get_weight (FontConfigFont* self); void font_config_font_set_weight (FontConfigFont* self, gint value); gint font_config_font_get_width (FontConfigFont* self); void font_config_font_set_width (FontConfigFont* self, gint value); gint font_config_font_get_spacing (FontConfigFont* self); void font_config_font_set_spacing (FontConfigFont* self, gint value); gint font_config_font_get_owner (FontConfigFont* self); void font_config_font_set_owner (FontConfigFont* self, gint value); const gchar* font_config_font_get_description (FontConfigFont* self); void font_config_font_set_description (FontConfigFont* self, const gchar* value); GType font_config_weight_get_type (void) G_GNUC_CONST; gboolean font_config_weight_defined (FontConfigWeight self); gchar* font_config_weight_to_string (FontConfigWeight self); GType font_config_slant_get_type (void) G_GNUC_CONST; gchar* font_config_slant_to_string (FontConfigSlant self); GType font_config_width_get_type (void) G_GNUC_CONST; gchar* font_config_width_to_string (FontConfigWidth self); GType font_config_spacing_get_type (void) G_GNUC_CONST; gchar* font_config_spacing_to_string (FontConfigSpacing self); GType font_config_subpixel_order_get_type (void) G_GNUC_CONST; gchar* font_config_subpixel_order_to_string (FontConfigSubpixelOrder self); GType font_config_hint_style_get_type (void) G_GNUC_CONST; gchar* font_config_hint_style_to_string (FontConfigHintStyle self); GType font_config_lcd_filter_get_type (void) G_GNUC_CONST; gchar* font_config_lcd_filter_to_string (FontConfigLCDFilter self); gboolean cacheable_deserialize_property (Cacheable* self, const gchar* prop_name, GValue* val, GParamSpec* pspec, JsonNode* node); GParamSpec** cacheable_list_properties (Cacheable* self, int* result_length1); JsonNode* cacheable_serialize_property (Cacheable* self, const gchar* prop_name, GValue* val, GParamSpec* pspec); Cacheable* cacheable_new (void); Cacheable* cacheable_construct (GType object_type); GType font_manager_font_info_get_type (void) G_GNUC_CONST; FontManagerFontInfo* font_manager_font_info_new_from_filepath (const gchar* filepath, gint index); FontManagerFontInfo* font_manager_font_info_construct_from_filepath (GType object_type, const gchar* filepath, gint index); FontManagerFontInfo* font_manager_font_info_new (void); FontManagerFontInfo* font_manager_font_info_construct (GType object_type); gint font_manager_font_info_get_owner (FontManagerFontInfo* self); void font_manager_font_info_set_owner (FontManagerFontInfo* self, gint value); const gchar* font_manager_font_info_get_filetype (FontManagerFontInfo* self); void font_manager_font_info_set_filetype (FontManagerFontInfo* self, const gchar* value); const gchar* font_manager_font_info_get_filesize (FontManagerFontInfo* self); void font_manager_font_info_set_filesize (FontManagerFontInfo* self, const gchar* value); const gchar* font_manager_font_info_get_checksum (FontManagerFontInfo* self); void font_manager_font_info_set_checksum (FontManagerFontInfo* self, const gchar* value); const gchar* font_manager_font_info_get_version (FontManagerFontInfo* self); void font_manager_font_info_set_version (FontManagerFontInfo* self, const gchar* value); const gchar* font_manager_font_info_get_psname (FontManagerFontInfo* self); void font_manager_font_info_set_psname (FontManagerFontInfo* self, const gchar* value); const gchar* font_manager_font_info_get_description (FontManagerFontInfo* self); void font_manager_font_info_set_description (FontManagerFontInfo* self, const gchar* value); const gchar* font_manager_font_info_get_vendor (FontManagerFontInfo* self); void font_manager_font_info_set_vendor (FontManagerFontInfo* self, const gchar* value); const gchar* font_manager_font_info_get_copyright (FontManagerFontInfo* self); void font_manager_font_info_set_copyright (FontManagerFontInfo* self, const gchar* value); const gchar* font_manager_font_info_get_license_type (FontManagerFontInfo* self); void font_manager_font_info_set_license_type (FontManagerFontInfo* self, const gchar* value); const gchar* font_manager_font_info_get_license_data (FontManagerFontInfo* self); void font_manager_font_info_set_license_data (FontManagerFontInfo* self, const gchar* value); const gchar* font_manager_font_info_get_license_url (FontManagerFontInfo* self); void font_manager_font_info_set_license_url (FontManagerFontInfo* self, const gchar* value); const gchar* font_manager_font_info_get_panose (FontManagerFontInfo* self); void font_manager_font_info_set_panose (FontManagerFontInfo* self, const gchar* value); gint free_type_num_faces (const gchar* filepath); gint free_type_query_file_info (FontManagerFontInfo* fileinfo, const gchar* filepath, gint index); FontConfigFont* font_config_get_font_from_file (const gchar* filepath, gint index); GeeArrayList* font_config_list_fonts (const gchar* family_name); G_END_DECLS #endif master-0.7.3/lib/Library/000077500000000000000000000000001300074171200151615ustar00rootroot00000000000000master-0.7.3/lib/Library/Install.vala000066400000000000000000000217351300074171200174440ustar00rootroot00000000000000/* Install.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace Library { [Compact] public class Install { public static Gee.ArrayList ? installed = null; public static Gee.HashMap ? install_failed = null; static File? tmpdir = null; public static void from_file_array (File? [] files) { debug("Processing files for installation"); init(); var _files = new Gee.ArrayList (); foreach (var file in files) _files.add(file); process_filelist(_files); fini(); } public static void from_path_array (string? [] paths) { debug("Processing files for installation"); init(); var files = new Gee.ArrayList (); foreach (var path in paths) files.add(File.new_for_path(path)); process_filelist(files); fini(); } public static void from_uri_array (string? [] uris) { debug("Processing files for installation"); init(); var files = new Gee.ArrayList (); foreach (var uri in uris) files.add(File.new_for_uri(uri)); process_filelist(files); fini(); } public static bool from_font_data (FontData data) { init(); debug("Preparing to install %s", data.file.get_path()); if (data.font == null || data.fontinfo == null) { install_failed[data.file.get_path()] = "Failed to create FontInfo"; warning("Failed to create FontInfo : %s", data.file.get_path()); return false; } string dest = Path.build_filename(install_dir, data.fontinfo.vendor, data.fontinfo.filetype, data.font.family); DirUtils.create_with_parents(dest, 0755); string filename = data.font.to_filename(); string filepath = Path.build_filename(dest, "%s.%s".printf(filename, get_file_extension(data.file.get_path()))); var file = File.new_for_path(filepath); try_copy(data.file, file); /* XXX */ if (data.fontinfo.filetype == "Type 1") { string par = data.file.get_parent().get_path(); try { FileInfo inf = data.file.query_info(FileAttribute.STANDARD_NAME, FileQueryInfoFlags.NONE); string name = inf.get_name().split_set(".")[0]; foreach (var ext in TYPE1_METRICS) { string poss = Path.build_filename(par, name + ext); File f = File.new_for_path(poss); if (f.query_exists()) { string path = Path.build_filename(dest, filename + ext); File _f = File.new_for_path(path); try_copy(f, _f); } } } catch (Error e) { critical("Error querying file information : %s", e.message); } } return true; } #if HAVE_FILE_ROLLER static File? get_temp_dir () { if (tmpdir != null) return tmpdir; string? _tmpdir = null; try { _tmpdir = DirUtils.make_tmp(TMP_TMPL); } catch (FileError e) { critical("Error creating temporary working directory : %s", e.message); } tmpdir = _tmpdir != null ? File.new_for_path(_tmpdir) : null; return tmpdir; } #endif static void process_filelist (Gee.ArrayList filelist) { var sorter = new Sorter(); sorter.sort(filelist); if (sorter.archives.size > 0) process_archives(sorter.archives); process_files(sorter.files); return; } static void process_files (Gee.ArrayList filelist) { int processed = 0; foreach (var f in filelist) { var data = FontData(f); /* XXX: FIXME : notify */ if (!is_installed(data) && (conflicts(data) < 0)) from_font_data(data); processed++; if (progress != null) progress(_("Installing files"), processed, filelist.size); } } static void process_archives (Gee.ArrayList filelist) { if (filelist.size == 0) return; #if HAVE_FILE_ROLLER int processed = 0; get_temp_dir(); if (tmpdir == null) { /* XXX : FIXME : notify */ critical("Failed to create temporary working directory!"); return; } debug("Preparing Archives"); foreach (var a in filelist) { if (!archive_manager.extract(a.get_uri(), tmpdir.get_uri(), false)) install_failed[a.get_path()] = "Failed to extract archive"; else debug("Successfully extracted the contents of %s", a.get_basename()); if (a.get_uri().contains(tmpdir.get_uri())) try { a.delete(); } catch (Error e) { warning("Failed to delete temporary file : %s", e.message); warning("Aborting installation..."); fini(); return; } processed++; if (progress != null) progress(_("Preparing Archives"), processed, filelist.size); } var sorter = new Sorter(); var l = new Gee.ArrayList (); l.add(tmpdir); sorter.sort(l); if (sorter.archives.size > 0) process_archives(sorter.archives); else process_files(sorter.files); #endif return; } static void init () { installed = new Gee.ArrayList (); install_failed = new Gee.HashMap (); if (install_dir == null) install_dir = get_user_font_dir(); #if HAVE_FILE_ROLLER if (archive_manager == null) { archive_manager = new ArchiveManager(); supported_archives = archive_manager.get_supported_types(); } #endif return; } static void fini () { if (tmpdir == null) return; debug("Removing temporary directory used during installation"); remove_directory(tmpdir); tmpdir = null; install_dir = null; return; } static void try_copy (File original, File copy) { try { original.copy(copy, FileCopyFlags.OVERWRITE | FileCopyFlags.ALL_METADATA); debug("Successfully copied %s to %s", original.get_path(), copy.get_path()); installed.add(original); } catch (Error e) { string path = original.get_path(); install_failed[path] = e.message; warning("%s : %s", e.message, path); } return; } } } } master-0.7.3/lib/Library/Library.vala000066400000000000000000000023731300074171200174370ustar00rootroot00000000000000/* Library.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace Library { public static ProgressCallback? progress = null; #if HAVE_FILE_ROLLER static ArchiveManager? archive_manager = null; static Gee.ArrayList ? supported_archives = null; #endif public static string? install_dir = null; public const string [] TYPE1_METRICS = { ".afm", ".pfa", ".pfm" }; } } master-0.7.3/lib/Library/Query.vala000066400000000000000000000072221300074171200171360ustar00rootroot00000000000000/* Query.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace Library { public static bool is_installed (FontData font_data) { var filelist = FontConfig.list_files(); if (font_data.font.filepath in filelist) { debug("Font already installed : Filepath match : %s", font_data.font.filepath); return true; } var _filelist = db_match_checksum(font_data.fontinfo.checksum); foreach (var f in _filelist) if (filelist.contains(f)) { debug("Font already installed : Checksum match"); return true; } return false; } public static int conflicts (FontData font_data) { var unique = db_match_unique_names(font_data); var filelist = FontConfig.list_files(); foreach (var f in unique.keys) if (filelist.contains(f)) { debug("%s conflicts with %s", font_data.font.filepath, f); return natural_cmp(unique[f], font_data.fontinfo.version); } return -1; } static Gee.ArrayList db_match_checksum (string checksum) { var results = new Gee.ArrayList (); Database? db = null; try { db = get_database(); db.reset(); db.table = "Fonts"; db.select = "filepath"; db.search = "checksum=\"%s\"".printf(checksum); db.execute_query(); foreach (var row in db) results.add(row.column_text(0)); } catch (DatabaseError e) { critical("Database Error : %s", e.message); //show_error_message(_("There was an error accessing the database"), e); } if (db != null) db.close(); return results; } static Gee.HashMap db_match_unique_names (FontData font_data) { var results = new Gee.HashMap (); Database? db = null; try { db = get_database(); db.reset(); db.table = "Fonts"; db.select = "filepath, version"; db.search = "psname=\"%s\" OR font_description=\"%s\"".printf(font_data.fontinfo.psname, font_data.font.description); db.execute_query(); foreach (var row in db) results[row.column_text(0)] = row.column_text(1); } catch (DatabaseError e) { critical("Database Error : %s", e.message); //show_error_message(_("There was an error accessing the database"), e); } if (db != null) db.close(); return results; } } } master-0.7.3/lib/Library/Remove.vala000066400000000000000000000112121300074171200172600ustar00rootroot00000000000000/* Remove.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace Library { public bool remove_directory_tree_if_empty (File? dir) { if (dir == null) return false; try { var enumerator = dir.enumerate_children(FileAttribute.STANDARD_NAME, FileQueryInfoFlags.NONE); if (enumerator.next_file() != null) return false; File parent = dir.get_parent(); dir.delete(); if (parent != null) remove_directory_tree_if_empty(parent); return true; } catch (Error e) { warning(e.message); } return false; } [Compact] public class Remove { public static Gee.HashMap ? remove_failed = null; public static bool from_file_array (File? [] files, Database? db = null) { remove_failed = null; bool res = true; int total = files.length; int processed = 0; foreach (var file in files) { try { string path = file.get_path(); if (db != null) purge_database_entry(db, path); if (!file.query_exists()) continue; File parent = file.get_parent(); FileInfo info = file.query_info(FileAttribute.STANDARD_CONTENT_TYPE, FileQueryInfoFlags.NONE); string basename = file.get_basename(); if (file.delete()) { debug("Successfully removed %s", path); if (info.get_content_type() == "application/x-font-type1") purge_type1_files(parent.get_path(), basename); } else { log_failure(path, "Failed to remove file"); res = false; } remove_directory_tree_if_empty(parent); processed++; if (progress != null) progress(_("Removing files"), processed, total); } catch (Error e) { log_failure(file.get_path(), e.message); res = false; } } return res; } static void log_failure (string path, string message) { if (remove_failed == null) remove_failed = new Gee.HashMap (); remove_failed[path] = message; warning("%s : %s", message, path); return; } static void purge_type1_files (string dir, string filename) { try { string name = filename.split_set(".")[0]; foreach (var ext in TYPE1_METRICS) { File metrics = File.new_for_path(Path.build_filename(dir, name + ext)); if (metrics.query_exists()) metrics.delete(); } } catch (Error e) { log_failure(Path.build_filename(dir, filename), e.message); } return; } static void purge_database_entry (Database db, string path) { try { db.remove("filepath=\"%s\"".printf(path)); debug("Successfully removed entry for %s from database", path); } catch (DatabaseError e) { warning(e.message); } return; } } } } master-0.7.3/lib/Library/Sorter.vala000066400000000000000000000124541300074171200173120ustar00rootroot00000000000000/* Sorter.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace Library { internal bool is_metrics_file (string name) { foreach (var ext in TYPE1_METRICS) if (name.has_suffix(ext)) return true; return false; } public class Sorter : Object { public Gee.ArrayList files { get; private set; } public Gee.ArrayList archives { get; private set; } public int total { get { return files.size + archives.size; } } construct { files = new Gee.ArrayList (); archives = new Gee.ArrayList (); #if HAVE_FILE_ROLLER if (archive_manager == null) { archive_manager = new ArchiveManager(); supported_archives = archive_manager.get_supported_types(); } #endif } public void sort (Gee.ArrayList filelist) { files.clear(); archives.clear(); process_files(filelist); return; } void process_directory (File dir) { try { FileInfo fileinfo; var attrs = "%s,%s,%s".printf(FileAttribute.STANDARD_NAME, FileAttribute.STANDARD_CONTENT_TYPE, FileAttribute.STANDARD_TYPE); var enumerator = dir.enumerate_children(attrs, FileQueryInfoFlags.NONE); int processed = 0; int total = 0; while ((fileinfo = enumerator.next_file ()) != null) total++; enumerator = dir.enumerate_children(attrs, FileQueryInfoFlags.NONE); while ((fileinfo = enumerator.next_file ()) != null) { string content_type = fileinfo.get_content_type(); string name = fileinfo.get_name(); if (fileinfo.get_file_type() == FileType.DIRECTORY) process_directory(dir.get_child(name)); else if (content_type.contains("font") && !is_metrics_file(name)) files.add(dir.get_child(name)); #if HAVE_FILE_ROLLER else if (content_type in supported_archives) archives.add(dir.get_child(name)); #endif else warning("Skipping unsupported file : %s : %s", name, content_type); processed++; if (progress != null) progress(_("Processing directories"), processed, total); } } catch (Error e) { warning("%s :: %s", e.message, dir.get_path()); } return; } void process_files (Gee.ArrayList filelist) { int total = filelist.size; int processed = 0; foreach (var file in filelist) { var attrs = "%s,%s,%s".printf(FileAttribute.STANDARD_CONTENT_TYPE, FileAttribute.STANDARD_TYPE, FileAttribute.STANDARD_NAME); try { var fileinfo = file.query_info(attrs, FileQueryInfoFlags.NONE, null); string name = fileinfo.get_name(); string content_type = fileinfo.get_content_type(); if (fileinfo.get_file_type() == FileType.DIRECTORY) process_directory(file); else if (content_type.contains("font") && !is_metrics_file(name)) files.add(file); #if HAVE_FILE_ROLLER else if (content_type in supported_archives) archives.add(file); #endif else warning("Skipping unsupported file : %s : %s", name, content_type); } catch (Error e) { critical("Error querying file information : %s", e.message); } processed++; if (progress != null) progress(_("Processing files"), processed, total); } return; } } } } master-0.7.3/lib/Makefile.am000066400000000000000000000023561300074171200156170ustar00rootroot00000000000000 include $(top_srcdir)/Flags.mk include ValaSources.mk SUBDIRS = \ Glue DATA_DIR = $(top_srcdir)/data GLIB_COMPILE_RESOURCES = \ `$(PKG_CONFIG) --variable=glib_compile_resources gio-2.0` FontManagerGResource.c : $(GLIB_COMPILE_RESOURCES) \ --sourcedir=$(DATA_DIR) \ --generate-source \ --target=$@ \ $(DATA_DIR)/FontManagerGResource.xml BUILT_SOURCES = \ FontManagerGResource.c \ fontmanager.h libfontmanager_la_CFLAGS = \ $(AM_CFLAGS) \ -fPIC \ -shared libfontmanager_la_LIBADD = \ $(AM_LDADD) libfontmanager_la_LDFLAGS = \ -shared \ -release @PACKAGE_VERSION@ libfontmanager_la_VALAFLAGS = \ $(AM_VALAFLAGS) \ $(HAVE_FILE_ROLLER) \ $(VALA_034_OR_LATER) \ --gresources $(DATA_DIR)/FontManagerGResource.xml \ --library fontmanager \ -H fontmanager.h libfontmanager_la_SOURCES = \ $(libfontmanager_la_VALASOURCES) \ $(BUILT_SOURCES) \ FontConfig/_Common_.c \ Glue/_Glue_.c \ Glue/_Glue_.h \ Glue/License.c \ Glue/License.h \ Glue/Vendor.c \ Glue/Vendor.h pkglib_LTLIBRARIES = libfontmanager.la EXTRA_DIST = \ ValaSources.mk CLEANFILES = \ $(BUILT_SOURCES) \ *.stamp* \ fontmanager.vapi MAINTAINERCLEANFILES = \ Makefile.in dist-hook: cd $(distdir) && rm -f $(libfontmanager_la_VALASOURCES:.vala=.c) $(CLEANFILES) master-0.7.3/lib/UX/000077500000000000000000000000001300074171200141115ustar00rootroot00000000000000master-0.7.3/lib/UX/CharacterMap/000077500000000000000000000000001300074171200164435ustar00rootroot00000000000000master-0.7.3/lib/UX/CharacterMap/CharacterDetails.vala000077500000000000000000000045361300074171200225250ustar00rootroot00000000000000/* CharacterDetails.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class CharacterDetails : Gtk.EventBox { public unichar active_character { get { return ac; } set { ac = value; set_details(); } } unichar ac; Gtk.Box box; Gtk.Label unicode_label; Gtk.Label name_label; public CharacterDetails () { box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); unicode_label = new Gtk.Label(null); unicode_label.halign = Gtk.Align.END; unicode_label.selectable = true; unicode_label.can_focus = false; name_label = new Gtk.Label(null); name_label.halign = Gtk.Align.START; name_label.opacity = unicode_label.opacity = 0.9; unicode_label.margin = name_label.margin = DEFAULT_MARGIN_SIZE / 4; box.pack_start(unicode_label, true, true, 2); box.pack_end(name_label, true, true, 2); add(box); get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); } public override void show () { unicode_label.show(); name_label.show(); box.show(); base.show(); return; } void set_details () { unicode_label.set_markup(Markup.printf_escaped("U+%4.4X", ac)); name_label.set_markup(Markup.printf_escaped("%s", Gucharmap.get_unicode_name(ac))); return; } } } master-0.7.3/lib/UX/CharacterMap/CharacterMapSideBar.vala000077500000000000000000000205341300074171200231030ustar00rootroot00000000000000/* CharacterMapSideBar.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public enum CharacterMapSideBarMode { SCRIPT, BLOCK, N_MODES } public class CharacterMapSideBar : Gtk.Box { public signal void mode_set (CharacterMapSideBarMode mode); public signal void selection_changed (Gucharmap.CodepointList codepoint_list); public CharacterMapSideBarMode mode { get { if (stack.get_visible_child_name() == "Scripts") return CharacterMapSideBarMode.SCRIPT; else return CharacterMapSideBarMode.BLOCK; } set { if (value == CharacterMapSideBarMode.SCRIPT) stack.set_visible_child_name("Scripts"); else stack.set_visible_child_name("Blocks"); } } public string? selected_script { get; set; default = "49"; } public string? selected_block { get; set; default = "1"; } Gtk.TreeView script_view; Gtk.TreeView block_view; Gtk.Stack stack; Gtk.StackSwitcher switcher; Gtk.ScrolledWindow script_scroll; Gtk.ScrolledWindow block_scroll; Gucharmap.ScriptChaptersModel scripts; Gucharmap.BlockChaptersModel blocks; Gee.HashMap num_chars; Gtk.EventBox blend; public CharacterMapSideBar () { orientation = Gtk.Orientation.VERTICAL; num_chars = new Gee.HashMap (); stack = new Gtk.Stack(); scripts = new Gucharmap.ScriptChaptersModel(); blocks = new Gucharmap.BlockChaptersModel(); script_view = new Gtk.TreeView(); block_view = new Gtk.TreeView(); script_view.set_model(scripts); block_view.set_model(blocks); Gtk.TreeView [] views = { script_view, block_view }; foreach (var view in views) { view.headers_visible = false; var render = new Gtk.CellRendererText(); render.ellipsize = Pango.EllipsizeMode.END; var count = new CellRendererCount(); count.type_name = null; count.type_name_plural = null; count.xalign = 1.0f; Gtk.TreeSelection selection = view.get_selection(); selection.set_mode(Gtk.SelectionMode.SINGLE); view.insert_column_with_attributes(0, null, render, "text", 0, null); view.insert_column_with_data_func(1, "", count, count_cell_data_func); view.get_column(0).expand = true; view.get_column(1).expand = false; } script_scroll = new Gtk.ScrolledWindow(null, null); script_scroll.add(script_view); block_scroll = new Gtk.ScrolledWindow(null, null); block_scroll.add(block_view); stack.add_titled(script_scroll, "Scripts", _("Unicode Script")); stack.add_titled(block_scroll, "Blocks", _("Unicode Block")); switcher = new Gtk.StackSwitcher(); switcher.set_stack(stack); stack.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); switcher.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); switcher.set_border_width(6); switcher.halign = Gtk.Align.CENTER; switcher.valign = Gtk.Align.CENTER; blend = new Gtk.EventBox(); blend.add(switcher); blend.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); pack_end(blend, false, true, 0); add_separator(this, Gtk.Orientation.HORIZONTAL, Gtk.PackType.END); pack_start(stack, true, true, 0); connect_signals(); } public override void show () { script_view.show(); block_view.show(); stack.show(); switcher.show(); blend.show(); script_scroll.show(); block_scroll.show(); base.show(); return; } public void set_initial_selection (string script_path, string block_path) { if (mode == CharacterMapSideBarMode.SCRIPT) { select_block_path(block_path); select_script_path(script_path); } else { select_script_path(script_path); select_block_path(block_path); } return; } void select_script_path (string script_path) { Gtk.TreeIter _iter; scripts.get_iter_from_string(out _iter, script_path); script_view.get_selection().select_iter(_iter); script_view.scroll_to_cell(script_view.get_model().get_path(_iter), null, true, 0.5f, 0.5f); return; } void select_block_path (string block_path) { Gtk.TreeIter _iter; blocks.get_iter_from_string(out _iter, block_path); block_view.get_selection().select_iter(_iter); block_view.scroll_to_cell(block_view.get_model().get_path(_iter), null, true, 0.5f, 0.5f); return; } void connect_signals () { script_view.get_selection().changed.connect((s) => { Gtk.TreeIter? _iter = null; bool selected = s.get_selected(null, out _iter); var model = (Gucharmap.ChaptersModel) script_view.get_model(); if (selected) { selection_changed(model.get_codepoint_list(_iter)); selected_script = ((Gtk.TreeModel) model).get_string_from_iter(_iter); } }); block_view.get_selection().changed.connect((s) => { Gtk.TreeIter? _iter = null; bool selected = s.get_selected(null, out _iter); var model = (Gucharmap.ChaptersModel) block_view.get_model(); if (selected) { selection_changed(model.get_codepoint_list(_iter)); selected_block = ((Gtk.TreeModel) model).get_string_from_iter(_iter); } }); stack.notify["visible-child-name"].connect(() => { Gtk.TreeIter? iter = null; Gucharmap.ChaptersModel model; if (stack.get_visible_child_name() == "Scripts") { mode = CharacterMapSideBarMode.SCRIPT; model = (Gucharmap.ChaptersModel) script_view.get_model(); model.get_iter_from_string(out iter, selected_script); } else { mode = CharacterMapSideBarMode.BLOCK; model = (Gucharmap.ChaptersModel) block_view.get_model(); model.get_iter_from_string(out iter, selected_block); } if (iter != null) selection_changed(model.get_codepoint_list(iter)); mode_set(mode); }); return; } void count_cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { Value val; model.get_value(treeiter, 0, out val); var name = (string) val; if (!num_chars.has_key(name)) num_chars[name] = ((Gucharmap.ChaptersModel) model).get_codepoint_list(treeiter).get_last_index(); cell.set_property("count", num_chars[name]); val.unset(); return; } } } master-0.7.3/lib/UX/CharacterMap/CharacterTable.vala000077500000000000000000000066441300074171200221710ustar00rootroot00000000000000/* CharacterTable.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class CharacterTable : AdjustablePreview { public unichar active_character { get; set; } public bool show_details { get; set; default = false; } public Gucharmap.Chartable table { get; private set; } public CharacterDetails details { get; private set; } public Pango.FontDescription font_desc { get { return _font_desc; } /* XXX : Bug? * Workaround broken rendering by temporarily changing size. * This does cause visual glitches. * But without it rendering at current size may fail when font changes. */ set { if (_font_desc == null) { _font_desc = table.font_desc = value; return; } preview_size = preview_size - 0.1; _font_desc = table.font_desc = value; preview_size = preview_size + 0.1; } } Gtk.ScrolledWindow scroll; Pango.FontDescription _font_desc; public CharacterTable () { orientation = Gtk.Orientation.VERTICAL; table = new Gucharmap.Chartable(); table.font_fallback = false; table.zoom_enabled = false; table.codepoint_list = new Gucharmap.ScriptCodepointList(); table.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); font_desc = Pango.FontDescription.from_string(DEFAULT_FONT); scroll = new Gtk.ScrolledWindow(null, null); details = new CharacterDetails(); scroll.add(table); pack_start(details, false, true, 0); pack_start(scroll, true, true, 1); table.bind_property("active-character", this, "active-character", BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL); table.bind_property("active-character", details, "active-character", BindingFlags.SYNC_CREATE); notify["show-details"].connect(() => { if (show_details) details.show(); else details.hide(); }); } public override void show () { table.show(); scroll.show(); if (show_details) details.show(); base.show(); return; } protected override void set_preview_size_internal (double new_size) { _font_desc.set_size((int) (new_size * Pango.SCALE)); table.font_desc = _font_desc; return; } } } master-0.7.3/lib/UX/Controls/000077500000000000000000000000001300074171200157145ustar00rootroot00000000000000master-0.7.3/lib/UX/Controls/BaseControls.vala000066400000000000000000000064651300074171200211720ustar00rootroot00000000000000/* CollectionControls.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { /** * BaseControls: * * Base class for controls that allow adding or removing. * By default includes add/remove buttons packed at start of @box * * Is actually a #Gtk.Eventbox, because applying styles to #Gtk.Box and its * contents does not actually work at this point * Use get_style_context().add_class() to blend these in a lot of places * * ---------------------------------------------------------------------- * | + - | * ---------------------------------------------------------------------- */ public class BaseControls : Gtk.EventBox { /** * BaseControls::add_selected: * * Emitted when @add_button has been clicked */ public signal void add_selected (); /** * BaseControls::remove_selected: * * Emitted when @remove_button is clicked */ public signal void remove_selected (); /** * BaseControls:box: * * #Gtk.Box */ public Gtk.Box box { get; protected set; } /** * BaseControls:add_button: * * #Gtk.Button */ public Gtk.Button add_button { get; protected set; } /** * BaseControls:remove_button: * * #Gtk.Button */ public Gtk.Button remove_button { get; protected set; } construct { box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 2); box.border_width = 2; set_size_request(0, 0); add_button = new Gtk.Button(); add_button.set_image(new Gtk.Image.from_icon_name("list-add-symbolic", Gtk.IconSize.MENU)); remove_button = new Gtk.Button(); remove_button.set_image(new Gtk.Image.from_icon_name("list-remove-symbolic", Gtk.IconSize.MENU)); box.pack_start(add_button, false, false, 1); box.pack_start(remove_button, false, false, 1); set_default_button_relief(box); add(box); add_button.clicked.connect((w) => { add_selected(); }); remove_button.clicked.connect(() => { remove_selected(); }); } /** * {@inheritDoc} */ public override void show () { add_button.show(); remove_button.show(); box.show(); base.show(); return; } } } master-0.7.3/lib/UX/Controls/CollectionControls.vala000077500000000000000000000023101300074171200223770ustar00rootroot00000000000000/* CollectionControls.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { /** * {@inheritDoc} */ public class CollectionControls : BaseControls { public CollectionControls () { add_button.set_tooltip_text(_("Add new collection")); remove_button.set_tooltip_text(_("Remove selected collection")); get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); } } } master-0.7.3/lib/UX/Controls/FontListControls.vala000077500000000000000000000065471300074171200220660ustar00rootroot00000000000000/* FontListControls.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { /** * {@inheritDoc} */ public class FontListControls : BaseControls { /** * FontListControls::expand_all: * * Emitted when the expand_button is clicked */ public signal void expand_all (bool expand); public bool expanded { get; private set; } public Gtk.Button expand_button { get; private set; } public Gtk.SearchEntry entry { get; private set; } Gtk.Arrow arrow; public FontListControls () { Object(name: "FontListControls", margin: 1); remove_button.set_tooltip_text(_("Remove selected font from collection")); expand_button = new Gtk.Button(); arrow = new Gtk.Arrow(Gtk.ArrowType.RIGHT, Gtk.ShadowType.ETCHED_IN); expand_button.add(arrow); expand_button.set_tooltip_text(_("Expand all")); entry = new Gtk.SearchEntry(); entry.set_size_request(0, 0); entry.margin_end = MINIMUM_MARGIN_SIZE; entry.placeholder_text = _("Search Families..."); box.pack_end(entry, false, false, 0); box.pack_start(expand_button, false, false, 0); box.reorder_child(expand_button, 0); set_default_button_relief(box); get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); get_style_context().add_class(name); set_size_request(0, 0); expand_button.clicked.connect((w) => { expanded = !expanded; expand_all(expanded); expand_button.set_tooltip_text(expanded ? _("Collapse all") : _("Expand all")); if (expanded) arrow.set(Gtk.ArrowType.DOWN, Gtk.ShadowType.ETCHED_IN); else arrow.set(Gtk.ArrowType.RIGHT, Gtk.ShadowType.ETCHED_IN); }); } /** * {@inheritDoc} */ public override void show () { entry.show(); arrow.show(); expand_button.show(); base.show(); add_button.hide(); return; } /** * set_remove_sensitivity: * * @sensitive #bool indicating whether remove function is available */ public void set_remove_sensitivity (bool sensitive) { remove_button.set_sensitive(sensitive); remove_button.set_has_tooltip(sensitive); remove_button.opacity = sensitive ? 1.0 : 0.1; return; } } } master-0.7.3/lib/UX/Controls/PreviewControls.vala000077500000000000000000000130201300074171200217250ustar00rootroot00000000000000/* PreviewControls.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { /** * PreviewControls: * * Toolbar providing controls to justify, edit and reset preview text. * * ------------------------------------------------------------------- * | | * | justify controls edit reset | * | | * ------------------------------------------------------------------- */ public class PreviewControls : Gtk.EventBox { /** * PreviewControls::justification_set: * * Emitted when the user toggles justification */ public signal void justification_set (Gtk.Justification justification); /** * PreviewControls::editing: * * Emitted when editing mode has changed. */ public signal void editing (bool enabled); /** * PreviewControls::on_clear_clicked: * * Emitted when user has requested text be reset to default */ public signal void on_clear_clicked (); /** * PreviewControls:clear_is_sensitive: * * Whether reset function is available. */ public bool clear_is_sensitive { get { return clear.get_sensitive(); } set { clear.set_sensitive(value); } } Gtk.Box box; Gtk.Button clear; Gtk.ToggleButton edit; Gtk.RadioButton justify_left; Gtk.RadioButton justify_center; Gtk.RadioButton justify_fill; Gtk.RadioButton justify_right; construct { box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 2); box.border_width = 1; justify_left = new Gtk.RadioButton(null); justify_center = new Gtk.RadioButton.from_widget(justify_left); justify_fill = new Gtk.RadioButton.from_widget(justify_left); justify_right = new Gtk.RadioButton.from_widget(justify_left); edit = new Gtk.ToggleButton(); edit.set_image(new Gtk.Image.from_icon_name("insert-text-symbolic", Gtk.IconSize.MENU)); edit.set_tooltip_text(_("Edit preview text")); clear = new Gtk.Button(); clear.set_image(new Gtk.Image.from_icon_name("edit-undo-symbolic", Gtk.IconSize.MENU)); clear.set_tooltip_text(_("Undo changes")); edit.relief = Gtk.ReliefStyle.NONE; clear.relief = Gtk.ReliefStyle.NONE; Gtk.RadioButton [] buttons = { justify_left, justify_center, justify_fill, justify_right }; string [] icons = { "format-justify-left-symbolic", "format-justify-center-symbolic", "format-justify-fill-symbolic", "format-justify-right-symbolic" }; string [] tooltips = { _("Left Aligned"), _("Centered"), _("Fill"), _("Right Aligned") }; for (int i = 0; i < buttons.length; i++) { var button = buttons[i]; button.relief = Gtk.ReliefStyle.NONE; ((Gtk.ToggleButton) button).draw_indicator = false; button.get_style_context().add_class(Gtk.STYLE_CLASS_LINKED); button.set_image(new Gtk.Image.from_icon_name(icons[i], Gtk.IconSize.MENU)); button.set_tooltip_text(tooltips[i]); box.pack_start(button, false, false, 0); } box.pack_end(clear, false, false, 0); box.pack_end(edit, false, false, 0); get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); add(box); justify_center.active = true; edit.active = false; clear.sensitive = false; connect_signals(); } /** * {@inheritDoc} */ public override void show () { clear.show(); edit.show(); justify_left.show(); justify_center.show(); justify_fill.show(); justify_right.show(); box.show(); base.show(); return; } void connect_signals () { justify_left.toggled.connect(() => { justification_set(Gtk.Justification.LEFT); }); justify_center.toggled.connect(() => { justification_set(Gtk.Justification.CENTER); }); justify_fill.toggled.connect(() => { justification_set(Gtk.Justification.FILL); }); justify_right.toggled.connect(() => { justification_set(Gtk.Justification.RIGHT); }); clear.clicked.connect(() => { on_clear_clicked(); }); edit.toggled.connect(() => { editing(edit.get_active()); }); return; } } } master-0.7.3/lib/UX/FontConfig/000077500000000000000000000000001300074171200161455ustar00rootroot00000000000000master-0.7.3/lib/UX/FontConfig/Controls.vala000066400000000000000000000063631300074171200206250ustar00rootroot00000000000000/* Controls.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /** * Controls: * * #Gtk.Actionbar containing a save and discard button along with a notice * informing the user that changes may not take effect immediately. * Intended for use in dialogs which generate Fontconfig configuration files. * * ----------------------------------------------------------------------- * | | * | Discard note Save | * | | * ----------------------------------------------------------------------- */ public class Controls : Gtk.ActionBar { /** * Controls::save_selected: * * Emitted when the user clicks Save */ public signal void save_selected (); /** * Controls::discard_selected: * * Emitted when the user clicks Discard */ public signal void discard_selected (); /** * Controls:note: * * Informational notice displayed between discard and save buttons. */ public Gtk.Label note { get; private set; } Gtk.Button save; Gtk.Button discard; public Controls () { save = new Gtk.Button.with_label(_("Save")); save.get_style_context().add_class(Gtk.STYLE_CLASS_SUGGESTED_ACTION); discard = new Gtk.Button.with_label(_("Discard")); discard.get_style_context().add_class(Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); note = new Gtk.Label(_("Running applications may require a restart to reflect any changes.")); note.opacity = 0.75; note.wrap = true; note.justify = Gtk.Justification.CENTER; pack_end(save); pack_start(discard); set_center_widget(note); connect_signals(); } /** * {@inheritDoc} */ public override void show () { save.show(); discard.show(); note.show(); base.show(); return; } void connect_signals () { save.clicked.connect(() => { save_selected(); }); discard.clicked.connect(() => { discard_selected(); }); return; } } } master-0.7.3/lib/UX/FontConfig/DisplayPropertiesPane.vala000066400000000000000000000062051300074171200233030ustar00rootroot00000000000000/* DisplayPropertiesPane.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /** * DisplayPropertiesPane: * * Preference pane allowing configuration of display related Fontconfig properties */ public class DisplayPropertiesPane : Gtk.ScrolledWindow { public DisplayProperties properties { get; private set; } Gtk.Grid grid; LabeledSpinButton dpi; LabeledSpinButton scale; OptionScale lcdfilter; SubpixelGeometry spg; public DisplayPropertiesPane () { grid = new Gtk.Grid(); properties = new DisplayProperties(); dpi = new LabeledSpinButton(_("Target DPI"), 0, 1000, 1); scale = new LabeledSpinButton(_("Scale factor"), 0, 1000, 0.1); string [] filters = {}; for (int i = 0; i < 4; i++) filters += ((LCDFilter) i).to_string(); lcdfilter = new OptionScale(_("LCD Filter"), filters); spg = new SubpixelGeometry(); pack_components(); bind_properties(); grid.foreach((w) => { w.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); }); grid.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); set_size_request(480, 420); } /** * {@inheritDoc} */ public override void show () { dpi.show(); scale.show(); lcdfilter.show(); spg.show(); grid.show(); base.show(); } void pack_components () { grid.attach(dpi, 0, 0, 2, 1); grid.attach(scale, 0, 1, 2, 1); grid.attach(lcdfilter, 0, 2, 2, 1); grid.attach(spg, 0, 3, 2, 1); add(grid); return; } void bind_properties () { properties.bind_property("dpi", dpi, "value", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); properties.bind_property("scale", scale, "value", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); properties.bind_property("lcdfilter", lcdfilter, "value", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); properties.bind_property("rgba", spg, "rgba", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); return; } } } master-0.7.3/lib/UX/FontConfig/FontPropertiesPane.vala000066400000000000000000000142741300074171200226110ustar00rootroot00000000000000/* FontPropertiesPane.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /** * FontPropertiesPane: * * Preference pane allowing configuration of FontConfig rendering properties */ public class FontPropertiesPane : Gtk.ScrolledWindow { /** * FontPropertiesPane:properties: * * #FontConfig.FontProperties in use */ public FontProperties properties { get; private set; } Gtk.Grid grid; Gtk.Revealer hinting_options; Gtk.Grid hinting_options_grid; Gtk.Expander expander; Gtk.CheckButton autohint; OptionScale hintstyle; LabeledSwitch antialias; LabeledSwitch hinting; LabeledSwitch embeddedbitmap; SizeOptions size_options; public FontPropertiesPane () { grid = new Gtk.Grid(); properties = new FontProperties(); antialias = new LabeledSwitch(_("Antialias")); hinting = new LabeledSwitch(_("Hinting")); autohint = new Gtk.CheckButton.with_label(_("Enable Autohinter")); autohint.margin = DEFAULT_MARGIN_SIZE; hinting_options = new Gtk.Revealer(); hinting_options_grid = new Gtk.Grid(); hinting_options_grid.margin = DEFAULT_MARGIN_SIZE + (DEFAULT_MARGIN_SIZE / 2); string [] hintstyles = {}; for (int i = 0; i < 4; i++) hintstyles += ((HintStyle) i).to_string(); hintstyle = new OptionScale(_("Hinting Style"), hintstyles); embeddedbitmap = new LabeledSwitch(_("Use Embedded Bitmaps")); size_options = new SizeOptions(); expander = new Gtk.Expander(_(" Size Restrictions ")); expander.notify["expanded"].connect(() => { if (expander.expanded) expander.set_label(_(" Apply settings to point sizes ")); else expander.set_label(_(" Size Restrictions ")); }); bind_properties(); pack_components(); grid.foreach((w) => { w.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); }); grid.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); set_size_request(450, 450); } /** * {@inheritDoc} */ public override void show () { antialias.show(); hinting.show(); autohint.show(); hintstyle.show(); hinting_options_grid.show(); hinting_options.show(); embeddedbitmap.show(); size_options.show(); expander.show(); grid.show(); base.show(); update_sensitivity(); return; } void pack_components () { grid.attach(antialias, 0, 0, 2, 1); grid.attach(hinting, 0, 1, 2, 1); hinting_options_grid.attach(autohint, 0, 0, 2, 1); hinting_options_grid.attach(hintstyle, 0, 1, 2, 1); hinting_options.add(hinting_options_grid); grid.attach(hinting_options, 0, 2, 2, 1); grid.attach(embeddedbitmap, 0, 3, 2, 1); expander.add(size_options); grid.attach(expander, 0, 4, 2, 1); add(grid); return; } void bind_properties () { properties.bind_property("antialias", antialias.toggle, "active", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); properties.bind_property("hinting", hinting.toggle, "active", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); properties.bind_property("autohint", autohint, "active", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); properties.bind_property("hintstyle", hintstyle.adjustment, "value", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); properties.bind_property("embeddedbitmap", embeddedbitmap.toggle, "active", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); properties.bind_property("less", size_options.less, "value", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); properties.bind_property("more", size_options.more, "value", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); hinting.toggle.bind_property("active", hinting_options, "reveal-child", BindingFlags.DEFAULT | BindingFlags.SYNC_CREATE); properties.notify["font"].connect(() => { update_sensitivity(); }); properties.notify["family"].connect(() => { update_sensitivity(); }); return; } void update_sensitivity () { if (properties.font == null && properties.family == null) expander.hide(); else expander.show(); return; } class SizeOptions : Gtk.Grid { public LabeledSpinButton less { get; private set; } public LabeledSpinButton more { get; private set; } public SizeOptions () { less = new LabeledSpinButton(_("Smaller than"), 0, 96, 0.5); more = new LabeledSpinButton(_("Larger than"), 0, 96, 0.5); attach(less, 0, 0, 1, 1); attach(more, 1, 0, 1, 1); } public override void show () { less.show(); more.show(); base.show(); } } } } master-0.7.3/lib/UX/FontConfig/FontSourceList.vala000077500000000000000000000206661300074171200217520ustar00rootroot00000000000000/* FontSourceList.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { const string w1 = _("Font Sources"); const string w2 = _("Easily add or preview fonts without actually installing them."); const string w3 = _("To add a new source simply drag a folder onto this area or click the add button in the toolbar."); const string welcome_tmpl = "%s\n\n\n%s\n\n\n\n%s"; /** * FontSourceRow: * * Widget representing a #FontConfig.Source and its current status. * Intended for use in a #Gtk.Listbox */ public class FontSourceRow : Gtk.Box { public weak FontConfig.Source source { get; set; } public Gtk.Image image { get; private set; } public LabeledSwitch toggle { get; private set; } public FontSourceRow (FontConfig.Source source) { Object(name: "FontManagerFontSourceRow", source: source, orientation: Gtk.Orientation.HORIZONTAL); image = new Gtk.Image(); image.expand = false; image.margin = DEFAULT_MARGIN_SIZE / 4; image.margin_start = DEFAULT_MARGIN_SIZE; toggle = new LabeledSwitch(); source.bind_property("active", toggle.toggle, "active", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); source.bind_property("available", toggle.toggle, "sensitive", BindingFlags.SYNC_CREATE); source.bind_property("icon-name", image, "icon-name", BindingFlags.SYNC_CREATE); source.bind_property("name", toggle.label, "label", BindingFlags.SYNC_CREATE); toggle.dim_label.set_text(source.get_dirname()); pack_start(image, false, false, 6); pack_end(toggle, true, true, 6); } /** * {@inheritDoc} */ public override void show () { image.show(); toggle.show(); base.show(); return; } } /** * FontSourceList: */ public class FontSourceList : Gtk.ScrolledWindow { /** * FontSourceList::changed: * * Emitted when a row has been added or removed */ public signal void changed (); /** * FontSourceList::row_selected: * * Emitted when a row has been selected */ public signal void row_selected (Gtk.ListBoxRow? row); /** * FontSourceList:sources: * * #FontConfig.Sources to display */ public FontConfig.Sources sources { get { return _sources; } set { _sources = value; _sources.changed.connect(() => { changed(); }); update(); } } /** * FontSourceList:first_row: */ Gtk.ListBoxRow first_row { get { return list.get_row_at_index(0); } } Gtk.ListBox list; Gtk.Label welcome; FontConfig.Sources _sources; construct { string welcome_message = welcome_tmpl.printf(w1, w2, w3); welcome = new WelcomeLabel(welcome_message); list = new Gtk.ListBox(); list.set_placeholder(welcome); add(list); get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); list.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); Gtk.drag_dest_set(this, Gtk.DestDefaults.ALL, AppDragTargets, AppDragActions); list.row_selected.connect((r) => { row_selected(r); }); changed.connect(() => { update(); }); } public FontSourceList () { Object(name: "FontSourceList"); } /** * update: * * Updates list to match sources */ public void update () { /* Simply destroy current list, it should never be long enough to be an issue */ while (first_row != null) ((Gtk.Widget) first_row).destroy(); foreach (var s in _sources) { var w = new FontSourceRow(s); list.add(w); w.show(); } list.queue_draw(); return; } /** * {@inheritDoc} */ public override void show () { welcome.show(); list.show(); update(); base.show(); return; } void add_source_from_uri (string uri) { var file = File.new_for_uri(uri); var filetype = file.query_file_type(FileQueryInfoFlags.NONE); if (filetype != FileType.DIRECTORY && filetype != FileType.MOUNTABLE) { warning("Adding individual font files is not supported"); return; } var path = file.get_path(); _sources.add_from_path(path); _sources.save(); debug("Added new font source : %s", path); changed(); return; } void add_sources(string [] arr) { foreach (var uri in arr) add_source_from_uri(uri); return; } /** * on_add_source: * * Displays a file selection dialog where source folders can be added */ public void on_add_source () { string? [] arr = { }; var dialog = new Gtk.FileChooserDialog(_("Select source folders"), (Gtk.Window) this.get_toplevel(), Gtk.FileChooserAction.SELECT_FOLDER, _("_Cancel"), Gtk.ResponseType.CANCEL, _("_Open"), Gtk.ResponseType.ACCEPT, null); dialog.set_select_multiple(true); if (dialog.run() == Gtk.ResponseType.ACCEPT) { dialog.hide(); foreach (var uri in dialog.get_uris()) arr += uri; } dialog.destroy(); if (arr.length > 0) add_sources(arr); return; } /** * on_remove_source: * * Removes currently selected source */ public void on_remove_source () { var selected_row = list.get_selected_row(); if (selected_row == null) return; var selected_source = ((FontSourceRow) selected_row.get_child()).source; if (!_sources.remove(selected_source)) return; _sources.save(); debug("Removed font source : %s", selected_source.path); changed(); return; } public override void drag_data_received (Gdk.DragContext context, int x, int y, Gtk.SelectionData selection_data, uint info, uint time) { switch (info) { case DragTargetType.EXTERNAL: add_sources(selection_data.get_uris()); break; default: warning("Unsupported drag target."); return; } return; } } } master-0.7.3/lib/UX/FontConfig/PreferencePane.vala000066400000000000000000000045331300074171200217010ustar00rootroot00000000000000/* PreferencePane.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /** * PreferencePane: * * Base class for dialogs which generate Fontconfig configuration files. * It features #Controls at the bottom which allow the user to save or * discard the current configuration and a #Gtk.Infobar at the top * to inform the user that the requested change was completed. */ public class PreferencePane : Gtk.Box { protected Gtk.Label message; protected Gtk.InfoBar infobar; protected FontConfig.Controls controls; construct { orientation = Gtk.Orientation.VERTICAL; controls = new FontConfig.Controls(); infobar = new Gtk.InfoBar(); infobar.message_type = Gtk.MessageType.INFO; message = new Gtk.Label(null); infobar.get_content_area().add(message); pack_start(infobar, false, false, 0); pack_end(controls, false, false, 0); infobar.response.connect((id) => { if (id == Gtk.ResponseType.CLOSE) infobar.hide(); }); } public override void show () { message.show(); controls.show(); base.show(); return; } protected virtual void show_message (string m) { message.set_markup("%s".printf(m)); infobar.show(); Timeout.add_seconds(3, () => { infobar.hide(); return false; }); return; } } } master-0.7.3/lib/UX/FontConfig/SubpixelGeometry.vala000066400000000000000000000132041300074171200223210ustar00rootroot00000000000000/* SubpixelGeometry.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /** * SubpixelGeometry: * * https://en.wikipedia.org/wiki/Subpixel_rendering * * Widget allowing user to select pixel layout. */ public class SubpixelGeometry : Gtk.Box { public int rgba { get { return _rgba; } set { if (value < 0 || value >= options.size) return; _rgba = value; options[_rgba].active = true; } } int _rgba; Gtk.Label label; Gtk.ButtonBox box; Gee.ArrayList options; public SubpixelGeometry () { Object(name: "SubpixelGeometry", margin: DEFAULT_MARGIN_SIZE, opacity: 0.75, orientation: Gtk.Orientation.VERTICAL); get_style_context().add_class(Gtk.STYLE_CLASS_ENTRY); label = new Gtk.Label(_("Subpixel Geometry")); label.halign = Gtk.Align.CENTER; label.margin = DEFAULT_MARGIN_SIZE / 2; pack_start(label, false, true, 6); options = new Gee.ArrayList (); box = new Gtk.ButtonBox(Gtk.Orientation.HORIZONTAL); for (int i = 0; i < 5; i++) { if (i == 0) options.add(new Gtk.RadioButton(null)); else options.add(new Gtk.RadioButton.from_widget(options[0])); var button = options[i]; var val = (FontConfig.SubpixelOrder) i; var icon = new SubpixelGeometryIcon(val); button.add(icon); icon.show(); button.set_tooltip_text(val.to_string()); button.toggled.connect(() => { if (button.active) rgba = (int) val; }); box.pack_start(button, true, true, 0); } foreach (var widget in options) widget.margin = DEFAULT_MARGIN_SIZE / 4; pack_start(box, true, true, 6); } /** * {@inheritDoc} */ public override void show () { foreach (var widget in options) widget.show(); label.show(); box.show(); base.show(); return; } } /** * SubpixelGeometryIcon: * * Icon representing subpixel layout. */ public class SubpixelGeometryIcon : Gtk.Box { int _size; Gtk.Label c1 = new Gtk.Label(null); Gtk.Label c2 = new Gtk.Label(null); Gtk.Label c3 = new Gtk.Label(null); Gtk.Label [] labels; construct { labels = { c1, c2, c3 }; } public SubpixelGeometryIcon (FontConfig.SubpixelOrder rgba, int size = 36) { Object(name: "SubpixelGeometryIcon", margin: 6, opacity: 1.0, homogeneous: true, orientation: Gtk.Orientation.HORIZONTAL, halign: Gtk.Align.CENTER, valign: Gtk.Align.CENTER); _size = size; string []? color = null; if (rgba == FontConfig.SubpixelOrder.RGB || rgba == FontConfig.SubpixelOrder.VRGB) color = { "red", "green", "blue" }; else if (rgba == FontConfig.SubpixelOrder.BGR || rgba == FontConfig.SubpixelOrder.VBGR) color = { "blue", "green", "red" }; else color = { "gray", "gray", "gray" }; if (rgba == FontConfig.SubpixelOrder.VRGB || rgba == FontConfig.SubpixelOrder.VBGR) orientation = Gtk.Orientation.VERTICAL; for (int i = 0; i < labels.length; i++) { pack_start(labels[i], true, true, 0); /* @color: defined in data/FontManager.css */ labels[i].get_style_context().add_class(color[i]); } } /** * {@inheritDoc} */ public override void show () { foreach (var label in labels) label.show(); base.show(); } /* Used to force square widget */ public override void get_preferred_width (out int minimum_size, out int natural_size) { minimum_size = natural_size = _size; return; } public override void get_preferred_height (out int minimum_size, out int natural_size) { minimum_size = natural_size = _size; return; } public override void get_preferred_height_for_width (int width, out int minimum_height, out int natural_height) { minimum_height = natural_height = width; return; } public override void get_preferred_width_for_height (int height, out int minimum_width, out int natural_width) { minimum_width = natural_width = height; return; } } } master-0.7.3/lib/UX/FontConfig/Substitute.vala000066400000000000000000000102241300074171200211640ustar00rootroot00000000000000/* Substitute.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontConfig { /** * Substitute: * * Single line widget representing a substitute font family * in a Fontconfig entry. */ public class Substitute : Gtk.Grid { /** * Substitute::changed: * * Emitted when a selection has changed */ public signal void changed (); /** * Substitute::removed: * * Emitted when user requests removal of this Substitute */ public signal void removed (); /** * Substitute:priority: * * prefer, accept, or default */ public string priority { get { return _priority; } } /** * Substitute:family: * * Name of replacement family */ public string? family { get { return _family; } } string? _priority; string? _family; Gtk.Button close; Gtk.ComboBoxText type; Gtk.ComboBoxText target; construct { type = new Gtk.ComboBoxText(); type.append_text(_("prefer")); type.append_text(_("accept")); type.append_text(_("default")); type.set_active(0); target = new Gtk.ComboBoxText.with_entry(); close = new Gtk.Button(); close.set_image(new Gtk.Image.from_icon_name("close-symbolic", Gtk.IconSize.MENU)); close.get_style_context().add_class("circular-button"); close.expand = false; attach(type, 0, 0, 2, 1); attach(target, 3, 0, 2, 1); attach(close, 5, 0, 1, 1); connect_signals(); } /** * @families string [] of available font family names */ public Substitute (string [] families) { Object(name: "Substitute", margin: 0); foreach (var family in families) target.append_text(family); } /** * {@inheritDoc} */ public override void show () { type.show(); target.show(); close.show(); base.show(); } void connect_signals () { type.format_entry_text.connect((p) => { Gtk.TreeIter iter; Value val; type.get_model().get_iter_from_string(out iter, p); type.get_model().get_value(iter, 0, out val); return ("<%s>".printf((string) val)); }); target.format_entry_text.connect((p) => { Gtk.TreeIter iter; Value val; target.get_model().get_iter_from_string(out iter, p); target.get_model().get_value(iter, 0, out val); return ("<%s>".printf((string) val)); }); type.changed.connect(() => { _priority = type.get_active_text(); changed(); return; }); target.changed.connect(() => { _family = target.get_active_text(); changed(); return; }); close.clicked.connect(() => { removed(); return; }); return; } } } master-0.7.3/lib/UX/Metadata/000077500000000000000000000000001300074171200156315ustar00rootroot00000000000000master-0.7.3/lib/UX/Metadata/Description.vala000066400000000000000000000040131300074171200207570ustar00rootroot00000000000000/* Description.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace Metadata { public class Description : StaticTextView { public Description () { base(null); hexpand = true; view.margin = DEFAULT_MARGIN_SIZE / 2; view.justification = Gtk.Justification.LEFT; view.pixels_above_lines = 1; set_size_request(0, 0); get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); expand = true; } void reset () { buffer.set_text(""); return; } public void update (FontData? font_data) { this.reset(); if (font_data == null || font_data.fontinfo == null) return; var fontinfo = font_data.fontinfo; if (fontinfo.copyright != null) view.buffer.set_text("%s".printf(fontinfo.copyright)); if (fontinfo.description != null && fontinfo.description.length > 10) view.buffer.set_text("%s\n\n%s".printf(get_buffer_text(), fontinfo.description)); return; } } } } master-0.7.3/lib/UX/Metadata/License.vala000066400000000000000000000073051300074171200200650ustar00rootroot00000000000000/* License.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace Metadata { public class License : Gtk.Overlay { Gtk.Grid grid; Gtk.EventBox blend; Gtk.LinkButton link; StaticTextView view; WelcomeLabel notice; public License () { grid = new Gtk.Grid(); view = new StaticTextView(null); view.view.margin = DEFAULT_MARGIN_SIZE; view.view.pixels_above_lines = 1; var tmpl = "%s"; notice = new WelcomeLabel(tmpl.printf(_("File does not contain license information."))); notice.opacity = 0.5; link = new Gtk.LinkButton(""); link.margin = DEFAULT_MARGIN_SIZE / 4; link.set_label(""); link.halign = Gtk.Align.CENTER; link.valign = Gtk.Align.CENTER; blend = new Gtk.EventBox(); blend.add(link); blend.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); view.expand = true; grid.attach(view, 0, 0, 1, 3); grid.attach(blend, 0, 3, 1 ,1); grid.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); add(grid); add_overlay(notice); } public override void show () { link.show(); view.show(); notice.show(); grid.show(); blend.show(); base.show(); this.reset(); return; } void reset () { view.buffer.set_text(""); link.set_uri(""); link.set_label(""); blend.hide(); view.hide(); notice.show(); return; } public void update (FontData? font_data) { this.reset(); if (font_data == null || font_data.fontinfo == null) return; var fontinfo = font_data.fontinfo; if (fontinfo.license_data == null && fontinfo.license_url == null) return; if (fontinfo.license_url != null) { link.set_uri(fontinfo.license_url); link.set_label(fontinfo.license_url); blend.show(); } bool license_data = (fontinfo.license_data != null); if (license_data) view.buffer.set_text("\n%s\n".printf(fontinfo.license_data)); view.visible = license_data; link.expand = !license_data; if (!license_data && fontinfo.license_url == null) notice.show(); else notice.hide(); return; } } } } master-0.7.3/lib/UX/Metadata/Properties.vala000066400000000000000000000142461300074171200206410ustar00rootroot00000000000000/* Properties.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace Metadata { public class Properties : Gtk.Grid { Gtk.Label psname; Gtk.Label weight; Gtk.Label slant; Gtk.Label width; Gtk.Label spacing; Gtk.Label version; Gtk.Label vendor; Gtk.Grid prop_grid; Gtk.Separator separator; Description description; string [] labels = { _("PostScript Name"), _("Weight"), _("Slant"), _("Width"), _("Spacing"), _("Version"), _("Vendor") }; public Properties () { expand = true; description = new Description(); separator = new Gtk.Separator(Gtk.Orientation.VERTICAL); separator.set_size_request(1, -1); separator.margin = DEFAULT_MARGIN_SIZE / 4; separator.margin_top = separator.margin_bottom = DEFAULT_MARGIN_SIZE / 2; separator.opacity = 0.5; psname = new Gtk.Label("psname"); weight = new Gtk.Label("weight"); slant = new Gtk.Label("slant"); width = new Gtk.Label("width"); spacing = new Gtk.Label("spacing"); version = new Gtk.Label("version"); vendor = new Gtk.Label("vendor"); prop_grid = create_prop_grid(); attach(prop_grid, 0, 0, 1, 1); attach(separator, 2, 0, 1, 7); attach(description, 3, 0, 3, 7); get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); } public override void show () { prop_grid.show(); separator.show(); description.show(); base.show(); return; } void reset () { weight.set_text(""); slant.set_text(""); width.set_text(""); spacing.set_text(""); version.set_text(""); vendor.set_text(""); return; } public void update (FontData? font_data) { description.update(font_data); this.reset(); if (font_data == null || font_data.fontinfo == null) return; var fontinfo = font_data.fontinfo; var fcfont = font_data.font; psname.set_text(fontinfo.psname); string? _weight = ((FontConfig.Weight) fcfont.weight).to_string(); weight.set_text(_weight == null ? "Regular" : _weight); string? _slant = ((FontConfig.Slant) fcfont.slant).to_string(); if (_slant == null) _slant = "Normal"; slant.set_text(_slant); string? _width = ((FontConfig.Width) fcfont.width).to_string(); if (_width == null) _width = "Normal"; width.set_text(_width); string? _spacing = ((FontConfig.Spacing) fcfont.spacing).to_string(); if (_spacing == null) _spacing = "Proportional"; spacing.set_text(_spacing); version.set_text(fontinfo.version); vendor.set_text(fontinfo.vendor); if (fontinfo.vendor == "Unknown Vendor") { prop_grid.get_child_at(0, 6).hide(); vendor.hide(); } else { vendor.show(); prop_grid.get_child_at(0, 6).show(); } return; } Gtk.Grid create_prop_grid () { var grid = new Gtk.Grid(); grid.expand = false; Gtk.Label [] values = { psname, weight, slant, width, spacing, version, vendor }; for (int i = 0; i < labels.length; i++) { var widget = new Gtk.Label(labels[i]); widget.sensitive = false; widget.opacity = 0.75; grid.attach(widget, 0, i, 1, 1); widget.halign = Gtk.Align.END; widget.margin = DEFAULT_MARGIN_SIZE / 2; widget.margin_start = DEFAULT_MARGIN_SIZE; widget.expand = false; grid.attach(values[i], 1, i, 1, 1); values[i].halign = Gtk.Align.START; values[i].expand = false; values[i].margin = DEFAULT_MARGIN_SIZE / 2; values[i].margin_end = DEFAULT_MARGIN_SIZE; if (i == 0) { widget.margin_top = DEFAULT_MARGIN_SIZE; values[i].margin_top = DEFAULT_MARGIN_SIZE; } else if (i == labels.length - 1) { widget.margin_bottom = DEFAULT_MARGIN_SIZE; values[i].margin_bottom = DEFAULT_MARGIN_SIZE; } widget.show(); values[i].show(); } return grid; } } } } master-0.7.3/lib/UX/Metadata/Title.vala000066400000000000000000000077761300074171200176000ustar00rootroot00000000000000/* Metadata.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ const string font_desc_templ = "%s %s"; namespace FontManager { namespace Metadata { public class Title : Gtk.Grid { struct FontTypeEntry { public string name; public string tooltip; public string url; public FontTypeEntry (string name, string tooltip, string url) { this.name = name; this.tooltip = tooltip; this.url = url; } } class TypeInfoCache : Object { FontTypeEntry [] types = { FontTypeEntry("null", "", ""), FontTypeEntry("opentype", _("OpenType Font"), "http://wikipedia.org/wiki/OpenType"), FontTypeEntry("truetype", _("TrueType Font"), "http://wikipedia.org/wiki/TrueType"), FontTypeEntry("type1", _("PostScript Type 1 Font"), "http://wikipedia.org/wiki/Type_1_Font#Type_1"), }; public new FontTypeEntry get (string key) { var _key = key.down().replace(" ", ""); foreach (var entry in types) if (entry.name == _key) return entry; return types[0]; } public void update (Gtk.Image icon, string key) { var entry = this[key]; icon.set_from_icon_name(entry.name, Gtk.IconSize.DIALOG); icon.set_tooltip_text(entry.tooltip); } } Gtk.Label font; Gtk.Image type_icon; TypeInfoCache type_info_cache; construct { font = new Gtk.Label(null); font.hexpand = true; font.halign = Gtk.Align.START; type_info_cache = new TypeInfoCache(); type_icon = new Gtk.Image(); reset(); attach(font, 0, 0, 1, 1); attach(type_icon, 1, 0, 1, 1); get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); get_style_context().add_class("MetadataTitle"); } public override void show () { font.show(); type_icon.show(); base.show(); return; } void reset () { font.set_text(""); type_info_cache.update(type_icon, "null"); return; } public virtual void update (string? family, string? style, string? filetype) { this.reset(); if (family == null && style == null) { var font_desc = font_desc_templ.printf(_("No file selected"), _("Or unsupported filetype.")); font.set_markup(font_desc); return; } var font_desc = font_desc_templ.printf(family, style); font.set_markup(font_desc); type_info_cache.update(type_icon, filetype); return; } } } } master-0.7.3/lib/UX/Models/000077500000000000000000000000001300074171200153345ustar00rootroot00000000000000master-0.7.3/lib/UX/Models/CategoryModel.vala000077500000000000000000000175271300074171200207560ustar00rootroot00000000000000/* CategoryModel.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class CategoryModel : Gtk.TreeStore { Gee.ArrayList categories; Database db; construct { set_column_types({typeof(Object), typeof(string), typeof(string), typeof(string), typeof(int), typeof(bool)}); } void init_categories () { if (categories != null) return; try { db = get_database(); categories = get_default_categories(db); } catch (Error e) { critical("Failed to initialize database!"); critical("Failed to update categories!"); } return; } void append_category (Category filter) { filter.update(db); Gtk.TreeIter iter; this.append(out iter, null); /* Comments are used for tooltips. */ string comment = Markup.escape_text(filter.comment); if (filter.index < 3) this.set(iter, 0, filter, 1, filter.icon, 2, filter.name, 3, comment, 4, filter.families.size, -1); else this.set(iter, 0, filter, 1, filter.icon, 2, filter.name, 3, comment, 4, filter.families.size, 5, true, -1); comment = null; foreach(var child in filter.children) { string child_comment = Markup.escape_text(child.comment); Gtk.TreeIter _iter; this.append(out _iter, iter); this.set(_iter, 0, child, 1, child.icon, 2, child.name, 3, child_comment, 4, child.families.size, -1); child_comment = null; } return; } public async void update () { clear(); init_categories(); foreach (var filter in categories) { append_category((Category) filter); Idle.add(update.callback); yield; } return; } public void update_sync () { clear(); init_categories(); foreach (var filter in categories) append_category((Category) filter); return; } } Gee.ArrayList get_default_categories (Database db) { var filters = new Gee.HashMap (); filters["All"] = new Category(_("All"), _("All Fonts"), "format-text-bold", null); filters["All"].index = 0; filters["System"] = new Category(_("System"), _("Fonts available to all users"), "computer", "owner!=0"); filters["System"].index = 1; filters["User"] = new Category(_("User"), _("Fonts available only to you"), "avatar-default", "owner=0 AND filepath LIKE \"%s%\"".printf(get_user_font_dir())); filters["User"].index = 2; filters["Panose"] = construct_panose_filter(); filters["Panose"].index = 3; filters["Spacing"] = construct_filter(db, _("Spacing"), _("Grouped by font spacing"), "spacing"); filters["Spacing"].index = 4; filters["Slant"] = construct_filter(db, _("Slant"), _("Grouped by font angle"), "slant"); filters["Slant"].index = 5; filters["Weight"] = construct_filter(db, _("Weight"), _("Grouped by font weight"), "weight"); filters["Weight"].index = 6; filters["Width"] = construct_filter(db, _("Width"), _("Grouped by font width"), "width"); filters["Width"].index = 7; filters["Filetype"] = construct_filter(db, _("Filetype"), _("Grouped by filetype"), "filetype"); filters["Filetype"].index = 8; filters["License"] = construct_filter(db, _("License"), _("Grouped by license type"), "license_type"); filters["License"].index = 9; filters["Vendor"] = construct_filter(db, _("Vendor"), _("Grouped by vendor"), "vendor"); filters["Vendor"].index = 10; filters["Unsorted"] = new Unsorted(); filters["Unsorted"].index = 11; filters["Disabled"] = new Disabled(); filters["Disabled"].index = 12; var sorted_filters = new Gee.ArrayList (); sorted_filters.add_all(filters.values); sorted_filters.sort((CompareDataFunc) sort_on_index); return sorted_filters; } Category construct_panose_filter () { var panose = new Category(_("Family Kind"), _("Only fonts which include Panose information will be grouped here."), "folder", "panose IS NOT NULL"); panose.children.add(new Category(_("Any"), _("Any"), "emblem-documents", "panose LIKE \"0:%\"")); panose.children.add(new Category(_("No Fit"), _("No Fit"), "emblem-documents", "panose LIKE \"1:%\"")); panose.children.add(new Category(_("Text and Display"), _("Text and Display"), "emblem-documents", "panose LIKE \"2:%\"")); panose.children.add(new Category(_("Script"), _("Script"), "emblem-documents", "panose LIKE \"3:%\"")); panose.children.add(new Category(_("Decorative"), _("Decorative"), "emblem-documents", "panose LIKE \"4:%\"")); panose.children.add(new Category(_("Pictorial"), _("Pictorial"), "emblem-documents", "panose LIKE \"5:%\"")); return panose; } Category construct_filter (Database db, string name, string comment, string keyword) { var filter = new Category(name, comment, "folder", null); try { add_children_from_db_results(db, filter.children, keyword); } catch (DatabaseError e) { warning("Failed to create child categories for %s", name); critical("There was an error accessing the database : %s", e.message); } return filter; } void add_children_from_db_results (Database db, Gee.ArrayList filters, string keyword) throws DatabaseError { db.execute_query("SELECT DISTINCT %s FROM Fonts ORDER BY %s;".printf(keyword, keyword)); foreach (var row in db) { if (row.column_type(0) == Sqlite.TEXT) { var type = row.column_text(0); filters.add(new Category(type, type, "emblem-documents", "%s='%s'".printf(keyword, type))); } else { string? type; var val = row.column_int(0); if (keyword == "slant") type = ((FontConfig.Slant) val).to_string(); else if (keyword == "weight") type = ((FontConfig.Weight) val).to_string(); else if (keyword == "width") type = ((FontConfig.Width) val).to_string(); else type = ((FontConfig.Spacing) val).to_string(); if (type == null) if (keyword == "slant" || keyword == "width") type = _("Normal"); /* Ignore random weights */ else if (keyword == "weight" && !((FontConfig.Weight) val).defined()) continue; else type = _("Regular"); filters.add(new Category(type, type, "emblem-documents", "%s='%i'".printf(keyword, val))); } } } } master-0.7.3/lib/UX/Models/CollectionModel.vala000077500000000000000000000104161300074171200212620ustar00rootroot00000000000000/* CollectionModel.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class CollectionModel : Gtk.TreeStore { public Collections collections { get { return groups; } set { groups = value; this.update(); } } Collections groups; construct { set_column_types({typeof(Object), typeof(string), typeof(string)}); collections = load_collections(); } public void update () { clear(); if (groups == null || groups.entries.values == null) return; var sorted = sort_groups(groups.entries.values); foreach (var group in sorted) { Gtk.TreeIter iter; this.append(out iter, null); this.set(iter, 0, group, 2, group.comment, -1); insert_children(group.children, iter); } return; } public void update_group_index () { if (groups == null || groups.entries.values == null) return; foreach (var group in groups.entries.values) group.clear_children(); /* (model, path, iter) */ this.foreach((m, p, i) => { /* Update index */ Value child; m.get_value(i, CollectionColumn.OBJECT, out child); var depth = p.get_depth(); var indices = p.get_indices(); /* This means we got an empty row, ignore this call */ if (((Collection) child) == null) { child.unset(); return false; } ((Collection) child).index = indices[depth-1]; /* Bail if this is a root node */ if (depth <= 1) { /* In case this wasn't a root node before, make it a root node */ if (!(groups.entries.has_key(((Collection) child).name))) groups.entries[((Collection) child).name] = ((Collection) child); child.unset(); return false; } /* Have a child node, need to add it to its parent */ Value parent; Gtk.TreeIter piter; m.iter_parent(out piter, i); m.get_value(piter, CollectionColumn.OBJECT, out parent); ((Collection) parent).children.add(((Collection) child)); /* In case this used to be a root node */ if (groups.entries.has_key(((Collection) child).name)) groups.entries.unset(((Collection) child).name); parent.unset(); child.unset(); return false; }); } Gee.ArrayList sort_groups (Gee.Collection groups) { var sorted = new Gee.ArrayList (); sorted.add_all(groups); sorted.sort((CompareDataFunc) sort_on_index); return sorted; } void insert_children (Gee.ArrayList groups, Gtk.TreeIter parent) { var sorted = sort_groups(groups); foreach(var child in sorted) { Gtk.TreeIter _iter; this.append(out _iter, parent); this.set(_iter, 0, child, 1, child.comment, -1); insert_children(child.children, _iter); } } } } master-0.7.3/lib/UX/Models/FontModel.vala000077500000000000000000000060731300074171200201010ustar00rootroot00000000000000/* FontModel.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public enum FontModelColumn { OBJECT, DESCRIPTION, COUNT, N_COLUMNS } public class FontModel : Gtk.TreeStore { public FontConfig.Families? families { get; set; } construct { set_column_types({typeof(Object), typeof(string), typeof(int)}); } public FontModel (FontConfig.Families? fcfamilies = null) { Object (families: fcfamilies); this.update(); } public void update (Filter? filter = null) { this.clear(); if (families == null) return; bool visible = true; Gee.HashSet contents = null; foreach(var entry in families.list()) { var family = families[entry]; if (filter != null) { if (contents == null) if (filter is Collection) contents = ((Collection) filter).get_full_contents(); else { contents = new Gee.HashSet (); contents.add_all(filter.families); } visible = (family.name in contents); } if (visible) { Gtk.TreeIter iter; this.append(out iter, null); this.set(iter, 0, family, 1, family.description, 2, family.faces.size, -1); foreach(var face in family.list_faces()) { visible = true; if (filter != null && filter is Category) if (!(face.description in ((Category) filter).descriptions)) visible = false; if (visible) { Gtk.TreeIter _iter; this.append(out _iter, iter); this.set(_iter, 0, face, 1, face.description, -1); } } } } /* Looks pointless, I know. */ if (contents != null) contents.clear(); contents = null; return; } } } master-0.7.3/lib/UX/Models/UserFontModel.vala000077500000000000000000000023531300074171200207350ustar00rootroot00000000000000/* UserFontModel.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class UserFontModel : FontModel { Category user_fonts; public UserFontModel (FontConfig.Families? families, Database db) { user_fonts = new Category("", "", "", "owner=0 AND filepath LIKE \"%s%\"".printf(get_user_font_dir())); user_fonts.update(db); this.families = families; this.update(user_fonts); } } } master-0.7.3/lib/UX/Trees/000077500000000000000000000000001300074171200151735ustar00rootroot00000000000000master-0.7.3/lib/UX/Trees/CategoryTree.vala000077500000000000000000000120271300074171200204420ustar00rootroot00000000000000/* CategoryTree.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public enum CategoryColumn { OBJECT, ICON, NAME, COMMENT, COUNT, HIDE_COUNT, N_COLUMNS } public class CategoryTree : Gtk.ScrolledWindow { public signal void selection_changed (Category filter, int category); public CategoryModel model { get { return _model; } set { _model = value; tree.set_model(_model); tree.get_selection().select_path(new Gtk.TreePath.first()); } } public string selected_iter { get; protected set; default = "0"; } public Category? selected_filter { get; protected set; default = null; } public BaseTreeView tree { get; protected set; } public Gtk.CellRendererText renderer { get; protected set; } public CellRendererCount count_renderer { get; protected set; } public Gtk.CellRendererPixbuf pixbuf_renderer { get; protected set; } CategoryModel _model; public CategoryTree () { expand = true; tree = new BaseTreeView(); model = new CategoryModel(); tree.name = "CategoryTree"; tree.level_indentation = 12; renderer = new Gtk.CellRendererText(); count_renderer = new CellRendererCount(); count_renderer.type_name = null; count_renderer.type_name_plural = null; pixbuf_renderer = new Gtk.CellRendererPixbuf(); pixbuf_renderer.set_property("xpad", 6); count_renderer.xalign = 1.0f; renderer.set_property("ellipsize", Pango.EllipsizeMode.END); renderer.set_property("ellipsize-set", true); tree.insert_column_with_data_func(0, "", pixbuf_renderer, pixbuf_cell_data_func); tree.insert_column_with_attributes(1, "", renderer, "text", CategoryColumn.NAME, null); tree.insert_column_with_attributes(2, "", count_renderer, "count", CategoryColumn.COUNT, "fallthrough", CategoryColumn.HIDE_COUNT, null); tree.get_column(0).expand = false; tree.get_column(1).expand = true; tree.get_column(2).expand = false; tree.set_headers_visible(false); tree.show_expanders = false; tree.set_tooltip_column(CategoryColumn.COMMENT); tree.test_expand_row.connect((t,i,p) => { t.collapse_all(); return false; }); tree.get_selection().changed.connect(on_selection_changed); add(tree); } public override void show () { tree.show(); base.show(); return; } public void select_first_row () { tree.get_selection().select_path(new Gtk.TreePath.first()); return; } void pixbuf_cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { Value val; model.get_value(treeiter, 0, out val); var obj = val.get_object(); if (tree.is_row_expanded(model.get_path(treeiter))) cell.set_property("icon-name", "folder-open"); else cell.set_property("icon-name", ((Category) obj).icon); val.unset(); return; } void on_selection_changed (Gtk.TreeSelection selection) { Gtk.TreeIter iter; Gtk.TreeModel model; GLib.Value val; if (!selection.get_selected(out model, out iter)) return; model.get_value(iter, 0, out val); var path = model.get_path(iter); selection_changed(((Category) val), path.get_indices()[0]); selected_filter = ((Category) val); debug("Selected category : %s", ((Category) val).name); if (path.get_depth() < 2) { tree.collapse_all(); tree.expand_to_path(path); } selected_iter = model.get_string_from_iter(iter); val.unset(); return; } } } master-0.7.3/lib/UX/Trees/CollectionTree.vala000077500000000000000000000246661300074171200207740ustar00rootroot00000000000000/* CollectionTree.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public enum CollectionColumn { OBJECT, NAME, COMMENT, N_COLUMNS } public class CollectionTree : Gtk.ScrolledWindow { public signal void update_ui (); public signal void changed (); public signal void selection_changed (Collection group); public Collection? selected_collection { get; protected set; default = null; } public CollectionModel model { get { return _model; } set { _model = value; tree.set_model(value); tree.get_selection().select_path(new Gtk.TreePath.first()); value.row_deleted.connect((t, p) => { update_and_cache_collections(); }); value.row_inserted.connect((t, p, i) => { update_and_cache_collections(); }); value.rows_reordered.connect((t, p, i) => { update_and_cache_collections(); }); value.row_changed.connect((t, p, i) => { update_and_cache_collections(); }); } } public FontConfig.Reject reject { get { return _reject; } set { _reject = value; } } public string selected_iter { get; protected set; default = "0"; } public CollectionControls controls { get; protected set; } public BaseTreeView tree { get; protected set; } public Gtk.CellRendererText renderer { get; protected set; } public CellRendererCount count_renderer { get; protected set; } public Gtk.CellRendererPixbuf pixbuf_renderer { get; protected set; } Gtk.TreeIter _selected_iter_; CollectionModel _model; FontConfig.Reject _reject; public CollectionTree () { expand = true; tree = new BaseTreeView(); model = new CollectionModel(); tree.name = "CollectionTree"; renderer = new Gtk.CellRendererText(); count_renderer = new CellRendererCount(); var toggle = new Gtk.CellRendererToggle(); toggle.toggled.connect(on_collection_toggled); count_renderer.type_name = null; count_renderer.type_name_plural = null; count_renderer.xalign = 1.0f; renderer.set_property("ellipsize", Pango.EllipsizeMode.END); renderer.set_property("ellipsize-set", true); renderer.editable = true; tree.insert_column_with_data_func(0, "", toggle, toggle_cell_data_func); tree.insert_column_with_data_func(1, "", renderer, text_cell_data_func); tree.insert_column_with_data_func(2, "", count_renderer, count_cell_data_func); tree.get_column(0).expand = false; tree.get_column(1).expand = true; tree.get_column(2).expand = false; tree.set_headers_visible(false); controls = new CollectionControls(); tree.reorderable = true; tree.set_tooltip_column(CollectionColumn.COMMENT); add(tree); connect_signals(); } public override void show () { controls.show(); tree.show(); base.show(); return; } void connect_signals () { tree.get_selection().changed.connect(on_selection_changed); renderer.edited.connect(on_edited); controls.add_selected.connect(() => { on_add_collection(); }); controls.remove_selected.connect(() => { on_remove_collection(); }); return; } public void select_first_row () { tree.get_selection().select_path(new Gtk.TreePath.first()); return; } public bool remove_fonts (Gee.ArrayList fonts) { bool res = selected_collection.families.remove_all(fonts); Idle.add(() => { model.collections.cache(); return false; }); selected_collection.set_active_from_fonts(reject); this.changed(); return res; } public void on_add_collection (Gee.ArrayList ? families = null) { string default_collection_name = DEFAULT_COLLECTION_NAME; int i = 1; while (model.collections.entries.has_key(default_collection_name)) default_collection_name = "%s %i".printf(DEFAULT_COLLECTION_NAME, i); var group = new Collection(default_collection_name); if (families != null) { group.families.add_all(families); group.set_active_from_fonts(reject); } model.collections.entries[default_collection_name] = group; Gtk.TreeIter iter; model.append(out iter, null); model.set(iter, 0, group, 1, group.comment, -1); tree.grab_focus(); tree.set_cursor(model.get_path(iter), tree.get_column(CollectionColumn.NAME), true); return; } public void on_remove_collection () { if (!model.iter_is_valid(_selected_iter_)) return; var collections = model.collections.entries; if (collections.has_key(selected_collection.name)) collections.unset(selected_collection.name); ((Gtk.TreeStore) model).remove(ref _selected_iter_); this.changed(); return; } public void on_export_collection () { // NotImplemented.run("Exporting collections"); return; } void on_edited (Gtk.CellRendererText renderer, string path, string new_text) { string new_name = new_text.strip(); if (new_name == selected_collection.name || new_name == "" || model.collections.entries.has_key(new_name)) { return; } else if (new_name == DEFAULT_COLLECTION_NAME) { Idle.add(() => { tree.grab_focus(); tree.set_cursor(new Gtk.TreePath.from_string(path), tree.get_column(CollectionColumn.NAME), true); return false; }); return; } Gtk.TreeIter iter; Value val; model.get_iter_from_string(out iter, path); model.get_value(iter, CollectionColumn.OBJECT, out val); var group = (Collection) val.get_object(); model.collections.rename_collection(group, new_name); val.unset(); Idle.add(() => { model.collections.cache(); return false; }); return; } void on_collection_toggled (string path) { Gtk.TreeIter iter; Value val; model.get_iter_from_string(out iter, path); model.get_value(iter, CollectionColumn.OBJECT, out val); var group = (Collection) val.get_object(); group.active = !(group.active); group.update(reject); group.set_active_from_fonts(reject); val.unset(); update_ui(); Idle.add(() => { model.collections.cache(); return false; }); return; } void on_selection_changed (Gtk.TreeSelection selection) { Gtk.TreeIter iter; Gtk.TreeModel model; GLib.Value val; if (!selection.get_selected(out model, out iter)) return; model.get_value(iter, 0, out val); selection_changed(((Collection) val)); selected_collection = ((Collection) val); debug("Selected collection : %s", ((Collection) val).name); _selected_iter_ = iter; selected_iter = model.get_string_from_iter(iter); val.unset(); return; } void text_cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { Value val; model.get_value(treeiter, CollectionColumn.OBJECT, out val); var obj = (Collection) val.get_object(); cell.set_property("text", obj.name); val.unset(); return; } void toggle_cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { Value val; model.get_value(treeiter, CollectionColumn.OBJECT, out val); var obj = (Collection) val.get_object(); cell.set_property("active", obj.active); val.unset(); return; } void count_cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { Value val; model.get_value(treeiter, CollectionColumn.OBJECT, out val); var obj = (Collection) val.get_object(); cell.set_property("count", obj.size()); val.unset(); return; } void update_and_cache_collections () { model.update_group_index(); Idle.add(() => { model.collections.cache(); return false; }); return; } } } master-0.7.3/lib/UX/Trees/FontListTree.vala000077500000000000000000000353571300074171200204420ustar00rootroot00000000000000/* FontListTree.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { enum FontListColumn { TOGGLE, TEXT, PREVIEW, COUNT, N_COLUMNS } public class FontList : MultiDNDTreeView { public signal void selection_changed (); public new Gtk.TreeStore? model { get { return _model; } set { _model = value; base.set_model(_model); select_first_row(); if (controls.expanded) expand_all(); } } public FontConfig.Reject reject { get; set; } public string selected_iter { get; protected set; default = "0"; } public string selected_font_desc { get; protected set; default = DEFAULT_FONT; } public FontData font_data { get; set; } public FontConfig.Family? selected_family { get; private set; default = null; } public FontConfig.Font? selected_font { get; private set; default = null; } public FontListControls controls { get; protected set; } Gtk.TreeStore? _model = null; Gtk.CellRendererToggle toggle; public FontList () { Object(name: "FontList", headers_visible: false, rubber_banding: true, expand: true); controls = new FontListControls(); toggle = new Gtk.CellRendererToggle(); var text = new Gtk.CellRendererText(); var preview = new Gtk.CellRendererText(); preview.ellipsize = Pango.EllipsizeMode.END; var count = new CellRendererCount(); count.junction_side = Gtk.JunctionSides.RIGHT; insert_column_with_data_func(FontListColumn.TOGGLE, "", toggle, toggle_cell_data_func); insert_column_with_data_func(FontListColumn.TEXT, "", text, text_cell_data_func); insert_column_with_data_func(FontListColumn.PREVIEW, "", preview, preview_cell_data_func); insert_column_with_data_func(FontListColumn.COUNT, "", count, count_cell_data_func); get_column(FontListColumn.TOGGLE).expand = false; get_column(FontListColumn.TEXT).expand = false; get_column(FontListColumn.PREVIEW).expand = true; get_column(FontListColumn.COUNT).expand = false; set_enable_search(true); set_search_column(FontListColumn.TEXT); controls.show(); connect_signals(); set_search_entry(controls.entry); } void connect_signals () { get_selection().changed.connect(on_selection_changed); toggle.toggled.connect(on_family_toggled); controls.expand_all.connect((e) => { if (e) expand_all(); else collapse_all(); }); return; } public void select_first_row () { get_selection().select_path(new Gtk.TreePath.first()); return; } public Gee.ArrayList get_selected_families () { var selected = new Gee.ArrayList (); List _selected = get_selection().get_selected_rows(null); foreach (var path in _selected) { Value val; Gtk.TreeIter iter; model.get_iter(out iter, path); model.get_value(iter, FontModelColumn.OBJECT, out val); var obj = val.get_object(); if (obj is FontConfig.Family) selected.add(((FontConfig.Family) obj).name); else selected.add(((FontConfig.Font) obj).family); val.unset(); } return selected; } public override void drag_begin (Gdk.DragContext context) { Gtk.drag_set_icon_name(context, "font-x-generic", 0, 0); return; } void on_selection_changed (Gtk.TreeSelection selection) { List selected = selection.get_selected_rows(null); if (selected == null || selected.length() < 1) return; Gtk.TreePath path = selected.nth_data(0); Gtk.TreeIter iter; model.get_iter(out iter, path); Value val; model.get_value(iter, FontModelColumn.OBJECT, out val); string description; var obj = val.get_object(); if (obj is FontConfig.Family) { description = ((FontConfig.Family) obj).description; selected_family = (FontConfig.Family) obj; selected_font = null; } else { description = ((FontConfig.Font) obj).description; selected_family = null; selected_font = (FontConfig.Font) obj; } try { if (selected_font != null) { var fontinfo = get_fontinfo_from_db_entry(FontManager.get_database(), selected_font.filepath); font_data = { File.new_for_path(selected_font.filepath), selected_font, fontinfo }; } else { var target = selected_family.get_default_variant(); var fontinfo = get_fontinfo_from_db_entry(FontManager.get_database(), target.filepath); font_data = { File.new_for_path(target.filepath), target, fontinfo }; } } catch (DatabaseError e) { warning(e.message); } selected_font_desc = description; debug("Selected font : %s", selected_font_desc); selected_iter = model.get_string_from_iter(iter); val.unset(); selection_changed(); return; } void on_family_toggled (string path) { Gtk.TreeIter iter; Value val; model.get_iter_from_string(out iter, path); model.get_value(iter, FontModelColumn.OBJECT, out val); var family = (FontConfig.Family) val.get_object(); debug("FontList : %s toggled", family.description); if (family.description in reject) reject.remove(family.description); else reject.add(family.description); reject.save(); val.unset(); Idle.add(() => { queue_draw(); return false; }); return; } void preview_cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { Value val; model.get_value(treeiter, FontModelColumn.OBJECT, out val); var obj = val.get_object(); Pango.AttrList attrs = new Pango.AttrList(); attrs.insert(Pango.attr_fallback_new(false)); cell.set_property("attributes", attrs); if (obj is FontConfig.Family) { cell.set_property("text", ((FontConfig.Family) obj).description); cell.set_property("ypad", 0); cell.set_property("xpad", 0); cell.set_property("visible", false); set_sensitivity(cell, treeiter, ((FontConfig.Family) obj).name); } else { cell.set_property("text", ((FontConfig.Font) obj).description); cell.set_property("ypad", 3); cell.set_property("xpad", 6); cell.set_property("visible", true); cell.set_property("font", ((FontConfig.Font) obj).description); set_sensitivity(cell, treeiter, ((FontConfig.Font) obj).family); } val.unset(); return; } void toggle_cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { Value val; model.get_value(treeiter, FontModelColumn.OBJECT, out val); var obj = val.get_object(); if (obj is FontConfig.Family) { cell.set_property("visible", true); cell.set_property("sensitive", true); cell.set_property("active", !(reject.contains(((FontConfig.Family) obj).description))); } else cell.set_property("visible", false); val.unset(); return; } void text_cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { Value val; model.get_value(treeiter, FontModelColumn.OBJECT, out val); var obj = val.get_object(); if (obj is FontConfig.Family) { cell.set_property("text", ((FontConfig.Family) obj).name); cell.set_property("ypad", 0); cell.set_property("xpad", 0); set_sensitivity(cell, treeiter, ((FontConfig.Family) obj).name); } else { cell.set_property("text", ((FontConfig.Font) obj).style); cell.set_property("ypad", 3); cell.set_property("xpad", 6); set_sensitivity(cell, treeiter, ((FontConfig.Font) obj).family); } val.unset(); return; } void count_cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { if (model.iter_has_child(treeiter)) { int count = 0; Gtk.TreeIter child; bool have_child = model.iter_children(out child, treeiter); while (have_child) { count++; have_child = model.iter_next(ref child); } cell.set_property("count", count); cell.set_property("visible", true); } else { cell.set_property("count", 0); cell.set_property("visible", false); } return; } void set_sensitivity(Gtk.CellRenderer cell, Gtk.TreeIter treeiter, string family) { bool inactive = (family in reject); cell.set_property("strikethrough" , inactive); if (inactive && get_selection().iter_is_selected(treeiter)) cell.set_property("sensitive" , true); else cell.set_property("sensitive" , !inactive); return; } } public class FontListTree : Gtk.Overlay { public FontList fontlist { get; set; } public Gtk.ProgressBar progress { get; private set; } public bool loading { get { return _loading; } set { _loading = value; if (value) progress.show(); else progress.hide(); } } public bool show_controls { get { return revealer.get_reveal_child(); } set { revealer.set_reveal_child(value); } } bool _loading; Gtk.Box _box; Gtk.Box fontlist_box; Gtk.Revealer revealer; Gtk.ScrolledWindow scroll; // Gtk.Menu context_menu; public FontListTree () { expand = true; scroll = new Gtk.ScrolledWindow(null, null); fontlist = new FontList(); progress = new Gtk.ProgressBar(); progress.halign = progress.valign = Gtk.Align.CENTER; get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); revealer = new Gtk.Revealer(); revealer.expand = false; fontlist_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); _box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); _box.pack_start(fontlist.controls, false, true, 0); revealer.add(_box); fontlist_box.pack_start(revealer, false, true, 0); scroll.add(fontlist); fontlist_box.pack_end(scroll, true, true, 0); add(fontlist_box); add_overlay(progress); // context_menu = get_context_menu(); // connect_signals(); } public override void show () { _box.show(); fontlist_box.show(); revealer.show(); scroll.show(); fontlist.show(); base.show(); return; } // void connect_signals () { // fontlist.menu_request.connect((w, e) => { // context_menu.popup(null, null, null, e.button, e.time); // }); // return; // } // Gtk.Menu get_context_menu () { // MenuEntry [] context_menu_entries = { // /* action_name, display_name, detailed_action_name, accelerator, method */ // MenuEntry("font_details", _("Show Details"), "app.font_details", null, new MenuCallbackWrapper(on_show_details)), // }; // var _menu = new Gtk.Menu(); // foreach (var entry in context_menu_entries) { // var item = new Gtk.MenuItem.with_label(entry.display_name); // item.activate.connect(() => { entry.method.run(); }); // item.show(); // _menu.append(item); // } // return _menu; // } // public void on_show_details () { // message("%s", fontlist.selected_font != null ? fontlist.selected_font.filepath: fontlist.selected_family.name); // } } } master-0.7.3/lib/UX/Trees/UserFontTree.vala000066400000000000000000000215031300074171200204260ustar00rootroot00000000000000/* UserFontTree.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class UserFontTree : BaseTreeView { Gtk.CellRendererToggle toggle; Gee.HashSet selected_families; Gee.HashSet selected_fonts; public UserFontTree (UserFontModel model) { Object(name: "UserFontTree", model: model, headers_visible: false); get_selection().set_mode(Gtk.SelectionMode.SINGLE); toggle = new Gtk.CellRendererToggle(); var text = new Gtk.CellRendererText(); var preview = new Gtk.CellRendererText(); preview.ellipsize = Pango.EllipsizeMode.END; var count = new CellRendererCount(); count.junction_side = Gtk.JunctionSides.RIGHT; insert_column_with_data_func(FontListColumn.TOGGLE, "", toggle, toggle_cell_data_func); insert_column_with_data_func(FontListColumn.TEXT, "", text, text_cell_data_func); insert_column_with_data_func(FontListColumn.PREVIEW, "", preview, preview_cell_data_func); insert_column_with_data_func(FontListColumn.COUNT, "", count, count_cell_data_func); get_column(FontListColumn.TOGGLE).expand = false; get_column(FontListColumn.TEXT).expand = false; get_column(FontListColumn.PREVIEW).expand = true; get_column(FontListColumn.COUNT).expand = false; selected_families = new Gee.HashSet (); selected_fonts = new Gee.HashSet (); connect_signals(); } public File [] to_file_array () { File? [] arr = null; foreach (var font in selected_fonts) arr += File.new_for_path(get_actual_filepath(font)); return arr; } void connect_signals () { toggle.toggled.connect(on_font_toggled); return; } string get_actual_filepath (FontConfig.Font font) { File font_file = File.new_for_path(font.filepath); if (font_file.query_exists() && font.filepath.contains(get_user_font_dir())) return font_file.get_path(); debug("Font file %s is not stored in user font directory, querying database for duplicates...", font.filepath); string path = font.filepath; try { var db = get_database(); db.reset(); db.table = "Fonts"; db.select = "filepath"; db.search = "family=\"%s\" AND style=\"%s\"".printf(font.family, font.style); db.unique = true; db.execute_query(); foreach (var row in db) { string res = row.column_text(0); if (res.contains(get_user_font_dir())) { path = res; debug("Found matching font file stored in user font directory %s", path); break; } } db.close(); } catch (DatabaseError e) { critical("Failed to query database : %s", db.db.errmsg()); } return path; } void on_font_toggled (string path) { Gtk.TreeIter iter; Value val; model.get_iter_from_string(out iter, path); model.get_value(iter, FontModelColumn.OBJECT, out val); var font = val.get_object(); if (font is FontConfig.Family) { if (selected_families.contains((FontConfig.Family) font)) { selected_families.remove((FontConfig.Family)font); foreach (var face in ((FontConfig.Family) font).list_faces()) selected_fonts.remove((FontConfig.Font) face); } else { selected_families.add((FontConfig.Family) font); foreach (var face in ((FontConfig.Family) font).list_faces()) selected_fonts.add((FontConfig.Font) face); } } else { if (selected_fonts.contains((FontConfig.Font) font)) selected_fonts.remove((FontConfig.Font) font); else selected_fonts.add((FontConfig.Font) font); } val.unset(); Idle.add(() => { queue_draw(); return false; }); return; } void preview_cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { Value val; model.get_value(treeiter, FontModelColumn.OBJECT, out val); var obj = val.get_object(); if (obj is FontConfig.Family) { cell.set_property("text", ((FontConfig.Family) obj).description); cell.set_property("ypad", 0); cell.set_property("xpad", 0); cell.set_property("visible", false); } else { cell.set_property("text", ((FontConfig.Font) obj).description); cell.set_property("ypad", 3); cell.set_property("xpad", 6); cell.set_property("visible", true); cell.set_property("font", ((FontConfig.Font) obj).description); } val.unset(); return; } void toggle_cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { Value val; model.get_value(treeiter, FontModelColumn.OBJECT, out val); var obj = val.get_object(); cell.set_property("visible", true); cell.set_property("sensitive", true); cell.set_property("inconsistent", false); if (obj is FontConfig.Family) cell.set_property("active", selected_families.contains((FontConfig.Family) obj)); else cell.set_property("active", selected_fonts.contains((FontConfig.Font) obj)); val.unset(); return; } void text_cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { Value val; model.get_value(treeiter, FontModelColumn.OBJECT, out val); var obj = val.get_object(); if (obj is FontConfig.Family) { cell.set_property("text", ((FontConfig.Family) obj).name); cell.set_property("ypad", 0); cell.set_property("xpad", 0); } else { cell.set_property("text", ((FontConfig.Font) obj).style); cell.set_property("ypad", 3); cell.set_property("xpad", 6); } val.unset(); return; } void count_cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { if (model.iter_has_child(treeiter)) { int count = 0; Gtk.TreeIter child; bool have_child = model.iter_children(out child, treeiter); while (have_child) { count++; have_child = model.iter_next(ref child); } cell.set_property("count", count); cell.set_property("visible", true); } else { cell.set_property("count", 0); cell.set_property("visible", false); } return; } } } master-0.7.3/lib/UX/Utils/000077500000000000000000000000001300074171200152115ustar00rootroot00000000000000master-0.7.3/lib/UX/Utils/Color.vala000066400000000000000000000272121300074171200171400ustar00rootroot00000000000000/* From libplank, namespace modified, "using" declarations removed. */ // // Copyright (C) 2011 Robert Dyer // // 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 . // /** * Represents a RGBA color and has methods for manipulating the color. */ public struct Color { /** * The red value for the color. */ public double R; /** * The green value for the color. */ public double G; /** * The blue value for the color. */ public double B; /** * The alpha value for the color. */ public double A; /** * Creates a new color from a {@link Gdk.Color}. * * @param color the color to use * @return new {@link Color} based on the given one */ public static Color from_gdk_color (Gdk.Color color) { return { (double) color.red / uint16.MAX, (double) color.green / uint16.MAX, (double) color.blue / uint16.MAX, 1.0 }; } /** * Creates a new {@link Gdk.Color}.from this color * * @return new {@link Gdk.Color} */ public Gdk.Color to_gdk_color () { return { 0, (uint16) (R * uint16.MAX), (uint16) (G * uint16.MAX), (uint16) (B * uint16.MAX) }; } /** * Creates a new color from a {@link Gdk.RGBA}. * * @param color the color to use * @return new {@link Color} based on the given one */ public static Color from_gdk_rgba (Gdk.RGBA color) { return { color.red, color.green, color.blue, color.alpha }; } /** * Creates a new {@link Gdk.RGBA}.from this color * * @return new {@link Gdk.RGBA} */ public Gdk.RGBA to_gdk_rgba () { return { R, G, B, A }; } /** * Check equality with the give color * * @return whether the give color equals this color. */ public bool equal (Color color) { return (R == color.R && G == color.G && B == color.B && A == color.A); } /** * Set HSV color values of this color. */ public void set_hsv (double h, double s, double v) { hsv_to_rgb(h, s, v, out R, out G, out B); } /** * Sets the hue for the color. * * @param hue the new hue for the color */ public void set_hue (double hue) requires (hue >= 0 && hue <= 360) { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); h = hue; hsv_to_rgb(h, s, v, out R, out G, out B); } /** * Sets the saturation for the color. * * @param sat the new saturation for the color */ public void set_sat (double sat) requires (sat >= 0 && sat <= 1) { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); s = sat; hsv_to_rgb(h, s, v, out R, out G, out B); } /** * Sets the value for the color. * * @param val the new value for the color */ public void set_val (double val) requires (val >= 0 && val <= 1) { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); v = val; hsv_to_rgb(h, s, v, out R, out G, out B); } /** * Sets the alpha for the color. * * @param alpha the new alpha for the color */ public void set_alpha (double alpha) requires (alpha >= 0 && alpha <= 1) { A = alpha; } /** * Get HSV color values of this color. */ public void get_hsv (out double h, out double s, out double v) { rgb_to_hsv(R, G, B, out h, out s, out v); } /** * Returns the hue for the color. * * @return the hue for the color */ public double get_hue () { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); return h; } /** * Returns the saturation for the color. * * @return the saturation for the color */ public double get_sat () { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); return s; } /** * Returns the value for the color. * * @return the value for the color */ public double get_val () { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); return v; } /** * Increases the color's hue. * * @param val the amount to add to the hue */ public void add_hue (double val) { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); h = (((h + val) % 360) + 360) % 360; hsv_to_rgb(h, s, v, out R, out G, out B); } /** * Limits the color's saturation. * * @param sat the minimum saturation allowed */ public void set_min_sat (double sat) requires (sat >= 0 && sat <= 1) { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); s = double.max (s, sat); hsv_to_rgb(h, s, v, out R, out G, out B); } /** * Limits the color's value. * * @param val the minimum value allowed */ public void set_min_value (double val) requires (val >= 0 && val <= 1) { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); v = double.max (v, val); hsv_to_rgb(h, s, v, out R, out G, out B); } /** * Limits the color's saturation. * * @param sat the maximum saturation allowed */ public void set_max_sat (double sat) requires (sat >= 0 && sat <= 1) { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); s = double.min (s, sat); hsv_to_rgb(h, s, v, out R, out G, out B); } /** * Limits the color's value. * * @param val the maximum value allowed */ public void set_max_val (double val) requires (val >= 0 && val <= 1) { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); v = double.min (v, val); hsv_to_rgb(h, s, v, out R, out G, out B); } /** * Multiplies the color's saturation using the amount. * * @param amount amount to multiply the saturation by */ public void multiply_sat (double amount) requires (amount >= 0) { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); s = double.min (1, s * amount); hsv_to_rgb(h, s, v, out R, out G, out B); } /** * Brighten the color's value using the value. * * @param amount percent of the value to brighten by */ public void brighten_val (double amount) requires (amount >= 0 && amount <= 1) { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); v = double.min (1, v + (1 - v) * amount); hsv_to_rgb(h, s, v, out R, out G, out B); } /** * Darkens the color's value using the value. * * @param amount percent of the value to darken by */ public void darken_val (double amount) requires (amount >= 0 && amount <= 1) { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); v = double.max (0, v - (1 - v) * amount); hsv_to_rgb(h, s, v, out R, out G, out B); } /** * Darkens the color's value using the saturtion. * * @param amount percent of the saturation to darken by */ public void darken_by_sat (double amount) requires (amount >= 0 && amount <= 1) { double h, s, v; rgb_to_hsv(R, G, B, out h, out s, out v); v = double.max (0, v - amount * s); hsv_to_rgb(h, s, v, out R, out G, out B); } static void rgb_to_hsv (double r, double g, double b, out double h, out double s, out double v) requires (r >= 0 && r <= 1) requires (g >= 0 && g <= 1) requires (b >= 0 && b <= 1) { v = double.max (r, double.max (g, b)); if (v == 0) { h = 0; s = 0; return; } // normalize value to 1 r /= v; g /= v; b /= v; var min = double.min(r, double.min(g, b)); var max = double.max(r, double.max(g, b)); var delta = max - min; s = delta; if (s == 0) { h = 0; return; } // normalize saturation to 1 r = (r - min) / delta; g = (g - min) / delta; b = (b - min) / delta; if (max == r) { h = 0 + 60 * (g - b); if (h < 0) h += 360; } else if (max == g) { h = 120 + 60 * (b - r); } else { h = 240 + 60 * (r - g); } } static void hsv_to_rgb (double h, double s, double v, out double r, out double g, out double b) requires (h >= 0 && h <= 360) requires (s >= 0 && s <= 1) requires (v >= 0 && v <= 1) { r = 0; g = 0; b = 0; if (s == 0) { r = v; g = v; b = v; } else { var secNum = (int) Math.floor(h / 60); var fracSec = h / 60.0 - secNum; var p = v * (1 - s); var q = v * (1 - s * fracSec); var t = v * (1 - s * (1 - fracSec)); switch (secNum) { case 0: r = v; g = t; b = p; break; case 1: r = q; g = v; b = p; break; case 2: r = p; g = v; b = t; break; case 3: r = p; g = q; b = v; break; case 4: r = t; g = p; b = v; break; case 5: r = v; g = p; b = q; break; } } } /** * Convert color to string formatted like "%d;;%d;;%d;;%d" * with numeric entries ranged in 0..255 * * @return the string representation of this color */ public string to_string () { return "%d;;%d;;%d;;%d".printf ((int) (R * uint8.MAX), (int) (G * uint8.MAX), (int) (B * uint8.MAX), (int) (A * uint8.MAX)); } /** * Create new color converted from string formatted like * "%d;;%d;;%d;;%d" with numeric entries ranged in 0..255 * * @return new {@link Color} based on the given string */ public static Color from_string (string s) { var parts = s.split (";;"); if (parts.length != 4) { critical("Malformed color string '%s'", s); return {0}; } return { double.min(uint8.MAX, double.max(0, int.parse(parts [0]))) / uint8.MAX, double.min(uint8.MAX, double.max(0, int.parse(parts [1]))) / uint8.MAX, double.min(uint8.MAX, double.max(0, int.parse(parts [2]))) / uint8.MAX, double.min(uint8.MAX, double.max(0, int.parse(parts [3]))) / uint8.MAX }; } } master-0.7.3/lib/UX/Utils/FileSelector.vala000077500000000000000000000100351300074171200204400ustar00rootroot00000000000000/* FileSelector.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace FileSelector { internal const string [] FONT_MIMETYPES = { "application/x-font-ttf", "application/x-font-ttc", "application/x-font-otf", "application/x-font-type1" }; public string? [] run_install (Gtk.Window? parent) { string? [] arr = { }; var dialog = new Gtk.FileChooserDialog(_("Select files to install"), parent, Gtk.FileChooserAction.OPEN, _("_Cancel"), Gtk.ResponseType.CANCEL, _("_Open"), Gtk.ResponseType.ACCEPT, null); var filter = new Gtk.FileFilter(); #if HAVE_FILE_ROLLER var archive_manager = new ArchiveManager(); foreach (var mimetype in archive_manager.get_supported_types()) filter.add_mime_type(mimetype); #endif foreach (var mimetype in FONT_MIMETYPES) filter.add_mime_type(mimetype); dialog.set_filter(filter); dialog.set_select_multiple(true); if (dialog.run() == Gtk.ResponseType.ACCEPT) { dialog.hide(); foreach (var uri in dialog.get_uris()) arr += uri; } dialog.destroy(); return arr; } public File? [] run_removal (Gtk.Window? parent, UserFontModel font_model) { File? [] res = null; var dialog = new Gtk.Dialog(); var cancel = new Gtk.Button.with_mnemonic(_("_Cancel")); var remove = new Gtk.Button.with_mnemonic(_("_Delete")); //cancel.get_style_context().add_class(Gtk.STYLE_CLASS_SUGGESTED_ACTION); remove.get_style_context().add_class(Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); var header = new Gtk.HeaderBar(); var content_area = dialog.get_content_area(); var scroll = new Gtk.ScrolledWindow(null, null); var tree = new UserFontTree(font_model); header.set_title(_("Select fonts to remove")); header.pack_start(cancel); header.pack_end(remove); dialog.set_titlebar(header); dialog.modal = true; dialog.destroy_with_parent = true; dialog.set_size_request(540, 480); dialog.set_transient_for(parent); tree.expand = true; scroll.add(tree); content_area.pack_start(scroll, true, true, 0); scroll.show_all(); header.show_all(); cancel.clicked.connect(() => { dialog.response(Gtk.ResponseType.CANCEL); }); remove.clicked.connect(() => { dialog.response(Gtk.ResponseType.ACCEPT); }); if (dialog.run() == Gtk.ResponseType.ACCEPT) { dialog.hide(); res = tree.to_file_array(); } dialog.destroy(); return res; } } } master-0.7.3/lib/UX/Utils/Utils.vala.in000077500000000000000000000061511300074171200175710ustar00rootroot00000000000000/* Utils.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ public Pango.FontDescription get_font (Gtk.Widget widget, Gtk.StateFlags flags = Gtk.StateFlags.NORMAL) { Pango.FontDescription desc; var ctx = widget.get_style_context(); ctx.save(); ctx.set_state(flags); ctx.get(flags, "font", out desc); ctx.restore(); return desc.copy(); } public bool Gnome3 () { Gtk.Settings settings = Gtk.Settings.get_default(); bool has_app_menu = settings.gtk_shell_shows_app_menu; bool has_menubar = settings.gtk_shell_shows_menubar; return has_app_menu && !has_menubar; } public void ensure_ui_update () { while (Gtk.events_pending()) Gtk.main_iteration(); return; } public bool is_left_to_right (Gtk.Widget widget) { var context = widget.get_style_context(); var state = context.get_state(); if ((state & Gtk.StateFlags.DIR_LTR) != 0) return true; return false; } public Gtk.Separator add_separator (Gtk.Box box, Gtk.Orientation orientation = Gtk.Orientation.VERTICAL, Gtk.PackType pack_type = Gtk.PackType.START) { var separator = new Gtk.Separator(orientation); switch (pack_type) { case Gtk.PackType.END: box.pack_end(separator, false, true, 0); break; default: box.pack_start(separator, false, true, 0); break; } separator.show(); return separator; } public void set_default_button_relief (Gtk.Container container) { foreach (Gtk.Widget widget in container.get_children()) if (widget is Gtk.Button) ((Gtk.Button) widget).relief = Gtk.ReliefStyle.NONE; return; } public void cr_set_source_rgba (Cairo.Context cr, Gdk.RGBA color, double? alpha = null) { if (alpha == null) cr.set_source_rgba(color.red, color.green, color.blue, color.alpha); else cr.set_source_rgba(color.red, color.green, color.blue, alpha); return; } public Gdk.RGBA darker (Gdk.RGBA rgba, double factor) { var color = Color.from_gdk_rgba(rgba); color.darken_by_sat(factor); return color.to_gdk_rgba(); } public bool color_is_light (Color color) { double Pr = (color.R * color.R) * 0.2126; double Pg = (color.G * color.G) * 0.7152; double Pb = (color.B * color.B) * 0.0722; return Math.sqrt(Pr + Pg + Pb) > 127.5; } master-0.7.3/lib/UX/Views/000077500000000000000000000000001300074171200152065ustar00rootroot00000000000000master-0.7.3/lib/UX/Views/FontPreviewPane.vala000066400000000000000000000224651300074171200211400ustar00rootroot00000000000000/* FontPreviewPane.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public enum FontPreviewMode { PREVIEW, WATERFALL, BODY_TEXT, N_MODES; public static FontPreviewMode parse (string mode) { switch (mode.down()) { case "waterfall": return FontPreviewMode.WATERFALL; case "body text": return FontPreviewMode.BODY_TEXT; default: return FontPreviewMode.PREVIEW; } } public string to_string () { switch (this) { case WATERFALL: return "Waterfall"; case BODY_TEXT: return "Body Text"; default: return "Preview"; } } public string to_translatable_string () { switch (this) { case WATERFALL: return _("Waterfall"); case BODY_TEXT: return _("Body Text"); default: return _("Preview"); } } } public class FontPreviewPane : Gtk.Box { public signal void preview_mode_changed (FontPreviewMode mode); public signal void preview_text_changed (string preview_text); public signal void updated (); public FontPreview preview { get; private set; } public Gtk.Notebook notebook { get; private set; } public Metadata.Properties properties { get; private set; } public Metadata.License license { get; private set; } public CharacterTable charmap { get; private set; } public double preview_size { get; set; } public FontData? font_data { get { return _font_data; } set { _font_data = value; Idle.add(() => { update(); return false; }); } } public FontPreviewMode mode { get { return FontPreviewMode.parse(preview.mode); } set { preview.mode = value.to_string(); } } Gtk.Label preview_tab_label; Gtk.MenuButton menu_button; FontData? _font_data = null; public FontPreviewPane () { Object(name: "FontManagerFontPreviewPane", orientation: Gtk.Orientation.VERTICAL, spacing: 0); Gtk.drag_dest_set(this, Gtk.DestDefaults.ALL, AppDragTargets, AppDragActions); notebook = new Gtk.Notebook(); notebook.show_border = false; preview = new FontPreview(); preview_tab_label = new Gtk.Label(FontPreviewMode.PREVIEW.to_translatable_string()); notebook.insert_page(preview, preview_tab_label, 0); properties = new Metadata.Properties(); license = new Metadata.License(); charmap = new CharacterTable(); var block_model = new Gucharmap.BlockChaptersModel(); Gtk.TreeIter iter; block_model.get_iter_from_string(out iter, "0"); charmap.table.codepoint_list = block_model.get_codepoint_list(iter); notebook.append_page(properties, new Gtk.Label(_("Properties"))); notebook.append_page(license, new Gtk.Label(_("License"))); notebook.append_page(charmap, new Gtk.Label(_("Characters"))); construct_menu_button(); notebook.set_action_widget(menu_button, Gtk.PackType.START); pack_end(notebook, true, true, 0); connect_signals(); } void connect_signals () { notebook.switch_page.connect((p, n) => { menu_button.sensitive = ((FontPreviewMode) n == FontPreviewMode.PREVIEW); }); preview.mode_changed.connect((m) => { preview_tab_label.set_text(mode.to_translatable_string()); var actions = ((SimpleActionGroup) get_action_group("preview")); actions.lookup_action("mode").change_state(mode.to_string()); Idle.add(() => { if (menu_button.use_popover) { menu_button.popover.hide(); return menu_button.popover.visible; } else { menu_button.popup.hide(); return menu_button.popup.visible; } }); debug("Selected preview mode : %s", m); this.preview_mode_changed(FontPreviewMode.parse(m)); }); preview.preview_text_changed.connect((p) => { this.preview_text_changed(p); }); bind_property("preview-size", preview, "preview-size", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); } public override void show () { notebook.show(); preview.show(); properties.show(); license.show(); charmap.show(); menu_button.show_all(); base.show(); return; } public virtual void show_uri (string uri) { this.open(uri); return; } public virtual void open (string arg) { var file = File.new_for_commandline_arg(arg); if (file.query_exists()) font_data = FontData(file); return; } public void set_preview_text (string preview_text) { preview.set_preview_text(preview_text); return; } public virtual void update () { if (font_data != null && font_data.file != null) FontConfig.add_app_font(font_data.file.get_path()); Idle.add(() => { properties.update(font_data); license.update(font_data); if (font_data != null && font_data.font != null) preview.font_desc = charmap.font_desc = Pango.FontDescription.from_string(font_data.font.description); else preview.font_desc = charmap.font_desc = Pango.FontDescription.from_string(DEFAULT_FONT); return false; }); this.updated(); return; } public override void drag_data_received (Gdk.DragContext context, int x, int y, Gtk.SelectionData selection_data, uint info, uint time) { switch (info) { case DragTargetType.EXTERNAL: this.open(selection_data.get_uris()[0]); break; default: warning("Unsupported drag target."); return; } return; } void construct_menu_button () { menu_button = new Gtk.MenuButton(); menu_button.margin = MINIMUM_MARGIN_SIZE; menu_button.direction = Gtk.ArrowType.DOWN; menu_button.relief = Gtk.ReliefStyle.NONE; menu_button.can_focus = false; var menu_button_icon = new Gtk.Image.from_icon_name("view-more-symbolic", Gtk.IconSize.MENU); menu_button.add(menu_button_icon); var action_group = new SimpleActionGroup(); var mode_section = new GLib.Menu(); string [] modes = { "Preview", "Waterfall", "Body Text" }; var mode_action = new SimpleAction.stateful("mode", VariantType.STRING, "Preview"); mode_action.activate.connect((a, s) => { mode = FontPreviewMode.parse((string) s); }); action_group.add_action(mode_action); mode_action.set_state("Preview"); int i = 0; foreach (var mode in modes) { i++; GLib.MenuItem item = new MenuItem(FontPreviewMode.parse(mode).to_translatable_string(), "preview.mode::%s".printf(mode)); item.set_attribute("accel", "s", "%i".printf(i)); mode_section.append_item(item); } insert_action_group("preview", action_group); menu_button.set_menu_model((GLib.MenuModel) mode_section); menu_button.set_tooltip_text(_("Select preview type")); return; } } } master-0.7.3/lib/UX/Widgets/000077500000000000000000000000001300074171200155175ustar00rootroot00000000000000master-0.7.3/lib/UX/Widgets/CellRendererPill.vala000077500000000000000000000164311300074171200215630ustar00rootroot00000000000000/* CellRendererPill.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ /* XXX : This shit here needs work... */ public class CellRendererCount : CellRendererPill { public int count { get; set; default = -1; } public string? type_name { get; set; default = _("Variation "); } public string? type_name_plural { get; set; default = _("Variations"); } protected override string _get_markup () { string markup = "%i "; string markup_w_type = "%i %s"; if (count == -1) return ""; else if (type_name != null && type_name_plural != null) return markup_w_type.printf((int) count, ngettext(type_name, type_name_plural, (ulong) count)); else return markup.printf((int) count); } } public class CellRendererTitle : CellRendererPill { public string title { get; set; } protected override string _get_markup () { if (title != null) return "%s".printf(Markup.escape_text(title)); else return ""; } } public abstract class CellRendererPill : Gtk.CellRendererText { public int radius { get; set; default = 9; } public bool fallthrough { get; set; default = false; } public Gtk.JunctionSides junction_side { get; set; default = Gtk.JunctionSides.NONE; } protected abstract string _get_markup (); public override void render (Cairo.Context cr, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gtk.CellRendererState flags) { if (fallthrough) { base.render(cr, widget, background_area, cell_area, flags); return; } /* Without some default padding our pill shape touches the text */ if (xpad < 12) xpad = 12; if (ypad < 2) ypad = 2; Gtk.StateFlags state = get_widget_state(widget, flags); Gdk.RGBA text_color; Gdk.RGBA pill_color; Gdk.RGBA shadow_color; Gtk.StyleContext context = widget.get_style_context(); shadow_color = context.get_color(state); if (state == Gtk.StateFlags.NORMAL) { pill_color = context.get_color(state); text_color = context.get_background_color(state); } else { pill_color = context.get_background_color(state); text_color = context.get_color(state); } /* Need layout size */ int layout_w, layout_h; Pango.Layout layout = widget.create_pango_layout(null); layout.set_markup(_get_markup(), -1); Pango.FontDescription font_desc; get("font-desc", out font_desc, null); if (font_desc != null) layout.set_font_description(font_desc); else layout.set_font_description(get_font(widget, state)); layout.get_pixel_size(out layout_w, out layout_h); if (state == Gtk.StateFlags.NORMAL) cr_set_source_rgba(cr, pill_color, 0.25); else cr_set_source_rgba(cr, darker(pill_color, 0.33), 0.75); int h = cell_area.height - ((int) ypad * 2); int w = layout_w + ((int) xpad * 2); int x; var cutoff = radius + ((int) xpad / 3); switch (junction_side) { case Gtk.JunctionSides.RIGHT: if (is_left_to_right(widget)) x = (cell_area.x + cell_area.width) - (w - cutoff); else x = cell_area.x - cutoff; break; case Gtk.JunctionSides.LEFT: if (is_left_to_right(widget)) x = cell_area.x - cutoff; else x = (cell_area.x + cell_area.width) - (w - cutoff); break; default: x = cell_area.x + (int) ((cell_area.width - w) * xalign); while (x + w > (cell_area.x + cell_area.width)) x--; while (x < cell_area.x) x++; break; } int y = cell_area.y + (int) ypad; int text_x = x + (int) (xpad * 1.15); int text_y = y + ((cell_area.height - layout_h) / 2) - (int) ypad; _cr_draw_pill_shape(cr, x, y, h, w); cr_set_source_rgba(cr, darker(shadow_color, 0.50), 0.333); cr.move_to(text_x + 0.5, text_y + 0.5); Pango.cairo_show_layout(cr, layout); cr_set_source_rgba(cr, text_color); cr.move_to(text_x, text_y); Pango.cairo_show_layout(cr, layout); return; } public override void get_preferred_width (Gtk.Widget widget, out int minimum_size, out int natural_size) { int w, h; _get_preferred_size(widget, out w, out h); minimum_size = natural_size = w; return; } public override void get_preferred_height_for_width (Gtk.Widget widget, int width, out int minimum_height, out int natural_height) { int w, h; _get_preferred_size(widget, out w, out h); minimum_height = natural_height = h; return; } public void _get_preferred_size (Gtk.Widget widget, out int w, out int h) { int layout_w, layout_h; if (xpad < 12) xpad = 12; if (ypad < 2) ypad = 2; Pango.Layout layout = widget.create_pango_layout(null); layout.set_markup(_get_markup(), -1); Pango.FontDescription font_desc; get("font-desc", out font_desc, null); if (font_desc != null) layout.set_font_description(font_desc); else layout.set_font_description(get_font(widget)); layout.get_pixel_size(out layout_w, out layout_h); w = layout_w + ((int) xpad * 2); h = layout_h + ((int) ypad * 2); return; } protected void _cr_draw_pill_shape (Cairo.Context cr, int x, int y, int h, int w) { cr.move_to(x + radius, y); cr.line_to(x + (w - (radius)), y); cr.curve_to(x + w, y, x + w, y + h, x + w - (radius), y + h); cr.line_to(x + radius, y + h); cr.curve_to(x, y + h, x, y, x + radius, y); cr.fill(); return; } protected virtual Gtk.StateFlags get_widget_state (Gtk.Widget widget, Gtk.CellRendererState flags) { /* Ignore most states */ if ((flags & Gtk.CellRendererState.SELECTED) == Gtk.CellRendererState.SELECTED && widget.has_focus) return Gtk.StateFlags.SELECTED; else return Gtk.StateFlags.NORMAL; } } master-0.7.3/lib/UX/Widgets/Controls.vala000066400000000000000000000232371300074171200201760ustar00rootroot00000000000000/* Controls.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ /** * LabeledSwitch: * * @label text to display in label * * Row like widget containing two #Gtk.Label and a #Gtk.Switch. * Use #Gtk.Label.set_text() / #Gtk.Label.set_markup() * @label is intended to display main option name * @dim_label is intended to display additional information * @toggle is #Gtk.Switch connect to its active signal to monitor changes * * ------------------------------------------------------------ * | | * | label dim_label switch | * | | * ------------------------------------------------------------ */ public class LabeledSwitch : Gtk.Box { /** * LabeledSwitch:label: * * #Gtk.Label */ public Gtk.Label label { get; private set; } /** * LabeledSwitch:dim_label: * * Centered #Gtk.Label with dim-label style class */ public Gtk.Label dim_label { get; private set; } /** * LabeledSwitch:toggle: * * #Gtk.Switch */ public Gtk.Switch toggle { get; private set; } construct { label = new Gtk.Label(null); label.hexpand = false; label.halign = Gtk.Align.START; dim_label = new Gtk.Label(null); dim_label.hexpand = true; dim_label.halign = Gtk.Align.CENTER; dim_label.get_style_context().add_class(Gtk.STYLE_CLASS_DIM_LABEL); toggle = new Gtk.Switch(); toggle.expand = false; pack_start(label, false, false, 0); set_center_widget(dim_label); pack_end(toggle, false, false, 0); } public LabeledSwitch (string label = "") { Object(name: "LabeledSwitch", margin: DEFAULT_MARGIN_SIZE); this.label.set_text(label); } /** * {@inheritDoc} */ public override void show () { label.show(); dim_label.show(); toggle.show(); base.show(); return; } } /** * LabeledSpinButton: * * @label text to display in label * @min minimum value for #Gtk.SpinButton * @max maximum value for #Gtk.SpinButton * @step step increment for #Gtk.SpinButton.adjustment * * Row like widget containing a #Gtk.Label and a #Gtk.SpinButton. * * ------------------------------------------------------------ * | | * | label spinbutton | * | | * ------------------------------------------------------------ */ public class LabeledSpinButton : Gtk.Grid { /** * LabeledSpinButton:value: * * Current value. */ public double @value { get; set; default = 0.0; } Gtk.Label label; Gtk.SpinButton spin; public LabeledSpinButton (string label = "", double min, double max, double step) { Object(name: "LabeledspinButton", margin: DEFAULT_MARGIN_SIZE); this.label = new Gtk.Label(label); this.label.hexpand = true; this.label.halign = Gtk.Align.START; spin = new Gtk.SpinButton.with_range(min, max, step); attach(this.label, 0, 0, 1, 1); attach(spin, 1, 0, 1, 1); bind_property("value", spin, "value", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); } /** * {@inheritDoc} */ public override void show () { label.show(); spin.show(); base.show(); return; } } /** * OptionScale: * * @heading string to display centered above scale * @options string [] of options to create marks for * * Row like widget containing a #Gtk.Label displayed centered * above the scale. * * --------------------------------------------------------------- * | heading | * | | * | options[0] ---------- options[1] ----------- options[2] | * | | * --------------------------------------------------------------- */ public class OptionScale : Gtk.Grid { /** * OptionScale:value: * * Current value. */ public double @value { get; set; default = 0.0; } /** * FontScale:adjustment: * * #Gtk.Adjustment in use */ public Gtk.Adjustment adjustment { get { return scale.get_adjustment(); } } /** * OptionScale:options: */ public string [] options { get; private set; } Gtk.Label label; Gtk.Scale scale; public OptionScale (string? heading = null, string [] options) { Object(name: "OptionScale", margin: DEFAULT_MARGIN_SIZE); hexpand = true; this.options = options; scale = new Gtk.Scale.with_range(Gtk.Orientation.HORIZONTAL, 0, options.length, 1); scale.hexpand = true; scale.draw_value = false; scale.round_digits = 1; scale.adjustment.lower = 0; scale.adjustment.page_increment = 1; scale.adjustment.step_increment = 1; scale.adjustment.upper = options.length - 1; scale.show_fill_level = false; for (int i = 0; i < options.length; i++) scale.add_mark(i, Gtk.PositionType.BOTTOM, options[i]); scale.value_changed.connect(() => { scale.set_value(Math.round(scale.adjustment.get_value())); }); label = new Gtk.Label(null); label.hexpand = true; label.margin = margin / 2; if (heading != null) label.set_text(heading); attach(label, 0, 0, options.length, 1); attach(scale, 0, 1, options.length, 1); bind_property("value", scale.adjustment, "value", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); } /** * {@inheritDoc} */ public override void show () { label.show(); scale.show(); base.show(); return; } } /** * FontScale: * * Row like widget which displays a #Gtk.Scale and a #Gtk.SpinButton * for adjusting font display size. * * ------------------------------------------------------------------ * | | * | a |------------------------------------------| A [ +/-] | * | | * ------------------------------------------------------------------ */ public class FontScale : Gtk.EventBox { /** * FontScale:value: * * Current value. */ public double @value { get; set; default = 0.0; } /** * FontScale:adjustment: * * #Gtk.Adjustment in use */ public Gtk.Adjustment adjustment { get { return scale.get_adjustment(); } set { scale.set_adjustment(value); spin.set_adjustment(value); } } Gtk.Box container; Gtk.Scale scale; Gtk.SpinButton spin; ReactiveLabel min; ReactiveLabel max; public FontScale () { Object(name: "FontScale"); scale = new Gtk.Scale.with_range(Gtk.Orientation.HORIZONTAL, MIN_FONT_SIZE, MAX_FONT_SIZE, 0.5); scale.draw_value = false; scale.set_range(MIN_FONT_SIZE, MAX_FONT_SIZE); scale.set_increments(0.5, 1.0); spin = new Gtk.SpinButton.with_range(MIN_FONT_SIZE, MAX_FONT_SIZE, 0.5); spin.set_adjustment(adjustment); min = new ReactiveLabel(null); max = new ReactiveLabel(null); min.label.set_markup(" A "); max.label.set_markup(" A "); container = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 5); container.pack_start(min, false, true, 2); container.pack_start(scale, true, true, 0); container.pack_start(max, false, true, 2); container.pack_end(spin, false, true, 8); container.border_width = 5; add(container); min.clicked.connect(() => { scale.set_value(MIN_FONT_SIZE); }); max.clicked.connect(() => { scale.set_value(MAX_FONT_SIZE); }); bind_property("value", spin, "value", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); } /** * add_style_class: * * Convenience function which applies given style_class. */ public void add_style_class (string gtk_style_class) { container.forall((w) => { if ((w is Gtk.SpinButton) || (w is Gtk.Scale)) return; w.get_style_context().add_class(gtk_style_class); }); get_style_context().add_class(gtk_style_class); return; } /** * {@inheritDoc} */ public override void show () { container.show(); min.show(); max.show(); spin.show(); scale.show(); base.show(); return; } } master-0.7.3/lib/UX/Widgets/Labels.vala000066400000000000000000000050531300074171200175710ustar00rootroot00000000000000/* Labels.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ /** * WelcomeLabel: * * It's intended use is as a placeholder, providing helpful information * about an empty area which the user may not yet be familiar with. */ public class WelcomeLabel : Gtk.Label { public WelcomeLabel (string? str) { Object(name: "WelcomeLabel", use_markup: true, label: str, margin: 64, sensitive: false, expand: true, wrap: true, wrap_mode: Pango.WrapMode.WORD_CHAR, valign: Gtk.Align.START, halign: Gtk.Align.FILL, justify: Gtk.Justification.CENTER); } } /** * ReactiveLabel: * * Label which reacts to mouseover and click events. * Is actually a #Gtk.EventBox containing a #Gtk.Label since * events can not be added to widgets that have no window. */ public class ReactiveLabel : Gtk.EventBox { /** * ReactiveLabel::clicked: * * Emitted when the label is clicked */ public signal void clicked (); /** * Reactivelabel:label: * * The actual #Gtk.Label */ public Gtk.Label label { get; private set; } public ReactiveLabel (string? str) { Object(name: "ReactiveLabel"); label = new Gtk.Label(str); label.opacity = 0.65; add(label); } /** * {@inheritDoc} */ public override void show () { label.show(); base.show(); return; } public override bool enter_notify_event (Gdk.EventCrossing event) { label.opacity = 0.95; return false; } public override bool leave_notify_event (Gdk.EventCrossing event) { label.opacity = 0.65; return false; } public override bool button_press_event (Gdk.EventButton event) { this.clicked(); return false; } } master-0.7.3/lib/UX/Widgets/TextViews.vala000077500000000000000000000467631300074171200203510ustar00rootroot00000000000000/* TextViews.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { /** * FontPreview - Full featured font preview widget * * ----------------------------------------------------------------- * | | | | * | #ActivePreview | #WaterfallPreview | #TextPreview | * | | | | * ----------------------------------------------------------------- */ public class FontPreview : Gtk.Stack { /** * FontPreview::mode_changed: */ public signal void mode_changed (string mode); /** * FontPreview::preview_text_changed: */ public signal void preview_text_changed (string preview_text); /** * FontPreview:pangram: * * The pangram displayed in #WaterfallPreview */ public string pangram { get { return waterfall.pangram; } set { waterfall.pangram = "%s\n".printf(value); } } /** * FontPreview:preview_size: * * Font point size */ public double preview_size { get { return preview.preview_size; } set { preview.preview_size = body_text.preview_size = value; } } /** * FontPreview:font_desc: * * The #Pango.FontDescription in use */ public Pango.FontDescription font_desc { get { return _font_desc; } set { _font_desc = preview.font_desc = body_text.font_desc = value; tag_table.lookup("FontDescription").font_desc = _font_desc; } } /** * FontPreview:mode: * * One of "Preview", "Waterfall" or "Body Text" */ public string mode { get { return get_visible_child_name(); } set { set_visible_child_name(value); } } protected Pango.FontDescription _font_desc; protected ActivePreview preview; protected WaterfallPreview waterfall; protected TextPreview body_text; protected StandardTextTagTable tag_table; public FontPreview () { Object(name: "FontPreview"); tag_table = new StandardTextTagTable(); preview = new ActivePreview(tag_table); waterfall = new WaterfallPreview(tag_table); body_text = new TextPreview(tag_table); body_text.preview.name = "BodyTextPreview"; font_desc = Pango.FontDescription.from_string(DEFAULT_FONT); preview.adjustment = body_text.adjustment = new Gtk.Adjustment(DEFAULT_PREVIEW_SIZE, MIN_FONT_SIZE, MAX_FONT_SIZE, 0.5, 1.0, 0); add_titled(preview, "Preview", _("Preview")); add_titled(waterfall, "Waterfall", _("Waterfall")); add_titled(body_text, "Body Text", _("Body Text")); set_transition_type(Gtk.StackTransitionType.CROSSFADE); preview.preview_text_changed.connect((n) => { this.preview_text_changed(n); }); preview.notify["preview-size"].connect(() => { notify_property("preview-size"); }); notify["visible-child-name"].connect(() => { get_visible_child().queue_draw(); mode_changed(mode); return; }); } /** * set_preview_text: * * Sets the text to display in #ActivePreview */ public void set_preview_text (string preview_text) { preview.set_preview_text(preview_text); return; } /** * {@inheritDoc} */ public override void show () { preview.show(); waterfall.show(); body_text.show(); base.show(); return; } } /** * StandardTextTagTable: * * Convenience class for setting attributes related to font rendering * in a #Gtk.TextView */ public class StandardTextTagTable : Gtk.TextTagTable { const string [] defaults = { "FontDescription", "FontSize", "SizePoint", "FontFallback" }; construct { foreach (string tag in defaults) add(new Gtk.TextTag(tag)); Gtk.TextTag sp = lookup(defaults[2]); sp.family = "Monospace"; sp.rise = 1250; sp.size_points = 6.0; Gtk.TextTag fb = lookup(defaults[3]); fb.fallback = false; } } /** * StandardTextView: * * Is actually a #Gtk.ScrolledWindow containing a #Gtk.TextView. */ public class StandardTextView : Gtk.ScrolledWindow { /** * StandardTextView::menu_request: * * Emitted when the user right clicks the view */ public signal void menu_request (Gtk.Widget widget, Gdk.EventButton event); /** * StandardTextView:view: * * The actual #Gtk.TextView */ public Gtk.TextView view { get; private set; } /** * StandardTextView:buffer: * * The #Gtk.Textbuffer attached to this view */ public Gtk.TextBuffer buffer { get { return view.get_buffer(); } set { view.set_buffer(value); } } /** * StandardTextView:tag_table: * * The #Gtk.TextTagTable attached to this view */ public Gtk.TextTagTable? tag_table { get { return buffer.get_tag_table(); } set { buffer = new Gtk.TextBuffer(value); } } construct { view = new Gtk.TextView(); view.margin = DEFAULT_MARGIN_SIZE / 2; view.editable = false; view.cursor_visible = false; view.accepts_tab = false; view.overwrite = false; view.wrap_mode = Gtk.WrapMode.WORD_CHAR; add(view); } public StandardTextView (StandardTextTagTable? tag_table) { Object(name: "StandardTextView", tag_table: tag_table, expand: true); get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); } /** * {@inheritDoc} */ public override void show () { view.show(); base.show(); return; } /** * @return the text currently displayed in view */ public string get_buffer_text () { Gtk.TextIter start, end; view.get_buffer().get_bounds(out start, out end); return view.get_buffer().get_text(start, end, false); } public virtual bool on_event (Gdk.Event event) { if (event.type == Gdk.EventType.BUTTON_PRESS && event.button.button == 3) { menu_request (this, event.button); debug("Context menu request - %s", this.name); return true; } return false; } } /** * StaticTextView: * * Discards all events except right click which emits menu_request */ public class StaticTextView : StandardTextView { public StaticTextView (StandardTextTagTable? tag_table) { Object(name: "StaticTextView", tag_table: tag_table); get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); this.view.event.connect(on_event); /* XXX : Silence warning - Vala binding issue? */ Gtk.TargetList? list = null; Gtk.drag_dest_set_target_list(this.view, list); } public override bool on_event (Gdk.Event event) { if (event.type == Gdk.EventType.SCROLL) return false; if (event.type == Gdk.EventType.BUTTON_PRESS && event.button.button == 3) return base.on_event(event); ((Gtk.TextView) this.view).get_window(Gtk.TextWindowType.TEXT).set_cursor(null); return true; } } /** * AdjustablePreview: * * Base class for zoomable text previews */ public abstract class AdjustablePreview : Gtk.Box { public double preview_size { get { return _preview_size; } set { _preview_size = value.clamp(MIN_FONT_SIZE, MAX_FONT_SIZE); Idle.add(() => { set_preview_size_internal(_preview_size); return false; }); } } public Gtk.Adjustment adjustment { get { return fontscale.adjustment; } set { fontscale.adjustment = value; fontscale.adjustment.bind_property("value", this, "preview-size", BindingFlags.BIDIRECTIONAL); } } protected double _preview_size; protected FontScale fontscale; protected abstract void set_preview_size_internal (double new_size); construct { name = "AdjustablePreview"; fontscale = new FontScale(); adjustment = fontscale.adjustment; pack_end(fontscale, false, true, 0); get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); fontscale.add_style_class(Gtk.STYLE_CLASS_VIEW); } /** * {@inheritDoc} */ public override void show () { fontscale.show(); base.show(); return; } protected double get_desc_size () { if (preview_size <= 10) return preview_size; else if (preview_size <= 20) return preview_size / 1.25; else if (preview_size <= 30) return preview_size / 1.5; else if (preview_size <= 50) return preview_size / 1.75; else return preview_size / 2; } } /** * ActivePreview: * * Default preview allows justification, editing and zooming of preview text */ public class ActivePreview : AdjustablePreview { public signal void preview_text_changed (string preview_text); public StandardTextView preview { get; private set; } public Pango.FontDescription font_desc { get { return _font_desc; } set { _font_desc = value; preview.tag_table.lookup("FontDescription").font_desc = _font_desc; this.update(); } } bool editing = false; PreviewControls controls; weak Pango.FontDescription _font_desc; construct { name = "ActivePreview"; orientation = Gtk.Orientation.VERTICAL; } public class ActivePreview (StandardTextTagTable tag_table) { preview = new StandardTextView(tag_table); preview.view.justification = Gtk.Justification.CENTER; set_preview_text(get_localized_preview_text()); preview_size = DEFAULT_PREVIEW_SIZE; controls = new PreviewControls(); pack_start(controls, false, true, 0); pack_start(preview, true, true, 0); connect_signals(); } /** * {@inheritDoc} */ public override void show () { controls.show(); preview.show(); base.show(); return; } public string get_buffer_text () { return preview.get_buffer_text(); } public void set_preview_text (string preview_text) { preview.buffer.set_text(preview_text, -1); return; } public void update () { var buffer = preview.buffer; Gtk.TextIter start, end; buffer.get_bounds(out start, out end); buffer.apply_tag(preview.tag_table.lookup("FontDescription"), start, end); buffer.apply_tag(preview.tag_table.lookup("FontSize"), start, end); buffer.apply_tag(preview.tag_table.lookup("FontFallback"), start, end); Idle.add(() => { preview.queue_draw(); return false; }); return; } protected override void set_preview_size_internal (double new_size) { preview.tag_table.lookup("FontSize").size_points = new_size; if (unlikely(_font_desc != null)) this.update(); return; } void connect_signals () { preview.buffer.changed.connect((b) => { this.update(); var new_preview = preview.get_buffer_text(); bool sensitive = (get_localized_preview_text() != new_preview); controls.clear_is_sensitive = sensitive; preview_text_changed(new_preview); }); controls.justification_set.connect((j) => { preview.view.set_justification(j); }); controls.editing.connect((e) => { on_edit_toggled(e); } ); controls.on_clear_clicked.connect(() => { on_clear(); }); preview.view.event.connect(on_textview_event); return; } void on_clear () { preview.buffer.set_text(get_localized_preview_text(), -1); controls.clear_is_sensitive = false; return; } bool on_textview_event (Gtk.Widget widget, Gdk.Event event) { if (editing || event.type == Gdk.EventType.SCROLL) return false; else if (event.type == Gdk.EventType.BUTTON_PRESS && event.button.button == 3) return preview.on_event(event); else { ((Gtk.TextView) widget).get_window(Gtk.TextWindowType.TEXT).set_cursor(null); return true; } } void on_edit_toggled (bool allow_edit) { editing = allow_edit; preview.view.editable = allow_edit; preview.view.cursor_visible = allow_edit; preview.view.accepts_tab = allow_edit; if (allow_edit) { Gdk.Cursor cursor = new Gdk.Cursor.for_display(Gdk.Display.get_default(), Gdk.CursorType.XTERM); Gdk.Window text_window = preview.view.get_window(Gtk.TextWindowType.TEXT); text_window.set_cursor(cursor); preview.grab_focus(); } else { Gtk.TextIter end; Gtk.TextBuffer buff = preview.buffer; buff.get_end_iter(out end); buff.select_range(end, end); } return; } } /** * TextPreview: * * Used to display zoomable paragraphs of text. */ public class TextPreview : AdjustablePreview { public StaticTextView preview { get; private set; } public Pango.FontDescription font_desc { get { return _font_desc; } set { _font_desc = value; this.update(); } } Pango.FontDescription _font_desc; public class TextPreview (StandardTextTagTable tag_table) { Object(name: "TextPreview", orientation: Gtk.Orientation.VERTICAL); preview = new StaticTextView(tag_table); preview.view.justification = Gtk.Justification.FILL; set_preview_text(LOREM_IPSUM); pack_start(preview, true, true, 0); } /** * {@inheritDoc} */ public override void show () { preview.show(); base.show(); return; } public string get_buffer_text () { return preview.get_buffer_text(); } public void set_preview_text (string preview_text) { preview.buffer.set_text(preview_text, -1); return; } public void update () { var buffer = preview.buffer; Gtk.TextIter start, end; buffer.get_bounds(out start, out end); buffer.apply_tag(preview.tag_table.lookup("FontDescription"), start, end); buffer.apply_tag(preview.tag_table.lookup("FontSize"), start, end); buffer.apply_tag(preview.tag_table.lookup("FontFallback"), start, end); Idle.add(() => { preview.queue_draw(); return false; }); return; } protected override void set_preview_size_internal (double new_size) { preview.tag_table.lookup("FontSize").size_points = new_size; this.update(); return; } } /** * WaterfallPreview: * * @tag_table #StandardTextTagTable * * #Gtk.TextView which will render the given pangram in waterfall style * from MIN_FONT_SIZE to MAX_FONT_SIZE with the attributes specified * in @tag_table */ public class WaterfallPreview : StaticTextView { public string pangram { get { return _pangram; } set { _pangram = "%s\n".printf(value); this.update(); } } string _pangram; public WaterfallPreview (StandardTextTagTable tag_table) { base(tag_table); name = "WaterfallPreview"; view.pixels_above_lines = 1; view.wrap_mode = Gtk.WrapMode.NONE; pangram = get_localized_pangram(); } public void update () { buffer.set_text("", -1); Gtk.TextIter iter; for (int i = (int) MIN_FONT_SIZE; i <= MAX_FONT_SIZE; i++) { var line = i.to_string(); string point; if (i < 10) point = "%spt. ".printf(line); else point = "%spt. ".printf(line); buffer.get_iter_at_line(out iter, i); buffer.insert_with_tags_by_name(ref iter, point, -1, "SizePoint", null); if (tag_table.lookup(line) == null) buffer.create_tag(line, "size-points", (double) i, null); buffer.get_end_iter(out iter); buffer.insert_with_tags_by_name(ref iter, _pangram, -1, line, "FontDescription", null); } Gtk.TextIter start, end; buffer.get_bounds(out start, out end); buffer.apply_tag(this.tag_table.lookup("FontFallback"), start, end); return; } } } master-0.7.3/lib/UX/Widgets/TreeViews.vala000066400000000000000000000070501300074171200203030ustar00rootroot00000000000000/* TreeViews.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ /** * BaseTreeView: * * Convenience class that signals on right click. */ public class BaseTreeView : Gtk.TreeView { /** * BaseTreeView::menu_request: * * Emitted on right click */ public signal void menu_request (Gtk.Widget widget, Gdk.EventButton event); public override bool button_press_event (Gdk.EventButton event) { if (event.button == 3) { menu_request(this, event); verbose("Context menu request - %s", this.name); return true; } return base.button_press_event(event); } } /** * MultiDNDTreeView: * * #Gtk.TreeView which supports drag and drop for multiple selections. * * Was this originally from Quod Libet? Think it was. Thanks. */ public class MultiDNDTreeView : BaseTreeView { struct PendingEvent { double x; double y; bool active; } PendingEvent pending_event; construct { name = "MultiDNDTreeView"; rubber_banding = true; get_selection().set_mode(Gtk.SelectionMode.MULTIPLE); pending_event = PendingEvent(); } public override bool button_press_event (Gdk.EventButton event) { if (event.button == 3) return base.button_press_event(event); Gtk.TreePath path; get_path_at_pos((int) event.x, (int) event.y, out path, null, null, null); if (path == null) return true; var selection = get_selection(); if (selection.path_is_selected(path) && (event.state & (Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.SHIFT_MASK)) == 0) { pending_event.x = event.x; pending_event.y = event.y; pending_event.active = true; selection.set_select_function((s, m, p, b) => { return false; }); } else { pending_event.x = 0.0; pending_event.y = 0.0; pending_event.active = false; selection.set_select_function((s, m, p, b) => { return true; }); } path = null; return base.button_press_event(event); } public override bool button_release_event (Gdk.EventButton event) { if (pending_event.active) { var selection = get_selection(); selection.set_select_function((s, m, p, b) => { return true; }); pending_event.active = false; if (pending_event.x != event.x || pending_event.y != event.y) return true; Gtk.TreePath path; if (get_path_at_pos((int) event.x, (int) event.y, out path, null, null, null)) set_cursor(path, null, false); } return base.button_release_event(event); } public override void drag_begin (Gdk.DragContext context) { return; } } master-0.7.3/lib/ValaSources.mk000066400000000000000000000041471300074171200163430ustar00rootroot00000000000000# Do not edit directly. See build-aux directory libfontmanager_la_VALASOURCES = \ Common/About.vala \ Common/ArchiveManager.vala \ Common/Cacheable.vala \ Common/Collections.vala \ Common/Constants.vala \ Common/Database.vala \ Common/FontData.vala \ Common/FontInfo.vala \ Common/JsonWriter.vala \ Common/Logger.vala \ Common/Settings.vala \ Common/Utils.vala \ Filters/Category.vala \ Filters/Collection.vala \ Filters/Disabled.vala \ Filters/Filter.vala \ Filters/SearchResult.vala \ Filters/Unsorted.vala \ FontConfig/Alias.vala \ FontConfig/Common.vala \ FontConfig/Directories.vala \ FontConfig/Enums.vala \ FontConfig/Families.vala \ FontConfig/Family.vala \ FontConfig/Font.vala \ FontConfig/MonitoredFiles.vala \ FontConfig/Properties.vala \ FontConfig/Selections.vala \ FontConfig/Sources.vala \ FontConfig/XmlWriter.vala \ Glue/Glue.vala \ Library/Install.vala \ Library/Library.vala \ Library/Query.vala \ Library/Remove.vala \ Library/Sorter.vala \ UX/CharacterMap/CharacterDetails.vala \ UX/CharacterMap/CharacterMapSideBar.vala \ UX/CharacterMap/CharacterTable.vala \ UX/Controls/BaseControls.vala \ UX/Controls/CollectionControls.vala \ UX/Controls/FontListControls.vala \ UX/Controls/PreviewControls.vala \ UX/FontConfig/Controls.vala \ UX/FontConfig/DisplayPropertiesPane.vala \ UX/FontConfig/FontPropertiesPane.vala \ UX/FontConfig/FontSourceList.vala \ UX/FontConfig/PreferencePane.vala \ UX/FontConfig/SubpixelGeometry.vala \ UX/FontConfig/Substitute.vala \ UX/Metadata/Description.vala \ UX/Metadata/License.vala \ UX/Metadata/Properties.vala \ UX/Metadata/Title.vala \ UX/Models/CategoryModel.vala \ UX/Models/CollectionModel.vala \ UX/Models/FontModel.vala \ UX/Models/UserFontModel.vala \ UX/Trees/CategoryTree.vala \ UX/Trees/CollectionTree.vala \ UX/Trees/FontListTree.vala \ UX/Trees/UserFontTree.vala \ UX/Utils/Color.vala \ UX/Utils/FileSelector.vala \ UX/Utils/Utils.vala \ UX/Views/FontPreviewPane.vala \ UX/Widgets/CellRendererPill.vala \ UX/Widgets/Controls.vala \ UX/Widgets/Labels.vala \ UX/Widgets/TextViews.vala \ UX/Widgets/TreeViews.vala master-0.7.3/po/000077500000000000000000000000001300074171200134255ustar00rootroot00000000000000master-0.7.3/po/HEADER000077500000000000000000000015271300074171200143100ustar00rootroot00000000000000# Font Manager - Simple font management for Gtk+ desktop environments # # Copyright (C) 2009 - 2016 Jerry Casiano # # This file is part of Font Manager. # # 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 . # # Author: # Jerry Casiano master-0.7.3/po/LINGUAS000066400000000000000000000000371300074171200144520ustar00rootroot00000000000000ar de_DE pl zh_CN zh_HK zh_TW master-0.7.3/po/Makevars000066400000000000000000000065421300074171200151300ustar00rootroot00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE_NAME) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. # This tells whether or not to prepend "GNU " prefix to the package # name that gets inserted into the header of the $(DOMAIN).pot file. # Possible values are "yes", "no", or empty. If it is empty, try to # detect it automatically by scanning the files in $(top_srcdir) for # "GNU packagename" string. PACKAGE_GNU = # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = https://github.com/FontManager/master/issues # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' # context. Possible values are "yes" and "no". Set this to yes if the # package uses functions taking also a message context, like pgettext(), or # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. USE_MSGCTXT = no # These options get passed to msgmerge. # Useful options are in particular: # --previous to keep previous msgids of translated messages, # --quiet to reduce the verbosity. MSGMERGE_OPTIONS = # These options get passed to msginit. # If you want to disable line wrapping when writing PO files, add # --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and # MSGINIT_OPTIONS. MSGINIT_OPTIONS = # This tells whether or not to regenerate a PO file when $(DOMAIN).pot # has changed. Possible values are "yes" and "no". Set this to no if # the POT file is checked in the repository and the version control # program ignores timestamps. PO_DEPENDS_ON_POT = no # This tells whether or not to forcibly update $(DOMAIN).pot and # regenerate PO files on "make dist". Possible values are "yes" and # "no". Set this to no if the POT file and PO files are maintained # externally. DIST_DEPENDS_ON_UPDATE_PO = no master-0.7.3/po/POTFILES.in000066400000000000000000000056761300074171200152200ustar00rootroot00000000000000lib/Common/About.vala lib/Common/ArchiveManager.vala lib/Common/Cacheable.vala lib/Common/Collections.vala lib/Common/Constants.vala lib/Common/Database.vala lib/Common/FontData.vala lib/Common/FontInfo.vala lib/Common/JsonWriter.vala lib/Common/Logger.vala lib/Common/Settings.vala lib/Common/Utils.vala lib/Filters/Category.vala lib/Filters/Collection.vala lib/Filters/Disabled.vala lib/Filters/Filter.vala lib/Filters/SearchResult.vala lib/Filters/Unsorted.vala lib/FontConfig/Alias.vala lib/FontConfig/Common.vala lib/FontConfig/Directories.vala lib/FontConfig/Enums.vala lib/FontConfig/Families.vala lib/FontConfig/Family.vala lib/FontConfig/Font.vala lib/FontConfig/MonitoredFiles.vala lib/FontConfig/Properties.vala lib/FontConfig/Selections.vala lib/FontConfig/Sources.vala lib/FontConfig/XmlWriter.vala lib/Glue/Glue.vala lib/Library/Install.vala lib/Library/Library.vala lib/Library/Query.vala lib/Library/Remove.vala lib/Library/Sorter.vala lib/UX/CharacterMap/CharacterDetails.vala lib/UX/CharacterMap/CharacterMapSideBar.vala lib/UX/CharacterMap/CharacterTable.vala lib/UX/Controls/BaseControls.vala lib/UX/Controls/CollectionControls.vala lib/UX/Controls/FontListControls.vala lib/UX/Controls/PreviewControls.vala lib/UX/FontConfig/Controls.vala lib/UX/FontConfig/DisplayPropertiesPane.vala lib/UX/FontConfig/FontPropertiesPane.vala lib/UX/FontConfig/FontSourceList.vala lib/UX/FontConfig/PreferencePane.vala lib/UX/FontConfig/SubpixelGeometry.vala lib/UX/FontConfig/Substitute.vala lib/UX/Metadata/Description.vala lib/UX/Metadata/License.vala lib/UX/Metadata/Properties.vala lib/UX/Metadata/Title.vala lib/UX/Models/CategoryModel.vala lib/UX/Models/CollectionModel.vala lib/UX/Models/FontModel.vala lib/UX/Models/UserFontModel.vala lib/UX/Trees/CategoryTree.vala lib/UX/Trees/CollectionTree.vala lib/UX/Trees/FontListTree.vala lib/UX/Trees/UserFontTree.vala lib/UX/Utils/Color.vala lib/UX/Utils/FileSelector.vala lib/UX/Utils/Utils.vala lib/UX/Views/FontPreviewPane.vala lib/UX/Widgets/CellRendererPill.vala lib/UX/Widgets/Controls.vala lib/UX/Widgets/Labels.vala lib/UX/Widgets/TextViews.vala lib/UX/Widgets/TreeViews.vala src/font-manager/Application.vala src/font-manager/Browse.vala src/font-manager/Compare.vala src/font-manager/Main.vala src/font-manager/MainWindow.vala src/font-manager/Migration.vala src/font-manager/Preferences/Display.vala src/font-manager/Preferences/Interface.vala src/font-manager/Preferences/Preferences.vala src/font-manager/Preferences/Rendering.vala src/font-manager/Preferences/Sources.vala src/font-manager/RenderingOptions.vala src/font-manager/SideBar.vala src/font-manager/State.vala src/font-manager/TitleBar.vala src/font-viewer/Application.vala src/font-viewer/MainWindow.vala src/font-viewer/State.vala src/font-viewer/TitleBar.vala tests/TestCase.vala tests/TestFontConfig.vala tests/TestMain.vala tests/TestUtils.vala [type: gettext/glade]data/ApplicationMenu.ui data/org.gnome.FontManager.appdata.xml.in data/org.gnome.FontManager.desktop.in master-0.7.3/po/POTFILES.readme000066400000000000000000000000711300074171200160270ustar00rootroot00000000000000Do not edit POTFILES.* directly. See build-aux directory master-0.7.3/po/POTFILES.skip000066400000000000000000000050671300074171200155520ustar00rootroot00000000000000lib/Common/About.c lib/Common/ArchiveManager.c lib/Common/Cacheable.c lib/Common/Collections.c lib/Common/Constants.c lib/Common/Database.c lib/Common/FontData.c lib/Common/FontInfo.c lib/Common/JsonWriter.c lib/Common/Logger.c lib/Common/Settings.c lib/Common/Utils.c lib/Filters/Category.c lib/Filters/Collection.c lib/Filters/Disabled.c lib/Filters/Filter.c lib/Filters/SearchResult.c lib/Filters/Unsorted.c lib/FontConfig/Alias.c lib/FontConfig/Common.c lib/FontConfig/Directories.c lib/FontConfig/Enums.c lib/FontConfig/Families.c lib/FontConfig/Family.c lib/FontConfig/Font.c lib/FontConfig/MonitoredFiles.c lib/FontConfig/Properties.c lib/FontConfig/Selections.c lib/FontConfig/Sources.c lib/FontConfig/XmlWriter.c lib/Glue/Glue.c lib/Library/Install.c lib/Library/Library.c lib/Library/Query.c lib/Library/Remove.c lib/Library/Sorter.c lib/UX/CharacterMap/CharacterDetails.c lib/UX/CharacterMap/CharacterMapSideBar.c lib/UX/CharacterMap/CharacterTable.c lib/UX/Controls/BaseControls.c lib/UX/Controls/CollectionControls.c lib/UX/Controls/FontListControls.c lib/UX/Controls/PreviewControls.c lib/UX/FontConfig/Controls.c lib/UX/FontConfig/DisplayPropertiesPane.c lib/UX/FontConfig/FontPropertiesPane.c lib/UX/FontConfig/FontSourceList.c lib/UX/FontConfig/PreferencePane.c lib/UX/FontConfig/SubpixelGeometry.c lib/UX/FontConfig/Substitute.c lib/UX/Metadata/Description.c lib/UX/Metadata/License.c lib/UX/Metadata/Properties.c lib/UX/Metadata/Title.c lib/UX/Models/CategoryModel.c lib/UX/Models/CollectionModel.c lib/UX/Models/FontModel.c lib/UX/Models/UserFontModel.c lib/UX/Trees/CategoryTree.c lib/UX/Trees/CollectionTree.c lib/UX/Trees/FontListTree.c lib/UX/Trees/UserFontTree.c lib/UX/Utils/Color.c lib/UX/Utils/FileSelector.c lib/UX/Utils/Utils.c lib/UX/Views/FontPreviewPane.c lib/UX/Widgets/CellRendererPill.c lib/UX/Widgets/Controls.c lib/UX/Widgets/Labels.c lib/UX/Widgets/TextViews.c lib/UX/Widgets/TreeViews.c src/font-manager/Application.c src/font-manager/Browse.c src/font-manager/Compare.c src/font-manager/Main.c src/font-manager/MainWindow.c src/font-manager/Migration.c src/font-manager/Preferences/Display.c src/font-manager/Preferences/Interface.c src/font-manager/Preferences/Preferences.c src/font-manager/Preferences/Rendering.c src/font-manager/Preferences/Sources.c src/font-manager/RenderingOptions.c src/font-manager/SideBar.c src/font-manager/State.c src/font-manager/TitleBar.c src/font-viewer/Application.c src/font-viewer/MainWindow.c src/font-viewer/State.c src/font-viewer/TitleBar.c tests/TestCase.c tests/TestFontConfig.c tests/TestMain.c tests/TestUtils.c lib/Glue/Enums.c master-0.7.3/po/ar.po000066400000000000000000000525411300074171200143760ustar00rootroot00000000000000# Khaled Hosny , 2016. #zanata msgid "" msgstr "" "Project-Id-Version: font-manager 0.7.3\n" "Report-Msgid-Bugs-To: https://github.com/FontManager/master/issues\n" "POT-Creation-Date: 2016-10-16 12:57-0400\n" "PO-Revision-Date: 2016-08-05 07:54-0400\n" "Last-Translator: Khaled Hosny \n" "Language-Team: Arabic\n" "Language: ar\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Zanata 3.9.3\n" "Plural-Forms: nplurals=6; plural= n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" #: ../lib/Common/About.vala:28 msgid "Font Manager" msgstr "مدير الخطوط" #: ../lib/Common/About.vala:30 msgid "Simple font management for GTK+ desktop environments" msgstr "إدارة بسيطة للخطوط لبيئات سطح مكتك جتك+" #: ../lib/Common/About.vala:34 msgid "" "\n" " This program is free software: you can redistribute it and/or modify\n" " it under the terms of the GNU General Public License as published by\n" " the Free Software Foundation, either version 3 of the License, or\n" " (at your option) any later version.\n" "\n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" " GNU General Public License for more details.\n" "\n" " You should have received a copy of the GNU General Public License\n" " along with this program. If not, see .\n" " " msgstr "" #: ../lib/Common/Constants.vala:38 msgid "Enter Collection Name" msgstr "اكتب اسم المجموعة" #: ../lib/Filters/Collection.vala:36 msgid "New Collection" msgstr "مجموعة جديدة" #: ../lib/Filters/Disabled.vala:29 msgid "Disabled" msgstr "غير Ù…ÙØ¹Ù‘لة" #: ../lib/Filters/Disabled.vala:29 msgid "Fonts which have been disabled" msgstr "الخطوط غير Ø§Ù„Ù…ÙØ¹Ù‘لة" #: ../lib/Filters/Filter.vala:40 #, c-format msgid "Created : %s" msgstr "تاريخ الإنشاء: %s" #: ../lib/Filters/Unsorted.vala:29 msgid "Unsorted" msgstr "غير مرتبة" #: ../lib/Filters/Unsorted.vala:29 msgid "Fonts not present in any collection" msgstr "الخطوط غير الموجودة ÙÙŠ مجموعتي" #: ../lib/FontConfig/Enums.vala:70 msgid "Thin" msgstr "رÙيع" #: ../lib/FontConfig/Enums.vala:72 msgid "Ultra-Light" msgstr "Ø®Ùي٠جدا" #: ../lib/FontConfig/Enums.vala:74 ../lib/FontConfig/Enums.vala:232 msgid "Light" msgstr "Ø®ÙÙŠÙ" #: ../lib/FontConfig/Enums.vala:76 msgid "Book" msgstr "كتاب" #: ../lib/FontConfig/Enums.vala:78 ../lib/FontConfig/Enums.vala:211 msgid "Medium" msgstr "وسط" #: ../lib/FontConfig/Enums.vala:80 msgid "Semi-Bold" msgstr "شبه ثخين" #: ../lib/FontConfig/Enums.vala:82 msgid "Bold" msgstr "ثخين" #: ../lib/FontConfig/Enums.vala:84 msgid "Ultra-Bold" msgstr "ثخين جدا" #: ../lib/FontConfig/Enums.vala:86 msgid "Heavy" msgstr "ثقيل" #: ../lib/FontConfig/Enums.vala:88 msgid "Ultra-Heavy" msgstr "ثقيل جدا" #: ../lib/FontConfig/Enums.vala:104 msgid "Italic" msgstr "مائل" #: ../lib/FontConfig/Enums.vala:106 msgid "Oblique" msgstr "مائل" #: ../lib/FontConfig/Enums.vala:128 msgid "Ultra-Condensed" msgstr "مضغوط جدا" #: ../lib/FontConfig/Enums.vala:130 msgid "Extra-Condensed" msgstr "مضغوط أكثر" #: ../lib/FontConfig/Enums.vala:132 msgid "Condensed" msgstr "مضغوط" #: ../lib/FontConfig/Enums.vala:134 msgid "Semi-Condensed" msgstr "شبه مضغوط" #: ../lib/FontConfig/Enums.vala:136 msgid "Semi-Expanded" msgstr "شبه ممدد" #: ../lib/FontConfig/Enums.vala:138 msgid "Expanded" msgstr "ممدد" #: ../lib/FontConfig/Enums.vala:140 msgid "Extra-Expanded" msgstr "ممدد كثيرا" #: ../lib/FontConfig/Enums.vala:142 msgid "Ultra-Expanded" msgstr "ممدد جدا" #: ../lib/FontConfig/Enums.vala:159 msgid "Proportional" msgstr "متناسب" #: ../lib/FontConfig/Enums.vala:161 msgid "Dual Width" msgstr "مزدوج العرض" #: ../lib/FontConfig/Enums.vala:163 msgid "Monospace" msgstr "ثابت العرض" #: ../lib/FontConfig/Enums.vala:165 msgid "Charcell" msgstr "" #: ../lib/FontConfig/Enums.vala:184 msgid "Unknown" msgstr "غير معروÙ" #: ../lib/FontConfig/Enums.vala:186 msgid "RGB" msgstr "RGB" #: ../lib/FontConfig/Enums.vala:188 msgid "BGR" msgstr "BGR" #: ../lib/FontConfig/Enums.vala:190 msgid "VRGB" msgstr "VRGB" #: ../lib/FontConfig/Enums.vala:192 msgid "VBGR" msgstr "VBGR" #: ../lib/FontConfig/Enums.vala:194 ../lib/FontConfig/Enums.vala:215 #: ../lib/FontConfig/Enums.vala:236 msgid "None" msgstr "لا شيء" #: ../lib/FontConfig/Enums.vala:209 msgid "Slight" msgstr "Ø®ÙÙŠÙ" #: ../lib/FontConfig/Enums.vala:213 msgid "Full" msgstr "كامل" #: ../lib/FontConfig/Enums.vala:230 msgid "Default" msgstr "المبدئي" #: ../lib/FontConfig/Enums.vala:234 msgid "Legacy" msgstr "عتيق" #: ../lib/FontConfig/Families.vala:45 msgid "Loading available font families" msgstr "يحمّل عائلات الخطوط الموجودة" #: ../lib/FontConfig/Sources.vala:83 ../lib/FontConfig/Sources.vala:97 msgid "Source Unavailable" msgstr "المصدر غير متاح" #: ../lib/FontConfig/Sources.vala:244 ../lib/FontConfig/XmlWriter.vala:38 msgid " Generated by Font Manager. Do NOT edit this file. " msgstr " Generated by Font Manager. Do NOT edit this file. " #: ../lib/Library/Install.vala:138 msgid "Installing files" msgstr "ÙŠÙنصّب Ø§Ù„Ù…Ù„ÙØ§Øª" #: ../lib/Library/Install.vala:170 msgid "Preparing Archives" msgstr "ÙŠÙØ¬Ù‡Ù‘ز Ø§Ù„Ù…Ù„ÙØ§Øª المضغوطة" #: ../lib/Library/Remove.vala:81 msgid "Removing files" msgstr "ÙŠÙØ²ÙŠÙ„ Ø§Ù„Ù…Ù„ÙØ§Øª" #: ../lib/Library/Sorter.vala:91 msgid "Processing directories" msgstr "ÙŠÙØ¹Ø§Ù„ج الأدلّة" #: ../lib/Library/Sorter.vala:123 msgid "Processing files" msgstr "ÙŠÙØ¹Ø§Ù„ج Ø§Ù„Ù…Ù„ÙØ§Øª" #: ../lib/UX/CharacterMap/CharacterMapSideBar.vala:96 msgid "Unicode Script" msgstr "نظام الكتابة" #: ../lib/UX/CharacterMap/CharacterMapSideBar.vala:97 msgid "Unicode Block" msgstr "قالب يونيكود" #: ../lib/UX/Controls/CollectionControls.vala:32 msgid "Add new collection" msgstr "أض٠مجموعة جديدة" #: ../lib/UX/Controls/CollectionControls.vala:33 msgid "Remove selected collection" msgstr "احذ٠المجموعة المحددة" #: ../lib/UX/Controls/FontListControls.vala:46 msgid "Remove selected font from collection" msgstr "احذ٠الخط المحدد من المجموعة" #: ../lib/UX/Controls/FontListControls.vala:50 #: ../lib/UX/Controls/FontListControls.vala:65 msgid "Expand all" msgstr "مدّد الكل" #: ../lib/UX/Controls/FontListControls.vala:54 msgid "Search Families..." msgstr "ابحث ÙÙŠ العائلات…" #: ../lib/UX/Controls/FontListControls.vala:65 msgid "Collapse all" msgstr "قلّص الكل" #: ../lib/UX/Controls/PreviewControls.vala:91 msgid "Edit preview text" msgstr "حرّر نص المعاينة" #: ../lib/UX/Controls/PreviewControls.vala:94 msgid "Undo changes" msgstr "تراجع عن التغييرات" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Left Aligned" msgstr "محاذى إلى اليسار" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Centered" msgstr "Ù…Ùوسّط" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Fill" msgstr "Ù…ÙØ³Ø§ÙˆÙ‰" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Right Aligned" msgstr "محاذى إلى اليمين" #: ../lib/UX/FontConfig/Controls.vala:66 msgid "Save" msgstr "Ø§Ø­ÙØ¸" #: ../lib/UX/FontConfig/Controls.vala:68 msgid "Discard" msgstr "ألغÙ" #: ../lib/UX/FontConfig/Controls.vala:70 msgid "Running applications may require a restart to reflect any changes." msgstr "تحتاج إعادة تشغيل البرامج Ø§Ù„Ù…ÙØªÙˆØ­Ø© لتطبيق التغييرات." #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:44 msgid "Target DPI" msgstr "" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:45 msgid "Scale factor" msgstr "معامل التكبير" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:49 msgid "LCD Filter" msgstr "مرشح LCD" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:54 msgid "Antialias" msgstr "التنعيم" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:55 msgid "Hinting" msgstr "التلميح" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:56 msgid "Enable Autohinter" msgstr "ÙØ¹Ù‘Ù„ Ø§Ù„Ù…Ù„Ù…Ù‘ÙØ­ الآلي" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:64 msgid "Hinting Style" msgstr "أسلوب التلميح" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:65 msgid "Use Embedded Bitmaps" msgstr "استخدم البتمابات المدمجة" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:67 #: ../lib/UX/FontConfig/FontPropertiesPane.vala:72 msgid " Size Restrictions " msgstr " قيود الحجم " #: ../lib/UX/FontConfig/FontPropertiesPane.vala:70 msgid " Apply settings to point sizes " msgstr " طبّق الإعدادات على المقاسات " #: ../lib/UX/FontConfig/FontPropertiesPane.vala:143 msgid "Smaller than" msgstr "أصغر من" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:144 msgid "Larger than" msgstr "أكبر من" #: ../lib/UX/FontConfig/FontSourceList.vala:26 msgid "Font Sources" msgstr "مصادر الخطوط" #: ../lib/UX/FontConfig/FontSourceList.vala:27 msgid "Easily add or preview fonts without actually installing them." msgstr "أض٠و عاين الخطوط بسهولة دون تنصيبهم." #: ../lib/UX/FontConfig/FontSourceList.vala:28 msgid "" "To add a new source simply drag a folder onto this area or click the add " "button in the toolbar." msgstr "" "Ù„Ø¥Ø¶Ø§ÙØ© خطوط جديدة يمكنك إما سحب المجلد إلى هذه المنطقة أو النقر على زر " "Ø§Ù„Ø¥Ø¶Ø§ÙØ© ÙÙŠ شريط الأدوات." #: ../lib/UX/FontConfig/FontSourceList.vala:194 msgid "Select source folders" msgstr "اختر مجلدات المصادر" #: ../lib/UX/FontConfig/FontSourceList.vala:197 #: ../lib/UX/Utils/FileSelector.vala:40 ../lib/UX/Utils/FileSelector.vala:67 #: ../src/font-manager/Migration.vala:58 msgid "_Cancel" msgstr "Ø£_لغÙ" #: ../lib/UX/FontConfig/FontSourceList.vala:199 #: ../lib/UX/Utils/FileSelector.vala:42 msgid "_Open" msgstr "ا_ÙØªØ­" #: ../lib/UX/FontConfig/SubpixelGeometry.vala:55 msgid "Subpixel Geometry" msgstr "" #: ../lib/UX/FontConfig/Substitute.vala:78 msgid "prefer" msgstr "ÙØ¶Ù‘Ù„" #: ../lib/UX/FontConfig/Substitute.vala:79 msgid "accept" msgstr "اقبل" #: ../lib/UX/FontConfig/Substitute.vala:80 msgid "default" msgstr "المبدئي" #: ../lib/UX/Metadata/License.vala:42 msgid "File does not contain license information." msgstr "لا يحتوي المل٠على معلومات الترخيص." #: ../lib/UX/Metadata/Properties.vala:43 msgid "PostScript Name" msgstr "اسم بوستسكربت" #: ../lib/UX/Metadata/Properties.vala:44 #: ../lib/UX/Models/CategoryModel.vala:104 msgid "Weight" msgstr "الوزن" #: ../lib/UX/Metadata/Properties.vala:45 #: ../lib/UX/Models/CategoryModel.vala:102 msgid "Slant" msgstr "الميلان" #: ../lib/UX/Metadata/Properties.vala:46 #: ../lib/UX/Models/CategoryModel.vala:106 msgid "Width" msgstr "العرض" #: ../lib/UX/Metadata/Properties.vala:47 #: ../lib/UX/Models/CategoryModel.vala:100 msgid "Spacing" msgstr "التوسع" #: ../lib/UX/Metadata/Properties.vala:48 msgid "Version" msgstr "الإصدارة" #: ../lib/UX/Metadata/Properties.vala:49 #: ../lib/UX/Models/CategoryModel.vala:112 msgid "Vendor" msgstr "البائع" #: ../lib/UX/Metadata/Title.vala:51 ../src/font-viewer/TitleBar.vala:49 msgid "OpenType Font" msgstr "خط أوبن تيب" #: ../lib/UX/Metadata/Title.vala:52 ../src/font-viewer/TitleBar.vala:50 msgid "TrueType Font" msgstr "خط ترو تيب" #: ../lib/UX/Metadata/Title.vala:53 ../src/font-viewer/TitleBar.vala:51 msgid "PostScript Type 1 Font" msgstr "خط بوستسكربت تيب Ù¡" #: ../lib/UX/Metadata/Title.vala:105 ../src/font-viewer/TitleBar.vala:99 msgid "No file selected" msgstr "لا Ù…Ù„ÙØ§Øª محددة" #: ../lib/UX/Metadata/Title.vala:105 ../src/font-viewer/TitleBar.vala:100 msgid "Or unsupported filetype." msgstr "أو نوع المل٠غير مدعوم." #: ../lib/UX/Models/CategoryModel.vala:92 msgid "All" msgstr "الكل" #: ../lib/UX/Models/CategoryModel.vala:92 msgid "All Fonts" msgstr "كل الخطوط" #: ../lib/UX/Models/CategoryModel.vala:94 msgid "System" msgstr "النظام" #: ../lib/UX/Models/CategoryModel.vala:94 msgid "Fonts available to all users" msgstr "الخطوط المتاحة لكل المستخدمين" #: ../lib/UX/Models/CategoryModel.vala:96 msgid "User" msgstr "المستخدم" #: ../lib/UX/Models/CategoryModel.vala:96 msgid "Fonts available only to you" msgstr "الخطوط المتاحة لك Ùقط" #: ../lib/UX/Models/CategoryModel.vala:100 msgid "Grouped by font spacing" msgstr "مجمّعة حسب توسع الخط" #: ../lib/UX/Models/CategoryModel.vala:102 msgid "Grouped by font angle" msgstr "مجمّعة حسب زاوية الخط" #: ../lib/UX/Models/CategoryModel.vala:104 msgid "Grouped by font weight" msgstr "مجمّعة حسب وزن الخط" #: ../lib/UX/Models/CategoryModel.vala:106 msgid "Grouped by font width" msgstr "مجمّعة حسب عرض الخط" #: ../lib/UX/Models/CategoryModel.vala:108 msgid "Filetype" msgstr "نوع الملÙ" #: ../lib/UX/Models/CategoryModel.vala:108 msgid "Grouped by filetype" msgstr "مجمّعة حسب نوع الملÙ" #: ../lib/UX/Models/CategoryModel.vala:110 #: ../lib/UX/Views/FontPreviewPane.vala:123 msgid "License" msgstr "الترخيص" #: ../lib/UX/Models/CategoryModel.vala:110 msgid "Grouped by license type" msgstr "مجمّعة حسب نوع الترخيص" #: ../lib/UX/Models/CategoryModel.vala:112 msgid "Grouped by vendor" msgstr "مجمّعة حسب البائع" #: ../lib/UX/Models/CategoryModel.vala:125 msgid "Family Kind" msgstr "نوع العائلة" #: ../lib/UX/Models/CategoryModel.vala:125 msgid "Only fonts which include Panose information will be grouped here." msgstr "لن تظهر سوى الخطوط التي تحتوي معلومات Panose." #: ../lib/UX/Models/CategoryModel.vala:126 msgid "Any" msgstr "أي شيء" #: ../lib/UX/Models/CategoryModel.vala:127 msgid "No Fit" msgstr "لا شيء مناسب" #: ../lib/UX/Models/CategoryModel.vala:128 msgid "Text and Display" msgstr "النص و العناوين" #: ../lib/UX/Models/CategoryModel.vala:129 msgid "Script" msgstr "" #: ../lib/UX/Models/CategoryModel.vala:130 msgid "Decorative" msgstr "زخرÙÙŠ" #: ../lib/UX/Models/CategoryModel.vala:131 msgid "Pictorial" msgstr "تصويري" #: ../lib/UX/Models/CategoryModel.vala:165 msgid "Normal" msgstr "طبيعي" #: ../lib/UX/Models/CategoryModel.vala:170 msgid "Regular" msgstr "عادي" #: ../lib/UX/Utils/FileSelector.vala:37 msgid "Select files to install" msgstr "اختر Ø§Ù„Ù…Ù„ÙØ§Øª لتنصيبها" #: ../lib/UX/Utils/FileSelector.vala:68 msgid "_Delete" msgstr "ا_حذÙ" #: ../lib/UX/Utils/FileSelector.vala:75 msgid "Select fonts to remove" msgstr "اختر الخطوط لإزالتها" #: ../lib/UX/Views/FontPreviewPane.vala:57 ../lib/UX/Widgets/TextViews.vala:122 msgid "Waterfall" msgstr "شلال" #: ../lib/UX/Views/FontPreviewPane.vala:59 ../lib/UX/Widgets/TextViews.vala:123 msgid "Body Text" msgstr "متن" #: ../lib/UX/Views/FontPreviewPane.vala:61 ../lib/UX/Widgets/TextViews.vala:121 #: ../src/font-manager/MainWindow.vala:213 msgid "Preview" msgstr "عاين" #: ../lib/UX/Views/FontPreviewPane.vala:122 msgid "Properties" msgstr "الخصائص" #: ../lib/UX/Views/FontPreviewPane.vala:124 msgid "Characters" msgstr "المحارÙ" #: ../lib/UX/Views/FontPreviewPane.vala:246 msgid "Select preview type" msgstr "اختر نوع المعاينة" #: ../lib/UX/Widgets/CellRendererPill.vala:30 msgid "Variation " msgstr "تحوير" #: ../lib/UX/Widgets/CellRendererPill.vala:31 msgid "Variations" msgstr "تحويرات" #: ../src/font-manager/Compare.vala:35 msgid "Add selected font to comparison" msgstr "أض٠الخط المحدد إلى المقارنة" #: ../src/font-manager/Compare.vala:36 msgid "Remove selected font from comparison" msgstr "احذ٠الخط المحدد من المقارنة" #: ../src/font-manager/Compare.vala:43 msgid "Select text color" msgstr "اختر لون النص" #: ../src/font-manager/Compare.vala:44 msgid "Select background color" msgstr "اختر لون الخلÙية" #: ../src/font-manager/MainWindow.vala:57 #: ../src/font-manager/MainWindow.vala:219 msgid "Browse" msgstr "ØªØµÙØ­" #: ../src/font-manager/MainWindow.vala:59 #: ../src/font-manager/MainWindow.vala:214 msgid "Compare" msgstr "قارن" #: ../src/font-manager/MainWindow.vala:61 #: ../src/font-manager/MainWindow.vala:218 msgid "Manage" msgstr "أدر" #: ../src/font-manager/Migration.vala:59 msgid "_Continue" msgstr "_واصل" #: ../src/font-manager/Migration.vala:69 msgid "Update Required" msgstr "التحديث مطلوب" #: ../src/font-manager/Migration.vala:206 msgid "" "\n" "Font Manager has detected files from a previous installation. Some files " "from previous versions are incompatible with this release. Others have been " "deprecated or moved.\n" "\n" "Font Manager will now attempt to migrate your fonts and collections. Files " "and settings which are no longer necessary or valid will be deleted. Any " "configuration files that could cause a conflict will also be deleted.\n" "\n" "It is strongly recommended that you back up any important files before " "proceeding.\n" msgstr "" "\n" "اكتش٠مدير الخطوط Ù…Ù„ÙØ§Øª من تنصيب سابق. بعض Ø§Ù„Ù…Ù„ÙØ§Øª من الإصدارات السابقة غير " "متواÙقة مع هذه الإصدارة، و البعض الآخر لم يعد مدعومًا أو أزيل.\n" "\n" "لن يحاول مدير الخطوط ترحيل خطوطك و مجموعاتك. Ø§Ù„Ù…Ù„ÙØ§Øª و الإعدادات التي لم تعد " "مطلوبة أو مدعومة Ø³ØªÙØ­Ø°ÙØŒ و أي Ù…Ù„ÙØ§Øª إعدادات قد تتسبب ÙÙŠ أي تعارضات Ø³ØªÙØ­Ø°Ù.\n" "\n" "ينصح جدًا بأخذ نسخة احتياطية من أي Ù…Ù„ÙØ§Øª مهمة قبل المواصلة.\n" #: ../src/font-manager/Preferences/Display.vala:48 #: ../src/font-manager/Preferences/Rendering.vala:47 msgid "Settings saved to file." msgstr "Ø§Ø­ÙØ¸ الإعدادات إلى ملÙ." #: ../src/font-manager/Preferences/Display.vala:52 #: ../src/font-manager/Preferences/Rendering.vala:51 msgid "Removed configuration file." msgstr "أزÙÙ„ مل٠الإعدادات." #: ../src/font-manager/Preferences/Interface.vala:42 msgid "Wide Layout" msgstr "تصميم واسع" #: ../src/font-manager/Preferences/Interface.vala:44 msgid "Only when maximized" msgstr "أثناء التكبير Ùقط" #: ../src/font-manager/Preferences/Interface.vala:48 msgid "Client Side Decorations" msgstr "" #: ../src/font-manager/Preferences/Interface.vala:101 msgid "" "CSD enabled. Change will take effect next time the application is started." msgstr "" #: ../src/font-manager/Preferences/Interface.vala:103 msgid "" "CSD disabled. Change will take effect next time the application is started." msgstr "" #: ../src/font-manager/Preferences/Preferences.vala:28 msgid "Sources" msgstr "المصادر" #: ../src/font-manager/Preferences/Preferences.vala:29 msgid "Rendering" msgstr "التصيير" #: ../src/font-manager/Preferences/Preferences.vala:30 msgid "Display" msgstr "العرض" #: ../src/font-manager/Preferences/Preferences.vala:31 msgid "Interface" msgstr "الواجهة" #: ../src/font-manager/Preferences/Sources.vala:40 msgid "Add source" msgstr "أض٠مصدرًا" #: ../src/font-manager/Preferences/Sources.vala:41 msgid "Remove selected source" msgstr "احذ٠المصدر المحدد" #: ../src/font-manager/SideBar.vala:172 msgid "Categories" msgstr "Ø§Ù„ÙØ¦Ø§Øª" #: ../src/font-manager/SideBar.vala:173 msgid "Collections" msgstr "المجموعات" #: ../src/font-manager/TitleBar.vala:63 msgid "Add Fonts" msgstr "أض٠خطوط" #: ../src/font-manager/TitleBar.vala:64 msgid "Remove Fonts" msgstr "احذ٠الخطوط" #: ../src/font-manager/TitleBar.vala:71 msgid "Preferences" msgstr "Ø§Ù„ØªÙØ¶ÙŠÙ„ات" #: ../src/font-manager/TitleBar.vala:160 msgid "Help" msgstr "مساعدة" #: ../src/font-manager/TitleBar.vala:161 msgid "About" msgstr "عن" #: ../src/font-manager/TitleBar.vala:162 msgid "Quit" msgstr "أنهÙ" #: ../src/font-viewer/Application.vala:121 #: ../src/font-viewer/MainWindow.vala:28 ../src/font-viewer/MainWindow.vala:52 msgid "Font Viewer" msgstr "عارض الخطوط" #: ../src/font-viewer/MainWindow.vala:29 msgid "Preview font files before installing them." msgstr "عاين Ù…Ù„ÙØ§Øª الخطوط قبل تنصيبهم" #: ../src/font-viewer/MainWindow.vala:30 msgid "To preview a font simply drag it onto this area." msgstr "لمعاينة خط يمكنك سحبه إلى هذه المنطقة." #: ../src/font-viewer/MainWindow.vala:58 ../src/font-viewer/MainWindow.vala:163 msgid "Install Font" msgstr "Ù†ØµÙ‘ÙØ¨ الخط" #: ../src/font-viewer/MainWindow.vala:155 msgid "Newer version already installed" msgstr "هناك إصدارة أحدث منصّبة" #: ../src/font-viewer/MainWindow.vala:159 msgid "Installed" msgstr "المنصبة" #: ../data/ApplicationMenu.ui.h:1 msgid "_Help" msgstr "_مساعدة" #: ../data/ApplicationMenu.ui.h:2 msgid "_About" msgstr "_عن" #: ../data/ApplicationMenu.ui.h:3 msgid "_Quit" msgstr "Ø£_نهÙ" master-0.7.3/po/de_DE.po000066400000000000000000000513511300074171200147320ustar00rootroot00000000000000# Font Manager - Simple font management for Gtk+ desktop environments # # Copyright © 2009 - 2016 Jerry Casiano # # 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 . # # Author: # Jerry Casiano # Jerry Casiano , 2016. #zanata msgid "" msgstr "" "Project-Id-Version: font-manager 0.7.3\n" "Report-Msgid-Bugs-To: https://github.com/FontManager/master/issues\n" "POT-Creation-Date: 2016-10-16 12:57-0400\n" "PO-Revision-Date: 2016-05-25 11:48-0400\n" "Last-Translator: Copied by Zanata \n" "Language-Team: none <@>\n" "Language: de-DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Zanata 3.9.3\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" #: ../lib/Common/About.vala:28 msgid "Font Manager" msgstr "Schriften Verwalter" #: ../lib/Common/About.vala:30 msgid "Simple font management for GTK+ desktop environments" msgstr "Einfache Schriftenverwaltung für GTK+ Arbeitsumgebungen" #: ../lib/Common/About.vala:34 msgid "" "\n" " This program is free software: you can redistribute it and/or modify\n" " it under the terms of the GNU General Public License as published by\n" " the Free Software Foundation, either version 3 of the License, or\n" " (at your option) any later version.\n" "\n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" " GNU General Public License for more details.\n" "\n" " You should have received a copy of the GNU General Public License\n" " along with this program. If not, see .\n" " " msgstr "" #: ../lib/Common/Constants.vala:38 msgid "Enter Collection Name" msgstr "Geben Sie einen Kollektionsnamen an" #: ../lib/Filters/Collection.vala:36 msgid "New Collection" msgstr "Neue Kollektion" #: ../lib/Filters/Disabled.vala:29 msgid "Disabled" msgstr "" #: ../lib/Filters/Disabled.vala:29 msgid "Fonts which have been disabled" msgstr "" #: ../lib/Filters/Filter.vala:40 #, c-format msgid "Created : %s" msgstr "Erstellt : %s" #: ../lib/Filters/Unsorted.vala:29 msgid "Unsorted" msgstr "Unsortiert" #: ../lib/Filters/Unsorted.vala:29 msgid "Fonts not present in any collection" msgstr "Schriften ohne Kollektionszugehörigkeit" #: ../lib/FontConfig/Enums.vala:70 msgid "Thin" msgstr "Dünn" #: ../lib/FontConfig/Enums.vala:72 msgid "Ultra-Light" msgstr "Sehr dünn" #: ../lib/FontConfig/Enums.vala:74 ../lib/FontConfig/Enums.vala:232 msgid "Light" msgstr "Leicht (Light)" #: ../lib/FontConfig/Enums.vala:76 msgid "Book" msgstr "Normal" #: ../lib/FontConfig/Enums.vala:78 ../lib/FontConfig/Enums.vala:211 msgid "Medium" msgstr "Mittel (Medium)" #: ../lib/FontConfig/Enums.vala:80 msgid "Semi-Bold" msgstr "Etwas dicker" #: ../lib/FontConfig/Enums.vala:82 msgid "Bold" msgstr "Dick" #: ../lib/FontConfig/Enums.vala:84 msgid "Ultra-Bold" msgstr "Sehr Dick" #: ../lib/FontConfig/Enums.vala:86 msgid "Heavy" msgstr "Fett" #: ../lib/FontConfig/Enums.vala:88 msgid "Ultra-Heavy" msgstr "Sehr Fett" #: ../lib/FontConfig/Enums.vala:104 msgid "Italic" msgstr "Kursiv (Italic)" #: ../lib/FontConfig/Enums.vala:106 msgid "Oblique" msgstr "Schräg (Oblique)" #: ../lib/FontConfig/Enums.vala:128 msgid "Ultra-Condensed" msgstr "Sehr stark gestaucht" #: ../lib/FontConfig/Enums.vala:130 msgid "Extra-Condensed" msgstr "Stark gestaucht" #: ../lib/FontConfig/Enums.vala:132 msgid "Condensed" msgstr "Gestaucht" #: ../lib/FontConfig/Enums.vala:134 msgid "Semi-Condensed" msgstr "Etwas gestaucht" #: ../lib/FontConfig/Enums.vala:136 msgid "Semi-Expanded" msgstr "Etwas gestreckt" #: ../lib/FontConfig/Enums.vala:138 msgid "Expanded" msgstr "Gestreckt" #: ../lib/FontConfig/Enums.vala:140 msgid "Extra-Expanded" msgstr "Stark gestreckt" #: ../lib/FontConfig/Enums.vala:142 msgid "Ultra-Expanded" msgstr "Sehr stark gestreckt" #: ../lib/FontConfig/Enums.vala:159 msgid "Proportional" msgstr "Proportional" #: ../lib/FontConfig/Enums.vala:161 msgid "Dual Width" msgstr "Doppelte Größe" #: ../lib/FontConfig/Enums.vala:163 msgid "Monospace" msgstr "Dicktengleich" #: ../lib/FontConfig/Enums.vala:165 msgid "Charcell" msgstr "Feste Breite" #: ../lib/FontConfig/Enums.vala:184 msgid "Unknown" msgstr "Unbekannt" #: ../lib/FontConfig/Enums.vala:186 msgid "RGB" msgstr "RGB (Rot-Grün-Blau Teilbildpunktwiedergabe)" #: ../lib/FontConfig/Enums.vala:188 msgid "BGR" msgstr "BGR (Blau-Grün-Rot Teilbildpunktwiedergabe)" #: ../lib/FontConfig/Enums.vala:190 msgid "VRGB" msgstr "VRGB (Vertikale Rot-Grün-Blau Teilbildpunktwiedergabe)" #: ../lib/FontConfig/Enums.vala:192 msgid "VBGR" msgstr "VBGR (Vertikale Blau-Grün-Rot Teilbildpunktwiedergabe)" #: ../lib/FontConfig/Enums.vala:194 ../lib/FontConfig/Enums.vala:215 #: ../lib/FontConfig/Enums.vala:236 msgid "None" msgstr "Keine (None)" #: ../lib/FontConfig/Enums.vala:209 msgid "Slight" msgstr "Schlank (Slight)" #: ../lib/FontConfig/Enums.vala:213 msgid "Full" msgstr "Voll (Full)" #: ../lib/FontConfig/Enums.vala:230 msgid "Default" msgstr "Normal" #: ../lib/FontConfig/Enums.vala:234 msgid "Legacy" msgstr "Veraltet (Legacy)" #: ../lib/FontConfig/Families.vala:45 #, fuzzy msgid "Loading available font families" msgstr "Für alle Benutzer verfügbare Schriften" #: ../lib/FontConfig/Sources.vala:83 ../lib/FontConfig/Sources.vala:97 #, fuzzy msgid "Source Unavailable" msgstr "%s --> Quelle nicht verfügbar" #: ../lib/FontConfig/Sources.vala:244 ../lib/FontConfig/XmlWriter.vala:38 msgid " Generated by Font Manager. Do NOT edit this file. " msgstr "Estellt von Font Manager. Editieren Sie diese Datei nicht!" #: ../lib/Library/Install.vala:138 #, fuzzy msgid "Installing files" msgstr "Alle Schriften" #: ../lib/Library/Install.vala:170 msgid "Preparing Archives" msgstr "" #: ../lib/Library/Remove.vala:81 #, fuzzy msgid "Removing files" msgstr "Alle Schriften" #: ../lib/Library/Sorter.vala:91 msgid "Processing directories" msgstr "" #: ../lib/Library/Sorter.vala:123 #, fuzzy msgid "Processing files" msgstr "Alle Schriften" #: ../lib/UX/CharacterMap/CharacterMapSideBar.vala:96 msgid "Unicode Script" msgstr "Unicode Skript" #: ../lib/UX/CharacterMap/CharacterMapSideBar.vala:97 msgid "Unicode Block" msgstr "Unicode Block" #: ../lib/UX/Controls/CollectionControls.vala:32 msgid "Add new collection" msgstr "Füge eine neue Kollektion hinzu" #: ../lib/UX/Controls/CollectionControls.vala:33 msgid "Remove selected collection" msgstr "Entferne ausgewählte Kollektion" #: ../lib/UX/Controls/FontListControls.vala:46 #, fuzzy msgid "Remove selected font from collection" msgstr "Entferne ausgewählte Schrift vom Vergleich" #: ../lib/UX/Controls/FontListControls.vala:50 #: ../lib/UX/Controls/FontListControls.vala:65 msgid "Expand all" msgstr "Alle ausklappen" #: ../lib/UX/Controls/FontListControls.vala:54 msgid "Search Families..." msgstr "Durchsuche Familien" #: ../lib/UX/Controls/FontListControls.vala:65 msgid "Collapse all" msgstr "Alle einklappen" #: ../lib/UX/Controls/PreviewControls.vala:91 msgid "Edit preview text" msgstr "Vorschautext bearbeiten" #: ../lib/UX/Controls/PreviewControls.vala:94 msgid "Undo changes" msgstr "Änderungen rückgängig machen" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Left Aligned" msgstr "Links ausgerichtet" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Centered" msgstr "Zentriert" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Fill" msgstr "Füllen" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Right Aligned" msgstr "Rechts ausgerichtet" #: ../lib/UX/FontConfig/Controls.vala:66 msgid "Save" msgstr "" #: ../lib/UX/FontConfig/Controls.vala:68 msgid "Discard" msgstr "" #: ../lib/UX/FontConfig/Controls.vala:70 msgid "Running applications may require a restart to reflect any changes." msgstr "" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:44 msgid "Target DPI" msgstr "" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:45 msgid "Scale factor" msgstr "" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:49 msgid "LCD Filter" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:54 msgid "Antialias" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:55 msgid "Hinting" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:56 msgid "Enable Autohinter" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:64 msgid "Hinting Style" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:65 msgid "Use Embedded Bitmaps" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:67 #: ../lib/UX/FontConfig/FontPropertiesPane.vala:72 msgid " Size Restrictions " msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:70 msgid " Apply settings to point sizes " msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:143 msgid "Smaller than" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:144 msgid "Larger than" msgstr "" #: ../lib/UX/FontConfig/FontSourceList.vala:26 #, fuzzy msgid "Font Sources" msgstr "Verwalte Quellen" #: ../lib/UX/FontConfig/FontSourceList.vala:27 msgid "Easily add or preview fonts without actually installing them." msgstr "" #: ../lib/UX/FontConfig/FontSourceList.vala:28 msgid "" "To add a new source simply drag a folder onto this area or click the add " "button in the toolbar." msgstr "" #: ../lib/UX/FontConfig/FontSourceList.vala:194 msgid "Select source folders" msgstr "Wähle Quellverzeichnisse aus" #: ../lib/UX/FontConfig/FontSourceList.vala:197 #: ../lib/UX/Utils/FileSelector.vala:40 ../lib/UX/Utils/FileSelector.vala:67 #: ../src/font-manager/Migration.vala:58 msgid "_Cancel" msgstr "_Abbrechen" #: ../lib/UX/FontConfig/FontSourceList.vala:199 #: ../lib/UX/Utils/FileSelector.vala:42 msgid "_Open" msgstr "_Öffnen" #: ../lib/UX/FontConfig/SubpixelGeometry.vala:55 msgid "Subpixel Geometry" msgstr "" #: ../lib/UX/FontConfig/Substitute.vala:78 msgid "prefer" msgstr "" #: ../lib/UX/FontConfig/Substitute.vala:79 msgid "accept" msgstr "" #: ../lib/UX/FontConfig/Substitute.vala:80 #, fuzzy msgid "default" msgstr "Normal" #: ../lib/UX/Metadata/License.vala:42 #, fuzzy msgid "File does not contain license information." msgstr "Zeige Schriftinformationen" #: ../lib/UX/Metadata/Properties.vala:43 #, fuzzy msgid "PostScript Name" msgstr "PostScript Type 1 Schrift" #: ../lib/UX/Metadata/Properties.vala:44 #: ../lib/UX/Models/CategoryModel.vala:104 msgid "Weight" msgstr "Stärke" #: ../lib/UX/Metadata/Properties.vala:45 #: ../lib/UX/Models/CategoryModel.vala:102 msgid "Slant" msgstr "Schriftstil" #: ../lib/UX/Metadata/Properties.vala:46 #: ../lib/UX/Models/CategoryModel.vala:106 msgid "Width" msgstr "Breite" #: ../lib/UX/Metadata/Properties.vala:47 #: ../lib/UX/Models/CategoryModel.vala:100 msgid "Spacing" msgstr "Abstände" #: ../lib/UX/Metadata/Properties.vala:48 msgid "Version" msgstr "" #: ../lib/UX/Metadata/Properties.vala:49 #: ../lib/UX/Models/CategoryModel.vala:112 msgid "Vendor" msgstr "Herausgeber" #: ../lib/UX/Metadata/Title.vala:51 ../src/font-viewer/TitleBar.vala:49 msgid "OpenType Font" msgstr "OpenType Schrift" #: ../lib/UX/Metadata/Title.vala:52 ../src/font-viewer/TitleBar.vala:50 msgid "TrueType Font" msgstr "TrueType Schrift" #: ../lib/UX/Metadata/Title.vala:53 ../src/font-viewer/TitleBar.vala:51 msgid "PostScript Type 1 Font" msgstr "PostScript Type 1 Schrift" #: ../lib/UX/Metadata/Title.vala:105 ../src/font-viewer/TitleBar.vala:99 msgid "No file selected" msgstr "" #: ../lib/UX/Metadata/Title.vala:105 ../src/font-viewer/TitleBar.vala:100 #, fuzzy msgid "Or unsupported filetype." msgstr "Geordnet nach Dateityp" #: ../lib/UX/Models/CategoryModel.vala:92 msgid "All" msgstr "Alle" #: ../lib/UX/Models/CategoryModel.vala:92 msgid "All Fonts" msgstr "Alle Schriften" #: ../lib/UX/Models/CategoryModel.vala:94 msgid "System" msgstr "System" #: ../lib/UX/Models/CategoryModel.vala:94 msgid "Fonts available to all users" msgstr "Für alle Benutzer verfügbare Schriften" #: ../lib/UX/Models/CategoryModel.vala:96 msgid "User" msgstr "Benutzer" #: ../lib/UX/Models/CategoryModel.vala:96 #, fuzzy msgid "Fonts available only to you" msgstr "Nur für Sie verfügbare Schriften" #: ../lib/UX/Models/CategoryModel.vala:100 msgid "Grouped by font spacing" msgstr "Geordnet nach Abständen" #: ../lib/UX/Models/CategoryModel.vala:102 msgid "Grouped by font angle" msgstr "Geordnet nach Schriftwinkel / Schriftstil" #: ../lib/UX/Models/CategoryModel.vala:104 msgid "Grouped by font weight" msgstr "Geordnet nach Schriftstärke" #: ../lib/UX/Models/CategoryModel.vala:106 msgid "Grouped by font width" msgstr "Geordnet nach Schriftbreite" #: ../lib/UX/Models/CategoryModel.vala:108 msgid "Filetype" msgstr "Dateityp" #: ../lib/UX/Models/CategoryModel.vala:108 msgid "Grouped by filetype" msgstr "Geordnet nach Dateityp" #: ../lib/UX/Models/CategoryModel.vala:110 #: ../lib/UX/Views/FontPreviewPane.vala:123 msgid "License" msgstr "Lizenz" #: ../lib/UX/Models/CategoryModel.vala:110 msgid "Grouped by license type" msgstr "Geordnet nach Lizenz" #: ../lib/UX/Models/CategoryModel.vala:112 msgid "Grouped by vendor" msgstr "Geordnet nach Herausgeber" #: ../lib/UX/Models/CategoryModel.vala:125 msgid "Family Kind" msgstr "Familienzugehörigkeit" #: ../lib/UX/Models/CategoryModel.vala:125 msgid "Only fonts which include Panose information will be grouped here." msgstr "" "Nur Schriften welche Panose Informationen enthalten werde hier gruppiert." #: ../lib/UX/Models/CategoryModel.vala:126 msgid "Any" msgstr "Alle" #: ../lib/UX/Models/CategoryModel.vala:127 msgid "No Fit" msgstr "Keine Übereinstimmung" #: ../lib/UX/Models/CategoryModel.vala:128 msgid "Text and Display" msgstr "Text und Bildschirm" #: ../lib/UX/Models/CategoryModel.vala:129 msgid "Script" msgstr "Skript" #: ../lib/UX/Models/CategoryModel.vala:130 msgid "Decorative" msgstr "Dekorativ" #: ../lib/UX/Models/CategoryModel.vala:131 msgid "Pictorial" msgstr "Bildhaft" #: ../lib/UX/Models/CategoryModel.vala:165 msgid "Normal" msgstr "Normal" #: ../lib/UX/Models/CategoryModel.vala:170 msgid "Regular" msgstr "Normal" #: ../lib/UX/Utils/FileSelector.vala:37 msgid "Select files to install" msgstr "Wähle Dateien zum installieren aus" #: ../lib/UX/Utils/FileSelector.vala:68 msgid "_Delete" msgstr "_Entfernen" #: ../lib/UX/Utils/FileSelector.vala:75 msgid "Select fonts to remove" msgstr "Wähle Schriften zum entfernen aus" #: ../lib/UX/Views/FontPreviewPane.vala:57 ../lib/UX/Widgets/TextViews.vala:122 msgid "Waterfall" msgstr "Wasserfall" #: ../lib/UX/Views/FontPreviewPane.vala:59 ../lib/UX/Widgets/TextViews.vala:123 msgid "Body Text" msgstr "Beispiel Text" #: ../lib/UX/Views/FontPreviewPane.vala:61 ../lib/UX/Widgets/TextViews.vala:121 #: ../src/font-manager/MainWindow.vala:213 msgid "Preview" msgstr "Vorschau" #: ../lib/UX/Views/FontPreviewPane.vala:122 #, fuzzy msgid "Properties" msgstr "Proportional" #: ../lib/UX/Views/FontPreviewPane.vala:124 #, fuzzy msgid "Characters" msgstr "Zeichentabelle" #: ../lib/UX/Views/FontPreviewPane.vala:246 #, fuzzy msgid "Select preview type" msgstr "Vorschautext bearbeiten" #: ../lib/UX/Widgets/CellRendererPill.vala:30 msgid "Variation " msgstr "Variation" #: ../lib/UX/Widgets/CellRendererPill.vala:31 msgid "Variations" msgstr "Variationen" #: ../src/font-manager/Compare.vala:35 msgid "Add selected font to comparison" msgstr "Füge ausgewählte Schrift dem Vergleich hinzu" #: ../src/font-manager/Compare.vala:36 msgid "Remove selected font from comparison" msgstr "Entferne ausgewählte Schrift vom Vergleich" #: ../src/font-manager/Compare.vala:43 msgid "Select text color" msgstr "Wähle Textfarbe" #: ../src/font-manager/Compare.vala:44 msgid "Select background color" msgstr "Wähle Hintergrundfarbe" #: ../src/font-manager/MainWindow.vala:57 #: ../src/font-manager/MainWindow.vala:219 msgid "Browse" msgstr "Stöbern" #: ../src/font-manager/MainWindow.vala:59 #: ../src/font-manager/MainWindow.vala:214 msgid "Compare" msgstr "Vergleiche" #: ../src/font-manager/MainWindow.vala:61 #: ../src/font-manager/MainWindow.vala:218 msgid "Manage" msgstr "Verwalte" #: ../src/font-manager/Migration.vala:59 #, fuzzy msgid "_Continue" msgstr "Weiter" #: ../src/font-manager/Migration.vala:69 msgid "Update Required" msgstr "Aktualisierung benötigt" #: ../src/font-manager/Migration.vala:206 msgid "" "\n" "Font Manager has detected files from a previous installation. Some files " "from previous versions are incompatible with this release. Others have been " "deprecated or moved.\n" "\n" "Font Manager will now attempt to migrate your fonts and collections. Files " "and settings which are no longer necessary or valid will be deleted. Any " "configuration files that could cause a conflict will also be deleted.\n" "\n" "It is strongly recommended that you back up any important files before " "proceeding.\n" msgstr "" "\n" "Font Manager hat Dateien einer früheren Installation gefunden. Einige " "Dateien von früheren Versionen sind inkompatibel mit dieser Version, andere " "sind veraltet oder wurden verschoben.\n" "\n" "Font Manager wird nun versuchen Ihre Schriften und Kollektionen zu " "migrieren. Dateien welche nicht länger nötig oder korrekt sind werden " "entfernt. Alle Einstellungen welche einen Konflikt hervorufen könnten werden " "entfernt.\n" "\n" "Es wird dringend empfohlen, alle wichtigen Dateien zu sichern bevor Sie " "fortfahren.\n" #: ../src/font-manager/Preferences/Display.vala:48 #: ../src/font-manager/Preferences/Rendering.vala:47 msgid "Settings saved to file." msgstr "" #: ../src/font-manager/Preferences/Display.vala:52 #: ../src/font-manager/Preferences/Rendering.vala:51 msgid "Removed configuration file." msgstr "" #: ../src/font-manager/Preferences/Interface.vala:42 msgid "Wide Layout" msgstr "" #: ../src/font-manager/Preferences/Interface.vala:44 msgid "Only when maximized" msgstr "" #: ../src/font-manager/Preferences/Interface.vala:48 msgid "Client Side Decorations" msgstr "" #: ../src/font-manager/Preferences/Interface.vala:101 msgid "" "CSD enabled. Change will take effect next time the application is started." msgstr "" #: ../src/font-manager/Preferences/Interface.vala:103 msgid "" "CSD disabled. Change will take effect next time the application is started." msgstr "" #: ../src/font-manager/Preferences/Preferences.vala:28 #, fuzzy msgid "Sources" msgstr "Verwalte Quellen" #: ../src/font-manager/Preferences/Preferences.vala:29 msgid "Rendering" msgstr "" #: ../src/font-manager/Preferences/Preferences.vala:30 #, fuzzy msgid "Display" msgstr "Text und Bildschirm" #: ../src/font-manager/Preferences/Preferences.vala:31 msgid "Interface" msgstr "" #: ../src/font-manager/Preferences/Sources.vala:40 #, fuzzy msgid "Add source" msgstr "Füge eine neue Quelle hinzu" #: ../src/font-manager/Preferences/Sources.vala:41 msgid "Remove selected source" msgstr "Entferne ausgewählte Quelle" #: ../src/font-manager/SideBar.vala:172 msgid "Categories" msgstr "Kategorien" #: ../src/font-manager/SideBar.vala:173 msgid "Collections" msgstr "Kollektionen" #: ../src/font-manager/TitleBar.vala:63 msgid "Add Fonts" msgstr "Schriften hinzufügen" #: ../src/font-manager/TitleBar.vala:64 msgid "Remove Fonts" msgstr "Schriften entfernen" #: ../src/font-manager/TitleBar.vala:71 msgid "Preferences" msgstr "" #: ../src/font-manager/TitleBar.vala:160 msgid "Help" msgstr "Hilfe" #: ../src/font-manager/TitleBar.vala:161 msgid "About" msgstr "Über" #: ../src/font-manager/TitleBar.vala:162 msgid "Quit" msgstr "Beenden" #: ../src/font-viewer/Application.vala:121 #: ../src/font-viewer/MainWindow.vala:28 ../src/font-viewer/MainWindow.vala:52 #, fuzzy msgid "Font Viewer" msgstr "Schriften Verwalter" #: ../src/font-viewer/MainWindow.vala:29 msgid "Preview font files before installing them." msgstr "" #: ../src/font-viewer/MainWindow.vala:30 msgid "To preview a font simply drag it onto this area." msgstr "" #: ../src/font-viewer/MainWindow.vala:58 ../src/font-viewer/MainWindow.vala:163 #, fuzzy msgid "Install Font" msgstr "Alle Schriften" #: ../src/font-viewer/MainWindow.vala:155 msgid "Newer version already installed" msgstr "" #: ../src/font-viewer/MainWindow.vala:159 #, fuzzy msgid "Installed" msgstr "Alle Schriften" #: ../data/ApplicationMenu.ui.h:1 #, fuzzy msgid "_Help" msgstr "Hilfe" #: ../data/ApplicationMenu.ui.h:2 #, fuzzy msgid "_About" msgstr "Über" #: ../data/ApplicationMenu.ui.h:3 #, fuzzy msgid "_Quit" msgstr "Beenden" master-0.7.3/po/insert-header.sin000066400000000000000000000012521300074171200166720ustar00rootroot00000000000000# Sed script that inserts the file called HEADER before the header entry. # 1,6 d # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. # /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } master-0.7.3/po/pl.po000066400000000000000000000515031300074171200144040ustar00rootroot00000000000000# Piotr Strebski , 2016. #zanata msgid "" msgstr "" "Project-Id-Version: font-manager 0.7.3\n" "Report-Msgid-Bugs-To: https://github.com/FontManager/master/issues\n" "POT-Creation-Date: 2016-10-16 12:57-0400\n" "PO-Revision-Date: 2016-05-27 02:36-0400\n" "Last-Translator: Piotr Strebski \n" "Language-Team: Polish\n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Zanata 3.9.3\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2)\n" #: ../lib/Common/About.vala:28 msgid "Font Manager" msgstr "ZarzÄ…dzanie czcionkami" #: ../lib/Common/About.vala:30 msgid "Simple font management for GTK+ desktop environments" msgstr "Proste zarzÄ…dzanie czcionkami dla Å›rodowisk pulpitowych GTK+" #: ../lib/Common/About.vala:34 msgid "" "\n" " This program is free software: you can redistribute it and/or modify\n" " it under the terms of the GNU General Public License as published by\n" " the Free Software Foundation, either version 3 of the License, or\n" " (at your option) any later version.\n" "\n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" " GNU General Public License for more details.\n" "\n" " You should have received a copy of the GNU General Public License\n" " along with this program. If not, see .\n" " " msgstr "" #: ../lib/Common/Constants.vala:38 msgid "Enter Collection Name" msgstr "Podaj nazwÄ™ kolekcji" #: ../lib/Filters/Collection.vala:36 msgid "New Collection" msgstr "Nowa kolekcja" #: ../lib/Filters/Disabled.vala:29 msgid "Disabled" msgstr "Wyłączone" #: ../lib/Filters/Disabled.vala:29 msgid "Fonts which have been disabled" msgstr "Czcionki, które zostaÅ‚y wyłączone" #: ../lib/Filters/Filter.vala:40 #, c-format msgid "Created : %s" msgstr "Utworzone: %s" #: ../lib/Filters/Unsorted.vala:29 msgid "Unsorted" msgstr "Nieposortowane" #: ../lib/Filters/Unsorted.vala:29 msgid "Fonts not present in any collection" msgstr "Czcionki niedostÄ™pne w żadnej kolekcji" #: ../lib/FontConfig/Enums.vala:70 msgid "Thin" msgstr "Cienkie" #: ../lib/FontConfig/Enums.vala:72 msgid "Ultra-Light" msgstr "Bardzo lekkie" #: ../lib/FontConfig/Enums.vala:74 ../lib/FontConfig/Enums.vala:232 msgid "Light" msgstr "Lekkie" #: ../lib/FontConfig/Enums.vala:76 msgid "Book" msgstr "Książka" #: ../lib/FontConfig/Enums.vala:78 ../lib/FontConfig/Enums.vala:211 msgid "Medium" msgstr "Åšrednie" #: ../lib/FontConfig/Enums.vala:80 msgid "Semi-Bold" msgstr "PoÅ‚owa pogrubienia" #: ../lib/FontConfig/Enums.vala:82 msgid "Bold" msgstr "Pogrubione" #: ../lib/FontConfig/Enums.vala:84 msgid "Ultra-Bold" msgstr "Bardzo pogrubione" #: ../lib/FontConfig/Enums.vala:86 msgid "Heavy" msgstr "Ciężkie" #: ../lib/FontConfig/Enums.vala:88 msgid "Ultra-Heavy" msgstr "Bardzo ciężkie" #: ../lib/FontConfig/Enums.vala:104 msgid "Italic" msgstr "Kursywa" #: ../lib/FontConfig/Enums.vala:106 msgid "Oblique" msgstr "Nachylone" #: ../lib/FontConfig/Enums.vala:128 msgid "Ultra-Condensed" msgstr "Bardzo zagÄ™szczone" #: ../lib/FontConfig/Enums.vala:130 msgid "Extra-Condensed" msgstr "Ekstra zagÄ™szczone" #: ../lib/FontConfig/Enums.vala:132 msgid "Condensed" msgstr "ZagÄ™szczone" #: ../lib/FontConfig/Enums.vala:134 msgid "Semi-Condensed" msgstr "PoÅ‚owa zagÄ™szczenia" #: ../lib/FontConfig/Enums.vala:136 msgid "Semi-Expanded" msgstr "PoÅ‚owa rozszerzenia" #: ../lib/FontConfig/Enums.vala:138 msgid "Expanded" msgstr "Rozszerzone" #: ../lib/FontConfig/Enums.vala:140 msgid "Extra-Expanded" msgstr "Ekstra rozszerzone" #: ../lib/FontConfig/Enums.vala:142 msgid "Ultra-Expanded" msgstr "Bardzo rozszerzone" #: ../lib/FontConfig/Enums.vala:159 msgid "Proportional" msgstr "Proporcjonalne" #: ../lib/FontConfig/Enums.vala:161 msgid "Dual Width" msgstr "Podwójna szerokość" #: ../lib/FontConfig/Enums.vala:163 msgid "Monospace" msgstr "StaÅ‚a szerokość" #: ../lib/FontConfig/Enums.vala:165 msgid "Charcell" msgstr "" #: ../lib/FontConfig/Enums.vala:184 msgid "Unknown" msgstr "Nieznane" #: ../lib/FontConfig/Enums.vala:186 msgid "RGB" msgstr "RGB" #: ../lib/FontConfig/Enums.vala:188 msgid "BGR" msgstr "BGR" #: ../lib/FontConfig/Enums.vala:190 msgid "VRGB" msgstr "VRGB" #: ../lib/FontConfig/Enums.vala:192 msgid "VBGR" msgstr "VBGR" #: ../lib/FontConfig/Enums.vala:194 ../lib/FontConfig/Enums.vala:215 #: ../lib/FontConfig/Enums.vala:236 msgid "None" msgstr "Brak" #: ../lib/FontConfig/Enums.vala:209 msgid "Slight" msgstr "Drobne" #: ../lib/FontConfig/Enums.vala:213 msgid "Full" msgstr "PeÅ‚ne" #: ../lib/FontConfig/Enums.vala:230 msgid "Default" msgstr "DomyÅ›lne" #: ../lib/FontConfig/Enums.vala:234 msgid "Legacy" msgstr "PrzestarzaÅ‚e" #: ../lib/FontConfig/Families.vala:45 msgid "Loading available font families" msgstr "Wczytywanie dostÄ™pnych rodzin czcionek" #: ../lib/FontConfig/Sources.vala:83 ../lib/FontConfig/Sources.vala:97 msgid "Source Unavailable" msgstr "ŹródÅ‚o niedostÄ™pne" #: ../lib/FontConfig/Sources.vala:244 ../lib/FontConfig/XmlWriter.vala:38 msgid " Generated by Font Manager. Do NOT edit this file. " msgstr "Utworzone przez ZarzÄ…dzanie czcionkami. NIE modyfikuj tego pliku." #: ../lib/Library/Install.vala:138 msgid "Installing files" msgstr "Instalowanie plików" #: ../lib/Library/Install.vala:170 msgid "Preparing Archives" msgstr "Przygotowywanie archiwów" #: ../lib/Library/Remove.vala:81 msgid "Removing files" msgstr "Usuwanie plików" #: ../lib/Library/Sorter.vala:91 msgid "Processing directories" msgstr "Przetwarzanie katalogów" #: ../lib/Library/Sorter.vala:123 msgid "Processing files" msgstr "Przetwarzanie plików" #: ../lib/UX/CharacterMap/CharacterMapSideBar.vala:96 msgid "Unicode Script" msgstr "Skrypt Unikodu" #: ../lib/UX/CharacterMap/CharacterMapSideBar.vala:97 msgid "Unicode Block" msgstr "Blok Unikodu" #: ../lib/UX/Controls/CollectionControls.vala:32 msgid "Add new collection" msgstr "Dodaj nowÄ… kolekcjÄ™" #: ../lib/UX/Controls/CollectionControls.vala:33 msgid "Remove selected collection" msgstr "UsuÅ„ wybranÄ… kolekcjÄ™" #: ../lib/UX/Controls/FontListControls.vala:46 msgid "Remove selected font from collection" msgstr "UsuÅ„ wybranÄ… czcionkÄ™ z kolekcji" #: ../lib/UX/Controls/FontListControls.vala:50 #: ../lib/UX/Controls/FontListControls.vala:65 msgid "Expand all" msgstr "RozwiÅ„ wszystkie" #: ../lib/UX/Controls/FontListControls.vala:54 msgid "Search Families..." msgstr "Szukaj rodzin..." #: ../lib/UX/Controls/FontListControls.vala:65 msgid "Collapse all" msgstr "ZwiÅ„ wszystkie" #: ../lib/UX/Controls/PreviewControls.vala:91 msgid "Edit preview text" msgstr "Edycja tekstu podglÄ…du" #: ../lib/UX/Controls/PreviewControls.vala:94 msgid "Undo changes" msgstr "Wycofaj zmiany" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Left Aligned" msgstr "Wyrównane do lewej" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Centered" msgstr "WyÅ›rodkowane" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Fill" msgstr "WypeÅ‚nij" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Right Aligned" msgstr "Wyrównane do prawej" #: ../lib/UX/FontConfig/Controls.vala:66 msgid "Save" msgstr "Zapisz" #: ../lib/UX/FontConfig/Controls.vala:68 msgid "Discard" msgstr "Odrzuć" #: ../lib/UX/FontConfig/Controls.vala:70 msgid "Running applications may require a restart to reflect any changes." msgstr "" "Aby odzwierciedlić poczynione zmiany, dziaÅ‚ajÄ…ce programy mogÄ… wymagać " "ponownego uruchomienia." #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:44 msgid "Target DPI" msgstr "Docelowe DPI" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:45 msgid "Scale factor" msgstr "Czynnik skali" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:49 msgid "LCD Filter" msgstr "Filtr LCD" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:54 msgid "Antialias" msgstr "Antyalias" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:55 msgid "Hinting" msgstr "Hinting" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:56 msgid "Enable Autohinter" msgstr "Włącz automatyczny hinting" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:64 msgid "Hinting Style" msgstr "Styl hintingu" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:65 msgid "Use Embedded Bitmaps" msgstr "Użyj osadzonych bitmap" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:67 #: ../lib/UX/FontConfig/FontPropertiesPane.vala:72 msgid " Size Restrictions " msgstr "Ograniczenia rozmiaru" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:70 msgid " Apply settings to point sizes " msgstr "Zastosuj ustawienia do rozmiarów punktu" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:143 msgid "Smaller than" msgstr "Mniejsze niż" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:144 msgid "Larger than" msgstr "WiÄ™ksze niż" #: ../lib/UX/FontConfig/FontSourceList.vala:26 msgid "Font Sources" msgstr "ŹródÅ‚a czcionek" #: ../lib/UX/FontConfig/FontSourceList.vala:27 msgid "Easily add or preview fonts without actually installing them." msgstr "Åatwo dodaj lub podejrzyj czcionki bez ich instalowania." #: ../lib/UX/FontConfig/FontSourceList.vala:28 msgid "" "To add a new source simply drag a folder onto this area or click the add " "button in the toolbar." msgstr "" "Aby dodać nowe źródÅ‚o po prostu przeciÄ…gnij katalog na ten obszar lub " "kliknij przycisk dodawania na pasku narzÄ™dzi." #: ../lib/UX/FontConfig/FontSourceList.vala:194 msgid "Select source folders" msgstr "Wybierz katalogi źródeÅ‚" #: ../lib/UX/FontConfig/FontSourceList.vala:197 #: ../lib/UX/Utils/FileSelector.vala:40 ../lib/UX/Utils/FileSelector.vala:67 #: ../src/font-manager/Migration.vala:58 msgid "_Cancel" msgstr "_Anuluj" #: ../lib/UX/FontConfig/FontSourceList.vala:199 #: ../lib/UX/Utils/FileSelector.vala:42 msgid "_Open" msgstr "_Otwórz" #: ../lib/UX/FontConfig/SubpixelGeometry.vala:55 msgid "Subpixel Geometry" msgstr "Geometria podpikselowa" #: ../lib/UX/FontConfig/Substitute.vala:78 msgid "prefer" msgstr "preferuj" #: ../lib/UX/FontConfig/Substitute.vala:79 msgid "accept" msgstr "akceptuj" #: ../lib/UX/FontConfig/Substitute.vala:80 msgid "default" msgstr "domyÅ›lne" #: ../lib/UX/Metadata/License.vala:42 msgid "File does not contain license information." msgstr "Plik nie zawiera informacji licencyjnych." #: ../lib/UX/Metadata/Properties.vala:43 msgid "PostScript Name" msgstr "Nazwa PostScript" #: ../lib/UX/Metadata/Properties.vala:44 #: ../lib/UX/Models/CategoryModel.vala:104 msgid "Weight" msgstr "Grubość" #: ../lib/UX/Metadata/Properties.vala:45 #: ../lib/UX/Models/CategoryModel.vala:102 msgid "Slant" msgstr "Pochylenie" #: ../lib/UX/Metadata/Properties.vala:46 #: ../lib/UX/Models/CategoryModel.vala:106 msgid "Width" msgstr "Szerokość" #: ../lib/UX/Metadata/Properties.vala:47 #: ../lib/UX/Models/CategoryModel.vala:100 msgid "Spacing" msgstr "OdstÄ™p" #: ../lib/UX/Metadata/Properties.vala:48 msgid "Version" msgstr "Wersja" #: ../lib/UX/Metadata/Properties.vala:49 #: ../lib/UX/Models/CategoryModel.vala:112 msgid "Vendor" msgstr "Dostawca" #: ../lib/UX/Metadata/Title.vala:51 ../src/font-viewer/TitleBar.vala:49 msgid "OpenType Font" msgstr "Czcionka OpenType" #: ../lib/UX/Metadata/Title.vala:52 ../src/font-viewer/TitleBar.vala:50 msgid "TrueType Font" msgstr "Czcionka TrueType" #: ../lib/UX/Metadata/Title.vala:53 ../src/font-viewer/TitleBar.vala:51 msgid "PostScript Type 1 Font" msgstr "Czcionka PostScript Type 1" #: ../lib/UX/Metadata/Title.vala:105 ../src/font-viewer/TitleBar.vala:99 msgid "No file selected" msgstr "Nie wybrano pliku" #: ../lib/UX/Metadata/Title.vala:105 ../src/font-viewer/TitleBar.vala:100 msgid "Or unsupported filetype." msgstr "Lub nieobsÅ‚ugiwany rodzaj pliku." #: ../lib/UX/Models/CategoryModel.vala:92 msgid "All" msgstr "Wszystkie" #: ../lib/UX/Models/CategoryModel.vala:92 msgid "All Fonts" msgstr "Wszystkie czcionki" #: ../lib/UX/Models/CategoryModel.vala:94 msgid "System" msgstr "System" #: ../lib/UX/Models/CategoryModel.vala:94 msgid "Fonts available to all users" msgstr "Czcionki dostÄ™pne dla wszystkich użytkowników" #: ../lib/UX/Models/CategoryModel.vala:96 msgid "User" msgstr "Użytkownik" #: ../lib/UX/Models/CategoryModel.vala:96 msgid "Fonts available only to you" msgstr "Czcionki dostÄ™pne tylko dla Ciebie" #: ../lib/UX/Models/CategoryModel.vala:100 msgid "Grouped by font spacing" msgstr "Pogrupowane wedÅ‚ug odstÄ™pu czcionek" #: ../lib/UX/Models/CategoryModel.vala:102 msgid "Grouped by font angle" msgstr "Pogrupowane wedÅ‚ug kÄ…ta czcionek" #: ../lib/UX/Models/CategoryModel.vala:104 msgid "Grouped by font weight" msgstr "Pogrupowane wedÅ‚ug gruboÅ›ci czcionek" #: ../lib/UX/Models/CategoryModel.vala:106 msgid "Grouped by font width" msgstr "Pogrupowane wedÅ‚ug szerokoÅ›ci czcionek" #: ../lib/UX/Models/CategoryModel.vala:108 msgid "Filetype" msgstr "Rodzaj pliku" #: ../lib/UX/Models/CategoryModel.vala:108 msgid "Grouped by filetype" msgstr "Pogrupowane wedÅ‚ug rodzaju pliku" #: ../lib/UX/Models/CategoryModel.vala:110 #: ../lib/UX/Views/FontPreviewPane.vala:123 msgid "License" msgstr "Licencja" #: ../lib/UX/Models/CategoryModel.vala:110 msgid "Grouped by license type" msgstr "Pogrupowane wedÅ‚ug rodzaju licencji" #: ../lib/UX/Models/CategoryModel.vala:112 msgid "Grouped by vendor" msgstr "Pogrupowane wedÅ‚ug dostawcy" #: ../lib/UX/Models/CategoryModel.vala:125 msgid "Family Kind" msgstr "Rodzaj rodziny" #: ../lib/UX/Models/CategoryModel.vala:125 msgid "Only fonts which include Panose information will be grouped here." msgstr "" "Tutaj pogrupowane sÄ… tylko czcionki, które posiadajÄ… informacjÄ™ Panose." #: ../lib/UX/Models/CategoryModel.vala:126 msgid "Any" msgstr "Dowolne" #: ../lib/UX/Models/CategoryModel.vala:127 msgid "No Fit" msgstr "Brak pasujÄ…cych" #: ../lib/UX/Models/CategoryModel.vala:128 msgid "Text and Display" msgstr "Tekst i wyÅ›wietlanie" #: ../lib/UX/Models/CategoryModel.vala:129 msgid "Script" msgstr "Skrypt" #: ../lib/UX/Models/CategoryModel.vala:130 msgid "Decorative" msgstr "Dekoracyjne" #: ../lib/UX/Models/CategoryModel.vala:131 msgid "Pictorial" msgstr "Obrazkowe" #: ../lib/UX/Models/CategoryModel.vala:165 msgid "Normal" msgstr "Normalne" #: ../lib/UX/Models/CategoryModel.vala:170 msgid "Regular" msgstr "Regularne" #: ../lib/UX/Utils/FileSelector.vala:37 msgid "Select files to install" msgstr "Wybierz pliki do zainstalowania" #: ../lib/UX/Utils/FileSelector.vala:68 msgid "_Delete" msgstr "_Skasuj" #: ../lib/UX/Utils/FileSelector.vala:75 msgid "Select fonts to remove" msgstr "Wybierz czcionki do usuniÄ™cia" #: ../lib/UX/Views/FontPreviewPane.vala:57 ../lib/UX/Widgets/TextViews.vala:122 msgid "Waterfall" msgstr "Wodospad" #: ../lib/UX/Views/FontPreviewPane.vala:59 ../lib/UX/Widgets/TextViews.vala:123 msgid "Body Text" msgstr "Tekst główny" #: ../lib/UX/Views/FontPreviewPane.vala:61 ../lib/UX/Widgets/TextViews.vala:121 #: ../src/font-manager/MainWindow.vala:213 msgid "Preview" msgstr "PodglÄ…d" #: ../lib/UX/Views/FontPreviewPane.vala:122 msgid "Properties" msgstr "WÅ‚aÅ›ciwoÅ›ci" #: ../lib/UX/Views/FontPreviewPane.vala:124 msgid "Characters" msgstr "Znaki" #: ../lib/UX/Views/FontPreviewPane.vala:246 msgid "Select preview type" msgstr "Wybierz rodzaj podglÄ…du" #: ../lib/UX/Widgets/CellRendererPill.vala:30 msgid "Variation " msgstr "odmiana" #: ../lib/UX/Widgets/CellRendererPill.vala:31 msgid "Variations" msgstr "odmiany" #: ../src/font-manager/Compare.vala:35 msgid "Add selected font to comparison" msgstr "Dodaj wybranÄ… czcionkÄ™ do porównania" #: ../src/font-manager/Compare.vala:36 msgid "Remove selected font from comparison" msgstr "UsuÅ„ wybranÄ… czcionkÄ™ z porównania" #: ../src/font-manager/Compare.vala:43 msgid "Select text color" msgstr "Wybierz kolor tekstu" #: ../src/font-manager/Compare.vala:44 msgid "Select background color" msgstr "Wybierz kolor tÅ‚a" #: ../src/font-manager/MainWindow.vala:57 #: ../src/font-manager/MainWindow.vala:219 msgid "Browse" msgstr "PrzeglÄ…daj" #: ../src/font-manager/MainWindow.vala:59 #: ../src/font-manager/MainWindow.vala:214 msgid "Compare" msgstr "Porównaj" #: ../src/font-manager/MainWindow.vala:61 #: ../src/font-manager/MainWindow.vala:218 msgid "Manage" msgstr "ZarzÄ…dzaj" #: ../src/font-manager/Migration.vala:59 msgid "_Continue" msgstr "_Kontynuuj" #: ../src/font-manager/Migration.vala:69 msgid "Update Required" msgstr "Wymagana aktualizacja" #: ../src/font-manager/Migration.vala:206 msgid "" "\n" "Font Manager has detected files from a previous installation. Some files " "from previous versions are incompatible with this release. Others have been " "deprecated or moved.\n" "\n" "Font Manager will now attempt to migrate your fonts and collections. Files " "and settings which are no longer necessary or valid will be deleted. Any " "configuration files that could cause a conflict will also be deleted.\n" "\n" "It is strongly recommended that you back up any important files before " "proceeding.\n" msgstr "" "\n" "ZarzÄ…dzanie czcionkami wykryÅ‚o pliki z poprzedniej instalacji. Niektóre " "pliki z poprzednich wersji sÄ… niezgodne z obecnÄ… wersjÄ…. Inne zostaÅ‚y " "zdezaktualizowane lub przeniesione.\n" "\n" "ZarzÄ…dzanie czcionkami dokona teraz próby migracji Twoich czcionek i " "kolekcji. Pliki i ustawienia, które nie sÄ… już wiÄ™cej potrzebne lub sÄ… " "nieważne, zostanÄ… usuniÄ™te. Wszystkie pliki konfiguracyjne, które mogÄ… " "powodować konflikty, również zostanÄ… usuniÄ™te.\n" "\n" "Zdecydowanie zaleca siÄ™ wykonanie kopii zapasowej ważnych plików przed " "kontynuacjÄ….\n" #: ../src/font-manager/Preferences/Display.vala:48 #: ../src/font-manager/Preferences/Rendering.vala:47 msgid "Settings saved to file." msgstr "Ustawienia zostaÅ‚y zapisane do pliku." #: ../src/font-manager/Preferences/Display.vala:52 #: ../src/font-manager/Preferences/Rendering.vala:51 msgid "Removed configuration file." msgstr "UsuniÄ™ty plik konfiguracyjny." #: ../src/font-manager/Preferences/Interface.vala:42 msgid "Wide Layout" msgstr "UkÅ‚ad szeroki" #: ../src/font-manager/Preferences/Interface.vala:44 msgid "Only when maximized" msgstr "Tylko gdy zmaksymalizowane" #: ../src/font-manager/Preferences/Interface.vala:48 msgid "Client Side Decorations" msgstr "Dekoracje po stronie klienta" #: ../src/font-manager/Preferences/Interface.vala:101 msgid "" "CSD enabled. Change will take effect next time the application is started." msgstr "" "CSD zostaÅ‚o włączone. Zmiany zostanÄ… zastosowane przy nastÄ™pnym uruchomieniu " "programu." #: ../src/font-manager/Preferences/Interface.vala:103 msgid "" "CSD disabled. Change will take effect next time the application is started." msgstr "" "CSD zostaÅ‚o wyłączone. Zmiany zostanÄ… zastosowane przy nastÄ™pnym " "uruchomieniu programu." #: ../src/font-manager/Preferences/Preferences.vala:28 msgid "Sources" msgstr "ŹródÅ‚a" #: ../src/font-manager/Preferences/Preferences.vala:29 msgid "Rendering" msgstr "Renderowanie" #: ../src/font-manager/Preferences/Preferences.vala:30 msgid "Display" msgstr "WyÅ›wietlanie" #: ../src/font-manager/Preferences/Preferences.vala:31 msgid "Interface" msgstr "Interfejs" #: ../src/font-manager/Preferences/Sources.vala:40 msgid "Add source" msgstr "Dodaj źródÅ‚a" #: ../src/font-manager/Preferences/Sources.vala:41 msgid "Remove selected source" msgstr "UsuÅ„ wybrane źródÅ‚a" #: ../src/font-manager/SideBar.vala:172 msgid "Categories" msgstr "Kategorie" #: ../src/font-manager/SideBar.vala:173 msgid "Collections" msgstr "Kolekcje" #: ../src/font-manager/TitleBar.vala:63 msgid "Add Fonts" msgstr "Dodaj czcionki" #: ../src/font-manager/TitleBar.vala:64 msgid "Remove Fonts" msgstr "UsuÅ„ czcionki" #: ../src/font-manager/TitleBar.vala:71 msgid "Preferences" msgstr "Preferencje" #: ../src/font-manager/TitleBar.vala:160 msgid "Help" msgstr "Pomoc" #: ../src/font-manager/TitleBar.vala:161 msgid "About" msgstr "O programie" #: ../src/font-manager/TitleBar.vala:162 msgid "Quit" msgstr "ZakoÅ„cz" #: ../src/font-viewer/Application.vala:121 #: ../src/font-viewer/MainWindow.vala:28 ../src/font-viewer/MainWindow.vala:52 msgid "Font Viewer" msgstr "PrzeglÄ…darka czcionek" #: ../src/font-viewer/MainWindow.vala:29 msgid "Preview font files before installing them." msgstr "Podejrzyj pliki czcionek przed ich zainstalowaniem." #: ../src/font-viewer/MainWindow.vala:30 msgid "To preview a font simply drag it onto this area." msgstr "Aby dokonać podglÄ…du czcionki po prostu przeciÄ…gnij jÄ… na ten obszar." #: ../src/font-viewer/MainWindow.vala:58 ../src/font-viewer/MainWindow.vala:163 msgid "Install Font" msgstr "Zainstaluj czcionkÄ™" #: ../src/font-viewer/MainWindow.vala:155 msgid "Newer version already installed" msgstr "Zainstalowana jest nowsza wersja" #: ../src/font-viewer/MainWindow.vala:159 msgid "Installed" msgstr "Zainstalowane" #: ../data/ApplicationMenu.ui.h:1 msgid "_Help" msgstr "_Pomoc" #: ../data/ApplicationMenu.ui.h:2 msgid "_About" msgstr "_O programie" #: ../data/ApplicationMenu.ui.h:3 msgid "_Quit" msgstr "_ZakoÅ„cz" master-0.7.3/po/zh_CN.po000066400000000000000000000502471300074171200147760ustar00rootroot00000000000000# Font Manager - Simple font management for Gtk+ desktop environments # # Copyright © 2009 - 2016 Jerry Casiano # # 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 . # # Author: # Jerry Casiano # Jerry Casiano , 2016. #zanata msgid "" msgstr "" "Project-Id-Version: font-manager 0.7.3\n" "Report-Msgid-Bugs-To: https://github.com/FontManager/master/issues\n" "POT-Creation-Date: 2016-10-16 12:57-0400\n" "PO-Revision-Date: 2016-05-25 11:48-0400\n" "Last-Translator: Copied by Zanata \n" "Language-Team: Chinese (China) <@>\n" "Language: zh-CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Zanata 3.9.3\n" "Plural-Forms: nplurals=1; plural=0\n" # Not translate very good, just for use. #: ../lib/Common/About.vala:28 msgid "Font Manager" msgstr "字体管ç†å™¨" #: ../lib/Common/About.vala:30 #, fuzzy msgid "Simple font management for GTK+ desktop environments" msgstr "GTK+桌é¢çŽ¯å¢ƒä¸‹çš„ç®€æ˜“å­—ä½“ç®¡ç†å™¨" #: ../lib/Common/About.vala:34 msgid "" "\n" " This program is free software: you can redistribute it and/or modify\n" " it under the terms of the GNU General Public License as published by\n" " the Free Software Foundation, either version 3 of the License, or\n" " (at your option) any later version.\n" "\n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" " GNU General Public License for more details.\n" "\n" " You should have received a copy of the GNU General Public License\n" " along with this program. If not, see .\n" " " msgstr "" #: ../lib/Common/Constants.vala:38 #, fuzzy msgid "Enter Collection Name" msgstr "新字体集" #: ../lib/Filters/Collection.vala:36 msgid "New Collection" msgstr "新字体集" #: ../lib/Filters/Disabled.vala:29 msgid "Disabled" msgstr "ç¦ç”¨" #: ../lib/Filters/Disabled.vala:29 msgid "Fonts which have been disabled" msgstr "ç¦ç”¨å­—体" #: ../lib/Filters/Filter.vala:40 #, c-format msgid "Created : %s" msgstr "创建: %s" #: ../lib/Filters/Unsorted.vala:29 msgid "Unsorted" msgstr "未分类" #: ../lib/Filters/Unsorted.vala:29 msgid "Fonts not present in any collection" msgstr "字体未在任何字体集中" #: ../lib/FontConfig/Enums.vala:70 msgid "Thin" msgstr "è½»(Thin)" #: ../lib/FontConfig/Enums.vala:72 msgid "Ultra-Light" msgstr "超细(Ultra-Light)" #: ../lib/FontConfig/Enums.vala:74 ../lib/FontConfig/Enums.vala:232 msgid "Light" msgstr "细(Light)" #: ../lib/FontConfig/Enums.vala:76 msgid "Book" msgstr "预设(Book)" #: ../lib/FontConfig/Enums.vala:78 ../lib/FontConfig/Enums.vala:211 msgid "Medium" msgstr "中等(Medium)" #: ../lib/FontConfig/Enums.vala:80 msgid "Semi-Bold" msgstr "åŠç²—(Semi-Bold)" #: ../lib/FontConfig/Enums.vala:82 msgid "Bold" msgstr "ç²—(Bold)" #: ../lib/FontConfig/Enums.vala:84 msgid "Ultra-Bold" msgstr "è¶…ç²—(Ultra-Bold)" #: ../lib/FontConfig/Enums.vala:86 msgid "Heavy" msgstr "é‡(Heavy)" #: ../lib/FontConfig/Enums.vala:88 msgid "Ultra-Heavy" msgstr "è¶…é‡(Ultra-Heavy)" #: ../lib/FontConfig/Enums.vala:104 msgid "Italic" msgstr "斜体(Italic)" #: ../lib/FontConfig/Enums.vala:106 msgid "Oblique" msgstr "倾斜体(Oblique)" #: ../lib/FontConfig/Enums.vala:128 msgid "Ultra-Condensed" msgstr "超窄(Ultra-Condensed)" #: ../lib/FontConfig/Enums.vala:130 msgid "Extra-Condensed" msgstr "特窄(Extra-Condensed)" #: ../lib/FontConfig/Enums.vala:132 msgid "Condensed" msgstr "窄(Condensed)" #: ../lib/FontConfig/Enums.vala:134 msgid "Semi-Condensed" msgstr "åŠçª„(Semi-Condensed)" #: ../lib/FontConfig/Enums.vala:136 msgid "Semi-Expanded" msgstr "åŠå®½(Semi-Expanded)" #: ../lib/FontConfig/Enums.vala:138 msgid "Expanded" msgstr "宽(Expanded)" #: ../lib/FontConfig/Enums.vala:140 msgid "Extra-Expanded" msgstr "特宽(Extra-Expanded)" #: ../lib/FontConfig/Enums.vala:142 msgid "Ultra-Expanded" msgstr "超宽(Ultra-Expanded)" #: ../lib/FontConfig/Enums.vala:159 msgid "Proportional" msgstr "比例(Proportional)" #: ../lib/FontConfig/Enums.vala:161 msgid "Dual Width" msgstr "åŒå®½(Dual Width)" #: ../lib/FontConfig/Enums.vala:163 msgid "Monospace" msgstr "等宽(Monospace)" #: ../lib/FontConfig/Enums.vala:165 msgid "Charcell" msgstr "等宽等高(Charcell)" #: ../lib/FontConfig/Enums.vala:184 msgid "Unknown" msgstr "未知(Unknown)" #: ../lib/FontConfig/Enums.vala:186 msgid "RGB" msgstr "RGB" #: ../lib/FontConfig/Enums.vala:188 msgid "BGR" msgstr "BGR" #: ../lib/FontConfig/Enums.vala:190 msgid "VRGB" msgstr "VRGB" #: ../lib/FontConfig/Enums.vala:192 msgid "VBGR" msgstr "VBGR" #: ../lib/FontConfig/Enums.vala:194 ../lib/FontConfig/Enums.vala:215 #: ../lib/FontConfig/Enums.vala:236 msgid "None" msgstr "æ— (None)" #: ../lib/FontConfig/Enums.vala:209 msgid "Slight" msgstr "å°‘é‡(Slight)" #: ../lib/FontConfig/Enums.vala:213 msgid "Full" msgstr "全部(Full)" #: ../lib/FontConfig/Enums.vala:230 msgid "Default" msgstr "默认(Default)" #: ../lib/FontConfig/Enums.vala:234 msgid "Legacy" msgstr "传统(Legacy)" #: ../lib/FontConfig/Families.vala:45 #, fuzzy msgid "Loading available font families" msgstr "字体对所有用户å¯è§" #: ../lib/FontConfig/Sources.vala:83 ../lib/FontConfig/Sources.vala:97 #, fuzzy msgid "Source Unavailable" msgstr "%s --> 资æºä¸å­˜åœ¨" #: ../lib/FontConfig/Sources.vala:244 ../lib/FontConfig/XmlWriter.vala:38 msgid " Generated by Font Manager. Do NOT edit this file. " msgstr " Generated by Font Manager. Do NOT edit this file. " #: ../lib/Library/Install.vala:138 #, fuzzy msgid "Installing files" msgstr "全部字体" #: ../lib/Library/Install.vala:170 msgid "Preparing Archives" msgstr "" #: ../lib/Library/Remove.vala:81 #, fuzzy msgid "Removing files" msgstr "全部字体" #: ../lib/Library/Sorter.vala:91 msgid "Processing directories" msgstr "" #: ../lib/Library/Sorter.vala:123 #, fuzzy msgid "Processing files" msgstr "全部字体" #: ../lib/UX/CharacterMap/CharacterMapSideBar.vala:96 #, fuzzy msgid "Unicode Script" msgstr "Unicode 脚本" #: ../lib/UX/CharacterMap/CharacterMapSideBar.vala:97 #, fuzzy msgid "Unicode Block" msgstr "Unicode 区å—" #: ../lib/UX/Controls/CollectionControls.vala:32 msgid "Add new collection" msgstr "添加新的字体集" #: ../lib/UX/Controls/CollectionControls.vala:33 msgid "Remove selected collection" msgstr "删除选中的字体集" #: ../lib/UX/Controls/FontListControls.vala:46 #, fuzzy msgid "Remove selected font from collection" msgstr "删除比较组中选中的字体" #: ../lib/UX/Controls/FontListControls.vala:50 #: ../lib/UX/Controls/FontListControls.vala:65 msgid "Expand all" msgstr "全部展开" #: ../lib/UX/Controls/FontListControls.vala:54 #, fuzzy msgid "Search Families..." msgstr "æœç´¢æ•°æ®åº“" #: ../lib/UX/Controls/FontListControls.vala:65 msgid "Collapse all" msgstr "全部折å " #: ../lib/UX/Controls/PreviewControls.vala:91 msgid "Edit preview text" msgstr "编辑预览文本" #: ../lib/UX/Controls/PreviewControls.vala:94 msgid "Undo changes" msgstr "撤销更改" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Left Aligned" msgstr "左对é½" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Centered" msgstr "居中" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Fill" msgstr "两端对é½" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Right Aligned" msgstr "å³å¯¹é½" #: ../lib/UX/FontConfig/Controls.vala:66 msgid "Save" msgstr "" #: ../lib/UX/FontConfig/Controls.vala:68 msgid "Discard" msgstr "" #: ../lib/UX/FontConfig/Controls.vala:70 msgid "Running applications may require a restart to reflect any changes." msgstr "" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:44 msgid "Target DPI" msgstr "" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:45 msgid "Scale factor" msgstr "" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:49 msgid "LCD Filter" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:54 msgid "Antialias" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:55 msgid "Hinting" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:56 msgid "Enable Autohinter" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:64 msgid "Hinting Style" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:65 msgid "Use Embedded Bitmaps" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:67 #: ../lib/UX/FontConfig/FontPropertiesPane.vala:72 msgid " Size Restrictions " msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:70 msgid " Apply settings to point sizes " msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:143 msgid "Smaller than" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:144 msgid "Larger than" msgstr "" #: ../lib/UX/FontConfig/FontSourceList.vala:26 #, fuzzy msgid "Font Sources" msgstr "管ç†å­—体æº" #: ../lib/UX/FontConfig/FontSourceList.vala:27 #, fuzzy msgid "Easily add or preview fonts without actually installing them." msgstr "快速添加或预览字体" #: ../lib/UX/FontConfig/FontSourceList.vala:28 msgid "" "To add a new source simply drag a folder onto this area or click the add " "button in the toolbar." msgstr "通过拖放到此区域或å•击工具æ ä¸Šçš„æŒ‰é’®æ¥æ·»åŠ æ–°çš„å­—ä½“æºã€‚" #: ../lib/UX/FontConfig/FontSourceList.vala:194 msgid "Select source folders" msgstr "é€‰æ‹©å­—ä½“æºæ–‡ä»¶å¤¹" #: ../lib/UX/FontConfig/FontSourceList.vala:197 #: ../lib/UX/Utils/FileSelector.vala:40 ../lib/UX/Utils/FileSelector.vala:67 #: ../src/font-manager/Migration.vala:58 msgid "_Cancel" msgstr "å–æ¶ˆ(_C)" #: ../lib/UX/FontConfig/FontSourceList.vala:199 #: ../lib/UX/Utils/FileSelector.vala:42 msgid "_Open" msgstr "打开(_O)" #: ../lib/UX/FontConfig/SubpixelGeometry.vala:55 msgid "Subpixel Geometry" msgstr "" #: ../lib/UX/FontConfig/Substitute.vala:78 msgid "prefer" msgstr "" #: ../lib/UX/FontConfig/Substitute.vala:79 msgid "accept" msgstr "" #: ../lib/UX/FontConfig/Substitute.vala:80 #, fuzzy msgid "default" msgstr "默认(Default)" #: ../lib/UX/Metadata/License.vala:42 #, fuzzy msgid "File does not contain license information." msgstr "文件未包å«åè®®æè¿°ã€‚" #: ../lib/UX/Metadata/Properties.vala:43 msgid "PostScript Name" msgstr "PostScript åç§°" #: ../lib/UX/Metadata/Properties.vala:44 #: ../lib/UX/Models/CategoryModel.vala:104 msgid "Weight" msgstr "å­—é‡" #: ../lib/UX/Metadata/Properties.vala:45 #: ../lib/UX/Models/CategoryModel.vala:102 msgid "Slant" msgstr "倾斜" #: ../lib/UX/Metadata/Properties.vala:46 #: ../lib/UX/Models/CategoryModel.vala:106 msgid "Width" msgstr "字宽" #: ../lib/UX/Metadata/Properties.vala:47 #: ../lib/UX/Models/CategoryModel.vala:100 msgid "Spacing" msgstr "å­—è·" #: ../lib/UX/Metadata/Properties.vala:48 msgid "Version" msgstr "版本" #: ../lib/UX/Metadata/Properties.vala:49 #: ../lib/UX/Models/CategoryModel.vala:112 msgid "Vendor" msgstr "供应商" #: ../lib/UX/Metadata/Title.vala:51 ../src/font-viewer/TitleBar.vala:49 msgid "OpenType Font" msgstr "OpenType 字体" #: ../lib/UX/Metadata/Title.vala:52 ../src/font-viewer/TitleBar.vala:50 msgid "TrueType Font" msgstr "TrueType 字体" #: ../lib/UX/Metadata/Title.vala:53 ../src/font-viewer/TitleBar.vala:51 msgid "PostScript Type 1 Font" msgstr "PostScript Type 1 字体" #: ../lib/UX/Metadata/Title.vala:105 ../src/font-viewer/TitleBar.vala:99 msgid "No file selected" msgstr "" #: ../lib/UX/Metadata/Title.vala:105 ../src/font-viewer/TitleBar.vala:100 #, fuzzy msgid "Or unsupported filetype." msgstr "按文件类型分组" # Do not to translate this one. #: ../lib/UX/Models/CategoryModel.vala:92 msgid "All" msgstr "全部" #: ../lib/UX/Models/CategoryModel.vala:92 msgid "All Fonts" msgstr "全部字体" #: ../lib/UX/Models/CategoryModel.vala:94 msgid "System" msgstr "系统" #: ../lib/UX/Models/CategoryModel.vala:94 msgid "Fonts available to all users" msgstr "字体对所有用户å¯è§" #: ../lib/UX/Models/CategoryModel.vala:96 msgid "User" msgstr "用户" #: ../lib/UX/Models/CategoryModel.vala:96 #, fuzzy msgid "Fonts available only to you" msgstr "å­—ä½“åªæœ‰ä½ å¯è§" #: ../lib/UX/Models/CategoryModel.vala:100 msgid "Grouped by font spacing" msgstr "按字è·åˆ†ç»„" #: ../lib/UX/Models/CategoryModel.vala:102 msgid "Grouped by font angle" msgstr "按倾斜分组" #: ../lib/UX/Models/CategoryModel.vala:104 msgid "Grouped by font weight" msgstr "按字é‡åˆ†ç»„" #: ../lib/UX/Models/CategoryModel.vala:106 msgid "Grouped by font width" msgstr "按字宽分组" #: ../lib/UX/Models/CategoryModel.vala:108 msgid "Filetype" msgstr "文件类型" #: ../lib/UX/Models/CategoryModel.vala:108 msgid "Grouped by filetype" msgstr "按文件类型分组" #: ../lib/UX/Models/CategoryModel.vala:110 #: ../lib/UX/Views/FontPreviewPane.vala:123 msgid "License" msgstr "许å¯è¯" #: ../lib/UX/Models/CategoryModel.vala:110 msgid "Grouped by license type" msgstr "按许å¯è¯åˆ†ç»„" #: ../lib/UX/Models/CategoryModel.vala:112 msgid "Grouped by vendor" msgstr "按供应商分组" #: ../lib/UX/Models/CategoryModel.vala:125 msgid "Family Kind" msgstr "类型" #: ../lib/UX/Models/CategoryModel.vala:125 msgid "Only fonts which include Panose information will be grouped here." msgstr "åªæœ‰åŒ…å«Panoseä¿¡æ¯çš„字体将被分组到这里" #: ../lib/UX/Models/CategoryModel.vala:126 msgid "Any" msgstr "ä»»æ„(Any)" #: ../lib/UX/Models/CategoryModel.vala:127 msgid "No Fit" msgstr "无匹é…(No Fit)" #: ../lib/UX/Models/CategoryModel.vala:128 msgid "Text and Display" msgstr "文本和显示(Text and Display)" #: ../lib/UX/Models/CategoryModel.vala:129 msgid "Script" msgstr "脚本(Script)" # msgstr "手写体(Script)" #: ../lib/UX/Models/CategoryModel.vala:130 msgid "Decorative" msgstr "修饰(Decorative)" #: ../lib/UX/Models/CategoryModel.vala:131 msgid "Pictorial" msgstr "图形(Pictorial)" #: ../lib/UX/Models/CategoryModel.vala:165 msgid "Normal" msgstr "正常(Normal)" #: ../lib/UX/Models/CategoryModel.vala:170 msgid "Regular" msgstr "常规(Regular)" #: ../lib/UX/Utils/FileSelector.vala:37 msgid "Select files to install" msgstr "选择文件安装" #: ../lib/UX/Utils/FileSelector.vala:68 msgid "_Delete" msgstr "删除(_D)" #: ../lib/UX/Utils/FileSelector.vala:75 msgid "Select fonts to remove" msgstr "选择字体删除" #: ../lib/UX/Views/FontPreviewPane.vala:57 ../lib/UX/Widgets/TextViews.vala:122 msgid "Waterfall" msgstr "瀑布" # Not fine #: ../lib/UX/Views/FontPreviewPane.vala:59 ../lib/UX/Widgets/TextViews.vala:123 msgid "Body Text" msgstr "正文" #: ../lib/UX/Views/FontPreviewPane.vala:61 ../lib/UX/Widgets/TextViews.vala:121 #: ../src/font-manager/MainWindow.vala:213 msgid "Preview" msgstr "预览" #: ../lib/UX/Views/FontPreviewPane.vala:122 #, fuzzy msgid "Properties" msgstr "比例(Proportional)" #: ../lib/UX/Views/FontPreviewPane.vala:124 #, fuzzy msgid "Characters" msgstr "字符映射" #: ../lib/UX/Views/FontPreviewPane.vala:246 #, fuzzy msgid "Select preview type" msgstr "编辑预览文本" #: ../lib/UX/Widgets/CellRendererPill.vala:30 msgid "Variation " msgstr "å˜ä½“" #: ../lib/UX/Widgets/CellRendererPill.vala:31 msgid "Variations" msgstr "å˜ä½“" #: ../src/font-manager/Compare.vala:35 msgid "Add selected font to comparison" msgstr "添加选中的字体进行比较" #: ../src/font-manager/Compare.vala:36 msgid "Remove selected font from comparison" msgstr "删除比较组中选中的字体" #: ../src/font-manager/Compare.vala:43 msgid "Select text color" msgstr "选择文本颜色" #: ../src/font-manager/Compare.vala:44 msgid "Select background color" msgstr "选择背景颜色" #: ../src/font-manager/MainWindow.vala:57 #: ../src/font-manager/MainWindow.vala:219 msgid "Browse" msgstr "æµè§ˆ" #: ../src/font-manager/MainWindow.vala:59 #: ../src/font-manager/MainWindow.vala:214 msgid "Compare" msgstr "比较" #: ../src/font-manager/MainWindow.vala:61 #: ../src/font-manager/MainWindow.vala:218 msgid "Manage" msgstr "管ç†" #: ../src/font-manager/Migration.vala:59 #, fuzzy msgid "_Continue" msgstr "ç»§ç»­" #: ../src/font-manager/Migration.vala:69 msgid "Update Required" msgstr "éœ€è¦æ›´æ–°" #: ../src/font-manager/Migration.vala:206 msgid "" "\n" "Font Manager has detected files from a previous installation. Some files " "from previous versions are incompatible with this release. Others have been " "deprecated or moved.\n" "\n" "Font Manager will now attempt to migrate your fonts and collections. Files " "and settings which are no longer necessary or valid will be deleted. Any " "configuration files that could cause a conflict will also be deleted.\n" "\n" "It is strongly recommended that you back up any important files before " "proceeding.\n" msgstr "" #: ../src/font-manager/Preferences/Display.vala:48 #: ../src/font-manager/Preferences/Rendering.vala:47 msgid "Settings saved to file." msgstr "" #: ../src/font-manager/Preferences/Display.vala:52 #: ../src/font-manager/Preferences/Rendering.vala:51 msgid "Removed configuration file." msgstr "" #: ../src/font-manager/Preferences/Interface.vala:42 msgid "Wide Layout" msgstr "" #: ../src/font-manager/Preferences/Interface.vala:44 msgid "Only when maximized" msgstr "" #: ../src/font-manager/Preferences/Interface.vala:48 msgid "Client Side Decorations" msgstr "" #: ../src/font-manager/Preferences/Interface.vala:101 msgid "" "CSD enabled. Change will take effect next time the application is started." msgstr "" #: ../src/font-manager/Preferences/Interface.vala:103 msgid "" "CSD disabled. Change will take effect next time the application is started." msgstr "" #: ../src/font-manager/Preferences/Preferences.vala:28 #, fuzzy msgid "Sources" msgstr "管ç†å­—体æº" #: ../src/font-manager/Preferences/Preferences.vala:29 msgid "Rendering" msgstr "" #: ../src/font-manager/Preferences/Preferences.vala:30 #, fuzzy msgid "Display" msgstr "文本和显示(Text and Display)" #: ../src/font-manager/Preferences/Preferences.vala:31 msgid "Interface" msgstr "" #: ../src/font-manager/Preferences/Sources.vala:40 #, fuzzy msgid "Add source" msgstr "添加新的字体æº" #: ../src/font-manager/Preferences/Sources.vala:41 msgid "Remove selected source" msgstr "删除选中的字体æº" # msgstr "区å—" #: ../src/font-manager/SideBar.vala:172 msgid "Categories" msgstr "分类" #: ../src/font-manager/SideBar.vala:173 msgid "Collections" msgstr "字体集" #: ../src/font-manager/TitleBar.vala:63 msgid "Add Fonts" msgstr "添加字体" #: ../src/font-manager/TitleBar.vala:64 msgid "Remove Fonts" msgstr "删除字体" #: ../src/font-manager/TitleBar.vala:71 msgid "Preferences" msgstr "" #: ../src/font-manager/TitleBar.vala:160 msgid "Help" msgstr "帮助" #: ../src/font-manager/TitleBar.vala:161 msgid "About" msgstr "关于" #: ../src/font-manager/TitleBar.vala:162 msgid "Quit" msgstr "退出" # Not translate very good, just for use. #: ../src/font-viewer/Application.vala:121 #: ../src/font-viewer/MainWindow.vala:28 ../src/font-viewer/MainWindow.vala:52 #, fuzzy msgid "Font Viewer" msgstr "字体管ç†å™¨" #: ../src/font-viewer/MainWindow.vala:29 #, fuzzy msgid "Preview font files before installing them." msgstr "快速添加或预览字体" #: ../src/font-viewer/MainWindow.vala:30 msgid "To preview a font simply drag it onto this area." msgstr "" #: ../src/font-viewer/MainWindow.vala:58 ../src/font-viewer/MainWindow.vala:163 #, fuzzy msgid "Install Font" msgstr "全部字体" #: ../src/font-viewer/MainWindow.vala:155 msgid "Newer version already installed" msgstr "新版本已安装" #: ../src/font-viewer/MainWindow.vala:159 #, fuzzy msgid "Installed" msgstr "全部字体" #: ../data/ApplicationMenu.ui.h:1 #, fuzzy msgid "_Help" msgstr "帮助" #: ../data/ApplicationMenu.ui.h:2 #, fuzzy msgid "_About" msgstr "关于" #: ../data/ApplicationMenu.ui.h:3 #, fuzzy msgid "_Quit" msgstr "退出" master-0.7.3/po/zh_HK.po000066400000000000000000000502471300074171200150000ustar00rootroot00000000000000# Font Manager - Simple font management for Gtk+ desktop environments # # Copyright © 2009 - 2016 Jerry Casiano # # 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 . # # Author: # Jerry Casiano # Jerry Casiano , 2016. #zanata msgid "" msgstr "" "Project-Id-Version: font-manager 0.7.3\n" "Report-Msgid-Bugs-To: https://github.com/FontManager/master/issues\n" "POT-Creation-Date: 2016-10-16 12:57-0400\n" "PO-Revision-Date: 2016-05-25 11:48-0400\n" "Last-Translator: Copied by Zanata \n" "Language-Team: Chinese (China) <@>\n" "Language: zh-HK\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Zanata 3.9.3\n" "Plural-Forms: nplurals=1; plural=0\n" # Not translate very good, just for use. #: ../lib/Common/About.vala:28 msgid "Font Manager" msgstr "字体管ç†å™¨" #: ../lib/Common/About.vala:30 #, fuzzy msgid "Simple font management for GTK+ desktop environments" msgstr "GTK+桌é¢çŽ¯å¢ƒä¸‹çš„ç®€æ˜“å­—ä½“ç®¡ç†å™¨" #: ../lib/Common/About.vala:34 msgid "" "\n" " This program is free software: you can redistribute it and/or modify\n" " it under the terms of the GNU General Public License as published by\n" " the Free Software Foundation, either version 3 of the License, or\n" " (at your option) any later version.\n" "\n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" " GNU General Public License for more details.\n" "\n" " You should have received a copy of the GNU General Public License\n" " along with this program. If not, see .\n" " " msgstr "" #: ../lib/Common/Constants.vala:38 #, fuzzy msgid "Enter Collection Name" msgstr "新字体集" #: ../lib/Filters/Collection.vala:36 msgid "New Collection" msgstr "新字体集" #: ../lib/Filters/Disabled.vala:29 msgid "Disabled" msgstr "ç¦ç”¨" #: ../lib/Filters/Disabled.vala:29 msgid "Fonts which have been disabled" msgstr "ç¦ç”¨å­—体" #: ../lib/Filters/Filter.vala:40 #, c-format msgid "Created : %s" msgstr "创建: %s" #: ../lib/Filters/Unsorted.vala:29 msgid "Unsorted" msgstr "未分类" #: ../lib/Filters/Unsorted.vala:29 msgid "Fonts not present in any collection" msgstr "字体未在任何字体集中" #: ../lib/FontConfig/Enums.vala:70 msgid "Thin" msgstr "è½»(Thin)" #: ../lib/FontConfig/Enums.vala:72 msgid "Ultra-Light" msgstr "超细(Ultra-Light)" #: ../lib/FontConfig/Enums.vala:74 ../lib/FontConfig/Enums.vala:232 msgid "Light" msgstr "细(Light)" #: ../lib/FontConfig/Enums.vala:76 msgid "Book" msgstr "预设(Book)" #: ../lib/FontConfig/Enums.vala:78 ../lib/FontConfig/Enums.vala:211 msgid "Medium" msgstr "中等(Medium)" #: ../lib/FontConfig/Enums.vala:80 msgid "Semi-Bold" msgstr "åŠç²—(Semi-Bold)" #: ../lib/FontConfig/Enums.vala:82 msgid "Bold" msgstr "ç²—(Bold)" #: ../lib/FontConfig/Enums.vala:84 msgid "Ultra-Bold" msgstr "è¶…ç²—(Ultra-Bold)" #: ../lib/FontConfig/Enums.vala:86 msgid "Heavy" msgstr "é‡(Heavy)" #: ../lib/FontConfig/Enums.vala:88 msgid "Ultra-Heavy" msgstr "è¶…é‡(Ultra-Heavy)" #: ../lib/FontConfig/Enums.vala:104 msgid "Italic" msgstr "斜体(Italic)" #: ../lib/FontConfig/Enums.vala:106 msgid "Oblique" msgstr "倾斜体(Oblique)" #: ../lib/FontConfig/Enums.vala:128 msgid "Ultra-Condensed" msgstr "超窄(Ultra-Condensed)" #: ../lib/FontConfig/Enums.vala:130 msgid "Extra-Condensed" msgstr "特窄(Extra-Condensed)" #: ../lib/FontConfig/Enums.vala:132 msgid "Condensed" msgstr "窄(Condensed)" #: ../lib/FontConfig/Enums.vala:134 msgid "Semi-Condensed" msgstr "åŠçª„(Semi-Condensed)" #: ../lib/FontConfig/Enums.vala:136 msgid "Semi-Expanded" msgstr "åŠå®½(Semi-Expanded)" #: ../lib/FontConfig/Enums.vala:138 msgid "Expanded" msgstr "宽(Expanded)" #: ../lib/FontConfig/Enums.vala:140 msgid "Extra-Expanded" msgstr "特宽(Extra-Expanded)" #: ../lib/FontConfig/Enums.vala:142 msgid "Ultra-Expanded" msgstr "超宽(Ultra-Expanded)" #: ../lib/FontConfig/Enums.vala:159 msgid "Proportional" msgstr "比例(Proportional)" #: ../lib/FontConfig/Enums.vala:161 msgid "Dual Width" msgstr "åŒå®½(Dual Width)" #: ../lib/FontConfig/Enums.vala:163 msgid "Monospace" msgstr "等宽(Monospace)" #: ../lib/FontConfig/Enums.vala:165 msgid "Charcell" msgstr "等宽等高(Charcell)" #: ../lib/FontConfig/Enums.vala:184 msgid "Unknown" msgstr "未知(Unknown)" #: ../lib/FontConfig/Enums.vala:186 msgid "RGB" msgstr "RGB" #: ../lib/FontConfig/Enums.vala:188 msgid "BGR" msgstr "BGR" #: ../lib/FontConfig/Enums.vala:190 msgid "VRGB" msgstr "VRGB" #: ../lib/FontConfig/Enums.vala:192 msgid "VBGR" msgstr "VBGR" #: ../lib/FontConfig/Enums.vala:194 ../lib/FontConfig/Enums.vala:215 #: ../lib/FontConfig/Enums.vala:236 msgid "None" msgstr "æ— (None)" #: ../lib/FontConfig/Enums.vala:209 msgid "Slight" msgstr "å°‘é‡(Slight)" #: ../lib/FontConfig/Enums.vala:213 msgid "Full" msgstr "全部(Full)" #: ../lib/FontConfig/Enums.vala:230 msgid "Default" msgstr "默认(Default)" #: ../lib/FontConfig/Enums.vala:234 msgid "Legacy" msgstr "传统(Legacy)" #: ../lib/FontConfig/Families.vala:45 #, fuzzy msgid "Loading available font families" msgstr "字体对所有用户å¯è§" #: ../lib/FontConfig/Sources.vala:83 ../lib/FontConfig/Sources.vala:97 #, fuzzy msgid "Source Unavailable" msgstr "%s --> 资æºä¸å­˜åœ¨" #: ../lib/FontConfig/Sources.vala:244 ../lib/FontConfig/XmlWriter.vala:38 msgid " Generated by Font Manager. Do NOT edit this file. " msgstr " Generated by Font Manager. Do NOT edit this file. " #: ../lib/Library/Install.vala:138 #, fuzzy msgid "Installing files" msgstr "全部字体" #: ../lib/Library/Install.vala:170 msgid "Preparing Archives" msgstr "" #: ../lib/Library/Remove.vala:81 #, fuzzy msgid "Removing files" msgstr "全部字体" #: ../lib/Library/Sorter.vala:91 msgid "Processing directories" msgstr "" #: ../lib/Library/Sorter.vala:123 #, fuzzy msgid "Processing files" msgstr "全部字体" #: ../lib/UX/CharacterMap/CharacterMapSideBar.vala:96 #, fuzzy msgid "Unicode Script" msgstr "Unicode 脚本" #: ../lib/UX/CharacterMap/CharacterMapSideBar.vala:97 #, fuzzy msgid "Unicode Block" msgstr "Unicode 区å—" #: ../lib/UX/Controls/CollectionControls.vala:32 msgid "Add new collection" msgstr "添加新的字体集" #: ../lib/UX/Controls/CollectionControls.vala:33 msgid "Remove selected collection" msgstr "删除选中的字体集" #: ../lib/UX/Controls/FontListControls.vala:46 #, fuzzy msgid "Remove selected font from collection" msgstr "删除比较组中选中的字体" #: ../lib/UX/Controls/FontListControls.vala:50 #: ../lib/UX/Controls/FontListControls.vala:65 msgid "Expand all" msgstr "全部展开" #: ../lib/UX/Controls/FontListControls.vala:54 #, fuzzy msgid "Search Families..." msgstr "æœç´¢æ•°æ®åº“" #: ../lib/UX/Controls/FontListControls.vala:65 msgid "Collapse all" msgstr "全部折å " #: ../lib/UX/Controls/PreviewControls.vala:91 msgid "Edit preview text" msgstr "编辑预览文本" #: ../lib/UX/Controls/PreviewControls.vala:94 msgid "Undo changes" msgstr "撤销更改" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Left Aligned" msgstr "左对é½" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Centered" msgstr "居中" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Fill" msgstr "两端对é½" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Right Aligned" msgstr "å³å¯¹é½" #: ../lib/UX/FontConfig/Controls.vala:66 msgid "Save" msgstr "" #: ../lib/UX/FontConfig/Controls.vala:68 msgid "Discard" msgstr "" #: ../lib/UX/FontConfig/Controls.vala:70 msgid "Running applications may require a restart to reflect any changes." msgstr "" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:44 msgid "Target DPI" msgstr "" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:45 msgid "Scale factor" msgstr "" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:49 msgid "LCD Filter" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:54 msgid "Antialias" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:55 msgid "Hinting" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:56 msgid "Enable Autohinter" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:64 msgid "Hinting Style" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:65 msgid "Use Embedded Bitmaps" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:67 #: ../lib/UX/FontConfig/FontPropertiesPane.vala:72 msgid " Size Restrictions " msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:70 msgid " Apply settings to point sizes " msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:143 msgid "Smaller than" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:144 msgid "Larger than" msgstr "" #: ../lib/UX/FontConfig/FontSourceList.vala:26 #, fuzzy msgid "Font Sources" msgstr "管ç†å­—体æº" #: ../lib/UX/FontConfig/FontSourceList.vala:27 #, fuzzy msgid "Easily add or preview fonts without actually installing them." msgstr "快速添加或预览字体" #: ../lib/UX/FontConfig/FontSourceList.vala:28 msgid "" "To add a new source simply drag a folder onto this area or click the add " "button in the toolbar." msgstr "通过拖放到此区域或å•击工具æ ä¸Šçš„æŒ‰é’®æ¥æ·»åŠ æ–°çš„å­—ä½“æºã€‚" #: ../lib/UX/FontConfig/FontSourceList.vala:194 msgid "Select source folders" msgstr "é€‰æ‹©å­—ä½“æºæ–‡ä»¶å¤¹" #: ../lib/UX/FontConfig/FontSourceList.vala:197 #: ../lib/UX/Utils/FileSelector.vala:40 ../lib/UX/Utils/FileSelector.vala:67 #: ../src/font-manager/Migration.vala:58 msgid "_Cancel" msgstr "å–æ¶ˆ(_C)" #: ../lib/UX/FontConfig/FontSourceList.vala:199 #: ../lib/UX/Utils/FileSelector.vala:42 msgid "_Open" msgstr "打开(_O)" #: ../lib/UX/FontConfig/SubpixelGeometry.vala:55 msgid "Subpixel Geometry" msgstr "" #: ../lib/UX/FontConfig/Substitute.vala:78 msgid "prefer" msgstr "" #: ../lib/UX/FontConfig/Substitute.vala:79 msgid "accept" msgstr "" #: ../lib/UX/FontConfig/Substitute.vala:80 #, fuzzy msgid "default" msgstr "默认(Default)" #: ../lib/UX/Metadata/License.vala:42 #, fuzzy msgid "File does not contain license information." msgstr "文件未包å«åè®®æè¿°ã€‚" #: ../lib/UX/Metadata/Properties.vala:43 msgid "PostScript Name" msgstr "PostScript åç§°" #: ../lib/UX/Metadata/Properties.vala:44 #: ../lib/UX/Models/CategoryModel.vala:104 msgid "Weight" msgstr "å­—é‡" #: ../lib/UX/Metadata/Properties.vala:45 #: ../lib/UX/Models/CategoryModel.vala:102 msgid "Slant" msgstr "倾斜" #: ../lib/UX/Metadata/Properties.vala:46 #: ../lib/UX/Models/CategoryModel.vala:106 msgid "Width" msgstr "字宽" #: ../lib/UX/Metadata/Properties.vala:47 #: ../lib/UX/Models/CategoryModel.vala:100 msgid "Spacing" msgstr "å­—è·" #: ../lib/UX/Metadata/Properties.vala:48 msgid "Version" msgstr "版本" #: ../lib/UX/Metadata/Properties.vala:49 #: ../lib/UX/Models/CategoryModel.vala:112 msgid "Vendor" msgstr "供应商" #: ../lib/UX/Metadata/Title.vala:51 ../src/font-viewer/TitleBar.vala:49 msgid "OpenType Font" msgstr "OpenType 字体" #: ../lib/UX/Metadata/Title.vala:52 ../src/font-viewer/TitleBar.vala:50 msgid "TrueType Font" msgstr "TrueType 字体" #: ../lib/UX/Metadata/Title.vala:53 ../src/font-viewer/TitleBar.vala:51 msgid "PostScript Type 1 Font" msgstr "PostScript Type 1 字体" #: ../lib/UX/Metadata/Title.vala:105 ../src/font-viewer/TitleBar.vala:99 msgid "No file selected" msgstr "" #: ../lib/UX/Metadata/Title.vala:105 ../src/font-viewer/TitleBar.vala:100 #, fuzzy msgid "Or unsupported filetype." msgstr "按文件类型分组" # Do not to translate this one. #: ../lib/UX/Models/CategoryModel.vala:92 msgid "All" msgstr "全部" #: ../lib/UX/Models/CategoryModel.vala:92 msgid "All Fonts" msgstr "全部字体" #: ../lib/UX/Models/CategoryModel.vala:94 msgid "System" msgstr "系统" #: ../lib/UX/Models/CategoryModel.vala:94 msgid "Fonts available to all users" msgstr "字体对所有用户å¯è§" #: ../lib/UX/Models/CategoryModel.vala:96 msgid "User" msgstr "用户" #: ../lib/UX/Models/CategoryModel.vala:96 #, fuzzy msgid "Fonts available only to you" msgstr "å­—ä½“åªæœ‰ä½ å¯è§" #: ../lib/UX/Models/CategoryModel.vala:100 msgid "Grouped by font spacing" msgstr "按字è·åˆ†ç»„" #: ../lib/UX/Models/CategoryModel.vala:102 msgid "Grouped by font angle" msgstr "按倾斜分组" #: ../lib/UX/Models/CategoryModel.vala:104 msgid "Grouped by font weight" msgstr "按字é‡åˆ†ç»„" #: ../lib/UX/Models/CategoryModel.vala:106 msgid "Grouped by font width" msgstr "按字宽分组" #: ../lib/UX/Models/CategoryModel.vala:108 msgid "Filetype" msgstr "文件类型" #: ../lib/UX/Models/CategoryModel.vala:108 msgid "Grouped by filetype" msgstr "按文件类型分组" #: ../lib/UX/Models/CategoryModel.vala:110 #: ../lib/UX/Views/FontPreviewPane.vala:123 msgid "License" msgstr "许å¯è¯" #: ../lib/UX/Models/CategoryModel.vala:110 msgid "Grouped by license type" msgstr "按许å¯è¯åˆ†ç»„" #: ../lib/UX/Models/CategoryModel.vala:112 msgid "Grouped by vendor" msgstr "按供应商分组" #: ../lib/UX/Models/CategoryModel.vala:125 msgid "Family Kind" msgstr "类型" #: ../lib/UX/Models/CategoryModel.vala:125 msgid "Only fonts which include Panose information will be grouped here." msgstr "åªæœ‰åŒ…å«Panoseä¿¡æ¯çš„字体将被分组到这里" #: ../lib/UX/Models/CategoryModel.vala:126 msgid "Any" msgstr "ä»»æ„(Any)" #: ../lib/UX/Models/CategoryModel.vala:127 msgid "No Fit" msgstr "无匹é…(No Fit)" #: ../lib/UX/Models/CategoryModel.vala:128 msgid "Text and Display" msgstr "文本和显示(Text and Display)" #: ../lib/UX/Models/CategoryModel.vala:129 msgid "Script" msgstr "脚本(Script)" # msgstr "手写体(Script)" #: ../lib/UX/Models/CategoryModel.vala:130 msgid "Decorative" msgstr "修饰(Decorative)" #: ../lib/UX/Models/CategoryModel.vala:131 msgid "Pictorial" msgstr "图形(Pictorial)" #: ../lib/UX/Models/CategoryModel.vala:165 msgid "Normal" msgstr "正常(Normal)" #: ../lib/UX/Models/CategoryModel.vala:170 msgid "Regular" msgstr "常规(Regular)" #: ../lib/UX/Utils/FileSelector.vala:37 msgid "Select files to install" msgstr "选择文件安装" #: ../lib/UX/Utils/FileSelector.vala:68 msgid "_Delete" msgstr "删除(_D)" #: ../lib/UX/Utils/FileSelector.vala:75 msgid "Select fonts to remove" msgstr "选择字体删除" #: ../lib/UX/Views/FontPreviewPane.vala:57 ../lib/UX/Widgets/TextViews.vala:122 msgid "Waterfall" msgstr "瀑布" # Not fine #: ../lib/UX/Views/FontPreviewPane.vala:59 ../lib/UX/Widgets/TextViews.vala:123 msgid "Body Text" msgstr "正文" #: ../lib/UX/Views/FontPreviewPane.vala:61 ../lib/UX/Widgets/TextViews.vala:121 #: ../src/font-manager/MainWindow.vala:213 msgid "Preview" msgstr "预览" #: ../lib/UX/Views/FontPreviewPane.vala:122 #, fuzzy msgid "Properties" msgstr "比例(Proportional)" #: ../lib/UX/Views/FontPreviewPane.vala:124 #, fuzzy msgid "Characters" msgstr "字符映射" #: ../lib/UX/Views/FontPreviewPane.vala:246 #, fuzzy msgid "Select preview type" msgstr "编辑预览文本" #: ../lib/UX/Widgets/CellRendererPill.vala:30 msgid "Variation " msgstr "å˜ä½“" #: ../lib/UX/Widgets/CellRendererPill.vala:31 msgid "Variations" msgstr "å˜ä½“" #: ../src/font-manager/Compare.vala:35 msgid "Add selected font to comparison" msgstr "添加选中的字体进行比较" #: ../src/font-manager/Compare.vala:36 msgid "Remove selected font from comparison" msgstr "删除比较组中选中的字体" #: ../src/font-manager/Compare.vala:43 msgid "Select text color" msgstr "选择文本颜色" #: ../src/font-manager/Compare.vala:44 msgid "Select background color" msgstr "选择背景颜色" #: ../src/font-manager/MainWindow.vala:57 #: ../src/font-manager/MainWindow.vala:219 msgid "Browse" msgstr "æµè§ˆ" #: ../src/font-manager/MainWindow.vala:59 #: ../src/font-manager/MainWindow.vala:214 msgid "Compare" msgstr "比较" #: ../src/font-manager/MainWindow.vala:61 #: ../src/font-manager/MainWindow.vala:218 msgid "Manage" msgstr "管ç†" #: ../src/font-manager/Migration.vala:59 #, fuzzy msgid "_Continue" msgstr "ç»§ç»­" #: ../src/font-manager/Migration.vala:69 msgid "Update Required" msgstr "éœ€è¦æ›´æ–°" #: ../src/font-manager/Migration.vala:206 msgid "" "\n" "Font Manager has detected files from a previous installation. Some files " "from previous versions are incompatible with this release. Others have been " "deprecated or moved.\n" "\n" "Font Manager will now attempt to migrate your fonts and collections. Files " "and settings which are no longer necessary or valid will be deleted. Any " "configuration files that could cause a conflict will also be deleted.\n" "\n" "It is strongly recommended that you back up any important files before " "proceeding.\n" msgstr "" #: ../src/font-manager/Preferences/Display.vala:48 #: ../src/font-manager/Preferences/Rendering.vala:47 msgid "Settings saved to file." msgstr "" #: ../src/font-manager/Preferences/Display.vala:52 #: ../src/font-manager/Preferences/Rendering.vala:51 msgid "Removed configuration file." msgstr "" #: ../src/font-manager/Preferences/Interface.vala:42 msgid "Wide Layout" msgstr "" #: ../src/font-manager/Preferences/Interface.vala:44 msgid "Only when maximized" msgstr "" #: ../src/font-manager/Preferences/Interface.vala:48 msgid "Client Side Decorations" msgstr "" #: ../src/font-manager/Preferences/Interface.vala:101 msgid "" "CSD enabled. Change will take effect next time the application is started." msgstr "" #: ../src/font-manager/Preferences/Interface.vala:103 msgid "" "CSD disabled. Change will take effect next time the application is started." msgstr "" #: ../src/font-manager/Preferences/Preferences.vala:28 #, fuzzy msgid "Sources" msgstr "管ç†å­—体æº" #: ../src/font-manager/Preferences/Preferences.vala:29 msgid "Rendering" msgstr "" #: ../src/font-manager/Preferences/Preferences.vala:30 #, fuzzy msgid "Display" msgstr "文本和显示(Text and Display)" #: ../src/font-manager/Preferences/Preferences.vala:31 msgid "Interface" msgstr "" #: ../src/font-manager/Preferences/Sources.vala:40 #, fuzzy msgid "Add source" msgstr "添加新的字体æº" #: ../src/font-manager/Preferences/Sources.vala:41 msgid "Remove selected source" msgstr "删除选中的字体æº" # msgstr "区å—" #: ../src/font-manager/SideBar.vala:172 msgid "Categories" msgstr "分类" #: ../src/font-manager/SideBar.vala:173 msgid "Collections" msgstr "字体集" #: ../src/font-manager/TitleBar.vala:63 msgid "Add Fonts" msgstr "添加字体" #: ../src/font-manager/TitleBar.vala:64 msgid "Remove Fonts" msgstr "删除字体" #: ../src/font-manager/TitleBar.vala:71 msgid "Preferences" msgstr "" #: ../src/font-manager/TitleBar.vala:160 msgid "Help" msgstr "帮助" #: ../src/font-manager/TitleBar.vala:161 msgid "About" msgstr "关于" #: ../src/font-manager/TitleBar.vala:162 msgid "Quit" msgstr "退出" # Not translate very good, just for use. #: ../src/font-viewer/Application.vala:121 #: ../src/font-viewer/MainWindow.vala:28 ../src/font-viewer/MainWindow.vala:52 #, fuzzy msgid "Font Viewer" msgstr "字体管ç†å™¨" #: ../src/font-viewer/MainWindow.vala:29 #, fuzzy msgid "Preview font files before installing them." msgstr "快速添加或预览字体" #: ../src/font-viewer/MainWindow.vala:30 msgid "To preview a font simply drag it onto this area." msgstr "" #: ../src/font-viewer/MainWindow.vala:58 ../src/font-viewer/MainWindow.vala:163 #, fuzzy msgid "Install Font" msgstr "全部字体" #: ../src/font-viewer/MainWindow.vala:155 msgid "Newer version already installed" msgstr "新版本已安装" #: ../src/font-viewer/MainWindow.vala:159 #, fuzzy msgid "Installed" msgstr "全部字体" #: ../data/ApplicationMenu.ui.h:1 #, fuzzy msgid "_Help" msgstr "帮助" #: ../data/ApplicationMenu.ui.h:2 #, fuzzy msgid "_About" msgstr "关于" #: ../data/ApplicationMenu.ui.h:3 #, fuzzy msgid "_Quit" msgstr "退出" master-0.7.3/po/zh_TW.po000066400000000000000000000502471300074171200150300ustar00rootroot00000000000000# Font Manager - Simple font management for Gtk+ desktop environments # # Copyright © 2009 - 2016 Jerry Casiano # # 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 . # # Author: # Jerry Casiano # Jerry Casiano , 2016. #zanata msgid "" msgstr "" "Project-Id-Version: font-manager 0.7.3\n" "Report-Msgid-Bugs-To: https://github.com/FontManager/master/issues\n" "POT-Creation-Date: 2016-10-16 12:57-0400\n" "PO-Revision-Date: 2016-05-25 11:48-0400\n" "Last-Translator: Copied by Zanata \n" "Language-Team: Chinese (China) <@>\n" "Language: zh-TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Zanata 3.9.3\n" "Plural-Forms: nplurals=1; plural=0\n" # Not translate very good, just for use. #: ../lib/Common/About.vala:28 msgid "Font Manager" msgstr "字体管ç†å™¨" #: ../lib/Common/About.vala:30 #, fuzzy msgid "Simple font management for GTK+ desktop environments" msgstr "GTK+桌é¢çŽ¯å¢ƒä¸‹çš„ç®€æ˜“å­—ä½“ç®¡ç†å™¨" #: ../lib/Common/About.vala:34 msgid "" "\n" " This program is free software: you can redistribute it and/or modify\n" " it under the terms of the GNU General Public License as published by\n" " the Free Software Foundation, either version 3 of the License, or\n" " (at your option) any later version.\n" "\n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" " GNU General Public License for more details.\n" "\n" " You should have received a copy of the GNU General Public License\n" " along with this program. If not, see .\n" " " msgstr "" #: ../lib/Common/Constants.vala:38 #, fuzzy msgid "Enter Collection Name" msgstr "新字体集" #: ../lib/Filters/Collection.vala:36 msgid "New Collection" msgstr "新字体集" #: ../lib/Filters/Disabled.vala:29 msgid "Disabled" msgstr "ç¦ç”¨" #: ../lib/Filters/Disabled.vala:29 msgid "Fonts which have been disabled" msgstr "ç¦ç”¨å­—体" #: ../lib/Filters/Filter.vala:40 #, c-format msgid "Created : %s" msgstr "创建: %s" #: ../lib/Filters/Unsorted.vala:29 msgid "Unsorted" msgstr "未分类" #: ../lib/Filters/Unsorted.vala:29 msgid "Fonts not present in any collection" msgstr "字体未在任何字体集中" #: ../lib/FontConfig/Enums.vala:70 msgid "Thin" msgstr "è½»(Thin)" #: ../lib/FontConfig/Enums.vala:72 msgid "Ultra-Light" msgstr "超细(Ultra-Light)" #: ../lib/FontConfig/Enums.vala:74 ../lib/FontConfig/Enums.vala:232 msgid "Light" msgstr "细(Light)" #: ../lib/FontConfig/Enums.vala:76 msgid "Book" msgstr "预设(Book)" #: ../lib/FontConfig/Enums.vala:78 ../lib/FontConfig/Enums.vala:211 msgid "Medium" msgstr "中等(Medium)" #: ../lib/FontConfig/Enums.vala:80 msgid "Semi-Bold" msgstr "åŠç²—(Semi-Bold)" #: ../lib/FontConfig/Enums.vala:82 msgid "Bold" msgstr "ç²—(Bold)" #: ../lib/FontConfig/Enums.vala:84 msgid "Ultra-Bold" msgstr "è¶…ç²—(Ultra-Bold)" #: ../lib/FontConfig/Enums.vala:86 msgid "Heavy" msgstr "é‡(Heavy)" #: ../lib/FontConfig/Enums.vala:88 msgid "Ultra-Heavy" msgstr "è¶…é‡(Ultra-Heavy)" #: ../lib/FontConfig/Enums.vala:104 msgid "Italic" msgstr "斜体(Italic)" #: ../lib/FontConfig/Enums.vala:106 msgid "Oblique" msgstr "倾斜体(Oblique)" #: ../lib/FontConfig/Enums.vala:128 msgid "Ultra-Condensed" msgstr "超窄(Ultra-Condensed)" #: ../lib/FontConfig/Enums.vala:130 msgid "Extra-Condensed" msgstr "特窄(Extra-Condensed)" #: ../lib/FontConfig/Enums.vala:132 msgid "Condensed" msgstr "窄(Condensed)" #: ../lib/FontConfig/Enums.vala:134 msgid "Semi-Condensed" msgstr "åŠçª„(Semi-Condensed)" #: ../lib/FontConfig/Enums.vala:136 msgid "Semi-Expanded" msgstr "åŠå®½(Semi-Expanded)" #: ../lib/FontConfig/Enums.vala:138 msgid "Expanded" msgstr "宽(Expanded)" #: ../lib/FontConfig/Enums.vala:140 msgid "Extra-Expanded" msgstr "特宽(Extra-Expanded)" #: ../lib/FontConfig/Enums.vala:142 msgid "Ultra-Expanded" msgstr "超宽(Ultra-Expanded)" #: ../lib/FontConfig/Enums.vala:159 msgid "Proportional" msgstr "比例(Proportional)" #: ../lib/FontConfig/Enums.vala:161 msgid "Dual Width" msgstr "åŒå®½(Dual Width)" #: ../lib/FontConfig/Enums.vala:163 msgid "Monospace" msgstr "等宽(Monospace)" #: ../lib/FontConfig/Enums.vala:165 msgid "Charcell" msgstr "等宽等高(Charcell)" #: ../lib/FontConfig/Enums.vala:184 msgid "Unknown" msgstr "未知(Unknown)" #: ../lib/FontConfig/Enums.vala:186 msgid "RGB" msgstr "RGB" #: ../lib/FontConfig/Enums.vala:188 msgid "BGR" msgstr "BGR" #: ../lib/FontConfig/Enums.vala:190 msgid "VRGB" msgstr "VRGB" #: ../lib/FontConfig/Enums.vala:192 msgid "VBGR" msgstr "VBGR" #: ../lib/FontConfig/Enums.vala:194 ../lib/FontConfig/Enums.vala:215 #: ../lib/FontConfig/Enums.vala:236 msgid "None" msgstr "æ— (None)" #: ../lib/FontConfig/Enums.vala:209 msgid "Slight" msgstr "å°‘é‡(Slight)" #: ../lib/FontConfig/Enums.vala:213 msgid "Full" msgstr "全部(Full)" #: ../lib/FontConfig/Enums.vala:230 msgid "Default" msgstr "默认(Default)" #: ../lib/FontConfig/Enums.vala:234 msgid "Legacy" msgstr "传统(Legacy)" #: ../lib/FontConfig/Families.vala:45 #, fuzzy msgid "Loading available font families" msgstr "字体对所有用户å¯è§" #: ../lib/FontConfig/Sources.vala:83 ../lib/FontConfig/Sources.vala:97 #, fuzzy msgid "Source Unavailable" msgstr "%s --> 资æºä¸å­˜åœ¨" #: ../lib/FontConfig/Sources.vala:244 ../lib/FontConfig/XmlWriter.vala:38 msgid " Generated by Font Manager. Do NOT edit this file. " msgstr " Generated by Font Manager. Do NOT edit this file. " #: ../lib/Library/Install.vala:138 #, fuzzy msgid "Installing files" msgstr "全部字体" #: ../lib/Library/Install.vala:170 msgid "Preparing Archives" msgstr "" #: ../lib/Library/Remove.vala:81 #, fuzzy msgid "Removing files" msgstr "全部字体" #: ../lib/Library/Sorter.vala:91 msgid "Processing directories" msgstr "" #: ../lib/Library/Sorter.vala:123 #, fuzzy msgid "Processing files" msgstr "全部字体" #: ../lib/UX/CharacterMap/CharacterMapSideBar.vala:96 #, fuzzy msgid "Unicode Script" msgstr "Unicode 脚本" #: ../lib/UX/CharacterMap/CharacterMapSideBar.vala:97 #, fuzzy msgid "Unicode Block" msgstr "Unicode 区å—" #: ../lib/UX/Controls/CollectionControls.vala:32 msgid "Add new collection" msgstr "添加新的字体集" #: ../lib/UX/Controls/CollectionControls.vala:33 msgid "Remove selected collection" msgstr "删除选中的字体集" #: ../lib/UX/Controls/FontListControls.vala:46 #, fuzzy msgid "Remove selected font from collection" msgstr "删除比较组中选中的字体" #: ../lib/UX/Controls/FontListControls.vala:50 #: ../lib/UX/Controls/FontListControls.vala:65 msgid "Expand all" msgstr "全部展开" #: ../lib/UX/Controls/FontListControls.vala:54 #, fuzzy msgid "Search Families..." msgstr "æœç´¢æ•°æ®åº“" #: ../lib/UX/Controls/FontListControls.vala:65 msgid "Collapse all" msgstr "全部折å " #: ../lib/UX/Controls/PreviewControls.vala:91 msgid "Edit preview text" msgstr "编辑预览文本" #: ../lib/UX/Controls/PreviewControls.vala:94 msgid "Undo changes" msgstr "撤销更改" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Left Aligned" msgstr "左对é½" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Centered" msgstr "居中" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Fill" msgstr "两端对é½" #: ../lib/UX/Controls/PreviewControls.vala:99 msgid "Right Aligned" msgstr "å³å¯¹é½" #: ../lib/UX/FontConfig/Controls.vala:66 msgid "Save" msgstr "" #: ../lib/UX/FontConfig/Controls.vala:68 msgid "Discard" msgstr "" #: ../lib/UX/FontConfig/Controls.vala:70 msgid "Running applications may require a restart to reflect any changes." msgstr "" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:44 msgid "Target DPI" msgstr "" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:45 msgid "Scale factor" msgstr "" #: ../lib/UX/FontConfig/DisplayPropertiesPane.vala:49 msgid "LCD Filter" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:54 msgid "Antialias" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:55 msgid "Hinting" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:56 msgid "Enable Autohinter" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:64 msgid "Hinting Style" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:65 msgid "Use Embedded Bitmaps" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:67 #: ../lib/UX/FontConfig/FontPropertiesPane.vala:72 msgid " Size Restrictions " msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:70 msgid " Apply settings to point sizes " msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:143 msgid "Smaller than" msgstr "" #: ../lib/UX/FontConfig/FontPropertiesPane.vala:144 msgid "Larger than" msgstr "" #: ../lib/UX/FontConfig/FontSourceList.vala:26 #, fuzzy msgid "Font Sources" msgstr "管ç†å­—体æº" #: ../lib/UX/FontConfig/FontSourceList.vala:27 #, fuzzy msgid "Easily add or preview fonts without actually installing them." msgstr "快速添加或预览字体" #: ../lib/UX/FontConfig/FontSourceList.vala:28 msgid "" "To add a new source simply drag a folder onto this area or click the add " "button in the toolbar." msgstr "通过拖放到此区域或å•击工具æ ä¸Šçš„æŒ‰é’®æ¥æ·»åŠ æ–°çš„å­—ä½“æºã€‚" #: ../lib/UX/FontConfig/FontSourceList.vala:194 msgid "Select source folders" msgstr "é€‰æ‹©å­—ä½“æºæ–‡ä»¶å¤¹" #: ../lib/UX/FontConfig/FontSourceList.vala:197 #: ../lib/UX/Utils/FileSelector.vala:40 ../lib/UX/Utils/FileSelector.vala:67 #: ../src/font-manager/Migration.vala:58 msgid "_Cancel" msgstr "å–æ¶ˆ(_C)" #: ../lib/UX/FontConfig/FontSourceList.vala:199 #: ../lib/UX/Utils/FileSelector.vala:42 msgid "_Open" msgstr "打开(_O)" #: ../lib/UX/FontConfig/SubpixelGeometry.vala:55 msgid "Subpixel Geometry" msgstr "" #: ../lib/UX/FontConfig/Substitute.vala:78 msgid "prefer" msgstr "" #: ../lib/UX/FontConfig/Substitute.vala:79 msgid "accept" msgstr "" #: ../lib/UX/FontConfig/Substitute.vala:80 #, fuzzy msgid "default" msgstr "默认(Default)" #: ../lib/UX/Metadata/License.vala:42 #, fuzzy msgid "File does not contain license information." msgstr "文件未包å«åè®®æè¿°ã€‚" #: ../lib/UX/Metadata/Properties.vala:43 msgid "PostScript Name" msgstr "PostScript åç§°" #: ../lib/UX/Metadata/Properties.vala:44 #: ../lib/UX/Models/CategoryModel.vala:104 msgid "Weight" msgstr "å­—é‡" #: ../lib/UX/Metadata/Properties.vala:45 #: ../lib/UX/Models/CategoryModel.vala:102 msgid "Slant" msgstr "倾斜" #: ../lib/UX/Metadata/Properties.vala:46 #: ../lib/UX/Models/CategoryModel.vala:106 msgid "Width" msgstr "字宽" #: ../lib/UX/Metadata/Properties.vala:47 #: ../lib/UX/Models/CategoryModel.vala:100 msgid "Spacing" msgstr "å­—è·" #: ../lib/UX/Metadata/Properties.vala:48 msgid "Version" msgstr "版本" #: ../lib/UX/Metadata/Properties.vala:49 #: ../lib/UX/Models/CategoryModel.vala:112 msgid "Vendor" msgstr "供应商" #: ../lib/UX/Metadata/Title.vala:51 ../src/font-viewer/TitleBar.vala:49 msgid "OpenType Font" msgstr "OpenType 字体" #: ../lib/UX/Metadata/Title.vala:52 ../src/font-viewer/TitleBar.vala:50 msgid "TrueType Font" msgstr "TrueType 字体" #: ../lib/UX/Metadata/Title.vala:53 ../src/font-viewer/TitleBar.vala:51 msgid "PostScript Type 1 Font" msgstr "PostScript Type 1 字体" #: ../lib/UX/Metadata/Title.vala:105 ../src/font-viewer/TitleBar.vala:99 msgid "No file selected" msgstr "" #: ../lib/UX/Metadata/Title.vala:105 ../src/font-viewer/TitleBar.vala:100 #, fuzzy msgid "Or unsupported filetype." msgstr "按文件类型分组" # Do not to translate this one. #: ../lib/UX/Models/CategoryModel.vala:92 msgid "All" msgstr "全部" #: ../lib/UX/Models/CategoryModel.vala:92 msgid "All Fonts" msgstr "全部字体" #: ../lib/UX/Models/CategoryModel.vala:94 msgid "System" msgstr "系统" #: ../lib/UX/Models/CategoryModel.vala:94 msgid "Fonts available to all users" msgstr "字体对所有用户å¯è§" #: ../lib/UX/Models/CategoryModel.vala:96 msgid "User" msgstr "用户" #: ../lib/UX/Models/CategoryModel.vala:96 #, fuzzy msgid "Fonts available only to you" msgstr "å­—ä½“åªæœ‰ä½ å¯è§" #: ../lib/UX/Models/CategoryModel.vala:100 msgid "Grouped by font spacing" msgstr "按字è·åˆ†ç»„" #: ../lib/UX/Models/CategoryModel.vala:102 msgid "Grouped by font angle" msgstr "按倾斜分组" #: ../lib/UX/Models/CategoryModel.vala:104 msgid "Grouped by font weight" msgstr "按字é‡åˆ†ç»„" #: ../lib/UX/Models/CategoryModel.vala:106 msgid "Grouped by font width" msgstr "按字宽分组" #: ../lib/UX/Models/CategoryModel.vala:108 msgid "Filetype" msgstr "文件类型" #: ../lib/UX/Models/CategoryModel.vala:108 msgid "Grouped by filetype" msgstr "按文件类型分组" #: ../lib/UX/Models/CategoryModel.vala:110 #: ../lib/UX/Views/FontPreviewPane.vala:123 msgid "License" msgstr "许å¯è¯" #: ../lib/UX/Models/CategoryModel.vala:110 msgid "Grouped by license type" msgstr "按许å¯è¯åˆ†ç»„" #: ../lib/UX/Models/CategoryModel.vala:112 msgid "Grouped by vendor" msgstr "按供应商分组" #: ../lib/UX/Models/CategoryModel.vala:125 msgid "Family Kind" msgstr "类型" #: ../lib/UX/Models/CategoryModel.vala:125 msgid "Only fonts which include Panose information will be grouped here." msgstr "åªæœ‰åŒ…å«Panoseä¿¡æ¯çš„字体将被分组到这里" #: ../lib/UX/Models/CategoryModel.vala:126 msgid "Any" msgstr "ä»»æ„(Any)" #: ../lib/UX/Models/CategoryModel.vala:127 msgid "No Fit" msgstr "无匹é…(No Fit)" #: ../lib/UX/Models/CategoryModel.vala:128 msgid "Text and Display" msgstr "文本和显示(Text and Display)" #: ../lib/UX/Models/CategoryModel.vala:129 msgid "Script" msgstr "脚本(Script)" # msgstr "手写体(Script)" #: ../lib/UX/Models/CategoryModel.vala:130 msgid "Decorative" msgstr "修饰(Decorative)" #: ../lib/UX/Models/CategoryModel.vala:131 msgid "Pictorial" msgstr "图形(Pictorial)" #: ../lib/UX/Models/CategoryModel.vala:165 msgid "Normal" msgstr "正常(Normal)" #: ../lib/UX/Models/CategoryModel.vala:170 msgid "Regular" msgstr "常规(Regular)" #: ../lib/UX/Utils/FileSelector.vala:37 msgid "Select files to install" msgstr "选择文件安装" #: ../lib/UX/Utils/FileSelector.vala:68 msgid "_Delete" msgstr "删除(_D)" #: ../lib/UX/Utils/FileSelector.vala:75 msgid "Select fonts to remove" msgstr "选择字体删除" #: ../lib/UX/Views/FontPreviewPane.vala:57 ../lib/UX/Widgets/TextViews.vala:122 msgid "Waterfall" msgstr "瀑布" # Not fine #: ../lib/UX/Views/FontPreviewPane.vala:59 ../lib/UX/Widgets/TextViews.vala:123 msgid "Body Text" msgstr "正文" #: ../lib/UX/Views/FontPreviewPane.vala:61 ../lib/UX/Widgets/TextViews.vala:121 #: ../src/font-manager/MainWindow.vala:213 msgid "Preview" msgstr "预览" #: ../lib/UX/Views/FontPreviewPane.vala:122 #, fuzzy msgid "Properties" msgstr "比例(Proportional)" #: ../lib/UX/Views/FontPreviewPane.vala:124 #, fuzzy msgid "Characters" msgstr "字符映射" #: ../lib/UX/Views/FontPreviewPane.vala:246 #, fuzzy msgid "Select preview type" msgstr "编辑预览文本" #: ../lib/UX/Widgets/CellRendererPill.vala:30 msgid "Variation " msgstr "å˜ä½“" #: ../lib/UX/Widgets/CellRendererPill.vala:31 msgid "Variations" msgstr "å˜ä½“" #: ../src/font-manager/Compare.vala:35 msgid "Add selected font to comparison" msgstr "添加选中的字体进行比较" #: ../src/font-manager/Compare.vala:36 msgid "Remove selected font from comparison" msgstr "删除比较组中选中的字体" #: ../src/font-manager/Compare.vala:43 msgid "Select text color" msgstr "选择文本颜色" #: ../src/font-manager/Compare.vala:44 msgid "Select background color" msgstr "选择背景颜色" #: ../src/font-manager/MainWindow.vala:57 #: ../src/font-manager/MainWindow.vala:219 msgid "Browse" msgstr "æµè§ˆ" #: ../src/font-manager/MainWindow.vala:59 #: ../src/font-manager/MainWindow.vala:214 msgid "Compare" msgstr "比较" #: ../src/font-manager/MainWindow.vala:61 #: ../src/font-manager/MainWindow.vala:218 msgid "Manage" msgstr "管ç†" #: ../src/font-manager/Migration.vala:59 #, fuzzy msgid "_Continue" msgstr "ç»§ç»­" #: ../src/font-manager/Migration.vala:69 msgid "Update Required" msgstr "éœ€è¦æ›´æ–°" #: ../src/font-manager/Migration.vala:206 msgid "" "\n" "Font Manager has detected files from a previous installation. Some files " "from previous versions are incompatible with this release. Others have been " "deprecated or moved.\n" "\n" "Font Manager will now attempt to migrate your fonts and collections. Files " "and settings which are no longer necessary or valid will be deleted. Any " "configuration files that could cause a conflict will also be deleted.\n" "\n" "It is strongly recommended that you back up any important files before " "proceeding.\n" msgstr "" #: ../src/font-manager/Preferences/Display.vala:48 #: ../src/font-manager/Preferences/Rendering.vala:47 msgid "Settings saved to file." msgstr "" #: ../src/font-manager/Preferences/Display.vala:52 #: ../src/font-manager/Preferences/Rendering.vala:51 msgid "Removed configuration file." msgstr "" #: ../src/font-manager/Preferences/Interface.vala:42 msgid "Wide Layout" msgstr "" #: ../src/font-manager/Preferences/Interface.vala:44 msgid "Only when maximized" msgstr "" #: ../src/font-manager/Preferences/Interface.vala:48 msgid "Client Side Decorations" msgstr "" #: ../src/font-manager/Preferences/Interface.vala:101 msgid "" "CSD enabled. Change will take effect next time the application is started." msgstr "" #: ../src/font-manager/Preferences/Interface.vala:103 msgid "" "CSD disabled. Change will take effect next time the application is started." msgstr "" #: ../src/font-manager/Preferences/Preferences.vala:28 #, fuzzy msgid "Sources" msgstr "管ç†å­—体æº" #: ../src/font-manager/Preferences/Preferences.vala:29 msgid "Rendering" msgstr "" #: ../src/font-manager/Preferences/Preferences.vala:30 #, fuzzy msgid "Display" msgstr "文本和显示(Text and Display)" #: ../src/font-manager/Preferences/Preferences.vala:31 msgid "Interface" msgstr "" #: ../src/font-manager/Preferences/Sources.vala:40 #, fuzzy msgid "Add source" msgstr "添加新的字体æº" #: ../src/font-manager/Preferences/Sources.vala:41 msgid "Remove selected source" msgstr "删除选中的字体æº" # msgstr "区å—" #: ../src/font-manager/SideBar.vala:172 msgid "Categories" msgstr "分类" #: ../src/font-manager/SideBar.vala:173 msgid "Collections" msgstr "字体集" #: ../src/font-manager/TitleBar.vala:63 msgid "Add Fonts" msgstr "添加字体" #: ../src/font-manager/TitleBar.vala:64 msgid "Remove Fonts" msgstr "删除字体" #: ../src/font-manager/TitleBar.vala:71 msgid "Preferences" msgstr "" #: ../src/font-manager/TitleBar.vala:160 msgid "Help" msgstr "帮助" #: ../src/font-manager/TitleBar.vala:161 msgid "About" msgstr "关于" #: ../src/font-manager/TitleBar.vala:162 msgid "Quit" msgstr "退出" # Not translate very good, just for use. #: ../src/font-viewer/Application.vala:121 #: ../src/font-viewer/MainWindow.vala:28 ../src/font-viewer/MainWindow.vala:52 #, fuzzy msgid "Font Viewer" msgstr "字体管ç†å™¨" #: ../src/font-viewer/MainWindow.vala:29 #, fuzzy msgid "Preview font files before installing them." msgstr "快速添加或预览字体" #: ../src/font-viewer/MainWindow.vala:30 msgid "To preview a font simply drag it onto this area." msgstr "" #: ../src/font-viewer/MainWindow.vala:58 ../src/font-viewer/MainWindow.vala:163 #, fuzzy msgid "Install Font" msgstr "全部字体" #: ../src/font-viewer/MainWindow.vala:155 msgid "Newer version already installed" msgstr "新版本已安装" #: ../src/font-viewer/MainWindow.vala:159 #, fuzzy msgid "Installed" msgstr "全部字体" #: ../data/ApplicationMenu.ui.h:1 #, fuzzy msgid "_Help" msgstr "帮助" #: ../data/ApplicationMenu.ui.h:2 #, fuzzy msgid "_About" msgstr "关于" #: ../data/ApplicationMenu.ui.h:3 #, fuzzy msgid "_Quit" msgstr "退出" master-0.7.3/src/000077500000000000000000000000001300074171200135765ustar00rootroot00000000000000master-0.7.3/src/Makefile.am000066400000000000000000000001201300074171200156230ustar00rootroot00000000000000SUBDIRS = \ font-manager \ font-viewer MAINTAINERCLEANFILES = \ Makefile.in master-0.7.3/src/font-manager/000077500000000000000000000000001300074171200161545ustar00rootroot00000000000000master-0.7.3/src/font-manager/Application.vala.in000077500000000000000000000155661300074171200217110ustar00rootroot00000000000000/* Application.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { const string BUS_ID = "org.gnome.FontManager"; const string BUS_PATH = "/org/gnome/FontManager"; void set_application_style () { Gtk.IconTheme.get_default().add_resource_path("/org/gnome/FontManager/icons"); string css_uri = "resource:///org/gnome/FontManager/FontManager.css"; File css_file = File.new_for_uri(css_uri); Gtk.CssProvider provider = new Gtk.CssProvider(); try { provider.load_from_file(css_file); } catch (Error e) { warning("Failed to load Css Provider! Application will not appear as expected."); warning(e.message); } Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); return; } [DBus (name = "org.gnome.FontManager")] public class Application: Gtk.Application { [DBus (visible = false)] public bool use_csd { get; set; default = true; } const OptionEntry[] options = { { "about", 'a', 0, OptionArg.NONE, null, "About the application", null }, { "version", 'v', 0, OptionArg.NONE, null, "Show application version", null }, { "install", 'i', 0, OptionArg.NONE, null, "Space separated list of files to install.", null }, { "enable", 'e', 0, OptionArg.STRING_ARRAY, null, "Enable specified font family", null }, { "disable", 'd', 0, OptionArg.STRING_ARRAY, null, "Disable specified font family", null }, { "list", 0, 0, OptionArg.NONE, null, "List available font families.", null }, { "list-full", 0, 0, OptionArg.NONE, null, "Full listing including face information. (JSON)", null }, { "debug", 'D', 0, OptionArg.NONE, null, "Enable debugging messages.", null }, { "verbose", 'V', 0, OptionArg.NONE, null, "Verbose logging. Lots of output.", null }, { "fatal", 'F', 0, OptionArg.NONE, null, "Fatal errors", null }, { "", 0, 0, OptionArg.FILENAME_ARRAY, null, null, null }, { null } }; uint dbus_id = 0; public Application (string app_id, ApplicationFlags app_flags) { Object(application_id : app_id, flags : app_flags); add_main_option_entries(options); } public void install (string [] paths) { File [] filelist = null; foreach (var path in paths) filelist += File.new_for_path(path); Library.Install.from_file_array(filelist); return; } public void enable (string [] families) { Main.instance.reject.remove_all_array(families); Main.instance.reject.save(); return; } public void disable (string [] families) { Main.instance.reject.add_all_array(families); Main.instance.reject.save(); return; } public override void startup () { base.startup(); Main.instance.at_startup(); return; } public override void open (File [] files, string hint) { Main.instance.handle_open(files[0]); return; } public override int command_line (ApplicationCommandLine cl) { return Main.instance.handle_command_line(cl); } public override int handle_local_options (VariantDict options) { return Main.instance.handle_local_options(options); } protected override void activate () { Main.instance.on_activate(); return; } public new void quit () { Main.instance.on_quit(); base.quit(); return; } public void about () { Gtk.show_about_dialog(Main.instance.main_window, "program-name", About.NAME, "logo-icon-name", About.ICON, "version", About.VERSION, "copyright", About.COPYRIGHT, "comments", About.COMMENT, "website", About.HOMEPAGE, "authors", About.AUTHORS, "license", About.LICENSE, //"artists", About.ARTISTS, "translator-credits", About.TRANSLATORS, null); return; } public void help () { try { Gtk.show_uri(null, "help:%s".printf("@PACKAGE_NAME@"), Gdk.CURRENT_TIME); } catch (Error e) { critical("There was an error displaying help contents : %s", e.message); } return; } public override bool dbus_register (DBusConnection conn, string path) throws Error { base.dbus_register(conn, path); dbus_id = conn.register_object (BUS_PATH, this); if (dbus_id == 0) critical("Could not register Font Manager service "); return true; } public override void dbus_unregister (DBusConnection conn, string path) { if (dbus_id != 0) conn.unregister_object(dbus_id); base.dbus_unregister(conn, path); } public static int main (string [] args) { Logging.setup(About.NAME); GLib.Intl.bindtextdomain("@PACKAGE_NAME@", null); GLib.Intl.bind_textdomain_codeset("@PACKAGE_NAME@", null); GLib.Intl.textdomain("@PACKAGE_NAME@"); GLib.Intl.setlocale(GLib.LocaleCategory.ALL, null); Environment.set_application_name(About.NAME); Environment.set_variable("XDG_CONFIG_HOME", "", true); FontConfig.enable_user_config(false); Gtk.init(ref args); if (update_declined()) return 0; set_application_style(); return new Application(BUS_ID, (ApplicationFlags.HANDLES_OPEN | ApplicationFlags.HANDLES_COMMAND_LINE)).run(args); } } } master-0.7.3/src/font-manager/Browse.vala000077500000000000000000000124041300074171200202660ustar00rootroot00000000000000/* Browse.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class Browse : AdjustablePreview { public Gtk.TreeStore? model { get; set; } public FontConfig.Reject reject { get; set;} public bool loading { get { return _loading; } set { _loading = value; if (_loading) progress.show(); else progress.hide(); } } public Gtk.ProgressBar progress { get; private set;} public BaseTreeView treeview { get; private set;} bool _loading = false; Gtk.Box main_box; Gtk.Overlay overlay; Gtk.ScrolledWindow scroll; CellRendererTitle renderer; public Browse () { orientation = Gtk.Orientation.VERTICAL; treeview = new BaseTreeView(); treeview.name = "FontManagerBrowseView"; treeview.headers_visible = false; treeview.show_expanders = false; progress = new Gtk.ProgressBar(); progress.halign = Gtk.Align.CENTER; progress.valign = Gtk.Align.CENTER; overlay = new Gtk.Overlay(); overlay.add_overlay(progress); overlay.get_style_context().add_class(Gtk.STYLE_CLASS_ENTRY); main_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); overlay.add(main_box); add(overlay); scroll = new Gtk.ScrolledWindow(null, null); scroll.add(treeview); scroll.expand = true; main_box.pack_start(scroll, true, true, 0); renderer = new CellRendererTitle(); renderer.xpad = 48; renderer.junction_side = Gtk.JunctionSides.LEFT; treeview.set_enable_search(true); treeview.set_search_column(FontModelColumn.DESCRIPTION); treeview.insert_column_with_data_func(0, "", renderer, cell_data_func); treeview.get_selection().set_mode(Gtk.SelectionMode.NONE); bind_property("model", treeview, "model", BindingFlags.DEFAULT); notify["model"].connect(() => { expand_all(); }); } public override void show () { treeview.show(); treeview.show(); scroll.show(); main_box.show(); overlay.show(); base.show(); return; } public void expand_all () { treeview.expand_all(); /* Workaround first row height bug? */ treeview.get_column(0).queue_resize(); return; } protected override void set_preview_size_internal (double new_size) { treeview.get_column(0).queue_resize(); return; } void cell_data_func (Gtk.TreeViewColumn layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { Value val; model.get_value(treeiter, FontModelColumn.OBJECT, out val); var obj = val.get_object(); string font_desc; bool active; Pango.AttrList attrs = new Pango.AttrList(); attrs.insert(Pango.attr_fallback_new(false)); cell.set_property("attributes", attrs); var default_desc = get_font(treeview); default_desc.set_size((int) ((get_desc_size()) * Pango.SCALE)); cell.set_property("font-desc" , default_desc); if (obj is FontConfig.Family) { font_desc = ((FontConfig.Family) obj).description; active = !(((FontConfig.Family) obj).name in reject); cell.set_property("title" , font_desc); cell.set_property("fallthrough" , false); } else { font_desc = ((FontConfig.Font) obj).description; active = !(((FontConfig.Font) obj).family in reject); Pango.FontDescription desc = Pango.FontDescription.from_string(font_desc); desc.set_size((int) (preview_size * Pango.SCALE)); cell.set_property("font-desc" , desc); cell.set_property("ypad" , 5); cell.set_property("fallthrough" , true); } cell.set_property("text", font_desc); cell.set_property("sensitive" , active); cell.set_property("strikethrough", !active); val.unset(); return; } } } master-0.7.3/src/font-manager/Compare.vala000077500000000000000000000304321300074171200204140ustar00rootroot00000000000000/* Compare.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class CompareControls : BaseControls { public signal void foreground_set (Gdk.RGBA fg_color); public signal void background_set (Gdk.RGBA bg_color); public Gtk.ColorButton fg_color_button { get; set; } public Gtk.ColorButton bg_color_button { get; set; } public CompareControls () { add_button.set_tooltip_text(_("Add selected font to comparison")); remove_button.set_tooltip_text(_("Remove selected font from comparison")); var context = get_style_context(); context.add_class(Gtk.STYLE_CLASS_TOOLBAR); context.save(); fg_color_button = new Gtk.ColorButton.with_rgba(context.get_color(Gtk.StateFlags.NORMAL)); bg_color_button = new Gtk.ColorButton.with_rgba(context.get_background_color(Gtk.StateFlags.NORMAL)); context.restore(); fg_color_button.set_tooltip_text(_("Select text color")); bg_color_button.set_tooltip_text(_("Select background color")); box.pack_end(bg_color_button, false, false, 0); box.pack_end(fg_color_button, false, false, 0); set_default_button_relief(box); connect_signals(); } public override void show () { fg_color_button.show(); bg_color_button.show(); base.show(); return; } new void connect_signals () { fg_color_button.color_set.connect((w) => { Idle.add(() => { fg_color_button.queue_draw(); foreground_set(w.get_rgba()); return false; }); }); bg_color_button.color_set.connect((w) => { Idle.add(() => { bg_color_button.queue_draw(); background_set(w.get_rgba()); return false; }); }); return; } } /* Most of the presentation and logic in our Compare view is based on * Gnome Specimen by Wouter Bolsterlee. * * https://launchpad.net/gnome-specimen */ public class Compare : AdjustablePreview { public signal void list_modified(); public signal void color_set(); public Gdk.RGBA foreground_color { get; set; } public Gdk.RGBA background_color { get; set; } public string font_desc { get; set; default = DEFAULT_FONT; } public CompareControls controls { get; private set; } public string? preview_text { get { return _preview_text; } set { _preview_text = value != null ? value : default_preview_text; } } string _preview_text; string default_preview_text; Gtk.Box box; BaseTreeView tree; Gtk.ListStore store; Gtk.ScrolledWindow scroll; Gtk.TreeViewColumn column; Gtk.CellRendererText renderer; Gdk.RGBA default_fg_color; Gdk.RGBA default_bg_color; public Compare () { orientation = Gtk.Orientation.VERTICAL; preview_text = default_preview_text = get_localized_pangram(); tree = new BaseTreeView(); tree.name = "FontManagerCompareView"; store = new Gtk.ListStore(2, typeof(Pango.FontDescription), typeof(string)); scroll = new Gtk.ScrolledWindow(null, null); controls = new CompareControls(); controls.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); update_default_colors(); renderer = new Gtk.CellRendererText(); column = new Gtk.TreeViewColumn(); column.pack_start(renderer, true); column.set_cell_data_func(renderer, cell_data_func); column.set_attributes(renderer, "font-desc", 0, "text", 1, null); tree.append_column(column); tree.set_model(store); tree.set_tooltip_column(1); pack_start(controls, false, false, 0); add_separator(this, Gtk.Orientation.HORIZONTAL); box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); scroll.add(tree); box.pack_start(scroll, true, true, 0); pack_end(box, true, true, 0); tree.set_headers_visible(false); bind_properties(); connect_signals(); } public override void show () { tree.show(); scroll.show(); box.show(); controls.show(); base.show(); return; } void bind_properties () { bind_property("foreground_color", controls.fg_color_button, "rgba", BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL); bind_property("background_color", controls.bg_color_button, "rgba", BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL); return; } void connect_signals() { /* selection, model, path, currently_selected_path */ tree.get_selection().set_select_function((s, m, p, csp) => { /* Disallow selection of preview rows */ if (p.get_indices()[0] % 2 == 0) /* Name row */ return true; else /* Preview row */ Idle.add(() => { if (p.prev()) tree.get_selection().select_path(p); return false; }); return false; }); controls.add_selected.connect(() => { debug("Add selected font to a comparison : %s", font_desc); add_from_string(font_desc); list_modified(); }); controls.remove_selected.connect(() => { debug("Remove selected font from comparison : %s", font_desc); on_remove(); }); controls.foreground_set.connect((rgba) => { foreground_color = rgba; color_set(); }); controls.background_set.connect((rgba) => { background_color = rgba; color_set(); }); style_updated.connect(() => { update_default_colors(); }); return; } void update_default_colors () { var ctx = get_style_context(); ctx.save(); default_fg_color = ctx.get_color(Gtk.StateFlags.NORMAL); default_bg_color = ctx.get_background_color(Gtk.StateFlags.NORMAL); ctx.restore(); return; } protected override void set_preview_size_internal (double new_size) { if (column != null) column.queue_resize(); return; } public void add_from_string (string pango_font_description) { Gtk.TreeIter iter; Gtk.TreeIter _iter; Pango.FontDescription desc = Pango.FontDescription.from_string(DEFAULT_FONT); Pango.FontDescription _desc = Pango.FontDescription.from_string(pango_font_description); store.append(out iter); store.set(iter, 0, desc, 1, _desc.to_string(), -1); store.append(out _iter); store.set(_iter, 0, _desc, 1, _desc.to_string(), -1); list_modified(); return; } void cell_data_func (Gtk.CellLayout layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter treeiter) { Pango.AttrList attrs = new Pango.AttrList(); attrs.insert(Pango.attr_fallback_new(false)); cell.set_property("attributes", attrs); if (model.get_path(treeiter).get_indices()[0] % 2 == 0) { /* Name row */ cell.set_property("foreground-rgba", default_fg_color); cell.set_property("background-rgba", default_bg_color); cell.set_property("size-points", get_desc_size()); cell.set_property("ypad", 4); cell.set_property("scale", 1.0); } else { /* Preview row */ cell.set_property("foreground-rgba", foreground_color); cell.set_property("background-rgba", background_color); cell.set_property("text", preview_text); cell.set_property("size-points", preview_size); cell.set_property("ypad", 4); cell.set_property("scale", 1.1); } return; } public string [] list () { Gee.HashSet results = new Gee.HashSet (); /* (model, path, iter) */ store.foreach((m, p, i) => { Value val; if (p.get_indices()[0] % 2 == 0) /* Skip name rows */ return false; m.get_value(i, 1, out val); results.add((string) val); val.unset(); /* Keep going */ return false; } ); return results.to_array(); } void on_remove () { Gtk.TreeModel model; Gtk.TreeIter iter; tree.get_selection().get_selected(out model, out iter); /* Note: There is a warning attached to this function (iter_is_valid) about it being * slow and only intended for debugging purposes. * * This particular tree should never grow to the point where this could become an issue. */ if (store.iter_is_valid(iter)) { /* Note: Saving a string and using it to reset the iter became necessary since * the iter was always being set to null after calling remove. */ string iter_as_string = store.get_string_from_iter(iter); store.remove(iter); store.get_iter_from_string(out iter, iter_as_string); bool still_valid = store.remove(iter); /* Set the cursor to a remaining row instead of having the cursor disappear. * This allows for easy deletion of multiple previews by hitting the remove * button repeatedly. */ if (still_valid) { /* The treeiter is still valid. This means that another row has "shifted" to * the location the deleted row occupied before. Set the cursor to that row. */ store.get_iter_from_string(out iter, iter_as_string); Gtk.TreePath path = model.get_path(iter); if (path != null && path.get_indices()[0] >= 0) tree.set_cursor(path, column, false); } else { /* The treeiter is no longer valid. In our case this means the bottom row in * the treeview was deleted. Set the cursor to the new bottom row. */ int n_children = model.iter_n_children(null) - 2; if (n_children >= 0) { Gtk.TreePath path = new Gtk.TreePath.from_string(n_children.to_string()); tree.get_selection().select_path(path); } } } list_modified(); return; } } } master-0.7.3/src/font-manager/Main.vala.in000066400000000000000000000271361300074171200203230ustar00rootroot00000000000000/* Main.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { void queue_reload () { /* Note : * There used to be a two second delay built into gnome-settings-daemon. * Not sure why... * It was removed at some point, but still seems like a good idea to me. */ Timeout.add_seconds(3, () => { Main.instance.update(); return false; }); return; } void set_g_app_menu (Gtk.Application app, Gtk.Builder builder, string menu_id) { try { builder.add_from_resource("/org/gnome/FontManager/ApplicationMenu.ui"); app.app_menu = builder.get_object(menu_id) as GLib.MenuModel; } catch (Error e) { warning("Failed to set application menu : %s : %s", menu_id, e.message); } return; } public class Main : Object { public static unowned Main instance { get { return _instance.once (() => { return new Main (); }); } } static GLib.Once
_instance; public signal void progress (string? message, int processed, int total); public Database database { get; private set; } public FontConfig.Sources sources { get; private set; } public FontConfig.Families families { get; private set; } public FontConfig.Reject reject { get; private set; } public MainWindow main_window { get; private set; } public FontModel font_model { get; private set; } public Settings? settings { get; private set; default = null; } public State? state { get; private set; default = null; } weak Application application; bool update_in_progress = false; bool queue_update = false; public Main () { application = ((Application) GLib.Application.get_default()); settings = get_gsettings(BUS_ID); if (settings != null) application.use_csd = settings.get_boolean("use-csd"); families = new FontConfig.Families(); font_model = new FontModel(families); reject = new FontConfig.Reject(); sources = new FontConfig.Sources(); } public void handle_open (File file) { try { DBusConnection conn = Bus.get_sync(BusType.SESSION); conn.call_sync("org.gnome.FontViewer", "/org/gnome/FontViewer", "org.gnome.FontViewer", "ShowUri", new Variant("(s)", file.get_uri()), null, DBusCallFlags.NONE, -1, null); } catch (Error e) { critical("Method call to org.gnome.FontViewer failed : %s", e.message); } return; } public int handle_command_line (ApplicationCommandLine cl) { application.hold(); VariantDict options = cl.get_options_dict(); File []? filelist = get_command_line_files(cl); if (options.contains("debug")) Logger.DisplayLevel = LogLevel.DEBUG; if (options.contains("verbose")) Logger.DisplayLevel = LogLevel.VERBOSE; if (options.contains("fatal")) Log.set_always_fatal(LogLevelFlags.LEVEL_CRITICAL); if (filelist == null) { application.activate(); } else if (options.contains("install")) { Library.Install.from_file_array(filelist); } else { handle_open(filelist[0]); } application.release(); return 0; } public int handle_local_options (VariantDict options) { int exit_status = -1; if (options.contains("version")) { show_version(); exit_status = 0; } if (options.contains("about")) { show_about(); exit_status = 0; } if (options.contains("enable")) { reject.load(); Variant v = options.lookup_value("enable", VariantType.STRING_ARRAY); string [] accept = v.get_strv(); reject.remove_all_array(accept); reject.save(); exit_status = 0; } if (options.contains("disable")) { reject.load(); Variant v = options.lookup_value("disable", VariantType.STRING_ARRAY); string [] rejects = v.get_strv(); reject.add_all_array(rejects); reject.save(); exit_status = 0; } if (options.contains("list")) { families.update(); assert(families.size > 0); foreach (string family in families.list()) stdout.printf("%s\n", family); exit_status = 0; } if (options.contains("list-full")) { sources.load(); FontConfig.enable_user_config(false); FontConfig.load_user_fontconfig_files(); if (!FontConfig.load_user_font_sources(sources.to_array())) critical("Failed to register user font sources with FontConfig! User fonts may be unavailable for preview."); sources.update(); families.update(); stdout.printf("\n%s\n\n", families.to_data()); exit_status = 0; } return exit_status; } public void at_startup () { try { database = get_database(); } catch (Error e) { error("Failed to initialize database : %s", e.message); } families.progress.connect((m, p, t) => { progress(m, p, t); }); } public void on_activate () { show_version_information(); if (main_window != null) { main_window.present(); return; } main_window = new MainWindow(); state = new State(main_window, BUS_ID); main_window.realize.connect(state.restore); application.add_window(main_window); progress.connect((m, p, t) => { main_window.progress = ((float) p /(float) t); ensure_ui_update(); }); if (application.prefers_app_menu()) set_g_app_menu(application, new Gtk.Builder(), "@PACKAGE_NAME@"); reject.load(); sources.load(); main_window.present(); do_initial_update(); sources.removed.connect((p) => { try { prune_path_from_database(database, p); } catch (FontManager.DatabaseError e) { warning(e.message); } }); sources.changed.connect((f, ev) => { queue_reload(); }); return; } public void on_quit () { state.save(); return; } public void update () { if (update_in_progress) { queue_update = true; return; } else { queue_update = false; } update_in_progress = true; debug("Updating font configuration"); FontConfig.update_cache(); main_window.font_model = null; main_window.loading = true; main_window.sidebar.category_model.clear(); ensure_ui_update(); FontConfig.enable_user_config(false); FontConfig.load_user_fontconfig_files(); FontConfig.load_user_font_sources(sources.to_array()); sync_database(); families.update(); main_window.loading = false; main_window.set_models(); ensure_ui_update(); main_window.sidebar.category_model.update.begin((obj, res) => { main_window.sidebar.category_model.update.end(res); main_window.reset_selections(); }); update_in_progress = false; if (queue_update) Idle.add(() => { update(); return false; }); return; } void do_initial_update () { main_window.font_model = null; main_window.loading = true; ensure_ui_update(); FontConfig.enable_user_config(false); FontConfig.load_user_fontconfig_files(); FontConfig.load_user_font_sources(sources.to_array()); sync_database(); families.update(); font_model.update(); main_window.loading = false; main_window.set_models(); /* Unset the browse model, allow categories to load, before render */ main_window.browser.model = null; main_window.sidebar.category_model.update.begin((obj, res) => { main_window.sidebar.category_model.update.end(res); Idle.add(() => { main_window.browser.model = Main.instance.font_model; state.restore_selections(); state.post_activate(); state.bind_settings(); application.notify["use-csd"].connect(() => { state.save(); }); return false; }); }); return; } void sync_database () { try { sync_fonts_table(database, FontConfig.list_fonts(), (m, p, t) => { Main.instance.progress(m, p, t); }); } catch (DatabaseError e) { critical("Database synchronization failed : %s", e.message); } return; } void show_version_information () { debug("Font Manager %s", About.VERSION); debug("Using GLib %u.%u.%u", Version.major, Version.minor, Version.micro); debug("Using JSON-GLib %s", Json.VERSION_S); debug("Using SQLite %s", Sqlite.VERSION); debug("Using FontConfig %s", FontConfig.get_version_string()); debug("Using Pango %s", Pango.version_string()); debug("Using GTK+ %i.%i.%i", Gtk.MAJOR_VERSION, Gtk.MINOR_VERSION, Gtk.MICRO_VERSION); if (Gdk.Screen.get_default().is_composited()) debug("Screen is composited. Client side decorations enabled."); if (Gnome3()) debug("Running on %s", get_command_line_output("gnome-shell --version")); else debug("Running on %s", Environment.get_variable("XDG_CURRENT_DESKTOP")); return; } } } master-0.7.3/src/font-manager/MainWindow.vala000066400000000000000000000670421300074171200211060ustar00rootroot00000000000000/* MainWindow.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public enum Mode { MANAGE, BROWSE, COMPARE, N_MODES; public static Mode parse (string mode) { switch (mode.down()) { case "browse": return Mode.BROWSE; case "compare": return Mode.COMPARE; default: return Mode.MANAGE; } } public string to_string () { switch (this) { case BROWSE: return "Browse"; case COMPARE: return "Compare"; default: return "Default"; } } public string to_translatable_string () { switch (this) { case BROWSE: return _("Browse"); case COMPARE: return _("Compare"); default: return _("Manage"); } } public string [] settings () { switch (this) { case BROWSE: return { "Browse", "Default"}; case COMPARE: return { "Default", "Compare"}; default: return { "Default", "Default"}; } } } public class MainWindow : Gtk.ApplicationWindow { public signal void mode_changed (int new_mode); public bool wide_layout { get; set; default = false; } public bool use_csd { get; set; default = true; } public string selected_font { get; set; default = DEFAULT_FONT; } public FontModel? font_model { get; set; default = null; } public FontConfig.Reject reject { get; set; } public Gtk.Stack main_stack { get; private set; } public Gtk.Stack content_stack { get; private set; } public Gtk.Stack view_stack { get; private set; } public Gtk.Box main_box { get; private set; } public Gtk.Box content_box { get; private set; } public Gtk.Paned main_pane { get; private set; } public Gtk.Paned content_pane { get; private set; } public Browse browser { get; private set; } public Compare compare { get; private set; } public FontPreviewPane preview { get; private set; } public SideBar sidebar { get; private set; } public TitleBar titlebar { get; private set; } public FontList fontlist { get; private set; } public FontListTree fonttree { get; private set; } public Preferences.Pane preference_pane { get; private set; } public Mode mode { get { return _mode; } set { real_set_mode(value, loading); } } public double progress { get { return _progress; } set { _progress = value; browser.progress.set_fraction(value); fonttree.progress.set_fraction(value); if (value >= 0.99) { browser.loading = false; fonttree.loading = false; } ensure_ui_update(); } } public bool loading { get { return _loading; } set { _loading = value; sidebar.loading = value; browser.loading = value; fonttree.loading = value; } } public FontData font_data { get { return preview.font_data; } set { preview.font_data = value; } } bool _loading = false; bool sidebar_switch = false; bool charmap_visible = false; bool is_horizontal = false; double _progress = 0.0; Mode _mode; Gtk.Box content_view; Gtk.Box _main_pane_; Gtk.Separator content_separator; Unsorted? unsorted = null; Disabled? disabled = null; CharacterMapSideBar charmap_sidebar; RenderingOptions render_opts; public MainWindow () { Object(title: About.NAME, icon_name: About.ICON, type: Gtk.WindowType.TOPLEVEL); application = ((Application) GLib.Application.get_default()); use_csd = ((Application) application).use_csd; init_components(); bind_properties(); pack_components(); add(main_box); set_models(); connect_signals(); } void bind_properties () { bind_property("font-model", browser, "model", BindingFlags.SYNC_CREATE); bind_property("font-model", fontlist, "model", BindingFlags.SYNC_CREATE); bind_property("reject", browser, "reject", BindingFlags.SYNC_CREATE); bind_property("reject", fontlist, "reject", BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL); bind_property("reject", sidebar.standard.collection_tree, "reject", BindingFlags.SYNC_CREATE); bind_property("selected-font", fontlist, "selected-font-desc", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); bind_property("font-data", fontlist, "font-data", BindingFlags.BIDIRECTIONAL); bind_property("selected-font", compare, "font-desc", BindingFlags.SYNC_CREATE); bind_property("use-csd", ((Application) application), "use-csd", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); var ui_prefs = (Preferences.Interface) preference_pane.get_page("Interface"); bind_property("wide-layout", ui_prefs.wide_layout.toggle, "active", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); application.bind_property("use-csd", ui_prefs.use_csd.toggle, "active", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE); return; } void init_components () { main_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); content_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); main_pane = new Gtk.Paned(Gtk.Orientation.HORIZONTAL); content_pane = new Gtk.Paned(wide_layout ? Gtk.Orientation.HORIZONTAL : Gtk.Orientation.VERTICAL); browser = new Browse(); compare = new Compare(); preview = new FontPreviewPane(); preview.charmap.show_details = true; sidebar = new SideBar(); charmap_sidebar = new CharacterMapSideBar(); sidebar.add_view(new StandardSideBar(), "Default"); sidebar.add_view(charmap_sidebar, "Character Map"); titlebar = new TitleBar(); fonttree = new FontListTree(); fontlist = fonttree.fontlist; main_stack = new Gtk.Stack(); main_stack.set_transition_duration(720); main_stack.set_transition_type(Gtk.StackTransitionType.UNDER_UP); view_stack = new Gtk.Stack(); view_stack.add_titled(preview, "Default", _("Preview")); view_stack.add_titled(compare, "Compare", _("Compare")); view_stack.set_transition_type(Gtk.StackTransitionType.CROSSFADE); content_stack = new Gtk.Stack(); content_stack.set_transition_duration(420); content_stack.add_titled(content_pane, "Default", _("Manage")); content_stack.add_titled(browser, "Browse", _("Browse")); content_stack.set_transition_type(Gtk.StackTransitionType.OVER_LEFT); unsorted = new Unsorted(); disabled = new Disabled(); render_opts = new RenderingOptions(); preference_pane = construct_preference_pane(); return; } void pack_components () { main_pane.add1(sidebar); main_pane.add2(content_box); add_separator(content_box, Gtk.Orientation.VERTICAL); content_box.pack_end(content_stack, true, true, 0); content_pane.add1(fonttree); content_view = new Gtk.Box(wide_layout ? Gtk.Orientation.HORIZONTAL : Gtk.Orientation.VERTICAL, 0); content_separator = add_separator(content_view, wide_layout ? Gtk.Orientation.VERTICAL : Gtk.Orientation.HORIZONTAL); content_view.pack_end(view_stack, true, true, 0); content_pane.add2(content_view); _main_pane_ = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); _main_pane_.pack_start(main_pane, true, true, 0); add_separator(_main_pane_, Gtk.Orientation.HORIZONTAL); main_stack.add_named(_main_pane_, "Default"); main_stack.add_named(preference_pane, "Preferences"); main_box.pack_end(main_stack, true, true, 0); if (Gdk.Screen.get_default().is_composited() && use_csd) { set_titlebar(titlebar); } else { main_box.pack_start(titlebar, false, true, 0); add_separator(main_box, Gtk.Orientation.HORIZONTAL); titlebar.use_toolbar_styling(); } return; } public void set_horizontal_layout () { var settings = Main.instance.settings; if (settings != null) { if (!is_horizontal) { settings.set_int("last-vertical-content-pane-position", content_pane.position); } Idle.add(() => { content_pane.set_position(settings.get_int("last-horizontal-content-pane-position")); return false; }); } content_pane.set_orientation(Gtk.Orientation.HORIZONTAL); content_view.set_orientation(Gtk.Orientation.HORIZONTAL); content_separator.set_orientation(Gtk.Orientation.VERTICAL); is_horizontal = true; return; } public void unset_horizontal_layout () { var settings = Main.instance.settings; if (settings != null) { if (is_horizontal) { settings.set_int("last-horizontal-content-pane-position", content_pane.position); } Idle.add(() => { if (settings.get_boolean("wide-layout-on-maximize") && !is_maximized) content_pane.set_position(settings.get_int("last-vertical-content-pane-position")); return false; }); } content_pane.set_orientation(Gtk.Orientation.VERTICAL); content_view.set_orientation(Gtk.Orientation.VERTICAL); content_separator.set_orientation(Gtk.Orientation.HORIZONTAL); is_horizontal = false; return; } public override void show () { content_view.show(); _main_pane_.show(); content_stack.show(); view_stack.show(); main_box.show(); content_box.show(); main_pane.show(); content_pane.show(); browser.show(); compare.show(); preview.show(); sidebar.show(); charmap_sidebar.show(); titlebar.show(); fonttree.show(); preference_pane.show(); main_stack.show(); base.show(); return; } public void set_models () { font_model = Main.instance.font_model; reject = Main.instance.reject; return; } public void reset_selections () { sidebar.standard.category_tree.select_first_row(); sidebar.standard.collection_tree.select_first_row(); if (sidebar.standard.mode == StandardSideBarMode.CATEGORY) update_font_model(sidebar.standard.selected_category); else update_font_model(sidebar.standard.selected_collection); return; } void real_set_mode (Mode mode, bool loading) { _mode = mode; titlebar.main_menu_label.set_markup("%s".printf(mode.to_translatable_string())); var settings = mode.settings(); /* XXX */ content_stack.set_visible_child_name(settings[0]); view_stack.set_visible_child_name(settings[1]); if (mode == Mode.MANAGE && charmap_visible) sidebar.mode = "Character Map"; else sidebar.mode = "Default"; sidebar.loading = loading; titlebar.reveal_controls((mode == Mode.MANAGE)); fonttree.show_controls = (mode != Mode.BROWSE); fontlist.controls.set_remove_sensitivity((mode == Mode.MANAGE && sidebar.standard.mode == StandardSideBarMode.COLLECTION)); fontlist.queue_draw(); render_opts.visible = (render_opts.visible && mode == Mode.MANAGE); if (titlebar.prefs_toggle.active && mode != Mode.MANAGE) titlebar.prefs_toggle.active = false; if (mode == Mode.BROWSE) browser.treeview.queue_draw(); mode_changed(_mode); debug("Mode changed : %s", mode.to_string()); return; } void update_font_model (Filter? filter) { if (filter == null) return; font_model = null; Main.instance.font_model.update(filter); font_model = Main.instance.font_model; fonttree.fontlist.select_first_row(); browser.expand_all(); return; } void connect_signals () { delete_event.connect((w, e) => { application.quit(); return true; } ); var settings = Main.instance.settings; notify["wide-layout"].connect(() => { Idle.add(() => { if (wide_layout && (!(settings.get_boolean("wide-layout-on-maximize")) || is_maximized)) { set_horizontal_layout(); } else if (settings != null && wide_layout && settings.get_boolean("wide-layout-on-maximize") && !(is_maximized)) { if (is_horizontal) { unset_horizontal_layout(); } } else { unset_horizontal_layout(); } return false; }); }); notify["is-maximized"].connect(() => { Idle.add(() => { if (settings != null) { if (wide_layout) { if (settings.get_boolean("wide-layout-on-maximize")) { Idle.add(() => { if (this.is_maximized) { set_horizontal_layout(); } else { unset_horizontal_layout(); } return false; }); } } else { Idle.add(() => { unset_horizontal_layout(); return false; }); } } return false; }); }); if (settings != null) { settings.changed.connect((key) => { if (key == "wide-layout-on-maximize") { Idle.add(() => { if (settings.get_boolean("wide-layout-on-maximize")) { if (!is_maximized && is_horizontal) { unset_horizontal_layout(); } } else { if (wide_layout) set_horizontal_layout(); else unset_horizontal_layout(); } return false; }); } }); } mode_changed.connect((m) => { var action = ((SimpleAction) application.lookup_action("mode")); action.set_state(((Mode) m).to_string()); /* Close popover on click */ titlebar.main_menu.active = !titlebar.main_menu.active; }); sidebar.standard.category_selected.connect((c, i) => { if (font_model == null) return; if (c is Unsorted) { unsorted = ((Unsorted) c); unsorted.update(Main.instance.database, sidebar.collection_model.collections.get_full_contents()); } else if (c is Disabled) { disabled = ((Disabled) c); disabled.update(Main.instance.database, Main.instance.reject); } update_font_model(c); }); sidebar.standard.collection_selected.connect((c) => { if (font_model == null) return; update_font_model(c); } ); sidebar.standard.mode_selected.connect(() => { if (font_model == null || sidebar_switch) return; var m = sidebar.standard.mode; if (m == StandardSideBarMode.CATEGORY) update_font_model(sidebar.standard.selected_category); else update_font_model(sidebar.standard.selected_collection); fontlist.controls.set_remove_sensitivity(mode == Mode.MANAGE && m == StandardSideBarMode.COLLECTION); } ); sidebar.standard.collection_tree.update_ui.connect(() => { sidebar.standard.collection_tree.queue_draw(); fontlist.queue_draw(); browser.queue_draw(); }); sidebar.standard.collection_tree.changed.connect(() => { unsorted.update(Main.instance.database, sidebar.collection_model.collections.get_full_contents()); }); fontlist.selection_changed.connect(() => { Gtk.TreeIter iter; fontlist.model.get_iter_from_string(out iter, fontlist.selected_iter); if (render_opts.visible) { if (fontlist.model.iter_has_child(iter)) { render_opts.properties.font = null; render_opts.properties.family = fontlist.selected_family.name; } else { render_opts.properties.font = fontlist.selected_font; } } }); fontlist.controls.remove_selected.connect(() => { if (sidebar.standard.collection_tree.selected_collection == null) return; sidebar.standard.collection_tree.remove_fonts(fontlist.get_selected_families()); update_font_model(sidebar.standard.collection_tree.selected_collection); }); fontlist.enable_model_drag_dest(AppDragTargets, AppDragActions); fontlist.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK | Gdk.ModifierType.RELEASE_MASK, AppDragTargets, AppDragActions); var collections_tree = sidebar.standard.collection_tree.tree; /* Let GTK+ handle re-ordering */ collections_tree.set_reorderable(true); fontlist.drag_data_received.connect(on_drag_data_received); fontlist.drag_begin.connect((w, c) => { /* When reorderable is set no other drag and drop is possible. * Temporarily disable it and set the treeview up as a drag destination. */ collections_tree.set_reorderable(false); collections_tree.enable_model_drag_dest(AppDragTargets, AppDragActions); if (sidebar.standard.mode == StandardSideBarMode.CATEGORY) { sidebar_switch = true; sidebar.standard.mode = StandardSideBarMode.COLLECTION; } }); fontlist.drag_end.connect((w, c) => { if (sidebar_switch) { Idle.add(() => { sidebar.standard.mode = StandardSideBarMode.CATEGORY; return false; }); sidebar_switch = false; } collections_tree.set_reorderable(true); unsorted.update(Main.instance.database, sidebar.collection_model.collections.get_full_contents()); }); collections_tree.drag_data_received.connect(on_drag_data_received); titlebar.install_selected.connect(() => { var selected = FileSelector.run_install((Gtk.Window) this); if (selected.length > 0) install_fonts(selected); }); titlebar.remove_selected.connect(() => { remove_fonts(); }); titlebar.preferences_selected.connect((a) => { if (a) main_stack.set_visible_child_name("Preferences"); else main_stack.set_visible_child_name("Default"); }); main_stack.notify["visible-child-name"].connect(() => { if (main_stack.get_visible_child_name() == "Default") main_stack.set_transition_type(Gtk.StackTransitionType.UNDER_UP); else main_stack.set_transition_type(Gtk.StackTransitionType.OVER_DOWN); }); content_stack.notify["visible-child-name"].connect(() => { if (content_stack.get_visible_child_name() == "Default") content_stack.set_transition_type(Gtk.StackTransitionType.OVER_LEFT); else content_stack.set_transition_type(Gtk.StackTransitionType.UNDER_RIGHT); }); reject.changed.connect(() => { disabled.update(Main.instance.database, Main.instance.reject); if (sidebar.standard.category_tree.selected_filter is Disabled) update_font_model(sidebar.standard.category_tree.selected_filter); Idle.add(() => { reject.load(); fontlist.queue_draw(); return false; }); }); preview.notebook.switch_page.connect((p, p_num) => { if (p is CharacterTable) { charmap_visible = true; sidebar.mode = "Character Map"; } else { charmap_visible = false; sidebar.mode = "Default"; } }); charmap_sidebar.selection_changed.connect((cl) => { preview.charmap.table.codepoint_list = cl; }); } void remove_fonts () { var _model = new UserFontModel(Main.instance.families, Main.instance.database); var arr = FileSelector.run_removal((Gtk.Window) this, _model); if (arr != null) { /* Avoid empty boxes and Pango warnings when removing fonts */ font_model = null; fonttree.progress.set_fraction(0f); loading = true; Library.progress = (m, p, t) => { Main.instance.main_window.fonttree.progress.set_fraction((float) p / (float) t); ensure_ui_update(); }; Library.Remove.from_file_array(arr, Main.instance.database); foreach (var file in arr) { try { prune_path_from_database(Main.instance.database, file.get_path()); } catch (DatabaseError e) { warning("Failed to remove entries from database : %s", e.message); } } queue_reload(); } return; } void install_fonts (string [] arr) { fonttree.loading = true; font_model = null; fonttree.progress.set_fraction(0f); Library.progress = (m, p, t) => { Main.instance.main_window.fonttree.progress.set_fraction((float) p / (float) t); ensure_ui_update(); }; Library.Install.from_uri_array(arr); fonttree.loading = false; font_model = Main.instance.font_model; if(Library.Install.installed.size > 0) queue_reload(); return; } void on_drag_data_received (Gtk.Widget widget, Gdk.DragContext context, int x, int y, Gtk.SelectionData selection_data, uint info, uint time) { switch (info) { case DragTargetType.FAMILY: family_drop_handler(widget, x, y); break; case DragTargetType.EXTERNAL: install_fonts(selection_data.get_uris()); break; default: warning("Unsupported drag target."); return; } return; } void family_drop_handler (Gtk.Widget widget, int x, int y) { if (!(widget.name == "CollectionTree")) { debug("Unsupported drag target : %s ", widget.name); return; } Gtk.TreePath path; var tree = widget as Gtk.TreeView; tree.get_path_at_pos(x, y, out path, null, null, null); /* Invalid drop, non-existent path */ if (path == null) return; Gtk.TreeIter iter; var model = tree.get_model(); /* Invalid drop, non-existent path */ if (!model.get_iter(out iter, path)) return; Value val; model.get_value(iter, CollectionColumn.OBJECT, out val); var group = (Collection) val.get_object(); if (group != null) { group.families.add_all(fontlist.get_selected_families()); group.set_active_from_fonts(Main.instance.reject); sidebar.collection_model.collections.cache(); Idle.add(() => { disabled.update(Main.instance.database, Main.instance.reject); return false; }); } return; } } } master-0.7.3/src/font-manager/Makefile.am000066400000000000000000000010701300074171200202060ustar00rootroot00000000000000 include $(top_srcdir)/Flags.mk include ValaSources.mk font_manager_VALAFLAGS = \ ${AM_VALAFLAGS} \ $(HAVE_FILE_ROLLER) \ $(top_srcdir)/lib/fontmanager.vapi font_manager_CFLAGS = \ ${AM_CFLAGS} \ -I$(top_srcdir)/lib/ font_manager_LDADD = \ ${AM_LDADD} \ $(top_srcdir)/lib/libfontmanager.la font_manager_SOURCES = \ $(font_manager_VALASOURCES) EXTRA_DIST = \ ValaSources.mk bin_PROGRAMS = font-manager CLEANFILES = \ *.stamp* MAINTAINERCLEANFILES = \ Makefile.in dist-hook: cd $(distdir) && rm -f $(font_manager_VALASOURCES:.vala=.c) $(CLEANFILES) master-0.7.3/src/font-manager/Migration.vala.in000077500000000000000000000211611300074171200213630ustar00rootroot00000000000000/* Migration.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public bool update_declined () { if (Migration.required()) { if (Migration.approved(null)) { Migration.run(); } else { return true; } } return false; } [Compact] public class Migration { static string old_prefs_file; static string old_cache_file; static string old_collections_file; static Collections collections; public static bool required () { old_prefs_file = Path.build_filename(Environment.get_user_config_dir(), "@PACKAGE_NAME@", "preferences.ini"); File old_prefs = File.new_for_path(old_prefs_file); old_cache_file = Path.build_filename(Environment.get_user_cache_dir(), "@PACKAGE_NAME@", "font-manager.cache"); File old_cache = File.new_for_path(old_cache_file); old_collections_file = Path.build_filename(Environment.get_user_data_dir(), "@PACKAGE_NAME@", "Collections.xml"); File old_collections = File.new_for_path(old_collections_file); return (old_prefs.query_exists() || old_cache.query_exists() || old_collections.query_exists()); } public static bool approved (Gtk.Window? parent) { Gtk.ResponseType response = Gtk.ResponseType.NONE; var dialog = new Gtk.Dialog(); var cancel = new Gtk.Button.with_mnemonic(_("_Cancel")); var accept = new Gtk.Button.with_mnemonic(_("_Continue")); accept.get_style_context().add_class(Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); var header = new Gtk.HeaderBar(); var box = dialog.get_content_area(); var scrolled = new Gtk.ScrolledWindow(null, null); var textview = new StaticTextView(null); box.set_orientation(Gtk.Orientation.VERTICAL); scrolled.add(textview); box.pack_start(scrolled, true, true, 0); textview.buffer.set_text(update_notice); header.set_title(_("Update Required")); header.pack_start(cancel); header.pack_end(accept); dialog.set_titlebar(header); dialog.set_transient_for(parent); dialog.modal = true; dialog.destroy_with_parent = true; dialog.set_size_request(540, 360); header.show_all(); box.show_all(); cancel.clicked.connect(() => { dialog.response(Gtk.ResponseType.CANCEL); }); accept.clicked.connect(() => { dialog.response(Gtk.ResponseType.ACCEPT); }); dialog.response.connect((i) => { response = (Gtk.ResponseType) i; dialog.destroy(); }); dialog.close.connect(() => { dialog.destroy(); }); dialog.delete_event.connect(() => { dialog.destroy(); return false; }); dialog.run(); return (response == Gtk.ResponseType.ACCEPT); } public static void run () { /* XXX : progress? */ debug("Importing fonts"); import_fonts(); debug("Importing collections"); import_collections(); debug("Purging old cache files"); purge_cache(); debug("Purging old configuration files"); purge_config(); debug("Purging old FontConfig configuration files"); purge_fontconfig_config(); debug("Purging outdated data"); purge_data(); debug("Purging obsolete files"); purge_obsolete(); debug("Saving imported collections"); collections.cache(); return; } static bool purge_cache () { File cache_dir = File.new_for_path(Path.build_filename(Environment.get_user_cache_dir(), "@PACKAGE_NAME@")); return remove_directory(cache_dir); } static bool purge_config () { File config_dir = File.new_for_path(Path.build_filename(Environment.get_user_config_dir(), "@PACKAGE_NAME@")); return remove_directory(config_dir); } static bool purge_fontconfig_config () { File fontconfig_dir = File.new_for_path(Path.build_filename(Environment.get_user_config_dir(), "fontconfig")); return remove_directory(fontconfig_dir); } static bool purge_data () { File data_dir = File.new_for_path(Path.build_filename(Environment.get_user_data_dir(), "@PACKAGE_NAME@")); return remove_directory(data_dir); } static bool purge_obsolete () { File fontsconf = File.new_for_path(Path.build_filename(Environment.get_home_dir(), ".fonts.conf")); if (fontsconf.query_exists()) try { fontsconf.delete(); return true; } catch (Error e) { warning("Failed to remove obsolete file : %s", e.message); } return false; } static void import_fonts () { File? [] font_dirs = null; string old_font_dir = Path.build_filename(Environment.get_home_dir(), ".fonts"); File ofd = File.new_for_path(old_font_dir); if (ofd.query_exists()) font_dirs += ofd; string old_library = Path.build_filename(Environment.get_user_data_dir(), "@PACKAGE_NAME@", "Library"); File ol = File.new_for_path(old_library); if (ol.query_exists()) font_dirs += ol; Library.Install.from_file_array(font_dirs); return; } static bool import_collections () { { File file = File.new_for_path(old_collections_file); if (!file.query_exists()) return false; } collections = load_collections(); Xml.Parser.init(); debug("Xml.Parser : Opening : %s", old_collections_file); Xml.Doc * doc = Xml.Parser.parse_file(old_collections_file); if (doc == null) { /* File not found */ debug("Xml.Parser : File not found : %s", old_collections_file); Xml.Parser.cleanup(); return false; } Xml.XPath.Context ctx = new Xml.XPath.Context(doc); Xml.XPath.Object * res = ctx.eval_expression("//fontcollection"); for (int i = 0; i < res->nodesetval->length (); i++) { Xml.Node* node = res->nodesetval->item(i); string name = node->get_prop("name"); debug("Importing collection : %s", name); Collection collection = new Collection(name); collections.entries[name] = collection; collection.comment = node->get_prop("comment"); for (Xml.Node* iter = node->children; iter != null; iter = iter->next) { // Spaces between tags are also nodes, discard them if (iter->type != Xml.ElementType.ELEMENT_NODE) { continue; } collection.families.add(iter->get_content().strip()); } } debug("Xml.Parser : Closing : %s", old_collections_file); delete res; delete doc; Xml.Parser.cleanup(); return true; } } } const string update_notice = _(""" Font Manager has detected files from a previous installation. Some files from previous versions are incompatible with this release. Others have been deprecated or moved. Font Manager will now attempt to migrate your fonts and collections. Files and settings which are no longer necessary or valid will be deleted. Any configuration files that could cause a conflict will also be deleted. It is strongly recommended that you back up any important files before proceeding. """); master-0.7.3/src/font-manager/Preferences/000077500000000000000000000000001300074171200204155ustar00rootroot00000000000000master-0.7.3/src/font-manager/Preferences/Display.vala000066400000000000000000000034141300074171200226710ustar00rootroot00000000000000/* Display.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace Preferences { public class Display : FontConfig.PreferencePane { FontConfig.DisplayPropertiesPane pane; public Display () { pane = new FontConfig.DisplayPropertiesPane(); pack_start(pane, true, true, 0); connect_signals(); } public override void show () { pane.show(); base.show(); return; } void connect_signals () { controls.save_selected.connect(() => { pane.properties.save(); show_message(_("Settings saved to file.")); }); controls.discard_selected.connect(() => { pane.properties.discard(); show_message(_("Removed configuration file.")); }); return; } } } } master-0.7.3/src/font-manager/Preferences/Interface.vala000066400000000000000000000103411300074171200231610ustar00rootroot00000000000000/* Interface.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace Preferences { public class Interface : Gtk.Box { public LabeledSwitch wide_layout { get; private set; } public LabeledSwitch use_csd { get; private set; } Gtk.Grid grid; Gtk.Label message; Gtk.InfoBar infobar; Gtk.Revealer wide_layout_options; Gtk.CheckButton on_maximize; construct { orientation = Gtk.Orientation.VERTICAL; wide_layout = new LabeledSwitch(); wide_layout.label.set_markup(_("Wide Layout")); wide_layout_options = new Gtk.Revealer(); on_maximize = new Gtk.CheckButton.with_label(_("Only when maximized")); on_maximize.margin = DEFAULT_MARGIN_SIZE / 2; on_maximize.margin_start = on_maximize.margin_end = DEFAULT_MARGIN_SIZE * 2; use_csd = new LabeledSwitch(); use_csd.label.set_markup(_("Client Side Decorations")); message = new Gtk.Label(null); infobar = new Gtk.InfoBar(); infobar.get_content_area().add(message); infobar.response.connect((id) => { if (id == Gtk.ResponseType.CLOSE) infobar.hide(); }); wide_layout_options.add(on_maximize); grid = new Gtk.Grid(); grid.attach(wide_layout, 0, 0, 1, 1); grid.attach(wide_layout_options, 0, 1, 1, 1); grid.attach(use_csd, 0, 2, 1, 1); pack_start(infobar, false, false, 0); pack_end(grid, true, true, 0); connect_signals(); bind_properties(); } public override void show () { grid.show(); message.show(); wide_layout.show(); on_maximize.show(); wide_layout_options.show(); use_csd.show(); base.show(); return; } void bind_properties () { if (Main.instance.settings == null) return; Main.instance.settings.bind("wide-layout-on-maximize", on_maximize, "active", SettingsBindFlags.DEFAULT); return; } void show_message (string m) { message.set_markup("%s".printf(m)); infobar.show(); Timeout.add_seconds(3, () => { infobar.hide(); return false; }); return; } void connect_signals () { wide_layout.toggle.notify["active"].connect(() => { wide_layout_options.set_reveal_child(wide_layout.toggle.get_active()); }); use_csd.toggle.notify["active"].connect(() => { if (use_csd.toggle.active) show_message(_("CSD enabled. Change will take effect next time the application is started.")); else show_message(_("CSD disabled. Change will take effect next time the application is started.")); }); /* XXX : Shouldn't need this... but do. */ this.realize.connect(() => { infobar.hide(); }); return; } } } } master-0.7.3/src/font-manager/Preferences/Preferences.vala000066400000000000000000000100341300074171200235210ustar00rootroot00000000000000/* Preferences.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public Preferences.Pane construct_preference_pane () { Preferences.Pane pane = new Preferences.Pane(); pane.add_page(new Preferences.Sources(), "Sources", _("Sources")); pane.add_page(new Preferences.Rendering(), "Rendering", _("Rendering")); pane.add_page(new Preferences.Display(), "Display", _("Display")); pane.add_page(new Preferences.Interface(), "Interface", _("Interface")); return pane; } namespace Preferences { public class Pane : Gtk.Paned { public Gtk.Widget visible_child { get; set; } public string visible_child_name { get; set; } Gtk.Box box; Gtk.Stack stack; Gtk.StackSidebar sidebar; construct { orientation = Gtk.Orientation.HORIZONTAL; expand = true; position = 275; stack = new Gtk.Stack(); stack.set_transition_type(Gtk.StackTransitionType.CROSSFADE); box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); sidebar = new Gtk.StackSidebar(); sidebar.set_stack(stack); sidebar.get_style_context().remove_class(Gtk.STYLE_CLASS_SIDEBAR); sidebar.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); box.pack_start(sidebar, true, true, 0); add_separator(box); add1(box); add2(stack); bind_properties(); connect_signals(); } void bind_properties () { stack.bind_property("visible-child", this, "visible-child"); stack.bind_property("visible-child-name", this, "visible-child-name"); } void connect_signals () { stack.notify["visible"].connect(() => { if (stack.visible_child_name == "Sources") ((Sources) get_page("Sources")).source_list.update(); }); stack.notify["visible-child"].connect(() => { if (stack.visible_child_name == "Sources") ((Sources) get_page("Sources")).source_list.update(); }); return; } public override void show () { box.show(); stack.show(); sidebar.show(); base.show(); return; } public void add_page (Gtk.Widget widget, string name, string title) { Gtk.ScrolledWindow scroll = new Gtk.ScrolledWindow(null, null); scroll.add(widget); scroll.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); stack.add_titled(scroll, name, title); widget.show(); scroll.show(); return; } public Gtk.Widget get_page (string name) { var scroll = ((Gtk.Container) stack.get_child_by_name(name)); var viewport = scroll.get_children().nth_data(0); var widget = ((Gtk.Container) viewport).get_children().nth_data(0); return widget; } } } } master-0.7.3/src/font-manager/Preferences/Rendering.vala000066400000000000000000000034151300074171200232020ustar00rootroot00000000000000/* Rendering.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace Preferences { public class Rendering : FontConfig.PreferencePane { FontConfig.FontPropertiesPane pane; public Rendering () { pane = new FontConfig.FontPropertiesPane(); pack_start(pane, true, true, 0); connect_signals(); } public override void show () { pane.show(); base.show(); return; } void connect_signals () { controls.save_selected.connect(() => { pane.properties.save(); show_message(_("Settings saved to file.")); }); controls.discard_selected.connect(() => { pane.properties.discard(); show_message(_("Removed configuration file.")); }); return; } } } } master-0.7.3/src/font-manager/Preferences/Sources.vala000066400000000000000000000051361300074171200227120ustar00rootroot00000000000000/* Sources.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace Preferences { public class Sources : Gtk.Box { public FontSourceList source_list { get; private set; } BaseControls controls; public Sources () { orientation = Gtk.Orientation.VERTICAL; source_list = new FontSourceList(); source_list.expand = true; source_list.sources = Main.instance.sources; controls = new BaseControls(); controls.add_button.set_tooltip_text(_("Add source")); controls.remove_button.set_tooltip_text(_("Remove selected source")); controls.remove_button.sensitive = false; pack_start(controls, false, false, 1); add_separator(this, Gtk.Orientation.HORIZONTAL); pack_end(source_list, true, true, 1); connect_signals(); } public override void show () { controls.show(); controls.remove_button.hide(); source_list.show(); base.show(); return; } void connect_signals () { controls.add_selected.connect(() => { source_list.on_add_source(); }); controls.remove_selected.connect(() => { source_list.on_remove_source(); }); source_list.row_selected.connect((r) => { if (r != null) controls.remove_button.show(); else controls.remove_button.hide(); controls.remove_button.sensitive = (r != null); }); return; } } } } master-0.7.3/src/font-manager/RenderingOptions.vala000066400000000000000000000054051300074171200223160ustar00rootroot00000000000000/* RenderingOptions.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class RenderingOptions : Gtk.Window { public FontConfig.FontProperties properties { get { return pane.properties; } } Gtk.Box box; Gtk.HeaderBar header_bar; FontConfig.FontPropertiesPane pane; FontConfig.Controls controls; public RenderingOptions () { box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); pane = new FontConfig.FontPropertiesPane(); controls = new FontConfig.Controls(); header_bar = new Gtk.HeaderBar(); if (((Application) GLib.Application.get_default()).use_csd) { set_titlebar(header_bar); header_bar.show_close_button = true; } else { box.pack_start(header_bar, true, true, 0); } box.pack_start(pane, true, true, 0); box.pack_end(controls, false, false, 0); add(box); connect_signals(); } public override void show () { pane.show(); controls.show(); header_bar.show(); box.show(); base.show(); return; } void connect_signals () { controls.save_selected.connect(() => { properties.save(); this.hide(); }); controls.discard_selected.connect(() => { properties.discard(); this.hide(); }); delete_event.connect(() => { return this.hide_on_delete(); }); properties.changed.connect(() => { header_bar.set_title(properties.family); if (properties.font != null) header_bar.set_subtitle(properties.font.style); else header_bar.set_subtitle(null); }); return; } } } master-0.7.3/src/font-manager/SideBar.vala000077500000000000000000000157031300074171200203430ustar00rootroot00000000000000/* SideBar.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class SideBar : Gtk.Overlay { public string mode { get { return stack.get_visible_child_name(); } set { stack.set_visible_child_name(value); } } public StandardSideBar? standard { get { return (StandardSideBar) stack.get_child_by_name("Default"); } } public CharacterMapSideBar? character_map { get { return (CharacterMapSideBar) stack.get_child_by_name("Character Map"); } } public CategoryModel? category_model { get { return standard.category_tree.model; } set { standard.category_tree.model = value; } } public CollectionModel? collection_model { get { return standard.collection_tree.model; } set { standard.collection_tree.model = value; } } public bool loading { get { return _loading; } set { if (value) { spinner.start(); spinner.show(); } else { spinner.hide(); spinner.stop(); } } } protected Gtk.Stack stack; bool _loading = false; Gtk.Spinner spinner; Gtk.Box box; public SideBar () { stack = new Gtk.Stack(); stack.set_transition_duration(420); stack.set_transition_type(Gtk.StackTransitionType.UNDER_LEFT); box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); box.expand = true; box.pack_start(stack, true, true, 0); spinner = new Gtk.Spinner(); spinner.halign = Gtk.Align.CENTER; spinner.valign = Gtk.Align.CENTER; spinner.set_size_request(48, 48); add(box); add_overlay(spinner); get_style_context().add_class(Gtk.STYLE_CLASS_SIDEBAR); spinner.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); stack.notify["visible-child-name"].connect(() => { if (stack.get_visible_child_name() == "Default") stack.set_transition_type(Gtk.StackTransitionType.UNDER_LEFT); else stack.set_transition_type(Gtk.StackTransitionType.OVER_RIGHT); }); } public override void show () { stack.show(); box.show(); base.show(); return; } public void add_view (Gtk.Widget sidebar_view, string name) { stack.add_named(sidebar_view, name); sidebar_view.show(); return; } } public enum StandardSideBarMode { CATEGORY, COLLECTION, N_MODES } public class StandardSideBar : Gtk.Box { public signal void collection_selected (Collection group); public signal void category_selected (Category filter, int category); public signal void mode_selected (); public Collection? selected_collection { get; protected set; default = null; } public Category? selected_category { get; protected set; default = null; } public StandardSideBarMode mode { get { return (StandardSideBarMode) int.parse(stack.get_visible_child_name()); } set { stack.set_visible_child_name(((int) value).to_string()); } } public CategoryTree category_tree { get; private set; } public CollectionTree collection_tree { get; private set; } Gtk.Stack stack; Gtk.StackSwitcher switcher; Gtk.Box collection_box; Gtk.EventBox blend; Gtk.Box main_box; public StandardSideBar () { main_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); stack = new Gtk.Stack(); stack.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT_RIGHT); switcher = new Gtk.StackSwitcher(); switcher.set_stack(stack); switcher.set_border_width(6); switcher.halign = Gtk.Align.CENTER; switcher.valign = Gtk.Align.CENTER; category_tree = new CategoryTree(); collection_tree = new CollectionTree(); collection_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); collection_box.pack_start(collection_tree.controls, false, true, 0); collection_box.pack_end(collection_tree, true, true, 0); stack.add_titled(category_tree, "0", _("Categories")); stack.add_titled(collection_box, "1", _("Collections")); mode = StandardSideBarMode.CATEGORY; blend = new Gtk.EventBox(); blend.add(switcher); blend.get_style_context().add_class(Gtk.STYLE_CLASS_VIEW); main_box.pack_end(blend, false, true, 0); add_separator(main_box, Gtk.Orientation.HORIZONTAL, Gtk.PackType.END); main_box.pack_start(stack, true, true, 0); add(main_box); connect_signals(); } public override void show () { collection_tree.controls.show(); collection_tree.show(); collection_box.show(); category_tree.show(); stack.show(); switcher.show(); blend.show(); main_box.show(); base.show(); return; } void connect_signals () { category_tree.selection_changed.connect((f, i) => { category_selected(f, i); selected_category = f; }); collection_tree.selection_changed.connect((g) => { collection_selected(g); selected_collection = g; }); /* XXX : string? pspec? */ stack.notify["visible-child-name"].connect((pspec) => { mode_selected(); }); return; } } } master-0.7.3/src/font-manager/State.vala000066400000000000000000000271561300074171200201140ustar00rootroot00000000000000/* State.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class State : Object { internal static const int DEFAULT_WIDTH = 700; internal static const int DEFAULT_HEIGHT = 480; public Settings? settings { get; set; default = null; } public weak MainWindow? main_window { get; set; default = null; } public State (MainWindow main_window, string schema_id) { Object(main_window: main_window, settings: get_gsettings(schema_id)); } public void save () { if (settings == null) return; settings.set_strv("compare-list", main_window.compare.list()); settings.apply(); return; } public void restore () { if (settings == null) { ensure_sane_defaults(); return; } int x, y, w, h; settings.get("window-size", "(ii)", out w, out h); settings.get("window-position", "(ii)", out x, out y); main_window.wide_layout = settings.get_boolean("wide-layout"); main_window.set_default_size(w, h); main_window.move(x, y); main_window.sidebar.standard.mode = (StandardSideBarMode) settings.get_enum("sidebar-mode"); main_window.preview.mode = FontManager.FontPreviewMode.parse(settings.get_string("preview-mode")); main_window.main_pane.position = settings.get_int("sidebar-size"); main_window.content_pane.position = settings.get_int("content-pane-position"); main_window.preview.preview_size = settings.get_double("preview-font-size"); main_window.browser.preview_size = settings.get_double("browse-font-size"); main_window.compare.preview_size = settings.get_double("compare-font-size"); main_window.preview.notebook.page = settings.get_int("preview-page"); var preview_text = settings.get_string("preview-text"); if (preview_text != "DEFAULT") main_window.preview.set_preview_text(preview_text); main_window.sidebar.character_map.mode = (CharacterMapSideBarMode) settings.get_enum("charmap-mode"); main_window.sidebar.character_map.selected_block = settings.get_string("selected-block"); main_window.sidebar.character_map.selected_script = settings.get_string("selected-script"); main_window.sidebar.character_map.set_initial_selection(settings.get_string("selected-script"), settings.get_string("selected-block")); main_window.fontlist.controls.set_remove_sensitivity(main_window.sidebar.standard.mode == StandardSideBarMode.COLLECTION); main_window.mode = (FontManager.Mode) settings.get_enum("mode"); var menu_button = main_window.titlebar.main_menu; if (menu_button.use_popover) menu_button.popover.hide(); else menu_button.popup.hide(); return; } public void bind_settings () { if (settings == null) return; settings.delay(); main_window.configure_event.connect((w, /* Gdk.EventConfigure */ e) => { /* Avoid tiny windows on Wayland */ if (e.width < DEFAULT_WIDTH || e.height < DEFAULT_HEIGHT) return false; /* Size provided by event is not usable on Gtk+ > 3.18 */ int actual_window_width, actual_window_height; main_window.get_size(out actual_window_width, out actual_window_height); settings.set("window-size", "(ii)", actual_window_width, actual_window_height); settings.set("window-position", "(ii)", e.x, e.y); return false; } ); main_window.mode_changed.connect((i) => { settings.set_enum("mode", (int) i); } ); main_window.sidebar.standard.mode_selected.connect(() => { settings.set_enum("sidebar-mode", (int) main_window.sidebar.standard.mode); } ); main_window.preview.preview_mode_changed.connect((m) => { settings.set_string("preview-mode", ((FontManager.FontPreviewMode) m).to_string()); }); main_window.preview.preview_text_changed.connect((p) => { settings.set_string("preview-text", p); }); settings.bind("sidebar-size", main_window.main_pane, "position", SettingsBindFlags.DEFAULT); settings.bind("content-pane-position", main_window.content_pane, "position", SettingsBindFlags.DEFAULT); settings.bind("preview-font-size", main_window.preview, "preview-size", SettingsBindFlags.DEFAULT); settings.bind("browse-font-size", main_window.browser, "preview-size", SettingsBindFlags.DEFAULT); settings.bind("compare-font-size", main_window.compare, "preview-size", SettingsBindFlags.DEFAULT); settings.bind("charmap-font-size", main_window.preview.charmap, "preview-size", SettingsBindFlags.DEFAULT); settings.bind("selected-block", main_window.sidebar.character_map, "selected-block", SettingsBindFlags.DEFAULT); settings.bind("selected-script", main_window.sidebar.character_map, "selected-script", SettingsBindFlags.DEFAULT); settings.bind("selected-category", main_window.sidebar.standard.category_tree, "selected-iter", SettingsBindFlags.DEFAULT); settings.bind("selected-collection", main_window.sidebar.standard.collection_tree, "selected-iter", SettingsBindFlags.DEFAULT); settings.bind("selected-font", main_window.fontlist, "selected-iter", SettingsBindFlags.DEFAULT); settings.bind("preview-page", main_window.preview.notebook, "page", SettingsBindFlags.DEFAULT); settings.bind("wide-layout", main_window, "wide-layout", SettingsBindFlags.DEFAULT); settings.bind("use-csd", main_window, "use-csd", SettingsBindFlags.DEFAULT); main_window.sidebar.character_map.mode_set.connect(() => { settings.set_enum("charmap-mode", (int) main_window.sidebar.character_map.mode); } ); main_window.compare.color_set.connect((p) => { settings.set_string("compare-foreground-color", main_window.compare.foreground_color.to_string()); settings.set_string("compare-background-color", main_window.compare.background_color.to_string()); } ); return; } public void post_activate () { if (settings == null) return; /* Workaround first row height bug? in browse mode */ main_window.browser.preview_size++; main_window.browser.preview_size--; Idle.add(() => { var foreground = Gdk.RGBA(); var background = Gdk.RGBA(); bool foreground_set = foreground.parse(settings.get_string("compare-foreground-color")); bool background_set = background.parse(settings.get_string("compare-background-color")); if (foreground_set) ((Gtk.ColorChooser) main_window.compare.controls.fg_color_button).set_rgba(foreground); if (background_set) ((Gtk.ColorChooser) main_window.compare.controls.bg_color_button).set_rgba(background); var compare_list = settings.get_strv("compare-list"); /* XXX */ var available_fonts = Main.instance.families.list_font_descriptions(); foreach (var entry in compare_list) { if (entry in available_fonts) main_window.compare.add_from_string(entry); } return false; }); } public void restore_selections () { if (settings == null) return; /* XXX: Order matters */ var font_path = settings.get_string("selected-font"); var collection_path = settings.get_string("selected-collection"); var category_path = settings.get_string("selected-category"); var collection_tree = main_window.sidebar.standard.collection_tree.tree; var category_tree = main_window.sidebar.standard.category_tree.tree; if (main_window.sidebar.standard.mode == StandardSideBarMode.CATEGORY){ restore_last_selected_treepath(collection_tree, collection_path); restore_last_selected_treepath(category_tree, category_path); } else if (main_window.sidebar.standard.mode == StandardSideBarMode.COLLECTION) { restore_last_selected_treepath(category_tree, category_path); restore_last_selected_treepath(collection_tree, collection_path); } Idle.add(() => { var treepath = restore_last_selected_treepath(main_window.fontlist, font_path); if (treepath != null) main_window.browser.treeview.scroll_to_cell(treepath, null, true, 0.5f, 0.5f); return false; }); return; } /* XXX : These should match the schema */ void ensure_sane_defaults () { main_window.set_default_size(DEFAULT_WIDTH, DEFAULT_HEIGHT); main_window.mode = FontManager.Mode.BROWSE; main_window.sidebar.standard.mode = StandardSideBarMode.CATEGORY; main_window.preview.mode = FontManager.FontPreviewMode.PREVIEW; main_window.main_pane.position = 200; main_window.content_pane.position = 150; main_window.preview.preview_size = 10.0; main_window.browser.preview_size = 12.0; main_window.compare.preview_size = 12.0; main_window.preview.notebook.page = 0; main_window.fontlist.controls.set_remove_sensitivity(main_window.sidebar.standard.mode == StandardSideBarMode.COLLECTION); return; } Gtk.TreePath? restore_last_selected_treepath (Gtk.TreeView tree, string path) { Gtk.TreeIter iter; var model = (Gtk.TreeStore) tree.get_model(); var selection = tree.get_selection(); model.get_iter_from_string(out iter, path); debug("Restoring previous selection for %s :: %s", tree.name, path); if (!model.iter_is_valid(iter)) { debug("Ignoring non-existent path : %s", path); selection.select_path(new Gtk.TreePath.first()); return null; } var treepath = new Gtk.TreePath.from_string(path); selection.unselect_all(); if (treepath.get_depth() > 1) tree.expand_to_path(treepath); tree.scroll_to_cell(treepath, null, true, 0.5f, 0.5f); selection.select_path(treepath); return treepath; } } } master-0.7.3/src/font-manager/TitleBar.vala000066400000000000000000000177241300074171200205420ustar00rootroot00000000000000/* TitleBar.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { public class TitleBar : Gtk.HeaderBar { public signal void install_selected (); public signal void remove_selected (); public signal void add_selected (); public signal void preferences_selected (bool active); public Gtk.MenuButton main_menu { get; private set; } public Gtk.Label main_menu_label { get; set; } public Gtk.MenuButton app_menu { get; private set; } public Gtk.ToggleButton prefs_toggle { get; private set; } BaseControls manage_controls; Gtk.Revealer revealer; Gtk.Image main_menu_icon; Gtk.Image app_menu_icon; Gtk.Box main_menu_container; public TitleBar () { Object(name: "TitleBar", title: About.NAME, has_subtitle: false, margin: 0); main_menu = new Gtk.MenuButton(); main_menu_icon = new Gtk.Image.from_icon_name("view-more-symbolic", Gtk.IconSize.MENU); main_menu_container = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 1); main_menu_container.pack_start(main_menu_icon, false, false, 0); main_menu_label = new Gtk.Label(null); main_menu_container.pack_end(main_menu_label, false, true, 0); main_menu.add(main_menu_container); main_menu.direction = Gtk.ArrowType.DOWN; main_menu.relief = Gtk.ReliefStyle.NONE; app_menu = new Gtk.MenuButton(); app_menu_icon = new Gtk.Image.from_icon_name(About.ICON, Gtk.IconSize.LARGE_TOOLBAR); app_menu.add(app_menu_icon); app_menu.direction = Gtk.ArrowType.DOWN; app_menu.relief = Gtk.ReliefStyle.NONE; revealer = new Gtk.Revealer(); revealer.set_transition_type(Gtk.RevealerTransitionType.SLIDE_RIGHT); manage_controls = new BaseControls(); manage_controls.add_button.set_tooltip_text(_("Add Fonts")); manage_controls.remove_button.set_tooltip_text(_("Remove Fonts")); var separator = add_separator(manage_controls.box); separator.get_style_context().add_class("separator"); manage_controls.box.reorder_child(manage_controls.box.get_children().nth_data(2), 0); prefs_toggle = new Gtk.ToggleButton(); prefs_toggle.set_image(new Gtk.Image.from_icon_name("preferences-system-symbolic", Gtk.IconSize.MENU)); prefs_toggle.relief = Gtk.ReliefStyle.NONE; prefs_toggle.set_tooltip_text(_("Preferences")); manage_controls.box.pack_end(prefs_toggle, false, false, 1); revealer.add(manage_controls); pack_start(main_menu); pack_start(revealer); pack_end(app_menu); revealer.get_style_context().add_class(Gtk.STYLE_CLASS_TITLEBAR); get_style_context().add_class(name); set_menus(); connect_signals(); } public override void show () { main_menu_icon.show(); main_menu_container.show(); main_menu_label.show(); main_menu.show(); app_menu_icon.show(); app_menu.show(); prefs_toggle.show(); manage_controls.show(); revealer.show(); base.show(); return; } void set_menus () { main_menu.set_menu_model(get_main_menu_model()); app_menu.set_menu_model(get_app_menu_model()); return; } void connect_signals () { manage_controls.add_button.clicked.connect(() => { install_selected(); }); manage_controls.remove_button.clicked.connect(() => { remove_selected(); }); prefs_toggle.toggled.connect(() => { var active = prefs_toggle.get_active(); prefs_toggle.set_active(active); preferences_selected(prefs_toggle.get_active()); }); return; } public void reveal_controls (bool reveal) { revealer.set_reveal_child(reveal); return; } public void use_toolbar_styling () { set_title(""); get_style_context().remove_class("header-bar"); get_style_context().remove_class("titlebar"); get_style_context().remove_class("menubar"); get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR); revealer.get_style_context().remove_class(Gtk.STYLE_CLASS_TITLEBAR); revealer.get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR); manage_controls.get_style_context().add_class(Gtk.STYLE_CLASS_TOOLBAR); manage_controls.get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR); return; } GLib.MenuModel get_main_menu_model () { var application = (Application) GLib.Application.get_default(); var mode_section = new GLib.Menu(); string [] modes = {"Default", "Browse", "Compare"}; var mode_action = new SimpleAction.stateful("mode", VariantType.STRING, "Manage"); mode_action.activate.connect((a, s) => { Main.instance.main_window.mode = Mode.parse((string) s); }); application.add_action(mode_action); int i = 0; foreach (var mode in modes) { i++; string? accels [] = {"%i".printf(i), null }; application.set_accels_for_action("app.mode::%s".printf(mode), accels); GLib.MenuItem item = new MenuItem(Mode.parse(mode).to_translatable_string(), "app.mode::%s".printf(mode)); item.set_attribute("accel", "s", "%i".printf(i)); mode_section.append_item(item); } return (GLib.MenuModel) mode_section; } GLib.MenuModel get_app_menu_model () { var application = (Application) GLib.Application.get_default(); /* action_name, display_name, detailed_action_name, accelerator, method */ MenuEntry [] app_menu_entries = { MenuEntry("help", _("Help"), "app.help", "F1", new MenuCallbackWrapper(application.help)), MenuEntry("about", _("About"), "app.about", null, new MenuCallbackWrapper(application.about)), MenuEntry("quit", _("Quit"), "app.quit", "Q", new MenuCallbackWrapper(application.quit)) }; var app_menu = new GLib.Menu(); foreach (var entry in app_menu_entries) { add_action_from_menu_entry(application, entry); if (entry.accelerator != null) { string? accels [] = {entry.accelerator, null }; application.set_accels_for_action(entry.detailed_action_name, accels); GLib.MenuItem item = new MenuItem(entry.display_name, entry.detailed_action_name); item.set_attribute("accel", "s", entry.accelerator); app_menu.append_item(item); } else { app_menu.append(entry.display_name, entry.detailed_action_name); } } return app_menu; } } } master-0.7.3/src/font-manager/ValaSources.mk000066400000000000000000000006161300074171200207370ustar00rootroot00000000000000# Do not edit directly. See build-aux directory font_manager_VALASOURCES = \ Application.vala \ Browse.vala \ Compare.vala \ Main.vala \ MainWindow.vala \ Migration.vala \ Preferences/Display.vala \ Preferences/Interface.vala \ Preferences/Preferences.vala \ Preferences/Rendering.vala \ Preferences/Sources.vala \ RenderingOptions.vala \ SideBar.vala \ State.vala \ TitleBar.vala master-0.7.3/src/font-viewer/000077500000000000000000000000001300074171200160435ustar00rootroot00000000000000master-0.7.3/src/font-viewer/Application.vala.in000066400000000000000000000105231300074171200215610ustar00rootroot00000000000000/* Application.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace FontViewer { const string BUS_ID = "org.gnome.FontViewer"; const string BUS_PATH = "/org/gnome/FontViewer"; [DBus (name = "org.gnome.FontViewer")] public class Application : Gtk.Application { [DBus (visible = false)] public MainWindow? main_window { get; private set; default = null; } uint dbus_id = 0; bool activate_called = false; State? state = null; public Application (string app_id, ApplicationFlags app_flags) { Object(application_id : app_id, flags : app_flags); } public override void startup () { base.startup(); main_window = new MainWindow(); main_window.application = this; add_window(main_window); state = new State(main_window, BUS_ID); return; } void activate_if_needed () { if (!activate_called) this.activate(); else { main_window.update(); main_window.present(); } return; } public bool ready () { return main_window.ready(); } public void show_uri (string uri) { main_window.show_uri(uri); activate_if_needed(); return; } public override void open (File [] files, string hint) { main_window.open(files[0].get_path()); activate_if_needed(); return; } protected override void activate () { activate_called = true; state.restore(); main_window.present(); main_window.update(); state.bind(); state.post_activate(); return; } public void about () { warning("About dialog not implemented!"); return; } public new void quit () { state.save(); base.quit(); return; } public override bool dbus_register (DBusConnection conn, string path) throws Error { base.dbus_register(conn, path); dbus_id = conn.register_object (BUS_PATH, this); if (dbus_id == 0) critical("Could not register Font Viewer service "); return true; } public override void dbus_unregister (DBusConnection conn, string path) { if (dbus_id != 0) conn.unregister_object(dbus_id); base.dbus_unregister(conn, path); } public static int main (string [] args) { Logging.setup("Font Viewer"); GLib.Intl.bindtextdomain("@PACKAGE_NAME@", null); GLib.Intl.bind_textdomain_codeset("@PACKAGE_NAME@", null); GLib.Intl.textdomain("@PACKAGE_NAME@"); GLib.Intl.setlocale(GLib.LocaleCategory.ALL, null); Environment.set_application_name(_("Font Viewer")); Environment.set_variable("XDG_CONFIG_HOME", "", true); FontConfig.enable_user_config(false); Gtk.init(ref args); return new Application(BUS_ID, (ApplicationFlags.HANDLES_OPEN)).run(args); } } } } master-0.7.3/src/font-viewer/MainWindow.vala000066400000000000000000000173371300074171200207770ustar00rootroot00000000000000/* MainWindow.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace FontViewer { internal const string w1 = _("Font Viewer"); internal const string w2 = _("Preview font files before installing them."); internal const string w3 = _("To preview a font simply drag it onto this area."); internal const string welcome_tmpl = "%s\n\n\n%s\n\n\n\n%s"; public class MainWindow : Gtk.ApplicationWindow { public signal void mode_changed (FontPreviewMode mode); public FontPreviewMode mode { get; set; } public FontPreviewPane preview { get; private set; } Gtk.Box box; Gtk.Overlay overlay; WelcomeLabel welcome; Gtk.Button install_button; Gee.ArrayList installed; Metadata.TitleBar titlebar; /* Type hint used to prevent notification on every selection. * Happens in gnome-shell and I assume other environments if * one of the file manager extensions are in use. */ public MainWindow () { Object(title: _("Font Viewer"), icon_name: About.ICON, type_hint: Gdk.WindowTypeHint.UTILITY); Gtk.drag_dest_set(this, Gtk.DestDefaults.ALL, AppDragTargets, AppDragActions); installed = new Gee.ArrayList (); preview = new FontPreviewPane(); install_button = new Gtk.Button(); install_button.margin = MINIMUM_MARGIN_SIZE; install_button.set_label(_("Install Font")); install_button.opacity = 0.725; install_button.clicked.connect(() => { Library.Install.from_font_data(preview.font_data); installed.add(preview.font_data.fontinfo.checksum); update_install_button_state(); }); preview.notebook.set_action_widget(install_button, Gtk.PackType.END); welcome = new WelcomeLabel(welcome_tmpl.printf(w1, w2, w3)); box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); titlebar = new Metadata.TitleBar(); add_separator(box, Gtk.Orientation.HORIZONTAL); box.pack_end(preview, true, true, 0); set_titlebar(titlebar); overlay = new Gtk.Overlay(); /* XXX : Bug? */ var force_label_resizing_in_an_overlay = new Gtk.ScrolledWindow(null, null); force_label_resizing_in_an_overlay.add(box); force_label_resizing_in_an_overlay.show(); overlay.add(force_label_resizing_in_an_overlay); overlay.add_overlay(welcome); add(overlay); set_default_size(600, 400); update_install_button_state(); connect_signals(); } void connect_signals () { delete_event.connect((w, e) => { ((Application) GLib.Application.get_default()).quit(); return true; }); bind_property("mode", preview, "mode", BindingFlags.BIDIRECTIONAL); preview.preview_mode_changed.connect((m) => { mode_changed(m); }); preview.updated.connect(() => { this.update(); }); } public override void show () { titlebar.show(); install_button.show(); preview.show(); box.show(); overlay.show(); base.show(); return; } public bool ready () { return this.visible; } public void show_uri (string uri) { preview.open(uri); return; } public void open (string arg) { preview.open(arg); return; } public void set_preview_text (string preview_text) { preview.set_preview_text(preview_text); return; } public void update () { update_install_button_state(); if (preview.font_data == null) titlebar.update(null, null, ""); else titlebar.update(preview.font_data.font.family,//Markup.escape_text(preview.font_data.font.family), preview.font_data.font.style, preview.font_data.fontinfo.filetype); if (preview.font_data != null) { welcome.hide(); box.show(); } else { box.hide(); welcome.show(); } return; } void update_install_button_state () { if (preview.font_data == null) { install_button.hide(); return; } else { install_button.show(); } FontConfig.clear_app_fonts(); bool _installed = Library.is_installed(preview.font_data); FontConfig.add_app_font(preview.font_data.font.filepath); if (installed.contains(preview.font_data.fontinfo.checksum)) _installed = true; if (Library.conflicts(preview.font_data) > 0) { install_button.set_label(_("Newer version already installed")); install_button.sensitive = false; install_button.relief = Gtk.ReliefStyle.NONE; } else if (_installed) { install_button.set_label(_("Installed")); install_button.sensitive = false; install_button.relief = Gtk.ReliefStyle.NONE; } else { install_button.set_label(_("Install Font")); install_button.sensitive = true; install_button.relief = Gtk.ReliefStyle.NORMAL; } return; } public override void drag_data_received (Gdk.DragContext context, int x, int y, Gtk.SelectionData selection_data, uint info, uint time) { switch (info) { case DragTargetType.EXTERNAL: this.open(selection_data.get_uris()[0]); break; default: warning("Unsupported drag target."); return; } return; } } } } master-0.7.3/src/font-viewer/Makefile.am000066400000000000000000000010161300074171200200750ustar00rootroot00000000000000 include $(top_srcdir)/Flags.mk font_viewer_VALAFLAGS = \ ${AM_VALAFLAGS} \ $(top_srcdir)/lib/fontmanager.vapi font_viewer_CFLAGS = \ ${AM_CFLAGS} \ -I$(top_srcdir)/lib/ font_viewer_LDADD = \ ${AM_LDADD} \ $(top_srcdir)/lib/libfontmanager.la font_viewer_SOURCES = \ Application.vala \ MainWindow.vala \ TitleBar.vala \ State.vala pkglibexec_PROGRAMS = font-viewer CLEANFILES = \ *.stamp* MAINTAINERCLEANFILES = \ Makefile.in dist-hook: cd $(distdir) && rm -f $(font_viewer_SOURCES:.vala=.c) $(CLEANFILES) master-0.7.3/src/font-viewer/State.vala000066400000000000000000000073011300074171200177710ustar00rootroot00000000000000/* State.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace FontViewer { public class State : Object { internal static const int DEFAULT_WIDTH = 600; internal static const int DEFAULT_HEIGHT = 400; public Settings? settings { get; set; default = null; } public weak MainWindow? main_window { get; set; default = null; } public State (MainWindow main_window, string schema_id) { Object(main_window: main_window, settings: get_gsettings(schema_id)); } public void save () { if (settings == null) return; settings.apply(); return; } public void restore () { if (settings == null) return; int x, y, w, h; settings.get("window-size", "(ii)", out w, out h); settings.get("window-position", "(ii)", out x, out y); main_window.set_default_size(w, h); main_window.move(x, y); main_window.preview.preview_size = settings.get_double("preview-font-size"); var preview_text = settings.get_string("preview-text"); if (preview_text != "DEFAULT") main_window.preview.set_preview_text(preview_text); return; } public void bind () { if (settings == null) return; main_window.configure_event.connect((w, e) => { /* Avoid tiny windows on Wayland */ if (e.width < DEFAULT_WIDTH || e.height < DEFAULT_HEIGHT) return false; /* Size provided by event is not usable on Gtk+ > 3.18 */ int actual_window_width, actual_window_height; main_window.get_size(out actual_window_width, out actual_window_height); settings.set("window-size", "(ii)", actual_window_width, actual_window_height); settings.set("window-position", "(ii)", e.x, e.y); return false; }); main_window.mode_changed.connect((m) => { settings.set_enum("mode", ((int) m)); }); main_window.preview.preview_text_changed.connect((p) => { settings.set_string("preview-text", p); }); settings.bind("preview-font-size", main_window.preview, "preview-size", SettingsBindFlags.DEFAULT); settings.bind("charmap-font-size", main_window.preview.charmap, "preview-size", SettingsBindFlags.DEFAULT); settings.delay(); return; } public void post_activate () { main_window.preview.mode = ((FontPreviewMode) settings.get_enum("mode")); return; } } } } master-0.7.3/src/font-viewer/TitleBar.vala000066400000000000000000000074121300074171200204220ustar00rootroot00000000000000/* TitleBar.vala * * Copyright (C) 2009 - 2016 Jerry Casiano * * This file is part of Font Manager. * * Font Manager 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. * * Font Manager 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 Font Manager. If not, see . * * Author: * Jerry Casiano */ namespace FontManager { namespace Metadata { public class TitleBar : Gtk.HeaderBar { struct FontTypeEntry { public string name; public string tooltip; public string url; public FontTypeEntry (string name, string tooltip, string url) { this.name = name; this.tooltip = tooltip; this.url = url; } } class TypeInfoCache : Object { FontTypeEntry [] types = { FontTypeEntry("null", "", ""), FontTypeEntry("opentype", _("OpenType Font"), "http://wikipedia.org/wiki/OpenType"), FontTypeEntry("truetype", _("TrueType Font"), "http://wikipedia.org/wiki/TrueType"), FontTypeEntry("type1", _("PostScript Type 1 Font"), "http://wikipedia.org/wiki/Type_1_Font#Type_1"), }; public new FontTypeEntry get (string key) { var _key = key.down().replace(" ", ""); foreach (var entry in types) if (entry.name == _key) return entry; return types[0]; } public void update (Gtk.Image icon, string key) { var entry = this[key]; icon.set_from_icon_name(entry.name, Gtk.IconSize.LARGE_TOOLBAR); icon.set_tooltip_text(entry.tooltip); } } Gtk.Image type_icon; TypeInfoCache type_info_cache; construct { show_close_button = true; spacing = 6; type_info_cache = new TypeInfoCache(); type_icon = new Gtk.Image(); reset(); pack_start(type_icon); get_style_context().add_class("MetadataTitle"); } public override void show () { type_icon.show(); base.show(); return; } void reset () { set_title(null); set_subtitle(null); type_info_cache.update(type_icon, "null"); return; } public virtual void update (string? family, string? style, string? filetype) { this.reset(); if (family == null && style == null) { set_title(_("No file selected")); set_subtitle(_("Or unsupported filetype.")); return; } set_title(family); set_subtitle(style); const string tt_tmpl = "%s %s"; set_tooltip_markup(tt_tmpl.printf(Markup.escape_text(family), style)); type_info_cache.update(type_icon, filetype); return; } } } } master-0.7.3/tests/000077500000000000000000000000001300074171200141515ustar00rootroot00000000000000master-0.7.3/tests/Makefile.am000066400000000000000000000014371300074171200162120ustar00rootroot00000000000000 include ValaSources.mk include $(top_srcdir)/Flags.mk noinst_PROGRAMS = $(TEST_PROGS) TEST_PROGS = FontManagerTestSuite FontManagerTestSuite_SOURCES = \ $(FontManagerTestSuite_VALASOURCES) FontManagerTestSuite_VALAFLAGS = \ ${AM_VALAFLAGS} \ $(HAVE_FILE_ROLLER) \ $(top_srcdir)/lib/fontmanager.vapi FontManagerTestSuite_CFLAGS = \ ${AM_CFLAGS} \ -I$(top_srcdir)/lib/ FontManagerTestSuite_LDADD = \ ${AM_LDADD} \ $(top_srcdir)/lib/libfontmanager.la EXTRA_DIST = \ fonts.dtd \ sources.dtd \ $(FontManagerTestSuite_VALASOURCES) CLEANFILES = \ results.xml \ *.stamp* MAINTAINERCLEANFILES = \ Makefile.in check-local: @echo @gtester -o results.xml --verbose FontManagerTestSuite @echo dist-hook: cd $(distdir) && rm -f $(FontManagerTestSuite_SOURCES:.vala=.c) $(CLEANFILES) master-0.7.3/tests/TestCase.vala000066400000000000000000000052231300074171200165330ustar00rootroot00000000000000/* TestCase.vala * * Originally from libgee : https://wiki.gnome.org/action/show/Projects/Libgee * * This copy contains minor modifications. * /* testcase.vala * * Copyright (C) 2009 Julien Peeters * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library 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 * Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Author: * Julien Peeters */ namespace FontManager { public abstract class TestCase : Object { public delegate void TestMethod (); GLib.TestSuite suite; /* Need to hold a ref to these */ TestWrapper [] tests = new TestWrapper[0]; public TestCase (string name) { suite = new GLib.TestSuite(name); } public void add_test (string name, owned TestMethod test) { TestWrapper t = new TestWrapper(name, (owned) test, this); tests += t; suite.add(new GLib.TestCase(t.name, t.set_up, t.run, t.tear_down )); } /* Called before every test.run */ public virtual void set_up () { return; } /* Called after every test.run */ public virtual void tear_down () { return; } public GLib.TestSuite get_suite () { return suite; } class TestWrapper { [CCode (notify = false)] public string name { get; private set; } TestMethod test; TestCase test_case; public TestWrapper (string name, owned TestMethod test, TestCase test_case) { this.name = name; this.test = (owned) test; this.test_case = test_case; } public void set_up (void * fixture) { test_case.set_up(); return; } public void run (void * fixture) { test(); return; } public void tear_down (void * fixture) { test_case.tear_down(); return; } } } } master-0.7.3/tests/TestFontConfig.vala000066400000000000000000000217041300074171200177160ustar00rootroot00000000000000using FontConfig; public class TestAccept : FontManager.TestCase { string? filepath = null; Accept accept; public TestAccept () { base("FontConfig"); add_test("Accept::create ", test_create); add_test("Accept::save ", test_save); add_test("Accept::validate ", test_valid_xml); add_test("Accept::load ", test_load); } public override void set_up () { accept = new Accept(); accept.config_dir = Environment.get_current_dir(); filepath = accept.get_filepath(); return; } public void test_create () { assert(accept is Accept); return; } public void test_save () { accept.add("monospace"); accept.add("sans"); accept.add("serif"); accept.save(); assert_exists(filepath); } public void test_valid_xml () { assert(is_valid_xml(filepath)); return; } public void test_load () { accept.load(); assert(accept.contains("monospace")); assert(accept.contains("sans")); assert(accept.contains("serif")); try_delete(filepath); return; } public override void tear_down () { accept = null; filepath = null; return; } } public class TestAliasElement : FontManager.TestCase { AliasElement? ae = null; public TestAliasElement () { base("FontConfig"); add_test("AliasElement::create ", test_create); } public override void set_up () { ae = new AliasElement(null); return; } public void test_create () { assert(ae is AliasElement); ae.family = "Test"; assert(ae.family != null); assert(ae.prefer is Gee.HashSet); assert(ae.accept is Gee.HashSet); assert(ae.default is Gee.HashSet); return; } public override void tear_down () { ae = null; return; } } public class TestAliases : FontManager.TestCase { string? filepath = null; Aliases? aliases = null; public TestAliases () { base("FontConfig"); add_test("Aliases::create ", test_create); add_test("Aliases::save ", test_save); add_test("Aliases::validate ", test_valid_xml); add_test("Aliases::load ", test_load); } public override void set_up () { aliases = new Aliases(); aliases.config_dir = Environment.get_current_dir(); filepath = aliases.get_filepath(); return; } public void test_create () { assert(aliases is Aliases); assert(aliases.config_dir != null); assert(aliases.target_file != null); return; } public void test_save () { aliases.add("Test"); AliasElement ae = aliases["Test"]; ae.prefer.add("SomeFont"); ae.prefer.add("SomeOtherFont"); ae.accept.add("YetAnotherFont"); ae.default.add("DefaultFont"); aliases.save(); return; } public void test_valid_xml () { assert(is_valid_xml(filepath)); return; } public void test_load () { aliases.load(); assert(aliases.has_key("Test")); AliasElement ae = aliases["Test"]; assert(ae.family == "Test"); assert(ae.prefer.contains("SomeFont")); assert(ae.prefer.contains("SomeOtherFont")); assert(ae.accept.contains("YetAnotherFont")); assert(ae.default.contains("DefaultFont")); try_delete(filepath); return; } public override void tear_down () { aliases = null; filepath = null; return; } } public class TestDirectories : FontManager.TestCase { string? filepath = null; Directories dirs; public TestDirectories () { base("FontConfig"); add_test("Directories::create ", test_create); add_test("Directories::save ", test_save); add_test("Directories::validate ", test_valid_xml); add_test("Directories::load ", test_load); } public override void set_up () { dirs = new Directories(); dirs.config_dir = Environment.get_current_dir(); filepath = dirs.get_filepath(); return; } public void test_create () { assert(dirs is Directories); return; } public void test_save () { dirs.add("/usr/share/fonts"); dirs.add("/home/user/.local/fonts"); dirs.save(); assert_exists(filepath); } public void test_valid_xml () { assert(is_valid_xml(filepath)); return; } public void test_load () { dirs.load(); assert(dirs.contains("/usr/share/fonts")); assert(dirs.contains("/home/user/.local/fonts")); try_delete(filepath); return; } public override void tear_down () { dirs = null; filepath = null; return; } } public class TestFamilies : FontManager.TestCase { Families families; public TestFamilies () { base("FontConfig"); add_test("Families::create ", test_create); add_test("Families::update ", test_update); } public override void set_up () { families = new Families(); return; } public void test_create () { assert(families is Families); return; } public void test_update () { assert(families.size == 0); families.update(); assert(families.size > 0); return; } public override void tear_down () { families = null; return; } } public class TestReject : FontManager.TestCase { string? filepath = null; Reject reject; public TestReject () { base("FontConfig"); add_test("Reject::create ", test_create); add_test("Reject::save ", test_save); add_test("Reject::validate ", test_valid_xml); add_test("Reject::load ", test_load); } public override void set_up () { reject = new Reject(); reject.config_dir = Environment.get_current_dir(); filepath = reject.get_filepath(); return; } public void test_create () { assert(reject is Reject); return; } public void test_save () { reject.add("monospace"); reject.add("sans"); reject.add("serif"); reject.save(); assert_exists(filepath); } public void test_valid_xml () { assert(is_valid_xml(filepath)); return; } public void test_load () { reject.load(); assert(reject.contains("monospace")); assert(reject.contains("sans")); assert(reject.contains("serif")); try_delete(filepath); return; } public override void tear_down () { reject = null; filepath = null; return; } } public class TestSource : FontManager.TestCase { File file = File.new_for_path(Environment.get_current_dir()); public TestSource () { base("FontConfig"); add_test("Source::create ", test_create); add_test("Source::availability ", test_availability); } public void test_create () { var source = new FontConfig.Source(file); assert(source is FontConfig.Source); return; } public void test_availability () { var source = new FontConfig.Source(file); assert(source.available); source = null; source = new FontConfig.Source(File.new_for_path("/not/available/")); assert(!(source.available)); return; } } public class TestSources : FontManager.TestCase { string? filepath = null; Sources? sources = null; const string [] test_paths = { "/etc", "/fontsource1", "/fontsource2", "/fontsource3" }; public TestSources () { base("FontConfig"); add_test("Sources::create ", test_create); add_test("Sources::save ", test_save); add_test("Sources::validate ", test_valid_xml); add_test("Sources::load ", test_load); } public override void set_up () { sources = new Sources(); sources.config_dir = Environment.get_current_dir(); sources.active.config_dir = Environment.get_current_dir(); filepath = sources.get_filepath(); return; } public void test_create () { assert(sources is Sources); return; } public void test_save () { foreach (var p in test_paths) sources.add_from_path(p); assert(sources.size == test_paths.length); sources.save(); assert_exists(filepath); } public void test_valid_xml () { assert(is_valid_xml(filepath)); return; } public void test_load () { assert(sources.size == 0); sources.load(); assert(sources.size == test_paths.length); foreach (var s in sources) assert(s.path in test_paths); try_delete(filepath); return; } public override void tear_down () { sources = null; filepath = null; return; } } master-0.7.3/tests/TestMain.vala000066400000000000000000000011571300074171200165460ustar00rootroot00000000000000 public static int main (string [] args) { Test.init(ref args); TestSuite root = TestSuite.get_root(); /* BEGIN FONTCONFIG TESTING */ root.add_suite(new TestAccept().get_suite()); root.add_suite(new TestAliasElement().get_suite()); root.add_suite(new TestAliases().get_suite()); root.add_suite(new TestDirectories().get_suite()); root.add_suite(new TestFamilies().get_suite()); root.add_suite(new TestReject().get_suite()); root.add_suite(new TestSource().get_suite()); root.add_suite(new TestSources().get_suite()); /* END FONTCONFIG TESTING */ return Test.run(); } master-0.7.3/tests/TestUtils.vala000066400000000000000000000013231300074171200167550ustar00rootroot00000000000000 void assert_exists (string filepath) { assert(File.new_for_path(filepath).query_exists()); return; } void try_delete (string filepath) { /* Try to cleanup */ try { var file = File.new_for_path(filepath); file.delete(); } catch (Error e) { if (!(e is FileError.NOENT)) message("Failed to remove temporary file : %s", e.message); } return; } string get_xmllint_path () { string? xmllint = Environment.find_program_in_path("xmllint"); assert(xmllint != null); return xmllint; } bool is_valid_xml (string filepath) { string cmd = "%s --noout --valid %s".printf(get_xmllint_path(), filepath); return (get_command_line_status(cmd) == 0); } master-0.7.3/tests/ValaSources.mk000066400000000000000000000001601300074171200167260ustar00rootroot00000000000000 FontManagerTestSuite_VALASOURCES = \ TestUtils.vala \ TestCase.vala \ TestMain.vala \ TestFontConfig.vala master-0.7.3/tests/fonts.dtd000066400000000000000000000161221300074171200160010ustar00rootroot00000000000000 master-0.7.3/tests/sources.dtd000066400000000000000000000000711300074171200163270ustar00rootroot00000000000000