Really Simple CAPTCHA - Version 1.0

Version Description

Download this release

Release Info

Developer takayukister
Plugin Icon 128x128 Really Simple CAPTCHA
Version 1.0
Comparing to
See all releases

Version 1.0

README.txt ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Really Simple CAPTCHA ===
2
+ Contributors: takayukister
3
+ Donate link: http://pledgie.com/campaigns/3259
4
+ Tags: captcha
5
+ Requires at least: 2.2
6
+ Tested up to: 2.7.1
7
+ Stable tag: 1.0
8
+
9
+ Really Simple CAPTCHA is a CAPTCHA module intended to be called from other plugins. It is originally created for my Contact Form 7 plugin.
10
+
11
+ == Description ==
12
+
13
+ Really Simple CAPTCHA does not work alone and is intended to work with other plugins. It is originally created for Contact Form 7, however, you can use it with your own plugin.
14
+
15
+ Note: This product is "really simple" as its name suggests, i.e., it is not strongly secure. If you need perfect security, you should try other solutions.
16
+
17
+ = How does it work? =
18
+
19
+ Really Simple CAPTCHA does not use PHP "Sessions" for storing states, unlike many other PHP CAPTCHA solutions, but stores them as temporary files. This allows you to embed it into WordPress without worrying about conflicts.
20
+
21
+ When you generate a CAPTCHA, Really Simple CAPTCHA creates two files for it; one is an image file of CAPTCHA, and the other is a PHP file which returns the correct answer to the CAPTCHA.
22
+
23
+ The two files have the same (random) prefix in their file names, for example, "a7hk3ux8p.png" and "a7hk3ux8p.php." In this case, for example, when the respondent answers "K5GF" as an answer to the "a7hk3ux8p.png" image, then Really Simple CAPTCHA runs "a7hk3ux8p.php" code and tests the answer against the return value it receives. If the return value is "K5GF," the two match, and the answer is confirmed as correct.
24
+
25
+ = How to use with your plugin =
26
+
27
+ First, create an instance of ReallySimpleCaptcha class:
28
+
29
+ `$captcha_instance = new ReallySimpleCaptcha();`
30
+
31
+ You can change the instance variables as you wish.
32
+
33
+ `// Change the background color of CAPTCHA image to black`
34
+ `$captcha_instance->bg = array(0, 0, 0);`
35
+
36
+ See really-simple-captcha.php if you are interested in other variables.
37
+
38
+ Generate a random word for CAPTCHA.
39
+
40
+ `$word = $captcha_instance->generate_random_word();`
41
+
42
+ Generate an image file and a PHP code file in the temporary directory.
43
+
44
+ `$prefix = mt_rand();`
45
+ `$captcha_instance->generate_image($prefix, $word);`
46
+
47
+ Then, show the image and get an answer from respondent.
48
+
49
+ Check the correctness of the answer.
50
+
51
+ `$correct = $captcha_instance->check($prefix, $the_answer_from_respondent);`
52
+
53
+ If the $correct is true, go ahead. Otherwise, block the respondent -- as it would appear not to be human.
54
+
55
+ And last, remove the temporary image and PHP files, as they are no longer in use.
56
+
57
+ `$captcha_instance->remove($prefix);`
58
+
59
+ That's all.
60
+
61
+ If you wish to see a live sample of this, you can try Contact Form 7.
62
+
63
+ == Installation ==
64
+
65
+ In most cases you can install automatically from WordPress.
66
+
67
+ However, if you install this manually, follow these steps:
68
+
69
+ 1. Upload the entire `really-simple-captcha` folder to the `/wp-content/plugins/` directory.
70
+ 1. Activate the plugin through the 'Plugins' menu in WordPress.
71
+
72
+ FYI: There is no "control panel" for this plugin.
gentium/FONTLOG.txt ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FONTLOG
2
+ Gentium font family
3
+ ========================
4
+
5
+
6
+ This file provides detailed information on the Gentium family of fonts. This
7
+ information should be distributed along with the Gentium fonts and any
8
+ derivative works.
9
+
10
+
11
+ Basic Font Information
12
+ ----------------------
13
+
14
+ Gentium ("belonging to the nations" in Latin) is a Unicode typeface family
15
+ designed to enable the many diverse ethnic groups around the world who use
16
+ the Latin script to produce readable, high-quality publications. The design
17
+ is intended to be highly readable, reasonably compact, and visually
18
+ attractive. Gentium has won a "Certificate of Excellence in Typeface Design"
19
+ in two major international typeface design competitions: bukva:raz! (2001),
20
+ TDC2003 (2003).
21
+
22
+ Gentium provides glyphs for a wide range of Latin and Greek characters. The
23
+ additional 'extended' Latin letters are designed to naturally harmonize with
24
+ the traditional 26 ones. Diacritics are treated with careful thought and
25
+ attention to their use. Gentium also supports both ancient and modern Greek,
26
+ including a number of alternate forms. It currently supports the following
27
+ ranges of Unicode 3.0 (completely unless noted):
28
+
29
+ Range Description
30
+ U+0020-U+007F Basic Latin
31
+ U+00A0-U+00FF Latin-1 Supplement
32
+ U+0100-U+017F Latin Extended-A
33
+ U+0180-U+021F Latin Extended-B
34
+ U+0222-U+0233 Latin Extended-B (continued)
35
+ U+0250-U+02AD IPA Extensions
36
+ U+02B0-U+02FF Spacing Modifier Letters
37
+ U+0300-U+036F Combining Diacritical Marks
38
+ U+0370-U+03D5 Greek (not including archaic or Coptic)
39
+ U+1E00-U+1EFF Latin Extended Additional
40
+ U+1F00-U+1FFF Greek Extended
41
+ U+2000-U+203A General Punctuation (partial)
42
+ U+2070-U+209F Superscripts and Subscripts
43
+ U+20A0-U+20CF Currency Symbols (partial)
44
+ U+2100-U+214F Letterlike Symbols (only a couple)
45
+
46
+ Gentium Regular also includes some Cyrillic glyphs, but they are only early
47
+ drafts. A future version will include a completely revised set, including
48
+ italic, and will expand the support for Latin, Greek and Cyrillic to Unicode
49
+ 4.1.
50
+
51
+
52
+ ChangeLog
53
+ ---------
54
+ (This should list both major and minor changes, most recent first.)
55
+
56
+ 28 Nov 2005 (Victor Gaultney) Gentium version 1.02
57
+ - Changed licensing to the SIL Open Font License
58
+ - Included FontLab source files
59
+ - Fixed some duplicate PostScript glyphs names
60
+ - Fixed italic angle
61
+
62
+ 19 Sep 2003 (Victor Gaultney) Gentium version 1.01
63
+ - Maintenance release focused on changing internal font
64
+ - Information to reflect the changeover to an SIL project
65
+ - There is only one bug fix - the Greek mu PS name was changed to try and fix
66
+ a display/printing problem. There is still no manual hinting
67
+
68
+ 16 Sep 2002 (Victor Gaultney) Gentium version 1.00
69
+ - First public release
70
+ - No manual hinting is included in this version. Some has been done - with
71
+ good results - but is not yet complete enough.
72
+
73
+
74
+ Information for Contributors
75
+ ----------------------------
76
+
77
+ The main point of version 1.02 is to enable modification via the OFL and to
78
+ establish a means for people to contribute to the project. For information
79
+ on what you're allowed to change or modify, consult the OFL and OFL-FAQ. The
80
+ OFL-FAQ also gives a very general rationale regarding why you would want to
81
+ contribute to the project.
82
+
83
+ Anyone can make their own modified version of Gentium (using a different
84
+ name), but SIL International will continue to maintain and develop the
85
+ canonical version of the Gentium fonts. As the package maintainer, we warmly
86
+ welcome contributions. Here are some things to keep in mind:
87
+
88
+ Format: We are open to contributions in various formats, but if you want to
89
+ maximise the chances of us including your work, please make it available to
90
+ us (via email or a URL) as either a FontLab database (preferred) or a
91
+ PostScript Type 1 (or OT-CFF) font.
92
+
93
+ Source files: For the first time, we're including FontLab databases used in
94
+ developing the fonts. The current fonts, however, were not solely built from
95
+ this FontLab database, so a simple "Generate Font" will not give you an
96
+ identical result. These databases are provided not as canonical source but
97
+ as an aid to anyone who might find it useful to have access to the
98
+ PostScript-style curves before they were turned into TrueType ones. BTW -
99
+ although only two databases are provided, they contain all the Alt glyphs.
100
+ In the future we may be making our 'source' available in three formats:
101
+ OpenType (TrueType), OT-CFF, and FontLab.
102
+
103
+ Copyright attribution: If you submit something for inclusion in the main
104
+ Gentium fonts, we will ask you to affirm that it is your original work, and
105
+ ask you to assign the copyright of your work to SIL International. This is
106
+ to ensure that future releases can be made under improved versions of the
107
+ OFL without needing to track you down for further permission. This follows
108
+ the same principle used by the FSF. Keep in mind that we are a
109
+ not-for-profit organization committed to free/libre and open source
110
+ software, and that any contributions incorporated in the fonts will always
111
+ be available under the OFL or a similar license.
112
+
113
+ Quality: Because we want to be able to guarantee a high level of quality for
114
+ the primary Gentium fonts, we will review submissions carefully. Please
115
+ don't be discouraged if we do not include a submission for this reason, or
116
+ ask you to make specific revisions.
117
+
118
+ What types of contributions are welcomed now (some more than others):
119
+ - Old style figures
120
+ - Small caps (although we would want such done for *all* caps, not just A-Z)
121
+ - Specifications for smart Greek code (write us about this)
122
+ - Coptic
123
+ - Historic/Archaic Cyrillic
124
+ - Glyphs used for ancient Greek text study (but not alphabetic ones, like
125
+ the digamma)
126
+ - Mathematical glyphs
127
+ - OpenType code and glyphs for on-the-fly fraction creation
128
+ - Additional scripts (Armenian, etc.?), and any needed OT/Graphite/AAT code
129
+ - Other things that we may have once told you we didn't have time to do :-)
130
+
131
+ What is not needed at this point:
132
+ - Revisions to the basic letters or their spacing
133
+ - Cyrillic revisions or additions. These are already in process
134
+ - Other weights (Bold, Bold italic). We already have some work done on this
135
+ - Alphabetic Ancient Greek glyphs (digamma, etc.). These are done and are
136
+ waiting for the next release
137
+ - Unicode 4.1 additions for Latin. We have these already in the pipeline
138
+ - General Latin/Cyrillic OpenType/Graphite/AAT code - we already have this
139
+ (see our Doulos SIL project)
140
+ - Kerning - there is some in place
141
+ - Hinting - although if you could offer to do some hinting, let us know :-)
142
+
143
+ So why didn't we include some of this in this release? The only change for
144
+ 1.02 is the new licensing model. We thought that it was important to get a
145
+ revised font out before we had completed the next big revision. We also
146
+ didn't want to hold up release until we had everything neat and tidy :-)
147
+
148
+ When submissions will be included: We hope to have a revised version of the
149
+ Regular and Italic fonts (including full Cyrillic) completed by mid-2006. To
150
+ do this we will need submissions early in the year. Other weights will
151
+ follow after that.
152
+
153
+ WARNINGS: The details of the source files and build procedures will be
154
+ changing radically before the next release, so do not spend too much time
155
+ working on systems that depend on the current FontLab database information.
156
+ Also - the Cyrillic glyphs in the regular font are very early prototypes and
157
+ will be changing completely. So don't bother to modify them!
158
+
159
+
160
+ Acknowledgements
161
+ ----------------
162
+ (Here is where contributors can be acknowledged. If you make modifications
163
+ be sure to add your name (N), email (E), web-address (W) and description
164
+ (D). This list is sorted by last name in alphabetical order.)
165
+
166
+ N: Victor Gaultney
167
+ E: victor_gaultney@sil.org
168
+ W: http://www.sil.org/~gaultney/
169
+ D: Original Designer of Latin, Greek and Cyrillic glyphs
170
+
171
+ The Gentium project is maintained by SIL International.
172
+
173
+ For more information please visit the Gentium page on SIL International's
174
+ Computers and Writing systems website:
175
+ http://scripts.sil.org/gentium
176
+
177
+ Or send an email to <gentium AT sil DOT org>
gentium/GENTIUM-FAQ.txt ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GENTIUM-FAQ
2
+ Gentium Release 1.02
3
+ 28 November 2005
4
+ ========================
5
+
6
+ Here are some answers to frequently asked questions about the Gentium fonts:
7
+
8
+
9
+ General
10
+ ========
11
+
12
+ How do you pronounce Gentium?
13
+
14
+ The preferred pronunciation is with a soft G as in 'general', not a
15
+ hard one as in 'gold': JEN-tee-oom.
16
+
17
+ What is GentiumAlt?
18
+
19
+ It is a version of the font with redesigned diacritics (flatter
20
+ ones) to make it more suitable for use with stacking diacritics, and
21
+ for languages such as Vietnamese. The Greek glyphs also use the
22
+ Porsonic (single-curve) design for the circumflex. Since Gentium
23
+ does not currently include any 'smart' rendering routines, there is
24
+ no easy way to access these alternate diacritic shapes from within
25
+ the regular Gentium font. The encoding of the fonts are the same, so
26
+ the same text can be viewed with either one. There is also no
27
+ problem with having both font families installed at the same time.
28
+
29
+
30
+ Licensing
31
+ =========
32
+
33
+ I want to use Gentium in my publication - can I?
34
+
35
+ Gentium is released under the SIL Open Font License, which permits use
36
+ for any publication, whether electronic or printed. For more answers
37
+ to use questions see the OFL-FAQ. The license, alongside information
38
+ specific to Gentium, is in the release package.
39
+
40
+ I would like to bundle Gentium with my application - can I?
41
+
42
+ This is our most common question. The SIL Open Font License allows
43
+ bundling with applications, even commercial ones, with some restrictions.
44
+ See the OFL file.
45
+
46
+ Can I use the font on my web site?
47
+
48
+ You can certainly create web pages that request that Gentium be used to
49
+ display them (if that font is available on the user's system). According
50
+ to the license, you are even allowed to place the font on your site for
51
+ people to download it. We would strongly recommend, however, that you
52
+ direct users to our site to download the font. This ensures that they
53
+ are always using the most recent version with bug fixes, etc. To make
54
+ this easier, we've simplified the URL for Gentium:
55
+ http://scripts.sil.org/gentium
56
+
57
+ Is Gentium going to stay free?
58
+
59
+ There is no intention to ever charge users for using Gentium. The
60
+ current version is licensed under a free/open license and future
61
+ versions will be similar.
62
+
63
+
64
+ Modification
65
+ ============
66
+
67
+ I would like to modify Gentium to add a couple of characters I need. Can I?
68
+
69
+ Yes - that is allowed as long as you abide by the conditions of the
70
+ SIL Open Font License.
71
+
72
+ So will you add glyphs upon request?
73
+
74
+ If you have a special symbol that you need (say, for a particular
75
+ transcription system), the best means of doing so will be to ensure
76
+ that the symbol makes it into the Unicode Standard. It is impossible
77
+ for us to add every glyph that every person desires, but we do place
78
+ a high priority on adding pretty much anything that falls in certain
79
+ Unicode ranges (extended Latin, Greek, Cyrillic). You can send us your
80
+ requests, but please understand that we are unlikely to add symbols
81
+ where the user base is very small, unless they have been accepted
82
+ into Unicode.
83
+
84
+ Can I send you work I've done to be incorporated into Gentium?
85
+
86
+ Yes! See the FONTLOG for information on becoming a contributor.
87
+
88
+
89
+ Technical
90
+ =========
91
+
92
+ Can you help me get Gentium working on my system?
93
+
94
+ We cannot afford to offer individual technical support. The best
95
+ resource is this website, where we hope to offer some limited help.
96
+ However, we do want to hear of any problems you encounter, so that
97
+ we can add them to the list of bugs to fix in later releases.
98
+
99
+ Our contact address is <gentium AT sil DOT org>. Please understand
100
+ that we cannot guarantee a personal response.
101
+
102
+ I can't find all the extended Latin letters in the font. How do I type them?
103
+
104
+ Gentium is Unicode-encoded, which means that the computer stores a
105
+ special, unique code for each letter in your document. Since most
106
+ keyboards do not have hundreds of keys, special software is needed
107
+ in order to type the hundreds of special characters supported by the
108
+ font.
109
+
110
+ I can't find the 'o with right hook' in the font. Where is it?
111
+
112
+ Combinations of base letters with diacritics are often called
113
+ composite, or pre-composed glyphs. Gentium has hundreds of these
114
+ (the ones that are included in Unicode). There are, however, many
115
+ common combinations that are not represented by a single composite.
116
+ It is possible to enter these into a document, but only as
117
+ individual components. So 'o with right hook' would be entered as
118
+ 'o', then 'right hook'. Although this may not look very good in some
119
+ cases, we're not able to anticipate every possible combination.
120
+ Future versions of Gentium will include 'smart font' support for
121
+ technologies such as OpenType and SIL's Graphite. This will make
122
+ diacritic positioning much better.
123
+
124
+ Some diacritics are not aligning well with base glyphs, and if I type more
125
+ than one diacritic, they run into each other. Why is that?
126
+
127
+ Gentium currently has no 'smart font' code for automatic diacritic
128
+ positioning, but will in the near future.
129
+
130
+ How do I type the Greek letters?
131
+
132
+ You need a Unicode-compatible keyboarding system, which is not
133
+ included in the distribution package.
134
+
135
+ I'm having problems making PDFs -- why won't my document distill?
136
+
137
+ Gentium is a large font, with lots of glyphs. As a result, some
138
+ printers can balk at PDFs that have the complete font embedded. The
139
+ easiest way to avoid this is to have Acrobat/Distiller subset the
140
+ font. This is generally a good idea anyway (with any font) and can
141
+ reduce the size of your files.
142
+
143
+
144
+ Future
145
+ ======
146
+
147
+ Now that SIL International has taken over Gentium, who will be the next
148
+ designer?
149
+
150
+ Victor Gaultney will remain as primary designer, but Annie Olsen, a
151
+ fellow type designer from the SIL Non-Roman Script Initiative, has
152
+ joined the project team. She is a former calligraphy teacher, and is
153
+ well suited for the task. Other members of the NRSI team will also
154
+ add their expertise in technical matters.
155
+
156
+ Do you plan to include other typographic enhancements (small caps, old style
157
+ figures, etc.)?
158
+
159
+ Those would be nice, wouldn't they. From a design point of view,
160
+ it would be great to have these refinements, and we haven't ruled
161
+ them out. But there are other needs that are much higher priority
162
+ (Bold, Cyrillic, etc.). If you think you could contribute some of
163
+ your time and effort to these enhancements, see the FONTLOG file for
164
+ information on becoming a contributor.
165
+
166
+ What about bold?
167
+
168
+ We hope to make a prototype of a Bold weight (and a few others,
169
+ including italic) available soon, but it will only cover basic Latin
170
+ glyphs at first. Once we are confident that the basic design is solid,
171
+ we will begin to design the bold versions of the other hundreds of
172
+ glyphs. Be patient, though, as Gentium has lots of glyphs!
173
+
174
+ Sans-serif?
175
+
176
+ There is a definite need for a sans-serif font that shares some of
177
+ Gentium�s strengths -- high readability, economy of space, etc. It
178
+ would also be great if that font also harmonized well with Gentium.
179
+ We don't currently have any plans for a companion face, although one
180
+ of our other projects - Andika - may be useful. Andika is a sans-serif
181
+ font designed specifically for use in literacy programs around the
182
+ world. A prototype should be available in a few months.
183
+
184
+ Will you be extending Gentium to cover other scripts, and Hebrew in
185
+ particular?
186
+
187
+ It is very unlikely that we would do this, as there are so many
188
+ pressing needs in Latin, Greek and Cyrillic scripts. But you could
189
+ contribute to the project.
190
+
191
+ When will Cyrillic be completed?
192
+
193
+ As soon as we can get it done, but it is still a few months away.
194
+
195
+ I need a couple of ancient Greek glyphs, such as the digamma. When will
196
+ those be ready?
197
+
198
+ These have already been designed and will be in the next release
199
+ (mid-2006).
200
+
201
+ Will there be a Type 1 version? What about OpenType?
202
+
203
+ The next generation of Gentium will have OpenType, Graphite and AAT
204
+ support. We do not plan to produce Type 1 versions at this time, but
205
+ please write us if this is important (and tell us why). We are, however,
206
+ considering releasing a version in OT-CFF format, but it will not go
207
+ through the same careful testing as the standard OT/Graphite/AAT version.
gentium/GenAI102.TTF ADDED
Binary file
gentium/GenAR102.TTF ADDED
Binary file
gentium/GenI102.TTF ADDED
Binary file
gentium/GenR102.TTF ADDED
Binary file
gentium/GentiumDesignSource.vfb ADDED
Binary file
gentium/GentiumIDesignSource.vfb ADDED
Binary file
gentium/OFL-FAQ.txt ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ OFL FAQ - Frequently Asked Questions about the SIL Open Font License (OFL)
2
+ Version 1.0 - 22 November 2005
3
+ (See http://scripts.sil.org/OFL for updates)
4
+
5
+
6
+ 1 ABOUT USING AND DISTRIBUTING FONTS LICENSED UNDER THE OFL
7
+
8
+ 1.1 Can I use the fonts in any publication, even embedded in the file?
9
+ Yes. You may use them like most other fonts, but unlike some fonts you may include an embedded subset of the fonts in your document. Such use does not require you to include this license or other files (listed in OFL condition 2), nor does it require any type of acknowledgement within the publication. Some mention of the font name within the publication information (such as in a colophon) is usually appreciated. If you wish to include the complete font as a separate file, you should distribute the full font package, including all existing acknowledgements, and comply with the OFL conditions. Of course, referencing or embedding an OFL font in any document does not change the license of the document itself. The resulting document is not a derivative anymore than a compiled program is a derivative of a compiler. Similarly, creating a graphic using an OFL font does not make the resulting artwork subject to the OFL.
10
+
11
+ 1.2 Can I make web pages using these fonts?
12
+ Yes! Go ahead! Using CSS (Cascading Style Sheets) is recommended.
13
+
14
+ 1.3 Can I make the fonts available to others from my web site?
15
+ Yes, as long as you meet the conditions for use (include the necessary files, don't abuse the Author(s)' names, rename Modified Versions, do not sublicense and do not sell by itself).
16
+
17
+ 1.4 Can the fonts be included with free and open source software distributions (such as GNU/Linux and BSD distributions)?
18
+ Yes! The OFL is compatible with most FLOSS (Free/Libre and Open Source Software) licenses. You can also repackage the fonts and the accompanying components in a .rpm or .deb package and include them in distro CD/DVDs and online repositories.
19
+
20
+ 1.5 I want to distribute the fonts with my program. Does this mean my program also has to be free and open source software?
21
+ No. Only the portions based on the font software are required to be released under the OFL. The intent of the license is to allow aggregation or bundling also with software under restricted licensing.
22
+
23
+ 1.6 Can I include the fonts on a CD of freeware or commercial fonts?
24
+ Yes, as long some other font or software is also on the disk, so the OFL font is not sold by itself.
25
+
26
+ 1.7 Can I sell a software package that includes these fonts?
27
+ Yes, you can do this with both the Standard Version and a Modified Version. Examples of bundling made possible by the OFL would include: word processors, design and publishing applications, training and educational software, edutainment software, etc.
28
+
29
+ 1.8 Why won't the OFL let me sell the fonts alone?
30
+ The intent is to keep people from making money by simply redistributing the fonts. The only people who ought to profit directly from the fonts should be the original authors, and those authors have kindly given up potential income to distribute their fonts under the OFL. Please honor and respect their contribution!
31
+
32
+ 1.9 I've come across a font released under the OFL. How can I easily get more information about the Standard Version? How can I know where it stands compared to the Standard Version or other Modified Versions?
33
+ Consult the copyright statement in the license for how to contact the original authors. Consult the FONTLOG for information on if and how the font differs from the Standard Version, and get in touch with the various contributors via the information in the acknowledgment section. Please consider using the Standard Versions of the fonts whenever possible.
34
+
35
+ 1.10 What do you mean in condition 4? Can you provide examples of abusive promotion / endorsement / advertisement vs. normal acknowledgement?
36
+ The intent is that the goodwill and reputation of the authors should not be used in a way that makes it sound like the original authors endorse or approve of a specific Modified Version or software bundle. For example, it would not be right to advertise a word processor by naming the authors in a listing of software features, or to promote a Modified Version on a web site by saying "designed by...". However, it would be appropriate to acknowledge the authors if your software package has a list of people who deserve thanks. We realize that this can seem to be a gray area, but the standard used to judge an acknowledgement is that if the acknowledgement benefits the authors it is allowed, but if it primarily benefits other parties, or could reflect poorly on the authors, then it is not.
37
+
38
+
39
+ 2 ABOUT MODIFYING OFL LICENSED FONTS
40
+
41
+ 2.1 Can I change the fonts? Are there any limitations to what things I can and cannot change?
42
+ You are allowed to change anything, as long as such changes do not violate the terms of the license. In other words, you could not remove the copyright statement from the font, but you could add additional information into it that covers your contribution.
43
+
44
+ 2.2 I have a font that needs a few extra glyphs - can I take them from an OFL licensed font and copy them into mine?
45
+ Yes, but if you distribute that font to others it must be under the OFL, and include the information mentioned in condition 2 of the license.
46
+
47
+ 2.3 Can I charge people for my additional work? In other words, if I add a bunch of special glyphs and/or OpenType/Graphite code, can I sell the enhanced font?
48
+ Not by itself. Derivative fonts must be released under the OFL and cannot be sold by themselves. It is permitted, however, to include them in a larger software package (such as text editors, office suites or operating systems), even if the larger package is sold. In that case, you are strongly encouraged, but not required, to also make that derived font easily and freely available outside of the larger package.
49
+
50
+ 2.4 Can I pay someone to enhance the fonts for my use and distribution?
51
+ Yes. This is a good way to fund the further development of the fonts. Keep in mind, however, that if the font is distributed to others it must be under the OFL. You won't be able to recover your investment by exclusively selling the font, but you will be making a valuable contribution to the community. Please remember how you have benefitted from the contributions of others.
52
+
53
+ 2.5 I need to make substantial revisions to the font to make it work with my program. It will be a lot of work, and a big investment, and I want to be sure that it can only be distributed with my program. Can I restrict its use?
54
+ No. If you redistribute a Modified Version of the font it must be under the OFL. You may not restrict it in any way. This is intended to ensure that all released improvements to the fonts become available to everyone. But you will likely get an edge over competitors by being the first to distribute a bundle with the enhancements. Again, please remember how you have benefitted from the contributions of others.
55
+
56
+ 2.6 Do I have to make any derivative fonts (including source code, build scripts, documentation, etc.) publicly available?
57
+ No, but please do share your improvements with others. You may find that you receive more than what you gave in return.
58
+
59
+ 2.7 Why can't I use the Reserved Font Name(s) in my derivative font names? I'd like people to know where the design came from.
60
+ The best way to acknowledge the source of the design is to thank the original authors and any other contributors in the files that are distributed with your revised font (although no acknowledgement is required). The FONTLOG is a natural place to do this. Reserved Font Name(s) ensure that the only fonts that have the original names are the unmodified Standard Versions. This eliminates potential confusion and name conflicts. When choosing a name be creative and try to avoid names that sound like the original. Keep in mind that the copyright holder can allow a specific trusted partner to use Reserved Font Name(s) through a separate written agreement.
61
+
62
+ 2.8 What do you mean by "references stored in the Font Software"? Do I have to delete every reference to the Reserved Font Name(s) from inside every file I modify?
63
+ No, not every reference. It would be fine, for example, to keep a text reference to the original fonts in your modified source code, as long as no one could be confused that your modified source is the original. But you cannot use the Reserved Font Names in any way to identify the font to the user (unless the Copyright Holder allows it through a separate agreement, see section 2.7). Users who install derivatives ("Modified Versions") on their systems should not see any of the original names ("Reserved Font Names") in their font menus, font properties dialogs, PostScript streams, documents that refer to a particular font name, etc. Again, this is to ensure that users are not confused and do not mistake a font for another and so expect features only another derivative or the Standard Version can actually offer. Ultimately, creating name conflicts will cause many problems for the users as well as for the designer of both the Standard and derivative versions, so please think ahead and find a good name for your own derivative. Font substitution systems like fontconfig, OpenOffice.org or Scribus will also get very confused if the name of the font they are configured to substitute to actually refers to another physical font on the user's hard drive. It will help everyone if Standard and derivative fonts can easily be distinguished from one another, and from other derivatives.
64
+
65
+ 2.9 What is this FONTLOG thing exactly?
66
+ It has three purposes: 1) to provide basic information on the font to users and other developers, 2) to document changes that have been made to the font or accompanying files, either by the original authors or others, and 3) to provide a place to acknowledge the authors and other contributors. Please use it! See below for details on how changes should be noted.
67
+
68
+ 2.10 Am I required to update the FONTLOG?
69
+ No, but users, designers and other developers might get very frustrated at you if you don't! People need to know how derivative fonts differ from the originals, and how to take advantage of the changes, or build on them.
70
+
71
+
72
+ 3 ABOUT THE FONTLOG
73
+
74
+ The FONTLOG can take a variety of formats, but should include these four sections:
75
+
76
+ 3.1 FONTLOG for <FontFamilyName>
77
+ This file provides detailed information on the <FontFamilyName> font software. This information should be distributed along with the <FontFamilyName> fonts and any derivative works.
78
+
79
+ 3.2 Basic Font Information
80
+ (Here is where you would describe the purpose and brief specifications for the font project, and where users can find more detailed documentation. It can also include references to how changes can be contributed back to the Standard Version. You may also wish to include a short guide to the design, or a reference to such a document.)
81
+
82
+ 3.3 ChangeLog
83
+ (This should list both major and minor changes, most recent first. Here are some examples:)
84
+
85
+ 1 Feb 2005 (Jane Doe) <NewFontFamilyName> Version 1.1
86
+ - Improved build script performance and verbosity
87
+ - Extended the smart code documentation
88
+ - Corrected minor typos in the documentation
89
+ - Fixed position of combining inverted breve below (U+032F)
90
+ - Added OpenType/Graphite smart code for Armenian
91
+ - Added Armenian glyphs (U+0531 -> U+0587)
92
+ - Released as "<NewFontFamilyName>"
93
+
94
+ 1 Jan 2005 (Joe Smith) <FontFamilyName> Version 1.0
95
+ - Initial release of font "<FontFamilyName>"
96
+
97
+ 3.4 Acknowledgements
98
+ (Here is where contributors can be acknowledged. If you make modifications be sure to add your name (N), email (E), web-address (W) and description (D). This list is sorted by last name in alphabetical order.)
99
+
100
+ N: Jane Doe
101
+ E: jane@university.edu
102
+ W: http://art.university.edu/projects/fonts
103
+ D: Contributor - Armenian glyphs and code
104
+
105
+ N: Fred Foobar
106
+ E: fred@foobar.org
107
+ W: http://foobar.org
108
+ D: Contributor - misc Graphite fixes
109
+
110
+ N: Pat Johnson
111
+ E: pat@fontstudio.org
112
+ W: http://pat.fontstudio.org
113
+ D: Designer - Greek & Cyrillic glyphs based on Roman design
114
+
115
+ N: Tom Parker
116
+ E: tom@company.com
117
+ W: http://www.company.com/tom/projects/fonts
118
+ D: Engineer - original smart font code
119
+
120
+ N: Joe Smith
121
+ E: joe@fontstudio.org
122
+ W: http://joe.fontstudio.org
123
+ D: Designer - original Roman glyphs
124
+
125
+ (Original authors can also include information here about their organization.)
126
+
127
+
128
+ 4 ABOUT MAKING CONTRIBUTIONS
129
+
130
+ 4.1 Why should I contribute my changes back to the original authors?
131
+ It would benefit many people if you contributed back to what you've received. Providing your contributions and improvements to the fonts and other components (data files, source code, build scripts, documentation, etc.) could be a tremendous help and would encourage others to contribute as well and 'give back', which means you will have an opportunity to benefit from other people's contributions as well. Sometimes maintaining your own separate version takes more effort than merging back with the original. Be aware that any contributions, however, must be either your own original creation or work that you own, and you may be asked to affirm that when you contribute.
132
+
133
+ 4.2 I've made some very nice improvements to the font, will you consider adopting them and putting them into future Standard Versions?
134
+ Most authors would be very happy to receive such contributions. Keep in mind that it is unlikely that they would want to incorporate major changes that would require additional work on their end. Any contributions would likely need to be made for all the fonts in a family and match the overall design and style. Authors are encouraged to include a guide to the design with the fonts. It would also help to have contributions submitted as patches or clearly marked changes (the use of a centralized or distributed source revision control system like subversion or arch is a good idea). Examples of useful contributions are bug fixes, additional glyphs, stylistic alternates (and the smart font code to access them).
135
+
136
+ 4.3 How can I financially support the development of OFL fonts?
137
+ It is likely that most authors of OFL fonts would accept financial contributions - contact them for instructions on how to do this. Such contributions would support future development. You can also pay for others to enhance the fonts and contribute the results back to the original authors for inclusion in the Standard Versions.
138
+
139
+
140
+ 5 ABOUT THE LICENSE
141
+
142
+ 5.1 I see that this is version 1.0 of the license. Will there be later changes?
143
+ We hope that version 1.0 will meet most needs, but are open to future improvements. Any revisions would be for future font releases, and previously existing licenses would remain in effect. No retroactive changes are possible, although the Copyright Holder can re-release the font under a revised OFL. All versions will be available on our web site: http://scripts.sil.org/OFL.
144
+
145
+ 5.2 Can I use the SIL Open Font License for my own fonts?
146
+ Yes! We heartily encourage anyone to use the OFL to distribute their own original fonts. It is a carefully constructed license that allows great freedom with some protection for the original authors and clear rules for other contributors. Some additional information is included at the end of this FAQ.
147
+
148
+ 5.3 Does this license restrict the rights of the Copyright Holder?
149
+ No. The Copyright Holder still retains all rights to their creation; they are only releasing a portion of it for use in a specific way. For example, the Copyright Holder may choose to release a 'basic' version of their font under the OFL, but sell a restricted 'enhanced' version. Only the Copyright Holder can do this.
150
+
151
+ 5.4 Is the OFL a contract or a license?
152
+ The OFL is a license and not a contract and so does not require you to sign it to have legal validity. By using, modifying and redistributing components under the OFL you indicate that you accept the license.
153
+
154
+
155
+ 6 ABOUT SIL INTERNATIONAL
156
+
157
+ 6.1 Who is SIL International and what does it do?
158
+ SIL International is a worldwide faith-based education and development organization (NGO) that studies, documents, and assists in developing the world's lesser-known languages through literacy, linguistics, translation, and other academic disciplines. SIL makes its services available to all without regard to religious belief, political ideology, gender, race, or ethnic background. SIL's members and volunteers share a Christian commitment.
159
+
160
+ 6.2 What does this have to do with font licensing?
161
+ The ability to read, write, type and publish in one's own language is one of the most critical needs for millions of people around the world. This requires fonts that are widely available and support lesser-known languages. SIL develops - and encourages others to develop - a complete stack of writing systems implementation components available under open licenses. This open stack includes input methods, smart fonts, smart rendering libraries and smart applications. There has been a need for a common open license that is specifically applicable to fonts and related software (a crucial component of this stack) so SIL developed the SIL Open Font License.
162
+
163
+ 6.3 How can I contact SIL?
164
+ Our main web site is: http://www.sil.org/
165
+ Our site about complex scripts is: http://scripts.sil.org/
166
+ Information about this license (including contact email information) is at: http://scripts.sil.org/OFL
167
+
168
+
169
+ 7 ABOUT USING THE OFL FOR YOUR ORIGINAL FONTS
170
+
171
+ If you want to release your fonts under the OFL, you only need to do the following:
172
+
173
+ 7.1 Put your copyright and reserved names information in the beginning of the main OFL file.
174
+ 7.2 Put your copyright and the OFL references in your various font files (such as in TrueType name, description and license fields) and in your other components (build scripts, glyph databases, documentation, keyboard, samples, etc).
175
+ 7.3 Write an initial FONTLOG for your font and include it in the release package.
176
+ 7.4 Include the OFL in your release package.
177
+ 7.5 We also highly recommend you include the relevant practical documentation on the license by putting the OFL-FAQ in your package.
178
+
179
+
180
+ That's all. If you have any more questions please get in touch with us.
181
+
182
+
gentium/OFL.txt ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ This Font Software is Copyright (c) 2003-2005, SIL International (http://scripts.sil.org/).
2
+ All Rights Reserved.
3
+
4
+ "Gentium" is a Reserved Font Name for this Font Software.
5
+ "SIL" is a Reserved Font Name for this Font Software.
6
+
7
+ This Font Software is licensed under the SIL Open Font License, Version 1.0.
8
+ No modification of the license is permitted, only verbatim copy is allowed.
9
+ This license is copied below, and is also available with a FAQ at:
10
+ http://scripts.sil.org/OFL
11
+
12
+
13
+ -----------------------------------------------------------
14
+ SIL OPEN FONT LICENSE Version 1.0 - 22 November 2005
15
+ -----------------------------------------------------------
16
+
17
+ PREAMBLE
18
+ The goals of the Open Font License (OFL) are to stimulate worldwide
19
+ development of cooperative font projects, to support the font creation
20
+ efforts of academic and linguistic communities, and to provide an open
21
+ framework in which fonts may be shared and improved in partnership with
22
+ others.
23
+
24
+ The OFL allows the licensed fonts to be used, studied, modified and
25
+ redistributed freely as long as they are not sold by themselves. The
26
+ fonts, including any derivative works, can be bundled, embedded,
27
+ redistributed and sold with any software provided that the font
28
+ names of derivative works are changed. The fonts and derivatives,
29
+ however, cannot be released under any other type of license.
30
+
31
+ DEFINITIONS
32
+ "Font Software" refers to any and all of the following:
33
+ - font files
34
+ - data files
35
+ - source code
36
+ - build scripts
37
+ - documentation
38
+
39
+ "Reserved Font Name" refers to the Font Software name as seen by
40
+ users and any other names as specified after the copyright statement.
41
+
42
+ "Standard Version" refers to the collection of Font Software
43
+ components as distributed by the Copyright Holder.
44
+
45
+ "Modified Version" refers to any derivative font software made by
46
+ adding to, deleting, or substituting -- in part or in whole --
47
+ any of the components of the Standard Version, by changing formats
48
+ or by porting the Font Software to a new environment.
49
+
50
+ "Author" refers to any designer, engineer, programmer, technical
51
+ writer or other person who contributed to the Font Software.
52
+
53
+ PERMISSION & CONDITIONS
54
+ Permission is hereby granted, free of charge, to any person obtaining
55
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
56
+ redistribute, and sell modified and unmodified copies of the Font
57
+ Software, subject to the following conditions:
58
+
59
+ 1) Neither the Font Software nor any of its individual components,
60
+ in Standard or Modified Versions, may be sold by itself.
61
+
62
+ 2) Standard or Modified Versions of the Font Software may be bundled,
63
+ redistributed and sold with any software, provided that each copy
64
+ contains the above copyright notice and this license. These can be
65
+ included either as stand-alone text files, human-readable headers or
66
+ in the appropriate machine-readable metadata fields within text or
67
+ binary files as long as those fields can be easily viewed by the user.
68
+
69
+ 3) No Modified Version of the Font Software may use the Reserved Font
70
+ Name(s), in part or in whole, unless explicit written permission is
71
+ granted by the Copyright Holder. This restriction applies to all
72
+ references stored in the Font Software, such as the font menu name and
73
+ other font description fields, which are used to differentiate the
74
+ font from others.
75
+
76
+ 4) The name(s) of the Copyright Holder or the Author(s) of the Font
77
+ Software shall not be used to promote, endorse or advertise any
78
+ Modified Version, except to acknowledge the contribution(s) of the
79
+ Copyright Holder and the Author(s) or with their explicit written
80
+ permission.
81
+
82
+ 5) The Font Software, modified or unmodified, in part or in whole,
83
+ must be distributed using this license, and may not be distributed
84
+ under any other license.
85
+
86
+ TERMINATION
87
+ This license becomes null and void if any of the above conditions are
88
+ not met.
89
+
90
+ DISCLAIMER
91
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
92
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
93
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
94
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
95
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
96
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
97
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
98
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
99
+ OTHER DEALINGS IN THE FONT SOFTWARE.
gentium/QUOTES.txt ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ QUOTES
2
+ Gentium Release 1.02
3
+ 28 November 2005
4
+ ========================
5
+
6
+
7
+ Read some of the comments sent to us by various grateful Gentium users:
8
+
9
+
10
+ 'Purpose: to build a free multilingual font to bring better typography to
11
+ thousands of languages around the globe. I can think of no higher calling.'
12
+
13
+ '...an interesting blend of economical use of space, a serious tone of voice
14
+ and a modern informal dress code.'
15
+
16
+ 'Thank you for this fantastic font set -- fantastic both in its purpose and
17
+ in its appearance and usability!'
18
+
19
+ 'Finally I can include Greek characters in my English papers without looking
20
+ typographically schizophrenic!'
21
+
22
+ 'Thank you so much for sharing this amazing work. I do love the vision you
23
+ have for "written word empowering". This is ethical science at its best.'
24
+
25
+ 'Our language restoration project thanks you.'
26
+
27
+ 'distinctive, elegant and readable'
28
+
29
+ 'a very warm look'
30
+
31
+ 'great consistency and legibility'
32
+
33
+ 'lotion for the eyes'
34
+
35
+ 'Your typeface Gentium is a "friendly" font to me. It's easy to read and its
36
+ lines and visual connections flow gently.'
37
+
38
+ 'I needed a nice serif font with haceks and other diacriticals... and was
39
+ very happy to find your Gentium. Thank you for making this available to us
40
+ poorer academic perfectionists!'
41
+
42
+ 'Your font is definitely the most complete and good-looking I've found for
43
+ my uses in Classical Greek.'
44
+
45
+ '...the various letters in the Extended-Latin and IPA ranges look "native"
46
+ to the font.'
47
+
48
+ '...diacritic Nirvana...'
49
+
50
+ 'Thank you very much for this excellent font. It is the most readable I have
51
+ ever seen.'
52
+
53
+ 'Officina Gentium: The workshop of the world.'
54
+
55
+ 'Commercial quality for free! That's the best free font that I see.'
56
+
57
+ 'May I congratulate you on what seems to be an outstanding effort matched
58
+ only by your generosity.'
59
+
60
+ 'I will be using this font regularly and will be recommending it strongly to
61
+ others. This is a very beautiful typeface. What you have done is a most
62
+ generous gift to the world.'
63
+
64
+ 'Many thanks. I have an esthetic dislike of "Times" fonts and a scholar's
65
+ budget. Now I have Gentium and I'm pleased as punch.'
66
+
67
+ 'I appreciate your project, that of making a font suitable for many
68
+ languages, including smaller ones.'
69
+
70
+ 'I am not sure where in the world I will end up, so I need something all
71
+ inclusive. Thanks so much!'
72
+
73
+ 'Thanks for such a beautiful and mind-bogglingly useful typeface!'
74
+
75
+ ...
76
+
gentium/README.txt ADDED
@@ -0,0 +1 @@
 
0
- --------------------------
1
+ README - WINDOWS
 
really-simple-captcha.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Really Simple CAPTCHA
4
+ Plugin URI: http://ideasilo.wordpress.com/2009/03/14/really-simple-captcha/
5
+ Description: Really Simple CAPTCHA is a CAPTCHA module intended to be called from other plugins. It is originally created for my Contact Form 7 plugin.
6
+ Author: Takayuki Miyoshi
7
+ Version: 1.0
8
+ Author URI: http://ideasilo.wordpress.com/
9
+ */
10
+
11
+ /* Copyright 2007-2009 Takayuki Miyoshi (email: takayukister at gmail.com)
12
+
13
+ This program is free software; you can redistribute it and/or modify
14
+ it under the terms of the GNU General Public License as published by
15
+ the Free Software Foundation; either version 2 of the License, or
16
+ (at your option) any later version.
17
+
18
+ This program is distributed in the hope that it will be useful,
19
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ GNU General Public License for more details.
22
+
23
+ You should have received a copy of the GNU General Public License
24
+ along with this program; if not, write to the Free Software
25
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
+ */
27
+
28
+ class ReallySimpleCaptcha {
29
+
30
+ function ReallySimpleCaptcha() {
31
+
32
+ /* Characters you can use in an image */
33
+ $this->chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
34
+
35
+ /* Length of a word in an image */
36
+ $this->char_length = 4;
37
+
38
+ /* Array of fonts. Randomly picked up per character */
39
+ $this->fonts = array(
40
+ dirname(__FILE__) . '/gentium/GenAI102.TTF',
41
+ dirname(__FILE__) . '/gentium/GenAR102.TTF',
42
+ dirname(__FILE__) . '/gentium/GenI102.TTF',
43
+ dirname(__FILE__) . '/gentium/GenR102.TTF');
44
+
45
+ /* Directory CAPTCHA image and corresponding code kept temporary */
46
+ $this->tmp_dir = dirname(__FILE__) . '/tmp/';
47
+
48
+ /* Array of CAPTCHA image size. Width and height */
49
+ $this->img_size = array(72, 24);
50
+
51
+ /* Background color of CAPTCHA image. RGB color 0-255 */
52
+ $this->bg = array(255, 255, 255);
53
+
54
+ /* Foreground (character) color of CAPTCHA image. RGB color 0-255 */
55
+ $this->fg = array(0, 0, 0);
56
+
57
+ /* Coordinates for a text in an image. I don't know the meaning. Just adjust. */
58
+ $this->base = array(6, 18);
59
+
60
+ /* Font size */
61
+ $this->font_size = 14;
62
+
63
+ /* Width of a character */
64
+ $this->font_char_width = 15;
65
+
66
+ /* Image type. 'png', 'gif' or 'jpeg' */
67
+ $this->img_type = 'png';
68
+
69
+ /* Mode of temporary files */
70
+ $this->file_mode = 0755;
71
+ }
72
+
73
+ /* Generate and return random word with $chars characters x $char_length length */
74
+ function generate_random_word() {
75
+ $word = '';
76
+ for ($i = 0; $i < $this->char_length; $i++) {
77
+ $pos = mt_rand(0, strlen($this->chars) - 1);
78
+ $char = $this->chars[$pos];
79
+ $word .= $char;
80
+ }
81
+ return $word;
82
+ }
83
+
84
+ /* Generate CAPTCHA code and corresponding code and save them into $tmp_dir directory.
85
+ $prefix is file prefix for both files. $captcha is a random word usually generated by generate_random_word()
86
+ This function returns the filename of the CAPTCHA image temporary file */
87
+ function generate_image($prefix, $word) {
88
+ $filename = null;
89
+ if ($im = imagecreatetruecolor($this->img_size[0], $this->img_size[1])) {
90
+ $bg = imagecolorallocate($im, $this->bg[0], $this->bg[1], $this->bg[2]);
91
+ $fg = imagecolorallocate($im, $this->fg[0], $this->fg[1], $this->fg[2]);
92
+ imagefill($im, 0, 0, $bg);
93
+ $x = $this->base[0] + mt_rand(-2, 2);
94
+ for ($i = 0; $i < strlen($word); $i++) {
95
+ $font = $this->fonts[array_rand($this->fonts)];
96
+ imagettftext($im, $this->font_size, mt_rand(-2, 2), $x, $this->base[1] + mt_rand(-2, 2), $fg, $font, $word[$i]);
97
+ $x += $this->font_char_width;
98
+ }
99
+ switch ($this->img_type) {
100
+ case 'jpeg':
101
+ $filename = $prefix . '.jpeg';
102
+ imagejpeg($im, $this->tmp_dir . $filename);
103
+ break;
104
+ case 'gif':
105
+ $filename = $prefix . '.gif';
106
+ imagegif($im, $this->tmp_dir . $filename);
107
+ break;
108
+ case 'png':
109
+ default:
110
+ $filename = $prefix . '.png';
111
+ imagepng($im, $this->tmp_dir . $filename);
112
+ }
113
+ imagedestroy($im);
114
+ @chmod($this->tmp_dir . $filename, $this->file_mode);
115
+ }
116
+ if ($fh = fopen($this->tmp_dir . $prefix . '.php', 'w')) {
117
+ @chmod($this->tmp_dir . $prefix . '.php', $this->file_mode);
118
+ fwrite($fh, '<?php $captcha = "' . $word . '"; ?>');
119
+ fclose($fh);
120
+ }
121
+ return $filename;
122
+ }
123
+
124
+ /* Check a $response against the code kept in the temporary file with $prefix
125
+ Return true if the two match, otherwise return false. */
126
+ function check($prefix, $response) {
127
+ if (is_readable($this->tmp_dir . $prefix . '.php')) {
128
+ include($this->tmp_dir . $prefix . '.php');
129
+ if (0 == strcasecmp($response, $captcha))
130
+ return true;
131
+ }
132
+ return false;
133
+ }
134
+
135
+ /* Remove temporary files with $prefix */
136
+ function remove($prefix) {
137
+ $suffixes = array('.jpeg', '.gif', '.png', '.php');
138
+ foreach ($suffixes as $suffix) {
139
+ $file = $this->tmp_dir . $prefix . $suffix;
140
+ if (is_file($file))
141
+ unlink($file);
142
+ }
143
+ }
144
+ }
145
+
146
+ ?>
tmp/index.php ADDED
File without changes