return ((current.font->hasglyph(current.font,c,0) != 0) ? 3 : 2);
}
-static int charwidth( zword c, int *oh)
+int sf_charwidth( zword c, int *oh)
{
SF_glyph *g; int ww = 0;
- if (c == ZC_INDENT) return (3*charwidth(' ',oh));
- if (c == ZC_GAP) return (2*charwidth(' ',oh));
+ if (c == ZC_INDENT) return (3*sf_charwidth(' ',oh));
+ if (c == ZC_GAP) return (2*sf_charwidth(' ',oh));
*oh = 0;
g = current.font->getglyph(current.font,c,1);
if (g)
int os_char_width(zchar c)
{
int w, oh;
- w = charwidth( c, &oh);
+ w = sf_charwidth( c, &oh);
return (w+oh);
}
os_set_font(*s++);
}
else
- width += charwidth(c,&oh);
+ width += sf_charwidth(c,&oh);
}
sf_poptextsettings();
SF_textsetting * sf_curtextsetting(void);
+/**
+ * Return the advance width of character c.
+ * Store glyph width minus advance width to oh ("overhang").
+ */
+int sf_charwidth( zword c, int *oh);
+
void sf_writeglyph( SF_glyph *g);
void sf_fillrect( unsigned long color, int x, int y, int w, int h);
\r
if (cursor)\r
{\r
- int wid=0, i=0;\r
- while (i<pos) wid += os_char_width(buffer[i++]);\r
+ int wid=0, i=0, oh;\r
+ while (i<pos) wid += sf_charwidth(buffer[i++], &oh);\r
drawthecursor(ptx+wid,pty,1);\r
}\r
\r