Examples of FontFamily


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

Examples of com.scriptographer.ai.FontFamily

    // Try to preserve selected weight across fonts:
    ListEntry selected = weightList.getSelectedEntry();
    String current = selected != null ? selected.getText() : null;
    selected = null;
    weightList.removeAll();
    FontFamily family = getFontFamily();
    if (family != null) {
      for (FontWeight weight : family) {
        ListEntry entry = new ListEntry(weightList);
        String name = weight.getName();
        entry.setText(name);
View Full Code Here

Examples of net.rim.device.api.ui.FontFamily

                }
                _textbox_text.setTrait("#text", _textboxText);

                try {
                    // Obtain the font object corresponding to the text element
                    final FontFamily family = FontFamily.forName("BBMillbank");
                    final Font font =
                            family.getFont(Font.PLAIN, 15, Ui.UNITS_px);

                    // Set the X and Y co-ordinates of the cursor rect
                    _textbox_cursor.setFloatTrait("x",
                            (Display.getWidth() / 2 - 83 + font
                                    .getAdvance(_textboxText)));
View Full Code Here

Examples of net.sf.jasperreports.engine.fonts.FontFamily

        pdfFont = new PdfFont(jrFont.getPdfFontName(), jrFont.getPdfEncoding(), jrFont.isPdfEmbedded());
      }
      else
      {
        //fontName found in font extensions
        FontFamily family = fontInfo.getFontFamily();
        FontFace face = fontInfo.getFontFace();
        int faceStyle = java.awt.Font.PLAIN;

        if (face == null)
        {
          //fontName matches family name in font extension
          if (jrFont.isBold() && jrFont.isItalic())
          {
            face = family.getBoldItalicFace();
            faceStyle = java.awt.Font.BOLD | java.awt.Font.ITALIC;
          }
         
          if (face == null && jrFont.isBold())
          {
            face = family.getBoldFace();
            faceStyle = java.awt.Font.BOLD;
          }
         
          if (face == null && jrFont.isItalic())
          {
            face = family.getItalicFace();
            faceStyle = java.awt.Font.ITALIC;
          }
         
          if (face == null)
          {
            face = family.getNormalFace();
            faceStyle = java.awt.Font.PLAIN;
          }
           
//          if (face == null)
//          {
//            throw new JRRuntimeException("Font family '" + family.getName() + "' does not have the normal font face.");
//          }
        }
        else
        {
          //fontName matches face name in font extension; not family name
          faceStyle = fontInfo.getStyle();
        }
       
        String pdfFontName = null;
        int pdfFontStyle = java.awt.Font.PLAIN;
        if (jrFont.isBold() && jrFont.isItalic())
        {
          pdfFontName = family.getBoldItalicPdfFont();
          pdfFontStyle = java.awt.Font.BOLD | java.awt.Font.ITALIC;
        }
       
        if (pdfFontName == null && jrFont.isBold())
        {
          pdfFontName = family.getBoldPdfFont();
          pdfFontStyle = java.awt.Font.BOLD;
        }
       
        if (pdfFontName == null && jrFont.isItalic())
        {
          pdfFontName = family.getItalicPdfFont();
          pdfFontStyle = java.awt.Font.ITALIC;
        }
       
        if (pdfFontName == null)
        {
          pdfFontName = family.getNormalPdfFont();
          pdfFontStyle = java.awt.Font.PLAIN;
        }

        if (pdfFontName == null)
        {
          //in theory, face file cannot be null here
          pdfFontName = (face == null || face.getFile() == null ? jrFont.getPdfFontName() : face.getFile());
          pdfFontStyle = faceStyle;//FIXMEFONT not sure this is correct, in case we inherit pdfFontName from default properties
        }

//        String ttf = face.getFile();
//        if (ttf == null)
//        {
//          throw new JRRuntimeException("The '" + face.getName() + "' font face in family '" + family.getName() + "' returns a null file.");
//        }
       
        pdfFont =
          new PdfFont(
            pdfFontName,
            family.getPdfEncoding() == null ? jrFont.getPdfEncoding() : family.getPdfEncoding(),
             family.isPdfEmbedded() == null ? jrFont.isPdfEmbedded() : family.isPdfEmbedded().booleanValue(),
            jrFont.isBold() && ((pdfFontStyle & java.awt.Font.BOLD) == 0),
            jrFont.isItalic() && ((pdfFontStyle & java.awt.Font.ITALIC) == 0)
            );
      }
    }
View Full Code Here

Examples of net.sf.jasperreports.engine.fonts.FontFamily

  {
    //FIXMEFONT do some cache
    List families = ExtensionsEnvironment.getExtensionsRegistry().getExtensions(FontFamily.class);
    for (Iterator itf = families.iterator(); itf.hasNext();)
    {
      FontFamily family = (FontFamily)itf.next();
      if (locale == null || family.supportsLocale(locale))
      {
        if (name.equals(family.getName()))
        {
          return new FontInfo(family, null, Font.PLAIN);
        }
        FontFace face = family.getNormalFace();
        if (face != null && name.equals(face.getName()))
        {
          return new FontInfo(family, face, Font.PLAIN);
        }
        face = family.getBoldFace();
        if (face != null && name.equals(face.getName()))
        {
          return new FontInfo(family, face, Font.BOLD);
        }
        face = family.getItalicFace();
        if (face != null && name.equals(face.getName()))
        {
          return new FontInfo(family, face, Font.ITALIC);
        }
        face = family.getBoldItalicFace();
        if (face != null && name.equals(face.getName()))
        {
          return new FontInfo(family, face, Font.BOLD | Font.ITALIC);
        }
      }
View Full Code Here

Examples of net.sf.jasperreports.engine.fonts.FontFamily

    TreeSet familyNames = new TreeSet();//FIXMEFONT use collator for order?
    //FIXMEFONT do some cache
    List families = ExtensionsEnvironment.getExtensionsRegistry().getExtensions(FontFamily.class);
    for (Iterator itf = families.iterator(); itf.hasNext();)
    {
      FontFamily family = (FontFamily)itf.next();
      familyNames.add(family.getName());
    }
    return familyNames;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.fonts.FontFamily

    FontInfo fontInfo = getFontInfo(name, locale);
   
    if (fontInfo != null)
    {
      int faceStyle = Font.PLAIN;
      FontFamily family = fontInfo.getFontFamily();
      FontFace face = fontInfo.getFontFace();
      if (face == null)
      {
        if (((style & Font.BOLD) > 0) && ((style & Font.ITALIC) > 0))
        {
          face = family.getBoldItalicFace();
          faceStyle = Font.BOLD | Font.ITALIC;
        }
       
        if (face == null && ((style & Font.BOLD) > 0))
        {
          face = family.getBoldFace();
          faceStyle = Font.BOLD;
        }
       
        if (face == null && ((style & Font.ITALIC) > 0))
        {
          face = family.getItalicFace();
          faceStyle = Font.ITALIC;
        }
       
        if (face == null)
        {
          face = family.getNormalFace();
          faceStyle = Font.PLAIN;
        }
         
//        if (face == null)
//        {
//          throw new JRRuntimeException("Font family '" + family.getName() + "' does not have the normal font face.");
//        }
      }
      else
      {
        faceStyle = fontInfo.getStyle();
      }

      if (face == null)
      {
        // The font family does not specify any font face, not even a normal one.
        // In such case, we take the family name and consider it as JVM available font name.
        checkAwtFont(family.getName(), ignoreMissingFont);
       
        awtFont = new Font(family.getName(), style, size);
      }
      else
      {
        awtFont = face.getFont();
        if (awtFont == null)
        {
          throw new JRRuntimeException("The '" + face.getName() + "' font face in family '" + family.getName() + "' returns a null font.");
        }

        awtFont = awtFont.deriveFont((float)size);
       
        awtFont = awtFont.deriveFont(style & ~faceStyle);
View Full Code Here

Examples of net.sf.jasperreports.engine.fonts.FontFamily

    {
      FontInfo fontInfo = JRFontUtil.getFontInfo(fontFamilyAttr, locale);
      if (fontInfo != null)
      {
        //fontName found in font extensions
        FontFamily family = fontInfo.getFontFamily();
        String exportFont = family.getExportFont(exporterKey);
        if (exportFont != null)
        {
          fontFamily = exportFont;
        }
      }
View Full Code Here

Examples of net.sf.jasperreports.engine.fonts.FontFamily

    {
      FontInfo fontInfo = JRFontUtil.getFontInfo(fontFamilyAttr, locale);
      if (fontInfo != null)
      {
        //fontName found in font extensions
        FontFamily family = fontInfo.getFontFamily();
        String exportFont = family.getExportFont(getExporterKey());
        if (exportFont != null)
        {
          fontFamily = exportFont;
        }
      }
View Full Code Here

Examples of net.sf.jasperreports.engine.fonts.FontFamily

        {
          FontInfo fontInfo = JRFontUtil.getFontInfo(fontName, locale);
          if (fontInfo != null)
          {
            //fontName found in font extensions
            FontFamily family = fontInfo.getFontFamily();
            String exportFont = family.getExportFont(getExporterKey());
            if (exportFont != null)
            {
              fontName = exportFont;
            }
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.