freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Difference between Get_Class and Get new class: More info


From: 786
Subject: [Devel] Difference between Get_Class and Get new class: More info
Date: Sat, 12 Jun 2004 08:43:43 +0500

Hello again

Thanks for the info but this did not really help. Let me explain this with a
small example.

Lets say I want to know the type of glyph# 836.

First the TT_GDEF_Get_Property() calls Get_class(...)
In get_class we have
            new_max = cdf2->ClassRangeCount - 1; lets say this is 4 and
ranges defined are
        3-46
        824-824
        826-835
        846-861
Now 836 is not in any of the range, Get class returns an error_not_covered
message with index =2.

At this point Get_New_class(...) is called. It some how finds the glyph 836,
can you explain how, and after calculating bits/byte it returns 1. But guess
what, 836 is a mark and it 'should' return 3. ??? If I could understand the
logic behind the ngc (for new glyph class) then maybe I could figure a way
out. I am doing all this using pango and gedit.

I am really stuck, please help.

Aamir

                

-----Original Message-----
From: Werner LEMBERG [mailto:address@hidden 
Sent: Wednesday, June 09, 2004 6:49 PM
To: address@hidden; 786
Subject: Re: [Devel] Difference between Get_Class and Get new class


> In ftxgdef.c, what is the difference between the call to function
> Get_Class and Get new class? I have done a little bit of debugging
> and Get_class always returns a 0 for simple or mark glyph type.  And
> it is then Get new class func that (always) returns simple i.e. 1.
> Can you help?

>From apirefx.txt:

    TT_GDEF_Get_Glyph_Property:

      [...]  Some fonts need GDEF-like data even if no GDEF table is
      provided (for example, the Arabic script needs information which
      glyphs are base glyphs and which are mark glyphs).  In such
      cases, you should use TT_GDEF_Build_ClassDefinition() to build
      the necessary structures so that TT_GDEF_Get_Property() returns
      meaningful values.  [...]

    TT_GDEF_Build_ClassDefinition:
      Fills a `gdef' structure with data to make
      TT_GDEF_Get_Property() work in case no GDEF table is available.
      `num_glyphs' is the number of glyphs in the font.  [...]

      See `arabic.c' for an example.

Get_Class() is for real GDEF tables, while Get_New_Class() handles
constructed ones.  Older Arabic OpenType fonts expect some extra logic
within the operating system (Windows 95 or so) which today's font
should normally have built-in.


    Werner

_______________________________________________
Devel mailing list
address@hidden
http://www.freetype.org/mailman/listinfo/devel



reply via email to

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