home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Elysian Archive
/
AmigaElysianArchive.iso
/
wp_dtp
/
atap.lha
/
ATAP
/
SourceCode
/
FindBaseName.c
< prev
next >
Wrap
Text File
|
1992-06-13
|
941b
|
35 lines
char *FindBaseName(char *typefaceName)
/* This pulls out a base family name from a typeface name.
This works on Adobe's principle of typeface naming with
dash marks; "AvantGarde-Demi" and "AvantGarde-Oblique"
for example, belong to the family "AvantGarde". Also,
"Helvetica" and "Helvetica-Black" belong to "Helvetica".
Since there can be multiple hyphens in a typeface name,
like "Helvetica-Condensed-Oblique", the last hyphen is
considered and this function would return "Helvetica-Condensed".
Get the string using strcpy(). */
{
static char baseName[68];
static int index,strLength,hyphenLoc;
strLength=strlen(typefaceName);
hyphenLoc=0;
for (index=0;index<=strLength;index++)
{
if (typefaceName[index]=='-')
hyphenLoc=index;
}
if (hyphenLoc==0)
hyphenLoc=strLength;
for (index=0;index<hyphenLoc;index++)
baseName[index]=typefaceName[index];
baseName[hyphenLoc]=0;
return(baseName);
};