PsPrint( buffer );
PsPrint( "(" );
- size_t len = strlen(textbuf);
- size_t i;
- for (i = 0; i < len; i++)
+ for ( const char *p = textbuf; *p != '\0'; p++ )
{
- int c = (unsigned char) textbuf[i];
+ int c = (unsigned char)*p;
if (c == ')' || c == '(' || c == '\\')
{
/* Cope with special characters */
PsPrint( "(" );
const wxWX2MBbuf textbuf = text.mb_str();
- size_t len = strlen(textbuf);
- size_t i;
- for (i = 0; i < len; i++)
+ if ( textbuf )
{
- int c = (unsigned char) textbuf[i];
- if (c == ')' || c == '(' || c == '\\')
+ for ( const char *p = textbuf; *p != '\0'; p++ )
{
- /* Cope with special characters */
- PsPrint( "\\" );
- PsPrint( (char) c );
- }
- else if ( c >= 128 )
- {
- /* Cope with character codes > 127 */
- buffer.Printf( "\\%o", c);
- PsPrint( buffer );
- }
- else
- {
- PsPrint( (char) c );
+ int c = (unsigned char)*p;
+ if (c == ')' || c == '(' || c == '\\')
+ {
+ /* Cope with special characters */
+ PsPrint( "\\" );
+ PsPrint( (char) c );
+ }
+ else if ( c >= 128 )
+ {
+ /* Cope with character codes > 127 */
+ buffer.Printf( "\\%o", c);
+ PsPrint( buffer );
+ }
+ else
+ {
+ PsPrint( (char) c );
+ }
}
}
/ these values from AFM files, too. Maybe later ... */
// NB: casts to int are needed to suppress gcc 3.3 warnings
- lastWidths[196] = lastWidths[(int)'A']; // Ä
- lastWidths[228] = lastWidths[(int)'a']; // ä
- lastWidths[214] = lastWidths[(int)'O']; // Ö
- lastWidths[246] = lastWidths[(int)'o']; // ö
- lastWidths[220] = lastWidths[(int)'U']; // Ü
- lastWidths[252] = lastWidths[(int)'u']; // ü
- lastWidths[223] = lastWidths[(int)251]; // ß
+ lastWidths[196] = lastWidths[(int)'A']; // U+00C4 A Umlaute
+ lastWidths[228] = lastWidths[(int)'a']; // U+00E4 a Umlaute
+ lastWidths[214] = lastWidths[(int)'O']; // U+00D6 O Umlaute
+ lastWidths[246] = lastWidths[(int)'o']; // U+00F6 o Umlaute
+ lastWidths[220] = lastWidths[(int)'U']; // U+00DC U Umlaute
+ lastWidths[252] = lastWidths[(int)'u']; // U+00FC u Umlaute
+ lastWidths[223] = lastWidths[(int)251]; // U+00DF eszett (scharfes s)
/* JC: calculate UnderlineThickness/UnderlinePosition */