font.php

来自「Bug tracker, and reporter.」· PHP 代码 · 共 776 行 · 第 1/2 页

PHP
776
字号
<?php/** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://framework.zend.com/license/new-bsd * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@zend.com so we can send you a copy immediately. * * @package    Zend_Pdf * @subpackage Fonts * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) * @license    http://framework.zend.com/license/new-bsd     New BSD License *//** Zend_Pdf_FileParserDataSource */require_once 'Zend/Pdf/FileParserDataSource.php';/** Zend_Pdf_FileParserDataSource_File */require_once 'Zend/Pdf/FileParserDataSource/File.php';/** Zend_Pdf_FileParserDataSource_String */require_once 'Zend/Pdf/FileParserDataSource/String.php';/** Zend_Pdf_FileParser_Font_OpenType_TrueType */require_once 'Zend/Pdf/FileParser/Font/OpenType/TrueType.php';/** Zend_Pdf_Resource_Font_Simple_Parsed_TrueType */require_once 'Zend/Pdf/Resource/Font/Simple/Parsed/TrueType.php';
/** Zend_Pdf_Resource_Font_Type0 */
require_once 'Zend/Pdf/Resource/Font/Type0.php';

/** Zend_Pdf_Resource_Font_CidFont_TrueType */
require_once 'Zend/Pdf/Resource/Font/CidFont/TrueType.php';
/** Zend_Pdf_Resource_Font_Simple_Standard_Courier */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/Courier.php';/** Zend_Pdf_Resource_Font_Simple_Standard_CourierBold */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/CourierBold.php';/** Zend_Pdf_Resource_Font_Simple_Standard_CourierBoldOblique */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/CourierBoldOblique.php';/** Zend_Pdf_Resource_Font_Simple_Standard_CourierOblique */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/CourierOblique.php';/** Zend_Pdf_Resource_Font_Simple_Standard_Helvetica */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/Helvetica.php';/** Zend_Pdf_Resource_Font_Simple_Standard_HelveticaBold */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/HelveticaBold.php';/** Zend_Pdf_Resource_Font_Simple_Standard_HelveticaBoldOblique */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/HelveticaBoldOblique.php';/** Zend_Pdf_Resource_Font_Simple_Standard_HelveticaOblique */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/HelveticaOblique.php';/** Zend_Pdf_Resource_Font_Simple_Standard_Symbol */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/Symbol.php';/** Zend_Pdf_Resource_Font_Simple_Standard_TimesBold */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/TimesBold.php';/** Zend_Pdf_Resource_Font_Simple_Standard_TimesBoldItalic */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/TimesBoldItalic.php';/** Zend_Pdf_Resource_Font_Simple_Standard_TimesItalic */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/TimesItalic.php';/** Zend_Pdf_Resource_Font_Simple_Standard_TimesRoman */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/TimesRoman.php';/** Zend_Pdf_Resource_Font_Simple_Standard_ZapfDingbats */require_once 'Zend/Pdf/Resource/Font/Simple/Standard/ZapfDingbats.php';
/** Zend_Pdf_Resource_Font_Extracted */
require_once 'Zend/Pdf/Resource/Font/Extracted.php';
/** * Abstract factory class which vends {@link Zend_Pdf_Resource_Font} objects. * * Font objects themselves are normally instantiated through the factory methods * {@link fontWithName()} or {@link fontWithPath()}. * * This class is also the home for font-related constants because the name of * the true base class ({@link Zend_Pdf_Resource_Font}) is not intuitive for the * end user. * * @package    Zend_Pdf * @subpackage Fonts * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) * @license    http://framework.zend.com/license/new-bsd     New BSD License */abstract class Zend_Pdf_Font{  /**** Class Constants ****/  /* Font Types */    /**     * Unknown font type.     */    const TYPE_UNKNOWN = 0;    /**     * One of the standard 14 PDF fonts.     */    const TYPE_STANDARD = 1;    /**     * A PostScript Type 1 font.     */    const TYPE_TYPE_1 = 2;    /**     * A TrueType font or an OpenType font containing TrueType outlines.     */    const TYPE_TRUETYPE = 3;
    /**
     * Type 0 composite font.
     */
    const TYPE_TYPE_0 = 4;
    
    /**
     * CID font containing a PostScript Type 1 font.
     * These fonts are used only to construct Type 0 composite fonts and can't be used directly
     */
    const TYPE_CIDFONT_TYPE_0 = 5;

    /**
     * CID font containing a TrueType font or an OpenType font containing TrueType outlines.
     * These fonts are used only to construct Type 0 composite fonts and can't be used directly
     */
    const TYPE_CIDFONT_TYPE_2 = 6;
      /* Names of the Standard 14 PDF Fonts */    /**     * Name of the standard PDF font Courier.     */    const FONT_COURIER = 'Courier';    /**     * Name of the bold style of the standard PDF font Courier.     */    const FONT_COURIER_BOLD = 'Courier-Bold';    /**     * Name of the italic style of the standard PDF font Courier.     */    const FONT_COURIER_OBLIQUE = 'Courier-Oblique';    /**     * Convenience constant for a common misspelling of     * {@link FONT_COURIER_OBLIQUE}.     */    const FONT_COURIER_ITALIC = 'Courier-Oblique';    /**     * Name of the bold and italic style of the standard PDF font Courier.     */    const FONT_COURIER_BOLD_OBLIQUE = 'Courier-BoldOblique';    /**     * Convenience constant for a common misspelling of     * {@link FONT_COURIER_BOLD_OBLIQUE}.     */    const FONT_COURIER_BOLD_ITALIC = 'Courier-BoldOblique';    /**     * Name of the standard PDF font Helvetica.     */    const FONT_HELVETICA = 'Helvetica';    /**     * Name of the bold style of the standard PDF font Helvetica.     */    const FONT_HELVETICA_BOLD = 'Helvetica-Bold';    /**     * Name of the italic style of the standard PDF font Helvetica.     */    const FONT_HELVETICA_OBLIQUE = 'Helvetica-Oblique';    /**     * Convenience constant for a common misspelling of     * {@link FONT_HELVETICA_OBLIQUE}.     */    const FONT_HELVETICA_ITALIC = 'Helvetica-Oblique';    /**     * Name of the bold and italic style of the standard PDF font Helvetica.     */    const FONT_HELVETICA_BOLD_OBLIQUE = 'Helvetica-BoldOblique';    /**     * Convenience constant for a common misspelling of     * {@link FONT_HELVETICA_BOLD_OBLIQUE}.     */    const FONT_HELVETICA_BOLD_ITALIC = 'Helvetica-BoldOblique';    /**     * Name of the standard PDF font Symbol.     */    const FONT_SYMBOL = 'Symbol';    /**     * Name of the standard PDF font Times.     */    const FONT_TIMES_ROMAN = 'Times-Roman';    /**     * Convenience constant for a common misspelling of     * {@link FONT_TIMES_ROMAN}.     */    const FONT_TIMES = 'Times-Roman';    /**     * Name of the bold style of the standard PDF font Times.     */    const FONT_TIMES_BOLD = 'Times-Bold';    /**     * Name of the italic style of the standard PDF font Times.     */    const FONT_TIMES_ITALIC = 'Times-Italic';    /**     * Name of the bold and italic style of the standard PDF font Times.     */    const FONT_TIMES_BOLD_ITALIC = 'Times-BoldItalic';    /**     * Name of the standard PDF font Zapf Dingbats.     */    const FONT_ZAPFDINGBATS = 'ZapfDingbats';  /* Font Name String Types */    /**     * Full copyright notice for the font.     */    const NAME_COPYRIGHT =  0;    /**     * Font family name. Used to group similar styles of fonts together.     */    const NAME_FAMILY =  1;    /**     * Font style within the font family. Examples: Regular, Italic, Bold, etc.     */    const NAME_STYLE =  2;    /**     * Unique font identifier.     */    const NAME_ID =  3;    /**     * Full font name. Usually a combination of the {@link NAME_FAMILY} and     * {@link NAME_STYLE} strings.     */    const NAME_FULL =  4;    /**     * Version number of the font.     */    const NAME_VERSION =  5;    /**     * PostScript name for the font. This is the name used to identify fonts     * internally and within the PDF file.     */    const NAME_POSTSCRIPT =  6;    /**     * Font trademark notice. This is distinct from the {@link NAME_COPYRIGHT}.     */    const NAME_TRADEMARK =  7;    /**     * Name of the font manufacturer.     */    const NAME_MANUFACTURER =  8;    /**     * Name of the designer of the font.     */    const NAME_DESIGNER =  9;    /**     * Description of the font. May contain revision information, usage     * recommendations, features, etc.     */    const NAME_DESCRIPTION = 10;    /**     * URL of the font vendor. Some fonts may contain a unique serial number     * embedded in this URL, which is used for licensing.     */    const NAME_VENDOR_URL = 11;    /**     * URL of the font designer ({@link NAME_DESIGNER}).     */    const NAME_DESIGNER_URL = 12;    /**     * Plain language licensing terms for the font.     */    const NAME_LICENSE = 13;    /**     * URL of more detailed licensing information for the font.     */    const NAME_LICENSE_URL = 14;    /**     * Preferred font family. Used by some fonts to work around a Microsoft     * Windows limitation where only four fonts styles can share the same     * {@link NAME_FAMILY} value.     */    const NAME_PREFERRED_FAMILY = 16;    /**     * Preferred font style. A more descriptive string than {@link NAME_STYLE}.     */    const NAME_PREFERRED_STYLE = 17;    /**     * Suggested text to use as a representative sample of the font.     */    const NAME_SAMPLE_TEXT = 19;    /**     * PostScript CID findfont name.     */    const NAME_CID_NAME = 20;  /* Font Weights */    /**     * Thin font weight.     */    const WEIGHT_THIN = 100;    /**     * Extra-light (Ultra-light) font weight.     */    const WEIGHT_EXTRA_LIGHT = 200;    /**     * Light font weight.     */    const WEIGHT_LIGHT = 300;    /**     * Normal (Regular) font weight.     */    const WEIGHT_NORMAL = 400;    /**     * Medium font weight.     */    const WEIGHT_MEDIUM = 500;    /**     * Semi-bold (Demi-bold) font weight.     */    const WEIGHT_SEMI_BOLD = 600;    /**     * Bold font weight.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?