Thanks for the explanation.....
but I have a doubt
When you are going to modify a read stream(some time down the line), you 
will be making the Fontable object with the name of Fonts. So it will be 
the Fontable object that knows about the total count of bytes of sttbfffn. 
So how can this info be filled into FIB from somewhere else??

Thanks & Regards
Praveen






"Ryan Ackley" <[EMAIL PROTECTED]>
07/07/2003 17:05
Please respond to "POI Developers List"

 
        To:     "POI Developers List" <[EMAIL PROTECTED]>
        cc: 
        Subject:        Re: New FFN & Fontable classes

 

You don't need to create a new doc file. You only have to write the
FontTable to an HWPFFileSystem, then use that same file system to create 
the
new FontTable. Look at the following code (assume that you already have a
FontTable object):

HWPFFileSystem sys = new HWPFFileSystem();

fontTable.writeTo(sys);

HWPFOutputStream tableStream = sys.getStream("1Table");

FontTable newFontTable = new FontTable(tableStream.toByteArray(), 0,
tableStream.getOffset());

//end of example

Also, you handle writing to the FIB in your FontTable class. Don't do this
because this will be handled somewhere else. You pass in an fcMin to the
writeTo function. This argument is unnecessary.

Ryan

----- Original Message ----- 
From: "Praveen Mathew" <[EMAIL PROTECTED]>
To: "POI Developers List" <[EMAIL PROTECTED]>
Sent: Monday, July 07, 2003 7:22 AM
Subject: Re: New FFN & Fontable classes


> Ryan,
>             Let me tell you what I understood, Plz tell me if that is 
what
> you have meant.
>
> 1. Read an existing Doc's main & table streams and create the Fontable
> object.
> 2. Now write this stream to create a new Doc file.
> 3. Then read from the newly created Doc file & create the Fontable 
object.
> 4. Check if the 2 fontable Objects are same by using your clone method.
>
> doubts:
> while creation & writing of Fontable, should I create & write out all 
the
> datastructures currently present or not. Since only if we write out all 
of
> them we can create a new Doc file right??
>
> Thanks & Regards
> Praveen
>
>
>
>
>
>
> "Ryan Ackley" <[EMAIL PROTECTED]>
> 07/07/2003 16:30
> Please respond to "POI Developers List"
>
>
>         To:     "POI Developers List" <[EMAIL PROTECTED]>
>         cc:
>         Subject:        Re: New FFN & Fontable classes
>
>
>
> Praveen the next thing you should be working on is writing a test case 
for
> FontTable. You need to test the writing by creating a FontTable from a
> WordDocument then writing it out then creating another FontTable from 
the
> what you wrote out. Then compare the two and see if they're equal.
>
> Ryan
>
> ----- Original Message ----- 
> From: "Praveen Mathew" <[EMAIL PROTECTED]>
> To: "POI Developers List" <[EMAIL PROTECTED]>
> Sent: Monday, July 07, 2003 1:59 AM
> Subject: Re: New FFN & Fontable classes
>
>
> > I coud do it like this
> >
> > long mask = 0;
> > mask = (long) Math.pow((long)2,(long)62);
> > mask = mask<<1;
> >
> > Thanks & Regards
> > Praveen
> >
> > Praveen Mathew
> > IBM Software Labs,Airport Road,
> > Bangalore - 560 017,India.
> > Ph : +91- 80 - 504 4609 (Direct)
> >        +91 - 80 - 5262355 Extn: 3609
> > Email: [EMAIL PROTECTED]
> >
> >
> >
> >
> > "A. Rothman" <[EMAIL PROTECTED]>
> > 05/07/2003 15:33
> > Please respond to "POI Developers List"
> >
> >
> >         To:     POI Developers List <[EMAIL PROTECTED]>
> >         cc:
> >         Subject:        Re: New FFN & Fontable classes
> >
> >
> >
> > as defined in java.lang.Long:
> >
> > /**
> >      * A constant holding the maximum value a <code>long</code> can
> >      * have, 2<sup>63</sup>-1.
> >      */
> >     public static final long MAX_VALUE = 0x7fffffffffffffffL;
> >
> > you're trying to use a number larger than a long can contain! (don't
> > forget
> > the msb is the sign bit)
> > what u want is probably something like:
> >
> > x = x | 0x8000000000000000L; // this is a bit-wise operator so sign
> > doesn't
> > matter
> >
> > if this is what you're trying to get:
> >
> > System.out.println(Long.toString(x >>> 63,2)); // prints '1'
> >
> > Hope this helps!
> >
> > Amichai
> >
> > ----- Original Message ----- 
> > From: "Ryan Ackley" <[EMAIL PROTECTED]>
> > To: "POI Developers List" <[EMAIL PROTECTED]>
> > Sent: Friday, July 04, 2003 9:18 PM
> > Subject: Re: New FFN & Fontable classes
> >
> >
> > > I need more details
> > >
> > > ----- Original Message ----- 
> > > From: "Praveen Mathew" <[EMAIL PROTECTED]>
> > > To: "POI Developers List" <[EMAIL PROTECTED]>
> > > Sent: Friday, July 04, 2003 7:19 AM
> > > Subject: Re: New FFN & Fontable classes
> > >
> > >
> > > > Hi ,
> > > >
> > > >  I am unable to make the MSbit of a long in java like
> > > > long x = 0;
> > > > x = x | (long)Math.pow((long)2,(long)63);
> > > >
> > > > Isd there a way I can do this???
> > > >
> > > >
> > > >
> > > >
> > > > Thanks & Regards
> > > > Praveen
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > "Ryan Ackley" <[EMAIL PROTECTED]>
> > > > 04/07/2003 15:26
> > > > Please respond to "POI Developers List"
> > > >
> > > >
> > > >         To:     "POI Developers List" <[EMAIL PROTECTED]>
> > > >         cc:
> > > >         Subject:        Re: New FFN & Fontable classes
> > > >
> > > >
> > > >
> > > > > Thanks Ryan for creating a Bugzilla acount for me. Does creating
> an
> > > > > attachement & submiting is all I have to do for sending new
> patches?
> > > > >
> > > > > still now I dont have a clear picture of whats happening with
> > > > > Bugzilla...what is this Bugzilla? & why does the patches sent 
are
> > > > > considered as BUGS!!
> > > >
> > > > They are not considered bugs. It simply gives a convenient way for
> you
> > to
> > > > upload attachments. You can't send attachments to the list and 
when
> > you
> > > > send
> > > > java code to the list, the line breaks get all messed up. When I 
try
> > to
> > > > copy
> > > > and paste from your last email, I get errors because my mail 
reader
> > has
> > > > wrapped some of the lines in the FontTable and Ffn classes.
> > > >
> > > > Ryan
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > > >
> > > >
> > >
> > > 
---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to