ref: 03f06f0f08f1ad864261a5e5644862ef654506d4
parent: 51ecb69a88e232223050aa3c6fceff97300cfb24
author: Werner Lemberg <[email protected]>
date: Sat Nov 15 12:44:13 EST 2003
* src/bdf/bdfdrivr.c (bdf_interpret_style), src/pcf/pcfread.c (pcf_interpret_style): Replace spaces with dashes in properties SETWIDTH_NAME and ADD_STYLE_NAME to simplify parsing.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-11-13 John A. Boyd Jr. <[email protected]>
+
+ * src/bdf/bdfdrivr.c (bdf_interpret_style), src/pcf/pcfread.c
+ (pcf_interpret_style): Replace spaces with dashes in properties
+ SETWIDTH_NAME and ADD_STYLE_NAME to simplify parsing.
+
2003-11-11 Werner Lemberg <[email protected]>
* docs/CHANGES: Updated.
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -238,7 +238,8 @@
face->style_name = (char *)"Regular";
else
{
- char *style, *s;
+ char *style, *s;
+ unsigned int i;
if ( FT_ALLOC( style, len + parts ) )
@@ -248,8 +249,10 @@
if ( astr )
{
- ft_strcpy( s, astr);
- s += ft_strlen( astr );
+ ft_strcpy( s, astr );
+ for ( i = 0; i < ft_strlen( astr ); i++, s++ )
+ if ( *s == ' ' )
+ *s = '-'; /* replace spaces with dashes */
*(s++) = ' ';
}
if ( bstr )
@@ -267,7 +270,9 @@
if ( sstr )
{
ft_strcpy( s, sstr );
- s += ft_strlen( sstr );
+ for ( i = 0; i < ft_strlen( sstr ); i++, s++ )
+ if ( *s == ' ' )
+ *s = '-'; /* replace spaces with dashes */
*(s++) = ' ';
}
*(--s) = '\0'; /* overwrite last ' ', terminate the string */
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -926,7 +926,8 @@
face->style_name = (char *)"Regular";
else
{
- char *style, *s;
+ char *style, *s;
+ unsigned int i;
if ( FT_ALLOC( style, len + parts ) )
@@ -937,7 +938,9 @@
if ( astr )
{
ft_strcpy( s, astr );
- s += ft_strlen( astr );
+ for ( i = 0; i < ft_strlen( astr ); i++, s++ )
+ if ( *s == ' ' )
+ *s = '-'; /* replace spaces with dashes */
*(s++) = ' ';
}
if ( bstr )
@@ -955,7 +958,9 @@
if ( sstr )
{
ft_strcpy( s, sstr );
- s += ft_strlen( sstr );
+ for ( i = 0; i < ft_strlen( sstr ); i++, s++ )
+ if ( *s == ' ' )
+ *s = '-'; /* replace spaces with dashes */
*(s++) = ' ';
}
*(--s) = '\0'; /* overwrite last ' ', terminate the string */