增加一个段落

@param font 字体信息{@link Font}
@param texts 段落中的文本，支持多个文本作为一个段落
@return this
187890
public Word07Writer addText(Font font, String... texts) {
		return addText(null, font, texts);
	}
340096
public final void setFont(Font font) {
        this.font = font;
        textRenderer = new TextRenderer(font.getAWTFont(), true, true);
    }
195030
public DataRange text(String... texts) {
        if (texts == null || texts.length == 0) {
            return this;
        }
        this.text().addAll(Arrays.asList(texts));
        return this;
    }
1229972
protected Label createLabel(String text) {

        Label label = new Label(text);
        Style style = label.getElement().getStyle();
        style.setMarginTop(10, Unit.PX);
        style.setMarginBottom(4, Unit.PX);
        style.setFontWeight(FontWeight.BOLD);
        return label;
    }
230430
public boolean addContentFontFaceContainerStyle(final FontFaceContainerStyle ffcStyle) {
        final FontFace fontFace = ffcStyle.getFontFace();
        if (fontFace != null) {
            this.fontFaces.add(fontFace);
        }
        return this.addContentStyle(ffcStyle);
    }
1193514
public void addFont(Font font) {
        if (font.getBaseFont() != null) {
            fonts.add(font);
            return;
        }
        BaseFont bf = font.getCalculatedBaseFont(true);
        Font f2 = new Font(bf, font.getSize(), font.getCalculatedStyle(), font.getColor());
        fonts.add(f2);
    }
283892
public boolean setTypeface(GVRContext gvrContext, String font) {
        return setTypeface(gvrContext, font, fontStyleTypes.PLAIN);
    }
355131
public FontChooser setSelectedFontFamily(String name) {
        String[] names = getFontFamilies();
        for (int i = 0; i < names.length; i++) {
            if (names[i].toLowerCase().equals(name.toLowerCase())) {
                getFontFamilyList().setSelectedIndex(i);
                break;
            }
        }
        updateSampleFont();
        return this;
    }
1303996
def encode_text(text, fonts)
      # text must be a unicode string and fonts must be an array.
      # this is an internal method, don't perform tests.
      fonts_array = []
      fonts.each do |name|
        f = Fonts.get_font name
        fonts_array << f if f
      end

      # before starting, we should reorder any RTL content in the string
      text = reorder_rtl_content text

      out = []
      text.chars.each do |c|
        fonts_array.each_index do |i|
          next unless fonts_array[i].cmap.nil? || (fonts_array[i].cmap && fonts_array[i].cmap[c])
          # add to array
          if out.last.nil? || out.last[0] != fonts[i]
            out.last[1] << '>' unless out.last.nil?
            out << [fonts[i], '<', 0, 0]
          end
          out.last[1] << (fonts_array[i].cmap.nil? ? (c.unpack('H*')[0]) : fonts_array[i].cmap[c])
          if fonts_array[i].metrics[c]
            out.last[2] += fonts_array[i].metrics[c][:wx].to_f
            out.last[3] += fonts_array[i].metrics[c][:wy].to_f
          end
          break
        end
      end
      out.last[1] << '>' if out.last
      out
    end
1112353
public void showText (final String text) throws IOException
  {
    if (!inTextMode)
    {
      throw new IllegalStateException ("Must call beginText() before showText()");
    }

    if (fontStack.isEmpty ())
    {
      throw new IllegalStateException ("Must call setFont() before showText()");
    }

    final PDFont font = fontStack.peek ();

    // Unicode code points to keep when subsetting
    if (font.willBeSubset ())
    {
      for (int offset = 0; offset < text.length ();)
      {
        final int codePoint = text.codePointAt (offset);
        font.addToSubset (codePoint);
        offset += Character.charCount (codePoint);
      }
    }

    COSWriter.writeString (font.encode (text), m_aOS);
    write ((byte) ' ');
    writeOperator ((byte) 'T', (byte) 'j');
  }
650127
public void showText(PdfTextArray text) {
        if (state.fontDetails == null)
            throw new NullPointerException("Font and size must be set before writing any text");
        content.append("[");
        ArrayList arrayList = text.getArrayList();
        boolean lastWasNumber = false;
        for (int k = 0; k < arrayList.size(); ++k) {
            Object obj = arrayList.get(k);
            if (obj instanceof String) {
                showText2((String)obj);
                lastWasNumber = false;
            }
            else {
                if (lastWasNumber)
                    content.append(' ');
                else
                    lastWasNumber = true;
                content.append(((Float)obj).floatValue());
            }
        }
        content.append("]TJ").append_i(separator);
    }
1263682
private Font randomFont() {
        Random r = new Random();
        int index = r.nextInt(this.fontNames.length);
        String fontName = this.fontNames[index];
        int style = r.nextInt(4);
        int size = (this.fontSizeRange > 0 ? r.nextInt(this.fontSizeRange) : 0) + this.fontBasicSize;
        return new Font(fontName, style, size);
    }
1361770
public void registerFont (String name, java.awt.Font font) {
    if (font == null) throw new NullPointerException();
    fonts.put(name, font);
  }
1006007
public static PdfTextArray getKernArray(String text, BaseFont font) {
        PdfTextArray pa = new PdfTextArray();
        StringBuffer acc = new StringBuffer();
        int len = text.length() - 1;
        char c[] = text.toCharArray();
        if (len >= 0)
            acc.append(c, 0, 1);
        for (int k = 0; k < len; ++k) {
            char c2 = c[k + 1];
            int kern = font.getKerning(c[k], c2);
            if (kern == 0) {
                acc.append(c2);
            }
            else {
                pa.add(acc.toString());
                acc.setLength(0);
                acc.append(c, k + 1, 1);
                pa.add(-kern);
            }
        }
        pa.add(acc.toString());
        return pa;
    }
766780
public function setFont($font) {

		if(false === is_string($font)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($font)), E_USER_ERROR);
		}

		$file = new File($font);

		if(false === $file -> exists()) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be an existing font', __METHOD__), E_USER_ERROR);
		}

		$this -> font = $file;

		return $this;
	}
896149
public static Font createFont(InputStream fontStream) {
		try {
			return Font.createFont(Font.TRUETYPE_FONT, fontStream);
		} catch (FontFormatException e) {
			// True Type字体无效时使用Type1字体
			try {
				return Font.createFont(Font.TYPE1_FONT, fontStream);
			} catch (Exception e1) {
				throw new UtilException(e1);
			}
		} catch (IOException e) {
			throw new IORuntimeException(e);
		}
	}
1067067
public TextColumn addAll(List<String> stringValues) {
        for (String stringValue : stringValues) {
            append(stringValue);
        }
        return this;
    }