/*
* $Id$
* Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
package org.apache.fop.pdf;
import org.apache.fop.fonts.FontType;
/**
* Class representing a Type3 font.
*
* CAUTION: this is not yet fully implemented!!!!!!!
* the /CharProcs is still missing its toPDF() method.
*
* Type3 fonts are specified on page 206 and onwards of the PDF 1.3 spec.
*/
public class PDFFontType3 extends PDFFontNonBase14 {
/**
* font's required /FontBBox bounding box
*/
protected PDFRectangle fontBBox;
/**
* font's required /FontMatrix array
*/
protected PDFArray fontMatrix;
/**
* font's required /CharProcs dictionary
*/
protected PDFCharProcs charProcs;
/**
* font's optional /Resources object
*/
protected PDFResources resources;
/**
* Create the /Font object
*
* @param number the object's number
* @param fontname the internal name for the font
* @param basefont the base font name
* @param encoding the character encoding schema used by the font
*/
public PDFFontType3(int number, String fontname,
String basefont,
Object encoding) {
/* generic creation of PDF object */
super(number, fontname, FontType.TYPE3, basefont, encoding /* , mapping */);
this.fontBBox = null;
this.fontMatrix = null;
this.charProcs = null;
}
/**
* Create the /Font object
*
* @param number the object's number
* @param fontname the internal name for the font
* @param basefont the base font name
* @param encoding the character encoding schema used by the font
* @param fontBBox the font's bounding box
* @param fontMatrix the font's transformation matrix
* @param charProcs the glyphs' definitions
*/
public PDFFontType3(int number, String fontname,
String basefont,
Object encoding,
PDFRectangle fontBBox, PDFArray fontMatrix,
PDFCharProcs charProcs) {
/* generic creation of PDF object */
super(number, fontname, FontType.TYPE3, basefont, encoding /* , mapping */);
this.fontBBox = fontBBox;
this.fontMatrix = fontMatrix;
this.charProcs = charProcs;
}
/**
* Set the font's bounding box
*
* @param bbox bounding box for the font
*/
public void setFontBBox(PDFRectangle bbox) {
this.fontBBox = bbox;
}
/**
* Set the font's transformation matrix
*
* @param matrix the transformation matrix for the font
*/
public void setFontMatrix(PDFArray matrix) {
this.fontMatrix = matrix;
}
/**
* Set the glyphs' definitions.
*
* The /CharProcs object needs to be registered in the document's resources.
*
* @param chars the glyphs' dictionary
*/
public void setCharProcs(PDFCharProcs chars) {
this.charProcs = chars;
}
/**
* @see org.apache.fop.pdf.PDFFont#fillInPDF(StringBuffer)
*/
protected void fillInPDF(StringBuffer target) {
if (fontBBox != null) {
target.append("\n/FontBBox ");
target.append(fontBBox.toPDF());
}
if (fontMatrix != null) {
target.append("\n/FontMatrix ");
target.append(fontMatrix.toPDF());
}
if (charProcs != null) {
target.append("\n/CharProcs ");
target.append(charProcs.referencePDF());
}
}
}
ion value='exclude-element-screenshot'>exclude-element-screenshot
Vaadin 6, 7, 8 is a Java framework for modern Java web applications: https://github.com/vaadin/framework
---
title: Client-Side Module Descriptor
order: 3
layout: page
---
[[clientside.module]]
= Client-Side Module Descriptor
Client-side Vaadin modules, such as the Vaadin Client-Side Engine (widget set)
or pure client-side applications, that are to be compiled to JavaScript, are
defined in a __module descriptor__ ( [filename]#.gwt.xml#) file.
When defining a widget set to build the Vaadin client-side engine, the only
necessary task is to inherit a base widget set. If you are developing a regular
widget set, you should normally inherit the [classname]#DefaultWidgetSet#.
----
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
<!-- Inherit the default widget set -->
<inherits name="com.vaadin.DefaultWidgetSet" />
</module>
----
If you are developing a pure client-side application, you should instead inherit
[classname]#com.vaadin.Vaadin#, as described in
<<dummy/../../../framework/clientsideapp/clientsideapp-overview.asciidoc#clientsideapp.overview,"Client-Side
Applications">>. In that case, the module descriptor also needs an entry-point.
If you are using the Eclipse IDE, the New Vaadin Widget wizard will
automatically create the GWT module descriptor. See
<<dummy/../../../framework/gwt/gwt-eclipse#gwt.eclipse.widget,"Creating a
Widget">> for detailed instructions.
[[clientside.module.stylesheet]]
== Specifying a Stylesheet
A client-side module can include CSS stylesheets. When the module is compiled,
these stylesheets are copied to the output target. In the module descriptor,
define a [literal]#++stylesheet++# element.
For example, if you are developing a custom widget and want to have a default
stylesheet for it, you could define it as follows:
----
<stylesheet src="mywidget/styles.css"/>
----
The specified path is relative to the __public__ folder under the folder of the
module descriptor.
[[gwt.module.compilation-limiting]]
== Limiting Compilation Targets
Compiling widget sets takes considerable time. You can reduce the compilation
time significantly by compiling the widget sets only for your browser, which is
useful during development. You can do this by setting the
[parameter]#user.agent# property in the module descriptor.
----
<set-property name="user.agent" value="gecko1_8"/>
----
The [parameter]#value# attribute should match your browser. The browsers
supported by GWT depend on the GWT version, below is a list of browser
identifiers supported by GWT.
.GWT User Agents
[options="header"]
|===============
|Identifier|Name
|ie6|Internet Explorer 6
|ie8|Internet Explorer 8
|gecko1_8|Mozilla Firefox 1.5 and later
|safari|Apple Safari and other Webkit-based browsers including Google Chrome
|opera|Opera
|ie9|Internet Explorer 9
|===============
For more information about the GWT Module XML Format, please see Google Web
Toolkit Developer Guide.