gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] DefineFontAlignZonesTag commit


From: Benjamin Wolsey
Subject: [Gnash-commit] DefineFontAlignZonesTag commit
Date: Thu, 16 Jul 2009 08:35:41 +0200

This commit wasn't sent on the commit list, maybe because the commit
email isn't registered with address@hidden

> +     log_parse(_(" ** DefineFontAlignZones: font=%d, flags=%d"), ref, flags);

Why the stars?
 
> +//   Si added here   

We can tell what people added without these markers.

> +//   log_debug(_("The value of the 'tag': %d "),tag);        // You will get 
> 73 here!!  :)   
> +//   log_debug(_("The value of the 'ref': %d "), ref); 
> +//   log_debug(_("The value of the 'flags' : %d "),flags);            
> +//   log_debug(_("The value of the 'csm_table_int_temp': %d 
> "),csm_table_int_temp);  
> +//   log_debug(_("The value of the 'font3.f_font2_glyphs_count: %d 
> "),referencedFont->glyphCount() );
> +
> +//   log_debug(_("The value of the sizeof 'tag': %d \n"),sizeof(tag));       
> //4
> +//   log_debug(_("The value of the sizeof 'ref': %d \n"), sizeof(ref));      
> //2
> +//   log_debug(_("The value of the sizeof 'flags' : %d \n"),sizeof(flags)); 
> //4               
> +//   log_debug(_("The value of the sizeof 'csm_table_int_temp': %d  
> \n"),sizeof(csm_table_int_temp));         //2
> +
> +//   log_debug(_("sizeof(int): %d \n"), sizeof(int) );    //4
> +//   log_debug(_("sizeof(int): %d \n" ), sizeof(short int) );        //2
> +//   log_debug(_("sizeof(unsigned short): %d \n"),sizeof(unsigned short) );  
> //2
> +//   log_debug(_("sizeof(unsigned): %d \n"), sizeof(unsigned) ); //4
> +//      log_debug(_( "sizeof(float): %d \n"),sizeof(float) ); //4
> +//      log_debug(_("sizeof(double): %d \n"), sizeof(double) );//8
> +//      log_debug(_("sizeof(char): %d \n"), sizeof(char) );//1
> +//   log_debug(_("****The value of the 'csm_table_int_temp': %d  
> \n"),csm_table_int_temp);   
> +//   log_debug(_("Hello, Let us try to parse all the tag information \n") );
> 

Debug logging is fine while you're working on things, but perhaps code
could be a little bit cleaner before committing to trunk.

> +     for (int i=0; i!=int(glyphs_count_temp); i++){

Use size_t for the i variable to avoid an unnecessary cast.


> +                     unsigned int nouse;

We use the boost fixed-size types such as boost::uint32_t for these.
Alexis' reference uses C89 and standard C++ types assuming they have the
most common size. We can specify the size exactly.

What is all the rest of the stuff in the file for?

> 
> +
> +//   struct swf_definefontalignzones {
> +//           swf_tag                 f_tag;          /* 73 */
> +//           unsigned short          f_font2_id_ref;                 // 1 
> bytes
> +//           unsigned                f_csm_table_hint : 2;           //Read 
> in flag? 2bits
> +//           unsigned                f_reserved : 6;                 //Read 
> in flag? 6bits
> +//           swf_zone_array          f_zones[corresponding define 
> font3.f_font2_glyphs_count];
> +//   }
> +
> +     //ref readed
> +     //tag readed 
> +
> +
> +     // The f_font2_glyphs_count does not exist at all.
> +     // I use the function glyphCount() defined in the Font class.
> +     // This function retrieve the number of embedded glyphs in this font.
> +
> +     
> +
> +     //Now read for swf_zone_array.
> +     ///But how?
> +
> +//   swf_zone_array f_zones_temp[2];
> +     
> +//   swf_zone_array f_zones_temp[glyphs_count_tempt];
> +
> +//   unsigned f_zone_count = in.read_u2(); // 2bits are cms table, 6bits are 
> reserved
> +//   for (int i=1; i<=f_zone_count; i++)
> +//                   {
> +//                   }
> +     
> +//   in.ensureBytes(1);
> +
> +             
> +/*
> +             struct swf_zone_array {
> +                     unsigned char           f_zone_count;           // 
> always 2 in V8.0           //??Why
> +                     swf_zone_data           f_zone_data[f_zone_count];
> +                     // I inverted the bits below, but I'm not too sure what 
> is correct, do you know? 
> +                     unsigned                f_reserved : 6;
> +                     unsigned                f_zone_y : 1;           // 
> probably always 1 in V8.0 
> +                     unsigned                f_zone_x : 1;           // 
> probably always 1 in V8.0 
> +             };
> +             
> +             //What is the size here? char?
> +             in.ensureBytes(1);
> +             unsigned char uchar = in.read_u8();
> +
> +                     struct swf_zone_data {
> +                             short float             f_zone_position;
> +                             short float             f_zone_size;
> +                     };
> +                     in.ensureBytes(2);
> +                     short float f_zone_position_now = in.read_u16();
> +                     in.ensureBytes(2);
> +                     short float f_zone_size = in.read_u16();
> +     
> +              in.ensureBytes(1);
> +              unsigned flags2 = in.read_u8(); // 6 bits are resered, 1 for 
> f_zone_y, 1 for f_zone_
> +     
> +//       referencedFont->f_font2_id_ref=;
> +//       referencedFont->f_csm_table_hint=2;
> +//       referencedFont->f_reserved=6;
> +//       referencedFont->f_zones=
> +
> +
> +        in.ensureBytes(1);
> +     unsigned short f_r_y_x = in.read_u8(); // must reference a valid 
> DEFINEFONT3 tag
> +*/   
> +
> +//   boost::uint16_t id = referencedFont->fontID;
> +
> +//   DefineFontAlignZonesTag* ch = new DefineFontAlignZonesTag(m,in);
> +//   m.addControlTag(ch);

It isn't a control tag. It may need to be added to a Font class, maybe
to an existing definition. You will need to do some testing before
implementing it.

> +     LOG_ONCE(log_unimpl(_("*** DefineFontAlignZoneTag")));

Stars again!?

--
The current release of Gnash is 0.8.5
http://www.gnu.org/software/gnash/

Benjamin Wolsey, Software Developer - http://benjaminwolsey.de

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

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