1 -- Created on: 1993-01-11
2 -- Created by: CKY / Contract Toubro-Larsen ( TCD )
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class TextFontDef from IGESGraph inherits IGESEntity
19 ---Purpose : defines IGES Text Font Definition Entity, Type <310>
20 -- in package IGESGraph
22 -- Used to define the appearance of characters in a text font.
23 -- It may be used to describe a complete font or a
24 -- modification to a subset of characters in another font.
28 HAsciiString from TCollection,
29 HArray1OfInteger from TColStd,
30 HArray1OfHArray1OfInteger from IGESBasic
32 raises DimensionMismatch, OutOfRange
36 Create returns TextFontDef;
38 -- specific for the entity
42 aFontName : HAsciiString;
43 aSupersededFont : Integer;
44 aSupersededEntity : TextFontDef;
46 allASCIICodes : HArray1OfInteger;
47 allNextCharX : HArray1OfInteger;
48 allNextCharY : HArray1OfInteger;
49 allPenMotions : HArray1OfInteger;
50 allPenFlags : HArray1OfHArray1OfInteger;
51 allMovePenToX : HArray1OfHArray1OfInteger;
52 allMovePenToY : HArray1OfHArray1OfInteger)
53 raises DimensionMismatch;
54 ---Purpose : This method is used to set the fields of the class
56 -- - aFontCode : Font Code
57 -- - aFontName : Font Name
58 -- - aSupersededFont : Number of superseded font
59 -- - aSupersededEntity : Text Definition Entity
60 -- - aScale : No. of grid units = 1 text height unit
61 -- - allASCIICodes : ASCII codes for characters
62 -- - allNextCharX & Y : Grid locations of the next
63 -- character's origin (Integer vals)
64 -- - allPenMotions : No. of pen motions for the characters
65 -- - allPenFlags : Pen up/down flags,
66 -- 0 = Down (default), 1 = Up
67 -- - allMovePenToX & Y : Grid locations the pen will move to
68 -- This method initializes the fields of the class TextFontDef.
69 -- An exception is raised if the lengths of allASCIICodes,
70 -- allNextChars, allPenMotions, allPenFlags and allMovePenTo
73 FontCode (me) returns Integer;
74 ---Purpose : returns the font code.
76 FontName (me) returns HAsciiString from TCollection;
77 ---Purpose : returns the font name.
79 IsSupersededFontEntity (me) returns Boolean;
80 ---Purpose : True if this definition supersedes another
81 -- TextFontDefinition Entity,
82 -- False if it supersedes value.
84 SupersededFontCode (me) returns Integer;
85 ---Purpose : returns the font number which this entity modifies.
87 SupersededFontEntity (me) returns TextFontDef;
88 ---Purpose : returns the font entity which this entity modifies.
90 Scale (me) returns Integer;
91 ---Purpose : returns the number of grid units which equal one text height unit.
93 NbCharacters (me) returns Integer;
94 ---Purpose : returns the number of characters in this definition.
96 ASCIICode (me; Chnum : Integer) returns Integer
98 ---Purpose : returns the ASCII code of Chnum'th character.
99 -- Exception OutOfRange is raised if Chnum <= 0 or Chnum > NbCharacters
101 NextCharOrigin (me; Chnum : Integer; NX,NY : out Integer)
103 ---Purpose : returns grid location of origin of character next to Chnum'th char.
104 -- Exception OutOfRange is raised if Chnum <= 0 or Chnum > NbCharacters
106 NbPenMotions (me; Chnum : Integer) returns Integer
108 ---Purpose : returns number of pen motions for Chnum'th character.
109 -- Exception OutOfRange is raised if Chnum <= 0 or Chnum > NbCharacters
111 IsPenUp (me; Chnum : Integer; Motionnum : Integer) returns Boolean
113 ---Purpose : returns pen status(True if 1, False if 0) of Motionnum'th motion
114 -- of Chnum'th character.
115 -- Exception raised if Chnum <= 0 or Chnum > NbCharacters or
116 -- Motionnum <= 0 or Motionnum > NbPenMotions
118 NextPenPosition (me; Chnum : Integer; Motionnum : Integer;
121 -- returns, for Motionnum'th motion of Chnum'th character,
122 -- the grid location to which the pen is to move.
123 -- Exception raised if Chnum <= 0 or Chnum > NbCharacters or
124 -- Motionnum <= 0 or Motionnum > NbPenMotions
128 -- Class : IGESDraw_TextFontDef
130 -- Purpose : Declaration of the variables specific to a TextFontDef.
132 -- Reminder : A Text Font Definition Entity is defined by :
135 -- - number of the font or pointer to the TextFontDef which
136 -- this definition supersedes,
137 -- - number of grid units which equal one text height unit,
138 -- - ASCII codes for each character in this definition,
139 -- - Grid locations of next character's origin, for each char
140 -- - number of pen motions for each character,
141 -- - status of pen flag for each motion of each character,
142 -- - Grid location to which pen is to move, for each motion
146 theFontCode : Integer;
148 theFontName : HAsciiString;
150 theSupersededFontCode : Integer;
152 theSupersededFontEntity : TextFontDef;
156 theASCIICodes : HArray1OfInteger;
157 -- ASCII code for each character
159 theNextCharOriginX : HArray1OfInteger;
160 theNextCharOriginY : HArray1OfInteger;
161 -- For each character, Grid location of next character's origin
163 theNbPenMotions : HArray1OfInteger;
164 -- Number of pen motions for each character(Length = NbCharacters)
165 -- is (NM1 ,NM2 ....... NMn)
167 thePenMotions : HArray1OfHArray1OfInteger;
168 -- Status of Pen up/down flag for each character
169 -- flag : 0 = Down(Default)
171 -- Note : Inner HArray1 are of lengths NM1, NM2... NMn respectively
173 thePenMovesToX : HArray1OfHArray1OfInteger;
174 thePenMovesToY : HArray1OfHArray1OfInteger;
175 -- For each character, Grid location to which the pen is to move
176 -- Note : Inner HArray1 are of lengths NM1, NM2... NMn respectively