[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Devel] FT_Set_Hint_Flags problem
From: |
Owen Taylor |
Subject: |
Re: [Devel] FT_Set_Hint_Flags problem |
Date: |
30 Apr 2003 11:34:13 -0400 |
On Tue, 2003-04-29 at 12:14, Werner LEMBERG wrote:
> > Would you be interested if we provided in FT2 an API similar to what
> > FT1 does and the code you ported from there to Pango? I was
> > thinking about performing the following:
> >
> > - providing an API similar to what FT1 provides to manage
> > OpenType Layout tables. This assumes you didn't make too many
> > changes to the code when "porting" it to Pango + FreeType
> > internals.
>
> It depends on how much work this is. FT1's OpenType interface is far
> from being elegant IMHO. Actually, I've never looked into Pango's
> code so I don't know how it is used -- Owen, can you describe what
> interface you need? Have you ever done a comparison with ICU? I
> believe that ICU is really up to date with its OpenType
> implementation (since Eric Mader still works on it) contrary to FT1's
> OpenType stuff which is dormant.
I've attached the semi-public interfaces in Pango to the mail, as you'll
see, it's pretty high level and simple; no details of the OpenType
tables are exported other than the script/language/feature hierarchy.
While a little more abstract (and pango-like) than what you had,
the basic operation:
void pango_ot_ruleset_shape (PangoOTRuleset *ruleset,
PangoGlyphString *glyphs,
gulong *properties);
Works pretty similarly to:
TT_GSUB/GPOS_Apply_String
Which it wraps. I suspect that you could put the PangoOT stuff over
a pretty broad range of different internal interfaces; but it's also
only semi-public - you have to define PANGO_ENABLE_ENGINE to use
it and there no guarantees of compatibility between 1.2/1.4/etc.
So, it could be changed if necessary.
(The use of OpenType in Pango still isn't broad enough to make me
confident that we have the final needs nailed; we do Arabic and
Indic scripts; the Indic scripts test quite a bit of the code, but
there might be different things coming up for dealing with
mark placement for, say, Hebrew, or for the more "typographic"
features.)
I haven't ever studied the OpenType interfaces in ICU in detail;
in general, I think that the freetype1 code worked OK for the port of
the Indic OpenType code from ICU to Pango that Eric did; there were
some bugs that weren't terribly easy to track down, but no major
missing pieces.
One major difference between ICU and the freetype1 code internally
is that ICU apparently does the table parsing on-demand; that may
be a fairly big win if you have a large font with many OpenType
features, only a few of that are needed at once.
Regards,
Owen
typedef guint32 PangoOTTag;
typedef struct _PangoOTInfo PangoOTInfo;
typedef struct _PangoOTRuleset PangoOTRuleset;
typedef enum
{
PANGO_OT_TABLE_GSUB,
PANGO_OT_TABLE_GPOS
} PangoOTTableType;
PangoOTInfo *pango_ot_info_get (FT_Face face);
gboolean pango_ot_info_find_script (PangoOTInfo *info,
PangoOTTableType table_type,
PangoOTTag script_tag,
guint *script_index);
gboolean pango_ot_info_find_language (PangoOTInfo *info,
PangoOTTableType table_type,
guint script_index,
PangoOTTag language_tag,
guint *language_index,
guint *required_feature_index);
gboolean pango_ot_info_find_feature (PangoOTInfo *info,
PangoOTTableType table_type,
PangoOTTag feature_tag,
guint script_index,
guint language_index,
guint *feature_index);
PangoOTTag *pango_ot_info_list_scripts (PangoOTInfo *info,
PangoOTTableType table_type);
PangoOTTag *pango_ot_info_list_languages (PangoOTInfo *info,
PangoOTTableType table_type,
guint script_index,
PangoOTTag language_tag);
PangoOTTag *pango_ot_info_list_features (PangoOTInfo *info,
PangoOTTableType table_type,
PangoOTTag tag,
guint script_index,
guint language_index);
PangoOTRuleset *pango_ot_ruleset_new (PangoOTInfo *info);
void pango_ot_ruleset_add_feature (PangoOTRuleset *ruleset,
PangoOTTableType table_type,
guint feature_index,
gulong property_bit);
void pango_ot_ruleset_shape (PangoOTRuleset *ruleset,
PangoGlyphString *glyphs,
gulong *properties);