home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / delphi / kompon / d3456 / POWERPDF.ZIP / PowerPdf / PdfFonts.pas < prev    next >
Pascal/Delphi Source File  |  2001-09-15  |  37KB  |  908 lines

  1. {*
  2.  * << P o w e r P d f >> -- PdfFonts.pas
  3.  *
  4.  * << Standerd font set for WinAnsiEncoding Charactors >>
  5.  *
  6.  * Copyright (c) 1999-2001 Takezou. <takeshi_kanno@est.hi-ho.ne.jp>
  7.  *
  8.  * This library is free software; you can redistribute it and/or modify it
  9.  * under the terms of the GNU Library General Public License as published
  10.  * by the Free Software Foundation; either version 2 of the License, or any
  11.  * later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful, but WITHOUT
  14.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15.  * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more
  16.  * details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public License
  19.  * along with this library.
  20.  *
  21.  * Create 2000.09.14
  22.  *
  23.  *}
  24. unit PdfFonts;
  25.  
  26. interface
  27.  
  28. uses
  29.   SysUtils, Classes, PdfDoc, PdfTypes;
  30.  
  31. const
  32.   TYPE1_FONT_STR_TABLE: array[0..2] of TPDF_STR_TBL =(
  33.                          (KEY: 'Type'; VAL: 'Font'),
  34.                          (KEY: 'Subtype'; VAL: 'Type1'),
  35.                          (KEY: 'Encoding'; VAL: 'WinAnsiEncoding')
  36.                          );
  37.  
  38.   // FixedWidth defination
  39.   FIXED_WIDTH_W_ARRAY: array[32..255] of Integer = (
  40.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  41.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  42.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  43.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  44.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  45.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  46.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  47.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  48.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  49.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  50.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  51.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  52.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  53.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  54.     600,600);
  55.  
  56.   FIXED_WIDTH_INT_TABLE: array[0..1] of TPDF_INT_TBL =(
  57.                        (KEY: 'FirstChar'; VAL: 32),
  58.                        (KEY: 'LastChar'; VAL: 255)
  59.                          );
  60.  
  61.   FIXED_WIDTH_DISC_STR_TABLE: array[0..2] of TPDF_STR_TBL =(
  62.                          (KEY: 'Type'; VAL: 'FontDescriptor'),
  63.                          (KEY: 'FontName'; VAL: 'Type1'),
  64.                          (KEY: 'Encoding'; VAL: 'WinAnsiEncoding')
  65.                          );
  66.  
  67.   FIXED_WIDTH_DISC_INT_TABLE: array[0..6] of TPDF_INT_TBL =(
  68.                          (KEY: 'Ascent'; VAL: 833),
  69.                          (KEY: 'CapHeight'; VAL: 833),
  70.                          (KEY: 'Descent'; VAL: -300),
  71.                          (KEY: 'Flags'; VAL: PDF_FONT_STD_CHARSET + PDF_FONT_FIXED_WIDTH),
  72.                          (KEY: 'ItalicAngle'; VAL: -15),
  73.                          (KEY: 'StemV'; VAL: 78),
  74.                          (KEY: 'MissingWidth'; VAL: 600));
  75.  
  76.   FIXED_WIDTH_BBOX: array[0..3] of Integer = (-103,-300,836,833);
  77.  
  78.   // FixedWidth-Bold defination
  79.  
  80.   FIXED_WIDTH_BOLD_W_ARRAY: array[32..255] of Integer = (
  81.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  82.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  83.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  84.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  85.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  86.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  87.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  88.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  89.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  90.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  91.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  92.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  93.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  94.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  95.     600,600);
  96.  
  97.   FIXED_WIDTH_BOLD_DISC_INT_TABLE: array[0..6] of TPDF_INT_TBL =(
  98.                          (KEY: 'Ascent'; VAL: 833),
  99.                          (KEY: 'CapHeight'; VAL: 833),
  100.                          (KEY: 'Descent'; VAL: -300),
  101.                          (KEY: 'Flags'; VAL: PDF_FONT_STD_CHARSET +
  102.                            PDF_FONT_FOURCE_BOLD + PDF_FONT_FIXED_WIDTH),
  103.                          (KEY: 'ItalicAngle'; VAL: 0),
  104.                          (KEY: 'StemV'; VAL: 156),
  105.                          (KEY: 'MissingWidth'; VAL: 600));
  106.  
  107.   FIXED_WIDTH_BOLD_BBOX: array[0..3] of Integer = (-46,-300,702,833);
  108.  
  109.   // FixedWidth-Italic defination
  110.  
  111.   FIXED_WIDTH_ITALIC_W_ARRAY: array[32..255] of Integer = (
  112.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  113.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  114.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  115.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  116.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  117.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  118.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  119.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  120.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  121.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  122.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  123.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  124.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  125.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  126.     600,600);
  127.  
  128.   FIXED_WIDTH_ITALIC_DISC_INT_TABLE: array[0..6] of TPDF_INT_TBL =(
  129.                          (KEY: 'Ascent'; VAL: 833),
  130.                          (KEY: 'CapHeight'; VAL: 833),
  131.                          (KEY: 'Descent'; VAL: -300),
  132.                          (KEY: 'Flags'; VAL: PDF_FONT_STD_CHARSET +
  133.                            PDF_FONT_FIXED_WIDTH),
  134.                          (KEY: 'ItalicAngle'; VAL: -15),
  135.                          (KEY: 'StemV'; VAL: 78),
  136.                          (KEY: 'MissingWidth'; VAL: 600));
  137.  
  138.   FIXED_WIDTH_ITALIC_BBOX: array[0..3] of Integer = (-67,-300,800,833);
  139.  
  140.   // FixedWidth-BoldItalic defination
  141.  
  142.   FIXED_WIDTH_BOLDITALIC_W_ARRAY: array[32..255] of Integer = (
  143.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  144.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  145.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  146.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  147.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  148.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  149.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  150.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  151.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  152.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  153.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  154.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  155.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  156.     600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,
  157.     600,600);
  158.  
  159.   FIXED_WIDTH_BOLDITALIC_DISC_INT_TABLE: array[0..6] of TPDF_INT_TBL =(
  160.                          (KEY: 'Ascent'; VAL: 833),
  161.                          (KEY: 'CapHeight'; VAL: 833),
  162.                          (KEY: 'Descent'; VAL: -300),
  163.                          (KEY: 'Flags'; VAL: PDF_FONT_STD_CHARSET +
  164.                              PDF_FONT_FIXED_WIDTH + PDF_FONT_FOURCE_BOLD),
  165.                          (KEY: 'ItalicAngle'; VAL: -15),
  166.                          (KEY: 'StemV'; VAL: 156),
  167.                          (KEY: 'MissingWidth'; VAL: 600));
  168.  
  169.   FIXED_WIDTH_BOLDITALIC_BBOX: array[0..3] of Integer = (-103,-300,836,833);
  170.  
  171.   // Arial definition
  172.  
  173.   ARIAL_W_ARRAY: array[32..255] of Integer = (
  174.     278,278,355,556,556,889,667,191,333,333,389,584,278,333,
  175.     278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,
  176.     584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,
  177.     722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,
  178.     469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,
  179.     556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,
  180.     584,0,556,0,222,556,333,1000,556,556,333,1000,667,333,1000,0,
  181.     611,0,0,222,222,333,333,350,556,1000,333,1000,500,333,944,0,
  182.     500,667,0,333,556,556,556,556,260,556,333,737,370,556,584,0,
  183.     737,333,400,584,333,333,333,556,537,278,333,333,365,556,834,834,
  184.     834,611,667,667,667,667,667,667,1000,722,667,667,667,667,278,278,
  185.     278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,
  186.     667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,
  187.     278,278,556,556,556,556,556,556,556,584,611,556,556,556,556,500,
  188.     556,500);
  189.  
  190.  
  191.   ARIAL_INT_TABLE: array[0..1] of TPDF_INT_TBL = (
  192.                        (KEY: 'FirstChar'; VAL: 32),
  193.                        (KEY: 'LastChar'; VAL: 255)
  194.                        );
  195.  
  196.   ARIAL_DISC_STR_TABLE: array[0..2] of TPDF_STR_TBL = (
  197.                          (KEY: 'Type'; VAL: 'FontDescriptor'),
  198.                          (KEY: 'FontName'; VAL: 'Type1'),
  199.                          (KEY: 'Encoding'; VAL: 'WinAnsiEncoding')
  200.                          );
  201.  
  202.   ARIAL_DISC_INT_TABLE: array[0..6] of TPDF_INT_TBL = (
  203.                          (KEY: 'Ascent'; VAL: 905),
  204.                          (KEY: 'CapHeight'; VAL: 905),
  205.                          (KEY: 'Descent'; VAL: -212),
  206.                          (KEY: 'Flags'; VAL: PDF_FONT_STD_CHARSET),
  207.                          (KEY: 'ItalicAngle'; VAL: 0),
  208.                          (KEY: 'StemV'; VAL: 78),
  209.                          (KEY: 'MissingWidth'; VAL: 750)
  210.                          );
  211.  
  212.   ARIAL_BBOX: array[0..3] of Integer = (-166,-225,1000,931);
  213.  
  214.   // Arial-Bold definition
  215.  
  216.   ARIAL_BOLD_W_ARRAY: array[32..255] of Integer = (
  217.     278,333,474,556,556,889,722,238,333,333,389,584,278,333,
  218.     278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,
  219.     584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,
  220.     722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,
  221.     584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,
  222.     611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,
  223.     584,0,556,0,278,556,500,1000,556,556,333,1000,667,333,1000,0,
  224.     611,0,0,278,278,500,500,350,556,1000,333,1000,556,333,944,0,
  225.     500,667,0,333,556,556,556,556,280,556,333,737,370,556,584,0,
  226.     737,333,400,584,333,333,333,611,556,278,333,333,365,556,834,834,
  227.     834,611,722,722,722,722,722,722,1000,722,667,667,667,667,278,278,
  228.     278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,
  229.     667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,
  230.     278,278,611,611,611,611,611,611,611,584,611,611,611,611,611,556,
  231.     611,556);
  232.  
  233.   ARIAL_BOLD_DISC_INT_TABLE: array[0..6] of TPDF_INT_TBL =(
  234.                          (KEY: 'Ascent'; VAL: 905),
  235.                          (KEY: 'CapHeight'; VAL: 905),
  236.                          (KEY: 'Descent'; VAL: -212),
  237.                          (KEY: 'Flags'; VAL: PDF_FONT_STD_CHARSET +
  238.                            PDF_FONT_FOURCE_BOLD),
  239.                          (KEY: 'ItalicAngle'; VAL: 0),
  240.                          (KEY: 'StemV'; VAL: 156),
  241.                          (KEY: 'MissingWidth'; VAL: 750)
  242.                          );
  243.  
  244.   ARIAL_BOLD_BBOX: array[0..3] of Integer = (-170,-228,1003,962);
  245.  
  246.   // Arial-Italic definition
  247.  
  248.   ARIAL_ITALIC_W_ARRAY: array[32..255] of Integer = (
  249.     278,278,355,556,556,889,667,191,333,333,389,584,278,333,
  250.     278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,
  251.     584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,
  252.     722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,
  253.     469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,
  254.     556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,
  255.     584,0,556,0,222,556,333,1000,556,556,333,1000,667,333,1000,0,
  256.     611,0,0,222,222,333,333,350,556,1000,333,1000,500,333,944,0,
  257.     500,667,0,333,556,556,556,556,260,556,333,737,370,556,584,0,
  258.     737,333,400,584,333,333,333,556,537,278,333,333,365,556,834,834,
  259.     834,611,667,667,667,667,667,667,1000,722,667,667,667,667,278,278,
  260.     278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,
  261.     667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,
  262.     278,278,556,556,556,556,556,556,556,584,611,556,556,556,556,500,
  263.     556,500);
  264.  
  265.   ARIAL_ITALIC_DISC_STR_TABLE: array[0..2] of TPDF_STR_TBL =(
  266.                          (KEY: 'Type'; VAL: 'FontDescriptor'),
  267.                          (KEY: 'FontName'; VAL: 'Type1'),
  268.                          (KEY: 'Encoding'; VAL: 'WinAnsiEncoding')
  269.                          );
  270.  
  271.   ARIAL_ITALIC_DISC_INT_TABLE: array[0..6] of TPDF_INT_TBL =(
  272.                          (KEY: 'Ascent'; VAL: 905),
  273.                          (KEY: 'CapHeight'; VAL: 905),
  274.                          (KEY: 'Descent'; VAL: -212),
  275.                          (KEY: 'Flags'; VAL: PDF_FONT_STD_CHARSET),
  276.                          (KEY: 'ItalicAngle'; VAL: -15),
  277.                          (KEY: 'StemV'; VAL: 78),
  278.                          (KEY: 'MissingWidth'; VAL: 750)
  279.                          );
  280.  
  281.   ARIAL_ITALIC_BBOX: array[0..3] of Integer = (-170,-225,1116,931);
  282.  
  283.   // Arial-BoldItalic definition
  284.  
  285.   ARIAL_BOLDITALIC_W_ARRAY: array[32..255] of Integer = (
  286.     278,333,474,556,556,889,722,238,333,333,389,584,278,333,
  287.     278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,
  288.     584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,
  289.     722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,
  290.     584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,
  291.     611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,
  292.     584,0,556,0,278,556,500,1000,556,556,333,1000,667,333,1000,0,
  293.     611,0,0,278,278,500,500,350,556,1000,333,1000,556,333,944,0,
  294.     500,667,0,333,556,556,556,556,280,556,333,737,370,556,584,0,
  295.     737,333,400,584,333,333,333,611,556,278,333,333,365,556,834,834,
  296.     834,611,722,722,722,722,722,722,1000,722,667,667,667,667,278,278,
  297.     278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,
  298.     667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,
  299.     278,278,611,611,611,611,611,611,611,584,611,611,611,611,611,556,
  300.     611,556);
  301.  
  302.   ARIAL_BOLDITALIC_DISC_INT_TABLE: array[0..6] of TPDF_INT_TBL =(
  303.                          (KEY: 'Ascent'; VAL: 905),
  304.                          (KEY: 'CapHeight'; VAL: 905),
  305.                          (KEY: 'Descent'; VAL: -212),
  306.                          (KEY: 'Flags'; VAL: PDF_FONT_STD_CHARSET +
  307.                            PDF_FONT_FOURCE_BOLD),
  308.                          (KEY: 'ItalicAngle'; VAL: -15),
  309.                          (KEY: 'StemV'; VAL: 156),
  310.                          (KEY: 'MissingWidth'; VAL: 750));
  311.  
  312.   ARIAL_BOLDITALIC_BBOX: array[0..3] of Integer = (-174,-228,1114,962);
  313.  
  314.   // Times definition
  315.  
  316.   TIMES_ROMAN_W_ARRAY: array[32..255] of Integer = (
  317.     250,333,408,500,500,833,778,180,333,333,500,564,250,333,
  318.     250,278,500,500,500,500,500,500,500,500,500,500,278,278,564,564,
  319.     564,444,921,722,667,667,722,611,556,722,722,333,389,722,611,889,
  320.     722,722,556,722,667,556,611,722,722,944,722,722,611,333,278,333,
  321.     469,500,333,444,500,444,500,444,333,500,500,278,278,500,278,778,
  322.     500,500,500,500,333,389,278,500,500,722,500,500,444,480,200,480,
  323.     541,0,500,0,333,500,444,1000,500,500,333,1000,556,333,889,0,
  324.     611,0,0,333,333,444,444,350,500,1000,333,980,389,333,722,0,
  325.     444,722,0,333,500,500,500,500,200,500,333,760,276,500,564,0,
  326.     760,333,400,564,300,300,333,500,453,250,333,300,310,500,750,750,
  327.     750,444,722,722,722,722,722,722,889,667,611,611,611,611,333,333,
  328.     333,333,722,722,722,722,722,722,722,564,722,722,722,722,722,722,
  329.     556,500,444,444,444,444,444,444,667,444,444,444,444,444,278,278,
  330.     278,278,500,500,500,500,500,500,500,564,500,500,500,500,500,500,
  331.     500,500);
  332.  
  333.   TIMES_INT_TABLE: array[0..1] of TPDF_INT_TBL = (
  334.                        (KEY: 'FirstChar'; VAL: 32),
  335.                        (KEY: 'LastChar'; VAL: 255)
  336.                        );
  337.  
  338.   TIMES_DISC_STR_TABLE: array[0..2] of TPDF_STR_TBL =(
  339.                          (KEY: 'Type'; VAL: 'FontDescriptor'),
  340.                          (KEY: 'FontName'; VAL: 'Type1'),
  341.                          (KEY: 'Encoding'; VAL: 'WinAnsiEncoding')
  342.                          );
  343.  
  344.   TIMES_DISC_INT_TABLE: array[0..6] of TPDF_INT_TBL =(
  345.                          (KEY: 'Ascent'; VAL: 891),
  346.                          (KEY: 'CapHeight'; VAL: 891),
  347.                          (KEY: 'Descent'; VAL: -216),
  348.                          (KEY: 'Flags'; VAL: PDF_FONT_STD_CHARSET +
  349.                            PDF_FONT_SERIF),
  350.                          (KEY: 'ItalicAngle'; VAL: 0),
  351.                          (KEY: 'StemV'; VAL: 78),
  352.                          (KEY: 'MissingWidth'; VAL: 778)
  353.                          );
  354.  
  355.   TIMES_BBOX: array[0..3] of Integer = (-168,-218,1000,898);
  356.  
  357.   // Times-Italic definition
  358.  
  359.   TIMES_ITALIC_W_ARRAY: array[32..255] of Integer = (
  360.     250,333,420,500,500,833,778,214,333,333,500,675,250,333,
  361.     250,278,500,500,500,500,500,500,500,500,500,500,333,333,675,675,
  362.     675,500,920,611,611,667,722,611,611,722,722,333,444,667,556,833,
  363.     667,722,611,722,611,500,556,722,611,833,611,556,556,389,278,389,
  364.     422,500,333,500,500,444,500,444,278,500,500,278,278,444,278,722,
  365.     500,500,500,500,389,389,278,500,444,667,444,444,389,400,275,400,
  366.     541,0,500,0,333,500,556,889,500,500,333,1000,500,333,944,0,
  367.     556,0,0,333,333,556,556,350,500,889,333,980,389,333,667,0,
  368.     389,556,0,389,500,500,500,500,275,500,333,760,276,500,675,0,
  369.     760,333,400,675,300,300,333,500,523,250,333,300,310,500,750,750,
  370.     750,500,611,611,611,611,611,611,889,667,611,611,611,611,333,333,
  371.     333,333,722,667,722,722,722,722,722,675,722,722,722,722,722,556,
  372.     611,500,500,500,500,500,500,500,667,444,444,444,444,444,278,278,
  373.     278,278,500,500,500,500,500,500,500,675,500,500,500,500,500,444,
  374.     500,444);
  375.  
  376.   TIMES_ITALIC_DISC_INT_TABLE: array[0..6] of TPDF_INT_TBL =(
  377.                          (KEY: 'Ascent'; VAL: 891),
  378.                          (KEY: 'CapHeight'; VAL: 891),
  379.                          (KEY: 'Descent'; VAL: -216),
  380.                          (KEY: 'Flags'; VAL: PDF_FONT_STD_CHARSET +
  381.                            PDF_FONT_SERIF + PDF_FONT_ITALIC),
  382.                          (KEY: 'ItalicAngle'; VAL: -15),
  383.                          (KEY: 'StemV'; VAL: 78),
  384.                          (KEY: 'MissingWidth'; VAL: 778));
  385.  
  386.   TIMES_ITALIC_BBOX: array[0..3] of Integer = (-169,-217,1010,883);
  387.  
  388.   // Times-BOLD definition
  389.  
  390.   TIMES_BOLD_W_ARRAY: array[32..255] of Integer = (
  391.     250,333,555,500,500,1000,833,278,333,333,500,570,250,333,
  392.     250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,
  393.     570,500,930,722,667,722,722,667,611,778,778,389,500,778,667,944,
  394.     722,778,611,778,722,556,667,722,722,1000,722,722,667,333,278,333,
  395.     581,500,333,500,556,444,556,444,333,500,556,278,333,556,278,833,
  396.     556,500,556,556,444,389,333,556,500,722,500,500,444,394,220,394,
  397.     520,0,500,0,333,500,500,1000,500,500,333,1000,556,333,1000,0,
  398.     667,0,0,333,333,500,500,350,500,1000,333,1000,389,333,722,0,
  399.     444,722,0,333,500,500,500,500,220,500,333,747,300,500,570,0,
  400.     747,333,400,570,300,300,333,556,540,250,333,300,330,500,750,750,
  401.     750,500,722,722,722,722,722,722,1000,722,667,667,667,667,389,389,
  402.     389,389,722,722,778,778,778,778,778,570,778,722,722,722,722,722,
  403.     611,556,500,500,500,500,500,500,722,444,444,444,444,444,278,278,
  404.     278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,500,
  405.     556,500);
  406.  
  407.   TIMES_BOLD_DISC_INT_TABLE: array[0..6] of TPDF_INT_TBL =(
  408.                          (KEY: 'Ascent'; VAL: 891),
  409.                          (KEY: 'CapHeight'; VAL: 891),
  410.                          (KEY: 'Descent'; VAL: -216),
  411.                          (KEY: 'Flags'; VAL: PDF_FONT_STD_CHARSET +
  412.                            PDF_FONT_SERIF + PDF_FONT_FOURCE_BOLD),
  413.                          (KEY: 'ItalicAngle'; VAL: 0),
  414.                          (KEY: 'StemV'; VAL: 156),
  415.                          (KEY: 'MissingWidth'; VAL: 778));
  416.  
  417.   TIMES_BOLD_BBOX: array[0..3] of Integer = (-168,-218,1000,935);
  418.  
  419.   // Times-BoldItalic definition
  420.  
  421.   TIMES_BOLDITALIC_W_ARRAY: array[32..255] of Integer = (
  422.     250,389,555,500,500,833,778,278,333,333,500,570,250,333,
  423.     250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,
  424.     570,500,832,667,667,667,722,667,667,722,778,389,500,667,611,889,
  425.     722,722,611,722,667,556,611,722,667,889,667,611,611,333,278,333,
  426.     570,500,333,500,500,444,500,444,333,500,556,278,278,500,278,778,
  427.     556,500,500,500,389,389,278,556,444,667,500,444,389,348,220,348,
  428.     570,0,500,0,333,500,500,1000,500,500,333,1000,556,333,944,0,
  429.     611,0,0,333,333,500,500,350,500,1000,333,1000,389,333,722,0,
  430.     389,611,0,389,500,500,500,500,220,500,333,747,266,500,606,0,
  431.     747,333,400,570,300,300,333,576,500,250,333,300,300,500,750,750,
  432.     750,500,667,667,667,667,667,667,944,667,667,667,667,667,389,389,
  433.     389,389,722,722,722,722,722,722,722,570,722,722,722,722,722,611,
  434.     611,500,500,500,500,500,500,500,722,444,444,444,444,444,278,278,
  435.     278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,444,
  436.     500,444);
  437.  
  438.   TIMES_BOLDITALIC_DISC_INT_TABLE: array[0..6] of TPDF_INT_TBL =(
  439.                          (KEY: 'Ascent'; VAL: 891),
  440.                          (KEY: 'CapHeight'; VAL: 891),
  441.                          (KEY: 'Descent'; VAL: -216),
  442.                          (KEY: 'Flags'; VAL: PDF_FONT_STD_CHARSET +
  443.                            PDF_FONT_SERIF + PDF_FONT_FOURCE_BOLD),
  444.                          (KEY: 'ItalicAngle'; VAL: -15),
  445.                          (KEY: 'StemV'; VAL: 156),
  446.                          (KEY: 'MissingWidth'; VAL: 778));
  447.  
  448.   TIMES_BOLDITALIC_BBOX: array[0..3] of Integer = (-200,-218,996,921);
  449.  
  450.   SCRIPT_W_ARRAY: array[32..255] of Integer = (
  451.     323,202,323,424,404,485,525,202,283,283,323,525,202,525,202,444,
  452.     404,404,404,404,404,404,404,404,404,404,202,202,485,525,485,364,
  453.     545,404,465,404,465,404,404,465,485,343,303,485,384,667,485,424,
  454.     505,444,505,404,384,485,465,566,485,465,424,283,283,283,444,323,
  455.     222,323,283,222,323,202,162,303,303,141,141,283,162,505,364,283,
  456.     303,303,263,222,182,303,303,424,323,303,283,283,162,283,485,202,
  457.     202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,
  458.     202,222,202,202,202,202,202,202,202,202,202,202,202,202,202,202,
  459.     202,202,222,384,283,465,162,283,404,283,323,404,404,404,283,404,
  460.     404,404,404,404,404,384,424,404,404,404,283,404,404,404,404,364,
  461.     404,404,404,404,404,404,566,404,404,404,404,404,343,343,343,343,
  462.     465,485,424,424,424,424,424,323,404,485,485,485,485,465,444,444,
  463.     323,323,323,323,323,323,384,222,202,202,202,202,141,141,141,141,
  464.     283,364,283,283,283,283,283,404,283,303,303,303,303,303,384,303
  465.     );
  466.  
  467.   SCRIPT_INT_TABLE: array[0..1] of TPDF_INT_TBL = (
  468.                        (KEY: 'FirstChar'; VAL: 32),
  469.                        (KEY: 'LastChar'; VAL: 255)
  470.                          );
  471.  
  472.   SCRIPT_DISC_STR_TABLE: array[0..2] of TPDF_STR_TBL =(
  473.                          (KEY: 'Type'; VAL: 'FontDescriptor'),
  474.                          (KEY: 'FontName'; VAL: 'Type1'),
  475.                          (KEY: 'Encoding'; VAL: 'WinAnsiEncoding')
  476.                          );
  477.  
  478.   SCRIPT_DISC_INT_TABLE: array[0..6] of TPDF_INT_TBL =(
  479.                          (KEY: 'Ascent'; VAL: 758),
  480.                          (KEY: 'CapHeight'; VAL: 758),
  481.                          (KEY: 'Descent'; VAL: -363),
  482.                          (KEY: 'Flags'; VAL: PDF_FONT_STD_CHARSET + PDF_FONT_ITALIC),
  483.                          (KEY: 'ItalicAngle'; VAL: 0),
  484.                          (KEY: 'StemV'; VAL: 78),
  485.                          (KEY: 'MissingWidth'; VAL: 202));
  486.  
  487.   SCRIPT_BBOX: array[0..3] of Integer = (-184,-363,505,758);
  488.  
  489. type
  490.   TPdfType1Font = class(TPdfFont)
  491.   private
  492.     FFirstChar: Byte;
  493.     FLastChar: Byte;
  494.     FArray: array[0..255] of Word;
  495.   public
  496.     procedure SetData(Value: TPdfDictionary); override;
  497.     function GetCharWidth(AText: string; APos: integer): integer; override;
  498.   end;
  499.  
  500.   TPdfFixedWidth = class(TPdfType1Font)
  501.   public
  502.     constructor Create(AXref: TPdfXref; AName: string); override;
  503.   end;
  504.  
  505.   TPdfFixedWidthBold = class(TPdfType1Font)
  506.   public
  507.     constructor Create(AXref: TPdfXref; AName: string); override;
  508.   end;
  509.  
  510.   TPdfFixedWidthItalic = class(TPdfType1Font)
  511.   public
  512.     constructor Create(AXref: TPdfXref; AName: string); override;
  513.   end;
  514.  
  515.   TPdfFixedWidthBoldItalic = class(TPdfType1Font)
  516.   public
  517.     constructor Create(AXref: TPdfXref; AName: string); override;
  518.   end;
  519.  
  520.   TPdfArial = class(TPdfType1Font)
  521.   public
  522.     constructor Create(AXref: TPdfXref; AName: string); override;
  523.   end;
  524.  
  525.   TPdfArialBold = class(TPdfType1Font)
  526.   public
  527.     constructor Create(AXref: TPdfXref; AName: string); override;
  528.   end;
  529.  
  530.   TPdfArialItalic = class(TPdfType1Font)
  531.   public
  532.     constructor Create(AXref: TPdfXref; AName: string); override;
  533.   end;
  534.  
  535.   TPdfArialBoldItalic = class(TPdfType1Font)
  536.   public
  537.     constructor Create(AXref: TPdfXref; AName: string); override;
  538.   end;
  539.  
  540.   TPdfTimesRoman = class(TPdfType1Font)
  541.   public
  542.     constructor Create(AXref: TPdfXref; AName: string); override;
  543.   end;
  544.  
  545.   TPdfTimesBold = class(TPdfType1Font)
  546.   public
  547.     constructor Create(AXref: TPdfXref; AName: string); override;
  548.   end;
  549.  
  550.   TPdfTimesItalic = class(TPdfType1Font)
  551.   public
  552.     constructor Create(AXref: TPdfXref; AName: string); override;
  553.   end;
  554.  
  555.   TPdfTimesBoldItalic = class(TPdfType1Font)
  556.   public
  557.     constructor Create(AXref: TPdfXref; AName: string); override;
  558.   end;
  559.  
  560.   TPdfScript = class(TPdfType1Font)
  561.   public
  562.     constructor Create(AXref: TPdfXref; AName: string); override;
  563.   end;
  564.  
  565. implementation
  566.  
  567. { TPdfType1Font }
  568. function TPdfType1Font.GetCharWidth(AText: string; APos: integer): integer;
  569. begin
  570.   result := FArray[ord(AText[APos])];
  571. end;
  572.  
  573. procedure TPdfType1Font.SetData(Value: TPdfDictionary);
  574. var
  575.   i: integer;
  576.   DefaultWidth: Word;
  577.   Widths: TPdfArray;
  578. begin
  579.   inherited SetData(Value);
  580.  
  581.   // initialize char widths array by default value (if missing width parameter
  582.   // is defined, use it as default value.)
  583.   if Data.PdfNumberByName('MissingWidth') <> nil then
  584.     DefaultWidth := Data.PdfNumberByName('MissingWidth').Value
  585.   else
  586.     DefaultWidth := 0;
  587.   for i := 0 to 255 do
  588.     FArray[i] := DefaultWidth;
  589.  
  590.   FFirstChar := Data.PdfNumberByName('FirstChar').Value;
  591.   FLastChar := Data.PdfNumberByName('LastChar').Value;
  592.  
  593.   // fill width array with "Widths" table values.
  594.   Widths := Data.PdfArrayByName('Widths');
  595.   for i := 0 to Widths.ItemCount - 1 do
  596.     FArray[i + FFirstChar] := TPdfNumber(Widths.Items[i]).Value;
  597. end;
  598.  
  599. { FixedWidth }
  600. constructor TPdfFixedWidth.Create(AXref: TPdfXref; AName: string);
  601. var
  602.   FWidths: TPdfArray;
  603.   FFont: TPdfDictionary;
  604. begin
  605.   inherited Create(AXref, AName);
  606.  
  607.   // make instance of TPdfDictionary and register to Xref table.
  608.   FFont := TPdfDictionary.CreateDictionary(AXref);
  609.   AXref.AddObject(FFont);
  610.  
  611.   // adding element to the dictionary.
  612.   AddStrElements(FFont, TYPE1_FONT_STR_TABLE);
  613.   AddIntElements(FFont, FIXED_WIDTH_INT_TABLE);
  614.   FFont.AddItem('BaseFont', TPdfName.CreateName('Courier'));
  615.  
  616.   // create "Width" table of the font.
  617.   FWidths := TPdfArray.CreateNumArray(AXref, FIXED_WIDTH_W_ARRAY);
  618.   FFont.AddInternalItem('Widths', FWidths);
  619.  
  620.   SetData(FFont);
  621. end;
  622.  
  623. { FixedWidthBold }
  624. constructor TPdfFixedWidthBold.Create(AXref: TPdfXref; AName: string);
  625. var
  626.   FWidths: TPdfArray;
  627.   FFont: TPdfDictionary;
  628. begin
  629.   inherited Create(AXref, AName);
  630.   FFont := TPdfDictionary.CreateDictionary(AXref);
  631.   AXref.AddObject(FFont);
  632.  
  633.   AddStrElements(FFont, TYPE1_FONT_STR_TABLE);
  634.   AddIntElements(FFont, FIXED_WIDTH_INT_TABLE);
  635.   FFont.AddItem('BaseFont', TPdfName.CreateName('Courier-Bold'));
  636.  
  637.   FWidths := TPdfArray.CreateNumArray(AXref, FIXED_WIDTH_BOLD_W_ARRAY);
  638.   FFont.AddInternalItem('Widths', FWidths);
  639.  
  640.   SetData(FFont);
  641. end;
  642.  
  643. { FixedWidthItalic }
  644. constructor TPdfFixedWidthItalic.Create(AXref: TPdfXref; AName: string);
  645. var
  646.   FWidths: TPdfArray;
  647.   FFont: TPdfDictionary;
  648. begin
  649.   inherited Create(AXref, AName);
  650.   FFont := TPdfDictionary.CreateDictionary(AXref);
  651.   AXref.AddObject(FFont);
  652.  
  653.   AddStrElements(FFont, TYPE1_FONT_STR_TABLE);
  654.   AddIntElements(FFont, FIXED_WIDTH_INT_TABLE);
  655.   FFont.AddItem('BaseFont', TPdfName.CreateName('Courier-Oblique'));
  656.  
  657.   FWidths := TPdfArray.CreateNumArray(AXref, FIXED_WIDTH_ITALIC_W_ARRAY);
  658.   FFont.AddInternalItem('Widths', FWidths);
  659.  
  660.   SetData(FFont);
  661. end;
  662.  
  663. { FixedWidthBoldItalic }
  664. constructor TPdfFixedWidthBoldItalic.Create(AXref: TPdfXref; AName: string);
  665. var
  666.   FWidths: TPdfArray;
  667.   FFont: TPdfDictionary;
  668. begin
  669.   inherited Create(AXref, AName);
  670.   FFont := TPdfDictionary.CreateDictionary(AXref);
  671.   AXref.AddObject(FFont);
  672.  
  673.   AddStrElements(FFont, TYPE1_FONT_STR_TABLE);
  674.   AddIntElements(FFont, FIXED_WIDTH_INT_TABLE);
  675.   FFont.AddItem('BaseFont', TPdfName.CreateName('Courier-BoldOblique'));
  676.  
  677.   FWidths := TPdfArray.CreateNumArray(AXref, FIXED_WIDTH_BOLDITALIC_W_ARRAY);
  678.   FFont.AddInternalItem('Widths', FWidths);
  679.  
  680.   SetData(FFont);
  681. end;
  682.  
  683. { Arial }
  684. constructor TPdfArial.Create(AXref: TPdfXref; AName: string);
  685. var
  686.   FWidths: TPdfArray;
  687.   FFont: TPdfDictionary;
  688. begin
  689.   inherited Create(AXref, AName);
  690.   FFont := TPdfDictionary.CreateDictionary(AXref);
  691.   AXref.AddObject(FFont);
  692.  
  693.   AddStrElements(FFont, TYPE1_FONT_STR_TABLE);
  694.   AddIntElements(FFont, ARIAL_INT_TABLE);
  695.   FFont.AddItem('BaseFont', TPdfName.CreateName('Helvetica'));
  696.  
  697.   FWidths := TPdfArray.CreateNumArray(AXref, ARIAL_W_ARRAY);
  698.   FFont.AddInternalItem('Widths', FWidths);
  699.  
  700.   SetData(FFont);
  701. end;
  702.  
  703. { Arial-Bold }
  704. constructor TPdfArialBold.Create(AXref: TPdfXref; AName: string);
  705. var
  706.   FWidths: TPdfArray;
  707.   FFont: TPdfDictionary;
  708. begin
  709.   inherited Create(AXref, AName);
  710.   FFont := TPdfDictionary.CreateDictionary(AXref);
  711.   AXref.AddObject(FFont);
  712.  
  713.   AddStrElements(FFont, TYPE1_FONT_STR_TABLE);
  714.   AddIntElements(FFont, ARIAL_INT_TABLE);
  715.   FFont.AddItem('BaseFont', TPdfName.CreateName('Helvetica-Bold'));
  716.  
  717.   FWidths := TPdfArray.CreateNumArray(AXref, ARIAL_BOLD_W_ARRAY);
  718.   FFont.AddInternalItem('Widths', FWidths);
  719.  
  720.   SetData(FFont);
  721. end;
  722.  
  723. { Arial-Italic }
  724. constructor TPdfArialItalic.Create(AXref: TPdfXref; AName: string);
  725. var
  726.   FWidths: TPdfArray;
  727.   FFont: TPdfDictionary;
  728. begin
  729.   inherited Create(AXref, AName);
  730.   FFont := TPdfDictionary.CreateDictionary(AXref);
  731.   AXref.AddObject(FFont);
  732.  
  733.   AddStrElements(FFont, TYPE1_FONT_STR_TABLE);
  734.   AddIntElements(FFont, ARIAL_INT_TABLE);
  735.   FFont.AddItem('BaseFont', TPdfName.CreateName('Helvetica-Oblique'));
  736.  
  737.   FWidths := TPdfArray.CreateNumArray(AXref, ARIAL_ITALIC_W_ARRAY);
  738.   FFont.AddInternalItem('Widths', FWidths);
  739.  
  740.   SetData(FFont);
  741. end;
  742.  
  743. { Arial-BoldItalic }
  744. constructor TPdfArialBoldItalic.Create(AXref: TPdfXref; AName: string);
  745. var
  746.   FWidths: TPdfArray;
  747.   FFont: TPdfDictionary;
  748. begin
  749.   inherited Create(AXref, AName);
  750.   FFont := TPdfDictionary.CreateDictionary(AXref);
  751.   AXref.AddObject(FFont);
  752.  
  753.   AddStrElements(FFont, TYPE1_FONT_STR_TABLE);
  754.   AddIntElements(FFont, ARIAL_INT_TABLE);
  755.   FFont.AddItem('BaseFont', TPdfName.CreateName('Helvetica-BoldOblique'));
  756.  
  757.   FWidths := TPdfArray.CreateNumArray(AXref, ARIAL_BOLDITALIC_W_ARRAY);
  758.   FFont.AddInternalItem('Widths', FWidths);
  759.  
  760.   SetData(FFont);
  761. end;
  762.  
  763. { TPdfTimesRoman }
  764. constructor TPdfTimesRoman.Create(AXref: TPdfXref; AName: string);
  765. var
  766.   FWidths: TPdfArray;
  767.   FFont: TPdfDictionary;
  768. begin
  769.   inherited Create(AXref, AName);
  770.   FFont := TPdfDictionary.CreateDictionary(AXref);
  771.   AXref.AddObject(FFont);
  772.  
  773.   AddStrElements(FFont, TYPE1_FONT_STR_TABLE);
  774.   AddIntElements(FFont, TIMES_INT_TABLE);
  775.   FFont.AddItem('BaseFont', TPdfName.CreateName('Times-Roman'));
  776.  
  777.   FWidths := TPdfArray.CreateNumArray(AXref, TIMES_ROMAN_W_ARRAY);
  778.   FFont.AddInternalItem('Widths', FWidths);
  779.  
  780.   SetData(FFont);
  781. end;
  782.  
  783. { TPdfTimesBold }
  784. constructor TPdfTimesBold.Create(AXref: TPdfXref; AName: string);
  785. var
  786.   FWidths: TPdfArray;
  787.   FFont: TPdfDictionary;
  788. begin
  789.   inherited Create(AXref, AName);
  790.   FFont := TPdfDictionary.CreateDictionary(AXref);
  791.   AXref.AddObject(FFont);
  792.  
  793.   AddStrElements(FFont, TYPE1_FONT_STR_TABLE);
  794.   AddIntElements(FFont, TIMES_INT_TABLE);
  795.   FFont.AddItem('BaseFont', TPdfName.CreateName('Times-Bold'));
  796.  
  797.   FWidths := TPdfArray.CreateNumArray(AXref, TIMES_BOLD_W_ARRAY);
  798.   FFont.AddInternalItem('Widths', FWidths);
  799.  
  800.   SetData(FFont);
  801. end;
  802.  
  803. { TPdfTimesItalic }
  804. constructor TPdfTimesItalic.Create(AXref: TPdfXref; AName: string);
  805. var
  806.   FWidths: TPdfArray;
  807.   FFont: TPdfDictionary;
  808. begin
  809.   inherited Create(AXref, AName);
  810.   FFont := TPdfDictionary.CreateDictionary(AXref);
  811.   AXref.AddObject(FFont);
  812.  
  813.   AddStrElements(FFont, TYPE1_FONT_STR_TABLE);
  814.   AddIntElements(FFont, TIMES_INT_TABLE);
  815.   FFont.AddItem('BaseFont', TPdfName.CreateName('Times-Italic'));
  816.  
  817.   FWidths := TPdfArray.CreateNumArray(AXref, TIMES_ITALIC_W_ARRAY);
  818.   FFont.AddInternalItem('Widths', FWidths);
  819.  
  820.   SetData(FFont);
  821. end;
  822.  
  823. { TPdfTimesBoldItalic }
  824. constructor TPdfTimesBoldItalic.Create(AXref: TPdfXref; AName: string);
  825. var
  826.   FWidths: TPdfArray;
  827.   FFont: TPdfDictionary;
  828. begin
  829.   inherited Create(AXref, AName);
  830.   FFont := TPdfDictionary.CreateDictionary(AXref);
  831.   AXref.AddObject(FFont);
  832.  
  833.   AddStrElements(FFont, TYPE1_FONT_STR_TABLE);
  834.   AddIntElements(FFont, TIMES_INT_TABLE);
  835.   FFont.AddItem('BaseFont', TPdfName.CreateName('Times-BoldItalic'));
  836.  
  837.   FWidths := TPdfArray.CreateNumArray(AXref, TIMES_BOLDITALIC_W_ARRAY);
  838.   FFont.AddInternalItem('Widths', FWidths);
  839.  
  840.   SetData(FFont);
  841. end;
  842.  
  843. { TPdfScript }
  844. constructor TPdfScript.Create(AXref: TPdfXref; AName: string);
  845. var
  846.   FWidths: TPdfArray;
  847.   FFontDescriptor: TPdfDictionary;
  848.   FFont: TPdfDictionary;
  849. begin
  850.   inherited Create(AXref, AName);
  851.   FFont := TPdfDictionary.CreateDictionary(AXref);
  852.   AXref.AddObject(FFont);
  853.  
  854.   AddStrElements(FFont, TYPE1_FONT_STR_TABLE);
  855.   AddIntElements(FFont, SCRIPT_INT_TABLE);
  856.   FFont.AddItem('BaseFont', TPdfName.CreateName('Script'));
  857.  
  858.   FFontDescriptor := TPdfDictionary.CreateDictionary(AXref);
  859.   AXref.AddObject(FFontDescriptor);
  860.  
  861.   AddStrElements(FFontDescriptor, SCRIPT_DISC_STR_TABLE);
  862.   AddIntElements(FFontDescriptor, SCRIPT_DISC_INT_TABLE);
  863.   FFontDescriptor.AddItem('FontBBox',
  864.              TPdfArray.CreateNumArray(AXref, SCRIPT_BBOX));
  865.   FFont.AddItem('FontDescriptor', FFontDescriptor);
  866.  
  867.   FWidths := TPdfArray.CreateNumArray(AXref, SCRIPT_W_ARRAY);
  868.   FFont.AddItem('Widths', FWidths);
  869.  
  870.   SetData(FFont);
  871. end;
  872.  
  873. initialization
  874.  
  875.   RegisterClassAlias(TPdfFixedWidth, 'FixedWidth');
  876.   RegisterClassAlias(TPdfFixedWidthBold, 'FixedWidth-Bold');
  877.   RegisterClassAlias(TPdfFixedWidthBoldItalic, 'FixedWidth-BoldItalic');
  878.   RegisterClassAlias(TPdfFixedWidthItalic, 'FixedWidth-Italic');
  879.   RegisterClassAlias(TPdfArial, 'Arial');
  880.   RegisterClassAlias(TPdfArialBold, 'Arial-Bold');
  881.   RegisterClassAlias(TPdfArialBoldItalic, 'Arial-BoldItalic');
  882.   RegisterClassAlias(TPdfArialItalic, 'Arial-Italic');
  883.   RegisterClassAlias(TPdfTimesRoman, 'Times-Roman');
  884.   RegisterClassAlias(TPdfTimesBold, 'Times-Bold');
  885.   RegisterClassAlias(TPdfTimesItalic, 'Times-Italic');
  886.   RegisterClassAlias(TPdfTimesBoldItalic, 'Times-BoldItalic');
  887. //  RegisterClassAlias(TPdfScript, 'Script');
  888. //  RegisterClassAlias(TPdfSymbol, 'Symbol');
  889.  
  890. finalization
  891.  
  892.   UnRegisterClass(TPdfFixedWidth);
  893.   UnRegisterClass(TPdfFixedWidthBold);
  894.   UnRegisterClass(TPdfFixedWidthBoldItalic);
  895.   UnRegisterClass(TPdfFixedWidthBold);
  896.   UnRegisterClass(TPdfArial);
  897.   UnRegisterClass(TPdfArialBold);
  898.   UnRegisterClass(TPdfArialBoldItalic);
  899.   UnRegisterClass(TPdfArialBold);
  900.   UnRegisterClass(TPdfTimesRoman);
  901.   UnRegisterClass(TPdfTimesBold);
  902.   UnRegisterClass(TPdfTimesItalic);
  903.   UnRegisterClass(TPdfTimesBoldItalic);
  904. //  UnRegisterClass(TPdfScript);
  905. //  UnRegisterClass(TPdfSymbol);
  906.  
  907. end.
  908.