Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 23, 2026

Diff for cpdf/svga.c between version 1.3 and 1.4

version 1.3, 2002/11/30 19:38:09 version 1.4, 2002/12/19 00:16:44
Line 7 
Line 7 
   
 #include "parse.h"  #include "parse.h"
 #include "cpdf.h"  #include "cpdf.h"
   #include "svga.h"
 #include "filter.h"  #include "filter.h"
   
   void text(char *start,char *end)
   {
   char *tj;
   int x = 10,y = 10;
   tj = strstr(start,"TJ") - 1;
   if(*tj == ']')
           while(*tj != '[') tj--;
   while(tj != start) {
           if(*tj == '(')
                   for(tj++; *tj != ')';tj++) {
                           gl_writen(x,y,sizeof(char),tj);
                   x += 10;
                   if(x == screen.x - 10) {
                           x = 10;
                           y += 10;
                   }
                   if(y == screen.y - 10)
                           y = 10;
                   }
   tj++;
   }
   return;
   }
   
 void render(void)  void render(void)
 {  {
         char *content,*txtstart,*txtend;          char *content,*txtstart,*txtend;
         struct page *page;          struct page *page;
         int x = 10,y = 10;  
 /*      fill_page(page_tree[current_page]);*/  
 /*      page = object[page_tree[current_page]]->parsed;*/  
         page = (struct page *) get_object(page_tree[current_page],NULL);          page = (struct page *) get_object(page_tree[current_page],NULL);
         content = (char *) calloc(100000,1);          txtstart = content = (char *) calloc(100000,1);
   #ifndef DEBUG
         gl_setfont(8, 8, gl_font8x8);          gl_setfont(8, 8, gl_font8x8);
         gl_setwritemode(FONT_COMPRESSED + WRITEMODE_OVERWRITE);          gl_setwritemode(FONT_COMPRESSED + WRITEMODE_OVERWRITE);
         gl_setfontcolors(0xFFFFFFFF, 0);          gl_setfontcolors(0xFFFFFFFF, 0);
   #endif
         filter(page->contents->filter,page->contents->stream,          filter(page->contents->filter,page->contents->stream,
                 page->contents->length,content,100000);                  page->contents->length,content,100000);
         txtend = content + 1500;          write(2,content,1500);
         for(txtstart = content;txtstart < txtend;txtstart++) {          for(txtend = content;txtend != content + 1500; txtend++)
                 if(*txtstart == '\0')                          if(*txtend == '\0')
                         continue;                                  *txtend = 'A';
                 while(*txtstart != '(') txtstart++;          while((txtstart = strstr(txtstart + 1,"BT")) != NULL) {
                 txtstart++;                  txtend = strstr(txtstart,"ET");
                 while(*txtstart != ')') {                  text(txtstart,txtend);
                         gl_writen(x,y,sizeof(char),txtstart);                  txtstart = txtend;
                         x += 10;  
                         if(x % 790 == 0) {  
                                 y += 10;  
                                 x = 10;  
                         }  
                         if(y % 590 == 0)  
                                 y = 10;  
                         txtstart++;  
                 gl_copyscreen(physicalscreen);  
                 usleep(1000);  
                 }  
         }          }
 /*                              }  #ifndef DEBUG
         }*/          gl_copyscreen(physicalscreen);
         sleep(30);  #endif
           getchar();
         exit(0);          exit(0);
 }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top