home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 March / Chip_2002-03_cd1.bin / zkuste / delphi / kompon / d5 / cak / CAKINST.ZIP / pdfmaker.lzh / PDFMaker / PMFonts.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-03-26  |  28.9 KB  |  933 lines

  1. {*
  2.  *
  3.  *   PMFonts.pas
  4.  *
  5.  *   PDFMakeré┼Ägùpé╖éΘâtâHâôâgÆΦï`é╠âåâjâbâg
  6.  *
  7.  *   Copyright (c) 1999-2000 Takezou
  8.  *
  9.  *   2000/01/19 MSPXXXâtâHâôâgé≡MSXXXé╔ò╧ìXüié▒é╠é┘éñé¬ë╝û╝é¬è∩ùφé╔ò\Īé│éΩéΘüj
  10.  *   2000/01/20 GetCharWidthâïü[â`âôé╠Ä└æò
  11.  *   2000/03/28 MSGothic,MSMincyoé╔Boldé≡Æ╟ë┴
  12.  *
  13.  *   üªâtâHâôâgé╠Ä└æòé╔é┬éóé─é═éαéñÅ¡é╡éµéóò√û@é¬éáéΦé╗éñüBüiô┴é╔Widthsé╠özù±
  14.  *     òöò¬üjâèâ\ü[âXâtâ@âCâïé╔Ä¥é╜é╣é─Æ╟ë┴üEìφÅ£é≡Å_ôεé╔é┼é½éΘéµéñé╔é╖éΘé▒é╞
  15.  *     éαîƒôóé╡é╜é¬üAŽùêLinuxö┼é¬Åoé╜é╞é½é╔ìóéΦé╗éñé╚é╠é┼üALinuxö┼Delphié╠
  16.  *     Å┌ì╫é¬éφé⌐éΘé▄é┼é═é▒é╠é▄é▄ò█ù»üB
  17.  *     é▄é╜üAò╢ÄÜâRü[âhüiî╗Å≤SJISüjéαûΓæΦé╔é╚éΘë┬ö\ɽé¬éáéΘé╜é▀üAæSé─UNICODEé╔
  18.  *     é╖éΘé▒é╞éαùvîƒôóüB
  19.  *
  20.  *
  21.  *}
  22. unit PMFonts;
  23.  
  24. interface
  25.  
  26. uses
  27.   Windows, SysUtils, Classes;
  28.  
  29. const
  30.   MAX_PDF_FONT_INDEX = 9;
  31.  
  32. type
  33.   TPDFFontDescriptorDef = class;
  34.  
  35.   TPDFFontID = (fiCentury,
  36.                 fiCenturyBold,
  37.                 fiArial,
  38.                 fiArialBold,
  39.                 fiCourier,
  40.                 fiCourierBold,
  41.                 fiMincyo,
  42.                 fiGothic,
  43.                 fiMincyoBold,
  44.                 fiGothicBold);
  45.  
  46.   {*
  47.    *  TPDFFontDef
  48.    *  FontÆΦï`é╠èεû{î^
  49.    *
  50.    *}
  51.   TPDFFontDef = class(TObject)
  52.   private
  53.     FSubtype: string;
  54.     FBaseFont: string;
  55.     FFontDescriptor: TPDFFontDescriptorDef;
  56.     FDescendantFont: TPDFFontDef;
  57.     FFontID: TPDFFontID;
  58.     FWArray: array[0..255] of Integer;
  59.   protected
  60.     function GetDetailString: string; virtual;
  61.     procedure CreateFontDef; virtual;
  62.     procedure InitFontDef; virtual;
  63.     property Subtype: string read FSubtype write FSubtype;
  64.     property BaseFont: string read FBaseFont write FBaseFont;
  65.   public
  66.     constructor Create; virtual;
  67.     function GetCharWidth(C: Char): integer;
  68.     property DetailString: string read GetDetailString;
  69.     property FontDescriptor: TPDFFontDescriptorDef read FFontDescriptor;
  70.     property DescendantFont: TPDFFontDef read FDescendantFont;
  71.     property FontID: TPDFFontID read FFontID;
  72.   end;
  73.  
  74.   {*
  75.    *  TPDFTrueTypeFontDef
  76.    *  TrueTypeFontÆΦï`é╠èεû{î^
  77.    *
  78.    *}
  79.   TPDFTrueTypeFontDef = class(TPDFFontDef)
  80.   private
  81.     FFirstChar: Byte;
  82.     FLastChar: Byte;
  83.     FWidths: string;
  84.     FEncoding: string;
  85.   protected
  86.     function GetDetailString: string; override;
  87.     procedure InitFontDef; override;
  88.   public
  89.     property FirstChar: Byte read FFirstChar write FFirstChar;
  90.     property LastChar: Byte read FLastChar write FLastChar;
  91.     property Encoding: string read FEncoding write FEncoding;
  92.     property Widths: string read FWidths write FWidths;
  93.   end;
  94.  
  95.   {*
  96.    *  TPDFType0FontDef
  97.    *  Type0FontÆΦï`é╠èεû{î^
  98.    *
  99.    *}
  100.   TPDFType0FontDef = class(TPDFFontDef)
  101.   private
  102.     FEncoding: string;
  103.   protected
  104.     function GetDetailString: string; override;
  105.   public
  106.     property Encoding: string read FEncoding write FEncoding;
  107.   end;
  108.  
  109.   {*
  110.    *  TPDFCID2FontDef
  111.    *  CID type2 FontÆΦï`é╠èεû{î^
  112.    *
  113.    *}
  114.   TPDFCID2FontDef = class(TPDFFontDef)
  115.   private
  116.     FWinCharSet: integer;
  117.     FCIDSystemInfo: string;
  118.     FDW: integer;
  119.     FW: string;
  120.   protected
  121.     function GetDetailString: string; override;
  122.     procedure InitFontDef; override;
  123.   public
  124.     property WinCharSet: integer read FWinCharSet write FWinCharSet;
  125.     property CIDSystemInfo: string read FCIDSystemInfo write FCIDSystemInfo;
  126.     property DW: integer read FDW write FDW;
  127.     property W: string read FW write FW;
  128.   end;
  129.  
  130.   {*
  131.    *  TPDFFontDescriptorDef
  132.    *  FontDescriptorÆΦï`
  133.    *
  134.    *}
  135.   TPDFFontDescriptorDef = class(TObject)
  136.   private
  137.     FAscent: integer;
  138.     FCapHeight: integer;
  139.     FDescent: integer;
  140.     FFlags: integer;
  141.     FFontBBox: TRect;
  142.     FFontName: string;
  143.     FItalicAngle: integer;
  144.     FStemV: integer;
  145.   public
  146.     property Ascent: integer read FAscent write FAscent;
  147.     property CapHeight: integer read FCapHeight write FCapHeight;
  148.     property Descent: integer read FDescent write FDescent;
  149.     property Flags: integer read FFlags write FFlags;
  150.     property FontBBox: TRect read FFontBBox write FFontBBox;
  151.     property FontName: string read FFontName write FFontName;
  152.     property ItalicAngle: integer read FItalicAngle write FItalicAngle;
  153.     property StemV: integer read FStemV write FStemV;
  154.   end;
  155.  
  156.   {*
  157.    *  TCenturyFontDef
  158.    *
  159.    *}
  160.   TCenturyFontDef = class(TPDFTrueTypeFontDef)
  161.   protected
  162.     procedure CreateFontDef; override;
  163.   public
  164.   end;
  165.  
  166.   {*
  167.    *  TCenturyBoldFontDef
  168.    *
  169.    *}
  170.   TCenturyBoldFontDef = class(TPDFTrueTypeFontDef)
  171.   protected
  172.     procedure CreateFontDef; override;
  173.   public
  174.   end;
  175.  
  176.   {*
  177.    *  TArialFontDef
  178.    *
  179.    *}
  180.   TArialFontDef = class(TPDFTrueTypeFontDef)
  181.   protected
  182.     procedure CreateFontDef; override;
  183.   public
  184.   end;
  185.  
  186.   {*
  187.    *  TArialBoldFontDef
  188.    *
  189.    *}
  190.   TArialBoldFontDef = class(TPDFTrueTypeFontDef)
  191.   protected
  192.     procedure CreateFontDef; override;
  193.   public
  194.   end;
  195.  
  196.   {*
  197.    *  TCourierFontDef
  198.    *
  199.    *}
  200.   TCourierFontDef = class(TPDFTrueTypeFontDef)
  201.   protected
  202.     procedure CreateFontDef; override;
  203.   public
  204.   end;
  205.  
  206.   {*
  207.    *  TCourierBoldFontDef
  208.    *
  209.    *}
  210.   TCourierBoldFontDef = class(TPDFTrueTypeFontDef)
  211.   protected
  212.     procedure CreateFontDef; override;
  213.   public
  214.   end;
  215.  
  216.   {*
  217.    *  TMSMincyoFontDef
  218.    *
  219.    *}
  220.   TMSMincyoFontDef = class(TPDFType0FontDef)
  221.   protected
  222.     procedure CreateFontDef; override;
  223.   public
  224.   end;
  225.  
  226.   {*
  227.    *  TMSMincyoDFontDef -- TMSMincyoFontDefé╠DescendantFont
  228.    *
  229.    *}
  230.   TMSMincyoDFontDef = class(TPDFCID2FontDef)
  231.   protected
  232.     procedure CreateFontDef; override;
  233.   public
  234.   end;
  235.  
  236.   {*
  237.    *  TMSGothicFontDef
  238.    *
  239.    *}
  240.   TMSGothicFontDef = class(TPDFType0FontDef)
  241.   protected
  242.     procedure CreateFontDef; override;
  243.   public
  244.   end;
  245.  
  246.   {*
  247.    *  TMSGothicDFontDef -- TMSGothicFontDefé╠DescendantFont
  248.    *
  249.    *}
  250.   TMSGothicDFontDef = class(TPDFCID2FontDef)
  251.   protected
  252.     procedure CreateFontDef; override;
  253.   public
  254.   end;
  255.  
  256.   {*
  257.    *  TMSMincyoBFontDef
  258.    *
  259.    *}
  260.   TMSMincyoBFontDef = class(TPDFType0FontDef)
  261.   protected
  262.     procedure CreateFontDef; override;
  263.   public
  264.   end;
  265.  
  266.   {*
  267.    *  TMSMincyoBDFontDef -- TMSMincyoBFontDefé╠DescendantFont
  268.    *
  269.    *}
  270.   TMSMincyoBDFontDef = class(TPDFCID2FontDef)
  271.   protected
  272.     procedure CreateFontDef; override;
  273.   public
  274.   end;
  275.  
  276.   {*
  277.    *  TMSGothicBFontDef
  278.    *
  279.    *}
  280.   TMSGothicBFontDef = class(TPDFType0FontDef)
  281.   protected
  282.     procedure CreateFontDef; override;
  283.   public
  284.   end;
  285.  
  286.   {*
  287.    *  TMSGothicBDFontDef -- TMSGothicBFontDefé╠DescendantFont
  288.    *
  289.    *}
  290.   TMSGothicBDFontDef = class(TPDFCID2FontDef)
  291.   protected
  292.     procedure CreateFontDef; override;
  293.   public
  294.   end;
  295.  
  296.   function CreateFont(FontID: TPDFFontID): TPDFFontDef;
  297.  
  298. implementation
  299.  
  300. const
  301.   CRLF = #13#10;
  302.  
  303. function CreateFont(FontID: TPDFFontID): TPDFFontDef;
  304. begin
  305.   case FontID of
  306.     fiCentury: result := TCenturyFontDef.Create;
  307.     fiCenturyBold: Result := TCenturyBoldFontDef.Create;
  308.     fiArial: Result := TArialFontDef.Create;
  309.     fiArialBold: Result := TArialBoldFontDef.Create;
  310.     fiCourier: Result := TCourierFontDef.Create;
  311.     fiCourierBold: Result := TCourierBoldFontDef.Create;
  312.     fiMincyo: Result := TMSMincyoFontDef.Create;
  313.     fiGothic: Result := TMSGothicFontDef.Create;
  314.     fiMincyoBold: Result := TMSMincyoBFontDef.Create;
  315.     fiGothicBold: Result := TMSGothicBFontDef.Create;
  316.   else
  317.     raise Exception.CreateFmt('é▒é╠âtâHâôâgé═î╗ì▌âTâ|ü[âgé│éΩé─éóé▄é╣é± (%d)', [ord(FontID)]);
  318.   end;
  319. end;
  320.  
  321. { TPDFFontDef }
  322.  
  323. function TPDFFontDef.GetDetailString: string;
  324. begin
  325.   { virtual method }
  326.   result := '';
  327. end;
  328.  
  329. procedure TPDFFontDef.InitFontDef;
  330. begin
  331.   {*
  332.    * virtual method
  333.    * é▒é╠âüâ\âbâhé═üACreateFontDefé┼èeâtâHâôâgé▓é╞é╠Åëè·É▌ÆΦé¬ìséφéΩé╜
  334.    * îπé╔î─é╤Åoé│éΩéΘüBÄσé╔âtâHâôâgò¥é╠âeü[âuâïé≡ì∞ɼé╖éΘüB
  335.    *
  336.    * CreateFontDef: èeâtâHâôâgé▓é╞é╠î┬ò╩É▌ÆΦ
  337.    * InitFont: âtâHâôâgÄφò╩üiâOâïü[âvüjé▓é╞é╠î┬ò╩É▌ÆΦ
  338.    *
  339.    *}
  340. end;
  341.  
  342. function TPDFFontDef.GetCharWidth(C: Char): integer;
  343. begin
  344.   if DescendantFont = nil then
  345.     result := FWArray[ord(C)]
  346.   else
  347.     result := FDescendantFont.GetCharWidth(C);
  348. end;
  349.  
  350. procedure TPDFFontDef.CreateFontDef;
  351. begin
  352.   {*
  353.    * virtual method
  354.    * é▒é╠Æåé┼üAèeFonté▓é╞é╠î┬ò╩é╠É▌ÆΦé≡ìséñüB
  355.    * òKùvé┼éáéΩé╬DecendantFontéΓFontDescriptoré≡ì∞ɼé╖éΘüB
  356.    * ì∞ɼé│éΩé╜DecendantFontéΓFontDescriptoré═èεû{ôIé╔PDFMakeræñé┼
  357.    * èJò·é╖éΘüB
  358.    *
  359.    *}
  360. end;
  361.  
  362. constructor TPDFFontDef.Create;
  363. begin
  364.   FFontDescriptor := nil;
  365.   FDescendantFont := nil;
  366.   CreateFontDef;
  367.   InitFontDef;
  368. end;
  369.  
  370. { TPDFTrueTypeFontDef }
  371.  
  372. procedure TPDFTrueTypeFontDef.InitFontDef;
  373. var
  374.   CurPos, MaxPos: integer;
  375.   i: integer;
  376.   tmpStr: string;
  377. begin
  378.   {*
  379.    *  FWidthé╠ò╢ÄÜù±é≡èεé╔é╡é─üAFWArrayé≡ì∞ɼé╖éΘüB
  380.    *
  381.    *}
  382.   CurPos := 1;
  383.   i := FirstChar;
  384.   MaxPos := Length(FWidths);
  385.   while CurPos <= MaxPos do
  386.   begin
  387.     // ÉöÄÜé¬é▌é┬é⌐é┴é╜éτ
  388.     if FWidths[CurPos] in ['0'..'9'] then
  389.     begin
  390.       tmpStr := '';
  391.       while (CurPos <= MaxPos) and (FWidths[CurPos] in ['0'..'9']) do
  392.       begin
  393.         tmpStr := tmpStr + FWidths[CurPos];
  394.         inc(CurPos);
  395.       end;
  396.       FWArray[i] := StrToInt(tmpStr);
  397.       inc(i);
  398.     end
  399.     else
  400.       inc(CurPos);
  401.   end;
  402.   // ö╝èpâXâyü[âXé═żò╢ÄÜ"i"é╠ò¥üié╞éΦéáéªé╕üj
  403.   FWArray[20] := FWArray[ord(i)];
  404. end;
  405.  
  406. function TPDFTrueTypeFontDef.GetDetailString: string;
  407. begin
  408.   result := '/Subtype /' + Subtype + CRLF +
  409.             '/BaseFont /' + BaseFont + CRLF +
  410.             '/FirstChar ' + IntToStr(FirstChar) + CRLF +
  411.             '/LastChar ' + IntToStr(LastChar) + CRLF +
  412.             '/Widths ' + Widths + CRLF +
  413.             '/Encoding /' + Encoding  + CRLF;
  414. end;
  415.  
  416. { TPDFType0FontDef }
  417. function TPDFType0FontDef.GetDetailString: string;
  418. begin
  419.   result := '/Subtype /' + Subtype + CRLF +
  420.             '/BaseFont /' + BaseFont + CRLF +
  421.             '/Encoding /' + Encoding  + CRLF;
  422. end;
  423.  
  424. { TPDFCID2FontDef }
  425. procedure TPDFCID2FontDef.InitFontDef;
  426. var
  427.   CurPos, MaxPos: integer;
  428.   i: integer;
  429.   tmpStr: string;
  430. begin
  431.   {*
  432.    *  FWé╠ò╢ÄÜù±é≡èεé╔é╡é─üAFWArrayé≡ì∞ɼé╖éΘüB
  433.    *  2âoâCâgò╢ÄÜé╠ò¥é═üAFWArrey[0]é┼éáéτéφé╖üB
  434.    *
  435.    *}
  436.   MaxPos := Length(FW);
  437.   CurPos := Pos('1 [' , FW) + Length('1 [');
  438.   i := 32;
  439.   while (CurPos <= MaxPos) and (FW[CurPos] <> ']') do
  440.   begin
  441.     // ÉöÄÜé¬é▌é┬é⌐é┴é╜éτ
  442.     if FW[CurPos] in ['0'..'9'] then
  443.     begin
  444.       tmpStr := '';
  445.       while (CurPos <= MaxPos) and (FW[CurPos] in ['0'..'9']) do
  446.       begin
  447.         tmpStr := tmpStr + FW[CurPos];
  448.         inc(CurPos);
  449.       end;
  450.       FWArray[i] := StrToInt(tmpStr);
  451.       inc(i);
  452.     end
  453.     else
  454.       inc(CurPos);
  455.   end;
  456.  
  457.   MaxPos := Length(FW);
  458.   CurPos := Pos('326 [' , FW) + Length('326 [');
  459.   i := 160;
  460.   while (CurPos <= MaxPos) and (FW[CurPos] <> ']') do
  461.   begin
  462.     // ÉöÄÜé¬é▌é┬é⌐é┴é╜éτ
  463.     if FW[CurPos] in ['0'..'9'] then
  464.     begin
  465.       tmpStr := '';
  466.       while (CurPos <= MaxPos) and (FW[CurPos] in ['0'..'9']) do
  467.       begin
  468.         tmpStr := tmpStr + FW[CurPos];
  469.         inc(CurPos);
  470.       end;
  471.       FWArray[i] := StrToInt(tmpStr);
  472.       inc(i);
  473.     end
  474.     else
  475.       inc(CurPos);
  476.   end;
  477.   // ö╝èpâXâyü[âXé═żò╢ÄÜ"i"é╠ò¥üié╞éΦéáéªé╕üj
  478.   FWArray[20] := FWArray[ord(i)];
  479.   // éQâoâCâgò╢ÄÜé╠ò¥é═FWArray[0]é┼éáéτéφé╖.
  480.   FWArray[0] := DW;
  481. end;
  482.  
  483. function TPDFCID2FontDef.GetDetailString: string;
  484. begin
  485.   result := '/Subtype /' + Subtype + CRLF +
  486.             '/BaseFont /' + BaseFont + CRLF +
  487.             '/WinCharSet /' + IntToStr(WinCharSet)  + CRLF +
  488.             '/CIDSystemInfo <<' + CRLF + CIDSystemInfo + CRLF + '>>' + CRLF +
  489.             '/DW ' + IntToStr(DW) + CRLF +
  490.             '/W ' + W + CRLF;
  491. end;
  492.  
  493. { TCenturyFontDef }
  494. procedure TCenturyFontDef.CreateFontDef;
  495. begin
  496.   FFontID := fiCentury;
  497.   Subtype := 'TrueType';
  498.   BaseFont := 'Century';
  499.   FirstChar := 31;
  500.   LastChar := 255;
  501.   Widths := '[ 719 266 283 373 533 533 798 781 196 319 319 479 581 266 319 266 ' + CRLF +
  502.     '266 533 533 533 533 533 533 533 533 533 533 266 266 581 581 581 ' + CRLF +
  503.     '426 706 692 692 692 745 692 639 745 798 390 533 745 639 904 781 ' + CRLF +
  504.     '745 639 745 692 604 639 781 692 940 675 675 585 319 581 319 581 ' + CRLF +
  505.     '479 319 533 533 426 550 479 319 515 585 302 283 568 302 852 585 ' + CRLF +
  506.     '479 550 533 426 443 373 585 515 745 515 515 461 319 581 319 581 ' + CRLF +
  507.     '719 719 719 196 533 373 958 479 479 319 958 604 248 958 719 719 ' + CRLF +
  508.     '719 719 196 196 373 373 581 533 958 319 958 443 248 798 719 719 ' + CRLF +
  509.     '675 275 283 533 533 581 675 581 479 319 706 320 408 581 319 706 ' + CRLF +
  510.     '719 383 526 319 319 319 552 581 266 319 319 288 408 798 798 798 ' + CRLF +
  511.     '426 692 692 692 692 692 692 958 692 692 692 692 692 390 390 390 ' + CRLF +
  512.     '390 745 781 745 745 745 745 745 581 745 781 781 781 781 675 639 ' + CRLF +
  513.     '550 533 533 533 533 533 533 763 426 479 479 479 479 302 302 302 ' + CRLF +
  514.     '302 479 585 479 479 479 479 479 526 479 585 585 585 585 515 550 ' + CRLF +
  515.     '515 ]';
  516.   Encoding := 'WinAnsiEncoding';
  517.   FFontDescriptor := TPDFFontDescriptorDef.Create;
  518.   with FFontDescriptor do
  519.   begin
  520.     FontName := 'Century';
  521.     Flags := 34;
  522.     FontBBox := Rect(-219, -219, 1188, 1001);
  523.     Stemv := 78;
  524.     ItalicAngle := 0;
  525.     CapHeight := 1001;
  526.     Ascent := 1001;
  527.     Descent := -219;
  528.   end;
  529. end;
  530.  
  531. { TCenturyBoldFontDef }
  532. procedure TCenturyBoldFontDef.CreateFontDef;
  533. begin
  534.   FFontID := fiCenturyBold;
  535.   Subtype := 'TrueType';
  536.   BaseFont := 'Century,Bold';
  537.   FirstChar := 31;
  538.   LastChar := 255;
  539.   Widths := '[ 719 267 284 374 533 533 799 781 196 320 320 480 581 267 320 267 ' + CRLF +
  540.     '267 533 533 533 533 533 533 533 533 533 533 267 267 581 581 581 ' + CRLF +
  541.     '426 707 693 693 693 746 693 640 746 799 391 533 746 640 905 781 ' + CRLF +
  542.     '746 640 746 693 604 640 781 693 941 676 676 586 320 581 320 581 ' + CRLF +
  543.     '480 320 533 533 426 551 480 320 515 586 303 284 569 303 852 586 ' + CRLF +
  544.     '480 551 533 426 444 374 586 515 746 515 515 461 320 581 320 581 ' + CRLF +
  545.     '719 719 719 196 533 374 959 480 480 320 959 604 249 959 719 719 ' + CRLF +
  546.     '719 719 196 196 374 374 581 533 959 320 959 444 249 799 719 719 ' + CRLF +
  547.     '676 276 284 533 533 581 676 581 480 320 707 321 409 581 320 707 ' + CRLF +
  548.     '719 384 527 320 320 320 553 581 267 320 320 288 409 799 799 799 ' + CRLF +
  549.     '426 693 693 693 693 693 693 959 693 693 693 693 693 391 391 391 ' + CRLF +
  550.     '391 746 781 746 746 746 746 746 581 746 781 781 781 781 676 640 ' + CRLF +
  551.     '551 533 533 533 533 533 533 763 426 480 480 480 480 303 303 303 ' + CRLF +
  552.     '303 480 586 480 480 480 480 480 527 480 586 586 586 586 515 551 ' + CRLF +
  553.     '515 ]';
  554.   Encoding := 'WinAnsiEncoding';
  555.   FFontDescriptor := TPDFFontDescriptorDef.Create;
  556.   with FFontDescriptor do
  557.   begin
  558.     FontName := 'Century,Bold';
  559.     Flags := 16416;
  560.     FontBBox := Rect(-219, -219, 1189, 1001);
  561.     Stemv := 156;
  562.     ItalicAngle := 0;
  563.     CapHeight := 1001;
  564.     Ascent := 1001;
  565.     Descent := -219;
  566.   end;
  567. end;
  568.  
  569. { TArialFontDef }
  570. procedure TArialFontDef.CreateFontDef;
  571. begin
  572.   FFontID := fiArial;
  573.   Subtype := 'TrueType';
  574.   BaseFont := 'Arial';
  575.   FirstChar := 31;
  576.   LastChar := 255;
  577.   Widths := '[ 719 266 266 340 533 533 852 639 183 319 319 373 559 266 319 266 ' + CRLF +
  578.     '266 533 533 533 533 533 533 533 533 533 533 266 266 559 559 559 ' + CRLF +
  579.     '533 972 639 639 692 692 639 585 745 692 266 479 639 533 798 692 ' + CRLF +
  580.     '745 639 745 692 639 585 692 639 904 639 639 585 266 266 266 449 ' + CRLF +
  581.     '533 319 533 533 479 533 533 266 533 533 213 213 479 213 798 533 ' + CRLF +
  582.     '533 533 533 319 479 266 533 479 692 479 479 479 320 249 320 559 ' + CRLF +
  583.     '719 533 719 213 533 319 958 533 533 319 958 639 319 958 719 585 ' + CRLF +
  584.     '719 719 213 213 319 319 336 533 958 319 958 479 319 904 719 479 ' + CRLF +
  585.     '639 266 319 533 533 533 533 249 533 319 706 354 533 559 319 706 ' + CRLF +
  586.     '529 383 526 319 319 319 552 515 266 319 319 350 533 799 799 799 ' + CRLF +
  587.     '585 639 639 639 639 639 639 958 692 639 639 639 639 266 266 266 ' + CRLF +
  588.     '266 692 692 745 745 745 745 745 559 745 692 692 692 692 639 639 ' + CRLF +
  589.     '585 533 533 533 533 533 533 852 479 533 533 533 533 266 266 266 ' + CRLF +
  590.     '266 533 533 533 533 533 533 533 526 585 533 533 533 533 479 533 ' + CRLF +
  591.     '479 ]';
  592.   Encoding := 'WinAnsiEncoding';
  593.   FFontDescriptor := TPDFFontDescriptorDef.Create;
  594.   with FFontDescriptor do
  595.   begin
  596.     FontName := 'Arial';
  597.     Flags := 32;
  598.     FontBBox := Rect(-215, -215, 1313, 919);
  599.     Stemv := 78;
  600.     ItalicAngle := 0;
  601.     CapHeight := 919;
  602.     Ascent := 919;
  603.     Descent := -215;
  604.   end;
  605. end;
  606.  
  607. { TArialBoldFontDef }
  608. procedure TArialBoldFontDef.CreateFontDef;
  609. begin
  610.   FFontID := fiArialBold;
  611.   Subtype := 'TrueType';
  612.   BaseFont := 'Arial,Bold';
  613.   FirstChar := 31;
  614.   LastChar := 255;
  615.   Widths := '[ 719 266 319 454 533 533 852 692 228 319 319 373 559 266 319 266 ' + CRLF +
  616.     '266 533 533 533 533 533 533 533 533 533 533 319 319 559 559 559 ' + CRLF +
  617.     '585 934 692 692 692 692 639 585 745 692 266 533 692 585 798 692 ' + CRLF +
  618.     '745 639 745 692 639 585 692 639 904 639 639 585 319 266 319 559 ' + CRLF +
  619.     '533 319 533 585 533 585 533 319 585 585 266 266 533 266 852 585 ' + CRLF +
  620.     '585 585 585 373 533 319 585 533 745 533 533 479 373 268 373 559 ' + CRLF +
  621.     '719 533 719 266 533 479 958 533 533 319 958 639 319 958 719 585 ' + CRLF +
  622.     '719 719 266 266 479 479 336 533 958 319 958 533 319 904 719 479 ' + CRLF +
  623.     '639 266 319 533 533 533 533 268 533 319 706 354 533 559 319 706 ' + CRLF +
  624.     '529 383 526 319 319 319 552 533 266 319 319 350 533 799 799 799 ' + CRLF +
  625.     '585 692 692 692 692 692 692 958 692 639 639 639 639 266 266 266 ' + CRLF +
  626.     '266 692 692 745 745 745 745 745 559 745 692 692 692 692 639 639 ' + CRLF +
  627.     '585 533 533 533 533 533 533 852 533 533 533 533 533 266 266 266 ' + CRLF +
  628.     '266 585 585 585 585 585 585 585 526 585 585 585 585 585 533 585 ' + CRLF +
  629.     '533 ]';
  630.   Encoding := 'WinAnsiEncoding';
  631.   FFontDescriptor := TPDFFontDescriptorDef.Create;
  632.   with FFontDescriptor do
  633.   begin
  634.     FontName := 'Arial,Bold';
  635.     Flags := 16416;
  636.     FontBBox := Rect(-215, -215, 1261, 919);
  637.     Stemv := 78;
  638.     ItalicAngle := 0;
  639.     CapHeight := 919;
  640.     Ascent := 919;
  641.     Descent := -215;
  642.   end;
  643. end;
  644.  
  645.  
  646. { TCourierFontDef }
  647. procedure TCourierFontDef.CreateFontDef;
  648. begin
  649.   FFontID := fiCourier;
  650.   Subtype := 'TrueType';
  651.   BaseFont := 'Courier';
  652.   FirstChar := 31;
  653.   LastChar := 255;
  654.   Widths := '[ 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  655.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  656.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  657.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  658.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  659.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  660.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  661.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  662.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  663.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  664.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  665.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  666.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  667.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  668.     '575 ]';
  669.   Encoding := 'WinAnsiEncoding';
  670.   FFontDescriptor := TPDFFontDescriptorDef.Create;
  671.   with FFontDescriptor do
  672.   begin
  673.     FontName := 'Courier';
  674.     Flags := 32;
  675.     FontBBox := Rect(-305, -305, 669, 845);
  676.     Stemv := 78;
  677.     ItalicAngle := 0;
  678.     CapHeight := 845;
  679.     Ascent := 845;
  680.     Descent := -305;
  681.   end;
  682. end;
  683.  
  684. { TCourierBoldFontDef }
  685. procedure TCourierBoldFontDef.CreateFontDef;
  686. begin
  687.   FFontID := fiCourierBold;
  688.   Subtype := 'TrueType';
  689.   BaseFont := 'Courier,Bold';
  690.   FirstChar := 31;
  691.   LastChar := 255;
  692.   Widths := '[ 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  693.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  694.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  695.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  696.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  697.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  698.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  699.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  700.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  701.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  702.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  703.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  704.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  705.     '575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 ' + CRLF +
  706.     '575 ]';
  707.   Encoding := 'WinAnsiEncoding';
  708.   FFontDescriptor := TPDFFontDescriptorDef.Create;
  709.   with FFontDescriptor do
  710.   begin
  711.     FontName := 'Courier,Bold';
  712.     Flags := 16416;
  713.     FontBBox := Rect(-305, -305, 759, 845);
  714.     Stemv := 78;
  715.     ItalicAngle := 0;
  716.     CapHeight := 845;
  717.     Ascent := 845;
  718.     Descent := -305;
  719.   end;
  720. end;
  721.  
  722. { TMSMincyoFontDef }
  723. procedure TMSMincyoFontDef.CreateFontDef;
  724. begin
  725.   FFontID := fiMincyo;
  726.   Subtype := 'Type0';
  727.   BaseFont := '#82#6C#82#72#20#96#BE#92#A9';
  728.   Encoding := '90msp-RKSJ-H';
  729.   {*
  730.    * MincyoFontDefôαé┼MincyoDFontDef(DecandantFont)é≡ì∞ɼé╖éΘüB
  731.    *
  732.    *}
  733.   FDescendantFont := TMSMincyoDFontDef.Create;
  734. end;
  735.  
  736. { TMSMincyoDFontDef }
  737. procedure TMSMincyoDFontDef.CreateFontDef;
  738. begin
  739.   Subtype := 'CIDFontType2';
  740.   BaseFont := '#82#6C#82#72#20#96#BE#92#A9';
  741.   WinCharSet := 128;
  742.   CIDSystemInfo := '/Registry(Adobe)' + CRLF +
  743.                    '/Ordering(Japan1)' + CRLF +
  744.                    '/Supplement 2';
  745.   DW := 1000;
  746.   W := '[' + CRLF +
  747.     '1 [ 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  748.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  749.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  750.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  751.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  752.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479]' + CRLF +
  753.     '326 [ 958 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  754.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  755.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  756.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  757.     ']' + CRLF +
  758.     '631 631 479' + CRLF +
  759.     ']' + CRLF;
  760.   FFontDescriptor := TPDFFontDescriptorDef.Create;
  761.   with FFontDescriptor do
  762.   begin
  763.     FontName := '#82#6C#82#72#20#96#BE#92#A9';
  764.     Flags := 6;
  765.     FontBBox := Rect(-143, -143, 1015, 872);
  766.     Stemv := 78;
  767.     ItalicAngle := 0;
  768.     CapHeight := 872;
  769.     Ascent := 872;
  770.     Descent := -143;
  771.   end;
  772. end;
  773.  
  774. { TMSGothicFontDef }
  775. procedure TMSGothicFontDef.CreateFontDef;
  776. begin
  777.   FFontID := fiGothic;
  778.   Subtype := 'Type0';
  779.   BaseFont := '#82#6C#82#72#20#83#53#83#56#83#62#83#4E';
  780.   Encoding := '90msp-RKSJ-H';
  781.   {*
  782.    * GothicFontDefôαé┼GothicDFontDef(DecandantFont)é≡ì∞ɼé╖éΘüB
  783.    *
  784.    *}
  785.   FDescendantFont := TMSGothicDFontDef.Create;
  786. end;
  787.  
  788. { TMSGothicDFontDef }
  789. procedure TMSGothicDFontDef.CreateFontDef;
  790. begin
  791.   Subtype := 'CIDFontType2';
  792.   BaseFont := '#82#6C#82#72#20#83#53#83#56#83#62#83#4E';
  793.   WinCharSet := 128;
  794.   CIDSystemInfo := '/Registry(Adobe)' + CRLF +
  795.                    '/Ordering(Japan1)' + CRLF +
  796.                    '/Supplement 2';
  797.   DW := 1000;
  798.   W := '[' + CRLF +
  799.     '1 [ 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  800.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  801.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  802.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  803.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  804.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479]' + CRLF +
  805.     '326 [ 958 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  806.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  807.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  808.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  809.     ']' + CRLF +
  810.     '631 631 479' + CRLF +
  811.     ']' + CRLF;
  812.   FFontDescriptor := TPDFFontDescriptorDef.Create;
  813.   with FFontDescriptor do
  814.   begin
  815.     FontName := '#82#6C#82#72#20#83#53#83#56#83#62#83#4E';
  816.     Flags := 4;
  817.     FontBBox := Rect(-143, -143, 1015, 872);
  818.     Stemv := 78;
  819.     ItalicAngle := 0;
  820.     CapHeight := 872;
  821.     Ascent := 872;
  822.     Descent := -143;
  823.   end;
  824. end;
  825.  
  826. { TMSMincyoBFontDef }
  827. procedure TMSMincyoBFontDef.CreateFontDef;
  828. begin
  829.   FFontID := fiMincyoBold;
  830.   Subtype := 'Type0';
  831.   BaseFont := '#82#6C#82#72#20#96#BE#92#A9,Bold';
  832.   Encoding := '90msp-RKSJ-H';
  833.   {*
  834.    * MincyoFontDefôαé┼MincyoDFontDef(DecandantFont)é≡ì∞ɼé╖éΘüB
  835.    *
  836.    *}
  837.   FDescendantFont := TMSMincyoBDFontDef.Create;
  838. end;
  839.  
  840. { TMSMincyoBDFontDef }
  841. procedure TMSMincyoBDFontDef.CreateFontDef;
  842. begin
  843.   Subtype := 'CIDFontType2';
  844.   BaseFont := '#82#6C#82#72#20#96#BE#92#A9,Bold';
  845.   WinCharSet := 128;
  846.   CIDSystemInfo := '/Registry(Adobe)' + CRLF +
  847.                    '/Ordering(Japan1)' + CRLF +
  848.                    '/Supplement 2';
  849.   DW := 1000;
  850.   W := '[' + CRLF +
  851.     '1 [ 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  852.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  853.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  854.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  855.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  856.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479]' + CRLF +
  857.     '326 [ 958 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  858.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  859.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  860.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  861.     ']' + CRLF +
  862.     '631 631 479' + CRLF +
  863.     ']' + CRLF;
  864.   FFontDescriptor := TPDFFontDescriptorDef.Create;
  865.   with FFontDescriptor do
  866.   begin
  867.     FontName := '#82#6C#82#72#20#96#BE#92#A9,Bold';
  868.     Flags := 16391;
  869.     FontBBox := Rect(-143, -143, 1015, 872);
  870.     Stemv := 78;
  871.     ItalicAngle := 0;
  872.     CapHeight := 872;
  873.     Ascent := 872;
  874.     Descent := -143;
  875.   end;
  876. end;
  877.  
  878. { TMSGothicBFontDef }
  879. procedure TMSGothicBFontDef.CreateFontDef;
  880. begin
  881.   FFontID := fiGothicBold;
  882.   Subtype := 'Type0';
  883.   BaseFont := '#82#6C#82#72#20#83#53#83#56#83#62#83#4E,Bold';
  884.   Encoding := '90msp-RKSJ-H';
  885.   {*
  886.    * GothicFontDefôαé┼GothicDFontDef(DecandantFont)é≡ì∞ɼé╖éΘüB
  887.    *
  888.    *}
  889.   FDescendantFont := TMSGothicBDFontDef.Create;
  890. end;
  891.  
  892. { TMSGothicBDFontDef }
  893. procedure TMSGothicBDFontDef.CreateFontDef;
  894. begin
  895.   Subtype := 'CIDFontType2';
  896.   BaseFont := '#82#6C#82#72#20#83#53#83#56#83#62#83#4E,Bold';
  897.   WinCharSet := 128;
  898.   CIDSystemInfo := '/Registry(Adobe)' + CRLF +
  899.                    '/Ordering(Japan1)' + CRLF +
  900.                    '/Supplement 2';
  901.   DW := 1000;
  902.   W := '[' + CRLF +
  903.     '1 [ 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  904.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  905.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  906.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  907.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  908.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479]' + CRLF +
  909.     '326 [ 958 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  910.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  911.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  912.     '479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 479 ' + CRLF +
  913.     ']' + CRLF +
  914.     '631 631 479' + CRLF +
  915.     ']' + CRLF;
  916.   FFontDescriptor := TPDFFontDescriptorDef.Create;
  917.   with FFontDescriptor do
  918.   begin
  919.     FontName := '#82#6C#82#72#20#83#53#83#56#83#62#83#4E,Bold';
  920.     Flags := 16389;
  921.     FontBBox := Rect(-143, -143, 1015, 872);
  922.     Stemv := 159;
  923.     ItalicAngle := 0;
  924.     CapHeight := 872;
  925.     Ascent := 872;
  926.     Descent := -143;
  927.   end;
  928. end;
  929.  
  930.  
  931.  
  932. end.
  933.