[softwarelist] Re: Text format in OvPro 2.77

  • From: David Pilling <flist@xxxxxxxxxxxxxxxxxxx>
  • To: davidpilling@xxxxxxxxxxxxx
  • Date: Wed, 4 Jun 2008 21:53:22 +0100

In message <4fa9072a08chris@xxxxxxxxxxxx>, Chris <chris@xxxxxxxxxxxx>
writes
>My understanding of RISC OS font names is as follows:

I thought you might like to see how OP does font weights. Close your
eyes now if easily offended...



static char * italicnames[]=
{
 "Italic",
 "Oblique",
};


#define NITALIC (sizeof(italicnames)/sizeof(char *))



static char * boldnames[]=
{
 "Bold",
/* "Black", */
 "Demi",
 "DemiBold",
};


#define NBOLD (sizeof(boldnames)/sizeof(char *))


static char * normalnames[]=
{
 "Normal",
 "Medium",
 "Regular",
 "Roman",
 "Book",
 "Light",
};



#define NNORM (sizeof(normalnames)/sizeof(char *))



static int italicfont(char * s)
{
 int i;

 for(i=0;i<NITALIC;i++)
 {
  if(!dotcmp(italicnames[i],s)) break;
 }

 return(i<NITALIC);
}


static int boldfont(char *s)
{
 int i;

 for(i=0;i<NBOLD;i++)
 {
  if(!dotcmp(boldnames[i],s)) break;
 }

 return(i<NBOLD);
}

static int normalfont(char *s)
{
 int i;

 for(i=0;i<NNORM;i++)
 {
  if(!dotcmp(normalnames[i],s)) break;
 }

 return(i);
}




-- 
David Pilling
email: david@xxxxxxxxxxxxxxxxxxx
  web: http://www.davidpilling.net
 post: David Pilling P.O. Box 22 Thornton Cleveleys Blackpool. FY5 1LR UK
  fax: +44(0)870-0520-941


To unsubscribe or subscribe goto: //www.freelists.org/list/davidpilling

Other related posts: