freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Glyph loading fails with FT_LOAD_NO_HINTING


From: Gustavo J. A. M.
Subject: [Devel] Glyph loading fails with FT_LOAD_NO_HINTING
Date: 24 Jan 2003 16:59:50 +0000

  I'm trying to load glpyh corresponding to charcode 0x2192 from the
font file /mnt/win/windows/Fonts/arial.ttf (yes, a windows font).

  The proble is that I cannot have hinting or grid-fitting or anything
else. I try to use this code to load that glyph:

        error = FT_Load_Char(face, chr, FT_LOAD_NO_HINTING);
        if (error) g_warning("Failed to FT_Load_Char U0%x from font %s", chr,
fname);
        if (!error) {
            error = FT_Get_Glyph(face->glyph, out_glyph);
                if (error) g_warning("Failed to FT_Get_Glyph from font %s", 
fname);
        }

It always fails, even though I *know* the font has that char (it's a
right pointing arrow, if you're wondering).
  Before giving up, I tried to do a simple experiment: remove the load
flag:

-       error = FT_Load_Char(face, chr, FT_LOAD_NO_HINTING);
+       error = FT_Load_Char(face, chr, 0);

Then it worked! However, rendering sucks completely since I'm using a
char size of 1 pixel and scale to the required size. This must be a bug
in freetype (2.1.3); I makes no sense to have a glyph available only if
you specify hinting.

  BTW: the reason I'm doing this way is because I have a font cache
subsystem that keeps a single face in memory, that is a source of glyphs
with any size/transformation possible. Is there an obviously better
alternative for this?

  Thanks in advance.

-- 
Gustavo João Alves Marques Carneiro
<address@hidden> <address@hidden>





reply via email to

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