001: /*
002: * Copyright (c) 2007, intarsys consulting GmbH
003: *
004: * Redistribution and use in source and binary forms, with or without
005: * modification, are permitted provided that the following conditions are met:
006: *
007: * - Redistributions of source code must retain the above copyright notice,
008: * this list of conditions and the following disclaimer.
009: *
010: * - Redistributions in binary form must reproduce the above copyright notice,
011: * this list of conditions and the following disclaimer in the documentation
012: * and/or other materials provided with the distribution.
013: *
014: * - Neither the name of intarsys nor the names of its contributors may be used
015: * to endorse or promote products derived from this software without specific
016: * prior written permission.
017: *
018: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
019: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
020: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
021: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
022: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
023: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
024: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
025: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
026: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
027: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
028: * POSSIBILITY OF SUCH DAMAGE.
029: */
030: package de.intarsys.font.truetype;
031:
032: /**
033: *
034: */
035: public class TTMetrics {
036: private short xAvgCharWidth;
037:
038: private int usWeightClass;
039:
040: private int usWidthClass;
041:
042: private int fsType;
043:
044: private short ySubscriptXSize;
045:
046: private short ySubscriptYSize;
047:
048: private short ySubscriptXOffset;
049:
050: private short ySubscriptYOffset;
051:
052: private short ySuperscriptXSize;
053:
054: private short ySuperscriptYSize;
055:
056: private short ySuperscriptXOffset;
057:
058: private short ySuperscriptYOffset;
059:
060: private short yStrikeoutSize;
061:
062: private short yStrikeoutPosition;
063:
064: private short sFamilyClass;
065:
066: private TTMetricsPanose panose;
067:
068: private byte[] achVendID = new byte[4];
069:
070: private int fsSelection;
071:
072: private int usFirstCharIndex;
073:
074: private int usLastCharIndex;
075:
076: private short sTypoAscender;
077:
078: private short sTypoDescender;
079:
080: private short sTypoLineGap;
081:
082: private int usWinAscent;
083:
084: private int usWinDescent;
085:
086: private short sxHeight;
087:
088: private short sCapHeight;
089:
090: private int usDefaultChar;
091:
092: private int usBreakChar;
093:
094: private int usMaxContext;
095:
096: public short getSCapHeight() {
097: return sCapHeight;
098: }
099:
100: public void setSCapHeight(short capHeight) {
101: sCapHeight = capHeight;
102: }
103:
104: public short getSxHeight() {
105: return sxHeight;
106: }
107:
108: public void setSxHeight(short sxHeight) {
109: this .sxHeight = sxHeight;
110: }
111:
112: public int getUsBreakChar() {
113: return usBreakChar;
114: }
115:
116: public void setUsBreakChar(int usBreakChar) {
117: this .usBreakChar = usBreakChar;
118: }
119:
120: public int getUsDefaultChar() {
121: return usDefaultChar;
122: }
123:
124: public void setUsDefaultChar(int usDefaultChar) {
125: this .usDefaultChar = usDefaultChar;
126: }
127:
128: public int getUsMaxContext() {
129: return usMaxContext;
130: }
131:
132: public void setUsMaxContext(int usMaxContext) {
133: this .usMaxContext = usMaxContext;
134: }
135:
136: public void setAchVendID(byte[] bs) {
137: achVendID = bs;
138: }
139:
140: public byte[] getAchVendID() {
141: return achVendID;
142: }
143:
144: public void setFsSelection(int i) {
145: fsSelection = i;
146: }
147:
148: public int getFsSelection() {
149: return fsSelection;
150: }
151:
152: public void setFsType(int s) {
153: fsType = s;
154: }
155:
156: public int getFsType() {
157: return fsType;
158: }
159:
160: public void setPanose(byte[] bs) {
161: if ((bs != null) && (bs.length == 10)) {
162: panose = new TTMetricsPanose(bs);
163: }
164: }
165:
166: public TTMetricsPanose getPanose() {
167: return panose;
168: }
169:
170: public void setSFamilyClass(short s) {
171: sFamilyClass = s;
172: }
173:
174: public short getSFamilyClass() {
175: return sFamilyClass;
176: }
177:
178: public void setSTypoAscender(short s) {
179: sTypoAscender = s;
180: }
181:
182: public short getSTypoAscender() {
183: return sTypoAscender;
184: }
185:
186: public void setSTypoDescender(short s) {
187: sTypoDescender = s;
188: }
189:
190: public short getSTypoDescender() {
191: return sTypoDescender;
192: }
193:
194: public void setSTypoLineGap(short s) {
195:
196: sTypoLineGap = s;
197: }
198:
199: public short getSTypoLineGap() {
200: return sTypoLineGap;
201: }
202:
203: public void setUsFirstCharIndex(int i) {
204: usFirstCharIndex = i;
205: }
206:
207: public int getUsFirstCharIndex() {
208: return usFirstCharIndex;
209: }
210:
211: public void setUsLastCharIndex(int i) {
212: usLastCharIndex = i;
213: }
214:
215: public int getUsLastCharIndex() {
216: return usLastCharIndex;
217: }
218:
219: public void setUsWeightClass(int i) {
220: usWeightClass = i;
221: }
222:
223: public int getUsWeightClass() {
224: return usWeightClass;
225: }
226:
227: public void setUsWidthClass(int i) {
228: usWidthClass = i;
229: }
230:
231: public int getUsWidthClass() {
232: return usWidthClass;
233: }
234:
235: public void setUsWinAscent(int i) {
236: usWinAscent = i;
237: }
238:
239: public int getUsWinAscent() {
240: return usWinAscent;
241: }
242:
243: public void setUsWinDescent(int i) {
244: usWinDescent = i;
245: }
246:
247: public int getUsWinDescent() {
248: return usWinDescent;
249: }
250:
251: public void setXAvgCharWidth(short s) {
252: xAvgCharWidth = s;
253: }
254:
255: public short getXAvgCharWidth() {
256: return xAvgCharWidth;
257: }
258:
259: public void setYStrikeoutPosition(short s) {
260: yStrikeoutPosition = s;
261: }
262:
263: public short getYStrikeoutPosition() {
264: return yStrikeoutPosition;
265: }
266:
267: public void setYStrikeoutSize(short s) {
268: yStrikeoutSize = s;
269: }
270:
271: public short getYStrikeoutSize() {
272: return yStrikeoutSize;
273: }
274:
275: public void setYSubscriptXOffset(short s) {
276: ySubscriptXOffset = s;
277: }
278:
279: public short getYSubscriptXOffset() {
280: return ySubscriptXOffset;
281: }
282:
283: public void setYSubscriptXSize(short s) {
284: ySubscriptXSize = s;
285: }
286:
287: public short getYSubscriptXSize() {
288: return ySubscriptXSize;
289: }
290:
291: public void setYSubscriptYOffset(short s) {
292: ySubscriptYOffset = s;
293: }
294:
295: public short getYSubscriptYOffset() {
296: return ySubscriptYOffset;
297: }
298:
299: public void setYSubscriptYSize(short s) {
300: ySubscriptYSize = s;
301: }
302:
303: public short getYSubscriptYSize() {
304: return ySubscriptYSize;
305: }
306:
307: public void setYSuperscriptXOffset(short s) {
308: ySuperscriptXOffset = s;
309: }
310:
311: public short getYSuperscriptXOffset() {
312: return ySuperscriptXOffset;
313: }
314:
315: public void setYSuperscriptXSize(short s) {
316: ySuperscriptXSize = s;
317: }
318:
319: public short getYSuperscriptXSize() {
320: return ySuperscriptXSize;
321: }
322:
323: public void setYSuperscriptYOffset(short s) {
324: ySuperscriptYOffset = s;
325: }
326:
327: public short getYSuperscriptYOffset() {
328: return ySuperscriptYOffset;
329: }
330:
331: public void setYSuperscriptYSize(short s) {
332: ySuperscriptYSize = s;
333: }
334:
335: public short getYSuperscriptYSize() {
336: return ySuperscriptYSize;
337: }
338: }
|