1
2 package org.freehep.graphicsio.emf.gdi;
3
4 import java.io.IOException;
5
6 import org.freehep.graphicsio.emf.EMFConstants;
7 import org.freehep.graphicsio.emf.EMFInputStream;
8 import org.freehep.graphicsio.emf.EMFOutputStream;
9
10
11
12
13
14
15
16 public class Panose implements EMFConstants {
17
18 private int familyType;
19
20 private int serifStyle;
21
22 private int weight;
23
24 private int proportion;
25
26 private int contrast;
27
28 private int strokeVariation;
29
30 private int armStyle;
31
32 private int letterForm;
33
34 private int midLine;
35
36 private int xHeight;
37
38 public Panose() {
39
40 this.familyType = PAN_NO_FIT;
41 this.serifStyle = PAN_NO_FIT;
42 this.proportion = PAN_NO_FIT;
43 this.weight = PAN_NO_FIT;
44 this.contrast = PAN_NO_FIT;
45 this.strokeVariation = PAN_NO_FIT;
46 this.armStyle = PAN_ANY;
47 this.letterForm = PAN_ANY;
48 this.midLine = PAN_ANY;
49 this.xHeight = PAN_ANY;
50 }
51
52 public Panose(EMFInputStream emf) throws IOException {
53 familyType = emf.readBYTE();
54 serifStyle = emf.readBYTE();
55 proportion = emf.readBYTE();
56 weight = emf.readBYTE();
57 contrast = emf.readBYTE();
58 strokeVariation = emf.readBYTE();
59 armStyle = emf.readBYTE();
60 letterForm = emf.readBYTE();
61 midLine = emf.readBYTE();
62 xHeight = emf.readBYTE();
63 }
64
65 public void write(EMFOutputStream emf) throws IOException {
66 emf.writeBYTE(familyType);
67 emf.writeBYTE(serifStyle);
68 emf.writeBYTE(weight);
69 emf.writeBYTE(proportion);
70 emf.writeBYTE(contrast);
71 emf.writeBYTE(strokeVariation);
72 emf.writeBYTE(armStyle);
73 emf.writeBYTE(letterForm);
74 emf.writeBYTE(midLine);
75 emf.writeBYTE(xHeight);
76 }
77
78 public String toString() {
79 return " Panose\n" + " familytype: " + familyType +
80 "\n serifStyle: " + serifStyle +
81 "\n weight: " + weight +
82 "\n proportion: " + proportion +
83 "\n contrast: " + contrast +
84 "\n strokeVariation: " + strokeVariation +
85 "\n armStyle: " + armStyle +
86 "\n letterForm: " + letterForm +
87 "\n midLine: " + midLine +
88 "\n xHeight: " + xHeight;
89 }
90 }