1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 package org.apache.fontbox.afm; 18 19 import java.util.ArrayList; 20 import java.util.List; 21 22 import org.apache.fontbox.util.BoundingBox; 23 24 /** 25 * This class represents a single character metric. 26 * 27 * @author Ben Litchfield (ben@benlitchfield.com) 28 * @version $Revision: 1.1 $ 29 */ 30 public class CharMetric 31 { 32 private int characterCode; 33 34 private float wx; 35 private float w0x; 36 private float w1x; 37 38 private float wy; 39 private float w0y; 40 private float w1y; 41 42 private float[] w; 43 private float[] w0; 44 private float[] w1; 45 private float[] vv; 46 47 private String name; 48 private BoundingBox boundingBox; 49 private List<Ligature> ligatures = new ArrayList<Ligature>(); 50 51 /** Getter for property boundingBox. 52 * @return Value of property boundingBox. 53 */ 54 public BoundingBox getBoundingBox() 55 { 56 return boundingBox; 57 } 58 59 /** Setter for property boundingBox. 60 * @param bBox New value of property boundingBox. 61 */ 62 public void setBoundingBox(BoundingBox bBox) 63 { 64 boundingBox = bBox; 65 } 66 67 /** Getter for property characterCode. 68 * @return Value of property characterCode. 69 */ 70 public int getCharacterCode() 71 { 72 return characterCode; 73 } 74 75 /** Setter for property characterCode. 76 * @param cCode New value of property characterCode. 77 */ 78 public void setCharacterCode(int cCode) 79 { 80 characterCode = cCode; 81 } 82 83 /** 84 * This will add an entry to the list of ligatures. 85 * 86 * @param ligature The ligature to add. 87 */ 88 public void addLigature( Ligature ligature ) 89 { 90 ligatures.add( ligature ); 91 } 92 93 /** Getter for property ligatures. 94 * @return Value of property ligatures. 95 */ 96 public List<Ligature> getLigatures() 97 { 98 return ligatures; 99 } 100 101 /** Setter for property ligatures. 102 * @param lig New value of property ligatures. 103 */ 104 public void setLigatures(List<Ligature> lig) 105 { 106 this.ligatures = lig; 107 } 108 109 /** Getter for property name. 110 * @return Value of property name. 111 */ 112 public String getName() 113 { 114 return name; 115 } 116 117 /** Setter for property name. 118 * @param n New value of property name. 119 */ 120 public void setName(String n) 121 { 122 this.name = n; 123 } 124 125 /** Getter for property vv. 126 * @return Value of property vv. 127 */ 128 public float[] getVv() 129 { 130 return this.vv; 131 } 132 133 /** Setter for property vv. 134 * @param vvValue New value of property vv. 135 */ 136 public void setVv(float[] vvValue) 137 { 138 this.vv = vvValue; 139 } 140 141 /** Getter for property w. 142 * @return Value of property w. 143 */ 144 public float[] getW() 145 { 146 return this.w; 147 } 148 149 /** Setter for property w. 150 * @param wValue New value of property w. 151 */ 152 public void setW(float[] wValue) 153 { 154 this.w = wValue; 155 } 156 157 /** Getter for property w0. 158 * @return Value of property w0. 159 */ 160 public float[] getW0() 161 { 162 return this.w0; 163 } 164 165 /** Setter for property w0. 166 * @param w0Value New value of property w0. 167 */ 168 public void setW0(float[] w0Value) 169 { 170 w0 = w0Value; 171 } 172 173 /** Getter for property w0x. 174 * @return Value of property w0x. 175 */ 176 public float getW0x() 177 { 178 return w0x; 179 } 180 181 /** Setter for property w0x. 182 * @param w0xValue New value of property w0x. 183 */ 184 public void setW0x(float w0xValue) 185 { 186 w0x = w0xValue; 187 } 188 189 /** Getter for property w0y. 190 * @return Value of property w0y. 191 */ 192 public float getW0y() 193 { 194 return w0y; 195 } 196 197 /** Setter for property w0y. 198 * @param w0yValue New value of property w0y. 199 */ 200 public void setW0y(float w0yValue) 201 { 202 w0y = w0yValue; 203 } 204 205 /** Getter for property w1. 206 * @return Value of property w1. 207 */ 208 public float[] getW1() 209 { 210 return this.w1; 211 } 212 213 /** Setter for property w1. 214 * @param w1Value New value of property w1. 215 */ 216 public void setW1(float[] w1Value) 217 { 218 w1 = w1Value; 219 } 220 221 /** Getter for property w1x. 222 * @return Value of property w1x. 223 */ 224 public float getW1x() 225 { 226 return w1x; 227 } 228 229 /** Setter for property w1x. 230 * @param w1xValue New value of property w1x. 231 */ 232 public void setW1x(float w1xValue) 233 { 234 w1x = w1xValue; 235 } 236 237 /** Getter for property w1y. 238 * @return Value of property w1y. 239 */ 240 public float getW1y() 241 { 242 return w1y; 243 } 244 245 /** Setter for property w1y. 246 * @param w1yValue New value of property w1y. 247 */ 248 public void setW1y(float w1yValue) 249 { 250 w1y = w1yValue; 251 } 252 253 /** Getter for property wx. 254 * @return Value of property wx. 255 */ 256 public float getWx() 257 { 258 return wx; 259 } 260 261 /** Setter for property wx. 262 * @param wxValue New value of property wx. 263 */ 264 public void setWx(float wxValue) 265 { 266 wx = wxValue; 267 } 268 269 /** Getter for property wy. 270 * @return Value of property wy. 271 */ 272 public float getWy() 273 { 274 return wy; 275 } 276 277 /** Setter for property wy. 278 * @param wyValue New value of property wy. 279 */ 280 public void setWy(float wyValue) 281 { 282 this.wy = wyValue; 283 } 284 285 }