[prev in list] [next in list] [prev in thread] [next in thread]
List: freetype
Subject: [Freetype] =?gb2312?B?tPC4tDogW0ZyZWV0eXBlXSBBIHF1ZXN0aW9uIGFib3V0IGZvbnQg?=
From: <wangyi () founder ! com ! cn>
Date: 2001-07-16 2:33:11
[Download RAW message or body]
Werner:
Now I use ftc_image_flag_no_sbits to avoid this problem because
sfnt->load_sbit_image won't be called any more. And which kind of input file
do you want? A picture or a data file or a EXE file? I think the behaviour
is very simple and I stated it clearly.
Now I have another very serious question about embedded font of PDF. I list
some examples as below and hope you can give me an answer, thanks.
In these examples, I use the same way to display characters used embedded
font as common font file, except FT_New_Memory_Face() function is called
instead of FT_New_Face() function.
(1)About Embedded Type1 Font
After initialized the font face through FT_New_Memory_Face() function, I
called FT_Get_Char_Index() function to get the glyph
index(m_ftFace->charmap->encoding = ft_encoding_unicode). I found that
sometimes I got the correct index but sometimes I got the wrong index:
when uCode = 0x21, FT_Get_Char_Index() return 1, correct.
when uCode = 0x22, FT_Get_Char_Index() return 2, correct.
......
when uCode = 0x26, FT_Get_Char_Index() return 6, correct.
when uCode = 0x27, FT_Get_Char_Index() return 0, wrong!
I debugged it and found the return value depended on an array --
names_to_unicode[](in pstables.h). Can you tell me why the array is defined
as below:
static const unsigned short names_to_unicode[1033] =
{
0,
0x0020,
0x0021,
0x0022,
0x0023,
0x0024,
0x0025,
0x0026,
0x2019,(--??????)
0x0028,
...
}
(2)About Embedded TrueType Font
When displaying a character with embedded truetype font which use built-in
encoding in PDF, I find that the font face's charmap is NULL. In fact, the
font face has two charmaps, one's encoding is ft_encoding_apple_roman, the
other is ft_encoding_symbol. Because there is no ft_encoding_unicode, the
font face's charmap is set to NULL.
So I can't use FT_Get_Char_Index() funtion to get the glyph index, please
tell me how to solve this problem, thanks very much.
Jacky/2001/7/16
> When the font size is under 15 point, the glyph that I got through
> FTC_Image_Cache_Lookup() function is to be a black square. And when I
> zoom in the font size, the glyph that I got is ok.
This looks like a bug. May I ask that you provide a very simple input file
which shows the incorrect behaviour?
BTW, it may took a while until this is fixed since we all deserve some
vacation...
Werner
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>΄πΈ΄: [Freetype] A question about font effect</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Werner:</FONT>
</P>
<P><FONT SIZE=2>Now I use ftc_image_flag_no_sbits to avoid this problem because \
sfnt->load_sbit_image won't be called any more. And which kind of input file do \
you want? A picture or a data file or a EXE file? I think the behaviour is very \
simple and I stated it clearly.</FONT></P>
<P><FONT SIZE=2>Now I have another very serious question about embedded font of PDF. \
I list some examples as below and hope you can give me an answer, thanks.</FONT></P>
<P><FONT SIZE=2>In these examples, I use the same way to display characters used \
embedded font as common font file, except FT_New_Memory_Face() function is called \
instead of FT_New_Face() function.</FONT></P>
<P><FONT SIZE=2>(1)About Embedded Type1 Font</FONT>
<BR><FONT SIZE=2>After initialized the font face through FT_New_Memory_Face() \
function, I called FT_Get_Char_Index() function to get the glyph \
index(m_ftFace->charmap->encoding = ft_encoding_unicode). I found that \
sometimes I got the correct index but sometimes I got the wrong index:</FONT></P>
<P><FONT SIZE=2> when uCode = 0x21, \
FT_Get_Char_Index() return 1, correct.</FONT> <BR><FONT \
SIZE=2> when uCode = 0x22, \
FT_Get_Char_Index() return 2, correct.</FONT> <BR><FONT \
SIZE=2> ......</FONT> <BR><FONT \
SIZE=2> when uCode = 0x26, \
FT_Get_Char_Index() return 6, correct.</FONT> <BR><FONT \
SIZE=2> when uCode = 0x27, \
FT_Get_Char_Index() return 0, wrong!</FONT> </P>
<P><FONT SIZE=2>I debugged it and found the return value depended on an array -- \
names_to_unicode[](in pstables.h). Can you tell me why the array is defined as \
below:</FONT></P>
<P><FONT SIZE=2>static const unsigned short names_to_unicode[1033] =</FONT>
<BR><FONT SIZE=2>{</FONT>
<BR><FONT SIZE=2> 0,</FONT>
<BR><FONT SIZE=2> 0x0020,</FONT>
<BR><FONT SIZE=2> 0x0021,</FONT>
<BR><FONT SIZE=2> 0x0022,</FONT>
<BR><FONT SIZE=2> 0x0023,</FONT>
<BR><FONT SIZE=2> 0x0024,</FONT>
<BR><FONT SIZE=2> 0x0025,</FONT>
<BR><FONT SIZE=2> 0x0026,</FONT>
<BR><FONT SIZE=2> 0x2019,(--??????)</FONT>
<BR><FONT SIZE=2> 0x0028,</FONT>
<BR><FONT SIZE=2> ...</FONT>
<BR><FONT SIZE=2>}</FONT>
</P>
<P><FONT SIZE=2>(2)About Embedded TrueType Font</FONT>
<BR><FONT SIZE=2>When displaying a character with embedded truetype font which use \
built-in encoding in PDF, I find that the font face's charmap is NULL. In fact, the \
font face has two charmaps, one's encoding is ft_encoding_apple_roman, the other is \
ft_encoding_symbol. Because there is no ft_encoding_unicode, the font face's charmap \
is set to NULL.</FONT></P>
<P><FONT SIZE=2>So I can't use FT_Get_Char_Index() funtion to get the glyph index, \
please tell me how to solve this problem, thanks very much.</FONT></P>
<P><FONT SIZE=2>Jacky/2001/7/16</FONT>
</P>
<P><FONT SIZE=2>> When the font size is under 15 point, the glyph that I got \
through</FONT> <BR><FONT SIZE=2>> FTC_Image_Cache_Lookup() function is to be a \
black square. And when I </FONT> <BR><FONT SIZE=2>> zoom in the font size, the \
glyph that I got is ok.</FONT> </P>
<P><FONT SIZE=2>This looks like a bug. May I ask that you provide a very simple \
input file which shows the incorrect behaviour?</FONT> </P>
<P><FONT SIZE=2>BTW, it may took a while until this is fixed since we all deserve \
some vacation...</FONT> </P>
<BR>
<P><FONT SIZE=2> Werner</FONT>
</P>
</BODY>
</HTML>
_______________________________________________
Freetype mailing list
Freetype@freetype.org
http://www.freetype.org/mailman/listinfo/freetype
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic