|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dante.extex.interpreter.type.AbstractCode
de.dante.extex.interpreter.type.AbstractAssignment
de.dante.extex.interpreter.primitives.register.font.FontPrimitive
This class provides an implementation for the primitive
The primitive \font can be used to load a font with some specified
properties and assign it to a control sequence. The primary option is the
specification of a size for the font. If no size is given then the font is
loaded at its design size.
An exact size can be specified with the at keyword. The dimension
following this keyword determines the size of the font.
The design size can be multiplied by a scale factor. This scale factor is
given as number after the keyword scaled. The value given is 1000
times the scale factor to be used.
This primitive is an assignment.
In the following example the font cmr12 is loaded at its design size. The
macro \myfont is bound to this font.
In the following example the font cmr12 is loaded at the size 15pt. The
macro \myfont is bound to this font.
In the following example the font cmr12 is loaded at the double design size.
The scale factor 2000 is divided by 1000 to get the effective scaling factor.
The macro \myfont is bound to this font.
In the following example the font cmr10 is loaded at the size of 12 true pt.
The macro \myfont is bound to this font.
\font
.
The Primitive \font
Syntax
The formal description of this primitive is the following:
〈font〉
→ 〈prefix〉 \font 〈control sequence〉 〈equals〉 〈font name〉 〈options〉
〈prefix〉
→
| \global
〈options〉
→ 〈option〉
| 〈option〉 〈options〉
〈option〉
→ [scaled] 〈number〉
| [at] 〈size〉
| [noligatures]
| [nokerning]
| [letterspaced]
Examples
\font\myfont=cmr12
\font\myfont=cmr12 at 15pt
\font\magnifiedfiverm=cmr5 scaled 2000
\font\second=cmr10 at 12truept
Example
\font\myfont=cmr12 at 15pt letterspaced 10sp plus 3sp minus 2sp \font\myfont=cmr12 at 15pt letterspaced 10sp plus 3sp minus 2sp noligatures \font\myfont=cmr12 at 15pt noligatures \font\myfont=cmr12 at 15pt noligatures nokerning
Field Summary | |
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
Constructor Summary | |
FontPrimitive(java.lang.String name)
Creates a new object. |
Method Summary | |
void |
assign(Flags prefix,
Context context,
TokenSource source,
Typesetter typesetter)
The method assign is the core of the functionality of execute() . |
Font |
convertFont(Context context,
TokenSource source,
Typesetter typesetter)
Convert some primitive value into a font. |
void |
enableLogging(java.util.logging.Logger log)
Setter for the logger. |
Methods inherited from class de.dante.extex.interpreter.type.AbstractAssignment |
execute |
Methods inherited from class de.dante.extex.interpreter.type.AbstractCode |
enableLocalization, getLocalizer, getName, isIf, isOuter, printable, printableControlSequence, readResolve, setName, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final long serialVersionUID
Constructor Detail |
public FontPrimitive(java.lang.String name)
name
- the name for debuggingMethod Detail |
public void assign(Flags prefix, Context context, TokenSource source, Typesetter typesetter) throws InterpreterException
AbstractAssignment
execute()
.
This method is preferable to execute() since the
execute() method provided in this class takes care of
\afterassignment and \globaldefs as well.
assign
in class AbstractAssignment
prefix
- the prefix controlling the executioncontext
- the interpreter contextsource
- the token sourcetypesetter
- the typesetter
InterpreterException
- in case of an errorCode.execute(
de.dante.extex.interpreter.Flags,
de.dante.extex.interpreter.context.Context,
de.dante.extex.interpreter.TokenSource,
de.dante.extex.typesetter.Typesetter)
public Font convertFont(Context context, TokenSource source, Typesetter typesetter) throws InterpreterException
FontConvertible
convertFont
in interface FontConvertible
context
- the interpreter contextsource
- the source for new tokenstypesetter
- the typesetter
InterpreterException
- In case of an errorFontConvertible.convertFont(
de.dante.extex.interpreter.context.Context,
de.dante.extex.interpreter.TokenSource,
de.dante.extex.typesetter.Typesetter)
public void enableLogging(java.util.logging.Logger log)
LogEnabled
enableLogging
in interface LogEnabled
log
- the logger to useLogEnabled.enableLogging(
java.util.logging.Logger)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |