freetype-devel
[Top][All Lists]
Advanced

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

AW: [Devel] German umlauts with Freetype 2?


From: Patrick Hoffmann
Subject: AW: [Devel] German umlauts with Freetype 2?
Date: Thu, 26 Dec 2002 10:26:14 +0100

Thanx for the reply, Werner. But there is still no positive effect. I've
tried this code...

        FT_Error  e;
        
        FT_Face   face;
        {
                e = FT_New_Face( m_FtLibrary,
                        (m_strFontFilePath + "/" + strFontName +
m_strFontFileExtension).c_str(),
                        0,
                        &face );
                
                if( e )
                        cerr << "SvgaAdaptor::drawText(): Couldn't open
ttf file '" << strFontName << "', code = " << e << endl;
        }
        
        e = FT_Set_Char_Size(
                face,    /* handle to face object           */
                0,       /* char_width in 1/64th of points  */
                nFontHeight*64,   /* char_height in 1/64th of points */
                resolution,     /* horizontal device resolution    */
                resolution);   /* vertical device resolution      */
        
        FT_Select_Charmap(face,ft_encoding_unicode);
        

The rest is mostly copied from the tutorial examples.

-----Ursprüngliche Nachricht-----
Von: Werner LEMBERG [mailto:address@hidden 
Gesendet: Donnerstag, 26. Dezember 2002 04:32
An: address@hidden; address@hidden
Betreff: Re: [Devel] German umlauts with Freetype 2?



> But when I use german umlauts only a square is displayed instead of 
> the right letter. So I may be right if I think this means, that I'm 
> not using the correct character code. But which code should I use? Is 
> there a possibility to change this behaviour with FT_Set_Charmap and 
> FT_Encoding? Does somebody know a solution for this problem?

Normally, TrueType fonts contain a Unicode charmap, and for non-TrueType
fonts, FreeType synthesizes a Unicode charmap if possible.  In Unicode,
the character range 0x00-0xFF is equivalent to Latin-1 (plus control
code range); this means that you have to use e.g. 0xDF as the input
character code for `ß'.  If you use the latest CVS snapshot of Unicode,
a proper Unicode cmap should always be selected by default, but I
recommend to select it explicitly with FT_Set_Charmap.


    Werner




reply via email to

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