poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan Ackley" <sack...@cfl.rr.com>
Subject Re: HWPF again
Date Tue, 24 Jun 2003 10:50:25 GMT
Praveen,

You are on the right track. PANOSE and FONTSIGNATURE should be byte arrays
because they aren't in the spec but we want to preserve that information.
XCHAR are unicode strings so we can simply use a String object for xszFfn in
the Ffn class.

Ryan

----- Original Message ----- 
From: "Praveen Mathew" <prmathew@in.ibm.com>
To: "POI Developers List" <poi-dev@jakarta.apache.org>
Sent: Tuesday, June 24, 2003 3:15 AM
Subject: Re: HWPF again


> Ryan,
>              Plzz tell me if I am in the right track....
> I have made these classe from what I understood.....still not clear
> though.
>
> Ffn.java
>
> package org.apache.poi.hwpf.model.hdftypes;
>
> import org.apache.poi.util.BitField;
> import org.apache.poi.util.LittleEndian;
>
>
> public class Ffn
> {
>         private byte field1_cbFfnM1;            //total length of FFN - 1.
>         private byte field2;
>
>                 private  static BitField _prq = new BitField(0x0003);   //
> pitch request
>                 private  static BitField _fTrueType = new
> BitField(0x0004);       // when 1, font is a TrueType font
>                 private  static BitField _ff = new BitField(0x0070);
>
>         private short field3_wWeight;           // base weight of font
>         private byte field4_chs;                        // character set
> identifier
>         private byte field5_ixchSzAlt;          // index into ffn.szFfn to
> the name of the alternate font
>
>         //private PANOSE panose;                        ????
>         //private FONTSIGNATURE fs                      ????
>
>         // zero terminated string that records name of font, cuurently not
> supporting Extended chars
>
>         private char [] xszFfn = new char[65];
>
>         public Ffn(byte[] buf, int offset)
>         {
>
>         }
>
>         protected byte[] toByteArray()
>         {
>                 //
>
>                 return buf;
>         }
>
>
> }
>
>
> FonTable.java
>
> package org.apache.poi.hwpf.model.hdftypes;
>
> import org.apache.poi.util.BitField;
> import org.apache.poi.util.LittleEndian;
>
>
> public class FontTable
> {
>         private short exntdChar;                // strings are extended
> character if = 0xFFFF
>         private short stringCount;      // how many strings are included
> in the string table
>         private short extraDataSz;      // size in bytes of the extra data
>
>         private int lcbSttbfffn;
>         private boolean isExtndChar;
>
>
>         // FFN structure containing strings of font names
>
>         private Ffn     [] fontNames;
>
>         public FontTable(byte[] buf, int offset, int lcbSttbfffn)
>         {
>                 this.lcbSttbfffn = lcbSttbfffn;
>
>                 exntdChar = LittleEndian.getShort(buf, offset);
>                 offset += LittleEndian.SHORT_SIZE;
>                 stringCount = LittleEndian.getShort(buf, offset);
>                 offset += LittleEndian.SHORT_SIZE;
>                 extraDataSz = LittleEndian.getShort(buf, offset);
>                 offset += LittleEndian.SHORT_SIZE;
>
>                 if ((exntdChar & 0xFFFF) == 0xFFFF)
>                 {
>                         isExtndChar = true;
>                 }
>                 else
>                 {
>                         isExtndChar = false;
>         }
>
>         }
>
> }
>
>
> 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: prmathew@in.ibm.com
>
>
>
>
> "Ryan Ackley" <sackley@cfl.rr.com>
> 23/06/2003 18:04
> Please respond to "POI Developers List"
>
>
>         To:     "POI Developers List" <poi-dev@jakarta.apache.org>
>         cc:
>         Subject:        Re: HWPF again
>
>
>
> Praveen,
>
> I have made a lot of progress since my last commit. I will try to commit
> everything tonight. I believe I can almost read in a Word file and write
> it
> back out. I haven't actually tried to do it, but I have all the code
> written. I am sure it will take some tweaking to work. I am currently
> writing test cases to see which parts aren't working. I have something you
> could do if you would like to help me. I need a FontTable class. Search
> for
> "sttbfffn" in the spec. that is what I need.
>
> Ryan
>
> ----- Original Message ----- 
> From: "Praveen Mathew" <prmathew@in.ibm.com>
> To: "POI Developers List" <poi-dev@jakarta.apache.org>
> Sent: Monday, June 23, 2003 8:14 AM
> Subject: Re: HWPF again
>
>
> > Hi,
> >        I tried creating a Doc from a String, and read the "WordDocument"
> stream from that Doc file , but there was no FIB in it...
> >
> > So no other go except to create all these Datastructures
> >
> > Thanks & Regards
> > Praveen
> >
> >
> >
> >
> >
> >
> > Praveen Mathew/India/IBM@IBMIN
> > 23/06/2003 15:23
> > Please respond to "POI Developers List"
> >
> >
> >         To:     "POI Developers List" <poi-dev@jakarta.apache.org>
> >         cc:
> >         Subject:        HWPF again
> >
> >
> >
> > Hi all,
> >              I am back to HWPF after a good vacation... I have gone
> > through the codes which Ryan has added. Thanks Ryan for your work.
> >
> > I am planning to create a Doc file with just 1 character in it...say
> "H".
> > This means I only have to deal with the minimum datastructures and that
> > too for the
> > condition where index = 0.
> >
> > I need some help regarding this.
> >
> > I am going to convert a String with "H" into a ByteArrayInputStream&
> then
> > using POIFS createDocument make a Doc, which will only have the
> > "WordDocument"
> > stream.  I suppose this will create a FIB which I can modify.
> >
> > But there is no way I can create a "1Table" stream as I did above, I
> > should create it myself.
> >
> > So I need to know what is the order in which i should go on creating the
> > different DataStructures, like PlexofCps, DiskFormatedPage, CHPX, PAPX
> > etc... for making the "1Table" stream. Since I have only one character
> "H"
> >
> >
> > I will have only 1 instance of all the dataStructures.
> > How will I link the FIB in "WordDocument" stream with "1Table" stream?.
> > Also If I need to show the "H" font = Arial, which datastructure should
> I
> > edit?
> >
> >
> > Thanks & Regards
> > Praveen
> >
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-dev-help@jakarta.apache.org
>
>
>
>


Mime
View raw message