» Archive for September, 2006

WP-dp.SyntaxHighlighter:source code syntax highlighting plugin

Thursday, September 28th, 2006 by rubypdf

Introduce
WP-dp.SyntaxHighlighter is a source code syntax highlighting plugin,Supported languages:

  • C#
  • CSS
  • C++
  • VB & VB.NET
  • Delphi, Pascal
  • Java
  • JavaScript
  • PHP
  • Python
  • Ruby
  • SQL
  • XML, HTML, XSLT and any other XML style code

Base on dp.SyntaxHighlighter, I created my first plugin: WP-dp.SyntaxHighlighter.
So you can get the Features,Compatability,Built-in tools,Examples,Usage guidefrom http://www.dreamprojections.com/SyntaxHighlighter/.

Reference:
dp.SyntaxHighlighter is a free JavaScript tool for source code syntax highlighting.
The script is meant to help a developer to post code snippets online with ease and without having to worry about applying format. People who use blogs like MovableType, .Text (dotText), dasBlog and any other system can easily add code to their posts.

TrueTypeCollections

Thursday, September 28th, 2006 by rubypdf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import java.io.FileOutputStream;
import java.io.IOException;
 
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Font;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfWriter;
 
/**
 * This example was written by Bruno Lowagie. It is part of the book 'iText in
 * Action' by Manning Publications. 
 * ISBN: 1932394796
 * http://itext.ugent.be/itext-in-action/ 
 * http://www.manning.com/lowagie/
 */
 
public class TrueTypeCollections {
 
	/**
	 * Generates a PDF file with a TrueType Font from a TrueType Collection.
	 * 
	 * @param args
	 *            no arguments needed here
	 */
	public static void main(String[] args) {
		System.out.println("Chapter 8: example TrueTypeCollections");
		System.out.println("-> Creates a PDF file with a TTC font.");
		System.out.println("-> jars needed: iText.jar");
		System.out.println("-> resources needed: c:/windows/fonts/msgothic.ttc");
		System.out.println("-> file generated: ttc.pdf");
 
		// step 1
		Document document = new Document();
		try {
			// step 2
			PdfWriter.getInstance(document, new FileOutputStream("ttc.pdf"));
 
			// step 3: we open the document
			document.open();
			// step 4
			BaseFont bf;
			Font font;
			bf = BaseFont.createFont("c:/windows/fonts/msgothic.ttc,0",
					BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
			font = new Font(bf, 12);
			System.err.println(bf.getClass().getName());
			document.add(new Paragraph("Rash鬽on", font));
			document.add(new Paragraph("Directed by Akira Kurosawa", font));
			document.add(new Paragraph("\u7f85\u751f\u9580", font));
			String[] names = BaseFont
					.enumerateTTCNames("c:/windows/fonts/msgothic.ttc");
			for (int i = 0; i < names.length; i++) {
				document
						.add(new Paragraph("font " + i + ": " + names[i], font));
			}
		} catch (DocumentException de) {
			System.err.println(de.getMessage());
		} catch (IOException ioe) {
			System.err.println(ioe.getMessage());
		}
 
		// step 5: we close the document
		document.close();
	}
}