Top Description Fields Constructors Methods
jogamp.graph.font.typecast.tt.engine

public Class Interpreter

extends Object
Class Inheritance
Imports
jogamp.graph.font.typecast.ot.Mnemonic, .Point

The interpreter shall remain ignorant of the table structure - the table data will be extracted by supporting classes, whether it be the Parser or some other.
Author
David Schweinsberg
Version
$Id: Interpreter.java,v 1.1.1.1 2004-12-05 23:15:05 davidsch Exp $

Field Summary

Modifier and TypeField and Description
private final int[]
private int[]
private final GraphicsState
private boolean
private Parser
private int[]
private int
private int[]
private final Point[][]

Constructor Summary

AccessConstructor and Description
public
Interpreter(final int stackMax, final int storeMax, final int funcMax)

Method Summary

Modifier and TypeMethod and Description
private void
_abs()

ABSolute value

private void
_add()

ADD

private void
private void
_alignrp()

USES: loop

private void
_and()

logical AND

private void
_call()

CALL function

private void
_ceiling()

CEILING

private void
_cindex()

Copy the INDEXed element to the top of the stack

private void
_clear()

CLEAR the entire stack

private void
private void
_deltac1()

DELTA exception C1

private void
_deltac2()

DELTA exception C2

private void
_deltac3()

DELTA exception C3

private void
_deltap1()

DELTA exception P1

private void
_deltap2()

DELTA exception P2

private void
_deltap3()

DELTA exception P3

private void
_depth()

Returns the DEPTH of the stack

private void
_div()

DIVide

private void
_dup()

DUPlicate top stack element

private int
_else(final int instructionIndex)

ELSE

private void
_eq()

EQual

private void
private void
_fdef(final int instructionIndex)

Function DEFinition

private void
_flipoff()

Set the auto_FLIP boolean to OFF

private void
_flipon()

Set the auto_FLIP boolean to ON

private void
_flippt()

FLIP PoinT USES: loop

private void
_fliprgoff()

FLIP RanGe OFF

private void
_fliprgon()

FLIP RanGe ON

private void
_floor()

FLOOR

private void
_gc(final short param)

private void
private void
_gfv()

Get Freedom_Vector

private void
_gpv()

Get Projection_Vector

private void
_gt()

Greater Than

private void
_gteq()

Greater Than or EQual

private void
_idef()

Instruction DEFinition

private int
_if(final int instructionIndex)

IF test

private void
_instctrl()

INSTruction Execution ConTRol INSTCTRL[] Code Range 0x8E Pops s: selector flag (int32) value: USHORT (padded to 32 bits) used to set value of instruction_control.

private void
_ip()

private void
private void
_iup(final short param)

private int
_jmpr(final int instructionIndex)

JuMP Relative

private int
_jrof(int instructionIndex)

Jump Relative On False

private int
_jrot(int instructionIndex)

Jump Relative On True

private void
_loopcall()

LOOP and CALL function

private void
_lt()

Less Than

private void
_lteq()

Less Than or EQual

private void
_max()

MAXimum of top two stack elements

private void
_md(final short param)

private void
_mdap(final short param)

private void
_mdrp(final short param)

private void
_miap(final short param)

private void
_min()

MINimum of top two stack elements

private void
_mindex()

Move the INDEXed element to the top of the stack

private void
_mirp(final short param)

private void
private void
_mps()

private void
_msirp(final short param)

private void
_mul()

MULtiply

private void
_neg()

NEGate

private void
_neq()

Not EQual

private void
_not()

logical NOT

private void
_nround(final short param)

private void
_odd()

private void
_or()

logical OR

private void
_push(final int[] data)

PUSH N Bytes PUSH N Words PUSH Bytes PUSH Words

private void
_rcvt()

Read Control Value Table

private void
_rdtg()

Round Down To Grid

private void
_roff()

Round OFF

private void
_roll()

ROLL the top three stack elements

private void
_round(final short param)

private void
_rs()

Read Store

private void
_rtdg()

Round To Double Grid

private void
_rtg()

Round To Grid

private void
_rthg()

Round To Half Grid

private void
_rutg()

Round Up To Grid

private void
private void
_scanctrl()

SCAN conversion ConTRoL SCANCTRL[ ] Code Range 0x85 Pops n: flags indicating when to turn on dropout control mode (16 bit word padded to 32 bits) Pushes - Sets scan_control SCANCTRL is used to set the value of the Graphics State variable scan_control which in turn determines whether the scan converter will activate dropout control for this glyph.

private void
_scantype()

SCANTYPE SCANTYPE[] Code Range 0x8D Pops n: 16 bit integer Pushes - Sets scan_control Pops a 16-bit integer whose value is used to determine which rules the scan converter will use.

private void
private void
_scvtci()

Set Control Value Table Cut In

private void
_sdb()

Set Delta_Base in the graphics state

private void
_sdpvtl(final short param)

Set Dual Projection_Vector To Line

private void
_sds()

Set Delta_Shift in the graphics state

private void
_sfvfs()

Set Freedom_Vector From Stack

private void
_sfvtca(final short param)

private void
_sfvtl(final short param)

private void
_sfvtpv()

Set Freedom_Vector To Projection Vector

private void
_shc(final short param)

private void
_shp(final short param)

SHift Point by the last point USES: loop

private void
_shpix()

SHift Point by a PIXel amount USES: loop

private void
_shz(final short param)

private void
_sloop()

Set LOOP variable

private void
_smd()

Set Minimum_Distance

private void
_spvfs()

Set Projection_Vector From Stack

private void
_spvtca(final short param)

private void
_spvtl(final short param)

Set Projection_Vector To Line

private void
private void
_srp0()

Set Reference Point 0

private void
_srp1()

Set Reference Point 1

private void
_srp2()

Set Reference Point 2

private void
_ssw()

Set Single-Width

private void
_sswci()

Set Single_Width_Cut_In

private void
_sub()

SUBtract

private void
_svtca(final short param)

Set freedom and projection Vectors To Coordinate Axis

private void
_swap()

SWAP the top two elements on the stack

private void
_szp0()

Set Zone Pointer 0

private void
_szp1()

Set Zone Pointer 1

private void
_szp2()

Set Zone Pointer 2

private void
_szps()

Set Zone PointerS

private void
_utp()

private void
_wcvtf()

Write Control Value Table in FUnits

private void
_wcvtp()

Write Control Value Table in Pixel units

private void
_ws()

Write Store

public void
execute(int ip)

public Point[][]
private int
pop()

private void
push(final int i)

public void
public void
public void
public void
setParser(final Parser p)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cvtback to summary
private final int[] cvt
functionMapback to summary
private int[] functionMap
gsback to summary
private final GraphicsState gs
inFuncDefback to summary
private boolean inFuncDef
parserback to summary
private Parser parser
stackback to summary
private int[] stack
stackIndexback to summary
private int stackIndex
storeback to summary
private int[] store
zoneback to summary
private final Point[][] zone

Constructor Detail

Interpreterback to summary
public Interpreter(final int stackMax, final int storeMax, final int funcMax)

Method Detail

_absback to summary
private void _abs()

ABSolute value

_addback to summary
private void _add()

ADD

_alignptsback to summary
private void _alignpts()
_alignrpback to summary
private void _alignrp()

USES: loop

_andback to summary
private void _and()

logical AND

_callback to summary
private void _call()

CALL function

_ceilingback to summary
private void _ceiling()

CEILING

_cindexback to summary
private void _cindex()

Copy the INDEXed element to the top of the stack

_clearback to summary
private void _clear()

CLEAR the entire stack

_debugback to summary
private void _debug()
_deltac1back to summary
private void _deltac1()

DELTA exception C1

_deltac2back to summary
private void _deltac2()

DELTA exception C2

_deltac3back to summary
private void _deltac3()

DELTA exception C3

_deltap1back to summary
private void _deltap1()

DELTA exception P1

_deltap2back to summary
private void _deltap2()

DELTA exception P2

_deltap3back to summary
private void _deltap3()

DELTA exception P3

_depthback to summary
private void _depth()

Returns the DEPTH of the stack

_divback to summary
private void _div()

DIVide

_dupback to summary
private void _dup()

DUPlicate top stack element

_elseback to summary
private int _else(final int instructionIndex)

ELSE

_eqback to summary
private void _eq()

EQual

_evenback to summary
private void _even()
_fdefback to summary
private void _fdef(final int instructionIndex)

Function DEFinition

_flipoffback to summary
private void _flipoff()

Set the auto_FLIP boolean to OFF

_fliponback to summary
private void _flipon()

Set the auto_FLIP boolean to ON

_flipptback to summary
private void _flippt()

FLIP PoinT USES: loop

_fliprgoffback to summary
private void _fliprgoff()

FLIP RanGe OFF

_fliprgonback to summary
private void _fliprgon()

FLIP RanGe ON

_floorback to summary
private void _floor()

FLOOR

_gcback to summary
private void _gc(final short param)
_getinfoback to summary
private void _getinfo()
_gfvback to summary
private void _gfv()

Get Freedom_Vector

_gpvback to summary
private void _gpv()

Get Projection_Vector

_gtback to summary
private void _gt()

Greater Than

_gteqback to summary
private void _gteq()

Greater Than or EQual

_idefback to summary
private void _idef()

Instruction DEFinition

_ifback to summary
private int _if(final int instructionIndex)

IF test

_instctrlback to summary
private void _instctrl()

INSTruction Execution ConTRol INSTCTRL[] Code Range 0x8E Pops s: selector flag (int32) value: USHORT (padded to 32 bits) used to set value of instruction_control. Pushes - Sets instruction_control Sets the instruction control state variable making it possible to turn on or off the execution of instructions and to regulate use of parameters set in the CVT program. INSTCTRL[ ] can only be executed in the CVT program. This instruction clears and sets various control flags in the rasterizer. The selector flag determines valid values for the value argument. The value determines the new setting of the raterizer control flag. In version 1.0 there are only two flags in use: Selector flag 1 is used to inhibit grid-fitting. If s=1, valid values for the value argument are 0 (FALSE) and 1 (TRUE). If the value argument is set to TRUE (v=1), any instructions associated with glyphs will not be executed. For example, to inhibit grid-fitting when a glyph is being rotated or stretched, use the following sequence on the preprogram: PUSHB[000] 6 ; ask GETINFO to check for stretching or rotation GETINFO[] ; will push TRUE if glyph is stretched or rotated IF[] ; tests value at top of stack PUSHB[000] 1 ; value for INSTCTRL PUSHB[000] 1 ; selector for INSTCTRL INSTRCTRL[] ; based on selector and value will turn grid-fitting off EIF[] Selector flag 2 is used to establish that any parameters set in the CVT program should be ignored when instructions associated with glyphs are executed. These include, for example, the values for scantype and the CVT cut-in. If s=1, valid values for the value argument are 0 (FALSE) and 2 (TRUE). If the value argument is set to TRUE (v=2), the default values of those parameters will be used regardless of any changes that may have been made in those values by the preprogram. If the value argument is set to FALSE (v=0), parameter values changed by the CVT program will be used in glyph instructions.

_ipback to summary
private void _ip()
_isectback to summary
private void _isect()
_iupback to summary
private void _iup(final short param)
_jmprback to summary
private int _jmpr(final int instructionIndex)

JuMP Relative

_jrofback to summary
private int _jrof(int instructionIndex)

Jump Relative On False

_jrotback to summary
private int _jrot(int instructionIndex)

Jump Relative On True

_loopcallback to summary
private void _loopcall()

LOOP and CALL function

_ltback to summary
private void _lt()

Less Than

_lteqback to summary
private void _lteq()

Less Than or EQual

_maxback to summary
private void _max()

MAXimum of top two stack elements

_mdback to summary
private void _md(final short param)
_mdapback to summary
private void _mdap(final short param)
_mdrpback to summary
private void _mdrp(final short param)
_miapback to summary
private void _miap(final short param)
_minback to summary
private void _min()

MINimum of top two stack elements

_mindexback to summary
private void _mindex()

Move the INDEXed element to the top of the stack

_mirpback to summary
private void _mirp(final short param)
_mppemback to summary
private void _mppem()
_mpsback to summary
private void _mps()
_msirpback to summary
private void _msirp(final short param)
_mulback to summary
private void _mul()

MULtiply

_negback to summary
private void _neg()

NEGate

_neqback to summary
private void _neq()

Not EQual

_notback to summary
private void _not()

logical NOT

_nroundback to summary
private void _nround(final short param)
_oddback to summary
private void _odd()
_orback to summary
private void _or()

logical OR

_pushback to summary
private void _push(final int[] data)

PUSH N Bytes PUSH N Words PUSH Bytes PUSH Words

_rcvtback to summary
private void _rcvt()

Read Control Value Table

_rdtgback to summary
private void _rdtg()

Round Down To Grid

_roffback to summary
private void _roff()

Round OFF

_rollback to summary
private void _roll()

ROLL the top three stack elements

_roundback to summary
private void _round(final short param)
_rsback to summary
private void _rs()

Read Store

_rtdgback to summary
private void _rtdg()

Round To Double Grid

_rtgback to summary
private void _rtg()

Round To Grid

_rthgback to summary
private void _rthg()

Round To Half Grid

_rutgback to summary
private void _rutg()

Round Up To Grid

_s45roundback to summary
private void _s45round()
_scanctrlback to summary
private void _scanctrl()

SCAN conversion ConTRoL SCANCTRL[ ] Code Range 0x85 Pops n: flags indicating when to turn on dropout control mode (16 bit word padded to 32 bits) Pushes - Sets scan_control SCANCTRL is used to set the value of the Graphics State variable scan_control which in turn determines whether the scan converter will activate dropout control for this glyph. Use of the dropout control mode is determined by three conditions: Is the glyph rotated? Is the glyph stretched? Is the current setting for ppem less than a specified threshold? The interpreter pops a word from the stack and looks at the lower 16 bits. Bits 0-7 represent the threshold value for ppem. A value of FF in bits 0-7 means invoke dropout_control for all sizes. A value of 0 in bits 0-7 means never invoke dropout_control. Bits 8-13 are used to turn on dropout_control in cases where the specified conditions are met. Bits 8, 9 and 10 are used to turn on the dropout_control mode (assuming other conditions do not block it). Bits 11, 12, and 13 are used to turn off the dropout mode unless other conditions force it. Bits 14 and 15 are reserved for future use. Bit Meaning if set --- -------------- 8 Set dropout_control to TRUE if other conditions do not block and ppem is less than or equal to the threshold value. 9 Set dropout_control to TRUE if other conditions do not block and the glyph is rotated. 10 Set dropout_control to TRUE if other conditions do not block and the glyph is stretched. 11 Set dropout_control to FALSE unless ppem is less than or equal to the threshold value. 12 Set dropout_control to FALSE unless the glyph is rotated. 13 Set dropout_control to FALSE unless the glyph is stretched. 14 Reserved for future use. 15 Reserved for future use. For example 0x0000 No dropout control is invoked 0x01FF Always do dropout control 0x0A10 Do dropout control if the glyph is rotated and has less than 16 pixels per-em The scan converter can operate in either a "normal" mode or in a "fix dropout" mode depending on the value of a set of enabling and disabling flags.

_scantypeback to summary
private void _scantype()

SCANTYPE SCANTYPE[] Code Range 0x8D Pops n: 16 bit integer Pushes - Sets scan_control Pops a 16-bit integer whose value is used to determine which rules the scan converter will use. If the value of the argument is 0, the fast scan converter will be used. If the value of the integer is 1 or 2, simple dropout control will be used. If the value of the integer is 4 or 5, smart dropout control will be used. More specifically, if n=0 rules 1, 2, and 3 are invoked (simple dropout control scan conversion including stubs) if n=1 rules 1, 2, and 4 are invoked (simple dropout control scan conversion excluding stubs) if n=2 rules 1 and 2 only are invoked (fast scan conversion; dropout control turned off) if n=3 same as n = 2 if n = 4 rules 1, 2, and 5 are invoked (smart dropout control scan conversion including stubs) if n = 5 rules 1, 2, and 6 are invoked (smart dropout control scan conversion excluding stubs) if n = 6 same as n = 2 if n = 7 same as n = 2 The scan conversion rules are shown here: Rule 1 If a pixel's center falls within the glyph outline, that pixel is turned on. Rule 2 If a contour falls exactly on a pixel's center, that pixel is turned on. Rule 3 If a scan line between two adjacent pixel centers (either vertical or horizontal) is intersected by both an on-Transition contour and an off-Transition contour and neither of the pixels was already turned on by rules 1 and 2, turn on the left-most pixel (horizontal scan line) or the bottom-most pixel (vertical scan line). This is "Simple" dropout control. Rule 4 Apply Rule 3 only if the two contours continue to intersect other scan lines in both directions. That is, do not turn on pixels for 'stubs.' The scanline segments that form a square with the intersected scan line segment are examined to verify that they are intersected by two contours. It is possible that these could be different contours than the ones intersecting the dropout scan line segment. This is very unlikely but may have to be controlled with grid-fitting in some exotic glyphs. Rule 5 If a scan line between two adjacent pixel centers (either vertical or horizontal) is intersected by both an on-Transition contour and an off-Transition contour and neither of the pixels was already turned on by rules 1 and 2, turn on the pixel which is closer to the midpoint between the on-Transition contour and off- Transition contour. This is "Smart" dropout control. Rule 6 Apply Rule 5 only if the two contours continue to intersect other scan lines in both directions. That is, do not turn on pixels for 'stubs.' New fonts wishing to use the new modes of the ScanType instruction, but still wishing to work correctly on old rasterizers that don't recognize the new modes should: First execute a ScanType instruction using an old mode which will give the best approximation to the desired new mode (e.g. Simple Stubs for Smart Stubs), and then Immediately execute another ScanType instruction with the desired new mode.

_scfsback to summary
private void _scfs()
_scvtciback to summary
private void _scvtci()

Set Control Value Table Cut In

_sdbback to summary
private void _sdb()

Set Delta_Base in the graphics state

_sdpvtlback to summary
private void _sdpvtl(final short param)

Set Dual Projection_Vector To Line

_sdsback to summary
private void _sds()

Set Delta_Shift in the graphics state

_sfvfsback to summary
private void _sfvfs()

Set Freedom_Vector From Stack

_sfvtcaback to summary
private void _sfvtca(final short param)
_sfvtlback to summary
private void _sfvtl(final short param)
_sfvtpvback to summary
private void _sfvtpv()

Set Freedom_Vector To Projection Vector

_shcback to summary
private void _shc(final short param)
_shpback to summary
private void _shp(final short param)

SHift Point by the last point USES: loop

_shpixback to summary
private void _shpix()

SHift Point by a PIXel amount USES: loop

_shzback to summary
private void _shz(final short param)
_sloopback to summary
private void _sloop()

Set LOOP variable

_smdback to summary
private void _smd()

Set Minimum_Distance

_spvfsback to summary
private void _spvfs()

Set Projection_Vector From Stack

_spvtcaback to summary
private void _spvtca(final short param)
_spvtlback to summary
private void _spvtl(final short param)

Set Projection_Vector To Line

_sroundback to summary
private void _sround()
_srp0back to summary
private void _srp0()

Set Reference Point 0

_srp1back to summary
private void _srp1()

Set Reference Point 1

_srp2back to summary
private void _srp2()

Set Reference Point 2

_sswback to summary
private void _ssw()

Set Single-Width

_sswciback to summary
private void _sswci()

Set Single_Width_Cut_In

_subback to summary
private void _sub()

SUBtract

_svtcaback to summary
private void _svtca(final short param)

Set freedom and projection Vectors To Coordinate Axis

_swapback to summary
private void _swap()

SWAP the top two elements on the stack

_szp0back to summary
private void _szp0()

Set Zone Pointer 0

_szp1back to summary
private void _szp1()

Set Zone Pointer 1

_szp2back to summary
private void _szp2()

Set Zone Pointer 2

_szpsback to summary
private void _szps()

Set Zone PointerS

_utpback to summary
private void _utp()
_wcvtfback to summary
private void _wcvtf()

Write Control Value Table in FUnits

_wcvtpback to summary
private void _wcvtp()

Write Control Value Table in Pixel units

_wsback to summary
private void _ws()

Write Store

executeback to summary
public void execute(int ip)
getZonesback to summary
public Point[][] getZones()
popback to summary
private int pop()
pushback to summary
private void push(final int i)
runCvtProgramback to summary
public void runCvtProgram()
runFontProgramback to summary
public void runFontProgram()
runGlyphProgramback to summary
public void runGlyphProgram()
setParserback to summary
public void setParser(final Parser p)