Subject: AW: microwindows font size
From: "Schmitz, Wilfried" <[email-masked]>
To: "Greg Haerr" <[email-masked]>
Date: Tue, 22 Sep 2009 11:30:46 +0200

Hi.
 
I changed the "gen_gettextbits" in genfont.c to display 26x24 fonts. This routine works fine for me now.
 
void
gen_gettextbits(PMWFONT pfont, int ch, const MWIMAGEBITS **retmap,
 MWCOORD *pwidth, MWCOORD *pheight, MWCOORD *pbase)
{
 PMWCFONT  pf = ((PMWCOREFONT)pfont)->cfont;
 int    count, width;
 const MWIMAGEBITS * bits;
 
 /* if char not in font, map to first character by default*/
 if(ch < pf->firstchar || ch >= pf->firstchar+pf->size)
  ch = pf->firstchar;
 
 ch -= pf->firstchar;
 
 /* get font bitmap depending on fixed pitch or not*/
 width = pf->width ? pf->width[ch] : pf->maxwidth;
 bits = pf->bits + (pf->offset? pf->offset[ch]: (pf->height * ch) * MWIMAGE_WORDS(width));
 count = MWIMAGE_WORDS(width) * pf->height; 
 
 *retmap = bits;
 
 /* return width depending on fixed pitch or not*/
 *pwidth = width; 
 *pheight = pf->height;
 *pbase = pf->ascent; 
}

I didn´t post it to the list, because the list is for nano-x, and i didn´t use nano-x.
 
Regards
Wilfried

-----Ursprüngliche Nachricht-----
Von: Greg Haerr [mailto:[email-masked]]
Gesendet: Sonntag, 20. September 2009 19:41
An: Schmitz, Wilfried
Betreff: Re: microwindows font size

Wilfried,
 
Please also post to the list so others can learn.
 
The code that handles most of what you're dealing with is 
src/drivers/genfont.c, take a look there.  The MWCFONT struct
contains the values for the font.  I'm not sure what the problem
is with the y-calc, are you talking about baseline considerations?
The baseline (ascent) of the font needs to be specified in the struct
for microwindows' internal font list.
 
Let me know if you find a bug, I'd like a patch if required!
 
Regards,
 
Greg

----- Original Message ----- 
From: Schmitz, Wilfried <mailto:[email-masked]>  
To: Greg Haerr <mailto:[email-masked]>  
Sent: Monday, September 14, 2009 9:06 AM
Subject: AW: microwindows font size

Hi.
 
Thanks for your quick answer.
I have now created a font 26x24 and inserted it into the microwindows source code. But there seemed to be a bug in the offset calculation for the font. The x-dirction of the font looks fine, but the starting point (y-direction) is wrong. Could you tell me where to look in the microwindows sourcecode, where the pointer to the array is calculated and how i can manipulate the calculation to work like expected? Thanks in advance for your help.
 
Best regards
Wilfried

-----Ursprüngliche Nachricht-----
Von: Greg Haerr [mailto:[email-masked]]
Gesendet: Mittwoch, 9. September 2009 18:34
An: Schmitz, Wilfried
Betreff: Re: microwindows font size

Yes, I think this should be possible.  There is a height limitation,
which can be changed, but I think its currently set to 16 .
 
Regards,
 
Greg

----- Original Message ----- 
From: Schmitz, Wilfried <mailto:[email-masked]>  
To: [email-masked] 
Sent: Wednesday, September 09, 2009 8:18 AM
Subject: microwindows font size

Hi.
 
I´m sorry to ask you directly, but i couln´t find an answer on the net.
Is it possibel to use a font (in genfont.c) which has a size of  16x32 ?
I was asked to change an old Microwindows (no NanoX) project and i´m not familiar with Microwindows.
Thanks in advance for your help.
 
Best regards
Wilfried Schmitz