{oapdf_gg}
chapter block , short sentences and paragraphsblockblock (Chunk) is added to the document can be the smallest unit of text, blocks can be used to build other infrastructure elements such as phrases, paragraphs, anchors, etc., is a piece of string to determine the font, it is necessary to add the block When the document, all other variables are the layout to be defined. The following line, we have created a content of "hello World", red, italic, COURIER font, size 20, a block: Chunk chunk = new Chunk ( "Hello world", FontFactory.getFont (FontFactory.COURIER, 20, Font.ITALIC, new Color (255, 0, 0 ))); fontu typical 1: in this guide, in addition to the ninth chapter (where you can learn to use other fonts), we will always use the typical 1 fonts, which is different from the typical character 1: Courier (fixed width of the font) Helvetica Times Roman Symbol ZapfDingbats
u underline/strikethrough If you wish to have underlined a number of block or delete lines, you can do to change the font style simple: Chunk chunk1 = new Chunk ( "This text is underlined", FontFactory.getFont (FontFactory.HELVETICA, 12, Font.UNDERLINE )); Chunk chunk2 = new Chunk ( "This font is of type ITALIC | STRIKETHRU", FontFactory.getFont (FontFactory.HELVETICA, 12, Font.ITALIC | Font.STRIKETHRU )); u superscript/subscript in the block there are several ways to call, most of which will be described in the next chapter, this chapter is only one way to introduce setTextRise (float f). You can use the method in superscript or subscript in writing block. u block the background block if you want to change the background, you can use the method setBackground (Color color). This will be the text block to add a colored rectangle below: ck.setBackground (new Color (0xFF, 0xFF, 0x00 )); sample code in 0101, you can Overview of 1 and a typical use of fonts setTextRise, setBackground examples of such methods. phrasephrases (Phrases) is a series of specific pitch (the distance between two lines) as a parameter of the block, a phrase has a main character, but some of the phrases is different from the main block font with a font, Do you have more choices to create phrases, the use of some specific code, see 0202.
u ancient Greek because of frequent use of ancient Greek, in the category of Phrase constructor, there is a characteristic of:a string as a parameter (If you want to avoid such a situation, you can only use pieces of string can not be used to work), as 0203 in the sample code you can see, the feature of automatically 913-937 (except 903) and 945-969 (the ASCII value of ancient Greece) within the scope of all fonts changed to Greek symbols. u of non-essential not so much a feature of this is, as that is a flaw, but in any case, making the creation of a non-essential phrases or paragraphs of the possible, which will result in a bottom-up role in writing the interim (see sample code 0204). If you want a number of locations in the page will be moved to above may be useful. note, when you will not be able to check through the above, there is no way to let you return to the previous page. |