| [1559] | 1 | --- ../dvipng-1.12/dvipng.h 2010-03-17 14:26:02.568367634 +0100 |
|---|
| 2 | +++ /home/jalar/cvs/dvipng/dvipng.h 2010-03-18 08:43:26.383609220 +0100 |
|---|
| 3 | @@ -387,9 +374,9 @@ |
|---|
| 4 | void WriteImage(char*, int); |
|---|
| 5 | void LoadPK(int32_t, register struct char_entry *); |
|---|
| 6 | int32_t SetChar(int32_t); |
|---|
| 7 | -dviunits SetGlyph(int32_t c, int32_t hh,int32_t vv); |
|---|
| 8 | +dviunits SetGlyph(struct char_entry *ptr, int32_t hh,int32_t vv); |
|---|
| 9 | void Gamma(double gamma); |
|---|
| 10 | -int32_t SetVF(int32_t); |
|---|
| 11 | +int32_t SetVF(struct char_entry *ptr); |
|---|
| 12 | int32_t SetRule(int32_t, int32_t, int32_t, int32_t); |
|---|
| 13 | void SetSpecial(char *, int32_t, int32_t); |
|---|
| 14 | void BeginVFMacro(struct font_entry*); |
|---|
| 15 | --- ../dvipng-1.12/draw.c 2010-03-17 14:26:02.373968076 +0100 |
|---|
| 16 | +++ /home/jalar/cvs/dvipng/draw.c 2010-03-17 13:52:14.625364911 +0100 |
|---|
| 17 | @@ -79,9 +79,15 @@ |
|---|
| 18 | |
|---|
| 19 | if (currentfont==NULL) |
|---|
| 20 | Fatal("faulty DVI, trying to set character from null font"); |
|---|
| 21 | - |
|---|
| 22 | - if (c>=0 && c<=LASTFNTCHAR) |
|---|
| 23 | - ptr = currentfont->chr[c]; |
|---|
| 24 | + if (c<0 || c>LASTFNTCHAR) { |
|---|
| 25 | + Warning("glyph index out of range (%d), skipping",c); |
|---|
| 26 | + return(0); |
|---|
| 27 | + } |
|---|
| 28 | + ptr=currentfont->chr[c]; |
|---|
| 29 | + if (ptr==NULL) { |
|---|
| 30 | + Warning("unable to draw glyph %d, skipping",c); |
|---|
| 31 | + return(0); |
|---|
| 32 | + } |
|---|
| 33 | #ifdef DEBUG |
|---|
| 34 | switch (currentfont->type) { |
|---|
| 35 | case FONT_TYPE_VF: DEBUG_PRINT(DEBUG_DVI,("\n VF CHAR:\t")); break; |
|---|
| 36 | @@ -90,15 +96,15 @@ |
|---|
| 37 | case FONT_TYPE_FT: DEBUG_PRINT(DEBUG_DVI,("\n FT CHAR:\t")); break; |
|---|
| 38 | default: DEBUG_PRINT(DEBUG_DVI,("\n NO CHAR:\t")) |
|---|
| 39 | } |
|---|
| 40 | - if (isprint(c)) |
|---|
| 41 | + if (debug & DEBUG_DVI && c>=0 && c<=UCHAR_MAX && isprint(c)) |
|---|
| 42 | DEBUG_PRINT(DEBUG_DVI,("'%c' ",c)); |
|---|
| 43 | DEBUG_PRINT(DEBUG_DVI,("%d at (%d,%d) tfmw %d", c, |
|---|
| 44 | dvi_stack->hh,dvi_stack->vv,ptr?ptr->tfmw:0)); |
|---|
| 45 | #endif |
|---|
| 46 | if (currentfont->type==FONT_TYPE_VF) { |
|---|
| 47 | - return(SetVF(c)); |
|---|
| 48 | + return(SetVF(ptr)); |
|---|
| 49 | } else { |
|---|
| 50 | - if (ptr!=NULL && ptr->data == NULL) |
|---|
| 51 | + if (ptr->data == NULL) |
|---|
| 52 | switch(currentfont->type) { |
|---|
| 53 | case FONT_TYPE_PK: LoadPK(c, ptr); break; |
|---|
| 54 | #ifdef HAVE_LIBT1 |
|---|
| 55 | @@ -111,8 +117,8 @@ |
|---|
| 56 | Fatal("undefined fonttype %d",currentfont->type); |
|---|
| 57 | } |
|---|
| 58 | if (page_imagep != NULL) |
|---|
| 59 | - return(SetGlyph(c, dvi_stack->hh, dvi_stack->vv)); |
|---|
| 60 | - else if (ptr!=NULL) { |
|---|
| 61 | + return(SetGlyph(ptr, dvi_stack->hh, dvi_stack->vv)); |
|---|
| 62 | + else { |
|---|
| 63 | /* Expand bounding box if necessary */ |
|---|
| 64 | min(x_min,dvi_stack->hh - ptr->xOffset/shrinkfactor); |
|---|
| 65 | min(y_min,dvi_stack->vv - ptr->yOffset/shrinkfactor); |
|---|
| 66 | --- ../dvipng-1.12/vf.c 2010-03-17 14:26:02.438184849 +0100 |
|---|
| 67 | +++ /home/jalar/cvs/dvipng/vf.c 2010-03-17 13:52:43.098991873 +0100 |
|---|
| 68 | @@ -27,11 +27,10 @@ |
|---|
| 69 | #define VF_ID 202 |
|---|
| 70 | #define LONG_CHAR 242 |
|---|
| 71 | |
|---|
| 72 | -int32_t SetVF(int32_t c) |
|---|
| 73 | +int32_t SetVF(struct char_entry* ptr) |
|---|
| 74 | { |
|---|
| 75 | struct font_entry* currentvf; |
|---|
| 76 | unsigned char *command,*end; |
|---|
| 77 | - struct char_entry* ptr=currentfont->chr[c]; |
|---|
| 78 | |
|---|
| 79 | currentvf=currentfont; |
|---|
| 80 | BeginVFMacro(currentvf); |
|---|
| 81 | --- ../dvipng-1.12/set.c 2010-03-17 14:26:02.541089281 +0100 |
|---|
| 82 | +++ /home/jalar/cvs/dvipng/set.c 2010-03-17 13:52:26.795955795 +0100 |
|---|
| 83 | @@ -203,23 +202,13 @@ |
|---|
| 84 | } |
|---|
| 85 | } |
|---|
| 86 | |
|---|
| 87 | -dviunits SetGlyph(int32_t c, int32_t hh,int32_t vv) |
|---|
| 88 | +dviunits SetGlyph(struct char_entry *ptr, int32_t hh,int32_t vv) |
|---|
| 89 | /* gdImageChar can only do monochrome glyphs */ |
|---|
| 90 | { |
|---|
| 91 | - register struct char_entry *ptr; |
|---|
| 92 | int dst_alpha,dst_weight,tot_weight,alpha; |
|---|
| 93 | int x,y,pos=0; |
|---|
| 94 | int bgColor,pixelgrey,pixelcolor; |
|---|
| 95 | |
|---|
| 96 | - if (c<0 || c>LASTFNTCHAR) { |
|---|
| 97 | - Warning("glyph index too large (%d), skipping",c); |
|---|
| 98 | - return(0); |
|---|
| 99 | - } |
|---|
| 100 | - ptr=currentfont->chr[c]; |
|---|
| 101 | - if (ptr==NULL) { |
|---|
| 102 | - Warning("unable to draw glyph %d, skipping",c); |
|---|
| 103 | - return(0); |
|---|
| 104 | - } |
|---|
| 105 | hh -= ptr->xOffset/shrinkfactor; |
|---|
| 106 | vv -= ptr->yOffset/shrinkfactor; |
|---|
| 107 | /* Initialize persistent color cache. Perhaps this should be in |
|---|