f7086ca9f432d2f720809669557aa76831bf8ad5 tdreszer Wed Nov 23 14:54:25 2011 -0800 New calculation for squeezed label height diff --git src/lib/common.c src/lib/common.c index 8b513e0..b47f76c 100644 --- src/lib/common.c +++ src/lib/common.c @@ -1669,30 +1669,42 @@ if (c == stripFirst) { if (startsWith(strip, in)) { in += stripSize; continue; } } *out = c; ++out; ++in; } *out = 0; } +int countCase(char *s,boolean upper) +// Count letters with case (upper or lower) +{ +char a; +int count = 0; +while ((a = *s++) != 0) + if (( upper && isupper(a)) + || (!upper && islower(a))) + ++count; +return count; +} + int countChars(char *s, char c) /* Return number of characters c in string s. */ { char a; int count = 0; while ((a = *s++) != 0) if (a == c) ++count; return count; } int countCharsN(char *s, char c, int size) /* Return number of characters c in string s of given size. */ { int i;