Hi Derek!
You recommend me using bitmaps because nearly all qnx-fonts are
delta-hinted. But I have to concentrate on a third-party font in my work,
so it would be nice if I get some kind of alphamap. By the way, I didn’t
expect, the bitmap would be a graymap…I thought that there was a 4-bit
alpha-value stored per pixel.
However, when I use PfRenderCx(): where should be the alphamap there?
Why does this not work? (there’s always invalid argument in PfRenderCx())
void renderGlyph (void *data, const PhPoint_t *pos, const FontRender
*metrics)
{
printf(“renderGlyph()\n”);
printf(“bitmap is of size %dx%d\n”, metrics->size.x, metrics->size.y);
printf(“bpp: %d\n”,metrics->bpp);
}
PtInit (NULL);
if( (fontSvrCtxt = PfAttach(NULL, -1)) == NULL)
{
printf(“PfAttach() failed\n”);
PtExit(EXIT_FAILURE);
}
if(PfGenerateFontName(“Helvetica”,
PF_STYLE_ANTIALIAS,
18,
szFont) == NULL)
return(Pt_CONTINUE);
if(PfRenderCx(fontSvrCtxt,
(void*)“test”,
szFont,
0,
0,
“m”,
strlen(“m”),
0,
&pos,
&clipRect,
renderGlyph)==-1)
{
perror(“PfRenderCx()”);
}
Derek Leach wrote:
mirtch <> mirtschink@xsys.de> > wrote:
Hello everybody!
I try to write some code to display rotated text. To get it work I have to
access the glyph-bitmap (FontRender) returned by PfGlyph(). But the
returned bitmap always returns a non-antialiased glyph (FontRender.bpp =
- although I turned on antialiasing via PF_STYLE_ANTIALIAS while creating
font name.
Anyone familiar with PfGlyph() ?
thanks in advance!
Current versions of the fontserver do not support anti-aliased glyph
fetching.
In reality, it is very unlikely you would be satisified with the results.
Anti-aliasing does the following:
- Affects, or turns off the delta hinting.
- Produces an alpha-map, not a graymap. Therefore the values
within the middle of the range (0x00 0xFF) do not necessarily
end up being the same as a straight graymap.
If you really want the alphamaps, use PfRenderCx. In order to process
an alphamap correctly, you need to read the hardware pixel values in order
to apply the alpha correctly.
I strongly recommend using straight bitmaps for your purpose, especially when
using a delta-hinted/hinted font(s) such as PrimaSans BT (TextFont), Swis721
BT,
basically all the core fonts shipped with Momentics.
Regards.