i->current_page = i->current_page->next;
}
i->current_page->textsize = 4096;
- i->current_page->text = malloc(i->current_page->textsize);
+ i->current_page->text = (char*)malloc(i->current_page->textsize);
i->current_page->textpos = 0;
i->current_page->next = 0;
i->currentx = 0;
} else if(xshift > i->lastadvance*1.3 || xshift<0) {
addchar(dev, 32);
}
- i->lastadvance = font->glyphs[glyphnr].advance*matrix->m00;
-
- int u = font->glyphs[glyphnr].unicode;
+ int u;
+ if(font) {
+ i->lastadvance = font->glyphs[glyphnr].advance*matrix->m00;
+ u = font->glyphs[glyphnr].unicode;
+ } else {
+ u = glyphnr;
+ i->currentx = 0;i->currenty = 0;
+ }
if(u>13) {
addchar(dev, u);
}
}
-void text_drawlink(gfxdevice_t*dev, gfxline_t*line, char*action)
+void text_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action)
{
internal_t*i = (internal_t*)dev->internal;
}
len += i->textpos;
j = j->next;
}
- char*text = malloc(len);
+ char*text = (char*)malloc(len);
int pos = 0;
j = i;
while(j) {