Home | History | Annotate | Download | only in font
      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 /**
     18  * @author Ilya S. Okomin
     19  * @version $Revision$
     20  *
     21  */
     22 package org.apache.harmony.awt.gl.font;
     23 
     24 /**
     25  * Android FontProperty implementation, applicable for Linux formats of
     26  * font property files.
     27  */
     28 public class AndroidFontProperty extends FontProperty {
     29 
     30     /** xlfd string that is applicable for Linux font.properties */
     31     String xlfd;
     32 
     33     /** logical name of the font corresponding to this FontProperty */
     34     String logicalName;
     35 
     36     /** style name of the font corresponding to this FontProperty */
     37     String styleName;
     38 
     39     public AndroidFontProperty(String _logicalName, String _styleName, String _fileName, String _name, String _xlfd, int _style, int[] exclusionRange, String _encoding){
     40         this.logicalName = _logicalName;
     41         this.styleName = _styleName;
     42         this.name = _name;
     43         this.encoding = _encoding;
     44         this.exclRange = exclusionRange;
     45         this.fileName = _fileName;
     46         this.xlfd = _xlfd;
     47         this.style = _style;
     48     }
     49 
     50     /**
     51      * Returns logical name of the font corresponding to this FontProperty.
     52      */
     53     public String getLogicalName(){
     54         return logicalName;
     55     }
     56 
     57     /**
     58      * Returns style name of the font corresponding to this FontProperty.
     59      */
     60     public String getStyleName(){
     61         return styleName;
     62     }
     63 
     64     /**
     65      * Returns xlfd string of this FontProperty.
     66      */
     67     public String getXLFD(){
     68         return xlfd;
     69     }
     70 
     71     public String toString(){
     72         return new String(this.getClass().getName() +
     73                 "[name=" + name + //$NON-NLS-1$
     74                 ",fileName="+ fileName + //$NON-NLS-1$
     75                 ",Charset=" + encoding + //$NON-NLS-1$
     76                 ",exclRange=" + exclRange + //$NON-NLS-1$
     77                 ",xlfd=" + xlfd + "]"); //$NON-NLS-1$ //$NON-NLS-2$
     78 
     79     }
     80 
     81 }
     82