|
From: | Zeming Liu |
Subject: | [ft-devel] Question about TTF |
Date: | Wed, 23 May 2018 20:40:42 +0000 |
Dear FreeType team,
I am a grad student of University of Waterloo. We have a project about TTF. We are trying to translate TTF bytecode to some kind of 3-addr-code, and optimize the 3-addr-code, then convert it back to bytecode. We tested our program on arial.ttf, and found that there is a CALL instruction in some fpgm, which calls an uncertain fixed point value( bytecode attached below ).
As you can see, the callee is the result of a series of arithmetic operations, ( 4096 DIV MIN(MAX(0, 64 SUB F26Dot6), 192) ADD 44 ), where 192 not even divides 4096.
So, I wonder how do you deal with such a call instruction, do you just throw an exception? There is very few documentation about ttf we can find, so your advice will be very helpful. I expect to here from you soon.
best wishes Zeming
PUSH[ ]
17 FDEF[ ] /* FunctionDefinition */ DUP[ ] /* DuplicateTopStack */ ROUND[01] /* Round */ PUSHB[ ] /* 1 value pushed */ 64 SUB[ ] /* Subtract */ PUSHB[ ] /* 1 value pushed */ 0 MAX[ ] /* Maximum */ DUP[ ] /* DuplicateTopStack */ PUSHB[ ] /* 2 values pushed */ 44 192 ROLL[ ] /* RollTopThreeStack */ MIN[ ] /* Minimum */ PUSHW[ ] /* 1 value pushed */ 4096 /* word */ DIV[ ] /* Divide */ ADD[ ] /* Add */ CALL[ ] /* CallFunction */ GPV[ ] /* GetPVector */ ABS[ ] /* Absolute */ SWAP[ ] /* SwapTopStack */ ABS[ ] /* Absolute */ SUB[ ] /* Subtract */ NOT[ ] /* LogicalNot */ IF[ ] /* If */ PUSHB[ ] /* 1 value pushed */ 3 SUB[ ] /* Subtract */ EIF[ ] /* EndIf */ ENDF[ ] /* EndFunctionDefinition */ |
[Prev in Thread] | Current Thread | [Next in Thread] |