* 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
diff --git a/ChangeLog b/ChangeLog
index deed6a0..0269948 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-11-13 John A. Boyd Jr. <jaboydjr@netwalk.com>
+
+ * 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 <wl@gnu.org>
* docs/CHANGES: Updated.
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index 03dc8d3..3e57c34 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -238,7 +238,8 @@ THE SOFTWARE.
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 @@ THE SOFTWARE.
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 @@ THE SOFTWARE.
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 */
diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
index e2deab3..fcf3628 100644
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -926,7 +926,8 @@ THE SOFTWARE.
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 @@ THE SOFTWARE.
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 @@ THE SOFTWARE.
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 */