CAPTCHA
Этот коммит содержится в:
@@ -0,0 +1,70 @@
|
||||
OpenType TT Font Installation
|
||||
|
||||
- OpenType TrueType (OT/TT) consists of one file with TTF extension.
|
||||
- OpenType fonts can be installed and used in any version of Windows and on Mac OS X system.
|
||||
- You may install OpenType fonts by the means of operating system or with the help of font management utilities.
|
||||
|
||||
Installing OpenType fonts for common operating systems:
|
||||
|
||||
- - - - - -
|
||||
Windows 95/98/NT/ME
|
||||
|
||||
You may install about 800 fonts maximum in Windows ME, 98, or 95.
|
||||
You may install OpenType/TT fonts by the means of operating system or with the help of font management utilities.
|
||||
Installing OpenType/TT fonts on Windows by means of operating system:
|
||||
Click on Start button and select Settings > Control Panel (or Open My Computer then Control Panel)
|
||||
Open (Double-click) the Fonts folder.
|
||||
Select File - Install New Font.
|
||||
Use the Folders and Drives windows to move to the folder on your hard drive, a floppy disk, or CD where
|
||||
your new fonts are located. (Make sure you have unzipped the files).
|
||||
If you are installing fonts from a floppy or CD be sure the 'Copy fonts to folder' box is checked; otherwise,
|
||||
fonts may not be available to use if the floppy or CD is not in the drive at all times.
|
||||
Highlight the font to install from the List of fonts window. To select more than one font, hold down the
|
||||
CTRL key and click each font. Click OK.
|
||||
After installation, you may need to restart an application or reselect a printer in your application to make
|
||||
the new fonts appear in the font list.
|
||||
|
||||
- - - - - - -
|
||||
Windows 2000/XP/Vista/Windows 7
|
||||
|
||||
These Windows versions have built-in support for OpenType fonts. Installation procedure is identical for
|
||||
all formats.
|
||||
Open Control Panel.
|
||||
In Windows 2000 double-click on My Computer. Then double-click on the Control Panel icon.
|
||||
In Windows XP and later click on Start button and then on Control Panel.
|
||||
Double-click on the Fonts icon in Control Panel window.
|
||||
In the Fonts window, select the File menu, and choose Install New Font.
|
||||
Navigate to the folder that contains fonts you want to install.
|
||||
Select fonts you want to install. You can click to select one font, Control-click to select several fonts, or Shift-click
|
||||
to select a contiguous group of fonts.
|
||||
Press the "OK" button to install the fonts.
|
||||
Close the Fonts control panel.
|
||||
After installation, you may need to restart an application or reselect a printer in your application to make the new fonts
|
||||
appear in the font list.
|
||||
|
||||
- - - - - -
|
||||
Mac OS 7.x-9.x
|
||||
|
||||
DOES NOT SUPPORT OT/TT.
|
||||
|
||||
- - - - - -
|
||||
Mac OS X
|
||||
|
||||
An OpenType font consists of one Suitcase file.
|
||||
You may install fonts by means of operating system or with the help of font management utilities. To install with a font
|
||||
management applications like Adobe Type Manager, Suitcase or Font Reserve, please consult the product manual.
|
||||
Font installation on Mac is a simple drag and drop operation.
|
||||
Close any open applications before installing fonts. New fonts do not appear in the font menu in some applications,
|
||||
if you install them while an application is open.
|
||||
Open the folder with fonts to install.
|
||||
Make sure you are selecting fonts themselves, not a folder containing fonts.
|
||||
Drag the selection to the Fonts folder inside the Library folder (see details below) on Mac OS X disk.
|
||||
If you want fonts to be available to applications running in Classic mode, you must also install the fonts into the
|
||||
Fonts folder inside the Classic System Folder.
|
||||
|
||||
- - - - - -
|
||||
Read more about OpenType fonts installation on our website:
|
||||
http://www.paratype.com/help/finst/
|
||||
|
||||
OpenType Overview
|
||||
http://www.paratype.com/help/formats/opentype.asp
|
||||
@@ -0,0 +1,55 @@
|
||||
Установка шрифтов OpenType TT.
|
||||
|
||||
- Шрифты OpenType на основе TrueType (OT/TT) состоят из одного файла с расширением TTF.
|
||||
- Шрифты OpenType могут быть установлены на любой версии Windows, а также на Mac OS 10.x.
|
||||
- Шрифты OpenType можно инсталлировать средствами операционной системы или с помощью
|
||||
шрифтовой утилиты Adobe Type Manager.
|
||||
|
||||
Инструкции по установке шрифтов в различных системах:
|
||||
- - - - - -
|
||||
Windows 95/98/NT/ME
|
||||
|
||||
Максимальное количество установленных шрифтов - 800.
|
||||
Установка шрифтов производится либо средствами ОС, либо с использованием специальных программ.
|
||||
Установка шрифтов OpenType TT в Windows средствами ОС:
|
||||
Откройте Пуск - Настройка - Панель управления.
|
||||
Откройте папку Шрифты.
|
||||
Выберите Файл - Установить новый шрифт.
|
||||
Найдите и откройте папку, в которой находится файлы шрифтов.
|
||||
Щёлкните мышью по появившимся именам шрифтов из Списка шрифтов. Чтобы выделить более одного шрифта,
|
||||
удерживайте клавишу CTRL и выделяйте мышью каждый шрифт. Нажмите ОК.
|
||||
После инсталляции необходимо перезапустить приложения или заново выбрать принтер в приложении с тем,
|
||||
чтобы новые шрифты появились в шрифтовом меню.
|
||||
- - - - - - -
|
||||
Windows 2000/XP/Vista/Windows 7
|
||||
|
||||
Эти версии Windows имеют встроенную поддержу OpenType шрифтов.
|
||||
Откройте Пуск - Настройка - Панель управления.
|
||||
Откройте папку Шрифты в Панели управления.
|
||||
Выберите Файл - Установить новый шрифт.
|
||||
Найдите и откройте папку, в которой находится файлы шрифтов.
|
||||
Щёлкните мышью по появившимся именам шрифтов из Списка шрифтов. Чтобы выделить более одного шрифта,
|
||||
удерживайте клавишу CTRL и выделяйте мышью каждый шрифт. Нажмите ОК.
|
||||
После инсталляции необходимо перезапустить приложения или заново выбрать принтер в приложении с тем,
|
||||
чтобы новые шрифты появились в шрифтовом меню.
|
||||
- - - - - -
|
||||
Mac OS 7.x-9.x
|
||||
|
||||
Не поддерживает OT/TT.
|
||||
- - - - - -
|
||||
Mac OS X
|
||||
|
||||
OpenType шрифт состоит из одного "чемодана".
|
||||
Шрифты OpenType можно инсталлировать средствами операционной системы или с помощью шрифтовой утилиты
|
||||
Adobe Type Manager. Установка шрифтов в ОС Mac - простая операция.
|
||||
Закройте все приложения перед установкой. Новые шрифты не появляются в некоторых шрифтовых меню, если
|
||||
установка выполняется при активном приложении. Откройте папку со шрифтами.
|
||||
Убедитесь, что вы выделяете шрифты, а не папку со шрифтами.
|
||||
Перетащите выделенные шрифты в папку Library, находящуюся на диске Mac OS X.
|
||||
- - - - - -
|
||||
|
||||
Подробнее об установке OpenType шрифтов вы можете прочитать на сайте компании ПараТайп:
|
||||
http://www.paratype.com/help/finst/
|
||||
|
||||
Обзор шрифтов OpenType:
|
||||
http://www.paratype.com/help/formats/opentype.asp
|
||||
@@ -0,0 +1,44 @@
|
||||
Copyright (c) 2009, ParaType Ltd. All Rights Reserved.
|
||||
|
||||
LICENSING AGREEMENT
|
||||
for the fonts with Original Name: PT Sans, PT Serif
|
||||
Version 1.2 - December 23, 2010
|
||||
|
||||
GRANT OF LICENSE
|
||||
ParaType Ltd grants you the right to use, copy, modify the fonts and distribute
|
||||
modified and unmodified copies of the fonts by any means, including placing
|
||||
on Web servers for free downloading, embedding in documents and Web pages,
|
||||
bundling with commercial and non commercial products, if it does not conflict
|
||||
with the conditions listed below:
|
||||
|
||||
- You may bundle the font with commercial software, but you may not sell the
|
||||
fonts by themselves. They are free.
|
||||
|
||||
- You may distribute the fonts in modified or unmodified version only together
|
||||
with this Licensing Agreement and with above copyright notice. You have no
|
||||
right to modify the text of Licensing Agreement. It can be placed in a separate
|
||||
text file or inserted into the font file, but it must be easily viewed by users.
|
||||
|
||||
- You may not distribute modified version of the font under the Original name
|
||||
or à combination of Original name with any other words without explicit written
|
||||
permission from ParaType.
|
||||
|
||||
TERMINATION & TERRITORY
|
||||
This license has no limits on time and territory, but it becomes null and void
|
||||
if any of the above conditions are not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
||||
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK,
|
||||
OR OTHER RIGHT. IN NO EVENT SHALL PARATYPE BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
|
||||
INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
||||
OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
|
||||
DEALINGS IN THE FONT SOFTWARE.
|
||||
|
||||
ParaType Ltd
|
||||
http://www.paratype.ru
|
||||
|
||||
Двоичные данные
Двоичный файл не отображается.
Двоичные данные
Двоичный файл не отображается.
Двоичные данные
Двоичный файл не отображается.
Двоичные данные
Двоичный файл не отображается.
Двоичные данные
Двоичный файл не отображается.
Двоичные данные
Двоичный файл не отображается.
Двоичные данные
Двоичный файл не отображается.
Двоичные данные
Двоичный файл не отображается.
|
После Ширина: | Высота: | Размер: 24 KiB |
Двоичные данные
Двоичный файл не отображается.
|
После Ширина: | Высота: | Размер: 44 KiB |
Двоичные данные
Двоичный файл не отображается.
|
После Ширина: | Высота: | Размер: 43 KiB |
Двоичные данные
Двоичный файл не отображается.
|
После Ширина: | Высота: | Размер: 8.9 KiB |
Двоичные данные
Двоичный файл не отображается.
|
После Ширина: | Высота: | Размер: 13 KiB |
@@ -7,11 +7,21 @@
|
||||
*/
|
||||
|
||||
namespace PTEST\C;
|
||||
use PFRM\Controller;
|
||||
use PFRM\View as View;
|
||||
use PTEST\M\CAPTCHAModel as Model;
|
||||
|
||||
|
||||
class CAPTCHAController {
|
||||
class CAPTCHAController extends Controller{
|
||||
|
||||
public function indexAction() {
|
||||
|
||||
$view = new View('CAPTCHA');
|
||||
$view->setHTTPHeader('Content-Type: image/png');
|
||||
$view->setHTTPHeader('Cache-Control: max-age=0, no-cache, no-store');
|
||||
$view->setHTTPHeader('Pragma: no-cache');
|
||||
$model = new Model();
|
||||
$view->image = $model->getImage();
|
||||
$_SESSION['CAPTCHA'] = $model->code;
|
||||
$view->render();
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
* Time: 00:20
|
||||
*/
|
||||
|
||||
namespace PTEST\Model;
|
||||
namespace PTEST\M;
|
||||
|
||||
|
||||
class AdModel {
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Игорь
|
||||
* Date: 24.01.2017
|
||||
* Time: 00:37
|
||||
*/
|
||||
|
||||
namespace PTEST\M;
|
||||
|
||||
|
||||
class CAPTCHAModel {
|
||||
|
||||
public $code;
|
||||
|
||||
public function getImage() {
|
||||
global $app;
|
||||
$letters = 'ABDEFABDEFGKLMNPRSTWXYZ482GKLMNABDEFGKLMNPRSTWXYZ482PRSTWXYZ482'; // алфавит
|
||||
|
||||
$length = 6; //длина текста
|
||||
$height = 60*2;
|
||||
|
||||
$fonts_arr = [
|
||||
$app->config->public_dir . 'font/PTF55F.ttf',
|
||||
$app->config->public_dir . 'font/PTF56F.ttf',
|
||||
$app->config->public_dir . 'font/PTF75F.ttf',
|
||||
$app->config->public_dir . 'font/PTF76F.ttf',
|
||||
$app->config->public_dir . 'font/PTZ55F.ttf',
|
||||
$app->config->public_dir . 'font/PTZ56F.ttf',
|
||||
];
|
||||
$fontsize_base = 36;// размер текста
|
||||
|
||||
$image = imagecreatefrompng($app->config->public_dir . 'image/CAPTCHA_' . rand(0,4) .'.png');
|
||||
|
||||
$captcha = '';
|
||||
|
||||
for ($i = 0; $i < $length; $i++)
|
||||
{
|
||||
$fontsize = rand($fontsize_base - 2, $fontsize_base + 2) ;
|
||||
$captcha .= $letters[ rand(0, strlen($letters)-1) ];
|
||||
$x = ($i + 1) * ($fontsize + 5 );
|
||||
$x = rand($x, $x+6);
|
||||
$y = $height - ( ($height - $fontsize) / 2 ) + rand(-8,16);
|
||||
$curcolor = imagecolorallocate( $image, rand(50, 127), rand(0, 127), rand(0, 127) );
|
||||
|
||||
//шум
|
||||
imageellipse($image, rand($x - 32 ,$x + 32), $y, rand(16,32), rand(16,52), $curcolor);
|
||||
imageellipse($image, $x, rand($y - 16 ,$y + 16), rand(16,52), rand(16,32), $curcolor);
|
||||
|
||||
$angle = rand(-25, 25);
|
||||
|
||||
imagettftext($image, $fontsize, $angle, $x, $y, $curcolor, $fonts_arr[rand(0,5)], $captcha[$i]);
|
||||
}
|
||||
|
||||
|
||||
ob_start();
|
||||
imagepng($image);
|
||||
$image_data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
$this->code = $captcha;
|
||||
|
||||
return $image_data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
echo $this->image;
|
||||
@@ -27,7 +27,7 @@ $app->config = (object) [
|
||||
"site_name" => "Доска объявлений"
|
||||
];
|
||||
|
||||
$app->setRoute( '/^\/CAPTCHA.png$/', 'CAPTCHA' );
|
||||
$app->setRoute( '/^\/CAPTCHA.png\?*\d*$/', 'CAPTCHA' );
|
||||
$app->setRoute( '|^/page/(?<id>\d+)/$|', 'Index', 'page');
|
||||
$app->setRoute( '/^.*$/', 'error404' );
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user