[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
char widths
From: |
Lidia Mirkin |
Subject: |
char widths |
Date: |
Tue, 20 Jun 2000 17:40:59 -0600 |
Hello !
I use freetype library in order to extract some information from ttf files
and use it
to embedd ttf file to pdf.
In particular,I need to know char widths.My code is following:
for (i=0;i<n;i++)
{
if (error=TT_Get_CharMap_ID( face, i, &platform, &encoding ))
goto done_face;
if ( (platform == 3 && encoding == 1 ) )
{
TT_Get_CharMap( face, i, &charMap );
break;
}
....
}
...
for (i=0;i<=255;i++)
{
unsigned short char_index=TT_Char_Index( charMap, i );
TT_Get_Face_Metrics( face,
char_index,
char_index,
NULL,
temp,
NULL,
NULL );
font->widths[i]=(int)(temp[0]*scale_factor+0.5);
}
For some fonts (for example , for Tahoma ) TT_Char_Index returns 0 ( unknown
glyph).
for i>125 to 160 and as result , TT_Get_Face_Metrics returns 1000 ( default
width ).
But I did embedding of this font into pfd in FreeHand .
Result is that for 160,161,162 widths are 1000 , but there are some other
values for next entries.
Does somebody know how can I extract these char widths ?
thanks ,Lidia.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- char widths,
Lidia Mirkin <=