Examples of Font


Examples of com.jagpdf.Font

        Canvas canvas = doc.page().canvas();

        //[java_example_string
        /*` An example should make it clear. Let's load a standard ISO-8859-2
            encoded font. */
        Font helv = doc.font_load("standard; enc=iso-8859-2; name=Helvetica; size=24");
        canvas.text_font(helv);
        /*` One of the languages representable by this encoding is Czech. We can
          pass a Unicode string ['úplnÄ›k] (full moon). [lib] converts the string
          to ISO-8859-2 and it is shown correctly. */
        String full_moon_cze = "\u00fapln\u011bk";
        canvas.text(50, 800, full_moon_cze); // ok
        /*` If we pass Swedish ['fullmåne], letter ['å] will not be shown
         because ISO-8859-2 does not represent such character. We should have
         used ISO-8859-1 encoded font instead. */
        String full_moon_swe = "fullm\u00e5ne";
        canvas.text(50, 760, full_moon_swe); // wrong
        /*` Let's load a Unicode encoded TrueType font. */
        //<-
        /* //->
        Font dejavu = doc.font_load("enc=utf-8; file=DejaVuSans.ttf; size=24");
        //<- */
        String res_dir = testlib.getResourcesDir();
        String dejavu_file = res_dir + "/fonts/DejaVuSans.ttf";
        Font dejavu = doc.font_load("enc=utf-8; file=" + dejavu_file + "; size=24");
        //->
        canvas.text_font(dejavu);
        /*` Now we can mix Czech and Swedish and it will be shown correctly as
            [lib] converts the strings to UTF-8.*/
        canvas.text(50, 720, full_moon_swe);
View Full Code Here

Examples of com.jgraph.gaeawt.java.awt.Font

    in.close();

    Graphics2D g2 = imageARGB.createGraphics();
    g2.rotate(-Math.PI / 12, image.getWidth() / 2, image.getHeight() / 2);
    String s = "bella";
    Font font = new Font("Serif", Font.PLAIN, 192);
    FontRenderContext frc = g2.getFontRenderContext();
    //GlyphVector gv = font.createGlyphVector(frc, s);
    //Shape clippingShape = gv.getOutline(10, 200);
    // FIXME when font rendering implemented
    //g2.clip(clippingShape);
View Full Code Here

Examples of com.lowagie.text.Font

    }
   
    private Phrase composePhrase(String text, BaseFont ufont, Color color, float fontSize) {
        Phrase phrase = null;
        if (extensionFont == null && (substitutionFonts == null || substitutionFonts.isEmpty()))
            phrase = new Phrase(new Chunk(text, new Font(ufont, fontSize, 0, color)));
        else {
            FontSelector fs = new FontSelector();
            fs.addFont(new Font(ufont, fontSize, 0, color));
            if (extensionFont != null)
                fs.addFont(new Font(extensionFont, fontSize, 0, color));
            if (substitutionFonts != null) {
                for (int k = 0; k < substitutionFonts.size(); ++k) {
                    fs.addFont(new Font((BaseFont)substitutionFonts.get(k), fontSize, 0, color));
                }
            }
            phrase = fs.process(text);
        }
        return phrase;
View Full Code Here

Examples of com.lowagie.text.Font

      if (pageEmpty) return;
      if (currentHeight + line.height() + leading > indentTop() - indentBottom()) return;
        leading = extraspace;
        carriageReturn();
        if (f.isUnderlined() || f.isStrikethru()) {
            f = new Font(f);
            int style = f.getStyle();
            style &= ~Font.UNDERLINE;
            style &= ~Font.STRIKETHRU;
            f.setStyle(Font.UNDEFINED);
            f.setStyle(style);
View Full Code Here

Examples of com.sun.dtv.lwuit.Font

    public void drawMonthView(Graphics g, com.sun.dtv.lwuit.Calendar cal, Component mv) {

        drawBorder(g, mv, 0x020202, 0x080808, 2);
        setFG(g, mv);

        Font f = mv.getStyle().getFont();
        int fh = f.getHeight();

        int w = mv.getWidth();
        int h = mv.getHeight();
        int labelH = (fh + DAY_SPACE_H);
        int ch = h - labelH;

        int dayWidth = (w / 7);
        int dayHeight = (ch / 6);

        long sd = cal.getSelectedDay();
        Date date = new Date();

        int fix = f.stringWidth("22") / 2;


        g.setColor(mv.getStyle().getBgSelectionColor());
        g.fillRect(mv.getX() + 2, mv.getY() + 2, mv.getWidth() - 4, mv.getStyle().getFont().getHeight());
View Full Code Here

Examples of de.lessvoid.nifty.renderer.lwjgl.render.font.Font

public class LwjglRenderFont implements RenderFont {
  private Font font;

  public LwjglRenderFont(final String name, final RenderDevice device) {
    font = new Font(device);
    font.init(name);
  }
View Full Code Here

Examples of fm.ak.otse.font.Font

        SUIL38M.getGlyph(':').setInfo(Glyph.DeriveStart(), 51 * 2, 8, 0, 0);
        SUIL38M.getGlyph(';').setInfo(Glyph.DeriveStart(), 51 * 2, 8, 0, 0);
        SUIL38M.getGlyph('-').setInfo(Glyph.DeriveStart(), 51 * 2, 15, 0, 0);
        SUIL38M.getGlyph('=').setInfo(Glyph.DeriveStart(), 51 * 2, 25, 0, 0);

        SegoeUILight38 = new Font(Main.main.sheet1, "SegoeUILight38", SUIL38M);

        Metrics SUIL14M = new Metrics();
        SUIL14M.Height = 19;
        SUIL14M.Baseline = 16;

        SUIL14M.getGlyph(' ').setInfo(0, 153, 4, 0, 0);
        SUIL14M.getGlyph('a').setInfo(Glyph.DeriveStart(), 153, 7, 0, 0);
        SUIL14M.getGlyph('b').setInfo(Glyph.DeriveStart(), 153, 8, 0, 0);
        SUIL14M.getGlyph('c').setInfo(Glyph.DeriveStart(), 153, 6, 0, 0);
        SUIL14M.getGlyph('d').setInfo(Glyph.DeriveStart(), 153, 8, 0, 0);
        SUIL14M.getGlyph('e').setInfo(Glyph.DeriveStart(), 153, 7, 0, 0);
        SUIL14M.getGlyph('f').setInfo(Glyph.DeriveStart(), 153, 5, 0, 1);
        SUIL14M.getGlyph('g').setInfo(Glyph.DeriveStart() + 3, 153, 8, 0, 0);
        SUIL14M.getGlyph('h').setInfo(Glyph.DeriveStart(), 153, 8, 0, 0);
        SUIL14M.getGlyph('i').setInfo(Glyph.DeriveStart(), 153, 3, 0, 0);
        SUIL14M.getGlyph('j').setInfo(Glyph.DeriveStart() + 2, 153, 5, 2, 0);
        SUIL14M.getGlyph('k').setInfo(Glyph.DeriveStart(), 153, 7, 0, 1);
        SUIL14M.getGlyph('l').setInfo(Glyph.DeriveStart() + 3, 153, 3, 0, 0);
        SUIL14M.getGlyph('m').setInfo(Glyph.DeriveStart(), 153, 12, 0, 0);
        SUIL14M.getGlyph('n').setInfo(Glyph.DeriveStart(), 153, 8, 0, 0);
        SUIL14M.getGlyph('o').setInfo(Glyph.DeriveStart(), 153, 8, 0, 0);
        SUIL14M.getGlyph('p').setInfo(Glyph.DeriveStart(), 153, 8, 0, 0);
        SUIL14M.getGlyph('q').setInfo(Glyph.DeriveStart(), 153, 8, 0, 0);
        SUIL14M.getGlyph('r').setInfo(Glyph.DeriveStart(), 153, 5, 0, 0);
        SUIL14M.getGlyph('s').setInfo(Glyph.DeriveStart(), 153, 5, 0, 0);
        SUIL14M.getGlyph('t').setInfo(Glyph.DeriveStart(), 153, 4, 0, 0);
        SUIL14M.getGlyph('u').setInfo(Glyph.DeriveStart(), 153, 8, 0, 0);
        SUIL14M.getGlyph('v').setInfo(Glyph.DeriveStart(), 153, 7, 0, 1);
        SUIL14M.getGlyph('w').setInfo(Glyph.DeriveStart() + 3, 153, 10, 0, 1);
        SUIL14M.getGlyph('x').setInfo(Glyph.DeriveStart() + 3, 153, 6, 0, 0);
        SUIL14M.getGlyph('y').setInfo(Glyph.DeriveStart(), 153, 7, 0, 1);
        SUIL14M.getGlyph('z').setInfo(Glyph.DeriveStart() + 3, 153, 7, 0, 0);
       
        SUIL14M.getGlyph('1').setInfo(Glyph.DeriveStart() + 4, 153, 5, 0, 0);
        SUIL14M.getGlyph('2').setInfo(Glyph.DeriveStart(), 153, 7, 0, 0);
        SUIL14M.getGlyph('3').setInfo(Glyph.DeriveStart(), 153, 7, 0, 0);
        SUIL14M.getGlyph('4').setInfo(Glyph.DeriveStart(), 153, 8, 0, 1);
        SUIL14M.getGlyph('5').setInfo(Glyph.DeriveStart() + 3, 153, 7, 0, 0);
        SUIL14M.getGlyph('6').setInfo(Glyph.DeriveStart(), 153, 7, 0, 0);
        SUIL14M.getGlyph('7').setInfo(Glyph.DeriveStart(), 153, 7, 0, 0);
        SUIL14M.getGlyph('8').setInfo(Glyph.DeriveStart(), 153, 7, 0, 0);
        SUIL14M.getGlyph('9').setInfo(Glyph.DeriveStart(), 153, 7, 0, 0);
        SUIL14M.getGlyph('0').setInfo(Glyph.DeriveStart(), 153, 7, 0, 0);

        SUIL14M.getGlyph('A').setInfo(0, 172, 9, 0, 0);
        SUIL14M.getGlyph('B').setInfo(Glyph.DeriveStart(), 172, 8, 0, 0);
        SUIL14M.getGlyph('C').setInfo(Glyph.DeriveStart(), 172, 9, 0, 0);
        SUIL14M.getGlyph('D').setInfo(Glyph.DeriveStart(), 172, 9, 0, 0);
        SUIL14M.getGlyph('E').setInfo(Glyph.DeriveStart(), 172, 7, 0, 0);
        SUIL14M.getGlyph('F').setInfo(Glyph.DeriveStart(), 172, 7, 0, 0);
        SUIL14M.getGlyph('G').setInfo(Glyph.DeriveStart(), 172, 9, 0, 0);
        SUIL14M.getGlyph('H').setInfo(Glyph.DeriveStart(), 172, 9, 0, 0);
        SUIL14M.getGlyph('I').setInfo(Glyph.DeriveStart(), 172, 3, 0, 0);
        SUIL14M.getGlyph('J').setInfo(Glyph.DeriveStart(), 172, 5, 0, 0);
        SUIL14M.getGlyph('K').setInfo(Glyph.DeriveStart(), 172, 8, 0, 1);
        SUIL14M.getGlyph('L').setInfo(Glyph.DeriveStart() + 3, 172, 6, 0, 0);
        SUIL14M.getGlyph('M').setInfo(Glyph.DeriveStart(), 172, 12, 0, 0);
        SUIL14M.getGlyph('N').setInfo(Glyph.DeriveStart(), 172, 10, 0, 0);
        SUIL14M.getGlyph('O').setInfo(Glyph.DeriveStart(), 172, 11, 0, 0);
        SUIL14M.getGlyph('P').setInfo(Glyph.DeriveStart(), 172, 8, 0, 0);
        SUIL14M.getGlyph('Q').setInfo(Glyph.DeriveStart(), 172, 11, 0, 0);
        SUIL14M.getGlyph('R').setInfo(Glyph.DeriveStart(), 172, 8, 0, 0);
        SUIL14M.getGlyph('S').setInfo(Glyph.DeriveStart(), 172, 7, 0, 0);
        SUIL14M.getGlyph('T').setInfo(Glyph.DeriveStart(), 172, 7, 0, 0);
        SUIL14M.getGlyph('U').setInfo(Glyph.DeriveStart(), 172, 9, 0, 0);
        SUIL14M.getGlyph('V').setInfo(Glyph.DeriveStart(), 172, 9, 0, 1);
        SUIL14M.getGlyph('W').setInfo(Glyph.DeriveStart() + 3, 172, 13, 0, 0);
        SUIL14M.getGlyph('X').setInfo(Glyph.DeriveStart(), 172, 8, 0, 0);
        SUIL14M.getGlyph('Y').setInfo(Glyph.DeriveStart(), 172, 8, 0, 0);
        SUIL14M.getGlyph('Z').setInfo(Glyph.DeriveStart(), 172, 8, 0, 0);

        SUIL14M.getGlyph('.').setInfo(0, 191, 3, 0, 0);
        SUIL14M.getGlyph(',').setInfo(Glyph.DeriveStart(), 191, 3, 0, 0);
        SUIL14M.getGlyph('?').setInfo(Glyph.DeriveStart(), 191, 6, 0, 0);
        SUIL14M.getGlyph('!').setInfo(Glyph.DeriveStart(), 191, 4, 0, 0);
        SUIL14M.getGlyph('\'').setInfo(Glyph.DeriveStart(), 191, 3, 0, 0);
        SUIL14M.getGlyph('"').setInfo(Glyph.DeriveStart(), 191, 5, 0, 0);
        SUIL14M.getGlyph(':').setInfo(Glyph.DeriveStart(), 191, 3, 0, 0);
        SUIL14M.getGlyph(';').setInfo(Glyph.DeriveStart(), 191, 3, 0, 0);
        SUIL14M.getGlyph('-').setInfo(Glyph.DeriveStart(), 191, 6, 0, 0);
        SUIL14M.getGlyph('=').setInfo(Glyph.DeriveStart(), 191, 9, 0, 0);

        SegoeUILight14 = new Font(Main.main.sheet1, "SegoeUILight14", SUIL14M);
    }
View Full Code Here

Examples of it.stefanobertini.zebra.beans.Font

public class BarcodeTextTest {

    @Test
    public void test() {

  BarcodeText command = new BarcodeText(new Font("4", 0), 10);

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("BARCODE-TEXT 4 0 10");

  assertCommand(output, command);
View Full Code Here

Examples of java.awt.Font

    FontMetrics metric = grp.getFontMetrics();
    for (Channel channel : channelArr) {
      String msg = channel.getCopyrightNotice();
      // repeatedly reduce the font size while the copyright notice is wider than the column
      while (metric.stringWidth(msg) > mColumnWidth) {
        Font font = grp.getFont();
        grp.setFont(font.deriveFont((float)(font.getSize()-1)));
        metric = grp.getFontMetrics();
      }
    }
    for (int i = 0; i < channelArr.length; i++) {
      String msg = channelArr[i].getCopyrightNotice();
View Full Code Here

Examples of java.awt.Font

  public Font getDefault() {
    if (mCachedValue == null) {
      // do not use the getAllFontFamilyNames() method as that leads to scanning
      // the system for all font files
      for (String knownFont : KNOWN_GOOD_FONTS) {
        final Font font = new Font(knownFont, mDefFont.getStyle(), mDefFont
            .getSize());
        // comparing the font name and Font.DIALOG is not really correct.
        // font family name would be more precise, but takes too much time
        if (font != null && !font.getName().startsWith(Font.DIALOG)) {
          mCachedValue = font;
          break;
        }
      }
    }
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.