freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Freetype] type1 charmaps


From: Detlef Würkner
Subject: Re: [Freetype] type1 charmaps
Date: Tue, 18 Jun 2002 10:22:45 +0200

Sorry for the late answer...

address@hidden wrote:

> Hello,
> 
> When I load a type 1 font with freetype-2.1.0 I can't seem to be able to
> load the glyph index with FT_Get_Char_Index(). Truetype fonts work fine.
> FT_Get_Char_Name() works fine.  Freetype-2.0.9 works fine.
> 
> #include <assert.h>
> #include <stdio.h>
> #include <ft2build.h>
> #include FT_FREETYPE_H
> 
> #define FONT "times.pfb"
> //#define FONT "times.ttf"
> 
> main()
> {
>         FT_Library ftlib;
>         FT_Face ftface;
>         int err;
>         err = FT_Init_FreeType(&ftlib);
>         assert(err == 0 && "init");
>         err = FT_New_Face(ftlib, FONT, 0, &ftface);
>         assert(err == 0 && "newface");
>         err = FT_Set_Char_Size(ftface, 0, 12 * 64, 72, 72);
>         assert(err == 0 && "setcharsize");
>         err = FT_Get_Char_Index(ftface, 'a');
>         printf("glyph index = %d\n", err);
> }

There is no call to FT_Select_Charmap() or FT_Set_Charmap(), and
FT_CONFIG_OPTION_USE_CMAPS is defined. In this case the current drivers
for bdf, pcf, pfr, type1 and fnt dont set the default charmap, and
without that FT_Get_Char_Index() fails.

I've just send a fix to the devel mailing list.

Ciao, Detlef
-- 
_ // address@hidden
\X/  Detlef Wuerkner, Langgoens/Germany



reply via email to

[Prev in Thread] Current Thread [Next in Thread]