+void text_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix)
+{
+ internal_t*i = (internal_t*)dev->internal;
+ double xshift = matrix->tx - i->currentx;
+ double yshift = matrix->ty - i->currenty;
+ i->currentx = matrix->tx;
+ i->currenty = matrix->ty;
+
+ if(fabs(yshift)>1.0) {
+ addchar(dev, 10);
+ } else if(xshift > i->lastadvance*1.3 || xshift<0) {
+ addchar(dev, 32);
+ }
+ 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, const char*action)