2 -- Copyright (c) 1993-1999 Matra Datavision
3 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
21 private class TextManager from PlotMgt inherits TextManager from MFT
25 PlaneAngle from Quantity,
26 TypeOfText from Aspect,
27 PlotterDriver from PlotMgt,
28 PlotterDriverPtr from PlotMgt
31 -------------------------
32 -- Category: Constructors
33 -------------------------
34 Create (aDriver : PlotterDriver from PlotMgt)
35 returns mutable TextManager from PlotMgt;
37 -------------------------
38 -- Category: Draw methods
39 -------------------------
40 BeginString (me: mutable;
41 X,Y: Length from Quantity;
42 anOrientation: PlaneAngle from Quantity;
43 aWidth,aHeight: Length from Quantity;
44 aSlant: PlaneAngle from Quantity;
45 aPaintType: Integer from Standard) is redefined;
46 ---Purpose: Calls when string drawing is started.
47 -- with a string aspect <aPaintType> :
48 -- 0 for filled string
49 -- 1 for stroke string
50 -- 2 for outline string
51 -- The origine of the string <X>,<Y>,
52 -- The orientation of the string <anOrientation>,
53 -- The medium size of the char <aWidth,aHeight>,
54 -- The Slant of the char <aSlant>,
56 BeginChar (me: mutable;
57 aCharCode: Integer from Standard;
58 X,Y: Length from Quantity)
59 returns Boolean from Standard is redefined;
60 ---Purpose: Calls when a char drawing is started
61 -- and give the current string position for this char.
62 -- and give the relative char position from the beginning
64 --The application can returns FALSE for skipping the char drawing.
66 SetCharBoundingBox (me: mutable;
67 X1,Y1,X2,Y2,X3,Y3,X4,Y4: Length from Quantity)
68 returns Boolean from Standard is redefined;
69 ---Purpose: Calls to defines the current char bounding-box.
70 -- The application can returns FALSE for ending the char drawing.
72 SetCharEncoding (me: mutable;
73 anEncoding: CString from Standard)
74 returns Boolean from Standard is redefined;
75 ---Purpose: Calls to defines the current char encoding.
76 -- Warning: The application can returns FALSE for skipping the char drawing.
78 Moveto (me: mutable; X,Y: Length from Quantity)
79 returns Boolean from Standard is redefined;
80 ---Purpose: Calls to sets the current string position.
81 -- The application can returns FALSE for ending the char drawing.
83 Lineto (me: mutable; X,Y: Length from Quantity)
84 returns Boolean from Standard is redefined;
85 ---Purpose: Calls to drawn to the current string position.
86 -- The application can returns FALSE for ending the char drawing.
88 Curveto (me: mutable; X1,Y1,X2,Y2,X3,Y3,X4,Y4: Length from Quantity)
89 returns Boolean from Standard is redefined;
90 ---Purpose: Calls to drawn to the current string position.
91 -- The application can drawn the curve defined by
92 -- his descriptor P1,P2,P3,P4 or
93 -- returns FALSE to let the interpretor compute the curve
96 ClosePath (me: mutable) is redefined;
97 ---Purpose: Calls when a char path drawing is ended
99 EndChar (me: mutable; X,Y: Length from Quantity)
100 returns Boolean from Standard is redefined;
101 ---Purpose: Calls when a char drawing is ended
102 -- and give the relative char ending position from the
103 -- beginning of the string.
104 -- The application can returns FALSE for skipping the string
107 EndString (me: mutable ) is redefined;
108 ---Purpose: Calls when string drawing is ended (Normally the last call).
110 -- Category: Private methods
111 -------------------------
112 SetTextAttribs (me: mutable;
113 aTextColor: Integer from Standard;
114 aTypeOfText: TypeOfText from Aspect;
115 anUnderlinePosition: Length from Quantity = 0.0)
117 ---Purpose: Sets the current attribs of the text.
120 myDriver : PlotterDriverPtr from PlotMgt;
123 class PlotterDriver from PlotMgt
125 end TextManager from PlotMgt;