[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"patches" for t2parse.c

From: Tom Kacvinsky
Subject: "patches" for t2parse.c
Date: Sat, 3 Jun 2000 19:07:47 -0400 (EDT)

Well, I got the CFF parser to parse the OpenType/CFF CID fonts that I
have access to.

The magority of the code is rock solid in terms of parsing the top
level DICT data (I haven't yet gone into the actual gsubrs and
charstrings parsing).

The problems had to do with number decoding (both real and integers).
The arguments passed to parse_t2_real and parse_t2_integer were
pointers to bottom two *encoded* numbers on the stack.  The first
argument is fine, but the second argument was used as the pointer to
the top level of the perand stack, so some numbers weren't being
parsed (we dropped right into the "bad", set val = 0, and returned).
What I did was omit the tests on exceeding the stack top (because a
test was alreay done in the function T2_Parser_Run before we handle
the operators and their operands).

I also put some modifications into parse_t2_real.  I returned (result
<< 16) | FT_DivFix (num, divider), if indeed parse_t2_real is supposed
to return a 16:16 real number).  The modifications might break for
those fonts which use real numbers that look like -3.01e-3, but I
don't have a font around for testing that...

Then there is the callback parsing code for the font matrix.  Type 1/2
font matrices use 6 numbers (not four), but the parsing code assumes 4
operands.  Which is fine, if the last two are zero, but that isn't
necessarily the case.

Finally, I noticed that there is no callback for handling the XUID
array (which will be tricky; it can have up to 14 arguments, and hence
there is no fixed number of arguments to expect) and I haven't looked
into the delta operand parsing code.

Now, for my own personal tastes, I modified the coding style.
Functions look like

void foo (int bar, char* bletch) {


instead of

void foo (

  int bar,
  char * bletch )


That, combined with the fact I added a *lot* of printf statements
for debugging purposes, is why I do not attach a patch here.  I will,
if you want me to.  Since I used emacs, perhaps I can put the code back
into the style desired.  What say you?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]