| 1 | -- Created on: 1993-09-07 |
| 2 | -- Created by: GG |
| 3 | -- Copyright (c) 1993-1999 Matra Datavision |
| 4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
| 5 | -- |
| 6 | -- The content of this file is subject to the Open CASCADE Technology Public |
| 7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
| 8 | -- except in compliance with the License. Please obtain a copy of the License |
| 9 | -- at http://www.opencascade.org and read it completely before using this file. |
| 10 | -- |
| 11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
| 12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
| 13 | -- |
| 14 | -- The Original Code and all software distributed under the License is |
| 15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
| 16 | -- Initial Developer hereby disclaims all such warranties, including without |
| 17 | -- limitation, any warranties of merchantability, fitness for a particular |
| 18 | -- purpose or non-infringement. Please see the License for the specific terms |
| 19 | -- and conditions governing the rights and limitations under the License. |
| 20 | |
| 21 | |
| 22 | class FontMap from Aspect inherits TShared from MMgt |
| 23 | |
| 24 | ---Version: 0.0 |
| 25 | |
| 26 | ---Purpose: This class defines a FontMap object. |
| 27 | ---Keywords: |
| 28 | ---Warning: |
| 29 | ---References: |
| 30 | uses |
| 31 | FontStyle from Aspect, |
| 32 | FontMapEntry from Aspect, |
| 33 | SequenceOfFontMapEntry from Aspect |
| 34 | |
| 35 | raises |
| 36 | BadAccess from Aspect |
| 37 | |
| 38 | is |
| 39 | |
| 40 | Create returns mutable FontMap from Aspect; |
| 41 | |
| 42 | AddEntry (me : mutable; AnEntry : FontMapEntry from Aspect) |
| 43 | ---Level: Public |
| 44 | ---Purpose: Adds an entry in the font map <me>. |
| 45 | -- Warning: Raises BadAccess if FontMap size is exceeded. |
| 46 | raises BadAccess from Aspect; |
| 47 | |
| 48 | AddEntry (me : mutable; aStyle : FontStyle from Aspect) |
| 49 | returns Integer from Standard; |
| 50 | ---Level: Public |
| 51 | ---Purpose: Search an identical font style entry in the font map <me> |
| 52 | -- and returns the FontMapEntry Index if exist. |
| 53 | -- Or add a new entry and returns the computed FontMapEntry index used. |
| 54 | |
| 55 | Size( me ) returns Integer from Standard is static; |
| 56 | ---Level: Public |
| 57 | ---Purpose: Returns the Allocated fontmap Size |
| 58 | |
| 59 | Index( me ; aFontmapIndex : Integer ) returns Integer from Standard |
| 60 | ---Level: Public |
| 61 | ---Purpose: Returns the FontMapEntry.Index of the FontMap |
| 62 | -- at rank <aFontmapIndex> . |
| 63 | raises BadAccess from Aspect is static; |
| 64 | ---Trigger: Raises BadAccess if the index less than 1 or |
| 65 | -- greater than Size. |
| 66 | |
| 67 | Dump( me ) ; |
| 68 | |
| 69 | Entry ( me ; |
| 70 | AnIndex : Integer from Standard ) |
| 71 | returns FontMapEntry from Aspect |
| 72 | ---Level: Public |
| 73 | ---Purpose: Returns the Font map entry with the index <AnIndex>. |
| 74 | -- Warning: Raises BadAccess if the index less than 1 |
| 75 | -- or greater than Size. |
| 76 | raises BadAccess from Aspect is static; |
| 77 | |
| 78 | fields |
| 79 | |
| 80 | mydata : SequenceOfFontMapEntry from Aspect is protected; |
| 81 | |
| 82 | end FontMap ; |