Package cli.System.Drawing

Examples of cli.System.Drawing.FontFamily


          familyName = Font.DIALOG_INPUT;
            return FontFamily.get_GenericSansSerif();
        }
        try{
            if(false) throw new cli.System.ArgumentException();
            return new FontFamily(name);
        }catch(cli.System.ArgumentException ex){
          // continue
        }
       
        //now we want map specific Name to a shorter Family Name like "Arial Bold" --> "Arial"
        String shortName = name;
        int spaceIdx = shortName.lastIndexOf(' ');
        while(spaceIdx > 0){
          shortName = shortName.substring(0, spaceIdx).trim();
            try{
                if(false) throw new cli.System.ArgumentException();
                return new FontFamily(shortName);
            }catch(cli.System.ArgumentException ex){
              // continue
            }
          spaceIdx = shortName.lastIndexOf(' ');
        }
       
        //now we want map generic names to specific families like "courier" --> "Courier New"
        FontFamily[] fontFanilies = FontFamily.get_Families();
        name = name.toLowerCase();
        for (int i = 0; i < fontFanilies.length; i++) {
      FontFamily fontFamily = fontFanilies[i];
      if(fontFamily.get_Name().toLowerCase().startsWith(name)){
        return fontFamily;
      }
    }
       
        //we have not find a valid font, we use the default font
View Full Code Here

TOP

Related Classes of cli.System.Drawing.FontFamily

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.