The graphics2d package of the FreeHEP library - PowerPoint PPT Presentation

About This Presentation
Title:

The graphics2d package of the FreeHEP library

Description:

The graphics2d package of the FreeHEP library. Simon Fischer ... dup 24 /breve put. dup 25 /caron put. dup 255 /ydieresis put. readonly def. currentdict end ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 18
Provided by: simonf1
Learn more at: http://java.freehep.org
Category:

less

Transcript and Presenter's Notes

Title: The graphics2d package of the FreeHEP library


1
The graphics2d package of the FreeHEP library
  • Simon Fischer (University of Dortmund)
  • Sami Kama (METU, Ankara)

2
Overview
  1. Features
  2. Package structure and inheritance tree
  3. Users view example and demo
  4. PDFGraphics2D
  5. Font inclusion
  6. Todo

3
1.1 Features
  • Export graphics displayed on the screen to a file
  • in a portable format (PDF, PS)
  • independent of the generating application (e.g.
    JAS/WIRED)
  • additional features (limited html strings,
    symbols)
  • Subclass the java.awt.Graphics2D
  • easily export everything that can be rendered by
    a graphics context

PDF File
4
1.2 Division of Work
  • What we built on
  • Mark Dönszelmann PDF writer and utilities
  • Charles Loomis PSGraphics and VectorGraphics
    interfaces
  • Whats new?
  • PDFGraphics2D
  • Type1 and Type3 font embedding both for ps and
    pdf
  • multipage output

5
2.1 The graphics2d Inheritance Tree
GraphicsdrawLine()drawString()drawImage()
Java 1.1
Graphics2Ddraw(Shape)setTransform()setStroke()
Java 2
6
2.2 The VectorGraphics2D Implementations
  • VectorGraphics2D implementations
  • PixelGraphics2D
  • PDFGraphics2D
  • PSGraphics2D
  • SVGGraphics2D
  • Additional Exportfilters for bitmaps
  • gif, png, ppm

7
2.3 Additional Utility Classes
8
3.1 Code Example
public static void export(Component component
String filename)
throws IOException
PDFGraphics2D graphics PDFGraphics2D.createP
DFGraphics2D( component.getSize(),
new FileOutputStream(filename) )
graphics.writeHeader() component.printAll(graph
ics) graphics.donePrinting()
9
D E M O
10
4. PDFGraphics2D
VectorGraphics2D
MultipageDocument
PDFImageDelayQueue
PDFPaintDelayQueue
PDFFontTable
GenericTagHandler
PDFWriter implements PathConstructor
11
5.1 Font Embedding (1)
  • Embed shapes of glyphs plus metric information in
    PDF/PS files
  • Type3 fonts
  • simple
  • large files
  • Type1 fonts
  • more difficult (binary, encrypted) representation
  • compact format (filesize approx. factor 5)
  • hints for better display/rendering of fonts

12
5.2 Font Embedding (2)
Hello W
13
5.3 Generation of CharTables
CharTabletoName()toEncoding()toUnicode()
14
5.4 Font Enbedding (3)
Font
PDFLatin
15
5.5 Font Embedding (4)
!FontType1-1.0 Monotype Corsiva Generated by
org.freehep.graphics2d.FontEmbedderType111 dict
begin/FontInfo 8 dict dup begin/FullName
(Monotype Corsiva) readonly def/FamilyName
(Monotype Corsiva) readonly defend readonly
def/Encoding 256 array0 1 255 1 index exch
/.notdef put fordup 24 /breve putdup 25 /caron
put...dup 255 /ydieresis putreadonly
defcurrentdict enddup /Private 8 dict dup
begin2 index /CharStrings 230 dict dup
begin/breve 91 RD binary dataND/caron 40 RD
binary dataND.../ydieresis 360 binary
dataND/.notdef 38 RD binary dataNDend end
readonly put noaccess putdup /FontName get exch
definefont pop
16
5.6 Font Embedding Classes
FontIncluder
FontEmbedder
FontEmbedderPDF
FontEmbedderType1
FontEmbedderPDFType3
FontEmbedderType1PDF
FontEmbedderPS
17
6. Todo
  • PDF
  • thumbnails and bookmarks for PDF
  • cyclic gradient and custom fill
  • Fonts
  • add hints to type 1 fonts
  • Misc
  • progress bar for exporting files
Write a Comment
User Comments (0)
About PowerShow.com